repoburg 1.3.257 → 1.3.259

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.
@@ -0,0 +1,498 @@
1
+ var py=Object.defineProperty;var hy=(n,s,r)=>s in n?py(n,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[s]=r;var ot=(n,s,r)=>hy(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 ym(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var qc={exports:{}},qi={},Kc={exports:{}},Ve={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Lp;function my(){if(Lp)return Ve;Lp=1;var n=Symbol.for("react.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),k=Symbol.iterator;function y(b){return b===null||typeof b!="object"?null:(b=k&&b[k]||b["@@iterator"],typeof b=="function"?b:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function T(b,A,ee){this.props=b,this.context=A,this.refs=E,this.updater=ee||N}T.prototype.isReactComponent={},T.prototype.setState=function(b,A){if(typeof b!="object"&&typeof b!="function"&&b!=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,b,A,"setState")},T.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function M(){}M.prototype=T.prototype;function I(b,A,ee){this.props=b,this.context=A,this.refs=E,this.updater=ee||N}var B=I.prototype=new M;B.constructor=I,_(B,T.prototype),B.isPureReactComponent=!0;var O=Array.isArray,W=Object.prototype.hasOwnProperty,q={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function G(b,A,ee){var ue,me={},xe=null,ze=null;if(A!=null)for(ue in A.ref!==void 0&&(ze=A.ref),A.key!==void 0&&(xe=""+A.key),A)W.call(A,ue)&&!K.hasOwnProperty(ue)&&(me[ue]=A[ue]);var _e=arguments.length-2;if(_e===1)me.children=ee;else if(1<_e){for(var Ee=Array(_e),Te=0;Te<_e;Te++)Ee[Te]=arguments[Te+2];me.children=Ee}if(b&&b.defaultProps)for(ue in _e=b.defaultProps,_e)me[ue]===void 0&&(me[ue]=_e[ue]);return{$$typeof:n,type:b,key:xe,ref:ze,props:me,_owner:q.current}}function ae(b,A){return{$$typeof:n,type:b.type,key:A,ref:b.ref,props:b.props,_owner:b._owner}}function de(b){return typeof b=="object"&&b!==null&&b.$$typeof===n}function oe(b){var A={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(ee){return A[ee]})}var ke=/\/+/g;function Ne(b,A){return typeof b=="object"&&b!==null&&b.key!=null?oe(""+b.key):A.toString(36)}function Fe(b,A,ee,ue,me){var xe=typeof b;(xe==="undefined"||xe==="boolean")&&(b=null);var ze=!1;if(b===null)ze=!0;else switch(xe){case"string":case"number":ze=!0;break;case"object":switch(b.$$typeof){case n:case s:ze=!0}}if(ze)return ze=b,me=me(ze),b=ue===""?"."+Ne(ze,0):ue,O(me)?(ee="",b!=null&&(ee=b.replace(ke,"$&/")+"/"),Fe(me,A,ee,"",function(Te){return Te})):me!=null&&(de(me)&&(me=ae(me,ee+(!me.key||ze&&ze.key===me.key?"":(""+me.key).replace(ke,"$&/")+"/")+b)),A.push(me)),1;if(ze=0,ue=ue===""?".":ue+":",O(b))for(var _e=0;_e<b.length;_e++){xe=b[_e];var Ee=ue+Ne(xe,_e);ze+=Fe(xe,A,ee,Ee,me)}else if(Ee=y(b),typeof Ee=="function")for(b=Ee.call(b),_e=0;!(xe=b.next()).done;)xe=xe.value,Ee=ue+Ne(xe,_e++),ze+=Fe(xe,A,ee,Ee,me);else if(xe==="object")throw A=String(b),Error("Objects are not valid as a React child (found: "+(A==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":A)+"). If you meant to render a collection of children, use an array instead.");return ze}function Q(b,A,ee){if(b==null)return b;var ue=[],me=0;return Fe(b,ue,"","",function(xe){return A.call(ee,xe,me++)}),ue}function se(b){if(b._status===-1){var A=b._result;A=A(),A.then(function(ee){(b._status===0||b._status===-1)&&(b._status=1,b._result=ee)},function(ee){(b._status===0||b._status===-1)&&(b._status=2,b._result=ee)}),b._status===-1&&(b._status=0,b._result=A)}if(b._status===1)return b._result.default;throw b._result}var ce={current:null},P={transition:null},J={ReactCurrentDispatcher:ce,ReactCurrentBatchConfig:P,ReactCurrentOwner:q};function H(){throw Error("act(...) is not supported in production builds of React.")}return Ve.Children={map:Q,forEach:function(b,A,ee){Q(b,function(){A.apply(this,arguments)},ee)},count:function(b){var A=0;return Q(b,function(){A++}),A},toArray:function(b){return Q(b,function(A){return A})||[]},only:function(b){if(!de(b))throw Error("React.Children.only expected to receive a single React element child.");return b}},Ve.Component=T,Ve.Fragment=r,Ve.Profiler=a,Ve.PureComponent=I,Ve.StrictMode=o,Ve.Suspense=m,Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,Ve.act=H,Ve.cloneElement=function(b,A,ee){if(b==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+b+".");var ue=_({},b.props),me=b.key,xe=b.ref,ze=b._owner;if(A!=null){if(A.ref!==void 0&&(xe=A.ref,ze=q.current),A.key!==void 0&&(me=""+A.key),b.type&&b.type.defaultProps)var _e=b.type.defaultProps;for(Ee in A)W.call(A,Ee)&&!K.hasOwnProperty(Ee)&&(ue[Ee]=A[Ee]===void 0&&_e!==void 0?_e[Ee]:A[Ee])}var Ee=arguments.length-2;if(Ee===1)ue.children=ee;else if(1<Ee){_e=Array(Ee);for(var Te=0;Te<Ee;Te++)_e[Te]=arguments[Te+2];ue.children=_e}return{$$typeof:n,type:b.type,key:me,ref:xe,props:ue,_owner:ze}},Ve.createContext=function(b){return b={$$typeof:f,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},b.Provider={$$typeof:u,_context:b},b.Consumer=b},Ve.createElement=G,Ve.createFactory=function(b){var A=G.bind(null,b);return A.type=b,A},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(b){return{$$typeof:h,render:b}},Ve.isValidElement=de,Ve.lazy=function(b){return{$$typeof:x,_payload:{_status:-1,_result:b},_init:se}},Ve.memo=function(b,A){return{$$typeof:g,type:b,compare:A===void 0?null:A}},Ve.startTransition=function(b){var A=P.transition;P.transition={};try{b()}finally{P.transition=A}},Ve.unstable_act=H,Ve.useCallback=function(b,A){return ce.current.useCallback(b,A)},Ve.useContext=function(b){return ce.current.useContext(b)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(b){return ce.current.useDeferredValue(b)},Ve.useEffect=function(b,A){return ce.current.useEffect(b,A)},Ve.useId=function(){return ce.current.useId()},Ve.useImperativeHandle=function(b,A,ee){return ce.current.useImperativeHandle(b,A,ee)},Ve.useInsertionEffect=function(b,A){return ce.current.useInsertionEffect(b,A)},Ve.useLayoutEffect=function(b,A){return ce.current.useLayoutEffect(b,A)},Ve.useMemo=function(b,A){return ce.current.useMemo(b,A)},Ve.useReducer=function(b,A,ee){return ce.current.useReducer(b,A,ee)},Ve.useRef=function(b){return ce.current.useRef(b)},Ve.useState=function(b){return ce.current.useState(b)},Ve.useSyncExternalStore=function(b,A,ee){return ce.current.useSyncExternalStore(b,A,ee)},Ve.useTransition=function(){return ce.current.useTransition()},Ve.version="18.3.1",Ve}var Pp;function zu(){return Pp||(Pp=1,Kc.exports=my()),Kc.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Op;function gy(){if(Op)return qi;Op=1;var n=zu(),s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(h,m,g){var x,k={},y=null,N=null;g!==void 0&&(y=""+g),m.key!==void 0&&(y=""+m.key),m.ref!==void 0&&(N=m.ref);for(x in m)o.call(m,x)&&!u.hasOwnProperty(x)&&(k[x]=m[x]);if(h&&h.defaultProps)for(x in m=h.defaultProps,m)k[x]===void 0&&(k[x]=m[x]);return{$$typeof:s,type:h,key:y,ref:N,props:k,_owner:a.current}}return qi.Fragment=r,qi.jsx=f,qi.jsxs=f,qi}var zp;function vy(){return zp||(zp=1,qc.exports=gy()),qc.exports}var c=vy(),w=zu();const it=ym(w);var Tl={},Xc={exports:{}},Cn={},Yc={exports:{}},Qc={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var $p;function yy(){return $p||($p=1,(function(n){function s(P,J){var H=P.length;P.push(J);e:for(;0<H;){var b=H-1>>>1,A=P[b];if(0<a(A,J))P[b]=J,P[H]=A,H=b;else break e}}function r(P){return P.length===0?null:P[0]}function o(P){if(P.length===0)return null;var J=P[0],H=P.pop();if(H!==J){P[0]=H;e:for(var b=0,A=P.length,ee=A>>>1;b<ee;){var ue=2*(b+1)-1,me=P[ue],xe=ue+1,ze=P[xe];if(0>a(me,H))xe<A&&0>a(ze,me)?(P[b]=ze,P[xe]=H,b=xe):(P[b]=me,P[ue]=H,b=ue);else if(xe<A&&0>a(ze,H))P[b]=ze,P[xe]=H,b=xe;else break e}}return J}function a(P,J){var H=P.sortIndex-J.sortIndex;return H!==0?H:P.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var m=[],g=[],x=1,k=null,y=3,N=!1,_=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(P){for(var J=r(g);J!==null;){if(J.callback===null)o(g);else if(J.startTime<=P)o(g),J.sortIndex=J.expirationTime,s(m,J);else break;J=r(g)}}function O(P){if(E=!1,B(P),!_)if(r(m)!==null)_=!0,se(W);else{var J=r(g);J!==null&&ce(O,J.startTime-P)}}function W(P,J){_=!1,E&&(E=!1,M(G),G=-1),N=!0;var H=y;try{for(B(J),k=r(m);k!==null&&(!(k.expirationTime>J)||P&&!oe());){var b=k.callback;if(typeof b=="function"){k.callback=null,y=k.priorityLevel;var A=b(k.expirationTime<=J);J=n.unstable_now(),typeof A=="function"?k.callback=A:k===r(m)&&o(m),B(J)}else o(m);k=r(m)}if(k!==null)var ee=!0;else{var ue=r(g);ue!==null&&ce(O,ue.startTime-J),ee=!1}return ee}finally{k=null,y=H,N=!1}}var q=!1,K=null,G=-1,ae=5,de=-1;function oe(){return!(n.unstable_now()-de<ae)}function ke(){if(K!==null){var P=n.unstable_now();de=P;var J=!0;try{J=K(!0,P)}finally{J?Ne():(q=!1,K=null)}}else q=!1}var Ne;if(typeof I=="function")Ne=function(){I(ke)};else if(typeof MessageChannel<"u"){var Fe=new MessageChannel,Q=Fe.port2;Fe.port1.onmessage=ke,Ne=function(){Q.postMessage(null)}}else Ne=function(){T(ke,0)};function se(P){K=P,q||(q=!0,Ne())}function ce(P,J){G=T(function(){P(n.unstable_now())},J)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(P){P.callback=null},n.unstable_continueExecution=function(){_||N||(_=!0,se(W))},n.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<P?Math.floor(1e3/P):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_getFirstCallbackNode=function(){return r(m)},n.unstable_next=function(P){switch(y){case 1:case 2:case 3:var J=3;break;default:J=y}var H=y;y=J;try{return P()}finally{y=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(P,J){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var H=y;y=P;try{return J()}finally{y=H}},n.unstable_scheduleCallback=function(P,J,H){var b=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?b+H:b):H=b,P){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=H+A,P={id:x++,callback:J,priorityLevel:P,startTime:H,expirationTime:A,sortIndex:-1},H>b?(P.sortIndex=H,s(g,P),r(m)===null&&P===r(g)&&(E?(M(G),G=-1):E=!0,ce(O,H-b))):(P.sortIndex=A,s(m,P),_||N||(_=!0,se(W))),P},n.unstable_shouldYield=oe,n.unstable_wrapCallback=function(P){var J=y;return function(){var H=y;y=J;try{return P.apply(this,arguments)}finally{y=H}}}})(Qc)),Qc}var Fp;function xy(){return Fp||(Fp=1,Yc.exports=yy()),Yc.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Up;function wy(){if(Up)return Cn;Up=1;var n=zu(),s=xy();function r(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function u(e,t){f(e,t),f(e+"Capture",t)}function f(e,t){for(a[e]=t,e=0;e<t.length;e++)o.add(t[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,x={},k={};function y(e){return m.call(k,e)?!0:m.call(x,e)?!1:g.test(e)?k[e]=!0:(x[e]=!0,!1)}function N(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,t,i,l){if(t===null||typeof t>"u"||N(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 E(e,t,i,l,d,p,v){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=p,this.removeEmptyString=v}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new E(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];T[t]=new E(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new E(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new E(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){T[e]=new E(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new E(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new E(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new E(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new E(e,5,!1,e.toLowerCase(),null,!1,!1)});var M=/[\-:]([a-z])/g;function I(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(M,I);T[t]=new E(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(M,I);T[t]=new E(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(M,I);T[t]=new E(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new E(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new E(e,1,!1,e.toLowerCase(),null,!0,!0)});function B(e,t,i,l){var d=T.hasOwnProperty(t)?T[t]:null;(d!==null?d.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(_(t,i,d,l)&&(i=null),l||d===null?y(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(t=d.attributeName,l=d.attributeNamespace,i===null?e.removeAttribute(t):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,l?e.setAttributeNS(l,t,i):e.setAttribute(t,i))))}var O=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),q=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),de=Symbol.for("react.provider"),oe=Symbol.for("react.context"),ke=Symbol.for("react.forward_ref"),Ne=Symbol.for("react.suspense"),Fe=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),se=Symbol.for("react.lazy"),ce=Symbol.for("react.offscreen"),P=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var H=Object.assign,b;function A(e){if(b===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);b=t&&t[1]||""}return`
34
+ `+b+e}var ee=!1;function ue(e,t){if(!e||ee)return"";ee=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(U){var l=U}Reflect.construct(e,[],t)}else{try{t.call()}catch(U){l=U}e.call(t.prototype)}else{try{throw Error()}catch(U){l=U}e()}}catch(U){if(U&&l&&typeof U.stack=="string"){for(var d=U.stack.split(`
35
+ `),p=l.stack.split(`
36
+ `),v=d.length-1,C=p.length-1;1<=v&&0<=C&&d[v]!==p[C];)C--;for(;1<=v&&0<=C;v--,C--)if(d[v]!==p[C]){if(v!==1||C!==1)do if(v--,C--,0>C||d[v]!==p[C]){var R=`
37
+ `+d[v].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),R}while(1<=v&&0<=C);break}}}finally{ee=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?A(e):""}function me(e){switch(e.tag){case 5:return A(e.type);case 16:return A("Lazy");case 13:return A("Suspense");case 19:return A("SuspenseList");case 0:case 2:case 15:return e=ue(e.type,!1),e;case 11:return e=ue(e.type.render,!1),e;case 1:return e=ue(e.type,!0),e;default:return""}}function xe(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 K:return"Fragment";case q:return"Portal";case ae:return"Profiler";case G:return"StrictMode";case Ne:return"Suspense";case Fe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oe:return(e.displayName||"Context")+".Consumer";case de:return(e._context.displayName||"Context")+".Provider";case ke:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case se:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}function ze(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 xe(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 _e(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Te(e){var t=Ee(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(v){l=""+v,p.call(this,v)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function mt(e){e._valueTracker||(e._valueTracker=Te(e))}function Me(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=Ee(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function bt(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 Le(e,t){var i=t.checked;return H({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function Pt(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=_e(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 We(e,t){t=t.checked,t!=null&&B(e,"checked",t,!1)}function Ut(e,t){We(e,t);var i=_e(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")?gt(e,t.type,i):t.hasOwnProperty("defaultValue")&&gt(e,t.type,_e(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Et(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 gt(e,t,i){(t!=="number"||bt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var _t=Array.isArray;function Ot(e,t,i,l){if(e=e.options,t){t={};for(var d=0;d<i.length;d++)t["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=t.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&l&&(e[i].defaultSelected=!0)}else{for(i=""+_e(i),t=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function V(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return H({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ge(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(_t(i)){if(1<i.length)throw Error(r(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:_e(i)}}function Be(e,t){var i=_e(t.value),l=_e(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 Ke(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ft(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 vt(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ft(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ct,Xt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,i,l,d){MSApp.execUnsafeLocalFunction(function(){return e(t,i,l,d)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ct=ct||document.createElement("div"),ct.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ct.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var yt={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},$n=["Webkit","ms","Moz","O"];Object.keys(yt).forEach(function(e){$n.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yt[t]=yt[e]})});function un(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||yt.hasOwnProperty(e)&&yt[e]?(""+t).trim():t+"px"}function is(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=un(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var _n=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 jn(e,t){if(t){if(_n[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!="object")throw Error(r(62))}}function Rn(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xn=null;function dn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bt=null,wn=null,nt=null;function j(e){if(e=Ii(e)){if(typeof Bt!="function")throw Error(r(280));var t=e.stateNode;t&&(t=zo(t),Bt(e.stateNode,e.type,t))}}function le(e){wn?nt?nt.push(e):nt=[e]:wn=e}function ne(){if(wn){var e=wn,t=nt;if(nt=wn=null,j(e),t)for(e=0;e<t.length;e++)j(t[e])}}function ve(e,t){return e(t)}function Re(){}var Pe=!1;function je(e,t,i){if(Pe)return e(t,i);Pe=!0;try{return ve(e,t,i)}finally{Pe=!1,(wn!==null||nt!==null)&&(Re(),ne())}}function Ue(e,t){var i=e.stateNode;if(i===null)return null;var l=zo(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 lt=!1;if(h)try{var rt={};Object.defineProperty(rt,"passive",{get:function(){lt=!0}}),window.addEventListener("test",rt,rt),window.removeEventListener("test",rt,rt)}catch{lt=!1}function It(e,t,i,l,d,p,v,C,R){var U=Array.prototype.slice.call(arguments,3);try{t.apply(i,U)}catch(Z){this.onError(Z)}}var Dt=!1,Yt=null,pt=!1,sn=null,He={onError:function(e){Dt=!0,Yt=e}};function jt(e,t,i,l,d,p,v,C,R){Dt=!1,Yt=null,It.apply(He,arguments)}function os(e,t,i,l,d,p,v,C,R){if(jt.apply(this,arguments),Dt){if(Dt){var U=Yt;Dt=!1,Yt=null}else throw Error(r(198));pt||(pt=!0,sn=U)}}function et(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function vs(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function vo(e){if(et(e)!==e)throw Error(r(188))}function yo(e){var t=e.alternate;if(!t){if(t=et(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 vo(d),e;if(p===l)return vo(d),t;p=p.sibling}throw Error(r(188))}if(i.return!==l.return)i=d,l=p;else{for(var v=!1,C=d.child;C;){if(C===i){v=!0,i=d,l=p;break}if(C===l){v=!0,l=d,i=p;break}C=C.sibling}if(!v){for(C=p.child;C;){if(C===i){v=!0,i=p,l=d;break}if(C===l){v=!0,l=p,i=d;break}C=C.sibling}if(!v)throw Error(r(189))}}if(i.alternate!==l)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:t}function br(e){return e=yo(e),e!==null?pi(e):null}function pi(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=pi(e);if(t!==null)return t;e=e.sibling}return null}var hi=s.unstable_scheduleCallback,xo=s.unstable_cancelCallback,va=s.unstable_shouldYield,ya=s.unstable_requestPaint,xt=s.unstable_now,ls=s.unstable_getCurrentPriorityLevel,Is=s.unstable_ImmediatePriority,as=s.unstable_UserBlockingPriority,Nr=s.unstable_NormalPriority,tr=s.unstable_LowPriority,wo=s.unstable_IdlePriority,nr=null,An=null;function Cr(e){if(An&&typeof An.onCommitFiberRoot=="function")try{An.onCommitFiberRoot(nr,e,void 0,(e.current.flags&128)===128)}catch{}}var fn=Math.clz32?Math.clz32:sr,Er=Math.log,Ds=Math.LN2;function sr(e){return e>>>=0,e===0?32:31-(Er(e)/Ds|0)|0}var pn=64,_r=4194304;function rr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ir(e,t){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,v=i&268435455;if(v!==0){var C=v&~d;C!==0?l=rr(C):(p&=v,p!==0&&(l=rr(p)))}else v=i&~d,v!==0?l=rr(v):p!==0&&(l=rr(p));if(l===0)return 0;if(t!==0&&t!==l&&(t&d)===0&&(d=l&-l,p=t&-t,d>=p||d===16&&(p&4194240)!==0))return t;if((l&4)!==0&&(l|=i&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)i=31-fn(t),d=1<<i,l|=e[i],t&=~d;return l}function ko(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 So(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var v=31-fn(p),C=1<<v,R=d[v];R===-1?((C&i)===0||(C&l)!==0)&&(d[v]=ko(C,t)):R<=t&&(e.expiredLanes|=C),p&=~C}}function mi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function gi(){var e=pn;return pn<<=1,(pn&4194240)===0&&(pn=64),e}function vi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function or(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fn(t),e[t]=i}function To(e,t){var i=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-fn(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Ms(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-fn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Xe=0;function re(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,z,X,ye,Ce,$e=!1,Ye=[],Ze=null,wt=null,kt=null,ys=new Map,Rt=new Map,Ls=[],Lg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function vd(e,t){switch(e){case"focusin":case"focusout":Ze=null;break;case"dragenter":case"dragleave":wt=null;break;case"mouseover":case"mouseout":kt=null;break;case"pointerover":case"pointerout":ys.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rt.delete(t.pointerId)}}function yi(e,t,i,l,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},t!==null&&(t=Ii(t),t!==null&&z(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function Pg(e,t,i,l,d){switch(t){case"focusin":return Ze=yi(Ze,e,t,i,l,d),!0;case"dragenter":return wt=yi(wt,e,t,i,l,d),!0;case"mouseover":return kt=yi(kt,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return ys.set(p,yi(ys.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Rt.set(p,yi(Rt.get(p)||null,e,t,i,l,d)),!0}return!1}function yd(e){var t=lr(e.target);if(t!==null){var i=et(t);if(i!==null){if(t=i.tag,t===13){if(t=vs(i),t!==null){e.blockedOn=t,Ce(e.priority,function(){X(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 bo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=wa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);xn=l,i.target.dispatchEvent(l),xn=null}else return t=Ii(i),t!==null&&z(t),e.blockedOn=i,!1;t.shift()}return!0}function xd(e,t,i){bo(e)&&i.delete(t)}function Og(){$e=!1,Ze!==null&&bo(Ze)&&(Ze=null),wt!==null&&bo(wt)&&(wt=null),kt!==null&&bo(kt)&&(kt=null),ys.forEach(xd),Rt.forEach(xd)}function xi(e,t){e.blockedOn===t&&(e.blockedOn=null,$e||($e=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Og)))}function wi(e){function t(d){return xi(d,e)}if(0<Ye.length){xi(Ye[0],e);for(var i=1;i<Ye.length;i++){var l=Ye[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Ze!==null&&xi(Ze,e),wt!==null&&xi(wt,e),kt!==null&&xi(kt,e),ys.forEach(t),Rt.forEach(t),i=0;i<Ls.length;i++)l=Ls[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Ls.length&&(i=Ls[0],i.blockedOn===null);)yd(i),i.blockedOn===null&&Ls.shift()}var jr=O.ReactCurrentBatchConfig,No=!0;function zg(e,t,i,l){var d=Xe,p=jr.transition;jr.transition=null;try{Xe=1,xa(e,t,i,l)}finally{Xe=d,jr.transition=p}}function $g(e,t,i,l){var d=Xe,p=jr.transition;jr.transition=null;try{Xe=4,xa(e,t,i,l)}finally{Xe=d,jr.transition=p}}function xa(e,t,i,l){if(No){var d=wa(e,t,i,l);if(d===null)Oa(e,t,l,Co,i),vd(e,l);else if(Pg(d,e,t,i,l))l.stopPropagation();else if(vd(e,l),t&4&&-1<Lg.indexOf(e)){for(;d!==null;){var p=Ii(d);if(p!==null&&S(p),p=wa(e,t,i,l),p===null&&Oa(e,t,l,Co,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else Oa(e,t,l,null,i)}}var Co=null;function wa(e,t,i,l){if(Co=null,e=dn(l),e=lr(e),e!==null)if(t=et(e),t===null)e=null;else if(i=t.tag,i===13){if(e=vs(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Co=e,null}function wd(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ls()){case Is:return 1;case as:return 4;case Nr:case tr:return 16;case wo:return 536870912;default:return 16}default:return 16}}var Ps=null,ka=null,Eo=null;function kd(){if(Eo)return Eo;var e,t=ka,i=t.length,l,d="value"in Ps?Ps.value:Ps.textContent,p=d.length;for(e=0;e<i&&t[e]===d[e];e++);var v=i-e;for(l=1;l<=v&&t[i-l]===d[p-l];l++);return Eo=d.slice(e,1<l?1-l:void 0)}function _o(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 jo(){return!0}function Sd(){return!1}function In(e){function t(i,l,d,p,v){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=v,this.currentTarget=null;for(var C in e)e.hasOwnProperty(C)&&(i=e[C],this[C]=i?i(p):p[C]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?jo:Sd,this.isPropagationStopped=Sd,this}return H(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=jo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=jo)},persist:function(){},isPersistent:jo}),t}var Rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sa=In(Rr),ki=H({},Rr,{view:0,detail:0}),Fg=In(ki),Ta,ba,Si,Ro=H({},ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ca,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Si&&(Si&&e.type==="mousemove"?(Ta=e.screenX-Si.screenX,ba=e.screenY-Si.screenY):ba=Ta=0,Si=e),Ta)},movementY:function(e){return"movementY"in e?e.movementY:ba}}),Td=In(Ro),Ug=H({},Ro,{dataTransfer:0}),Bg=In(Ug),Wg=H({},ki,{relatedTarget:0}),Na=In(Wg),Hg=H({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),Vg=In(Hg),Gg=H({},Rr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qg=In(Gg),Kg=H({},Rr,{data:0}),bd=In(Kg),Xg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yg={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"},Qg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qg[e])?!!t[e]:!1}function Ca(){return Zg}var Jg=H({},ki,{key:function(e){if(e.key){var t=Xg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_o(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ca,charCode:function(e){return e.type==="keypress"?_o(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_o(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ev=In(Jg),tv=H({},Ro,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nd=In(tv),nv=H({},ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ca}),sv=In(nv),rv=H({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),iv=In(rv),ov=H({},Ro,{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}),lv=In(ov),av=[9,13,27,32],Ea=h&&"CompositionEvent"in window,Ti=null;h&&"documentMode"in document&&(Ti=document.documentMode);var cv=h&&"TextEvent"in window&&!Ti,Cd=h&&(!Ea||Ti&&8<Ti&&11>=Ti),Ed=" ",_d=!1;function jd(e,t){switch(e){case"keyup":return av.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function uv(e,t){switch(e){case"compositionend":return Rd(t);case"keypress":return t.which!==32?null:(_d=!0,Ed);case"textInput":return e=t.data,e===Ed&&_d?null:e;default:return null}}function dv(e,t){if(Ar)return e==="compositionend"||!Ea&&jd(e,t)?(e=kd(),Eo=ka=Ps=null,Ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Cd&&t.locale!=="ko"?null:t.data;default:return null}}var fv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ad(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fv[e.type]:t==="textarea"}function Id(e,t,i,l){le(l),t=Lo(t,"onChange"),0<t.length&&(i=new Sa("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var bi=null,Ni=null;function pv(e){Yd(e,0)}function Ao(e){var t=Pr(e);if(Me(t))return e}function hv(e,t){if(e==="change")return t}var Dd=!1;if(h){var _a;if(h){var ja="oninput"in document;if(!ja){var Md=document.createElement("div");Md.setAttribute("oninput","return;"),ja=typeof Md.oninput=="function"}_a=ja}else _a=!1;Dd=_a&&(!document.documentMode||9<document.documentMode)}function Ld(){bi&&(bi.detachEvent("onpropertychange",Pd),Ni=bi=null)}function Pd(e){if(e.propertyName==="value"&&Ao(Ni)){var t=[];Id(t,Ni,e,dn(e)),je(pv,t)}}function mv(e,t,i){e==="focusin"?(Ld(),bi=t,Ni=i,bi.attachEvent("onpropertychange",Pd)):e==="focusout"&&Ld()}function gv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ao(Ni)}function vv(e,t){if(e==="click")return Ao(t)}function yv(e,t){if(e==="input"||e==="change")return Ao(t)}function xv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Xn=typeof Object.is=="function"?Object.is:xv;function Ci(e,t){if(Xn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!m.call(t,d)||!Xn(e[d],t[d]))return!1}return!0}function Od(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zd(e,t){var i=Od(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Od(i)}}function $d(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$d(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fd(){for(var e=window,t=bt();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=bt(e.document)}return t}function Ra(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function wv(e){var t=Fd(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&$d(i.ownerDocument.documentElement,i)){if(l!==null&&Ra(i)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(e,i.value.length);else if(e=(t=i.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,p=Math.min(l.start,d);l=l.end===void 0?p:Math.min(l.end,d),!e.extend&&p>l&&(d=l,l=p,p=d),d=zd(i,p);var v=zd(i,l);d&&v&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>l?(e.addRange(t),e.extend(v.node,v.offset)):(t.setEnd(v.node,v.offset),e.addRange(t)))}}for(t=[],e=i;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)e=t[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kv=h&&"documentMode"in document&&11>=document.documentMode,Ir=null,Aa=null,Ei=null,Ia=!1;function Ud(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ia||Ir==null||Ir!==bt(l)||(l=Ir,"selectionStart"in l&&Ra(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ei&&Ci(Ei,l)||(Ei=l,l=Lo(Aa,"onSelect"),0<l.length&&(t=new Sa("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Ir)))}function Io(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Dr={animationend:Io("Animation","AnimationEnd"),animationiteration:Io("Animation","AnimationIteration"),animationstart:Io("Animation","AnimationStart"),transitionend:Io("Transition","TransitionEnd")},Da={},Bd={};h&&(Bd=document.createElement("div").style,"AnimationEvent"in window||(delete Dr.animationend.animation,delete Dr.animationiteration.animation,delete Dr.animationstart.animation),"TransitionEvent"in window||delete Dr.transitionend.transition);function Do(e){if(Da[e])return Da[e];if(!Dr[e])return e;var t=Dr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Bd)return Da[e]=t[i];return e}var Wd=Do("animationend"),Hd=Do("animationiteration"),Vd=Do("animationstart"),Gd=Do("transitionend"),qd=new Map,Kd="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Os(e,t){qd.set(e,t),u(t,[e])}for(var Ma=0;Ma<Kd.length;Ma++){var La=Kd[Ma],Sv=La.toLowerCase(),Tv=La[0].toUpperCase()+La.slice(1);Os(Sv,"on"+Tv)}Os(Wd,"onAnimationEnd"),Os(Hd,"onAnimationIteration"),Os(Vd,"onAnimationStart"),Os("dblclick","onDoubleClick"),Os("focusin","onFocus"),Os("focusout","onBlur"),Os(Gd,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _i="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),bv=new Set("cancel close invalid load scroll toggle".split(" ").concat(_i));function Xd(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,os(l,t,void 0,e),e.currentTarget=null}function Yd(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],d=l.event;l=l.listeners;e:{var p=void 0;if(t)for(var v=l.length-1;0<=v;v--){var C=l[v],R=C.instance,U=C.currentTarget;if(C=C.listener,R!==p&&d.isPropagationStopped())break e;Xd(d,C,U),p=R}else for(v=0;v<l.length;v++){if(C=l[v],R=C.instance,U=C.currentTarget,C=C.listener,R!==p&&d.isPropagationStopped())break e;Xd(d,C,U),p=R}}}if(pt)throw e=sn,pt=!1,sn=null,e}function ut(e,t){var i=t[Wa];i===void 0&&(i=t[Wa]=new Set);var l=e+"__bubble";i.has(l)||(Qd(t,e,2,!1),i.add(l))}function Pa(e,t,i){var l=0;t&&(l|=4),Qd(i,e,l,t)}var Mo="_reactListening"+Math.random().toString(36).slice(2);function ji(e){if(!e[Mo]){e[Mo]=!0,o.forEach(function(i){i!=="selectionchange"&&(bv.has(i)||Pa(i,!1,e),Pa(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mo]||(t[Mo]=!0,Pa("selectionchange",!1,t))}}function Qd(e,t,i,l){switch(wd(t)){case 1:var d=zg;break;case 4:d=$g;break;default:d=xa}i=d.bind(null,t,i,e),d=void 0,!lt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(t,i,{capture:!0,passive:d}):e.addEventListener(t,i,!0):d!==void 0?e.addEventListener(t,i,{passive:d}):e.addEventListener(t,i,!1)}function Oa(e,t,i,l,d){var p=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var C=l.stateNode.containerInfo;if(C===d||C.nodeType===8&&C.parentNode===d)break;if(v===4)for(v=l.return;v!==null;){var R=v.tag;if((R===3||R===4)&&(R=v.stateNode.containerInfo,R===d||R.nodeType===8&&R.parentNode===d))return;v=v.return}for(;C!==null;){if(v=lr(C),v===null)return;if(R=v.tag,R===5||R===6){l=p=v;continue e}C=C.parentNode}}l=l.return}je(function(){var U=p,Z=dn(i),te=[];e:{var Y=qd.get(e);if(Y!==void 0){var fe=Sa,he=e;switch(e){case"keypress":if(_o(i)===0)break e;case"keydown":case"keyup":fe=ev;break;case"focusin":he="focus",fe=Na;break;case"focusout":he="blur",fe=Na;break;case"beforeblur":case"afterblur":fe=Na;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=Td;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=Bg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=sv;break;case Wd:case Hd:case Vd:fe=Vg;break;case Gd:fe=iv;break;case"scroll":fe=Fg;break;case"wheel":fe=lv;break;case"copy":case"cut":case"paste":fe=qg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=Nd}var we=(t&4)!==0,At=!we&&e==="scroll",$=we?Y!==null?Y+"Capture":null:Y;we=[];for(var D=U,F;D!==null;){F=D;var ie=F.stateNode;if(F.tag===5&&ie!==null&&(F=ie,$!==null&&(ie=Ue(D,$),ie!=null&&we.push(Ri(D,ie,F)))),At)break;D=D.return}0<we.length&&(Y=new fe(Y,he,null,i,Z),te.push({event:Y,listeners:we}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",Y&&i!==xn&&(he=i.relatedTarget||i.fromElement)&&(lr(he)||he[xs]))break e;if((fe||Y)&&(Y=Z.window===Z?Z:(Y=Z.ownerDocument)?Y.defaultView||Y.parentWindow:window,fe?(he=i.relatedTarget||i.toElement,fe=U,he=he?lr(he):null,he!==null&&(At=et(he),he!==At||he.tag!==5&&he.tag!==6)&&(he=null)):(fe=null,he=U),fe!==he)){if(we=Td,ie="onMouseLeave",$="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(we=Nd,ie="onPointerLeave",$="onPointerEnter",D="pointer"),At=fe==null?Y:Pr(fe),F=he==null?Y:Pr(he),Y=new we(ie,D+"leave",fe,i,Z),Y.target=At,Y.relatedTarget=F,ie=null,lr(Z)===U&&(we=new we($,D+"enter",he,i,Z),we.target=F,we.relatedTarget=At,ie=we),At=ie,fe&&he)t:{for(we=fe,$=he,D=0,F=we;F;F=Mr(F))D++;for(F=0,ie=$;ie;ie=Mr(ie))F++;for(;0<D-F;)we=Mr(we),D--;for(;0<F-D;)$=Mr($),F--;for(;D--;){if(we===$||$!==null&&we===$.alternate)break t;we=Mr(we),$=Mr($)}we=null}else we=null;fe!==null&&Zd(te,Y,fe,we,!1),he!==null&&At!==null&&Zd(te,At,he,we,!0)}}e:{if(Y=U?Pr(U):window,fe=Y.nodeName&&Y.nodeName.toLowerCase(),fe==="select"||fe==="input"&&Y.type==="file")var Se=hv;else if(Ad(Y))if(Dd)Se=yv;else{Se=gv;var Ie=mv}else(fe=Y.nodeName)&&fe.toLowerCase()==="input"&&(Y.type==="checkbox"||Y.type==="radio")&&(Se=vv);if(Se&&(Se=Se(e,U))){Id(te,Se,i,Z);break e}Ie&&Ie(e,Y,U),e==="focusout"&&(Ie=Y._wrapperState)&&Ie.controlled&&Y.type==="number"&&gt(Y,"number",Y.value)}switch(Ie=U?Pr(U):window,e){case"focusin":(Ad(Ie)||Ie.contentEditable==="true")&&(Ir=Ie,Aa=U,Ei=null);break;case"focusout":Ei=Aa=Ir=null;break;case"mousedown":Ia=!0;break;case"contextmenu":case"mouseup":case"dragend":Ia=!1,Ud(te,i,Z);break;case"selectionchange":if(kv)break;case"keydown":case"keyup":Ud(te,i,Z)}var De;if(Ea)e:{switch(e){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else Ar?jd(e,i)&&(Oe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Oe="onCompositionStart");Oe&&(Cd&&i.locale!=="ko"&&(Ar||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&Ar&&(De=kd()):(Ps=Z,ka="value"in Ps?Ps.value:Ps.textContent,Ar=!0)),Ie=Lo(U,Oe),0<Ie.length&&(Oe=new bd(Oe,e,null,i,Z),te.push({event:Oe,listeners:Ie}),De?Oe.data=De:(De=Rd(i),De!==null&&(Oe.data=De)))),(De=cv?uv(e,i):dv(e,i))&&(U=Lo(U,"onBeforeInput"),0<U.length&&(Z=new bd("onBeforeInput","beforeinput",null,i,Z),te.push({event:Z,listeners:U}),Z.data=De))}Yd(te,t)})}function Ri(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Lo(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=Ue(e,i),p!=null&&l.unshift(Ri(e,p,d)),p=Ue(e,t),p!=null&&l.push(Ri(e,p,d))),e=e.return}return l}function Mr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Zd(e,t,i,l,d){for(var p=t._reactName,v=[];i!==null&&i!==l;){var C=i,R=C.alternate,U=C.stateNode;if(R!==null&&R===l)break;C.tag===5&&U!==null&&(C=U,d?(R=Ue(i,p),R!=null&&v.unshift(Ri(i,R,C))):d||(R=Ue(i,p),R!=null&&v.push(Ri(i,R,C)))),i=i.return}v.length!==0&&e.push({event:t,listeners:v})}var Nv=/\r\n?/g,Cv=/\u0000|\uFFFD/g;function Jd(e){return(typeof e=="string"?e:""+e).replace(Nv,`
38
+ `).replace(Cv,"")}function Po(e,t,i){if(t=Jd(t),Jd(e)!==t&&i)throw Error(r(425))}function Oo(){}var za=null,$a=null;function Fa(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ua=typeof setTimeout=="function"?setTimeout:void 0,Ev=typeof clearTimeout=="function"?clearTimeout:void 0,ef=typeof Promise=="function"?Promise:void 0,_v=typeof queueMicrotask=="function"?queueMicrotask:typeof ef<"u"?function(e){return ef.resolve(null).then(e).catch(jv)}:Ua;function jv(e){setTimeout(function(){throw e})}function Ba(e,t){var i=t,l=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(l===0){e.removeChild(d),wi(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);wi(t)}function zs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function tf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}var Lr=Math.random().toString(36).slice(2),cs="__reactFiber$"+Lr,Ai="__reactProps$"+Lr,xs="__reactContainer$"+Lr,Wa="__reactEvents$"+Lr,Rv="__reactListeners$"+Lr,Av="__reactHandles$"+Lr;function lr(e){var t=e[cs];if(t)return t;for(var i=e.parentNode;i;){if(t=i[xs]||i[cs]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=tf(e);e!==null;){if(i=e[cs])return i;e=tf(e)}return t}e=i,i=e.parentNode}return null}function Ii(e){return e=e[cs]||e[xs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Pr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function zo(e){return e[Ai]||null}var Ha=[],Or=-1;function $s(e){return{current:e}}function dt(e){0>Or||(e.current=Ha[Or],Ha[Or]=null,Or--)}function at(e,t){Or++,Ha[Or]=e.current,e.current=t}var Fs={},rn=$s(Fs),kn=$s(!1),ar=Fs;function zr(e,t){var i=e.type.contextTypes;if(!i)return Fs;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=t[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function Sn(e){return e=e.childContextTypes,e!=null}function $o(){dt(kn),dt(rn)}function nf(e,t,i){if(rn.current!==Fs)throw Error(r(168));at(rn,t),at(kn,i)}function sf(e,t,i){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in t))throw Error(r(108,ze(e)||"Unknown",d));return H({},i,l)}function Fo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Fs,ar=rn.current,at(rn,e),at(kn,kn.current),!0}function rf(e,t,i){var l=e.stateNode;if(!l)throw Error(r(169));i?(e=sf(e,t,ar),l.__reactInternalMemoizedMergedChildContext=e,dt(kn),dt(rn),at(rn,e)):dt(kn),at(kn,i)}var ws=null,Uo=!1,Va=!1;function of(e){ws===null?ws=[e]:ws.push(e)}function Iv(e){Uo=!0,of(e)}function Us(){if(!Va&&ws!==null){Va=!0;var e=0,t=Xe;try{var i=ws;for(Xe=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}ws=null,Uo=!1}catch(d){throw ws!==null&&(ws=ws.slice(e+1)),hi(Is,Us),d}finally{Xe=t,Va=!1}}return null}var $r=[],Fr=0,Bo=null,Wo=0,Fn=[],Un=0,cr=null,ks=1,Ss="";function ur(e,t){$r[Fr++]=Wo,$r[Fr++]=Bo,Bo=e,Wo=t}function lf(e,t,i){Fn[Un++]=ks,Fn[Un++]=Ss,Fn[Un++]=cr,cr=e;var l=ks;e=Ss;var d=32-fn(l)-1;l&=~(1<<d),i+=1;var p=32-fn(t)+d;if(30<p){var v=d-d%5;p=(l&(1<<v)-1).toString(32),l>>=v,d-=v,ks=1<<32-fn(t)+d|i<<d|l,Ss=p+e}else ks=1<<p|i<<d|l,Ss=e}function Ga(e){e.return!==null&&(ur(e,1),lf(e,1,0))}function qa(e){for(;e===Bo;)Bo=$r[--Fr],$r[Fr]=null,Wo=$r[--Fr],$r[Fr]=null;for(;e===cr;)cr=Fn[--Un],Fn[Un]=null,Ss=Fn[--Un],Fn[Un]=null,ks=Fn[--Un],Fn[Un]=null}var Dn=null,Mn=null,ht=!1,Yn=null;function af(e,t){var i=Vn(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=e,t=e.deletions,t===null?(e.deletions=[i],e.flags|=16):t.push(i)}function cf(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Dn=e,Mn=zs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Dn=e,Mn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=cr!==null?{id:ks,overflow:Ss}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Vn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,Dn=e,Mn=null,!0):!1;default:return!1}}function Ka(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xa(e){if(ht){var t=Mn;if(t){var i=t;if(!cf(e,t)){if(Ka(e))throw Error(r(418));t=zs(i.nextSibling);var l=Dn;t&&cf(e,t)?af(l,i):(e.flags=e.flags&-4097|2,ht=!1,Dn=e)}}else{if(Ka(e))throw Error(r(418));e.flags=e.flags&-4097|2,ht=!1,Dn=e}}}function uf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Dn=e}function Ho(e){if(e!==Dn)return!1;if(!ht)return uf(e),ht=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fa(e.type,e.memoizedProps)),t&&(t=Mn)){if(Ka(e))throw df(),Error(r(418));for(;t;)af(e,t),t=zs(t.nextSibling)}if(uf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){Mn=zs(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}Mn=null}}else Mn=Dn?zs(e.stateNode.nextSibling):null;return!0}function df(){for(var e=Mn;e;)e=zs(e.nextSibling)}function Ur(){Mn=Dn=null,ht=!1}function Ya(e){Yn===null?Yn=[e]:Yn.push(e)}var Dv=O.ReactCurrentBatchConfig;function Di(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(r(309));var l=i.stateNode}if(!l)throw Error(r(147,e));var d=l,p=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===p?t.ref:(t=function(v){var C=d.refs;v===null?delete C[p]:C[p]=v},t._stringRef=p,t)}if(typeof e!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,e))}return e}function Vo(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ff(e){var t=e._init;return t(e._payload)}function pf(e){function t($,D){if(e){var F=$.deletions;F===null?($.deletions=[D],$.flags|=16):F.push(D)}}function i($,D){if(!e)return null;for(;D!==null;)t($,D),D=D.sibling;return null}function l($,D){for($=new Map;D!==null;)D.key!==null?$.set(D.key,D):$.set(D.index,D),D=D.sibling;return $}function d($,D){return $=Xs($,D),$.index=0,$.sibling=null,$}function p($,D,F){return $.index=F,e?(F=$.alternate,F!==null?(F=F.index,F<D?($.flags|=2,D):F):($.flags|=2,D)):($.flags|=1048576,D)}function v($){return e&&$.alternate===null&&($.flags|=2),$}function C($,D,F,ie){return D===null||D.tag!==6?(D=Uc(F,$.mode,ie),D.return=$,D):(D=d(D,F),D.return=$,D)}function R($,D,F,ie){var Se=F.type;return Se===K?Z($,D,F.props.children,ie,F.key):D!==null&&(D.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===se&&ff(Se)===D.type)?(ie=d(D,F.props),ie.ref=Di($,D,F),ie.return=$,ie):(ie=ml(F.type,F.key,F.props,null,$.mode,ie),ie.ref=Di($,D,F),ie.return=$,ie)}function U($,D,F,ie){return D===null||D.tag!==4||D.stateNode.containerInfo!==F.containerInfo||D.stateNode.implementation!==F.implementation?(D=Bc(F,$.mode,ie),D.return=$,D):(D=d(D,F.children||[]),D.return=$,D)}function Z($,D,F,ie,Se){return D===null||D.tag!==7?(D=yr(F,$.mode,ie,Se),D.return=$,D):(D=d(D,F),D.return=$,D)}function te($,D,F){if(typeof D=="string"&&D!==""||typeof D=="number")return D=Uc(""+D,$.mode,F),D.return=$,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case W:return F=ml(D.type,D.key,D.props,null,$.mode,F),F.ref=Di($,null,D),F.return=$,F;case q:return D=Bc(D,$.mode,F),D.return=$,D;case se:var ie=D._init;return te($,ie(D._payload),F)}if(_t(D)||J(D))return D=yr(D,$.mode,F,null),D.return=$,D;Vo($,D)}return null}function Y($,D,F,ie){var Se=D!==null?D.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Se!==null?null:C($,D,""+F,ie);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case W:return F.key===Se?R($,D,F,ie):null;case q:return F.key===Se?U($,D,F,ie):null;case se:return Se=F._init,Y($,D,Se(F._payload),ie)}if(_t(F)||J(F))return Se!==null?null:Z($,D,F,ie,null);Vo($,F)}return null}function fe($,D,F,ie,Se){if(typeof ie=="string"&&ie!==""||typeof ie=="number")return $=$.get(F)||null,C(D,$,""+ie,Se);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case W:return $=$.get(ie.key===null?F:ie.key)||null,R(D,$,ie,Se);case q:return $=$.get(ie.key===null?F:ie.key)||null,U(D,$,ie,Se);case se:var Ie=ie._init;return fe($,D,F,Ie(ie._payload),Se)}if(_t(ie)||J(ie))return $=$.get(F)||null,Z(D,$,ie,Se,null);Vo(D,ie)}return null}function he($,D,F,ie){for(var Se=null,Ie=null,De=D,Oe=D=0,Vt=null;De!==null&&Oe<F.length;Oe++){De.index>Oe?(Vt=De,De=null):Vt=De.sibling;var Je=Y($,De,F[Oe],ie);if(Je===null){De===null&&(De=Vt);break}e&&De&&Je.alternate===null&&t($,De),D=p(Je,D,Oe),Ie===null?Se=Je:Ie.sibling=Je,Ie=Je,De=Vt}if(Oe===F.length)return i($,De),ht&&ur($,Oe),Se;if(De===null){for(;Oe<F.length;Oe++)De=te($,F[Oe],ie),De!==null&&(D=p(De,D,Oe),Ie===null?Se=De:Ie.sibling=De,Ie=De);return ht&&ur($,Oe),Se}for(De=l($,De);Oe<F.length;Oe++)Vt=fe(De,$,Oe,F[Oe],ie),Vt!==null&&(e&&Vt.alternate!==null&&De.delete(Vt.key===null?Oe:Vt.key),D=p(Vt,D,Oe),Ie===null?Se=Vt:Ie.sibling=Vt,Ie=Vt);return e&&De.forEach(function(Ys){return t($,Ys)}),ht&&ur($,Oe),Se}function we($,D,F,ie){var Se=J(F);if(typeof Se!="function")throw Error(r(150));if(F=Se.call(F),F==null)throw Error(r(151));for(var Ie=Se=null,De=D,Oe=D=0,Vt=null,Je=F.next();De!==null&&!Je.done;Oe++,Je=F.next()){De.index>Oe?(Vt=De,De=null):Vt=De.sibling;var Ys=Y($,De,Je.value,ie);if(Ys===null){De===null&&(De=Vt);break}e&&De&&Ys.alternate===null&&t($,De),D=p(Ys,D,Oe),Ie===null?Se=Ys:Ie.sibling=Ys,Ie=Ys,De=Vt}if(Je.done)return i($,De),ht&&ur($,Oe),Se;if(De===null){for(;!Je.done;Oe++,Je=F.next())Je=te($,Je.value,ie),Je!==null&&(D=p(Je,D,Oe),Ie===null?Se=Je:Ie.sibling=Je,Ie=Je);return ht&&ur($,Oe),Se}for(De=l($,De);!Je.done;Oe++,Je=F.next())Je=fe(De,$,Oe,Je.value,ie),Je!==null&&(e&&Je.alternate!==null&&De.delete(Je.key===null?Oe:Je.key),D=p(Je,D,Oe),Ie===null?Se=Je:Ie.sibling=Je,Ie=Je);return e&&De.forEach(function(fy){return t($,fy)}),ht&&ur($,Oe),Se}function At($,D,F,ie){if(typeof F=="object"&&F!==null&&F.type===K&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case W:e:{for(var Se=F.key,Ie=D;Ie!==null;){if(Ie.key===Se){if(Se=F.type,Se===K){if(Ie.tag===7){i($,Ie.sibling),D=d(Ie,F.props.children),D.return=$,$=D;break e}}else if(Ie.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===se&&ff(Se)===Ie.type){i($,Ie.sibling),D=d(Ie,F.props),D.ref=Di($,Ie,F),D.return=$,$=D;break e}i($,Ie);break}else t($,Ie);Ie=Ie.sibling}F.type===K?(D=yr(F.props.children,$.mode,ie,F.key),D.return=$,$=D):(ie=ml(F.type,F.key,F.props,null,$.mode,ie),ie.ref=Di($,D,F),ie.return=$,$=ie)}return v($);case q:e:{for(Ie=F.key;D!==null;){if(D.key===Ie)if(D.tag===4&&D.stateNode.containerInfo===F.containerInfo&&D.stateNode.implementation===F.implementation){i($,D.sibling),D=d(D,F.children||[]),D.return=$,$=D;break e}else{i($,D);break}else t($,D);D=D.sibling}D=Bc(F,$.mode,ie),D.return=$,$=D}return v($);case se:return Ie=F._init,At($,D,Ie(F._payload),ie)}if(_t(F))return he($,D,F,ie);if(J(F))return we($,D,F,ie);Vo($,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,D!==null&&D.tag===6?(i($,D.sibling),D=d(D,F),D.return=$,$=D):(i($,D),D=Uc(F,$.mode,ie),D.return=$,$=D),v($)):i($,D)}return At}var Br=pf(!0),hf=pf(!1),Go=$s(null),qo=null,Wr=null,Qa=null;function Za(){Qa=Wr=qo=null}function Ja(e){var t=Go.current;dt(Go),e._currentValue=t}function ec(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function Hr(e,t){qo=e,Qa=Wr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Tn=!0),e.firstContext=null)}function Bn(e){var t=e._currentValue;if(Qa!==e)if(e={context:e,memoizedValue:t,next:null},Wr===null){if(qo===null)throw Error(r(308));Wr=e,qo.dependencies={lanes:0,firstContext:e}}else Wr=Wr.next=e;return t}var dr=null;function tc(e){dr===null?dr=[e]:dr.push(e)}function mf(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,tc(t)):(i.next=d.next,d.next=i),t.interleaved=i,Ts(e,l)}function Ts(e,t){e.lanes|=t;var i=e.alternate;for(i!==null&&(i.lanes|=t),i=e,e=e.return;e!==null;)e.childLanes|=t,i=e.alternate,i!==null&&(i.childLanes|=t),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Bs=!1;function nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ws(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Qe&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,Ts(e,i)}return d=l.interleaved,d===null?(t.next=t,tc(l)):(t.next=d.next,d.next=t),l.interleaved=t,Ts(e,i)}function Ko(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Ms(e,i)}}function vf(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var v={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=v:p=p.next=v,i=i.next}while(i!==null);p===null?d=p=t:p=p.next=t}else d=p=t;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,effects:l.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}function Xo(e,t,i,l){var d=e.updateQueue;Bs=!1;var p=d.firstBaseUpdate,v=d.lastBaseUpdate,C=d.shared.pending;if(C!==null){d.shared.pending=null;var R=C,U=R.next;R.next=null,v===null?p=U:v.next=U,v=R;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,C=Z.lastBaseUpdate,C!==v&&(C===null?Z.firstBaseUpdate=U:C.next=U,Z.lastBaseUpdate=R))}if(p!==null){var te=d.baseState;v=0,Z=U=R=null,C=p;do{var Y=C.lane,fe=C.eventTime;if((l&Y)===Y){Z!==null&&(Z=Z.next={eventTime:fe,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var he=e,we=C;switch(Y=t,fe=i,we.tag){case 1:if(he=we.payload,typeof he=="function"){te=he.call(fe,te,Y);break e}te=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=we.payload,Y=typeof he=="function"?he.call(fe,te,Y):he,Y==null)break e;te=H({},te,Y);break e;case 2:Bs=!0}}C.callback!==null&&C.lane!==0&&(e.flags|=64,Y=d.effects,Y===null?d.effects=[C]:Y.push(C))}else fe={eventTime:fe,lane:Y,tag:C.tag,payload:C.payload,callback:C.callback,next:null},Z===null?(U=Z=fe,R=te):Z=Z.next=fe,v|=Y;if(C=C.next,C===null){if(C=d.shared.pending,C===null)break;Y=C,C=Y.next,Y.next=null,d.lastBaseUpdate=Y,d.shared.pending=null}}while(!0);if(Z===null&&(R=te),d.baseState=R,d.firstBaseUpdate=U,d.lastBaseUpdate=Z,t=d.shared.interleaved,t!==null){d=t;do v|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);hr|=v,e.lanes=v,e.memoizedState=te}}function yf(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(r(191,d));d.call(l)}}}var Mi={},us=$s(Mi),Li=$s(Mi),Pi=$s(Mi);function fr(e){if(e===Mi)throw Error(r(174));return e}function sc(e,t){switch(at(Pi,t),at(Li,e),at(us,Mi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vt(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vt(t,e)}dt(us),at(us,t)}function Vr(){dt(us),dt(Li),dt(Pi)}function xf(e){fr(Pi.current);var t=fr(us.current),i=vt(t,e.type);t!==i&&(at(Li,e),at(us,i))}function rc(e){Li.current===e&&(dt(us),dt(Li))}var St=$s(0);function Yo(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ic=[];function oc(){for(var e=0;e<ic.length;e++)ic[e]._workInProgressVersionPrimary=null;ic.length=0}var Qo=O.ReactCurrentDispatcher,lc=O.ReactCurrentBatchConfig,pr=0,Tt=null,zt=null,Wt=null,Zo=!1,Oi=!1,zi=0,Mv=0;function on(){throw Error(r(321))}function ac(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Xn(e[i],t[i]))return!1;return!0}function cc(e,t,i,l,d,p){if(pr=p,Tt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Qo.current=e===null||e.memoizedState===null?zv:$v,e=i(l,d),Oi){p=0;do{if(Oi=!1,zi=0,25<=p)throw Error(r(301));p+=1,Wt=zt=null,t.updateQueue=null,Qo.current=Fv,e=i(l,d)}while(Oi)}if(Qo.current=tl,t=zt!==null&&zt.next!==null,pr=0,Wt=zt=Tt=null,Zo=!1,t)throw Error(r(300));return e}function uc(){var e=zi!==0;return zi=0,e}function ds(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wt===null?Tt.memoizedState=Wt=e:Wt=Wt.next=e,Wt}function Wn(){if(zt===null){var e=Tt.alternate;e=e!==null?e.memoizedState:null}else e=zt.next;var t=Wt===null?Tt.memoizedState:Wt.next;if(t!==null)Wt=t,zt=e;else{if(e===null)throw Error(r(310));zt=e,e={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},Wt===null?Tt.memoizedState=Wt=e:Wt=Wt.next=e}return Wt}function $i(e,t){return typeof t=="function"?t(e):t}function dc(e){var t=Wn(),i=t.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var l=zt,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var v=d.next;d.next=p.next,p.next=v}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var C=v=null,R=null,U=p;do{var Z=U.lane;if((pr&Z)===Z)R!==null&&(R=R.next={lane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),l=U.hasEagerState?U.eagerState:e(l,U.action);else{var te={lane:Z,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};R===null?(C=R=te,v=l):R=R.next=te,Tt.lanes|=Z,hr|=Z}U=U.next}while(U!==null&&U!==p);R===null?v=l:R.next=C,Xn(l,t.memoizedState)||(Tn=!0),t.memoizedState=l,t.baseState=v,t.baseQueue=R,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,Tt.lanes|=p,hr|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function fc(e){var t=Wn(),i=t.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,p=t.memoizedState;if(d!==null){i.pending=null;var v=d=d.next;do p=e(p,v.action),v=v.next;while(v!==d);Xn(p,t.memoizedState)||(Tn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function wf(){}function kf(e,t){var i=Tt,l=Wn(),d=t(),p=!Xn(l.memoizedState,d);if(p&&(l.memoizedState=d,Tn=!0),l=l.queue,pc(bf.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Wt!==null&&Wt.memoizedState.tag&1){if(i.flags|=2048,Fi(9,Tf.bind(null,i,l,d,t),void 0,null),Ht===null)throw Error(r(349));(pr&30)!==0||Sf(i,t,d)}return d}function Sf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Tt.updateQueue,t===null?(t={lastEffect:null,stores:null},Tt.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Tf(e,t,i,l){t.value=i,t.getSnapshot=l,Nf(t)&&Cf(e)}function bf(e,t,i){return i(function(){Nf(t)&&Cf(e)})}function Nf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Xn(e,i)}catch{return!0}}function Cf(e){var t=Ts(e,1);t!==null&&es(t,e,1,-1)}function Ef(e){var t=ds();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:e},t.queue=e,e=e.dispatch=Ov.bind(null,Tt,e),[t.memoizedState,e]}function Fi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=Tt.updateQueue,t===null?(t={lastEffect:null,stores:null},Tt.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e)),e}function _f(){return Wn().memoizedState}function Jo(e,t,i,l){var d=ds();Tt.flags|=e,d.memoizedState=Fi(1|t,i,void 0,l===void 0?null:l)}function el(e,t,i,l){var d=Wn();l=l===void 0?null:l;var p=void 0;if(zt!==null){var v=zt.memoizedState;if(p=v.destroy,l!==null&&ac(l,v.deps)){d.memoizedState=Fi(t,i,p,l);return}}Tt.flags|=e,d.memoizedState=Fi(1|t,i,p,l)}function jf(e,t){return Jo(8390656,8,e,t)}function pc(e,t){return el(2048,8,e,t)}function Rf(e,t){return el(4,2,e,t)}function Af(e,t){return el(4,4,e,t)}function If(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Df(e,t,i){return i=i!=null?i.concat([e]):null,el(4,4,If.bind(null,t,e),i)}function hc(){}function Mf(e,t){var i=Wn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&ac(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Lf(e,t){var i=Wn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&ac(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Pf(e,t,i){return(pr&21)===0?(e.baseState&&(e.baseState=!1,Tn=!0),e.memoizedState=i):(Xn(i,t)||(i=gi(),Tt.lanes|=i,hr|=i,e.baseState=!0),t)}function Lv(e,t){var i=Xe;Xe=i!==0&&4>i?i:4,e(!0);var l=lc.transition;lc.transition={};try{e(!1),t()}finally{Xe=i,lc.transition=l}}function Of(){return Wn().memoizedState}function Pv(e,t,i){var l=qs(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},zf(e))$f(t,i);else if(i=mf(e,t,i,l),i!==null){var d=mn();es(i,e,l,d),Ff(i,t,l)}}function Ov(e,t,i){var l=qs(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(zf(e))$f(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var v=t.lastRenderedState,C=p(v,i);if(d.hasEagerState=!0,d.eagerState=C,Xn(C,v)){var R=t.interleaved;R===null?(d.next=d,tc(t)):(d.next=R.next,R.next=d),t.interleaved=d;return}}catch{}finally{}i=mf(e,t,d,l),i!==null&&(d=mn(),es(i,e,l,d),Ff(i,t,l))}}function zf(e){var t=e.alternate;return e===Tt||t!==null&&t===Tt}function $f(e,t){Oi=Zo=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Ff(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Ms(e,i)}}var tl={readContext:Bn,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},zv={readContext:Bn,useCallback:function(e,t){return ds().memoizedState=[e,t===void 0?null:t],e},useContext:Bn,useEffect:jf,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,Jo(4194308,4,If.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Jo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Jo(4,2,e,t)},useMemo:function(e,t){var i=ds();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=ds();return t=i!==void 0?i(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Pv.bind(null,Tt,e),[l.memoizedState,e]},useRef:function(e){var t=ds();return e={current:e},t.memoizedState=e},useState:Ef,useDebugValue:hc,useDeferredValue:function(e){return ds().memoizedState=e},useTransition:function(){var e=Ef(!1),t=e[0];return e=Lv.bind(null,e[1]),ds().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=Tt,d=ds();if(ht){if(i===void 0)throw Error(r(407));i=i()}else{if(i=t(),Ht===null)throw Error(r(349));(pr&30)!==0||Sf(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,jf(bf.bind(null,l,p,e),[e]),l.flags|=2048,Fi(9,Tf.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=ds(),t=Ht.identifierPrefix;if(ht){var i=Ss,l=ks;i=(l&~(1<<32-fn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=zi++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=Mv++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$v={readContext:Bn,useCallback:Mf,useContext:Bn,useEffect:pc,useImperativeHandle:Df,useInsertionEffect:Rf,useLayoutEffect:Af,useMemo:Lf,useReducer:dc,useRef:_f,useState:function(){return dc($i)},useDebugValue:hc,useDeferredValue:function(e){var t=Wn();return Pf(t,zt.memoizedState,e)},useTransition:function(){var e=dc($i)[0],t=Wn().memoizedState;return[e,t]},useMutableSource:wf,useSyncExternalStore:kf,useId:Of,unstable_isNewReconciler:!1},Fv={readContext:Bn,useCallback:Mf,useContext:Bn,useEffect:pc,useImperativeHandle:Df,useInsertionEffect:Rf,useLayoutEffect:Af,useMemo:Lf,useReducer:fc,useRef:_f,useState:function(){return fc($i)},useDebugValue:hc,useDeferredValue:function(e){var t=Wn();return zt===null?t.memoizedState=e:Pf(t,zt.memoizedState,e)},useTransition:function(){var e=fc($i)[0],t=Wn().memoizedState;return[e,t]},useMutableSource:wf,useSyncExternalStore:kf,useId:Of,unstable_isNewReconciler:!1};function Qn(e,t){if(e&&e.defaultProps){t=H({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function mc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:H({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var nl={isMounted:function(e){return(e=e._reactInternals)?et(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=mn(),d=qs(e),p=bs(l,d);p.payload=t,i!=null&&(p.callback=i),t=Ws(e,p,d),t!==null&&(es(t,e,d,l),Ko(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=mn(),d=qs(e),p=bs(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Ws(e,p,d),t!==null&&(es(t,e,d,l),Ko(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=mn(),l=qs(e),d=bs(i,l);d.tag=2,t!=null&&(d.callback=t),t=Ws(e,d,l),t!==null&&(es(t,e,l,i),Ko(t,e,l))}};function Uf(e,t,i,l,d,p,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,v):t.prototype&&t.prototype.isPureReactComponent?!Ci(i,l)||!Ci(d,p):!0}function Bf(e,t,i){var l=!1,d=Fs,p=t.contextType;return typeof p=="object"&&p!==null?p=Bn(p):(d=Sn(t)?ar:rn.current,l=t.contextTypes,p=(l=l!=null)?zr(e,d):Fs),t=new t(i,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=nl,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Wf(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&nl.enqueueReplaceState(t,t.state,null)}function gc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},nc(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=Bn(p):(p=Sn(t)?ar:rn.current,d.context=zr(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(mc(e,t,p,i),d.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(t=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),t!==d.state&&nl.enqueueReplaceState(d,d.state,null),Xo(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Gr(e,t){try{var i="",l=t;do i+=me(l),l=l.return;while(l);var d=i}catch(p){d=`
39
+ Error generating stack: `+p.message+`
40
+ `+p.stack}return{value:e,source:t,stack:d,digest:null}}function vc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function yc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var Uv=typeof WeakMap=="function"?WeakMap:Map;function Hf(e,t,i){i=bs(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){cl||(cl=!0,Dc=l),yc(e,t)},i}function Vf(e,t,i){i=bs(-1,i),i.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var d=t.value;i.payload=function(){return l(d)},i.callback=function(){yc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){yc(e,t),typeof l!="function"&&(Vs===null?Vs=new Set([this]):Vs.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),i}function Gf(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Uv;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=ty.bind(null,e,t,i),t.then(e,e))}function qf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Kf(e,t,i,l,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(t=bs(-1,1),t.tag=2,Ws(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Bv=O.ReactCurrentOwner,Tn=!1;function hn(e,t,i,l){t.child=e===null?hf(t,null,i,l):Br(t,e.child,i,l)}function Xf(e,t,i,l,d){i=i.render;var p=t.ref;return Hr(t,d),l=cc(e,t,i,l,p,d),i=uc(),e!==null&&!Tn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ns(e,t,d)):(ht&&i&&Ga(t),t.flags|=1,hn(e,t,l,d),t.child)}function Yf(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Fc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,Qf(e,t,p,l,d)):(e=ml(i.type,null,l,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,(e.lanes&d)===0){var v=p.memoizedProps;if(i=i.compare,i=i!==null?i:Ci,i(v,l)&&e.ref===t.ref)return Ns(e,t,d)}return t.flags|=1,e=Xs(p,l),e.ref=t.ref,e.return=t,t.child=e}function Qf(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(Ci(p,l)&&e.ref===t.ref)if(Tn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Tn=!0);else return t.lanes=e.lanes,Ns(e,t,d)}return xc(e,t,i,l,d)}function Zf(e,t,i){var l=t.pendingProps,d=l.children,p=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},at(Kr,Ln),Ln|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,at(Kr,Ln),Ln|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,at(Kr,Ln),Ln|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,at(Kr,Ln),Ln|=l;return hn(e,t,d,i),t.child}function Jf(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function xc(e,t,i,l,d){var p=Sn(i)?ar:rn.current;return p=zr(t,p),Hr(t,d),i=cc(e,t,i,l,p,d),l=uc(),e!==null&&!Tn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ns(e,t,d)):(ht&&l&&Ga(t),t.flags|=1,hn(e,t,i,d),t.child)}function ep(e,t,i,l,d){if(Sn(i)){var p=!0;Fo(t)}else p=!1;if(Hr(t,d),t.stateNode===null)rl(e,t),Bf(t,i,l),gc(t,i,l,d),l=!0;else if(e===null){var v=t.stateNode,C=t.memoizedProps;v.props=C;var R=v.context,U=i.contextType;typeof U=="object"&&U!==null?U=Bn(U):(U=Sn(i)?ar:rn.current,U=zr(t,U));var Z=i.getDerivedStateFromProps,te=typeof Z=="function"||typeof v.getSnapshotBeforeUpdate=="function";te||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==l||R!==U)&&Wf(t,v,l,U),Bs=!1;var Y=t.memoizedState;v.state=Y,Xo(t,l,v,d),R=t.memoizedState,C!==l||Y!==R||kn.current||Bs?(typeof Z=="function"&&(mc(t,i,Z,l),R=t.memoizedState),(C=Bs||Uf(t,i,C,l,Y,R,U))?(te||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=R),v.props=l,v.state=R,v.context=U,l=C):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{v=t.stateNode,gf(e,t),C=t.memoizedProps,U=t.type===t.elementType?C:Qn(t.type,C),v.props=U,te=t.pendingProps,Y=v.context,R=i.contextType,typeof R=="object"&&R!==null?R=Bn(R):(R=Sn(i)?ar:rn.current,R=zr(t,R));var fe=i.getDerivedStateFromProps;(Z=typeof fe=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==te||Y!==R)&&Wf(t,v,l,R),Bs=!1,Y=t.memoizedState,v.state=Y,Xo(t,l,v,d);var he=t.memoizedState;C!==te||Y!==he||kn.current||Bs?(typeof fe=="function"&&(mc(t,i,fe,l),he=t.memoizedState),(U=Bs||Uf(t,i,U,l,Y,he,R)||!1)?(Z||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(l,he,R),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(l,he,R)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=he),v.props=l,v.state=he,v.context=R,l=U):(typeof v.componentDidUpdate!="function"||C===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),l=!1)}return wc(e,t,i,l,p,d)}function wc(e,t,i,l,d,p){Jf(e,t);var v=(t.flags&128)!==0;if(!l&&!v)return d&&rf(t,i,!1),Ns(e,t,p);l=t.stateNode,Bv.current=t;var C=v&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&v?(t.child=Br(t,e.child,null,p),t.child=Br(t,null,C,p)):hn(e,t,C,p),t.memoizedState=l.state,d&&rf(t,i,!0),t.child}function tp(e){var t=e.stateNode;t.pendingContext?nf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nf(e,t.context,!1),sc(e,t.containerInfo)}function np(e,t,i,l,d){return Ur(),Ya(d),t.flags|=256,hn(e,t,i,l),t.child}var kc={dehydrated:null,treeContext:null,retryLane:0};function Sc(e){return{baseLanes:e,cachePool:null,transitions:null}}function sp(e,t,i){var l=t.pendingProps,d=St.current,p=!1,v=(t.flags&128)!==0,C;if((C=v)||(C=e!==null&&e.memoizedState===null?!1:(d&2)!==0),C?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),at(St,d&1),e===null)return Xa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(v=l.children,e=l.fallback,p?(l=t.mode,p=t.child,v={mode:"hidden",children:v},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=v):p=gl(v,l,0,null),e=yr(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=Sc(i),t.memoizedState=kc,e):Tc(t,v));if(d=e.memoizedState,d!==null&&(C=d.dehydrated,C!==null))return Wv(e,t,v,l,C,d,i);if(p){p=l.fallback,v=t.mode,d=e.child,C=d.sibling;var R={mode:"hidden",children:l.children};return(v&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=R,t.deletions=null):(l=Xs(d,R),l.subtreeFlags=d.subtreeFlags&14680064),C!==null?p=Xs(C,p):(p=yr(p,v,i,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,l=p,p=t.child,v=e.child.memoizedState,v=v===null?Sc(i):{baseLanes:v.baseLanes|i,cachePool:null,transitions:v.transitions},p.memoizedState=v,p.childLanes=e.childLanes&~i,t.memoizedState=kc,l}return p=e.child,e=p.sibling,l=Xs(p,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=i),l.return=t,l.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=l,t.memoizedState=null,l}function Tc(e,t){return t=gl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function sl(e,t,i,l){return l!==null&&Ya(l),Br(t,e.child,null,i),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wv(e,t,i,l,d,p,v){if(i)return t.flags&256?(t.flags&=-257,l=vc(Error(r(422))),sl(e,t,v,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=l.fallback,d=t.mode,l=gl({mode:"visible",children:l.children},d,0,null),p=yr(p,d,v,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Br(t,e.child,null,v),t.child.memoizedState=Sc(v),t.memoizedState=kc,p);if((t.mode&1)===0)return sl(e,t,v,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var C=l.dgst;return l=C,p=Error(r(419)),l=vc(p,l,void 0),sl(e,t,v,l)}if(C=(v&e.childLanes)!==0,Tn||C){if(l=Ht,l!==null){switch(v&-v){case 4:d=2;break;case 16:d=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(l.suspendedLanes|v))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,Ts(e,d),es(l,e,d,-1))}return $c(),l=vc(Error(r(421))),sl(e,t,v,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=ny.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,Mn=zs(d.nextSibling),Dn=t,ht=!0,Yn=null,e!==null&&(Fn[Un++]=ks,Fn[Un++]=Ss,Fn[Un++]=cr,ks=e.id,Ss=e.overflow,cr=t),t=Tc(t,l.children),t.flags|=4096,t)}function rp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),ec(e.return,t,i)}function bc(e,t,i,l,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=i,p.tailMode=d)}function ip(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(hn(e,t,l.children,i),l=St.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rp(e,i,t);else if(e.tag===19)rp(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(at(St,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&&Yo(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),bc(t,!1,d,i,p);break;case"backwards":for(i=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Yo(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}bc(t,!0,i,null,p);break;case"together":bc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ns(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),hr|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,i=Xs(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Xs(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Hv(e,t,i){switch(t.tag){case 3:tp(t),Ur();break;case 5:xf(t);break;case 1:Sn(t.type)&&Fo(t);break;case 4:sc(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;at(Go,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(at(St,St.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?sp(e,t,i):(at(St,St.current&1),e=Ns(e,t,i),e!==null?e.sibling:null);at(St,St.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return ip(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),at(St,St.current),l)break;return null;case 22:case 23:return t.lanes=0,Zf(e,t,i)}return Ns(e,t,i)}var op,Nc,lp,ap;op=function(e,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Nc=function(){},lp=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,fr(us.current);var p=null;switch(i){case"input":d=Le(e,d),l=Le(e,l),p=[];break;case"select":d=H({},d,{value:void 0}),l=H({},l,{value:void 0}),p=[];break;case"textarea":d=V(e,d),l=V(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Oo)}jn(i,l);var v;i=null;for(U in d)if(!l.hasOwnProperty(U)&&d.hasOwnProperty(U)&&d[U]!=null)if(U==="style"){var C=d[U];for(v in C)C.hasOwnProperty(v)&&(i||(i={}),i[v]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(a.hasOwnProperty(U)?p||(p=[]):(p=p||[]).push(U,null));for(U in l){var R=l[U];if(C=d!=null?d[U]:void 0,l.hasOwnProperty(U)&&R!==C&&(R!=null||C!=null))if(U==="style")if(C){for(v in C)!C.hasOwnProperty(v)||R&&R.hasOwnProperty(v)||(i||(i={}),i[v]="");for(v in R)R.hasOwnProperty(v)&&C[v]!==R[v]&&(i||(i={}),i[v]=R[v])}else i||(p||(p=[]),p.push(U,i)),i=R;else U==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,C=C?C.__html:void 0,R!=null&&C!==R&&(p=p||[]).push(U,R)):U==="children"?typeof R!="string"&&typeof R!="number"||(p=p||[]).push(U,""+R):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(a.hasOwnProperty(U)?(R!=null&&U==="onScroll"&&ut("scroll",e),p||C===R||(p=[])):(p=p||[]).push(U,R))}i&&(p=p||[]).push("style",i);var U=p;(t.updateQueue=U)&&(t.flags|=4)}},ap=function(e,t,i,l){i!==l&&(t.flags|=4)};function Ui(e,t){if(!ht)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ln(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function Vv(e,t,i){var l=t.pendingProps;switch(qa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(t),null;case 1:return Sn(t.type)&&$o(),ln(t),null;case 3:return l=t.stateNode,Vr(),dt(kn),dt(rn),oc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ho(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yn!==null&&(Pc(Yn),Yn=null))),Nc(e,t),ln(t),null;case 5:rc(t);var d=fr(Pi.current);if(i=t.type,e!==null&&t.stateNode!=null)lp(e,t,i,l,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(r(166));return ln(t),null}if(e=fr(us.current),Ho(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[cs]=t,l[Ai]=p,e=(t.mode&1)!==0,i){case"dialog":ut("cancel",l),ut("close",l);break;case"iframe":case"object":case"embed":ut("load",l);break;case"video":case"audio":for(d=0;d<_i.length;d++)ut(_i[d],l);break;case"source":ut("error",l);break;case"img":case"image":case"link":ut("error",l),ut("load",l);break;case"details":ut("toggle",l);break;case"input":Pt(l,p),ut("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},ut("invalid",l);break;case"textarea":ge(l,p),ut("invalid",l)}jn(i,p),d=null;for(var v in p)if(p.hasOwnProperty(v)){var C=p[v];v==="children"?typeof C=="string"?l.textContent!==C&&(p.suppressHydrationWarning!==!0&&Po(l.textContent,C,e),d=["children",C]):typeof C=="number"&&l.textContent!==""+C&&(p.suppressHydrationWarning!==!0&&Po(l.textContent,C,e),d=["children",""+C]):a.hasOwnProperty(v)&&C!=null&&v==="onScroll"&&ut("scroll",l)}switch(i){case"input":mt(l),Et(l,p,!0);break;case"textarea":mt(l),Ke(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Oo)}l=d,t.updateQueue=l,l!==null&&(t.flags|=4)}else{v=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ft(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=v.createElement(i,{is:l.is}):(e=v.createElement(i),i==="select"&&(v=e,l.multiple?v.multiple=!0:l.size&&(v.size=l.size))):e=v.createElementNS(e,i),e[cs]=t,e[Ai]=l,op(e,t,!1,!1),t.stateNode=e;e:{switch(v=Rn(i,l),i){case"dialog":ut("cancel",e),ut("close",e),d=l;break;case"iframe":case"object":case"embed":ut("load",e),d=l;break;case"video":case"audio":for(d=0;d<_i.length;d++)ut(_i[d],e);d=l;break;case"source":ut("error",e),d=l;break;case"img":case"image":case"link":ut("error",e),ut("load",e),d=l;break;case"details":ut("toggle",e),d=l;break;case"input":Pt(e,l),d=Le(e,l),ut("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=H({},l,{value:void 0}),ut("invalid",e);break;case"textarea":ge(e,l),d=V(e,l),ut("invalid",e);break;default:d=l}jn(i,d),C=d;for(p in C)if(C.hasOwnProperty(p)){var R=C[p];p==="style"?is(e,R):p==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&Xt(e,R)):p==="children"?typeof R=="string"?(i!=="textarea"||R!=="")&&nn(e,R):typeof R=="number"&&nn(e,""+R):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?R!=null&&p==="onScroll"&&ut("scroll",e):R!=null&&B(e,p,R,v))}switch(i){case"input":mt(e),Et(e,l,!1);break;case"textarea":mt(e),Ke(e);break;case"option":l.value!=null&&e.setAttribute("value",""+_e(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?Ot(e,!!l.multiple,p,!1):l.defaultValue!=null&&Ot(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Oo)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ln(t),null;case 6:if(e&&t.stateNode!=null)ap(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(i=fr(Pi.current),fr(us.current),Ho(t)){if(l=t.stateNode,i=t.memoizedProps,l[cs]=t,(p=l.nodeValue!==i)&&(e=Dn,e!==null))switch(e.tag){case 3:Po(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Po(l.nodeValue,i,(e.mode&1)!==0)}p&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[cs]=t,t.stateNode=l}return ln(t),null;case 13:if(dt(St),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ht&&Mn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)df(),Ur(),t.flags|=98560,p=!1;else if(p=Ho(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(r(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[cs]=t}else Ur(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ln(t),p=!1}else Yn!==null&&(Pc(Yn),Yn=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||(St.current&1)!==0?$t===0&&($t=3):$c())),t.updateQueue!==null&&(t.flags|=4),ln(t),null);case 4:return Vr(),Nc(e,t),e===null&&ji(t.stateNode.containerInfo),ln(t),null;case 10:return Ja(t.type._context),ln(t),null;case 17:return Sn(t.type)&&$o(),ln(t),null;case 19:if(dt(St),p=t.memoizedState,p===null)return ln(t),null;if(l=(t.flags&128)!==0,v=p.rendering,v===null)if(l)Ui(p,!1);else{if($t!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=Yo(e),v!==null){for(t.flags|=128,Ui(p,!1),l=v.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=i,i=t.child;i!==null;)p=i,e=l,p.flags&=14680066,v=p.alternate,v===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=v.childLanes,p.lanes=v.lanes,p.child=v.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=v.memoizedProps,p.memoizedState=v.memoizedState,p.updateQueue=v.updateQueue,p.type=v.type,e=v.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return at(St,St.current&1|2),t.child}e=e.sibling}p.tail!==null&&xt()>Xr&&(t.flags|=128,l=!0,Ui(p,!1),t.lanes=4194304)}else{if(!l)if(e=Yo(v),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),Ui(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!ht)return ln(t),null}else 2*xt()-p.renderingStartTime>Xr&&i!==1073741824&&(t.flags|=128,l=!0,Ui(p,!1),t.lanes=4194304);p.isBackwards?(v.sibling=t.child,t.child=v):(i=p.last,i!==null?i.sibling=v:t.child=v,p.last=v)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=xt(),t.sibling=null,i=St.current,at(St,l?i&1|2:i&1),t):(ln(t),null);case 22:case 23:return zc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(Ln&1073741824)!==0&&(ln(t),t.subtreeFlags&6&&(t.flags|=8192)):ln(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function Gv(e,t){switch(qa(t),t.tag){case 1:return Sn(t.type)&&$o(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vr(),dt(kn),dt(rn),oc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return rc(t),null;case 13:if(dt(St),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ur()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return dt(St),null;case 4:return Vr(),null;case 10:return Ja(t.type._context),null;case 22:case 23:return zc(),null;case 24:return null;default:return null}}var il=!1,an=!1,qv=typeof WeakSet=="function"?WeakSet:Set,pe=null;function qr(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){Nt(e,t,l)}else i.current=null}function Cc(e,t,i){try{i()}catch(l){Nt(e,t,l)}}var cp=!1;function Kv(e,t){if(za=No,e=Fd(),Ra(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var v=0,C=-1,R=-1,U=0,Z=0,te=e,Y=null;t:for(;;){for(var fe;te!==i||d!==0&&te.nodeType!==3||(C=v+d),te!==p||l!==0&&te.nodeType!==3||(R=v+l),te.nodeType===3&&(v+=te.nodeValue.length),(fe=te.firstChild)!==null;)Y=te,te=fe;for(;;){if(te===e)break t;if(Y===i&&++U===d&&(C=v),Y===p&&++Z===l&&(R=v),(fe=te.nextSibling)!==null)break;te=Y,Y=te.parentNode}te=fe}i=C===-1||R===-1?null:{start:C,end:R}}else i=null}i=i||{start:0,end:0}}else i=null;for($a={focusedElem:e,selectionRange:i},No=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var he=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(he!==null){var we=he.memoizedProps,At=he.memoizedState,$=t.stateNode,D=$.getSnapshotBeforeUpdate(t.elementType===t.type?we:Qn(t.type,we),At);$.__reactInternalSnapshotBeforeUpdate=D}break;case 3:var F=t.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ie){Nt(t,t.return,ie)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return he=cp,cp=!1,he}function Bi(e,t,i){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&Cc(t,i,p)}d=d.next}while(d!==l)}}function ol(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var l=i.create;i.destroy=l()}i=i.next}while(i!==t)}}function Ec(e){var t=e.ref;if(t!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof t=="function"?t(e):t.current=e}}function up(e){var t=e.alternate;t!==null&&(e.alternate=null,up(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[cs],delete t[Ai],delete t[Wa],delete t[Rv],delete t[Av])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dp(e){return e.tag===5||e.tag===3||e.tag===4}function fp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _c(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Oo));else if(l!==4&&(e=e.child,e!==null))for(_c(e,t,i),e=e.sibling;e!==null;)_c(e,t,i),e=e.sibling}function jc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(jc(e,t,i),e=e.sibling;e!==null;)jc(e,t,i),e=e.sibling}var Qt=null,Zn=!1;function Hs(e,t,i){for(i=i.child;i!==null;)pp(e,t,i),i=i.sibling}function pp(e,t,i){if(An&&typeof An.onCommitFiberUnmount=="function")try{An.onCommitFiberUnmount(nr,i)}catch{}switch(i.tag){case 5:an||qr(i,t);case 6:var l=Qt,d=Zn;Qt=null,Hs(e,t,i),Qt=l,Zn=d,Qt!==null&&(Zn?(e=Qt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):Qt.removeChild(i.stateNode));break;case 18:Qt!==null&&(Zn?(e=Qt,i=i.stateNode,e.nodeType===8?Ba(e.parentNode,i):e.nodeType===1&&Ba(e,i),wi(e)):Ba(Qt,i.stateNode));break;case 4:l=Qt,d=Zn,Qt=i.stateNode.containerInfo,Zn=!0,Hs(e,t,i),Qt=l,Zn=d;break;case 0:case 11:case 14:case 15:if(!an&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,v=p.destroy;p=p.tag,v!==void 0&&((p&2)!==0||(p&4)!==0)&&Cc(i,t,v),d=d.next}while(d!==l)}Hs(e,t,i);break;case 1:if(!an&&(qr(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(C){Nt(i,t,C)}Hs(e,t,i);break;case 21:Hs(e,t,i);break;case 22:i.mode&1?(an=(l=an)||i.memoizedState!==null,Hs(e,t,i),an=l):Hs(e,t,i);break;default:Hs(e,t,i)}}function hp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new qv),t.forEach(function(l){var d=sy.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function Jn(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var p=e,v=t,C=v;e:for(;C!==null;){switch(C.tag){case 5:Qt=C.stateNode,Zn=!1;break e;case 3:Qt=C.stateNode.containerInfo,Zn=!0;break e;case 4:Qt=C.stateNode.containerInfo,Zn=!0;break e}C=C.return}if(Qt===null)throw Error(r(160));pp(p,v,d),Qt=null,Zn=!1;var R=d.alternate;R!==null&&(R.return=null),d.return=null}catch(U){Nt(d,t,U)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mp(t,e),t=t.sibling}function mp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Jn(t,e),fs(e),l&4){try{Bi(3,e,e.return),ol(3,e)}catch(we){Nt(e,e.return,we)}try{Bi(5,e,e.return)}catch(we){Nt(e,e.return,we)}}break;case 1:Jn(t,e),fs(e),l&512&&i!==null&&qr(i,i.return);break;case 5:if(Jn(t,e),fs(e),l&512&&i!==null&&qr(i,i.return),e.flags&32){var d=e.stateNode;try{nn(d,"")}catch(we){Nt(e,e.return,we)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,v=i!==null?i.memoizedProps:p,C=e.type,R=e.updateQueue;if(e.updateQueue=null,R!==null)try{C==="input"&&p.type==="radio"&&p.name!=null&&We(d,p),Rn(C,v);var U=Rn(C,p);for(v=0;v<R.length;v+=2){var Z=R[v],te=R[v+1];Z==="style"?is(d,te):Z==="dangerouslySetInnerHTML"?Xt(d,te):Z==="children"?nn(d,te):B(d,Z,te,U)}switch(C){case"input":Ut(d,p);break;case"textarea":Be(d,p);break;case"select":var Y=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var fe=p.value;fe!=null?Ot(d,!!p.multiple,fe,!1):Y!==!!p.multiple&&(p.defaultValue!=null?Ot(d,!!p.multiple,p.defaultValue,!0):Ot(d,!!p.multiple,p.multiple?[]:"",!1))}d[Ai]=p}catch(we){Nt(e,e.return,we)}}break;case 6:if(Jn(t,e),fs(e),l&4){if(e.stateNode===null)throw Error(r(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(we){Nt(e,e.return,we)}}break;case 3:if(Jn(t,e),fs(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{wi(t.containerInfo)}catch(we){Nt(e,e.return,we)}break;case 4:Jn(t,e),fs(e);break;case 13:Jn(t,e),fs(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Ic=xt())),l&4&&hp(e);break;case 22:if(Z=i!==null&&i.memoizedState!==null,e.mode&1?(an=(U=an)||Z,Jn(t,e),an=U):Jn(t,e),fs(e),l&8192){if(U=e.memoizedState!==null,(e.stateNode.isHidden=U)&&!Z&&(e.mode&1)!==0)for(pe=e,Z=e.child;Z!==null;){for(te=pe=Z;pe!==null;){switch(Y=pe,fe=Y.child,Y.tag){case 0:case 11:case 14:case 15:Bi(4,Y,Y.return);break;case 1:qr(Y,Y.return);var he=Y.stateNode;if(typeof he.componentWillUnmount=="function"){l=Y,i=Y.return;try{t=l,he.props=t.memoizedProps,he.state=t.memoizedState,he.componentWillUnmount()}catch(we){Nt(l,i,we)}}break;case 5:qr(Y,Y.return);break;case 22:if(Y.memoizedState!==null){yp(te);continue}}fe!==null?(fe.return=Y,pe=fe):yp(te)}Z=Z.sibling}e:for(Z=null,te=e;;){if(te.tag===5){if(Z===null){Z=te;try{d=te.stateNode,U?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(C=te.stateNode,R=te.memoizedProps.style,v=R!=null&&R.hasOwnProperty("display")?R.display:null,C.style.display=un("display",v))}catch(we){Nt(e,e.return,we)}}}else if(te.tag===6){if(Z===null)try{te.stateNode.nodeValue=U?"":te.memoizedProps}catch(we){Nt(e,e.return,we)}}else if((te.tag!==22&&te.tag!==23||te.memoizedState===null||te===e)&&te.child!==null){te.child.return=te,te=te.child;continue}if(te===e)break e;for(;te.sibling===null;){if(te.return===null||te.return===e)break e;Z===te&&(Z=null),te=te.return}Z===te&&(Z=null),te.sibling.return=te.return,te=te.sibling}}break;case 19:Jn(t,e),fs(e),l&4&&hp(e);break;case 21:break;default:Jn(t,e),fs(e)}}function fs(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(dp(i)){var l=i;break e}i=i.return}throw Error(r(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(nn(d,""),l.flags&=-33);var p=fp(e);jc(e,p,d);break;case 3:case 4:var v=l.stateNode.containerInfo,C=fp(e);_c(e,C,v);break;default:throw Error(r(161))}}catch(R){Nt(e,e.return,R)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Xv(e,t,i){pe=e,gp(e)}function gp(e,t,i){for(var l=(e.mode&1)!==0;pe!==null;){var d=pe,p=d.child;if(d.tag===22&&l){var v=d.memoizedState!==null||il;if(!v){var C=d.alternate,R=C!==null&&C.memoizedState!==null||an;C=il;var U=an;if(il=v,(an=R)&&!U)for(pe=d;pe!==null;)v=pe,R=v.child,v.tag===22&&v.memoizedState!==null?xp(d):R!==null?(R.return=v,pe=R):xp(d);for(;p!==null;)pe=p,gp(p),p=p.sibling;pe=d,il=C,an=U}vp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,pe=p):vp(e)}}function vp(e){for(;pe!==null;){var t=pe;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:an||ol(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!an)if(i===null)l.componentDidMount();else{var d=t.elementType===t.type?i.memoizedProps:Qn(t.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=t.updateQueue;p!==null&&yf(t,p,l);break;case 3:var v=t.updateQueue;if(v!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}yf(t,v,i)}break;case 5:var C=t.stateNode;if(i===null&&t.flags&4){i=C;var R=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&i.focus();break;case"img":R.src&&(i.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var U=t.alternate;if(U!==null){var Z=U.memoizedState;if(Z!==null){var te=Z.dehydrated;te!==null&&wi(te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}an||t.flags&512&&Ec(t)}catch(Y){Nt(t,t.return,Y)}}if(t===e){pe=null;break}if(i=t.sibling,i!==null){i.return=t.return,pe=i;break}pe=t.return}}function yp(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var i=t.sibling;if(i!==null){i.return=t.return,pe=i;break}pe=t.return}}function xp(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{ol(4,t)}catch(R){Nt(t,i,R)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(R){Nt(t,d,R)}}var p=t.return;try{Ec(t)}catch(R){Nt(t,p,R)}break;case 5:var v=t.return;try{Ec(t)}catch(R){Nt(t,v,R)}}}catch(R){Nt(t,t.return,R)}if(t===e){pe=null;break}var C=t.sibling;if(C!==null){C.return=t.return,pe=C;break}pe=t.return}}var Yv=Math.ceil,ll=O.ReactCurrentDispatcher,Rc=O.ReactCurrentOwner,Hn=O.ReactCurrentBatchConfig,Qe=0,Ht=null,Mt=null,Zt=0,Ln=0,Kr=$s(0),$t=0,Wi=null,hr=0,al=0,Ac=0,Hi=null,bn=null,Ic=0,Xr=1/0,Cs=null,cl=!1,Dc=null,Vs=null,ul=!1,Gs=null,dl=0,Vi=0,Mc=null,fl=-1,pl=0;function mn(){return(Qe&6)!==0?xt():fl!==-1?fl:fl=xt()}function qs(e){return(e.mode&1)===0?1:(Qe&2)!==0&&Zt!==0?Zt&-Zt:Dv.transition!==null?(pl===0&&(pl=gi()),pl):(e=Xe,e!==0||(e=window.event,e=e===void 0?16:wd(e.type)),e)}function es(e,t,i,l){if(50<Vi)throw Vi=0,Mc=null,Error(r(185));or(e,i,l),((Qe&2)===0||e!==Ht)&&(e===Ht&&((Qe&2)===0&&(al|=i),$t===4&&Ks(e,Zt)),Nn(e,l),i===1&&Qe===0&&(t.mode&1)===0&&(Xr=xt()+500,Uo&&Us()))}function Nn(e,t){var i=e.callbackNode;So(e,t);var l=ir(e,e===Ht?Zt:0);if(l===0)i!==null&&xo(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&xo(i),t===1)e.tag===0?Iv(kp.bind(null,e)):of(kp.bind(null,e)),_v(function(){(Qe&6)===0&&Us()}),i=null;else{switch(re(l)){case 1:i=Is;break;case 4:i=as;break;case 16:i=Nr;break;case 536870912:i=wo;break;default:i=Nr}i=jp(i,wp.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function wp(e,t){if(fl=-1,pl=0,(Qe&6)!==0)throw Error(r(327));var i=e.callbackNode;if(Yr()&&e.callbackNode!==i)return null;var l=ir(e,e===Ht?Zt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=hl(e,l);else{t=l;var d=Qe;Qe|=2;var p=Tp();(Ht!==e||Zt!==t)&&(Cs=null,Xr=xt()+500,gr(e,t));do try{Jv();break}catch(C){Sp(e,C)}while(!0);Za(),ll.current=p,Qe=d,Mt!==null?t=0:(Ht=null,Zt=0,t=$t)}if(t!==0){if(t===2&&(d=mi(e),d!==0&&(l=d,t=Lc(e,d))),t===1)throw i=Wi,gr(e,0),Ks(e,l),Nn(e,xt()),i;if(t===6)Ks(e,l);else{if(d=e.current.alternate,(l&30)===0&&!Qv(d)&&(t=hl(e,l),t===2&&(p=mi(e),p!==0&&(l=p,t=Lc(e,p))),t===1))throw i=Wi,gr(e,0),Ks(e,l),Nn(e,xt()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(r(345));case 2:vr(e,bn,Cs);break;case 3:if(Ks(e,l),(l&130023424)===l&&(t=Ic+500-xt(),10<t)){if(ir(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){mn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Ua(vr.bind(null,e,bn,Cs),t);break}vr(e,bn,Cs);break;case 4:if(Ks(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var v=31-fn(l);p=1<<v,v=t[v],v>d&&(d=v),l&=~p}if(l=d,l=xt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Yv(l/1960))-l,10<l){e.timeoutHandle=Ua(vr.bind(null,e,bn,Cs),l);break}vr(e,bn,Cs);break;case 5:vr(e,bn,Cs);break;default:throw Error(r(329))}}}return Nn(e,xt()),e.callbackNode===i?wp.bind(null,e):null}function Lc(e,t){var i=Hi;return e.current.memoizedState.isDehydrated&&(gr(e,t).flags|=256),e=hl(e,t),e!==2&&(t=bn,bn=i,t!==null&&Pc(t)),e}function Pc(e){bn===null?bn=e:bn.push.apply(bn,e)}function Qv(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(!Xn(p(),d))return!1}catch{return!1}}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ks(e,t){for(t&=~Ac,t&=~al,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-fn(t),l=1<<i;e[i]=-1,t&=~l}}function kp(e){if((Qe&6)!==0)throw Error(r(327));Yr();var t=ir(e,0);if((t&1)===0)return Nn(e,xt()),null;var i=hl(e,t);if(e.tag!==0&&i===2){var l=mi(e);l!==0&&(t=l,i=Lc(e,l))}if(i===1)throw i=Wi,gr(e,0),Ks(e,t),Nn(e,xt()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vr(e,bn,Cs),Nn(e,xt()),null}function Oc(e,t){var i=Qe;Qe|=1;try{return e(t)}finally{Qe=i,Qe===0&&(Xr=xt()+500,Uo&&Us())}}function mr(e){Gs!==null&&Gs.tag===0&&(Qe&6)===0&&Yr();var t=Qe;Qe|=1;var i=Hn.transition,l=Xe;try{if(Hn.transition=null,Xe=1,e)return e()}finally{Xe=l,Hn.transition=i,Qe=t,(Qe&6)===0&&Us()}}function zc(){Ln=Kr.current,dt(Kr)}function gr(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,Ev(i)),Mt!==null)for(i=Mt.return;i!==null;){var l=i;switch(qa(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&$o();break;case 3:Vr(),dt(kn),dt(rn),oc();break;case 5:rc(l);break;case 4:Vr();break;case 13:dt(St);break;case 19:dt(St);break;case 10:Ja(l.type._context);break;case 22:case 23:zc()}i=i.return}if(Ht=e,Mt=e=Xs(e.current,null),Zt=Ln=t,$t=0,Wi=null,Ac=al=hr=0,bn=Hi=null,dr!==null){for(t=0;t<dr.length;t++)if(i=dr[t],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var v=p.next;p.next=d,l.next=v}i.pending=l}dr=null}return e}function Sp(e,t){do{var i=Mt;try{if(Za(),Qo.current=tl,Zo){for(var l=Tt.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}Zo=!1}if(pr=0,Wt=zt=Tt=null,Oi=!1,zi=0,Rc.current=null,i===null||i.return===null){$t=1,Wi=t,Mt=null;break}e:{var p=e,v=i.return,C=i,R=t;if(t=Zt,C.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var U=R,Z=C,te=Z.tag;if((Z.mode&1)===0&&(te===0||te===11||te===15)){var Y=Z.alternate;Y?(Z.updateQueue=Y.updateQueue,Z.memoizedState=Y.memoizedState,Z.lanes=Y.lanes):(Z.updateQueue=null,Z.memoizedState=null)}var fe=qf(v);if(fe!==null){fe.flags&=-257,Kf(fe,v,C,p,t),fe.mode&1&&Gf(p,U,t),t=fe,R=U;var he=t.updateQueue;if(he===null){var we=new Set;we.add(R),t.updateQueue=we}else he.add(R);break e}else{if((t&1)===0){Gf(p,U,t),$c();break e}R=Error(r(426))}}else if(ht&&C.mode&1){var At=qf(v);if(At!==null){(At.flags&65536)===0&&(At.flags|=256),Kf(At,v,C,p,t),Ya(Gr(R,C));break e}}p=R=Gr(R,C),$t!==4&&($t=2),Hi===null?Hi=[p]:Hi.push(p),p=v;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var $=Hf(p,R,t);vf(p,$);break e;case 1:C=R;var D=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof D.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Vs===null||!Vs.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var ie=Vf(p,C,t);vf(p,ie);break e}}p=p.return}while(p!==null)}Np(i)}catch(Se){t=Se,Mt===i&&i!==null&&(Mt=i=i.return);continue}break}while(!0)}function Tp(){var e=ll.current;return ll.current=tl,e===null?tl:e}function $c(){($t===0||$t===3||$t===2)&&($t=4),Ht===null||(hr&268435455)===0&&(al&268435455)===0||Ks(Ht,Zt)}function hl(e,t){var i=Qe;Qe|=2;var l=Tp();(Ht!==e||Zt!==t)&&(Cs=null,gr(e,t));do try{Zv();break}catch(d){Sp(e,d)}while(!0);if(Za(),Qe=i,ll.current=l,Mt!==null)throw Error(r(261));return Ht=null,Zt=0,$t}function Zv(){for(;Mt!==null;)bp(Mt)}function Jv(){for(;Mt!==null&&!va();)bp(Mt)}function bp(e){var t=_p(e.alternate,e,Ln);e.memoizedProps=e.pendingProps,t===null?Np(e):Mt=t,Rc.current=null}function Np(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=Vv(i,t,Ln),i!==null){Mt=i;return}}else{if(i=Gv(i,t),i!==null){i.flags&=32767,Mt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{$t=6,Mt=null;return}}if(t=t.sibling,t!==null){Mt=t;return}Mt=t=e}while(t!==null);$t===0&&($t=5)}function vr(e,t,i){var l=Xe,d=Hn.transition;try{Hn.transition=null,Xe=1,ey(e,t,i,l)}finally{Hn.transition=d,Xe=l}return null}function ey(e,t,i,l){do Yr();while(Gs!==null);if((Qe&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(To(e,p),e===Ht&&(Mt=Ht=null,Zt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||ul||(ul=!0,jp(Nr,function(){return Yr(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Hn.transition,Hn.transition=null;var v=Xe;Xe=1;var C=Qe;Qe|=4,Rc.current=null,Kv(e,i),mp(i,e),wv($a),No=!!za,$a=za=null,e.current=i,Xv(i),ya(),Qe=C,Xe=v,Hn.transition=p}else e.current=i;if(ul&&(ul=!1,Gs=e,dl=d),p=e.pendingLanes,p===0&&(Vs=null),Cr(i.stateNode),Nn(e,xt()),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(cl)throw cl=!1,e=Dc,Dc=null,e;return(dl&1)!==0&&e.tag!==0&&Yr(),p=e.pendingLanes,(p&1)!==0?e===Mc?Vi++:(Vi=0,Mc=e):Vi=0,Us(),null}function Yr(){if(Gs!==null){var e=re(dl),t=Hn.transition,i=Xe;try{if(Hn.transition=null,Xe=16>e?16:e,Gs===null)var l=!1;else{if(e=Gs,Gs=null,dl=0,(Qe&6)!==0)throw Error(r(331));var d=Qe;for(Qe|=4,pe=e.current;pe!==null;){var p=pe,v=p.child;if((pe.flags&16)!==0){var C=p.deletions;if(C!==null){for(var R=0;R<C.length;R++){var U=C[R];for(pe=U;pe!==null;){var Z=pe;switch(Z.tag){case 0:case 11:case 15:Bi(8,Z,p)}var te=Z.child;if(te!==null)te.return=Z,pe=te;else for(;pe!==null;){Z=pe;var Y=Z.sibling,fe=Z.return;if(up(Z),Z===U){pe=null;break}if(Y!==null){Y.return=fe,pe=Y;break}pe=fe}}}var he=p.alternate;if(he!==null){var we=he.child;if(we!==null){he.child=null;do{var At=we.sibling;we.sibling=null,we=At}while(we!==null)}}pe=p}}if((p.subtreeFlags&2064)!==0&&v!==null)v.return=p,pe=v;else e:for(;pe!==null;){if(p=pe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Bi(9,p,p.return)}var $=p.sibling;if($!==null){$.return=p.return,pe=$;break e}pe=p.return}}var D=e.current;for(pe=D;pe!==null;){v=pe;var F=v.child;if((v.subtreeFlags&2064)!==0&&F!==null)F.return=v,pe=F;else e:for(v=D;pe!==null;){if(C=pe,(C.flags&2048)!==0)try{switch(C.tag){case 0:case 11:case 15:ol(9,C)}}catch(Se){Nt(C,C.return,Se)}if(C===v){pe=null;break e}var ie=C.sibling;if(ie!==null){ie.return=C.return,pe=ie;break e}pe=C.return}}if(Qe=d,Us(),An&&typeof An.onPostCommitFiberRoot=="function")try{An.onPostCommitFiberRoot(nr,e)}catch{}l=!0}return l}finally{Xe=i,Hn.transition=t}}return!1}function Cp(e,t,i){t=Gr(i,t),t=Hf(e,t,1),e=Ws(e,t,1),t=mn(),e!==null&&(or(e,1,t),Nn(e,t))}function Nt(e,t,i){if(e.tag===3)Cp(e,e,i);else for(;t!==null;){if(t.tag===3){Cp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Vs===null||!Vs.has(l))){e=Gr(i,e),e=Vf(t,e,1),t=Ws(t,e,1),e=mn(),t!==null&&(or(t,1,e),Nn(t,e));break}}t=t.return}}function ty(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=mn(),e.pingedLanes|=e.suspendedLanes&i,Ht===e&&(Zt&i)===i&&($t===4||$t===3&&(Zt&130023424)===Zt&&500>xt()-Ic?gr(e,0):Ac|=i),Nn(e,t)}function Ep(e,t){t===0&&((e.mode&1)===0?t=1:(t=_r,_r<<=1,(_r&130023424)===0&&(_r=4194304)));var i=mn();e=Ts(e,t),e!==null&&(or(e,t,i),Nn(e,i))}function ny(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Ep(e,i)}function sy(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(r(314))}l!==null&&l.delete(t),Ep(e,i)}var _p;_p=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||kn.current)Tn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return Tn=!1,Hv(e,t,i);Tn=(e.flags&131072)!==0}else Tn=!1,ht&&(t.flags&1048576)!==0&&lf(t,Wo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;rl(e,t),e=t.pendingProps;var d=zr(t,rn.current);Hr(t,i),d=cc(null,t,l,e,d,i);var p=uc();return t.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Sn(l)?(p=!0,Fo(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,nc(t),d.updater=nl,t.stateNode=d,d._reactInternals=t,gc(t,l,e,i),t=wc(null,t,l,!0,p,i)):(t.tag=0,ht&&p&&Ga(t),hn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(rl(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=iy(l),e=Qn(l,e),d){case 0:t=xc(null,t,l,e,i);break e;case 1:t=ep(null,t,l,e,i);break e;case 11:t=Xf(null,t,l,e,i);break e;case 14:t=Yf(null,t,l,Qn(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:Qn(l,d),xc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),ep(e,t,l,d,i);case 3:e:{if(tp(t),e===null)throw Error(r(387));l=t.pendingProps,p=t.memoizedState,d=p.element,gf(e,t),Xo(t,l,null,i);var v=t.memoizedState;if(l=v.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=Gr(Error(r(423)),t),t=np(e,t,l,i,d);break e}else if(l!==d){d=Gr(Error(r(424)),t),t=np(e,t,l,i,d);break e}else for(Mn=zs(t.stateNode.containerInfo.firstChild),Dn=t,ht=!0,Yn=null,i=hf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ur(),l===d){t=Ns(e,t,i);break e}hn(e,t,l,i)}t=t.child}return t;case 5:return xf(t),e===null&&Xa(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,v=d.children,Fa(l,d)?v=null:p!==null&&Fa(l,p)&&(t.flags|=32),Jf(e,t),hn(e,t,v,i),t.child;case 6:return e===null&&Xa(t),null;case 13:return sp(e,t,i);case 4:return sc(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Br(t,null,l,i):hn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),Xf(e,t,l,d,i);case 7:return hn(e,t,t.pendingProps,i),t.child;case 8:return hn(e,t,t.pendingProps.children,i),t.child;case 12:return hn(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(l=t.type._context,d=t.pendingProps,p=t.memoizedProps,v=d.value,at(Go,l._currentValue),l._currentValue=v,p!==null)if(Xn(p.value,v)){if(p.children===d.children&&!kn.current){t=Ns(e,t,i);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var C=p.dependencies;if(C!==null){v=p.child;for(var R=C.firstContext;R!==null;){if(R.context===l){if(p.tag===1){R=bs(-1,i&-i),R.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var Z=U.pending;Z===null?R.next=R:(R.next=Z.next,Z.next=R),U.pending=R}}p.lanes|=i,R=p.alternate,R!==null&&(R.lanes|=i),ec(p.return,i,t),C.lanes|=i;break}R=R.next}}else if(p.tag===10)v=p.type===t.type?null:p.child;else if(p.tag===18){if(v=p.return,v===null)throw Error(r(341));v.lanes|=i,C=v.alternate,C!==null&&(C.lanes|=i),ec(v,i,t),v=p.sibling}else v=p.child;if(v!==null)v.return=p;else for(v=p;v!==null;){if(v===t){v=null;break}if(p=v.sibling,p!==null){p.return=v.return,v=p;break}v=v.return}p=v}hn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,Hr(t,i),d=Bn(d),l=l(d),t.flags|=1,hn(e,t,l,i),t.child;case 14:return l=t.type,d=Qn(l,t.pendingProps),d=Qn(l.type,d),Yf(e,t,l,d,i);case 15:return Qf(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),rl(e,t),t.tag=1,Sn(l)?(e=!0,Fo(t)):e=!1,Hr(t,i),Bf(t,l,d),gc(t,l,d,i),wc(null,t,l,!0,e,i);case 19:return ip(e,t,i);case 22:return Zf(e,t,i)}throw Error(r(156,t.tag))};function jp(e,t){return hi(e,t)}function ry(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 Vn(e,t,i,l){return new ry(e,t,i,l)}function Fc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function iy(e){if(typeof e=="function")return Fc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ke)return 11;if(e===Q)return 14}return 2}function Xs(e,t){var i=e.alternate;return i===null?(i=Vn(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 ml(e,t,i,l,d,p){var v=2;if(l=e,typeof e=="function")Fc(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case K:return yr(i.children,d,p,t);case G:v=8,d|=8;break;case ae:return e=Vn(12,i,t,d|2),e.elementType=ae,e.lanes=p,e;case Ne:return e=Vn(13,i,t,d),e.elementType=Ne,e.lanes=p,e;case Fe:return e=Vn(19,i,t,d),e.elementType=Fe,e.lanes=p,e;case ce:return gl(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case de:v=10;break e;case oe:v=9;break e;case ke:v=11;break e;case Q:v=14;break e;case se:v=16,l=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return t=Vn(v,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function yr(e,t,i,l){return e=Vn(7,e,l,t),e.lanes=i,e}function gl(e,t,i,l){return e=Vn(22,e,l,t),e.elementType=ce,e.lanes=i,e.stateNode={isHidden:!1},e}function Uc(e,t,i){return e=Vn(6,e,null,t),e.lanes=i,e}function Bc(e,t,i){return t=Vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function oy(e,t,i,l,d){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vi(0),this.expirationTimes=vi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vi(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Wc(e,t,i,l,d,p,v,C,R){return e=new oy(e,t,i,C,R),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Vn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},nc(p),e}function ly(e,t,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q,key:l==null?null:""+l,children:e,containerInfo:t,implementation:i}}function Rp(e){if(!e)return Fs;e=e._reactInternals;e:{if(et(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(Sn(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(Sn(i))return sf(e,i,t)}return t}function Ap(e,t,i,l,d,p,v,C,R){return e=Wc(i,l,!0,e,d,p,v,C,R),e.context=Rp(null),i=e.current,l=mn(),d=qs(i),p=bs(l,d),p.callback=t??null,Ws(i,p,d),e.current.lanes=d,or(e,d,l),Nn(e,l),e}function vl(e,t,i,l){var d=t.current,p=mn(),v=qs(d);return i=Rp(i),t.context===null?t.context=i:t.pendingContext=i,t=bs(p,v),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Ws(d,t,v),e!==null&&(es(e,d,v,p),Ko(e,d,v)),v}function yl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Hc(e,t){Ip(e,t),(e=e.alternate)&&Ip(e,t)}function ay(){return null}var Dp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Vc(e){this._internalRoot=e}xl.prototype.render=Vc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));vl(e,t,null,null)},xl.prototype.unmount=Vc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mr(function(){vl(null,e,null,null)}),t[xs]=null}};function xl(e){this._internalRoot=e}xl.prototype.unstable_scheduleHydration=function(e){if(e){var t=ye();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ls.length&&t!==0&&t<Ls[i].priority;i++);Ls.splice(i,0,e),i===0&&yd(e)}};function Gc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function wl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Mp(){}function cy(e,t,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var U=yl(v);p.call(U)}}var v=Ap(t,l,e,0,null,!1,!1,"",Mp);return e._reactRootContainer=v,e[xs]=v.current,ji(e.nodeType===8?e.parentNode:e),mr(),v}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var C=l;l=function(){var U=yl(R);C.call(U)}}var R=Wc(e,0,!1,null,null,!1,!1,"",Mp);return e._reactRootContainer=R,e[xs]=R.current,ji(e.nodeType===8?e.parentNode:e),mr(function(){vl(t,R,i,l)}),R}function kl(e,t,i,l,d){var p=i._reactRootContainer;if(p){var v=p;if(typeof d=="function"){var C=d;d=function(){var R=yl(v);C.call(R)}}vl(t,v,e,d)}else v=cy(i,t,e,d,l);return yl(v)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=rr(t.pendingLanes);i!==0&&(Ms(t,i|1),Nn(t,xt()),(Qe&6)===0&&(Xr=xt()+500,Us()))}break;case 13:mr(function(){var l=Ts(e,1);if(l!==null){var d=mn();es(l,e,1,d)}}),Hc(e,1)}},z=function(e){if(e.tag===13){var t=Ts(e,134217728);if(t!==null){var i=mn();es(t,e,134217728,i)}Hc(e,134217728)}},X=function(e){if(e.tag===13){var t=qs(e),i=Ts(e,t);if(i!==null){var l=mn();es(i,e,t,l)}Hc(e,t)}},ye=function(){return Xe},Ce=function(e,t){var i=Xe;try{return Xe=e,t()}finally{Xe=i}},Bt=function(e,t,i){switch(t){case"input":if(Ut(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=zo(l);if(!d)throw Error(r(90));Me(l),Ut(l,d)}}}break;case"textarea":Be(e,i);break;case"select":t=i.value,t!=null&&Ot(e,!!i.multiple,t,!1)}},ve=Oc,Re=mr;var uy={usingClientEntryPoint:!1,Events:[Ii,Pr,zo,le,ne,Oc]},Gi={findFiberByHostInstance:lr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dy={bundleType:Gi.bundleType,version:Gi.version,rendererPackageName:Gi.rendererPackageName,rendererConfig:Gi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=br(e),e===null?null:e.stateNode},findFiberByHostInstance:Gi.findFiberByHostInstance||ay,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 Sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sl.isDisabled&&Sl.supportsFiber)try{nr=Sl.inject(dy),An=Sl}catch{}}return Cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uy,Cn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gc(t))throw Error(r(200));return ly(e,t,null,i)},Cn.createRoot=function(e,t){if(!Gc(e))throw Error(r(299));var i=!1,l="",d=Dp;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Wc(e,1,!1,null,null,i,!1,l,d),e[xs]=t.current,ji(e.nodeType===8?e.parentNode:e),new Vc(t)},Cn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=br(t),e=e===null?null:e.stateNode,e},Cn.flushSync=function(e){return mr(e)},Cn.hydrate=function(e,t,i){if(!wl(t))throw Error(r(200));return kl(null,e,t,!0,i)},Cn.hydrateRoot=function(e,t,i){if(!Gc(e))throw Error(r(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",v=Dp;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),t=Ap(t,null,e,1,i??null,d,!1,p,v),e[xs]=t.current,ji(e),l)for(e=0;e<l.length;e++)i=l[e],d=i._getVersion,d=d(i._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[i,d]:t.mutableSourceEagerHydrationData.push(i,d);return new xl(t)},Cn.render=function(e,t,i){if(!wl(t))throw Error(r(200));return kl(null,e,t,!1,i)},Cn.unmountComponentAtNode=function(e){if(!wl(e))throw Error(r(40));return e._reactRootContainer?(mr(function(){kl(null,null,e,!1,function(){e._reactRootContainer=null,e[xs]=null})}),!0):!1},Cn.unstable_batchedUpdates=Oc,Cn.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!wl(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return kl(e,t,i,!1,l)},Cn.version="18.3.1-next-f1338f8080-20240426",Cn}var Bp;function xm(){if(Bp)return Xc.exports;Bp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(s){console.error(s)}}return n(),Xc.exports=wy(),Xc.exports}var Wp;function ky(){if(Wp)return Tl;Wp=1;var n=xm();return Tl.createRoot=n.createRoot,Tl.hydrateRoot=n.hydrateRoot,Tl}var Sy=ky();const Ty=ym(Sy),Hp=n=>{let s;const r=new Set,o=(g,x)=>{const k=typeof g=="function"?g(s):g;if(!Object.is(k,s)){const y=s;s=x??(typeof k!="object"||k===null)?k:Object.assign({},s,k),r.forEach(N=>N(s,y))}},a=()=>s,h={setState:o,getState:a,getInitialState:()=>m,subscribe:g=>(r.add(g),()=>r.delete(g))},m=s=n(o,a,h);return h},by=(n=>n?Hp(n):Hp),Ny=n=>n;function Cy(n,s=Ny){const r=it.useSyncExternalStore(n.subscribe,it.useCallback(()=>s(n.getState()),[n,s]),it.useCallback(()=>s(n.getInitialState()),[n,s]));return it.useDebugValue(r),r}const Ey=n=>{const s=by(n),r=o=>Cy(s,o);return Object.assign(r,s),r},_y=(n=>Ey),wm="agentpane:machines",km="agentpane:active-machine";function jy(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function Sm(n){return`${n}.repoburg.com`}function Tm(n){const s=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return s?s[1]:null}function bm(n,s){try{const r=localStorage.getItem(n);return r==null?s:JSON.parse(r)}catch{return s}}function Nm(n,s){try{localStorage.setItem(n,JSON.stringify(s))}catch{}}function Cm(){return bm(wm,[]).filter(s=>jy(s.mahlas)&&s.hostname===Sm(s.mahlas))}function Ry(n){const s={mahlas:n,hostname:Sm(n),lastConnectedAt:new Date().toISOString()},r=Cm(),o=[s,...r.filter(a=>a.mahlas!==n)];return Nm(wm,o),s}function Ay(){const n=bm(km,null);return n?Cm().find(s=>s.mahlas===n)??null:null}function Iy(n){Nm(km,n)}function Dy(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const s=Tm(n);s&&(Ry(s),Iy(s))}const Vp="http://localhost:9998",My=["agent.repoburg.com"];function ms(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),s=n.get("bport");if(s)return`http://localhost:${s}`;const r=n.get("host");if(r)return`https://${r}`;const o=window.location.hostname;if(My.includes(o))return Vp;if(Tm(o))return"";const a=Ay();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Vp}const Ly="/api";async function uo(n,s,r){const o=await fetch(`${ms()}${Ly}${s}`,{method:n,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!o.ok){let a=`${o.status} ${o.statusText}`;try{const u=await o.json();u!=null&&u.error&&(a=`${a} — ${u.error}`)}catch{}throw new Error(`${n} ${s} failed: ${a}`)}return o.json()}function vn(n){return uo("GET",n)}function Ct(n,s){return uo("POST",n,s)}function ia(n){return uo("DELETE",n)}function gs(n,s){return uo("PATCH",n,s)}function Py(n,s){return uo("PUT",n,s)}function Oy(){return vn("/sessions")}function bl(n){return vn(`/sessions/${n}`)}function $u(n){return Ct("/sessions",n)}function Gp(n){return ia(`/sessions/${n}`)}function Em(n,s,r){return Ct(`/sessions/${n}/turns`,{user_prompt:s,...r!=null&&r.length?{attachments:r}:{}})}function zy(n){return Ct(`/sessions/${n}/cancel`)}function $y(n,s){return gs(`/sessions/${n}`,{title:s})}function qp(n){return gs(`/sessions/${n}`,{lifecycle:"finished"})}function Kp(n){return gs(`/sessions/${n}`,{lifecycle:"working"})}function Fy(n,s){return gs(`/sessions/${n}`,{starred:s})}function Xp(n){return gs(`/sessions/${n}`,{has_unreviewed:0})}function Uy(n,s,r,o){const a={model:s,model_reasoning_effort:r};return o!==void 0&&(a.runtime_type=o),gs(`/sessions/${n}`,a)}function By(n,s){return gs(`/sessions/${n}`,{runtime_config:s})}function Wy(n,s){return Ct(`/sessions/${n}/rewind`,{turn_id:s})}function Hy(n){return Ct(`/sessions/${n}/restore`,{})}function Vy(n,s,r){return Ct(`/sessions/${n}/branch`,{turn_id:s,title:r})}function _m(){return vn("/workspaces")}function Gy(n,s){return Ct("/workspaces",{path:n,label:s})}function qy(n){return Ct("/workspaces/hide",{path:n})}async function Ky(){const n=await fetch(`${ms()}/api/pick-directory`);if(n.status===204)return{cancelled:!0};if(!n.ok)throw new Error(`GET /api/pick-directory failed: ${n.status} ${n.statusText}`);return n.json()}function jm(){return vn("/folders")}function Xy(n,s){return Ct("/folders",{workspace_path:n,name:s})}function Yp(n,s){return gs(`/folders/${n}`,s)}function Yy(n){return ia(`/folders/${n}`)}function Qy(n){return Ct("/sessions/reorder",{moves:n})}function ai(n){return n.status==="pending"||n.status==="running"}function Rm(n){return!!(n!=null&&n.turns.some(ai))}function oa(n){return n?n.turns.some(ai)||(n.threads??[]).some(s=>(s.turns??[]).some(ai)):!1}async function Zy(n,s){const r=await Promise.allSettled(n.map(u=>s(u))),o=new Map;let a=null;return r.forEach((u,f)=>{var h;u.status==="fulfilled"?o.set(n[f],u.value):a===null&&(a=((h=u.reason)==null?void 0:h.message)??"Request failed")}),{updated:o,firstError:a}}function Qp(n,s){const r={...n.sessionDetails};s.forEach(f=>delete r[f]);const o=n.openTabs.filter(f=>!s.has(f));let a=n.activeSessionId,u=n.activeTurnIndex;if(a&&s.has(a)){a=o.length>0?o[o.length-1]:null;const f=a?r[a]:null;u=f&&f.turns.length>0?f.turns.length-1:0}return{sessions:n.sessions.filter(f=>!s.has(f.id)),sessionDetails:r,openTabs:o,activeSessionId:a,activeTurnIndex:u}}async function Zp(n,s,r,o,a){if(r.length===0)return;n({error:null});const{updated:u,firstError:f}=await Zy(r,o);u.size>0&&n(m=>({sessions:m.sessions.map(g=>u.get(g.id)??g)}));const h=r.length-u.size;if(h===0)s().addToast("info",`${r.length} session${r.length===1?"":"s"} ${a}`);else{n({error:f});const m=a[0].toUpperCase()+a.slice(1);s().addToast(h===r.length?"error":"warn",`${m} ${u.size} of ${r.length} — ${h} failed`)}}const Jy=(n,s)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{var r;try{const o=localStorage.getItem("agentpane:last-model-config");o&&n({lastModelConfig:JSON.parse(o)})}catch{}n({loading:!0,error:null});try{const[o,a,u]=await Promise.all([Oy(),_m(),jm()]);n({sessions:o,workspaces:a,folders:u,loading:!1});const f=new URLSearchParams(window.location.search),h=f.get("session"),m=f.get("thread"),g=h&&o.some(x=>x.id===h)?h:(r=o[0])==null?void 0:r.id;g&&!s().activeSessionId&&await s().selectSession(g),m&&n({activeRightTab:"threads",deepLinkThreadId:m})}catch(o){n({loading:!1,error:o.message})}},selectSession:async r=>{if(s().sessionDetails[r]){const o=s().sessionDetails[r];n({activeSessionId:r,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",activeAppTabId:null,openTabs:s().openTabs.includes(r)?s().openTabs:[...s().openTabs,r]}),o.has_unreviewed===1&&(Xp(r).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[r]:{...o,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const o=await bl(r);n(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeSessionId:r,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",activeAppTabId:null,loading:!1})),o.has_unreviewed===1&&(Xp(r).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[r]:{...o,has_unreviewed:0}}})))}catch(o){n({loading:!1,error:o.message})}},closeTab:r=>{n(o=>{const a=o.openTabs.filter(u=>u!==r);if(o.activeSessionId===r&&a.length>0){const u=a[a.length-1],f=o.sessionDetails[u];return{openTabs:a,activeSessionId:u,activeTurnIndex:f&&f.turns.length>0?f.turns.length-1:0}}return{openTabs:a,activeSessionId:o.activeSessionId===r?null:o.activeSessionId}})},updateModelConfig:async(r,o,a)=>{const u=s().activeSessionId;if(u){n({error:null});try{const f=await Uy(u,r,o,a),h={provider:f.runtime_type,model:f.model??"",reasoning:f.model_reasoning_effort??""};n({lastModelConfig:h}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(h)),n(m=>({sessions:m.sessions.map(g=>g.id===u?f:g),sessionDetails:m.sessionDetails[u]?{...m.sessionDetails,[u]:{...m.sessionDetails[u],model:f.model,model_reasoning_effort:f.model_reasoning_effort,external_thread_id:f.external_thread_id}}:m.sessionDetails})),await s().refreshActiveSession()}catch(f){n({error:f.message}),s().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async r=>{n({error:null});try{const o=await $u(r);n(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const a={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};n({lastModelConfig:a}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(a)),await s().selectSession(o.id),s().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),s().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){n({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},addSession:r=>{n(o=>({sessions:o.sessions.some(a=>a.id===r.id)?o.sessions:[r,...o.sessions]}))},deleteSession:async r=>{var a;n({error:null});const o=(a=s().sessions.find(u=>u.id===r))==null?void 0:a.title;try{await Gp(r),n(u=>Qp(u,new Set([r]))),s().addLogEntry("INFO",`Session deleted — ${r.slice(0,8)}`),s().addToast("info",`Session "${o||r.slice(0,8)}" deleted`)}catch(u){n({error:u.message}),s().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(r,o)=>{n({error:null});try{const a=await $y(r,o.trim());n(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],title:a.title}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async r=>{n({error:null});try{const o=await qp(r);n(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session marked as finished")}catch(o){n({error:o.message}),s().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async r=>{await Zp(n,s,r,qp,"marked as finished")},toggleStar:async r=>{const o=s().sessions.find(a=>a.id===r);if(o){n({error:null});try{const a=await Fy(r,o.starred?0:1);n(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],starred:a.starred}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async r=>{n({error:null});try{const o=await Kp(r);n(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session reopened")}catch(o){n({error:o.message}),s().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async r=>{await Zp(n,s,r,Kp,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;n({error:null});const o=await Promise.allSettled(r.map(f=>Gp(f))),a=new Set;if(o.forEach((f,h)=>{f.status==="fulfilled"&&a.add(r[h])}),a.size===0){n({error:"Failed to delete sessions"}),s().addToast("error","Failed to delete sessions");return}n(f=>Qp(f,a)),s().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const u=r.length-a.size;u===0?s().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(n({error:"One or more sessions failed to delete"}),s().addToast("warn",`Deleted ${a.size} of ${r.length} — ${u} failed`))},submitPrompt:async(r,o)=>{const a=s().activeSessionId;if(a){n({error:null,submittingPrompt:r}),n(u=>{const f=u.sessionDetails[a];return f?{sessionDetails:{...u.sessionDetails,[a]:{...f,is_running:1,status:"running"}},sessions:u.sessions.map(h=>h.id===a?{...h,is_running:1,status:"running"}:h)}:{}});try{const u=await Em(a,r,o);s().addLogEntry("INFO",`Turn submitted — "${r.slice(0,40)}"`),n(f=>{const h=f.sessionDetails[a];if(!h)return{submittingPrompt:null};const m={...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 m=oa(h)?1:0;return{sessionDetails:{...f.sessionDetails,[a]:{...h,is_running:m,status:m?"running":"active"}},sessions:f.sessions.map(g=>g.id===a?{...g,is_running:m,status:m?"running":"active"}:g)}})}}},cancelTurn:async()=>{const r=s().activeSessionId;if(r)try{await zy(r)}catch(o){n({error:o.message})}},rewindToTurn:async(r,o)=>{n({error:null});try{const a=await Wy(r,o),u=await bl(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 Hy(r),a=await bl(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 Vy(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 By(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 bl(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})}}}),ex=(n,s)=>({workspaces:[],addWorkspace:async r=>{n({error:null});try{const o=await Gy(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 qy(r);const o=await _m();n({workspaces:o}),s().addToast("info","Workspace hidden")}catch(o){s().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async r=>{n({error:null});try{const o=s().lastModelConfig,a=await $u({cwd:r,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});n(u=>({sessions:[a,...u.sessions]})),await s().selectSession(a.id),s().addLogEntry("INFO",`Session created in ${r} — ${a.id.slice(0,8)}`),s().addToast("success",`Session created in ${r.split("/").pop()||r}`)}catch(o){n({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const r=await Ky();if(r.cancelled||!r.path)return;await s().addWorkspace(r.path)}catch(r){s().addToast("error",`Failed to pick directory — ${r.message}`)}}}),Sr=new Map,Fu=new Map,Uu=new Map,Bu=new Map;function tx(n,s){Sr.set(n,s)}function nx(n){Sr.delete(n)}function Zc(n,s){Fu.set(n,s)}function Jp(n,s,r){const o=Fu.get(n);if(!o)return;const a=Sr.get(o);a&&a({source:"agentpane-host",event:s,payload:r})}function sx(n,s,r,o){const a=Sr.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:s,tool:r,name:r,args:o}})}function rx(n,s,r,o){const a=Fu.get(n);if(!a)return;const u=Sr.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:s,itemId:r,delta:o}})}function ix(n,s){Uu.set(n,s)}function ox(n){Uu.delete(n)}function lx(n,s){Bu.set(n,s)}function ax(n){Bu.delete(n)}function cx(n){var r;const s=Sr.get(n);s&&s({source:"agentpane-host",event:"state_changed",payload:{}}),(r=Bu.get(n))==null||r()}function ux(n){var r;const s=Sr.get(n);s&&s({source:"agentpane-host",event:"source:updated",payload:{}}),(r=Uu.get(n))==null||r()}const dx=(n,s)=>({wsConnected:!1,setWsConnected:r=>n({wsConnected:r}),onTurnStarted:(r,o)=>{s().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=Nl(a.sessions,r,()=>({is_running:1,status:"running"})),f=a.sessionDetails[r];if(!f)return{sessions:u};const h=f.turns.findIndex(m=>m.id===o);return{sessionDetails:{...a.sessionDetails,[r]:{...Es(f,o,m=>({...m,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:a.activeSessionId===r&&h>=0?h:a.activeTurnIndex}})},onItemStarted:(r,o,a)=>{s().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Es(f,o,h=>eu(h,a))}}:{}})},onItemUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Es(f,o,h=>eu(h,a))}}:{}})},onItemCompleted:(r,o,a)=>{if(s().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const u=a.data||{},f=u.task_type||"unknown",h=u.description||"background task",g=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?s().addToast("success",`${g} completed: ${h}`):s().addToast("error",`${g} failed: ${h}`)}n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Es(f,o,h=>{var g,x;let m=eu(h,a);if(a.type==="agent_message"&&((g=a.data)!=null&&g.text)&&(m={...m,agent_response:a.data.text}),a.type==="reasoning"&&((x=a.data)!=null&&x.text)){const k=m.thoughts?m.thoughts+`
41
+ `+a.data.text:a.data.text;m={...m,thoughts:k}}return m})}}:{}})},onItemDelta:(r,o,a,u)=>{rx(r,o,a,u),n(f=>{const h=f.sessionDetails[r];return h?{sessionDetails:{...f.sessionDetails,[r]:Es(h,o,m=>fx(m,a,u))}}:{}})},onTurnCompleted:(r,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,m=(a==null?void 0:a.output_tokens)??0;s().addLogEntry("INFO",`turn:completed — ${h} in / ${m} out`),Jp(r,"turn:completed",{turnId:o,response:f??null}),s().refreshApps(),n(g=>{const x=g.sessionDetails[r],k=x?Es(x,o,E=>({...E,status:"completed",token_usage:a??E.token_usage??null,...f&&!E.agent_response?{agent_response:f}:{}})):null,y=Jc(k),N=y?"running":"active",_=Nl(g.sessions,r,E=>({is_running:y,status:N,has_unreviewed:u?1:E.has_unreviewed}));return k?{sessionDetails:{...g.sessionDetails,[r]:{...k,is_running:y,status:N,has_unreviewed:u?1:k.has_unreviewed}},sessions:_}:{sessions:_}})},onTokenUsageUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Es(f,o,h=>({...h,token_usage:a}))}}:{}})},onContextUsageUpdated:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(r,o,a)=>{s().addLogEntry("ERROR",`turn:failed — ${a}`),s().addToast("error",`Turn failed — ${a}`),Jp(r,"turn:failed",{turnId:o,error:a}),n(u=>{const f=u.sessionDetails[r],h=a.includes("cancelled")||a.includes("aborted"),m=h?"aborted":"failed",g=f?Es(f,o,N=>({...N,status:m,error:a,items:N.items.map(_=>_.status==="in_progress"?{..._,status:"failed"}:_)})):null,x=Jc(g),k=x?"running":h?"active":"failed",y=Nl(u.sessions,r,()=>({is_running:x,status:k}));return g?{sessionDetails:{...u.sessionDetails,[r]:{...g,is_running:x,status:k}},sessions:y}:{sessions:y}})},onTurnCancelled:(r,o)=>{n(a=>{const u=a.sessionDetails[r],f=u?Es(u,o,x=>({...x,status:"aborted",items:x.items.map(k=>k.status==="in_progress"?{...k,status:"completed"}:k)})):null,h=Jc(f),m=h?"running":"active",g=Nl(a.sessions,r,()=>({is_running:h,status:m}));return f?{sessionDetails:{...a.sessionDetails,[r]:{...f,is_running:h,status:m}},sessions:g}:{sessions:g}})},onSessionTitle:(r,o)=>{n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,title:o}:u),sessionDetails:a.sessionDetails[r]?{...a.sessionDetails,[r]:{...a.sessionDetails[r],title:o}}:a.sessionDetails}))},onBackgroundTasksChanged:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,backgroundTasks:o}}}:{}})}});function Jc(n){return n&&(n.turns.some(ai)||(n.threads??[]).some(r=>(r.turns??[]).some(ai)))?1:0}function Nl(n,s,r){return n.some(o=>o.id===s)?n.map(o=>o.id===s?{...o,...r(o)}:o):n}function Es(n,s,r){const o=(n.threads??[]).map(a=>(a.turns??[]).some(u=>u.id===s)?{...a,turns:(a.turns??[]).map(u=>u.id===s?r(u):u)}:a);return{...n,turns:n.turns.map(a=>a.id===s?r(a):a),threads:o}}function eu(n,s){const r=n.items.findIndex(o=>o.external_item_id===s.external_item_id);if(r>=0){const o=[...n.items];return o[r]=s,{...n,items:o}}if(s.type==="agent_message"){const o=n.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...n,items:[...o,s]}}return{...n,items:[...n.items,s]}}function fx(n,s,r){var u;const o=n.items.findIndex(f=>f.external_item_id===s);if(o>=0){const f=n.items[o],m=(((u=f.data)==null?void 0:u.text)??"")+r,g=[...n.items];return g[o]={...f,data:{...f.data,text:m}},{...n,items:g,agent_response:m}}const a={id:`delta-${s}`,turn_id:n.id,external_item_id:s,type:"agent_message",data:{text:r},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...n,items:[...n.items,a],agent_response:r}}function px(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return vn(`/providers/${n}/models${r}`)}const vu=160,yu=480,hx=240,$l=220,mx=300,gx=600;function Fl(){return typeof window>"u"?gx:Math.max($l,Math.round(window.innerWidth*.7))}const eh="agentpane:sidebar-width",th="agentpane:right-panel-width";function nh(n,s,r,o){try{const a=localStorage.getItem(n);if(a==null)return o;const u=Number(a);return Number.isFinite(u)?Math.min(r,Math.max(s,u)):o}catch{return o}}const sh=200,vx=(n,s)=>({activeRightTab:"turns",changesScope:"session",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showRemoteModal:!1,toasts:[],showCommandPalette:!1,selectedChangePath:null,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:nh(eh,vu,yu,hx),rightPanelWidth:nh(th,$l,Fl(),mx),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,setActiveTurnIndex:r=>n({activeTurnIndex:r}),switchRightTab:r=>n({activeRightTab:r}),setChangesScope:r=>n({changesScope:r}),setShowNewSessionDialog:r=>n({showNewSessionDialog:r}),setShowRemoteModal:r=>n({showRemoteModal:r}),setShowCommandPalette:r=>n({showCommandPalette:r}),setShowModelSelector:r=>n({showModelSelector:r}),setSelectedChangePath:r=>n({selectedChangePath:r}),setDeepLinkThreadId:r=>n({deepLinkThreadId:r}),setSidebarWidth:r=>{const o=Math.min(yu,Math.max(vu,Math.round(r)));n({sidebarWidth:o});try{localStorage.setItem(eh,String(o))}catch{}},setRightPanelWidth:r=>{const o=Math.min(Fl(),Math.max($l,Math.round(r)));n({rightPanelWidth:o});try{localStorage.setItem(th,String(o))}catch{}},toggleVscodeView:()=>{if(s().vscodeViewOpen){n({vscodeViewOpen:!1});return}n({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(r,o,a)=>n({vscodeState:r,vscodeId:o,vscodeToken:a}),addToast:(r,o,a,u)=>{const f=Math.random().toString(36).slice(2,9);n(h=>({toasts:[...h.toasts,{id:f,type:r,message:o,undoAction:a,undoLabel:u}]}))},removeToast:r=>{n(o=>({toasts:o.toasts.filter(a=>a.id!==r)}))},addLogEntry:(r,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});n(u=>{const f=[...u.eventLog,{time:a,level:r,message:o}];return f.length>sh&&f.splice(0,f.length-sh),{eventLog:f}})},loadModels:async(r,o)=>{if(!s().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await px(r,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),yx=(n,s)=>({createThread:async(r,o)=>{try{await Ct(`/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 Ct(`/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 Ct(`/sessions/${r}/cancel?threadId=${encodeURIComponent(o)}`),s().addLogEntry("INFO","Thread turn cancelled")}catch(a){s().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(r,o)=>{try{await gs(`/sessions/${r}/threads/${o}`,{status:"resolved"})}catch(a){s().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(r,o)=>{try{await gs(`/sessions/${r}/threads/${o}`,{status:"open"})}catch(a){s().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(r,o,a)=>{try{const u=await Ct(`/sessions/${r}/threads/${o}/summarize`,{directives:a}),f=`
42
+ [Shared from a resolved discussion thread — summary of its findings]
43
+
44
+ \`\`\`QUOTE
45
+ ${u.summary}
46
+ \`\`\`
47
+
48
+ `;return n({quotedText:f}),s().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),s().addToast("success","Thread summary added to your input"),!0}catch(u){return s().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(r,o)=>{try{await ia(`/sessions/${r}/threads/${o}`)}catch(a){s().addToast("error",`Failed to delete thread — ${a.message}`)}},onThreadCreated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:(f.threads??[]).map(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];if(!f)return{};const h=(f.threads??[]).map(m=>m.id===o?{...m,status:a,resolved_at:a==="resolved"?new Date().toISOString():null}:m);return{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:h}}}})},onThreadDeleted:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),xx=(n,s)=>({folders:[],loadFolders:async()=>{const r=await jm();n({folders:r})},createSidebarFolder:async(r,o)=>{try{const a=await Xy(r,o);return n(u=>({folders:[...u.folders,a]})),a}catch(a){return s().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(r,o)=>{try{const a=await Yp(r,{name:o});n(u=>({folders:u.folders.map(f=>f.id===r?a:f)}))}catch(a){s().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async r=>{const o=s().folders,a=s().sessions;n(u=>({folders:u.folders.filter(f=>f.id!==r),sessions:u.sessions.map(f=>f.folder_id===r?{...f,folder_id:null}:f)}));try{await Yy(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 Qy(r)}catch(u){n({sessions:o}),s().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async r=>{const o=s().folders,a=new Map(r.map((u,f)=>[u,f]));n(u=>({folders:u.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(r.map((u,f)=>Yp(u,{sort_order:f})))}catch(u){n({folders:o}),s().addToast("error",`Failed to save folder order — ${u.message}`)}}});function rh(){return vn("/apps")}function wx(){return vn("/apps/root")}function ih(n){return vn(`/apps/${n}/source`)}function oh(n,s=""){return vn(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`)}function Am(n,s,r=""){return Py(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`,s)}function kx(n){return ia(`/apps/${n}`)}function Sx(n){return vn(`/apps/${n}/sessions`)}function Tx(){return vn("/apps/examples")}function bx(n){return Ct(`/apps/examples/${n}/install`,{})}function Nx(n){return Ct("/apps",n)}function Cx(n,s){return Ct("/apps/import",{id:n,files:s})}function Ex(n,s,r){return Ct(`/apps/mcp/calls/${n}/result`,{result:s,error:null})}function _x(n,s){return Ct(`/apps/${n}/edit-session`,s)}const Ml=new Set;async function tu(n,s){Ml.add(s),await n().loadApps();const r=n().apps.find(o=>o.id===s);n().openAppTab(s),n().addToast("success",`Mini app added: ${(r==null?void 0:r.title)??s}`)}const xu="agentpane:app-workspaces";function jx(){try{const n=JSON.parse(localStorage.getItem(xu)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const Rx=(n,s)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:jx(),loadApps:async()=>{try{const[r,o]=await Promise.all([rh(),wx().catch(()=>null)]);r.forEach(a=>Ml.add(a.id)),n(o?{apps:r,appsRootPath:o.root}:{apps:r})}catch{}},refreshApps:async()=>{try{const r=await rh();for(const o of r)Ml.has(o.id)||(Ml.add(o.id),s().addToast("success",`New mini app discovered: ${o.title}`));n({apps:r})}catch{}},openAppTab:r=>{n(o=>({activeAppTabId:r,openAppTabs:o.openAppTabs.includes(r)?o.openAppTabs:[...o.openAppTabs,r]}))},closeAppTab:r=>{n(o=>{const a=o.openAppTabs.filter(u=>u!==r);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===r?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:r=>n({activeAppTabId:r}),openAppCatalog:()=>n({appCatalogOpen:!0}),closeAppCatalog:()=>n({appCatalogOpen:!1}),setAppWorkspace:(r,o)=>{n(a=>{const u={...a.appWorkspaces,[r]:o};try{localStorage.setItem(xu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async r=>{try{return await bx(r),await tu(s,r),!0}catch(o){return s().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await Nx(r),await tu(s,r.id),!0}catch(o){return s().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await Cx(r,o),await tu(s,r),!0}catch(a){return s().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async r=>{try{const o=s().lastModelConfig,a=await _x(r,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});s().sessions.some(u=>u.id===a.id)||n(u=>({sessions:[a,...u.sessions]})),n({activeAppTabId:null}),await s().selectSession(a.id),n(u=>({openTabs:u.openTabs.includes(a.id)?u.openTabs:[...u.openTabs,a.id]})),s().addLogEntry("INFO",`App edit session opened for ${r}`)}catch(o){s().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async r=>{const o=s().apps.find(a=>a.id===r);if(o)try{await Am(r,{pinned:!o.pinned}),await s().loadApps()}catch(a){s().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async r=>{try{await kx(r),n(o=>{const a={...o.appWorkspaces};delete a[r];try{localStorage.setItem(xu,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==r),openAppTabs:o.openAppTabs.filter(u=>u!==r),activeAppTabId:o.activeAppTabId===r?null:o.activeAppTabId,appWorkspaces:a}}),s().addToast("success",`Mini app deleted: ${r}`)}catch(o){s().addToast("error",`Failed to delete app — ${o.message}`)}}}),lh=3e3,On={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},zn=[];let Ul=0,Wu=0,Bl=0,Hu=0,Wl=0,Vu=0,Gu=0;const io=new Map,oo=new Map;let si=new Map,ti=0,ri=new Map,nu=!1;function Hl(n,s,r){if(zn.push({t:Date.now(),cat:n,msg:s,ms:r}),zn.length>lh){const o=zn.length-lh;zn.splice(0,o),En=Math.max(0,En-o)}}function ni(n,s,r){Hl(n,s,r),console.log(`[perf:${n}] ${s}`)}function Im(n){ni("note",n)}function Dm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function Ax(n,s){let r=si.get(n);r||si.set(n,r={n:0,bytes:0}),r.n++,r.bytes+=s;let o=io.get(n);o||io.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=s}function Ix(){ti++,Gu++}function Dx(n){ri.set(n,(ri.get(n)??0)+1),oo.set(n,(oo.get(n)??0)+1)}let Ll=0;function Mx(){Ll=performance.now()}function Lx(){const n=performance.now(),s=Ll?n-Ll:null;Ll=0,requestAnimationFrame(()=>{if(s===null)return;const r=performance.now()-n+s;r>On.keypressMs&&ni("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(s)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const Px=5e3,Mm=500,ah=2e3;let En=0,su=!1;function Ox(n){return Ct("/perf-log",{entries:n}).then(()=>{En+=n.length})}function zx(){if(su||En>=zn.length)return;const n=zn.slice(En,En+Mm);n.length!==0&&(su=!0,Ox(n).catch(()=>{zn.length-En>ah&&(En=Math.max(En,zn.length-ah))}).finally(()=>{su=!1}))}function ch(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||En>=zn.length)return;const n=zn.slice(En,En+Mm);if(n.length!==0)try{const s=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${ms()}/api/perf-log`,s),En+=n.length}catch{}}function $x(){let n=0;for(const o of si.values())n+=o.n;const s=[];if(n>0){const o=[...si.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${Dm(u.bytes)})`).join(", ");s.push(`ws ${n}/s [${o}]`)}ti>0&&s.push(`store ${ti}/s`);const r=[...ri.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(r.length>0&&s.push(`renders ${r.join(" ")}`),s.length>0){const o=s.join(" · ");Hl("stat",o);const a=[...ri.values()].some(u=>u>On.renderPerSecLog);(n>On.wsPerSecLog||ti>On.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}si=new Map,ti=0,ri=new Map}function Fx(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 Ux(){if(nu||typeof window>"u")return()=>{};nu=!0,Ul=Date.now();const n=[];let s=performance.now()+250;const r=window.setInterval(()=>{const u=performance.now(),f=u-s;s=u+250,f>On.lagMs&&(Wu++,Bl=Math.max(Bl,f),ni("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(r)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const h=m=>{const g=m-u;u=m,g>On.frameGapMs&&ni("lag",`frame gap ${Math.round(g)}ms`),f=window.requestAnimationFrame(h)};f=window.requestAnimationFrame(h),n.push(()=>window.cancelAnimationFrame(f))}if(typeof PerformanceObserver<"u"){try{const u=new PerformanceObserver(f=>{var h;for(const m of f.getEntries()){const g=m.duration;if(g<On.longtaskBufferMs)continue;Hu++,Wl=Math.max(Wl,g);const x=(h=m.attribution)==null?void 0:h[0],k=(x==null?void 0:x.containerName)||(x==null?void 0:x.name)||"unknown",y=`long task ${Math.round(g)}ms (${k})`;g>=On.longtaskLogMs?ni("longtask",y,g):Hl("longtask",y,g)}});u.observe({type:"longtask",buffered:!1}),n.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(f=>{for(const h of f.getEntries()){const m=h.duration,g=h.processingStart-h.startTime;Vu++;const x=`${h.name} ${Math.round(m)}ms (input delay ${Math.round(g)}ms) on ${Fx(h.target)}`;m>=On.eventLogMs?ni("input",x,m):Hl("input",x,m)}});u.observe({type:"event",durationThreshold:On.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval($x,1e3);n.push(()=>window.clearInterval(o)),Im("perf logger session started");const a=window.setInterval(zx,Px);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",ch),n.push(()=>window.removeEventListener("beforeunload",ch)),window.__agentPanePerf={dump:Lm,reset:Pm},()=>{n.forEach(u=>u()),nu=!1}}function Lm(){const n=[],s=Ul?Math.round((Date.now()-Ul)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${s}s · ${zn.length} buffered entries`),n.push(`event-loop lag: ${Wu} blocks >${On.lagMs}ms (max ${Math.round(Bl)}ms)`),n.push(`long tasks: ${Hu} ≥${On.longtaskBufferMs}ms (max ${Math.round(Wl)}ms)`),n.push(`slow input events (≥${On.eventBufferMs}ms): ${Vu}`),n.push(`store updates: ${Gu} total`),io.size>0){n.push("ws messages by type (top 15):");for(const[r,o]of[...io.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${r}: ${o.n} msgs, ${Dm(o.bytes)}`)}if(oo.size>0){n.push("render counts by component:");for(const[r,o]of[...oo.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${r}: ${o}`)}n.push("--- last 200 entries ---");for(const r of zn.slice(-200))n.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return n.join(`
49
+ `)}function Pm(){zn.length=0,En=0,Ul=Date.now(),Wu=0,Bl=0,Hu=0,Wl=0,Vu=0,Gu=0,io.clear(),oo.clear(),si=new Map,ti=0,ri=new Map}const en={start:Ux,note:Im,trackWsEvent:Ax,trackStoreUpdate:Ix,trackRender:Dx,markKeystroke:Mx,markInputChange:Lx,dump:Lm,reset:Pm},L=_y()((...n)=>({...Jy(...n),...ex(...n),...dx(...n),...vx(...n),...yx(...n),...xx(...n),...Rx(...n)}));typeof window<"u"&&L.subscribe(()=>en.trackStoreUpdate());function wu(n){switch(n){case"claude":return{iconClass:"ic-claude",iconText:"CL"};case"codex":return{iconClass:"ic-codex",iconText:"CX"};case"repoburg":return{iconClass:"ic-repoburg",iconText:"RB"};case"cursor":return{iconClass:"ic-cursor",iconText:"CR"};default:return{iconClass:"ic-codex",iconText:"CX"}}}function Bx(n,s,r=!1,o="working"){if(o==="finished")return"";if(s)return"running";if(r&&n!=="failed")return"queued";switch(n){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Wx(n,s,r=!1,o="working"){if(o==="finished")return"Finished";if(s)return"Running";if(r&&n!=="failed")return"Review Pending";switch(n){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return n}}function la(n){const s=n.is_running===1,r=n.lifecycle==="finished",o=wu(n.runtime_type);return{dot:Bx(n.status,s,n.has_unreviewed===1,n.lifecycle),label:Wx(n.status,s,n.has_unreviewed===1,n.lifecycle),iconClass:o.iconClass,iconText:o.iconText,isRunning:s,isFinished:r}}function aa(n,s,r=!0){w.useEffect(()=>{if(!r)return;function o(a){n.current&&!n.current.contains(a.target)&&s()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[n,s,r])}function qu(n,s=!0){w.useEffect(()=>{if(!s)return;function r(o){o.key==="Escape"&&n()}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n,s])}function Ku({status:n,size:s=6}){return c.jsx("span",{className:`status-dot ${n}`,style:s!==6?{width:s,height:s}:void 0})}function Xu({iconClass:n,iconText:s,size:r=20}){return c.jsx("span",{className:`runtime-icon ${n}`,style:r!==20?{width:r,height:r,fontSize:r*.45}:void 0,children:s})}/**
50
+ * @license lucide-react v0.469.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const Hx=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Om=(...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 Vx={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 Gx=w.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...h},m)=>w.createElement("svg",{ref:m,...Vx,width:s,height:s,stroke:n,strokeWidth:o?Number(r)*24/Number(s):r,className:Om("lucide",a),...h},[...f.map(([g,x])=>w.createElement(g,x)),...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 be=(n,s)=>{const r=w.forwardRef(({className:o,...a},u)=>w.createElement(Gx,{ref:u,iconNode:s,className:Om(`lucide-${Hx(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 qx=be("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
75
+ * @license lucide-react v0.469.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const ku=be("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 Kx=be("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
85
+ * @license lucide-react v0.469.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const er=be("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
90
+ * @license lucide-react v0.469.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const ii=be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
95
+ * @license lucide-react v0.469.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const Yu=be("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
100
+ * @license lucide-react v0.469.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const Qu=be("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 Xx=be("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
110
+ * @license lucide-react v0.469.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const Vl=be("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 Yx=be("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 Qx=be("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 Zx=be("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 zm=be("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
135
+ * @license lucide-react v0.469.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const uh=be("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
140
+ * @license lucide-react v0.469.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const Su=be("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 Jx=be("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 e0=be("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 t0=be("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 n0=be("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 $m=be("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
170
+ * @license lucide-react v0.469.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const ru=be("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
175
+ * @license lucide-react v0.469.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const Tu=be("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 s0=be("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 r0=be("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 i0=be("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 o0=be("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 l0=be("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
205
+ * @license lucide-react v0.469.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const a0=be("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
210
+ * @license lucide-react v0.469.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const ns=be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
215
+ * @license lucide-react v0.469.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const c0=be("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
220
+ * @license lucide-react v0.469.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const u0=be("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
225
+ * @license lucide-react v0.469.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const d0=be("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
230
+ * @license lucide-react v0.469.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const f0=be("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
235
+ * @license lucide-react v0.469.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const dh=be("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
240
+ * @license lucide-react v0.469.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const p0=be("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
245
+ * @license lucide-react v0.469.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const h0=be("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
250
+ * @license lucide-react v0.469.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const Pl=be("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
255
+ * @license lucide-react v0.469.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const m0=be("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
260
+ * @license lucide-react v0.469.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const g0=be("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
265
+ * @license lucide-react v0.469.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const wr=be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
270
+ * @license lucide-react v0.469.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const Fm=be("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
275
+ * @license lucide-react v0.469.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const v0=be("Rewind",[["polygon",{points:"11 19 2 12 11 5 11 19",key:"14yba5"}],["polygon",{points:"22 19 13 12 22 5 22 19",key:"1pi1cj"}]]);/**
280
+ * @license lucide-react v0.469.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const lo=be("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
285
+ * @license lucide-react v0.469.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const Um=be("SatelliteDish",[["path",{d:"M4 10a7.31 7.31 0 0 0 10 10Z",key:"1fzpp3"}],["path",{d:"m9 15 3-3",key:"88sc13"}],["path",{d:"M17 13a6 6 0 0 0-6-6",key:"15cc6u"}],["path",{d:"M21 13A10 10 0 0 0 11 3",key:"11nf8s"}]]);/**
290
+ * @license lucide-react v0.469.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const y0=be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
295
+ * @license lucide-react v0.469.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const ca=be("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
300
+ * @license lucide-react v0.469.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const x0=be("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
305
+ * @license lucide-react v0.469.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const ci=be("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
310
+ * @license lucide-react v0.469.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const Gl=be("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
315
+ * @license lucide-react v0.469.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const Bm=be("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
320
+ * @license lucide-react v0.469.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const hs=be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
325
+ * @license lucide-react v0.469.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const w0=be("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
330
+ * @license lucide-react v0.469.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const k0=be("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
335
+ * @license lucide-react v0.469.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const S0=be("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
340
+ * @license lucide-react v0.469.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const T0=be("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
345
+ * @license lucide-react v0.469.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const b0=be("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
350
+ * @license lucide-react v0.469.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const Kn=be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
355
+ * @license lucide-react v0.469.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const N0=be("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 Zi=xm();function C0(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return w.useMemo(()=>o=>{s.forEach(a=>a(o))},s)}const ua=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ui(n){const s=Object.prototype.toString.call(n);return s==="[object Window]"||s==="[object global]"}function Zu(n){return"nodeType"in n}function yn(n){var s,r;return n?ui(n)?n:Zu(n)&&(s=(r=n.ownerDocument)==null?void 0:r.defaultView)!=null?s:window:window}function Ju(n){const{Document:s}=yn(n);return n instanceof s}function fo(n){return ui(n)?!1:n instanceof yn(n).HTMLElement}function Wm(n){return n instanceof yn(n).SVGElement}function di(n){return n?ui(n)?n.document:Zu(n)?Ju(n)?n:fo(n)||Wm(n)?n.ownerDocument:document:document:document}const ss=ua?w.useLayoutEffect:w.useEffect;function da(n){const s=w.useRef(n);return ss(()=>{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 E0(){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 ao(n,s){s===void 0&&(s=[n]);const r=w.useRef(n);return ss(()=>{r.current!==n&&(r.current=n)},s),r}function po(n,s){const r=w.useRef();return w.useMemo(()=>{const o=n(r.current);return r.current=o,o},[...s])}function ql(n){const s=da(n),r=w.useRef(null),o=w.useCallback(a=>{a!==r.current&&(s==null||s(a,r.current)),r.current=a},[]);return[r,o]}function Kl(n){const s=w.useRef();return w.useEffect(()=>{s.current=n},[n]),s.current}let iu={};function ho(n,s){return w.useMemo(()=>{if(s)return s;const r=iu[n]==null?0:iu[n]+1;return iu[n]=r,n+"-"+r},[n,s])}function Hm(n){return function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return o.reduce((u,f)=>{const h=Object.entries(f);for(const[m,g]of h){const x=u[m];x!=null&&(u[m]=x+n*g)}return u},{...s})}}const oi=Hm(1),Xl=Hm(-1);function _0(n){return"clientX"in n&&"clientY"in n}function fa(n){if(!n)return!1;const{KeyboardEvent:s}=yn(n.target);return s&&n instanceof s}function j0(n){if(!n)return!1;const{TouchEvent:s}=yn(n.target);return s&&n instanceof s}function Yl(n){if(j0(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 _0(n)?{x:n.clientX,y:n.clientY}:null}const As=Object.freeze({Translate:{toString(n){if(!n)return;const{x:s,y:r}=n;return"translate3d("+(s?Math.round(s):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:s,scaleY:r}=n;return"scaleX("+s+") scaleY("+r+")"}},Transform:{toString(n){if(n)return[As.Translate.toString(n),As.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:s,duration:r,easing:o}=n;return s+" "+r+"ms "+o}}}),fh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function R0(n){return n.matches(fh)?n:n.querySelector(fh)}const A0={display:"none"};function I0(n){let{id:s,value:r}=n;return it.createElement("div",{id:s,style:A0},r)}function D0(n){let{id:s,announcement:r,ariaLiveType:o="assertive"}=n;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return it.createElement("div",{id:s,style:a,role:"status","aria-live":o,"aria-atomic":!0},r)}function M0(){const[n,s]=w.useState("");return{announce:w.useCallback(o=>{o!=null&&s(o)},[]),announcement:n}}const Vm=w.createContext(null);function L0(n){const s=w.useContext(Vm);w.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(n)},[n,s])}function P0(){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 O0={draggable:`
360
+ To pick up a draggable item, press the space bar.
361
+ While dragging, use the arrow keys to move the item.
362
+ Press space again to drop the item in its new position, or press escape to cancel.
363
+ `},z0={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 $0(n){let{announcements:s=z0,container:r,hiddenTextDescribedById:o,screenReaderInstructions:a=O0}=n;const{announce:u,announcement:f}=M0(),h=ho("DndLiveRegion"),[m,g]=w.useState(!1);if(w.useEffect(()=>{g(!0)},[]),L0(w.useMemo(()=>({onDragStart(k){let{active:y}=k;u(s.onDragStart({active:y}))},onDragMove(k){let{active:y,over:N}=k;s.onDragMove&&u(s.onDragMove({active:y,over:N}))},onDragOver(k){let{active:y,over:N}=k;u(s.onDragOver({active:y,over:N}))},onDragEnd(k){let{active:y,over:N}=k;u(s.onDragEnd({active:y,over:N}))},onDragCancel(k){let{active:y,over:N}=k;u(s.onDragCancel({active:y,over:N}))}}),[u,s])),!m)return null;const x=it.createElement(it.Fragment,null,it.createElement(I0,{id:o,value:a.draggable}),it.createElement(D0,{id:h,announcement:f}));return r?Zi.createPortal(x,r):x}var Ft;(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"})(Ft||(Ft={}));function Ql(){}function F0(n,s){return w.useMemo(()=>({sensor:n,options:s??{}}),[n,s])}function U0(){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 rs=Object.freeze({x:0,y:0});function B0(n,s){return Math.sqrt(Math.pow(n.x-s.x,2)+Math.pow(n.y-s.y,2))}function W0(n,s){const r=Yl(n);if(!r)return"0 0";const o={x:(r.x-s.left)/s.width*100,y:(r.y-s.top)/s.height*100};return o.x+"% "+o.y+"%"}function H0(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return r-o}function V0(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return o-r}function G0(n,s){if(!n||n.length===0)return null;const[r]=n;return r[s]}function ph(n,s,r){return s===void 0&&(s=n.left),r===void 0&&(r=n.top),{x:s+n.width*.5,y:r+n.height*.5}}const q0=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=ph(s,s.left,s.top),u=[];for(const f of o){const{id:h}=f,m=r.get(h);if(m){const g=B0(ph(m),a);u.push({id:h,data:{droppableContainer:f,value:g}})}}return u.sort(H0)};function K0(n,s){const r=Math.max(s.top,n.top),o=Math.max(s.left,n.left),a=Math.min(s.left+s.width,n.left+n.width),u=Math.min(s.top+s.height,n.top+n.height),f=a-o,h=u-r;if(o<a&&r<u){const m=s.width*s.height,g=n.width*n.height,x=f*h,k=x/(m+g-x);return Number(k.toFixed(4))}return 0}const X0=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,h=r.get(f);if(h){const m=K0(h,s);m>0&&a.push({id:f,data:{droppableContainer:u,value:m}})}}return a.sort(V0)};function Y0(n,s,r){return{...n,scaleX:s&&r?s.width/r.width:1,scaleY:s&&r?s.height/r.height:1}}function Gm(n,s){return n&&s?{x:n.left-s.left,y:n.top-s.top}:rs}function Q0(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 Z0=Q0(1);function qm(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 J0(n,s,r){const o=qm(s);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,m=n.left-f-(1-a)*parseFloat(r),g=n.top-h-(1-u)*parseFloat(r.slice(r.indexOf(" ")+1)),x=a?n.width/a:n.width,k=u?n.height/u:n.height;return{width:x,height:k,top:g,right:m+x,bottom:g+k,left:m}}const ew={ignoreTransform:!1};function fi(n,s){s===void 0&&(s=ew);let r=n.getBoundingClientRect();if(s.ignoreTransform){const{transform:g,transformOrigin:x}=yn(n).getComputedStyle(n);g&&(r=J0(r,g,x))}const{top:o,left:a,width:u,height:f,bottom:h,right:m}=r;return{top:o,left:a,width:u,height:f,bottom:h,right:m}}function hh(n){return fi(n,{ignoreTransform:!0})}function tw(n){const s=n.innerWidth,r=n.innerHeight;return{top:0,left:0,right:s,bottom:r,width:s,height:r}}function nw(n,s){return s===void 0&&(s=yn(n).getComputedStyle(n)),s.position==="fixed"}function sw(n,s){s===void 0&&(s=yn(n).getComputedStyle(n));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=s[a];return typeof u=="string"?r.test(u):!1})}function ed(n,s){const r=[];function o(a){if(s!=null&&r.length>=s||!a)return r;if(Ju(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!fo(a)||Wm(a)||r.includes(a))return r;const u=yn(n).getComputedStyle(a);return a!==n&&sw(a,u)&&r.push(a),nw(a,u)?r:o(a.parentNode)}return n?o(n):r}function Km(n){const[s]=ed(n,1);return s??null}function ou(n){return!ua||!n?null:ui(n)?n:Zu(n)?Ju(n)||n===di(n).scrollingElement?window:fo(n)?n:null:null}function Xm(n){return ui(n)?n.scrollX:n.scrollLeft}function Ym(n){return ui(n)?n.scrollY:n.scrollTop}function bu(n){return{x:Xm(n),y:Ym(n)}}var Kt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Kt||(Kt={}));function Qm(n){return!ua||!n?!1:n===document.scrollingElement}function Zm(n){const s={x:0,y:0},r=Qm(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 rw={x:.2,y:.2};function iw(n,s,r,o,a){let{top:u,left:f,right:h,bottom:m}=r;o===void 0&&(o=10),a===void 0&&(a=rw);const{isTop:g,isBottom:x,isLeft:k,isRight:y}=Zm(n),N={x:0,y:0},_={x:0,y:0},E={height:s.height*a.y,width:s.width*a.x};return!g&&u<=s.top+E.height?(N.y=Kt.Backward,_.y=o*Math.abs((s.top+E.height-u)/E.height)):!x&&m>=s.bottom-E.height&&(N.y=Kt.Forward,_.y=o*Math.abs((s.bottom-E.height-m)/E.height)),!y&&h>=s.right-E.width?(N.x=Kt.Forward,_.x=o*Math.abs((s.right-E.width-h)/E.width)):!k&&f<=s.left+E.width&&(N.x=Kt.Backward,_.x=o*Math.abs((s.left+E.width-f)/E.width)),{direction:N,speed:_}}function ow(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 Jm(n){return n.reduce((s,r)=>oi(s,bu(r)),rs)}function lw(n){return n.reduce((s,r)=>s+Xm(r),0)}function aw(n){return n.reduce((s,r)=>s+Ym(r),0)}function eg(n,s){if(s===void 0&&(s=fi),!n)return;const{top:r,left:o,bottom:a,right:u}=s(n);Km(n)&&(a<=0||u<=0||r>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const cw=[["x",["left","right"],lw],["y",["top","bottom"],aw]];class td{constructor(s,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=ed(r),a=Jm(o);this.rect={...s},this.width=s.width,this.height=s.height;for(const[u,f,h]of cw)for(const m of f)Object.defineProperty(this,m,{get:()=>{const g=h(o),x=a[u]-g;return this.rect[m]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class eo{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 uw(n){const{EventTarget:s}=yn(n);return n instanceof s?n:di(n)}function lu(n,s){const r=Math.abs(n.x),o=Math.abs(n.y);return typeof s=="number"?Math.sqrt(r**2+o**2)>s:"x"in s&&"y"in s?r>s.x&&o>s.y:"x"in s?r>s.x:"y"in s?o>s.y:!1}var qn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(qn||(qn={}));function mh(n){n.preventDefault()}function dw(n){n.stopPropagation()}var tt;(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"})(tt||(tt={}));const tg={start:[tt.Space,tt.Enter],cancel:[tt.Esc],end:[tt.Space,tt.Enter,tt.Tab]},fw=(n,s)=>{let{currentCoordinates:r}=s;switch(n.code){case tt.Right:return{...r,x:r.x+25};case tt.Left:return{...r,x:r.x-25};case tt.Down:return{...r,y:r.y+25};case tt.Up:return{...r,y:r.y-25}}};class ng{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 eo(di(r)),this.windowListeners=new eo(yn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qn.Resize,this.handleCancel),this.windowListeners.add(qn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:s,onStart:r}=this.props,o=s.node.current;o&&eg(o),r(rs)}handleKeyDown(s){if(fa(s)){const{active:r,context:o,options:a}=this.props,{keyboardCodes:u=tg,coordinateGetter:f=fw,scrollBehavior:h="smooth"}=a,{code:m}=s;if(u.end.includes(m)){this.handleEnd(s);return}if(u.cancel.includes(m)){this.handleCancel(s);return}const{collisionRect:g}=o.current,x=g?{x:g.left,y:g.top}:rs;this.referenceCoordinates||(this.referenceCoordinates=x);const k=f(s,{active:r,context:o.current,currentCoordinates:x});if(k){const y=Xl(k,x),N={x:0,y:0},{scrollableAncestors:_}=o.current;for(const E of _){const T=s.code,{isTop:M,isRight:I,isLeft:B,isBottom:O,maxScroll:W,minScroll:q}=Zm(E),K=ow(E),G={x:Math.min(T===tt.Right?K.right-K.width/2:K.right,Math.max(T===tt.Right?K.left:K.left+K.width/2,k.x)),y:Math.min(T===tt.Down?K.bottom-K.height/2:K.bottom,Math.max(T===tt.Down?K.top:K.top+K.height/2,k.y))},ae=T===tt.Right&&!I||T===tt.Left&&!B,de=T===tt.Down&&!O||T===tt.Up&&!M;if(ae&&G.x!==k.x){const oe=E.scrollLeft+y.x,ke=T===tt.Right&&oe<=W.x||T===tt.Left&&oe>=q.x;if(ke&&!y.y){E.scrollTo({left:oe,behavior:h});return}ke?N.x=E.scrollLeft-oe:N.x=T===tt.Right?E.scrollLeft-W.x:E.scrollLeft-q.x,N.x&&E.scrollBy({left:-N.x,behavior:h});break}else if(de&&G.y!==k.y){const oe=E.scrollTop+y.y,ke=T===tt.Down&&oe<=W.y||T===tt.Up&&oe>=q.y;if(ke&&!y.x){E.scrollTo({top:oe,behavior:h});return}ke?N.y=E.scrollTop-oe:N.y=T===tt.Down?E.scrollTop-W.y:E.scrollTop-q.y,N.y&&E.scrollBy({top:-N.y,behavior:h});break}}this.handleMove(s,oi(Xl(k,this.referenceCoordinates),N))}}}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()}}ng.activators=[{eventName:"onKeyDown",handler:(n,s,r)=>{let{keyboardCodes:o=tg,onActivation:a}=s,{active:u}=r;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const h=u.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),a==null||a({event:n.nativeEvent}),!0)}return!1}}];function gh(n){return!!(n&&"distance"in n)}function vh(n){return!!(n&&"delay"in n)}class nd{constructor(s,r,o){var a;o===void 0&&(o=uw(s.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=s,this.events=r;const{event:u}=s,{target:f}=u;this.props=s,this.events=r,this.document=di(f),this.documentListeners=new eo(this.document),this.listeners=new eo(o),this.windowListeners=new eo(yn(f)),this.initialCoordinates=(a=Yl(u))!=null?a:rs,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(qn.Resize,this.handleCancel),this.windowListeners.add(qn.DragStart,mh),this.windowListeners.add(qn.VisibilityChange,this.handleCancel),this.windowListeners.add(qn.ContextMenu,mh),this.documentListeners.add(qn.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(vh(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(gh(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(s,r){const{active:o,onPending:a}=this.props;a(o,s,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:s}=this,{onStart:r}=this.props;s&&(this.activated=!0,this.documentListeners.add(qn.Click,dw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qn.SelectionChange,this.removeTextSelection),r(s))}handleMove(s){var r;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const m=(r=Yl(s))!=null?r:rs,g=Xl(a,m);if(!o&&h){if(gh(h)){if(h.tolerance!=null&&lu(g,h.tolerance))return this.handleCancel();if(lu(g,h.distance))return this.handleStart()}if(vh(h)&&lu(g,h.tolerance))return this.handleCancel();this.handlePending(h,g);return}s.cancelable&&s.preventDefault(),f(m)}handleEnd(){const{onAbort:s,onEnd:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleCancel(){const{onAbort:s,onCancel:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleKeydown(s){s.code===tt.Esc&&this.handleCancel()}removeTextSelection(){var s;(s=this.document.getSelection())==null||s.removeAllRanges()}}const pw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class sd extends nd{constructor(s){const{event:r}=s,o=di(r.target);super(s,pw,o)}}sd.activators=[{eventName:"onPointerDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const hw={move:{name:"mousemove"},end:{name:"mouseup"}};var Nu;(function(n){n[n.RightClick=2]="RightClick"})(Nu||(Nu={}));class mw extends nd{constructor(s){super(s,hw,di(s.event.target))}}mw.activators=[{eventName:"onMouseDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return r.button===Nu.RightClick?!1:(o==null||o({event:r}),!0)}}];const au={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class gw extends nd{constructor(s){super(s,au)}static setup(){return window.addEventListener(au.move.name,s,{capture:!1,passive:!1}),function(){window.removeEventListener(au.move.name,s)};function s(){}}}gw.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 to;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(to||(to={}));var Zl;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zl||(Zl={}));function vw(n){let{acceleration:s,activator:r=to.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=Zl.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:x,delta:k,threshold:y}=n;const N=xw({delta:k,disabled:!u}),[_,E]=E0(),T=w.useRef({x:0,y:0}),M=w.useRef({x:0,y:0}),I=w.useMemo(()=>{switch(r){case to.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case to.DraggableRect:return a}},[r,a,m]),B=w.useRef(null),O=w.useCallback(()=>{const q=B.current;if(!q)return;const K=T.current.x*M.current.x,G=T.current.y*M.current.y;q.scrollBy(K,G)},[]),W=w.useMemo(()=>h===Zl.TreeOrder?[...g].reverse():g,[h,g]);w.useEffect(()=>{if(!u||!g.length||!I){E();return}for(const q of W){if((o==null?void 0:o(q))===!1)continue;const K=g.indexOf(q),G=x[K];if(!G)continue;const{direction:ae,speed:de}=iw(q,G,I,s,y);for(const oe of["x","y"])N[oe][ae[oe]]||(de[oe]=0,ae[oe]=0);if(de.x>0||de.y>0){E(),B.current=q,_(O,f),T.current=de,M.current=ae;return}}T.current={x:0,y:0},M.current={x:0,y:0},E()},[s,O,o,E,u,f,JSON.stringify(I),JSON.stringify(N),_,g,W,x,JSON.stringify(y)])}const yw={x:{[Kt.Backward]:!1,[Kt.Forward]:!1},y:{[Kt.Backward]:!1,[Kt.Forward]:!1}};function xw(n){let{delta:s,disabled:r}=n;const o=Kl(s);return po(a=>{if(r||!o||!a)return yw;const u={x:Math.sign(s.x-o.x),y:Math.sign(s.y-o.y)};return{x:{[Kt.Backward]:a.x[Kt.Backward]||u.x===-1,[Kt.Forward]:a.x[Kt.Forward]||u.x===1},y:{[Kt.Backward]:a.y[Kt.Backward]||u.y===-1,[Kt.Forward]:a.y[Kt.Forward]||u.y===1}}},[r,s,o])}function ww(n,s){const r=s!=null?n.get(s):void 0,o=r?r.node.current:null;return po(a=>{var u;return s==null?null:(u=o??a)!=null?u:null},[o,s])}function kw(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 co;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(co||(co={}));var Cu;(function(n){n.Optimized="optimized"})(Cu||(Cu={}));const yh=new Map;function Sw(n,s){let{dragging:r,dependencies:o,config:a}=s;const[u,f]=w.useState(null),{frequency:h,measure:m,strategy:g}=a,x=w.useRef(n),k=T(),y=ao(k),N=w.useCallback(function(M){M===void 0&&(M=[]),!y.current&&f(I=>I===null?M:I.concat(M.filter(B=>!I.includes(B))))},[y]),_=w.useRef(null),E=po(M=>{if(k&&!r)return yh;if(!M||M===yh||x.current!==n||u!=null){const I=new Map;for(let B of n){if(!B)continue;if(u&&u.length>0&&!u.includes(B.id)&&B.rect.current){I.set(B.id,B.rect.current);continue}const O=B.node.current,W=O?new td(m(O),O):null;B.rect.current=W,W&&I.set(B.id,W)}return I}return M},[n,u,r,k,m]);return w.useEffect(()=>{x.current=n},[n]),w.useEffect(()=>{k||N()},[r,k]),w.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),w.useEffect(()=>{k||typeof h!="number"||_.current!==null||(_.current=setTimeout(()=>{N(),_.current=null},h))},[h,k,N,...o]),{droppableRects:E,measureDroppableContainers:N,measuringScheduled:u!=null};function T(){switch(g){case co.Always:return!1;case co.BeforeDragging:return r;default:return!r}}}function rd(n,s){return po(r=>n?r||(typeof s=="function"?s(n):n):null,[s,n])}function Tw(n,s){return rd(n,s)}function bw(n){let{callback:s,disabled:r}=n;const o=da(s),a=w.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,r]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function pa(n){let{callback:s,disabled:r}=n;const o=da(s),a=w.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[r]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Nw(n){return new td(fi(n),n)}function xh(n,s,r){s===void 0&&(s=Nw);const[o,a]=w.useState(null);function u(){a(m=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=m??r)!=null?g:null}const x=s(n);return JSON.stringify(m)===JSON.stringify(x)?m:x})}const f=bw({callback(m){if(n)for(const g of m){const{type:x,target:k}=g;if(x==="childList"&&k instanceof HTMLElement&&k.contains(n)){u();break}}}}),h=pa({callback:u});return ss(()=>{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 Cw(n){const s=rd(n);return Gm(n,s)}const wh=[];function Ew(n){const s=w.useRef(n),r=po(o=>n?o&&o!==wh&&n&&s.current&&n.parentNode===s.current.parentNode?o:ed(n):wh,[n]);return w.useEffect(()=>{s.current=n},[n]),r}function _w(n){const[s,r]=w.useState(null),o=w.useRef(n),a=w.useCallback(u=>{const f=ou(u.target);f&&r(h=>h?(h.set(f,bu(f)),new Map(h)):null)},[]);return w.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(m=>{const g=ou(m);return g?(g.addEventListener("scroll",a,{passive:!0}),[g,bu(g)]):null}).filter(m=>m!=null);r(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(m=>{const g=ou(m);g==null||g.removeEventListener("scroll",a)})}},[a,n]),w.useMemo(()=>n.length?s?Array.from(s.values()).reduce((u,f)=>oi(u,f),rs):Jm(n):rs,[n,s])}function kh(n,s){s===void 0&&(s=[]);const r=w.useRef(null);return w.useEffect(()=>{r.current=null},s),w.useEffect(()=>{const o=n!==rs;o&&!r.current&&(r.current=n),!o&&r.current&&(r.current=null)},[n]),r.current?Xl(n,r.current):rs}function jw(n){w.useEffect(()=>{if(!ua)return;const s=n.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of s)r==null||r()}},n.map(s=>{let{sensor:r}=s;return r}))}function Rw(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 sg(n){return w.useMemo(()=>n?tw(n):null,[n])}const Sh=[];function Aw(n,s){s===void 0&&(s=fi);const[r]=n,o=sg(r?yn(r):null),[a,u]=w.useState(Sh);function f(){u(()=>n.length?n.map(m=>Qm(m)?o:new td(s(m),m)):Sh)}const h=pa({callback:f});return ss(()=>{h==null||h.disconnect(),f(),n.forEach(m=>h==null?void 0:h.observe(m))},[n]),a}function rg(n){if(!n)return null;if(n.children.length>1)return n;const s=n.children[0];return fo(s)?s:n}function Iw(n){let{measure:s}=n;const[r,o]=w.useState(null),a=w.useCallback(g=>{for(const{target:x}of g)if(fo(x)){o(k=>{const y=s(x);return k?{...k,width:y.width,height:y.height}:y});break}},[s]),u=pa({callback:a}),f=w.useCallback(g=>{const x=rg(g);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?s(x):null)},[s,u]),[h,m]=ql(f);return w.useMemo(()=>({nodeRef:h,rect:r,setRef:m}),[r,h,m])}const Dw=[{sensor:sd,options:{}},{sensor:ng,options:{}}],Mw={current:{}},Ol={draggable:{measure:hh},droppable:{measure:hh,strategy:co.WhileDragging,frequency:Cu.Optimized},dragOverlay:{measure:fi}};class no 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 Lw={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new no,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ql},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ol,measureDroppableContainers:Ql,windowRect:null,measuringScheduled:!1},ig={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ql,draggableNodes:new Map,over:null,measureDroppableContainers:Ql},mo=w.createContext(ig),og=w.createContext(Lw);function Pw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new no}}}function Ow(n,s){switch(s.type){case Ft.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:s.initialCoordinates,active:s.active}};case Ft.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 Ft.DragEnd:case Ft.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ft.RegisterDroppable:{const{element:r}=s,{id:o}=r,a=new no(n.droppable.containers);return a.set(o,r),{...n,droppable:{...n.droppable,containers:a}}}case Ft.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 no(n.droppable.containers);return f.set(r,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Ft.UnregisterDroppable:{const{id:r,key:o}=s,a=n.droppable.containers.get(r);if(!a||o!==a.key)return n;const u=new no(n.droppable.containers);return u.delete(r),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function zw(n){let{disabled:s}=n;const{active:r,activatorEvent:o,draggableNodes:a}=w.useContext(mo),u=Kl(o),f=Kl(r==null?void 0:r.id);return w.useEffect(()=>{if(!s&&!o&&u&&f!=null){if(!fa(u)||document.activeElement===u.target)return;const h=a.get(f);if(!h)return;const{activatorNode:m,node:g}=h;if(!m.current&&!g.current)return;requestAnimationFrame(()=>{for(const x of[m.current,g.current]){if(!x)continue;const k=R0(x);if(k){k.focus();break}}})}},[o,s,a,f,u]),null}function lg(n,s){let{transform:r,...o}=s;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),r):r}function $w(n){return w.useMemo(()=>({draggable:{...Ol.draggable,...n==null?void 0:n.draggable},droppable:{...Ol.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Ol.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function Fw(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;ss(()=>{if(!f&&!h||!s){u.current=!1;return}if(u.current||!o)return;const g=s==null?void 0:s.node.current;if(!g||g.isConnected===!1)return;const x=r(g),k=Gm(x,o);if(f||(k.x=0),h||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const y=Km(g);y&&y.scrollBy({top:k.y,left:k.x})}},[s,f,h,o,r])}const ha=w.createContext({...rs,scaleX:1,scaleY:1});var Zs;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Zs||(Zs={}));const Uw=w.memo(function(s){var r,o,a,u;let{id:f,accessibility:h,autoScroll:m=!0,children:g,sensors:x=Dw,collisionDetection:k=X0,measuring:y,modifiers:N,..._}=s;const E=w.useReducer(Ow,void 0,Pw),[T,M]=E,[I,B]=P0(),[O,W]=w.useState(Zs.Uninitialized),q=O===Zs.Initialized,{draggable:{active:K,nodes:G,translate:ae},droppable:{containers:de}}=T,oe=K!=null?G.get(K):null,ke=w.useRef({initial:null,translated:null}),Ne=w.useMemo(()=>{var nt;return K!=null?{id:K,data:(nt=oe==null?void 0:oe.data)!=null?nt:Mw,rect:ke}:null},[K,oe]),Fe=w.useRef(null),[Q,se]=w.useState(null),[ce,P]=w.useState(null),J=ao(_,Object.values(_)),H=ho("DndDescribedBy",f),b=w.useMemo(()=>de.getEnabled(),[de]),A=$w(y),{droppableRects:ee,measureDroppableContainers:ue,measuringScheduled:me}=Sw(b,{dragging:q,dependencies:[ae.x,ae.y],config:A.droppable}),xe=ww(G,K),ze=w.useMemo(()=>ce?Yl(ce):null,[ce]),_e=wn(),Ee=Tw(xe,A.draggable.measure);Fw({activeNode:K!=null?G.get(K):null,config:_e.layoutShiftCompensation,initialRect:Ee,measure:A.draggable.measure});const Te=xh(xe,A.draggable.measure,Ee),mt=xh(xe?xe.parentElement:null),Me=w.useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:G,draggingNode:null,draggingNodeRect:null,droppableContainers:de,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),bt=de.getNodeFor((r=Me.current.over)==null?void 0:r.id),Le=Iw({measure:A.dragOverlay.measure}),Pt=(o=Le.nodeRef.current)!=null?o:xe,We=q?(a=Le.rect)!=null?a:Te:null,Ut=!!(Le.nodeRef.current&&Le.rect),Et=Cw(Ut?null:Te),gt=sg(Pt?yn(Pt):null),_t=Ew(q?bt??xe:null),Ot=Aw(_t),V=lg(N,{transform:{x:ae.x-Et.x,y:ae.y-Et.y,scaleX:1,scaleY:1},activatorEvent:ce,active:Ne,activeNodeRect:Te,containerNodeRect:mt,draggingNodeRect:We,over:Me.current.over,overlayNodeRect:Le.rect,scrollableAncestors:_t,scrollableAncestorRects:Ot,windowRect:gt}),ge=ze?oi(ze,ae):null,Be=_w(_t),Ke=kh(Be),ft=kh(Be,[Te]),vt=oi(V,Ke),ct=We?Z0(We,V):null,Xt=Ne&&ct?k({active:Ne,collisionRect:ct,droppableRects:ee,droppableContainers:b,pointerCoordinates:ge}):null,nn=G0(Xt,"id"),[yt,$n]=w.useState(null),un=Ut?V:oi(V,ft),is=Y0(un,(u=yt==null?void 0:yt.rect)!=null?u:null,Te),_n=w.useRef(null),jn=w.useCallback((nt,j)=>{let{sensor:le,options:ne}=j;if(Fe.current==null)return;const ve=G.get(Fe.current);if(!ve)return;const Re=nt.nativeEvent,Pe=new le({active:Fe.current,activeNode:ve,event:Re,options:ne,context:Me,onAbort(Ue){if(!G.get(Ue))return;const{onDragAbort:rt}=J.current,It={id:Ue};rt==null||rt(It),I({type:"onDragAbort",event:It})},onPending(Ue,lt,rt,It){if(!G.get(Ue))return;const{onDragPending:Yt}=J.current,pt={id:Ue,constraint:lt,initialCoordinates:rt,offset:It};Yt==null||Yt(pt),I({type:"onDragPending",event:pt})},onStart(Ue){const lt=Fe.current;if(lt==null)return;const rt=G.get(lt);if(!rt)return;const{onDragStart:It}=J.current,Dt={activatorEvent:Re,active:{id:lt,data:rt.data,rect:ke}};Zi.unstable_batchedUpdates(()=>{It==null||It(Dt),W(Zs.Initializing),M({type:Ft.DragStart,initialCoordinates:Ue,active:lt}),I({type:"onDragStart",event:Dt}),se(_n.current),P(Re)})},onMove(Ue){M({type:Ft.DragMove,coordinates:Ue})},onEnd:je(Ft.DragEnd),onCancel:je(Ft.DragCancel)});_n.current=Pe;function je(Ue){return async function(){const{active:rt,collisions:It,over:Dt,scrollAdjustedTranslate:Yt}=Me.current;let pt=null;if(rt&&Yt){const{cancelDrop:sn}=J.current;pt={activatorEvent:Re,active:rt,collisions:It,delta:Yt,over:Dt},Ue===Ft.DragEnd&&typeof sn=="function"&&await Promise.resolve(sn(pt))&&(Ue=Ft.DragCancel)}Fe.current=null,Zi.unstable_batchedUpdates(()=>{M({type:Ue}),W(Zs.Uninitialized),$n(null),se(null),P(null),_n.current=null;const sn=Ue===Ft.DragEnd?"onDragEnd":"onDragCancel";if(pt){const He=J.current[sn];He==null||He(pt),I({type:sn,event:pt})}})}}},[G]),Rn=w.useCallback((nt,j)=>(le,ne)=>{const ve=le.nativeEvent,Re=G.get(ne);if(Fe.current!==null||!Re||ve.dndKit||ve.defaultPrevented)return;const Pe={active:Re};nt(le,j.options,Pe)===!0&&(ve.dndKit={capturedBy:j.sensor},Fe.current=ne,jn(le,j))},[G,jn]),xn=kw(x,Rn);jw(x),ss(()=>{Te&&O===Zs.Initializing&&W(Zs.Initialized)},[Te,O]),w.useEffect(()=>{const{onDragMove:nt}=J.current,{active:j,activatorEvent:le,collisions:ne,over:ve}=Me.current;if(!j||!le)return;const Re={active:j,activatorEvent:le,collisions:ne,delta:{x:vt.x,y:vt.y},over:ve};Zi.unstable_batchedUpdates(()=>{nt==null||nt(Re),I({type:"onDragMove",event:Re})})},[vt.x,vt.y]),w.useEffect(()=>{const{active:nt,activatorEvent:j,collisions:le,droppableContainers:ne,scrollAdjustedTranslate:ve}=Me.current;if(!nt||Fe.current==null||!j||!ve)return;const{onDragOver:Re}=J.current,Pe=ne.get(nn),je=Pe&&Pe.rect.current?{id:Pe.id,rect:Pe.rect.current,data:Pe.data,disabled:Pe.disabled}:null,Ue={active:nt,activatorEvent:j,collisions:le,delta:{x:ve.x,y:ve.y},over:je};Zi.unstable_batchedUpdates(()=>{$n(je),Re==null||Re(Ue),I({type:"onDragOver",event:Ue})})},[nn]),ss(()=>{Me.current={activatorEvent:ce,active:Ne,activeNode:xe,collisionRect:ct,collisions:Xt,droppableRects:ee,draggableNodes:G,draggingNode:Pt,draggingNodeRect:We,droppableContainers:de,over:yt,scrollableAncestors:_t,scrollAdjustedTranslate:vt},ke.current={initial:We,translated:ct}},[Ne,xe,Xt,ct,G,Pt,We,ee,de,yt,_t,vt]),vw({..._e,delta:ae,draggingRect:ct,pointerCoordinates:ge,scrollableAncestors:_t,scrollableAncestorRects:Ot});const dn=w.useMemo(()=>({active:Ne,activeNode:xe,activeNodeRect:Te,activatorEvent:ce,collisions:Xt,containerNodeRect:mt,dragOverlay:Le,draggableNodes:G,droppableContainers:de,droppableRects:ee,over:yt,measureDroppableContainers:ue,scrollableAncestors:_t,scrollableAncestorRects:Ot,measuringConfiguration:A,measuringScheduled:me,windowRect:gt}),[Ne,xe,Te,ce,Xt,mt,Le,G,de,ee,yt,ue,_t,Ot,A,me,gt]),Bt=w.useMemo(()=>({activatorEvent:ce,activators:xn,active:Ne,activeNodeRect:Te,ariaDescribedById:{draggable:H},dispatch:M,draggableNodes:G,over:yt,measureDroppableContainers:ue}),[ce,xn,Ne,Te,M,H,G,yt,ue]);return it.createElement(Vm.Provider,{value:B},it.createElement(mo.Provider,{value:Bt},it.createElement(og.Provider,{value:dn},it.createElement(ha.Provider,{value:is},g)),it.createElement(zw,{disabled:(h==null?void 0:h.restoreFocus)===!1})),it.createElement($0,{...h,hiddenTextDescribedById:H}));function wn(){const nt=(Q==null?void 0:Q.autoScrollEnabled)===!1,j=typeof m=="object"?m.enabled===!1:m===!1,le=q&&!nt&&!j;return typeof m=="object"?{...m,enabled:le}:{enabled:le}}}),Bw=w.createContext(null),Th="button",Ww="Draggable";function Hw(n){let{id:s,data:r,disabled:o=!1,attributes:a}=n;const u=ho(Ww),{activators:f,activatorEvent:h,active:m,activeNodeRect:g,ariaDescribedById:x,draggableNodes:k,over:y}=w.useContext(mo),{role:N=Th,roleDescription:_="draggable",tabIndex:E=0}=a??{},T=(m==null?void 0:m.id)===s,M=w.useContext(T?ha:Bw),[I,B]=ql(),[O,W]=ql(),q=Rw(f,s),K=ao(r);ss(()=>(k.set(s,{id:s,key:u,node:I,activatorNode:O,data:K}),()=>{const ae=k.get(s);ae&&ae.key===u&&k.delete(s)}),[k,s]);const G=w.useMemo(()=>({role:N,tabIndex:E,"aria-disabled":o,"aria-pressed":T&&N===Th?!0:void 0,"aria-roledescription":_,"aria-describedby":x.draggable}),[o,N,E,T,_,x.draggable]);return{active:m,activatorEvent:h,activeNodeRect:g,attributes:G,isDragging:T,listeners:o?void 0:q,node:I,over:y,setNodeRef:B,setActivatorNodeRef:W,transform:M}}function ag(){return w.useContext(og)}const Vw="Droppable",Gw={timeout:25};function cg(n){let{data:s,disabled:r=!1,id:o,resizeObserverConfig:a}=n;const u=ho(Vw),{active:f,dispatch:h,over:m,measureDroppableContainers:g}=w.useContext(mo),x=w.useRef({disabled:r}),k=w.useRef(!1),y=w.useRef(null),N=w.useRef(null),{disabled:_,updateMeasurementsFor:E,timeout:T}={...Gw,...a},M=ao(E??o),I=w.useCallback(()=>{if(!k.current){k.current=!0;return}N.current!=null&&clearTimeout(N.current),N.current=setTimeout(()=>{g(Array.isArray(M.current)?M.current:[M.current]),N.current=null},T)},[T]),B=pa({callback:I,disabled:_||!f}),O=w.useCallback((G,ae)=>{B&&(ae&&(B.unobserve(ae),k.current=!1),G&&B.observe(G))},[B]),[W,q]=ql(O),K=ao(s);return w.useEffect(()=>{!B||!W.current||(B.disconnect(),k.current=!1,B.observe(W.current))},[W,B]),w.useEffect(()=>(h({type:Ft.RegisterDroppable,element:{id:o,key:u,disabled:r,node:W,rect:y,data:K}}),()=>h({type:Ft.UnregisterDroppable,key:u,id:o})),[o]),w.useEffect(()=>{r!==x.current.disabled&&(h({type:Ft.SetDroppableDisabled,id:o,key:u,disabled:r}),x.current.disabled=r)},[o,u,r,h]),{active:f,rect:y,isOver:(m==null?void 0:m.id)===o,node:W,over:m,setNodeRef:q}}function qw(n){let{animation:s,children:r}=n;const[o,a]=w.useState(null),[u,f]=w.useState(null),h=Kl(r);return!r&&!o&&h&&a(h),ss(()=>{if(!u)return;const m=o==null?void 0:o.key,g=o==null?void 0:o.props.id;if(m==null||g==null){a(null);return}Promise.resolve(s(g,u)).then(()=>{a(null)})},[s,o,u]),it.createElement(it.Fragment,null,r,o?w.cloneElement(o,{ref:f}):null)}const Kw={x:0,y:0,scaleX:1,scaleY:1};function Xw(n){let{children:s}=n;return it.createElement(mo.Provider,{value:ig},it.createElement(ha.Provider,{value:Kw},s))}const Yw={position:"fixed",touchAction:"none"},Qw=n=>fa(n)?"transform 250ms ease":void 0,Zw=w.forwardRef((n,s)=>{let{as:r,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:m,transform:g,transition:x=Qw}=n;if(!h)return null;const k=a?g:{...g,scaleX:1,scaleY:1},y={...Yw,width:h.width,height:h.height,top:h.top,left:h.left,transform:As.Transform.toString(k),transformOrigin:a&&o?W0(o,h):void 0,transition:typeof x=="function"?x(o):x,...m};return it.createElement(r,{className:f,style:y,ref:s},u)}),Jw=n=>s=>{let{active:r,dragOverlay:o}=s;const a={},{styles:u,className:f}=n;if(u!=null&&u.active)for(const[h,m]of Object.entries(u.active))m!==void 0&&(a[h]=r.node.style.getPropertyValue(h),r.node.style.setProperty(h,m));if(u!=null&&u.dragOverlay)for(const[h,m]of Object.entries(u.dragOverlay))m!==void 0&&o.node.style.setProperty(h,m);return f!=null&&f.active&&r.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[m,g]of Object.entries(a))r.node.style.setProperty(m,g);f!=null&&f.active&&r.node.classList.remove(f.active)}},e1=n=>{let{transform:{initial:s,final:r}}=n;return[{transform:As.Transform.toString(s)},{transform:As.Transform.toString(r)}]},t1={duration:250,easing:"ease",keyframes:e1,sideEffects:Jw({styles:{active:{opacity:"0"}}})};function n1(n){let{config:s,draggableNodes:r,droppableContainers:o,measuringConfiguration:a}=n;return da((u,f)=>{if(s===null)return;const h=r.get(u);if(!h)return;const m=h.node.current;if(!m)return;const g=rg(f);if(!g)return;const{transform:x}=yn(f).getComputedStyle(f),k=qm(x);if(!k)return;const y=typeof s=="function"?s:s1(s);return eg(m,a.draggable.measure),y({active:{id:u,data:h.data,node:m,rect:a.draggable.measure(m)},draggableNodes:r,dragOverlay:{node:f,rect:a.dragOverlay.measure(g)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function s1(n){const{duration:s,easing:r,sideEffects:o,keyframes:a}={...t1,...n};return u=>{let{active:f,dragOverlay:h,transform:m,...g}=u;if(!s)return;const x={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},k={scaleX:m.scaleX!==1?f.rect.width*m.scaleX/h.rect.width:1,scaleY:m.scaleY!==1?f.rect.height*m.scaleY/h.rect.height:1},y={x:m.x-x.x,y:m.y-x.y,...k},N=a({...g,active:f,dragOverlay:h,transform:{initial:m,final:y}}),[_]=N,E=N[N.length-1];if(JSON.stringify(_)===JSON.stringify(E))return;const T=o==null?void 0:o({active:f,dragOverlay:h,...g}),M=h.node.animate(N,{duration:s,easing:r,fill:"forwards"});return new Promise(I=>{M.onfinish=()=>{T==null||T(),I()}})}}let bh=0;function r1(n){return w.useMemo(()=>{if(n!=null)return bh++,bh},[n])}const i1=it.memo(n=>{let{adjustScale:s=!1,children:r,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:m,zIndex:g=999}=n;const{activatorEvent:x,active:k,activeNodeRect:y,containerNodeRect:N,draggableNodes:_,droppableContainers:E,dragOverlay:T,over:M,measuringConfiguration:I,scrollableAncestors:B,scrollableAncestorRects:O,windowRect:W}=ag(),q=w.useContext(ha),K=r1(k==null?void 0:k.id),G=lg(f,{activatorEvent:x,active:k,activeNodeRect:y,containerNodeRect:N,draggingNodeRect:T.rect,over:M,overlayNodeRect:T.rect,scrollableAncestors:B,scrollableAncestorRects:O,transform:q,windowRect:W}),ae=rd(y),de=n1({config:o,draggableNodes:_,droppableContainers:E,measuringConfiguration:I}),oe=ae?T.setRef:void 0;return it.createElement(Xw,null,it.createElement(qw,{animation:de},k&&K?it.createElement(Zw,{key:K,id:k.id,ref:oe,as:h,activatorEvent:x,adjustScale:s,className:m,transition:u,rect:ae,style:{zIndex:g,...a},transform:G},r):null))});function ug(n,s,r){const o=n.slice();return o.splice(r<0?o.length+r:r,0,o.splice(s,1)[0]),o}function o1(n,s){return n.reduce((r,o,a)=>{const u=s.get(o);return u&&(r[a]=u),r},Array(n.length))}function Cl(n){return n!==null&&n>=0}function l1(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 a1(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const dg=n=>{let{rects:s,activeIndex:r,overIndex:o,index:a}=n;const u=ug(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}},El={scaleX:1,scaleY:1},Nh=n=>{var s;let{activeIndex:r,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const h=(s=u[r])!=null?s:o;if(!h)return null;if(a===r){const g=u[f];return g?{x:0,y:r<f?g.top+g.height-(h.top+h.height):g.top-h.top,...El}:null}const m=c1(u,a,r);return a>r&&a<=f?{x:0,y:-h.height-m,...El}:a<r&&a>=f?{x:0,y:h.height+m,...El}:{x:0,y:0,...El}};function c1(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 fg="Sortable",pg=it.createContext({activeIndex:-1,containerId:fg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:dg,disabled:{draggable:!1,droppable:!1}});function Ch(n){let{children:s,id:r,items:o,strategy:a=dg,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:m,over:g,measureDroppableContainers:x}=ag(),k=ho(fg,r),y=h.rect!==null,N=w.useMemo(()=>o.map(q=>typeof q=="object"&&"id"in q?q.id:q),[o]),_=f!=null,E=f?N.indexOf(f.id):-1,T=g?N.indexOf(g.id):-1,M=w.useRef(N),I=!l1(N,M.current),B=T!==-1&&E===-1||I,O=a1(u);ss(()=>{I&&_&&x(N)},[I,N,_,x]),w.useEffect(()=>{M.current=N},[N]);const W=w.useMemo(()=>({activeIndex:E,containerId:k,disabled:O,disableTransforms:B,items:N,overIndex:T,useDragOverlay:y,sortedRects:o1(N,m),strategy:a}),[E,k,O.draggable,O.droppable,B,N,T,m,y,a]);return it.createElement(pg.Provider,{value:W},s)}const u1=n=>{let{id:s,items:r,activeIndex:o,overIndex:a}=n;return ug(r,o,a).indexOf(s)},d1=n=>{let{containerId:s,isSorting:r,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:m,transition:g}=n;return!g||!o||h!==u&&a===f?!1:r?!0:f!==a&&s===m},f1={duration:200,easing:"ease"},hg="transform",p1=As.Transition.toString({property:hg,duration:0,easing:"linear"}),h1={roleDescription:"sortable"};function m1(n){let{disabled:s,index:r,node:o,rect:a}=n;const[u,f]=w.useState(null),h=w.useRef(r);return ss(()=>{if(!s&&r!==h.current&&o.current){const m=a.current;if(m){const g=fi(o.current,{ignoreTransform:!0}),x={x:m.left-g.left,y:m.top-g.top,scaleX:m.width/g.width,scaleY:m.height/g.height};(x.x||x.y)&&f(x)}}r!==h.current&&(h.current=r)},[s,r,o,a]),w.useEffect(()=>{u&&f(null)},[u]),u}function mg(n){let{animateLayoutChanges:s=d1,attributes:r,disabled:o,data:a,getNewIndex:u=u1,id:f,strategy:h,resizeObserverConfig:m,transition:g=f1}=n;const{items:x,containerId:k,activeIndex:y,disabled:N,disableTransforms:_,sortedRects:E,overIndex:T,useDragOverlay:M,strategy:I}=w.useContext(pg),B=g1(o,N),O=x.indexOf(f),W=w.useMemo(()=>({sortable:{containerId:k,index:O,items:x},...a}),[k,a,O,x]),q=w.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:K,node:G,isOver:ae,setNodeRef:de}=cg({id:f,data:W,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:q,...m}}),{active:oe,activatorEvent:ke,activeNodeRect:Ne,attributes:Fe,setNodeRef:Q,listeners:se,isDragging:ce,over:P,setActivatorNodeRef:J,transform:H}=Hw({id:f,data:W,attributes:{...h1,...r},disabled:B.draggable}),b=C0(de,Q),A=!!oe,ee=A&&!_&&Cl(y)&&Cl(T),ue=!M&&ce,me=ue&&ee?H:null,ze=ee?me??(h??I)({rects:E,activeNodeRect:Ne,activeIndex:y,overIndex:T,index:O}):null,_e=Cl(y)&&Cl(T)?u({id:f,items:x,activeIndex:y,overIndex:T}):O,Ee=oe==null?void 0:oe.id,Te=w.useRef({activeId:Ee,items:x,newIndex:_e,containerId:k}),mt=x!==Te.current.items,Me=s({active:oe,containerId:k,isDragging:ce,isSorting:A,id:f,index:O,items:x,newIndex:Te.current.newIndex,previousItems:Te.current.items,previousContainerId:Te.current.containerId,transition:g,wasDragging:Te.current.activeId!=null}),bt=m1({disabled:!Me,index:O,node:G,rect:K});return w.useEffect(()=>{A&&Te.current.newIndex!==_e&&(Te.current.newIndex=_e),k!==Te.current.containerId&&(Te.current.containerId=k),x!==Te.current.items&&(Te.current.items=x)},[A,_e,k,x]),w.useEffect(()=>{if(Ee===Te.current.activeId)return;if(Ee!=null&&Te.current.activeId==null){Te.current.activeId=Ee;return}const Pt=setTimeout(()=>{Te.current.activeId=Ee},50);return()=>clearTimeout(Pt)},[Ee]),{active:oe,activeIndex:y,attributes:Fe,data:W,rect:K,index:O,newIndex:_e,items:x,isOver:ae,isSorting:A,isDragging:ce,listeners:se,node:G,overIndex:T,over:P,setNodeRef:b,setActivatorNodeRef:J,setDroppableNodeRef:de,setDraggableNodeRef:Q,transform:bt??ze,transition:Le()};function Le(){if(bt||mt&&Te.current.newIndex===O)return p1;if(!(ue&&!fa(ke)||!g)&&(A||Me))return As.Transition.toString({...g,property:hg})}}function g1(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}}tt.Down,tt.Right,tt.Up,tt.Left;function _l(n){const[s,r]=w.useState(()=>{try{const a=localStorage.getItem(n);if(a==null)return new Set;const u=JSON.parse(a);return Array.isArray(u)?new Set(u.filter(f=>typeof f=="string")):new Set}catch{return new Set}}),o=w.useCallback(a=>{r(u=>{const f=a(new Set(u));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[s,o]}async function Eu(n){try{return await navigator.clipboard.writeText(n),!0}catch{try{const s=document.createElement("textarea");s.value=n,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const r=document.execCommand("copy");return document.body.removeChild(s),r}catch{return!1}}}function Jl(n){return n.replaceAll("\\","/").replace(/\/+$/,"")}function Eh(n,s){if(!s||!n.cwd)return!1;const r=Jl(n.cwd),o=Jl(s);return r.startsWith(`${o}/`)}function v1(n,s){const r=new Map;for(const f of s){const h=f.cwd||"(no directory)",m=r.get(h)??[];m.push(f),r.set(h,m)}const o=new Set,a=new Set(n.filter(f=>f.deleted===1).map(f=>f.path)),u=[];for(const f of n){if(f.deleted===1){o.add(f.path);continue}o.add(f.path),u.push({path:f.path,label:f.label||f.path.split("/").pop()||f.path,sessions:r.get(f.path)??[],workspace:f})}for(const[f,h]of r)o.has(f)||a.has(f)||u.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:h,workspace:null});return u}function ea(n){return[...n].sort((s,r)=>r.sort_order-s.sort_order||(s.created_at<r.created_at?1:-1))}function _h(n,s,r,o){const a=s.map(u=>({folder:u,sessions:n.sessions.filter(f=>f.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return a.push({folder:null,sessions:n.sessions.filter(u=>!(u.folder_id&&r.has(u.folder_id))),finishedKey:`${n.path}:finished`,hidden:!1}),a}function jh(n,s){return{working:ea(n.sessions.filter(r=>r.lifecycle!=="finished")),finished:ea(n.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:s.has(n.finishedKey)}}function jl(n,s){return n.folder_id&&s.has(n.folder_id)?n.folder_id:null}function y1(n){const s=new Set(n.map(o=>o.name));if(!s.has("New Folder"))return"New Folder";let r=2;for(;s.has(`New Folder ${r}`);)r++;return`New Folder ${r}`}function Rh({id:n,children:s,className:r}){const{setNodeRef:o,isOver:a}=cg({id:n});return c.jsx("div",{ref:o,className:`${r??""}${a?" drop-over":""}`,children:s})}function id({inputRef:n,value:s,onChange:r,onConfirm:o,onCancel:a}){return c.jsx("input",{ref:n,className:"tree-rename-input",value:s,onChange:u=>r(u.target.value),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Enter"&&o(),u.key==="Escape"&&a()},onBlur:o})}function x1({s:n,isActive:s,isSelected:r,appIcon:o,renaming:a,renameValue:u,renameRef:f,onRenameValue:h,onRenameConfirm:m,onRenameCancel:g,onSelect:x,onCtxMenu:k,onToggleStar:y}){const{attributes:N,listeners:_,setNodeRef:E,transform:T,transition:M,isDragging:I}=mg({id:`s:${n.id}`}),B=la(n);return c.jsxs("div",{ref:E,style:{transform:As.Transform.toString(T),transition:M},className:`tree-item ${s?"active":""}${r?" selected":""} ${B.isFinished?"tree-item-finished":""}${I?" dragging":""}${n.starred?" tree-item-starred":""}`,...N,..._,onClick:x,onContextMenu:k,children:[c.jsx(Xu,{iconClass:B.iconClass,iconText:B.iconText,size:16}),o&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:o}),a?c.jsx(id,{inputRef:f,value:u,onChange:h,onConfirm:m,onCancel:g}):c.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!a&&c.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:O=>{O.stopPropagation(),y()},onPointerDown:O=>O.stopPropagation(),children:c.jsx(Gl,{size:10,fill:n.starred?"currentColor":"none"})}),B.dot&&c.jsx(Ku,{status:B.dot})]})}function w1({folder:n,count:s,collapsed:r,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:m,onToggle:g,onCtxMenu:x,children:k}){const{attributes:y,listeners:N,setNodeRef:_,transform:E,transition:T,isDragging:M,over:I}=mg({id:`f:${n.id}`}),B=I!=null&&String(I.id).startsWith("s:");return c.jsxs("div",{ref:_,style:{transform:As.Transform.toString(E),transition:T},className:`tree-folder ${r?"collapsed":""}${M?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${B?" drop-over":""}`,...y,...N,onClick:()=>{o||g()},onContextMenu:x,children:o?c.jsx(id,{inputRef:u,value:a,onChange:f,onConfirm:h,onCancel:m}):c.jsxs(c.Fragment,{children:[c.jsx(ii,{size:8,className:"tree-chevron"}),c.jsx(Tu,{size:12}),c.jsx("span",{className:"tree-folder-label",children:n.name}),c.jsx("span",{className:"tree-count",children:s})]})}),!r&&c.jsx("div",{className:"tree-folder-children",children:k})]})}function k1(){const n=L(j=>j.sessions),s=L(j=>j.workspaces),r=L(j=>j.folders),o=L(j=>j.activeSessionId),a=L(j=>j.selectSession),u=L(j=>j.deleteSession),f=L(j=>j.removeWorkspace),h=L(j=>j.createSessionInWorkspace),m=L(j=>j.pickAndAddWorkspace),g=L(j=>j.renameSession),x=L(j=>j.markFinished),k=L(j=>j.markFinishedMany),y=L(j=>j.toggleStar),N=L(j=>j.reopenSession),_=L(j=>j.reopenSessionMany),E=L(j=>j.deleteSessionMany),T=L(j=>j.createSidebarFolder),M=L(j=>j.renameFolder),I=L(j=>j.deleteFolder),B=L(j=>j.applyMoves),O=L(j=>j.reorderFolders),W=L(j=>j.apps),q=L(j=>j.appsRootPath),K=L(j=>j.activeAppTabId),G=L(j=>j.openAppTab),ae=L(j=>j.startAppEdit),de=L(j=>j.toggleAppPin),oe=L(j=>j.deleteApp),ke=L(j=>j.openAppCatalog),[Ne,Fe]=_l("agentpane:sidebar-ws-collapsed"),[Q,se]=_l("agentpane:sidebar-sub-collapsed"),[ce,P]=_l("agentpane:sidebar-folders-collapsed"),[J,H]=_l("agentpane:sidebar-app-edits-collapsed"),[b,A]=w.useState(null),[ee,ue]=w.useState(null),[me,xe]=w.useState(""),[ze,_e]=w.useState(null),[Ee,Te]=w.useState(new Set),[mt,Me]=w.useState(null),bt=w.useRef(null),Le=w.useRef(null),Pt=U0(F0(sd,{activationConstraint:{distance:5}}));function We(){Te(new Set),Me(null)}aa(bt,()=>A(null),!!b),qu(()=>{A(null),We()},!!b||Ee.size>0),w.useLayoutEffect(()=>{const j=bt.current;if(!b||!j)return;const le=8,{offsetWidth:ne,offsetHeight:ve}=j,Re=b.x+ne>window.innerWidth-le?Math.max(le,b.x-ne):b.x,Pe=b.y+ve>window.innerHeight-le?Math.max(le,b.y-ve):b.y;j.style.left=`${Re}px`,j.style.top=`${Pe}px`},[b]);const Ut=w.useMemo(()=>new Map(n.map(j=>[j.id,j])),[n]),Et=w.useMemo(()=>new Map(r.map(j=>[j.id,j])),[r]),gt=w.useMemo(()=>{const j=new Map;for(const le of[...r].sort((ne,ve)=>ne.sort_order-ve.sort_order)){const ne=j.get(le.workspace_path)??[];ne.push(le),j.set(le.workspace_path,ne)}return j},[r]);function _t(j){Fe(le=>{const ne=new Set(le);return ne.has(j)?ne.delete(j):ne.add(j),ne})}function Ot(j){se(le=>{const ne=new Set(le);return ne.has(j)?ne.delete(j):ne.add(j),ne})}function V(j){P(le=>{const ne=new Set(le);return ne.has(j)?ne.delete(j):ne.add(j),ne})}function ge(j){H(le=>{const ne=new Set(le);return ne.has(j)?ne.delete(j):ne.add(j),ne})}w.useEffect(()=>{ee&&Le.current&&(Le.current.focus(),Le.current.select())},[ee]);function Be(j,le,ne,ve=""){ue({kind:j,id:le}),xe(ne||ve)}function Ke(){if(ee){const j=me.trim();j&&(ee.kind==="session"?g(ee.id,j):M(ee.id,j))}ue(null)}function ft(){ue(null),xe("")}async function vt(j){const le=y1(gt.get(j)??[]),ne=await T(j,le);ne&&Be("folder",ne.id,ne.name)}function ct(j){const le=String(j.active.id);if(le.startsWith("s:")){const ne=Ut.get(le.slice(2));ne&&_e({kind:"session",label:ne.title||ne.id.slice(0,8)})}else if(le.startsWith("f:")){const ne=Et.get(le.slice(2));ne&&_e({kind:"folder",label:ne.name})}}function Xt(j){_e(null);const{active:le,over:ne}=j;if(!ne)return;const ve=String(le.id),Re=String(ne.id);if(ve.startsWith("s:")){const Pe=Ut.get(ve.slice(2));if(!Pe)return;const je=Pe.cwd||"(no directory)",Ue=jl(Pe,Et);let lt,rt;if(Re.startsWith("f:")){const He=Et.get(Re.slice(2));if(!He)return;lt=He.workspace_path,rt=He.id}else if(Re.startsWith("s:")){const He=Ut.get(Re.slice(2));if(!He)return;lt=He.cwd||"(no directory)",rt=jl(He,Et)}else if(Re.startsWith("c:")){const He=Re.slice(2),jt=He.lastIndexOf("|");lt=He.slice(0,jt);const os=He.slice(jt+1);rt=os==="root"?null:os}else return;if(lt!==je)return;const It=ea(n.filter(He=>(He.cwd||"(no directory)")===lt&&jl(He,Et)===rt)),Dt=It.filter(He=>He.id!==Pe.id);let Yt=Dt.length;if(Re.startsWith("s:")){const He=Dt.findIndex(jt=>jt.id===Re.slice(2));He>=0&&(Yt=He)}const pt=[...Dt.slice(0,Yt),Pe,...Dt.slice(Yt)],sn=[];if(rt===Ue){if(pt.length===It.length&&pt.every((He,jt)=>He.id===It[jt].id))return;pt.forEach((He,jt)=>sn.push({id:He.id,folder_id:rt,sort_order:pt.length-1-jt}))}else{const He=ea(n.filter(jt=>(jt.cwd||"(no directory)")===je&&jl(jt,Et)===Ue)).filter(jt=>jt.id!==Pe.id);He.forEach((jt,os)=>sn.push({id:jt.id,folder_id:Ue,sort_order:He.length-1-os})),pt.forEach((jt,os)=>sn.push({id:jt.id,folder_id:rt,sort_order:pt.length-1-os}))}B(sn);return}if(ve.startsWith("f:")){if(!Re.startsWith("f:"))return;const Pe=Et.get(ve.slice(2)),je=Et.get(Re.slice(2));if(!Pe||!je||Pe.id===je.id||Pe.workspace_path!==je.workspace_path)return;const Ue=(gt.get(Pe.workspace_path)??[]).map(It=>It.id),lt=Ue.indexOf(Pe.id),rt=Ue.indexOf(je.id);Ue.splice(rt,0,...Ue.splice(lt,1)),O(Ue)}}const nn=v1(s,q?n.filter(j=>!Eh(j,q)):n),yt=w.useMemo(()=>{const j=new Map;if(!q)return j;const le=Jl(q);for(const ne of n){if(!Eh(ne,q))continue;const ve=Jl(ne.cwd).slice(le.length+1).split("/")[0],Re=j.get(ve)??[];Re.push(ne),j.set(ve,Re)}return j},[n,q]);function $n(j){return{folder:null,sessions:yt.get(j)??[],finishedKey:`app:${j}:finished`,hidden:J.has(j)}}const un=[],is=j=>{if(j.hidden)return;const{working:le,finished:ne,finishedCollapsed:ve}=jh(j,Q);un.push(...le.map(Re=>Re.id)),ve||un.push(...ne.map(Re=>Re.id))};for(const j of nn){if(Ne.has(j.path))continue;const le=gt.get(j.path)??[],ne=new Set(le.map(ve=>ve.id));_h(j,le,ne,ce).forEach(is)}W.forEach(j=>is($n(j.id)));const _n=n.filter(j=>Ee.has(j.id)),jn=_n.filter(j=>j.lifecycle!=="finished").map(j=>j.id),Rn=_n.filter(j=>j.lifecycle==="finished").map(j=>j.id);function xn(j,le){if(le.metaKey||le.ctrlKey){le.preventDefault(),Me(j.id),Te(ne=>{const ve=new Set(ne);return ve.has(j.id)?ve.delete(j.id):ve.add(j.id),ve});return}if(le.shiftKey){le.preventDefault();const ne=mt??j.id;Me(ne);const ve=un.indexOf(ne),Re=un.indexOf(j.id);if(ve>=0&&Re>=0){const[Pe,je]=ve<Re?[ve,Re]:[Re,ve];Te(new Set(un.slice(Pe,je+1)))}return}We(),Me(j.id),a(j.id)}function dn(j,le){le.preventDefault();const ne=Ee.has(j.id)&&Ee.size>1;Ee.has(j.id)||(Te(new Set),Me(j.id)),A({x:le.clientX,y:le.clientY,type:"session",sessionId:j.id,sessionTitle:j.title,sessionLifecycle:j.lifecycle,sessionExternalId:j.external_thread_id,multi:ne})}function Bt(j){const le=j.origin_app_id?W.find(ne=>ne.id===j.origin_app_id):null;return c.jsx(x1,{s:j,isActive:o===j.id,isSelected:Ee.has(j.id),appIcon:le?le.icon??"◧":null,renaming:(ee==null?void 0:ee.kind)==="session"&&ee.id===j.id,renameValue:me,renameRef:Le,onRenameValue:xe,onRenameConfirm:Ke,onRenameCancel:ft,onSelect:ne=>xn(j,ne),onToggleStar:()=>y(j.id),onCtxMenu:ne=>dn(j,ne)},j.id)}function wn(j){const le=la(j);return c.jsxs("div",{className:`sidebar-app-edit-row${o===j.id?" active":""}${Ee.has(j.id)?" selected":""}${le.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:ne=>xn(j,ne),onContextMenu:ne=>dn(j,ne),children:[c.jsx(Xu,{iconClass:le.iconClass,iconText:le.iconText,size:14}),(ee==null?void 0:ee.kind)==="session"&&ee.id===j.id?c.jsx(id,{inputRef:Le,value:me,onChange:xe,onConfirm:Ke,onCancel:ft}):c.jsx("span",{className:"tree-label",children:j.title||j.id.slice(0,8)}),le.dot&&c.jsx(Ku,{status:le.dot})]},j.id)}function nt(j,le="workspace"){const{working:ne,finished:ve,finishedCollapsed:Re}=jh(j,Q),Pe=le==="workspace"?Bt:wn,je=c.jsxs(c.Fragment,{children:[ne.length===0&&ve.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):ne.map(Pe),ve.length>0&&c.jsxs("div",{className:`tree-subgroup ${Re?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>Ot(j.finishedKey),children:[c.jsx(ii,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:ve.length})]}),!Re&&c.jsx("div",{className:"tree-subgroup-items",children:ve.map(Pe)})]})]});if(le==="app")return je;const Ue=[...ne,...ve].map(lt=>`s:${lt.id}`);return c.jsx(Ch,{items:Ue,strategy:Nh,children:je})}return c.jsxs("div",{className:"ide-sidebar",children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),c.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:c.jsx(wr,{size:14})})]}),c.jsxs(Uw,{sensors:Pt,collisionDetection:q0,onDragStart:ct,onDragEnd:Xt,children:[nn.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):nn.map(j=>{const le=Ne.has(j.path),ne=gt.get(j.path)??[],ve=new Set(ne.map(je=>je.id)),Re=_h(j,ne,ve,ce),Pe=Re[Re.length-1];return c.jsxs("div",{className:`tree-section ${le?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>_t(j.path),onContextMenu:je=>{je.preventDefault(),A({x:je.clientX,y:je.clientY,type:"workspace",path:j.path})},children:[c.jsx(ii,{size:9,className:"tree-chevron"}),c.jsx(Tu,{size:14}),c.jsx("span",{className:"tree-section-label",children:j.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:je=>{je.stopPropagation(),h(j.path)},children:c.jsx(wr,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:je=>{je.stopPropagation(),vt(j.path)},children:c.jsx(ru,{size:11})}),c.jsx("span",{className:"tree-count",children:j.sessions.length})]}),!le&&c.jsxs("div",{className:"tree-children",children:[c.jsx(Ch,{items:ne.map(je=>`f:${je.id}`),strategy:Nh,children:Re.filter(je=>je.folder).map(je=>c.jsx(w1,{folder:je.folder,count:je.sessions.length,collapsed:je.hidden,renaming:(ee==null?void 0:ee.kind)==="folder"&&ee.id===je.folder.id,renameValue:me,renameRef:Le,onRenameValue:xe,onRenameConfirm:Ke,onRenameCancel:ft,onToggle:()=>V(je.folder.id),onCtxMenu:Ue=>{Ue.preventDefault(),A({x:Ue.clientX,y:Ue.clientY,type:"folder",folderId:je.folder.id,folderName:je.folder.name})},children:c.jsx(Rh,{id:`c:${j.path}|${je.folder.id}`,children:nt(je)})},je.folder.id))}),c.jsx(Rh,{id:`c:${j.path}|root`,children:nt(Pe)})]})]},j.path)}),c.jsx(i1,{children:ze&&c.jsxs("div",{className:"drag-overlay",children:[ze.kind==="folder"&&c.jsx(Tu,{size:12}),c.jsx("span",{children:ze.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:()=>ke(),children:c.jsx(wr,{size:14})})]}),W.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),W.map(j=>{const le=$n(j.id),ne=le.sessions.length>0&&!le.hidden;return c.jsxs("div",{className:"sidebar-app-block",children:[c.jsxs("div",{className:`sidebar-app-row${K===j.id?" active":""}`,title:j.description??void 0,onClick:()=>G(j.id),onContextMenu:ve=>{ve.preventDefault(),A({x:ve.clientX,y:ve.clientY,type:"app",appId:j.id,appPinned:j.pinned})},children:[le.sessions.length>0&&c.jsx("button",{className:`sidebar-app-chevron${ne?"":" closed"}`,title:"Edit sessions of this app",onClick:ve=>{ve.stopPropagation(),ge(j.id)},children:c.jsx(ii,{size:10,className:"tree-chevron"})}),c.jsx("span",{className:"sidebar-app-icon",children:j.icon??"◧"}),c.jsx("span",{className:"tree-label",children:j.title}),le.sessions.length>0&&c.jsx("span",{className:"sidebar-app-count",children:le.sessions.length}),j.pinned&&c.jsx(Gl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),ne&&c.jsx("div",{className:"sidebar-app-edits",children:nt(le,"app")})]},j.id)})]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[c.jsx(ru,{size:14}),c.jsx("span",{children:"Add workspace"})]}),b&&c.jsxs("div",{ref:bt,className:"ctx-menu",style:{position:"fixed",left:b.x,top:b.y,zIndex:500},children:[b.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{h(b.path),A(null)},children:[c.jsx(wr,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{vt(b.path),A(null)},children:[c.jsx(ru,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(b.path),A(null)},children:[c.jsx(hs,{size:12})," Hide Workspace"]})]}),b.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Be("folder",b.folderId,b.folderName??""),A(null)},children:[c.jsx(Pl,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{I(b.folderId),A(null)},children:[c.jsx(hs,{size:12})," Delete Folder"]})]}),b.type==="session"&&!b.multi&&c.jsx(c.Fragment,{children:b.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Be("session",b.sessionId,b.sessionTitle??""),A(null)},children:[c.jsx(Pl,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(b.sessionId),A(null)},children:[c.jsx(Vl,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${b.sessionExternalId?"":" ctx-disabled"}`,title:b.sessionExternalId?void 0:"Session not started",onClick:()=>{b.sessionExternalId&&(Eu(b.sessionExternalId),A(null))},children:[c.jsx(Su,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(b.sessionId),A(null)},children:[c.jsx(hs,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{N(b.sessionId),A(null)},children:[c.jsx(lo,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${b.sessionExternalId?"":" ctx-disabled"}`,title:b.sessionExternalId?void 0:"Session not started",onClick:()=>{b.sessionExternalId&&(Eu(b.sessionExternalId),A(null))},children:[c.jsx(Su,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(b.sessionId),A(null)},children:[c.jsx(hs,{size:12})," Delete Session"]})]})}),b.type==="session"&&b.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[_n.length," sessions selected"]}),jn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(jn),A(null),We()},children:[c.jsx(Vl,{size:12})," Mark ",jn.length," as Finished"]}),Rn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{_(Rn),A(null),We()},children:[c.jsx(lo,{size:12})," Reopen ",Rn.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{E([...Ee]),A(null),We()},children:[c.jsx(hs,{size:12})," Delete ",_n.length," Sessions"]})]}),b.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ae(b.appId),A(null)},children:[c.jsx(Pl,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{de(b.appId),A(null)},children:[c.jsx(Gl,{size:12})," ",b.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{oe(b.appId),A(null)},children:[c.jsx(hs,{size:12})," Delete App"]})]})]})]})}function S1(){const n=L(y=>y.openTabs),s=L(y=>y.activeSessionId),r=L(y=>y.sessions),o=L(y=>y.selectSession),a=L(y=>y.closeTab),u=L(y=>y.setShowNewSessionDialog),f=L(y=>y.apps),h=L(y=>y.openAppTabs),m=L(y=>y.activeAppTabId),g=L(y=>y.openAppTab),x=L(y=>y.closeAppTab),k=L(y=>y.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(y=>{const N=r.find(T=>T.id===y);if(!N)return null;const _=la(N),E=s===y&&m==null;return c.jsxs("div",{className:`ide-tab ${E?"active":""}`,onClick:()=>{m!=null&&k(null),o(y)},children:[c.jsx(Xu,{iconClass:_.iconClass,iconText:_.iconText,size:14}),N.title||y.slice(0,8),_.dot&&c.jsx(Ku,{status:_.dot}),c.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),a(y)},children:c.jsx(Kn,{size:12})})]},y)}),h.map(y=>{const N=f.find(E=>E.id===y),_=m===y;return c.jsxs("div",{className:`ide-tab ${_?"active":""}`,onClick:()=>g(y),children:[N!=null&&N.icon?c.jsx("span",{className:"miniapp-tab-icon",children:N.icon}):c.jsx(o0,{size:12}),(N==null?void 0:N.title)??y,c.jsx("span",{className:"ide-tab-close",onClick:E=>{E.stopPropagation(),x(y)},children:c.jsx(Kn,{size:12})})]},y)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>u(!0),children:c.jsx(wr,{size:14})})]})}function od(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Tr=od();function gg(n){Tr=n}var so={exec:()=>null};function st(n,s=""){let r=typeof n=="string"?n:n.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(gn.caret,"$1"),r=r.replace(a,f),o},getRegex:()=>new RegExp(r,s)};return o}var gn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},T1=/^(?:[ \t]*(?:\n|$))+/,b1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,N1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,go=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,C1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ld=/(?:[*+-]|\d{1,9}[.)])/,vg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yg=st(vg).replace(/bull/g,ld).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),E1=st(vg).replace(/bull/g,ld).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ad=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_1=/^[^\n]+/,cd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,j1=st(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",cd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),R1=st(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ld).getRegex(),ma="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ud=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,A1=st("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ud).replace("tag",ma).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xg=st(ad).replace("hr",go).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ma).getRegex(),I1=st(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",xg).getRegex(),dd={blockquote:I1,code:b1,def:j1,fences:N1,heading:C1,hr:go,html:A1,lheading:yg,list:R1,newline:T1,paragraph:xg,table:so,text:_1},Ah=st("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",go).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ma).getRegex(),D1={...dd,lheading:E1,table:Ah,paragraph:st(ad).replace("hr",go).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ah).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ma).getRegex()},M1={...dd,html:st(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ud).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:so,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:st(ad).replace("hr",go).replace("heading",` *#{1,6} *[^
364
+ ]`).replace("lheading",yg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},L1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,P1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,wg=/^( {2,}|\\)\n(?!\s*$)/,O1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ga=/[\p{P}\p{S}]/u,fd=/[\s\p{P}\p{S}]/u,kg=/[^\s\p{P}\p{S}]/u,z1=st(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,fd).getRegex(),Sg=/(?!~)[\p{P}\p{S}]/u,$1=/(?!~)[\s\p{P}\p{S}]/u,F1=/(?:[^\s\p{P}\p{S}]|~)/u,U1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Tg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,B1=st(Tg,"u").replace(/punct/g,ga).getRegex(),W1=st(Tg,"u").replace(/punct/g,Sg).getRegex(),bg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",H1=st(bg,"gu").replace(/notPunctSpace/g,kg).replace(/punctSpace/g,fd).replace(/punct/g,ga).getRegex(),V1=st(bg,"gu").replace(/notPunctSpace/g,F1).replace(/punctSpace/g,$1).replace(/punct/g,Sg).getRegex(),G1=st("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,kg).replace(/punctSpace/g,fd).replace(/punct/g,ga).getRegex(),q1=st(/\\(punct)/,"gu").replace(/punct/g,ga).getRegex(),K1=st(/^<(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(),X1=st(ud).replace("(?:-->|$)","-->").getRegex(),Y1=st("^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",X1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ta=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Q1=st(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ta).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ng=st(/^!?\[(label)\]\[(ref)\]/).replace("label",ta).replace("ref",cd).getRegex(),Cg=st(/^!?\[(ref)\](?:\[\])?/).replace("ref",cd).getRegex(),Z1=st("reflink|nolink(?!\\()","g").replace("reflink",Ng).replace("nolink",Cg).getRegex(),pd={_backpedal:so,anyPunctuation:q1,autolink:K1,blockSkip:U1,br:wg,code:P1,del:so,emStrongLDelim:B1,emStrongRDelimAst:H1,emStrongRDelimUnd:G1,escape:L1,link:Q1,nolink:Cg,punctuation:z1,reflink:Ng,reflinkSearch:Z1,tag:Y1,text:O1,url:so},J1={...pd,link:st(/^!?\[(label)\]\((.*?)\)/).replace("label",ta).getRegex(),reflink:st(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ta).getRegex()},_u={...pd,emStrongRDelimAst:V1,emStrongLDelim:W1,url:st(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},ek={..._u,br:st(wg).replace("{2,}","*").getRegex(),text:st(_u.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Rl={normal:dd,gfm:D1,pedantic:M1},Ki={normal:pd,gfm:_u,breaks:ek,pedantic:J1},tk={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ih=n=>tk[n];function ps(n,s){if(s){if(gn.escapeTest.test(n))return n.replace(gn.escapeReplace,Ih)}else if(gn.escapeTestNoEncode.test(n))return n.replace(gn.escapeReplaceNoEncode,Ih);return n}function Dh(n){try{n=encodeURI(n).replace(gn.percentDecode,"%")}catch{return null}return n}function Mh(n,s){var u;const r=n.replace(gn.findPipe,(f,h,m)=>{let g=!1,x=h;for(;--x>=0&&m[x]==="\\";)g=!g;return g?"|":" |"}),o=r.split(gn.splitPipe);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),s)if(o.length>s)o.splice(s);else for(;o.length<s;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(gn.slashPipe,"|");return o}function Xi(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 nk(n,s){if(n.indexOf(s[1])===-1)return-1;let r=0;for(let o=0;o<n.length;o++)if(n[o]==="\\")o++;else if(n[o]===s[0])r++;else if(n[o]===s[1]&&(r--,r<0))return o;return r>0?-2:-1}function Lh(n,s,r,o,a){const u=s.href,f=s.title||null,h=n[1].replace(a.other.outputLinkReplace,"$1");o.state.inLink=!0;const m={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:f,text:h,tokens:o.inlineTokens(h)};return o.state.inLink=!1,m}function sk(n,s,r){const o=n.match(r.other.indentCodeCompensation);if(o===null)return s;const a=o[1];return s.split(`
365
+ `).map(u=>{const f=u.match(r.other.beginningSpace);if(f===null)return u;const[h]=f;return h.length>=a.length?u.slice(a.length):u}).join(`
366
+ `)}var na=class{constructor(n){ot(this,"options");ot(this,"rules");ot(this,"lexer");this.options=n||Tr}space(n){const s=this.rules.block.newline.exec(n);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(n){const s=this.rules.block.code.exec(n);if(s){const r=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Xi(r,`
367
+ `)}}}fences(n){const s=this.rules.block.fences.exec(n);if(s){const r=s[0],o=sk(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=Xi(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:Xi(s[0],`
368
+ `)}}blockquote(n){const s=this.rules.block.blockquote.exec(n);if(s){let r=Xi(s[0],`
369
+ `).split(`
370
+ `),o="",a="";const u=[];for(;r.length>0;){let f=!1;const h=[];let m;for(m=0;m<r.length;m++)if(this.rules.other.blockquoteStart.test(r[m]))h.push(r[m]),f=!0;else if(!f)h.push(r[m]);else break;r=r.slice(m);const g=h.join(`
371
+ `),x=g.replace(this.rules.other.blockquoteSetextReplace,`
372
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
373
+ ${g}`:g,a=a?`${a}
374
+ ${x}`:x;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(x,u,!0),this.lexer.state.top=k,r.length===0)break;const y=u.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){const N=y,_=N.raw+`
375
+ `+r.join(`
376
+ `),E=this.blockquote(_);u[u.length-1]=E,o=o.substring(0,o.length-N.raw.length)+E.raw,a=a.substring(0,a.length-N.text.length)+E.text;break}else if((y==null?void 0:y.type)==="list"){const N=y,_=N.raw+`
377
+ `+r.join(`
378
+ `),E=this.list(_);u[u.length-1]=E,o=o.substring(0,o.length-y.raw.length)+E.raw,a=a.substring(0,a.length-N.raw.length)+E.raw,r=_.substring(u.at(-1).raw.length).split(`
379
+ `);continue}}return{type:"blockquote",raw:o,tokens:u,text:a}}}list(n){let s=this.rules.block.list.exec(n);if(s){let r=s[1].trim();const o=r.length>1,a={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const u=this.rules.other.listItemRegex(r);let f=!1;for(;n;){let m=!1,g="",x="";if(!(s=u.exec(n))||this.rules.block.hr.test(n))break;g=s[0],n=n.substring(g.length);let k=s[2].split(`
380
+ `,1)[0].replace(this.rules.other.listReplaceTabs,M=>" ".repeat(3*M.length)),y=n.split(`
381
+ `,1)[0],N=!k.trim(),_=0;if(this.options.pedantic?(_=2,x=k.trimStart()):N?_=s[1].length+1:(_=s[2].search(this.rules.other.nonSpaceChar),_=_>4?1:_,x=k.slice(_),_+=s[1].length),N&&this.rules.other.blankLine.test(y)&&(g+=y+`
382
+ `,n=n.substring(y.length+1),m=!0),!m){const M=this.rules.other.nextBulletRegex(_),I=this.rules.other.hrRegex(_),B=this.rules.other.fencesBeginRegex(_),O=this.rules.other.headingBeginRegex(_),W=this.rules.other.htmlBeginRegex(_);for(;n;){const q=n.split(`
383
+ `,1)[0];let K;if(y=q,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),K=y):K=y.replace(this.rules.other.tabCharGlobal," "),B.test(y)||O.test(y)||W.test(y)||M.test(y)||I.test(y))break;if(K.search(this.rules.other.nonSpaceChar)>=_||!y.trim())x+=`
384
+ `+K.slice(_);else{if(N||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||B.test(k)||O.test(k)||I.test(k))break;x+=`
385
+ `+y}!N&&!y.trim()&&(N=!0),g+=q+`
386
+ `,n=n.substring(q.length+1),k=K.slice(_)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(f=!0));let E=null,T;this.options.gfm&&(E=this.rules.other.listIsTask.exec(x),E&&(T=E[0]!=="[ ] ",x=x.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:g,task:!!E,checked:T,loose:!1,text:x,tokens:[]}),a.raw+=g}const h=a.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let m=0;m<a.items.length;m++)if(this.lexer.state.top=!1,a.items[m].tokens=this.lexer.blockTokens(a.items[m].text,[]),!a.loose){const g=a.items[m].tokens.filter(k=>k.type==="space"),x=g.length>0&&g.some(k=>this.rules.other.anyLine.test(k.raw));a.loose=x}if(a.loose)for(let m=0;m<a.items.length;m++)a.items[m].loose=!0;return a}}html(n){const s=this.rules.block.html.exec(n);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(n){const s=this.rules.block.def.exec(n);if(s){const r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:s[0],href:o,title:a}}}table(n){var f;const s=this.rules.block.table.exec(n);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const r=Mh(s[1]),o=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(f=s[3])!=null&&f.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
387
+ `):[],u={type:"table",raw:s[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const h of o)this.rules.other.tableAlignRight.test(h)?u.align.push("right"):this.rules.other.tableAlignCenter.test(h)?u.align.push("center"):this.rules.other.tableAlignLeft.test(h)?u.align.push("left"):u.align.push(null);for(let h=0;h<r.length;h++)u.header.push({text:r[h],tokens:this.lexer.inline(r[h]),header:!0,align:u.align[h]});for(const h of a)u.rows.push(Mh(h,u.header.length).map((m,g)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:u.align[g]})));return u}}lheading(n){const s=this.rules.block.lheading.exec(n);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(n){const s=this.rules.block.paragraph.exec(n);if(s){const r=s[1].charAt(s[1].length-1)===`
388
+ `?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(n){const s=this.rules.block.text.exec(n);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(n){const s=this.rules.inline.escape.exec(n);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(n){const s=this.rules.inline.tag.exec(n);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(n){const s=this.rules.inline.link.exec(n);if(s){const r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const u=Xi(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{const u=nk(s[2],"()");if(u===-2)return;if(u>-1){const h=(s[0].indexOf("!")===0?5:4)+s[1].length+u;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let o=s[2],a="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],a=u[3])}else a=s[3]?s[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o=o.slice(1):o=o.slice(1,-1)),Lh(s,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(n,s){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){const o=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=s[o.toLowerCase()];if(!a){const u=r[0].charAt(0);return{type:"text",raw:u,text:u}}return Lh(r,a,r[0],this.lexer,this.rules)}}emStrong(n,s,r=""){let o=this.rules.inline.emStrongLDelim.exec(n);if(!o||o[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const u=[...o[0]].length-1;let f,h,m=u,g=0;const x=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,s=s.slice(-1*n.length+u);(o=x.exec(s))!=null;){if(f=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!f)continue;if(h=[...f].length,o[3]||o[4]){m+=h;continue}else if((o[5]||o[6])&&u%3&&!((u+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);const k=[...o[0]][0].length,y=n.slice(0,u+o.index+k+h);if(Math.min(u,h)%2){const _=y.slice(1,-1);return{type:"em",raw:y,text:_,tokens:this.lexer.inlineTokens(_)}}const N=y.slice(2,-2);return{type:"strong",raw:y,text:N,tokens:this.lexer.inlineTokens(N)}}}}codespan(n){const s=this.rules.inline.code.exec(n);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(r),a=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&a&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(n){const s=this.rules.inline.br.exec(n);if(s)return{type:"br",raw:s[0]}}del(n){const s=this.rules.inline.del.exec(n);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(n){const s=this.rules.inline.autolink.exec(n);if(s){let r,o;return s[2]==="@"?(r=s[1],o="mailto:"+r):(r=s[1],o=r),{type:"link",raw:s[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(n){var r;let s;if(s=this.rules.inline.url.exec(n)){let o,a;if(s[2]==="@")o=s[0],a="mailto:"+o;else{let u;do u=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(u!==s[0]);o=s[0],s[1]==="www."?a="http://"+s[0]:a=s[0]}return{type:"link",raw:s[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(n){const s=this.rules.inline.text.exec(n);if(s){const r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},js=class ju{constructor(s){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||Tr,this.options.tokenizer=this.options.tokenizer||new na,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:gn,block:Rl.normal,inline:Ki.normal};this.options.pedantic?(r.block=Rl.pedantic,r.inline=Ki.pedantic):this.options.gfm&&(r.block=Rl.gfm,this.options.breaks?r.inline=Ki.breaks:r.inline=Ki.gfm),this.tokenizer.rules=r}static get rules(){return{block:Rl,inline:Ki}}static lex(s,r){return new ju(r).lex(s)}static lexInline(s,r){return new ju(r).inlineTokens(s)}lex(s){s=s.replace(gn.carriageReturn,`
389
+ `),this.blockTokens(s,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const o=this.inlineQueue[r];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,r=[],o=!1){var a,u,f;for(this.options.pedantic&&(s=s.replace(gn.tabCharGlobal," ").replace(gn.spaceLine,""));s;){let h;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(g=>(h=g.call({lexer:this},s,r))?(s=s.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.space(s)){s=s.substring(h.raw.length);const g=r.at(-1);h.raw.length===1&&g!==void 0?g.raw+=`
390
+ `:r.push(h);continue}if(h=this.tokenizer.code(s)){s=s.substring(h.raw.length);const g=r.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
391
+ `+h.raw,g.text+=`
392
+ `+h.text,this.inlineQueue.at(-1).src=g.text):r.push(h);continue}if(h=this.tokenizer.fences(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.heading(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.hr(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.blockquote(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.list(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.html(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.def(s)){s=s.substring(h.raw.length);const g=r.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
393
+ `+h.raw,g.text+=`
394
+ `+h.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[h.tag]||(this.tokens.links[h.tag]={href:h.href,title:h.title});continue}if(h=this.tokenizer.table(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.lheading(s)){s=s.substring(h.raw.length),r.push(h);continue}let m=s;if((f=this.options.extensions)!=null&&f.startBlock){let g=1/0;const x=s.slice(1);let k;this.options.extensions.startBlock.forEach(y=>{k=y.call({lexer:this},x),typeof k=="number"&&k>=0&&(g=Math.min(g,k))}),g<1/0&&g>=0&&(m=s.substring(0,g+1))}if(this.state.top&&(h=this.tokenizer.paragraph(m))){const g=r.at(-1);o&&(g==null?void 0:g.type)==="paragraph"?(g.raw+=`
395
+ `+h.raw,g.text+=`
396
+ `+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):r.push(h),o=m.length!==s.length,s=s.substring(h.raw.length);continue}if(h=this.tokenizer.text(s)){s=s.substring(h.raw.length);const g=r.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=`
397
+ `+h.raw,g.text+=`
398
+ `+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):r.push(h);continue}if(s){const g="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var h,m,g;let o=s,a=null;if(this.tokens.links){const x=Object.keys(this.tokens.links);if(x.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)x.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 x;if((m=(h=this.options.extensions)==null?void 0:h.inline)!=null&&m.some(y=>(x=y.call({lexer:this},s,r))?(s=s.substring(x.raw.length),r.push(x),!0):!1))continue;if(x=this.tokenizer.escape(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.tag(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.link(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(x.raw.length);const y=r.at(-1);x.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):r.push(x);continue}if(x=this.tokenizer.emStrong(s,o,f)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.codespan(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.br(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.del(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.autolink(s)){s=s.substring(x.raw.length),r.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(s))){s=s.substring(x.raw.length),r.push(x);continue}let k=s;if((g=this.options.extensions)!=null&&g.startInline){let y=1/0;const N=s.slice(1);let _;this.options.extensions.startInline.forEach(E=>{_=E.call({lexer:this},N),typeof _=="number"&&_>=0&&(y=Math.min(y,_))}),y<1/0&&y>=0&&(k=s.substring(0,y+1))}if(x=this.tokenizer.inlineText(k)){s=s.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(f=x.raw.slice(-1)),u=!0;const y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):r.push(x);continue}if(s){const y="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return r}},sa=class{constructor(n){ot(this,"options");ot(this,"parser");this.options=n||Tr}space(n){return""}code({text:n,lang:s,escaped:r}){var u;const o=(u=(s||"").match(gn.notSpaceStart))==null?void 0:u[0],a=n.replace(gn.endingNewline,"")+`
399
+ `;return o?'<pre><code class="language-'+ps(o)+'">'+(r?a:ps(a,!0))+`</code></pre>
400
+ `:"<pre><code>"+(r?a:ps(a,!0))+`</code></pre>
401
+ `}blockquote({tokens:n}){return`<blockquote>
402
+ ${this.parser.parse(n)}</blockquote>
403
+ `}html({text:n}){return n}heading({tokens:n,depth:s}){return`<h${s}>${this.parser.parseInline(n)}</h${s}>
404
+ `}hr(n){return`<hr>
405
+ `}list(n){const s=n.ordered,r=n.start;let o="";for(let f=0;f<n.items.length;f++){const h=n.items[f];o+=this.listitem(h)}const a=s?"ol":"ul",u=s&&r!==1?' start="'+r+'"':"";return"<"+a+u+`>
406
+ `+o+"</"+a+`>
407
+ `}listitem(n){var r;let s="";if(n.task){const o=this.checkbox({checked:!!n.checked});n.loose?((r=n.tokens[0])==null?void 0:r.type)==="paragraph"?(n.tokens[0].text=o+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=o+" "+ps(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):s+=o+" "}return s+=this.parser.parse(n.tokens,!!n.loose),`<li>${s}</li>
408
+ `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
409
+ `}table(n){let s="",r="";for(let a=0;a<n.header.length;a++)r+=this.tablecell(n.header[a]);s+=this.tablerow({text:r});let o="";for(let a=0;a<n.rows.length;a++){const u=n.rows[a];r="";for(let f=0;f<u.length;f++)r+=this.tablecell(u[f]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
410
+ <thead>
411
+ `+s+`</thead>
412
+ `+o+`</table>
413
+ `}tablerow({text:n}){return`<tr>
414
+ ${n}</tr>
415
+ `}tablecell(n){const s=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+s+`</${r}>
416
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${ps(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:s,tokens:r}){const o=this.parser.parseInline(r),a=Dh(n);if(a===null)return o;n=a;let u='<a href="'+n+'"';return s&&(u+=' title="'+ps(s)+'"'),u+=">"+o+"</a>",u}image({href:n,title:s,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));const a=Dh(n);if(a===null)return ps(r);n=a;let u=`<img src="${n}" alt="${r}"`;return s&&(u+=` title="${ps(s)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ps(n.text)}},hd=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Rs=class Ru{constructor(s){ot(this,"options");ot(this,"renderer");ot(this,"textRenderer");this.options=s||Tr,this.options.renderer=this.options.renderer||new sa,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new hd}static parse(s,r){return new Ru(r).parse(s)}static parseInline(s,r){return new Ru(r).parseInline(s)}parse(s,r=!0){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const g=h,x=this.options.extensions.renderers[g.type].call({parser:this},g);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(g.type)){o+=x||"";continue}}const m=h;switch(m.type){case"space":{o+=this.renderer.space(m);continue}case"hr":{o+=this.renderer.hr(m);continue}case"heading":{o+=this.renderer.heading(m);continue}case"code":{o+=this.renderer.code(m);continue}case"table":{o+=this.renderer.table(m);continue}case"blockquote":{o+=this.renderer.blockquote(m);continue}case"list":{o+=this.renderer.list(m);continue}case"html":{o+=this.renderer.html(m);continue}case"paragraph":{o+=this.renderer.paragraph(m);continue}case"text":{let g=m,x=this.renderer.text(g);for(;f+1<s.length&&s[f+1].type==="text";)g=s[++f],x+=`
417
+ `+this.renderer.text(g);r?o+=this.renderer.paragraph({type:"paragraph",raw:x,text:x,tokens:[{type:"text",raw:x,text:x,escaped:!0}]}):o+=x;continue}default:{const g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}parseInline(s,r=this.renderer){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const g=this.options.extensions.renderers[h.type].call({parser:this},h);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){o+=g||"";continue}}const m=h;switch(m.type){case"escape":{o+=r.text(m);break}case"html":{o+=r.html(m);break}case"link":{o+=r.link(m);break}case"image":{o+=r.image(m);break}case"strong":{o+=r.strong(m);break}case"em":{o+=r.em(m);break}case"codespan":{o+=r.codespan(m);break}case"br":{o+=r.br(m);break}case"del":{o+=r.del(m);break}case"text":{o+=r.text(m);break}default:{const g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}},gu,zl=(gu=class{constructor(n){ot(this,"options");ot(this,"block");this.options=n||Tr}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?js.lex:js.lexInline}provideParser(){return this.block?Rs.parse:Rs.parseInline}},ot(gu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),gu),rk=class{constructor(...n){ot(this,"defaults",od());ot(this,"options",this.setOptions);ot(this,"parse",this.parseMarkdown(!0));ot(this,"parseInline",this.parseMarkdown(!1));ot(this,"Parser",Rs);ot(this,"Renderer",sa);ot(this,"TextRenderer",hd);ot(this,"Lexer",js);ot(this,"Tokenizer",na);ot(this,"Hooks",zl);this.use(...n)}walkTokens(n,s){var o,a;let r=[];for(const u of n)switch(r=r.concat(s.call(this,u)),u.type){case"table":{const f=u;for(const h of f.header)r=r.concat(this.walkTokens(h.tokens,s));for(const h of f.rows)for(const m of h)r=r.concat(this.walkTokens(m.tokens,s));break}case"list":{const f=u;r=r.concat(this.walkTokens(f.items,s));break}default:{const f=u;(a=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&a[f.type]?this.defaults.extensions.childTokens[f.type].forEach(h=>{const m=f[h].flat(1/0);r=r.concat(this.walkTokens(m,s))}):f.tokens&&(r=r.concat(this.walkTokens(f.tokens,s)))}}return r}use(...n){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const u=s.renderers[a.name];u?s.renderers[a.name]=function(...f){let h=a.renderer.apply(this,f);return h===!1&&(h=u.apply(this,f)),h}:s.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const u=s[a.level];u?u.unshift(a.tokenizer):s[a.level]=[a.tokenizer],a.start&&(a.level==="block"?s.startBlock?s.startBlock.push(a.start):s.startBlock=[a.start]:a.level==="inline"&&(s.startInline?s.startInline.push(a.start):s.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(s.childTokens[a.name]=a.childTokens)}),o.extensions=s),r.renderer){const a=this.defaults.renderer||new sa(this.defaults);for(const u in r.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const f=u,h=r.renderer[f],m=a[f];a[f]=(...g)=>{let x=h.apply(a,g);return x===!1&&(x=m.apply(a,g)),x||""}}o.renderer=a}if(r.tokenizer){const a=this.defaults.tokenizer||new na(this.defaults);for(const u in r.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const f=u,h=r.tokenizer[f],m=a[f];a[f]=(...g)=>{let x=h.apply(a,g);return x===!1&&(x=m.apply(a,g)),x}}o.tokenizer=a}if(r.hooks){const a=this.defaults.hooks||new zl;for(const u in r.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const f=u,h=r.hooks[f],m=a[f];zl.passThroughHooks.has(u)?a[f]=g=>{if(this.defaults.async)return Promise.resolve(h.call(a,g)).then(k=>m.call(a,k));const x=h.call(a,g);return m.call(a,x)}:a[f]=(...g)=>{let x=h.apply(a,g);return x===!1&&(x=m.apply(a,g)),x}}o.hooks=a}if(r.walkTokens){const a=this.defaults.walkTokens,u=r.walkTokens;o.walkTokens=function(f){let h=[];return h.push(u.call(this,f)),a&&(h=h.concat(a.call(this,f))),h}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,s){return js.lex(n,s??this.defaults)}parser(n,s){return Rs.parse(n,s??this.defaults)}parseMarkdown(n){return(r,o)=>{const a={...o},u={...this.defaults,...a},f=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&a.async===!1)return f(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=n);const h=u.hooks?u.hooks.provideLexer():n?js.lex:js.lexInline,m=u.hooks?u.hooks.provideParser():n?Rs.parse:Rs.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(r):r).then(g=>h(g,u)).then(g=>u.hooks?u.hooks.processAllTokens(g):g).then(g=>u.walkTokens?Promise.all(this.walkTokens(g,u.walkTokens)).then(()=>g):g).then(g=>m(g,u)).then(g=>u.hooks?u.hooks.postprocess(g):g).catch(f);try{u.hooks&&(r=u.hooks.preprocess(r));let g=h(r,u);u.hooks&&(g=u.hooks.processAllTokens(g)),u.walkTokens&&this.walkTokens(g,u.walkTokens);let x=m(g,u);return u.hooks&&(x=u.hooks.postprocess(x)),x}catch(g){return f(g)}}}onError(n,s){return r=>{if(r.message+=`
418
+ Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+ps(r.message+"",!0)+"</pre>";return s?Promise.resolve(o):o}if(s)return Promise.reject(r);throw r}}},kr=new rk;function qe(n,s){return kr.parse(n,s)}qe.options=qe.setOptions=function(n){return kr.setOptions(n),qe.defaults=kr.defaults,gg(qe.defaults),qe};qe.getDefaults=od;qe.defaults=Tr;qe.use=function(...n){return kr.use(...n),qe.defaults=kr.defaults,gg(qe.defaults),qe};qe.walkTokens=function(n,s){return kr.walkTokens(n,s)};qe.parseInline=kr.parseInline;qe.Parser=Rs;qe.parser=Rs.parse;qe.Renderer=sa;qe.TextRenderer=hd;qe.Lexer=js;qe.lexer=js.lex;qe.Tokenizer=na;qe.Hooks=zl;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 Ph(n,s){(s==null||s>n.length)&&(s=n.length);for(var r=0,o=Array(s);r<s;r++)o[r]=n[r];return o}function ik(n){if(Array.isArray(n))return n}function ok(n,s){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var o,a,u,f,h=[],m=!0,g=!1;try{if(u=(r=r.call(n)).next,s!==0)for(;!(m=(o=u.call(r)).done)&&(h.push(o.value),h.length!==s);m=!0);}catch(x){g=!0,a=x}finally{try{if(!m&&r.return!=null&&(f=r.return(),Object(f)!==f))return}finally{if(g)throw a}}return h}}function lk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
419
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ak(n,s){return ik(n)||ok(n,s)||ck(n,s)||lk()}function ck(n,s){if(n){if(typeof n=="string")return Ph(n,s);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ph(n,s):void 0}}const Eg=Object.entries,Oh=Object.setPrototypeOf,uk=Object.isFrozen,dk=Object.getPrototypeOf,fk=Object.getOwnPropertyDescriptor;let Jt=Object.freeze,tn=Object.seal,ei=Object.create,_g=typeof Reflect<"u"&&Reflect,Au=_g.apply,Iu=_g.construct;Jt||(Jt=function(s){return s});tn||(tn=function(s){return s});Au||(Au=function(s,r){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return s.apply(r,a)});Iu||(Iu=function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return new s(...o)});const Qr=Lt(Array.prototype.forEach),pk=Lt(Array.prototype.lastIndexOf),zh=Lt(Array.prototype.pop),Zr=Lt(Array.prototype.push),hk=Lt(Array.prototype.splice),Js=Array.isArray,Ji=Lt(String.prototype.toLowerCase),cu=Lt(String.prototype.toString),$h=Lt(String.prototype.match),Yi=Lt(String.prototype.replace),Fh=Lt(String.prototype.indexOf),mk=Lt(String.prototype.trim),gk=Lt(Number.prototype.toString),vk=Lt(Boolean.prototype.toString),Uh=typeof BigInt>"u"?null:Lt(BigInt.prototype.toString),Bh=typeof Symbol>"u"?null:Lt(Symbol.prototype.toString),qt=Lt(Object.prototype.hasOwnProperty),Qi=Lt(Object.prototype.toString),Gt=Lt(RegExp.prototype.test),xr=yk(TypeError);function Lt(n){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return Au(n,s,o)}}function yk(n){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return Iu(n,r)}}function Ge(n,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ji;if(Oh&&Oh(n,null),!Js(s))return n;let o=s.length;for(;o--;){let a=s[o];if(typeof a=="string"){const u=r(a);u!==a&&(uk(s)||(s[o]=u),a=u)}n[a]=!0}return n}function xk(n){for(let s=0;s<n.length;s++)qt(n,s)||(n[s]=null);return n}function cn(n){const s=ei(null);for(const o of Eg(n)){var r=ak(o,2);const a=r[0],u=r[1];qt(n,a)&&(Js(u)?s[a]=xk(u):u&&typeof u=="object"&&u.constructor===Object?s[a]=cn(u):s[a]=u)}return s}function wk(n){switch(typeof n){case"string":return n;case"number":return gk(n);case"boolean":return vk(n);case"bigint":return Uh?Uh(n):"0";case"symbol":return Bh?Bh(n):"Symbol()";case"undefined":return Qi(n);case"function":case"object":{if(n===null)return Qi(n);const s=n,r=ts(s,"toString");if(typeof r=="function"){const o=r(s);return typeof o=="string"?o:Qi(o)}return Qi(n)}default:return Qi(n)}}function ts(n,s){for(;n!==null;){const o=fk(n,s);if(o){if(o.get)return Lt(o.get);if(typeof o.value=="function")return Lt(o.value)}n=dk(n)}function r(){return null}return r}function kk(n){try{return Gt(n,""),!0}catch{return!1}}const Wh=Jt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),uu=Jt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),du=Jt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Sk=Jt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fu=Jt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Tk=Jt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Hh=Jt(["#text"]),Vh=Jt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),pu=Jt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Gh=Jt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Al=Jt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),bk=tn(/{{[\w\W]*|^[\w\W]*}}/g),Nk=tn(/<%[\w\W]*|^[\w\W]*%>/g),Ck=tn(/\${[\w\W]*/g),Ek=tn(/^data-[\-\w.\u00B7-\uFFFF]+$/),_k=tn(/^aria-[\-\w]+$/),qh=tn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jk=tn(/^(?:\w+script|data):/i),Rk=tn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ak=tn(/^html$/i),Ik=tn(/^[a-z][.\w]*(-[.\w]+)+$/i),Kh=tn(/<[/\w!]/g),Xh=tn(/<[/\w]/g),Dk=tn(/<\/no(script|embed|frames)/i),Mk=tn(/\/>/i),Pn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Lk=function(){return typeof window>"u"?null:window},Pk=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(o=r.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return s.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Yh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Qs=function(s,r,o,a){return qt(s,r)&&Js(s[r])?Ge(a.base?cn(a.base):{},s[r],a.transform):o};function jg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lk();const s=re=>jg(re);if(s.version="3.4.13",s.removed=[],!n||!n.document||n.document.nodeType!==Pn.document||!n.Element)return s.isSupported=!1,s;let r=n.document;const o=r,a=o.currentScript;n.DocumentFragment;const u=n.HTMLTemplateElement,f=n.Node,h=n.Element,m=n.NodeFilter,g=n.NamedNodeMap;g===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const x=n.DOMParser,k=n.trustedTypes,y=h.prototype,N=ts(y,"cloneNode"),_=ts(y,"remove"),E=ts(y,"nextSibling"),T=ts(y,"childNodes"),M=ts(y,"parentNode"),I=ts(y,"shadowRoot"),B=ts(y,"attributes"),O=f&&f.prototype?ts(f.prototype,"nodeType"):null,W=f&&f.prototype?ts(f.prototype,"nodeName"):null,q=f&&f.prototype?ts(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const re=r.createElement("template");re.content&&re.content.ownerDocument&&(r=re.content.ownerDocument)}let K,G="",ae,de=!1,oe=0;const ke=function(){if(oe>0)throw xr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Ne=function(S){ke(),oe++;try{return K.createHTML(S)}finally{oe--}},Fe=function(S){ke(),oe++;try{return K.createScriptURL(S)}finally{oe--}},Q=function(){return de||(ae=Pk(k,a),de=!0),ae},se=r,ce=se.implementation,P=se.createNodeIterator,J=se.createDocumentFragment,H=se.getElementsByTagName,b=o.importNode;let A=Yh();s.isSupported=typeof Eg=="function"&&typeof M=="function"&&ce&&ce.createHTMLDocument!==void 0;const ee=bk,ue=Nk,me=Ck,xe=Ek,ze=_k,_e=jk,Ee=Rk,Te=Ik;let mt=qh,Me=null;const bt=Ge({},[...Wh,...uu,...du,...fu,...Hh]);let Le=null;const Pt=Ge({},[...Vh,...pu,...Gh,...Al]);let We=Object.seal(ei(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ut=null,Et=null;const gt=Object.seal(ei(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let _t=!0,Ot=!0,V=!1,ge=!0,Be=!1,Ke=!0,ft=!1,vt=!1,ct=null,Xt=null,nn=!1,yt=!1,$n=!1,un=!1,is=!0,_n=!1;const jn="user-content-";let Rn=!0,xn=!1,dn={},Bt=null;const wn=Ge({},["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 j=Ge({},["audio","video","img","source","image","track"]);let le=null;const ne=Ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ve="http://www.w3.org/1998/Math/MathML",Re="http://www.w3.org/2000/svg",Pe="http://www.w3.org/1999/xhtml";let je=Pe,Ue=!1,lt=null;const rt=Ge({},[ve,Re,Pe],cu),It=Jt(["mi","mo","mn","ms","mtext"]);let Dt=Ge({},It);const Yt=Jt(["annotation-xml"]);let pt=Ge({},Yt);const sn=Ge({},["title","style","font","a","script"]);let He=null;const jt=["application/xhtml+xml","text/html"],os="text/html";let et=null,vs=null;const vo=r.createElement("form"),yo=function(S){return S instanceof RegExp||S instanceof Function},br=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(vs&&vs===S)return;(!S||typeof S!="object")&&(S={}),S=cn(S),He=jt.indexOf(S.PARSER_MEDIA_TYPE)===-1?os:S.PARSER_MEDIA_TYPE,et=He==="application/xhtml+xml"?cu:Ji,Me=Qs(S,"ALLOWED_TAGS",bt,{transform:et}),Le=Qs(S,"ALLOWED_ATTR",Pt,{transform:et}),lt=Qs(S,"ALLOWED_NAMESPACES",rt,{transform:cu}),le=Qs(S,"ADD_URI_SAFE_ATTR",ne,{transform:et,base:ne}),nt=Qs(S,"ADD_DATA_URI_TAGS",j,{transform:et,base:j}),Bt=Qs(S,"FORBID_CONTENTS",wn,{transform:et}),Ut=Qs(S,"FORBID_TAGS",cn({}),{transform:et}),Et=Qs(S,"FORBID_ATTR",cn({}),{transform:et}),dn=qt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?cn(S.USE_PROFILES):S.USE_PROFILES:!1,_t=S.ALLOW_ARIA_ATTR!==!1,Ot=S.ALLOW_DATA_ATTR!==!1,V=S.ALLOW_UNKNOWN_PROTOCOLS||!1,ge=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Be=S.SAFE_FOR_TEMPLATES||!1,Ke=S.SAFE_FOR_XML!==!1,ft=S.WHOLE_DOCUMENT||!1,yt=S.RETURN_DOM||!1,$n=S.RETURN_DOM_FRAGMENT||!1,un=S.RETURN_TRUSTED_TYPE||!1,nn=S.FORCE_BODY||!1,is=S.SANITIZE_DOM!==!1,_n=S.SANITIZE_NAMED_PROPS||!1,Rn=S.KEEP_CONTENT!==!1,xn=S.IN_PLACE||!1,mt=kk(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:qh,je=typeof S.NAMESPACE=="string"?S.NAMESPACE:Pe,Dt=qt(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?cn(S.MATHML_TEXT_INTEGRATION_POINTS):Ge({},It),pt=qt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?cn(S.HTML_INTEGRATION_POINTS):Ge({},Yt);const z=qt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?cn(S.CUSTOM_ELEMENT_HANDLING):ei(null);if(We=ei(null),qt(z,"tagNameCheck")&&yo(z.tagNameCheck)&&(We.tagNameCheck=z.tagNameCheck),qt(z,"attributeNameCheck")&&yo(z.attributeNameCheck)&&(We.attributeNameCheck=z.attributeNameCheck),qt(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(We.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),tn(We),Be&&(Ot=!1),$n&&(yt=!0),dn&&(Me=Ge({},Hh),Le=ei(null),dn.html===!0&&(Ge(Me,Wh),Ge(Le,Vh)),dn.svg===!0&&(Ge(Me,uu),Ge(Le,pu),Ge(Le,Al)),dn.svgFilters===!0&&(Ge(Me,du),Ge(Le,pu),Ge(Le,Al)),dn.mathMl===!0&&(Ge(Me,fu),Ge(Le,Gh),Ge(Le,Al))),gt.tagCheck=null,gt.attributeCheck=null,qt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?gt.tagCheck=S.ADD_TAGS:Js(S.ADD_TAGS)&&(Me===bt&&(Me=cn(Me)),Ge(Me,S.ADD_TAGS,et))),qt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?gt.attributeCheck=S.ADD_ATTR:Js(S.ADD_ATTR)&&(Le===Pt&&(Le=cn(Le)),Ge(Le,S.ADD_ATTR,et))),qt(S,"ADD_URI_SAFE_ATTR")&&Js(S.ADD_URI_SAFE_ATTR)&&Ge(le,S.ADD_URI_SAFE_ATTR,et),qt(S,"FORBID_CONTENTS")&&Js(S.FORBID_CONTENTS)&&(Bt===wn&&(Bt=cn(Bt)),Ge(Bt,S.FORBID_CONTENTS,et)),qt(S,"ADD_FORBID_CONTENTS")&&Js(S.ADD_FORBID_CONTENTS)&&(Bt===wn&&(Bt=cn(Bt)),Ge(Bt,S.ADD_FORBID_CONTENTS,et)),Rn&&(Me["#text"]=!0),ft&&Ge(Me,["html","head","body"]),Me.table&&(Ge(Me,["tbody"]),delete Ut.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw xr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const X=K;K=S.TRUSTED_TYPES_POLICY;try{G=Ne("")}catch(ye){throw K=X,ye}}else S.TRUSTED_TYPES_POLICY===null?(K=void 0,G=""):(K===void 0&&(K=Q()),K&&typeof G=="string"&&(G=Ne("")));Jt&&Jt(S),vs=S},pi=Ge({},[...uu,...du,...Sk]),hi=Ge({},[...fu,...Tk]),xo=function(S,z,X){return z.namespaceURI===Pe?S==="svg":z.namespaceURI===ve?S==="svg"&&(X==="annotation-xml"||Dt[X]):!!pi[S]},va=function(S,z,X){return z.namespaceURI===Pe?S==="math":z.namespaceURI===Re?S==="math"&&pt[X]:!!hi[S]},ya=function(S,z,X){return z.namespaceURI===Re&&!pt[X]||z.namespaceURI===ve&&!Dt[X]?!1:!hi[S]&&(sn[S]||!pi[S])},xt=function(S){let z=M(S);(!z||!z.tagName)&&(z={namespaceURI:je,tagName:"template"});const X=Ji(S.tagName),ye=Ji(z.tagName);return lt[S.namespaceURI]?S.namespaceURI===Re?xo(X,z,ye):S.namespaceURI===ve?va(X,z,ye):S.namespaceURI===Pe?ya(X,z,ye):!!(He==="application/xhtml+xml"&&lt[S.namespaceURI]):!1},ls=function(S){Zr(s.removed,{element:S});try{M(S).removeChild(S)}catch{if(_(S),!M(S))throw xr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Is=function(S){tr(S);const z=T(S);if(z){const ye=[];Qr(z,Ce=>{Zr(ye,Ce)}),Qr(ye,Ce=>{try{_(Ce)}catch{}})}const X=B(S);if(X)for(let ye=X.length-1;ye>=0;--ye){const Ce=X[ye],$e=Ce&&Ce.name;if(typeof $e=="string")try{S.removeAttribute($e)}catch{}}},as=function(S,z){try{Zr(s.removed,{attribute:z.getAttributeNode(S),from:z})}catch{Zr(s.removed,{attribute:null,from:z})}if(z.removeAttribute(S),S==="is")if(yt||$n)try{ls(z)}catch{}else try{z.setAttribute(S,"")}catch{}},Nr=function(S){const z=B(S);if(z)for(let X=z.length-1;X>=0;--X){const ye=z[X],Ce=ye&&ye.name;if(!(typeof Ce!="string"||Le[et(Ce)]))try{S.removeAttribute(Ce)}catch{}}},tr=function(S){const z=[S];for(;z.length>0;){const X=z.pop();(O?O(X):X.nodeType)===Pn.element&&Nr(X);const Ce=T(X);if(Ce)for(let $e=Ce.length-1;$e>=0;--$e)z.push(Ce[$e])}},wo=function(S){if(!Ke)return;const z=[S];for(;z.length>0;){const X=z.pop(),ye=O?O(X):X.nodeType;if(ye===Pn.processingInstruction||ye===Pn.comment&&Gt(Xh,X.data)){try{_(X)}catch{}continue}if(ye===Pn.element){const $e=X,Ye=et(W?W(X):X.nodeName);try{$e.hasAttribute&&$e.hasAttribute("patchsrc")&&$e.removeAttribute("patchsrc"),$e.hasAttribute&&$e.hasAttribute("for")&&Ye!=="label"&&Ye!=="output"&&$e.removeAttribute("for")}catch{}}const Ce=T(X);if(Ce)for(let $e=Ce.length-1;$e>=0;--$e)z.push(Ce[$e])}},nr=function(S){let z=null,X=null;if(nn)S="<remove></remove>"+S;else{const $e=$h(S,/^[\r\n\t ]+/);X=$e&&$e[0]}He==="application/xhtml+xml"&&je===Pe&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const ye=K?Ne(S):S;if(je===Pe)try{z=new x().parseFromString(ye,He)}catch{}if(!z||!z.documentElement){z=ce.createDocument(je,"template",null);try{z.documentElement.innerHTML=Ue?G:ye}catch{}}const Ce=z.body||z.documentElement;return S&&X&&Ce.insertBefore(r.createTextNode(X),Ce.childNodes[0]||null),je===Pe?H.call(z,ft?"html":"body")[0]:ft?z.documentElement:Ce},An=function(S){const z=q?q(S):S.ownerDocument;return P.call(z||S,S,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Cr=function(S){return S=Yi(S,ee," "),S=Yi(S,ue," "),S=Yi(S,me," "),S},fn=function(S){var z;S.normalize();const X=q?q(S):S.ownerDocument,ye=P.call(X||S,S,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let Ce=ye.nextNode();for(;Ce;)Ce.data=Cr(Ce.data),Ce=ye.nextNode();const $e=(z=S.querySelectorAll)===null||z===void 0?void 0:z.call(S,"template");$e&&Qr($e,Ye=>{Ds(Ye.content)&&fn(Ye.content)})},Er=function(S){const z=W?W(S):null;return typeof z!="string"||et(z)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==B(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==O(S)||S.childNodes!==T(S)},Ds=function(S){if(!O||typeof S!="object"||S===null)return!1;try{return O(S)===Pn.documentFragment}catch{return!1}},sr=function(S){if(!O||typeof S!="object"||S===null)return!1;try{return typeof O(S)=="number"}catch{return!1}};function pn(re,S,z){re.length!==0&&Qr(re,X=>{X.call(s,S,z,vs)})}const _r=function(S,z){return!!(Ke&&S.hasChildNodes()&&!sr(S.firstElementChild)&&Gt(Kh,S.textContent)&&Gt(Kh,S.innerHTML)||Ke&&S.namespaceURI===Pe&&z==="style"&&sr(S.firstElementChild)||S.nodeType===Pn.processingInstruction||Ke&&S.nodeType===Pn.comment&&Gt(Xh,S.data))},rr=function(S,z,X){if(!Ut[z]&&gi(z)&&(We.tagNameCheck instanceof RegExp&&Gt(We.tagNameCheck,z)||We.tagNameCheck instanceof Function&&We.tagNameCheck(z)))return!1;if(Rn&&!Bt[z]){const ye=M(S),Ce=T(S);if(Ce&&ye){const $e=Ce.length;for(let Ye=$e-1;Ye>=0;--Ye){const Ze=S===X?N(Ce[Ye],!0):Ce[Ye];ye.insertBefore(Ze,E(S))}}}return ls(S),!0},ir=function(S,z,X,ye){return S.length===0?z:z===X||z===ye?cn(z):z},ko=function(S,z){if(pn(A.beforeSanitizeElements,S,null),S!==z&&M(S)===null)return xn&&tr(S),!0;if(Er(S))return ls(S),!0;const X=et(W?W(S):S.nodeName);if(Me=ir(A.uponSanitizeElement,Me,bt,ct),pn(A.uponSanitizeElement,S,{tagName:X,allowedTags:Me}),S!==z&&M(S)===null)return xn&&tr(S),!0;if(_r(S,X))return ls(S),!0;if(Ut[X]||!(gt.tagCheck instanceof Function&&gt.tagCheck(X))&&!Me[X]){const Ce=rr(S,X,z);return Ce===!1&&pn(A.afterSanitizeElements,S,null),Ce}if((O?O(S):S.nodeType)===Pn.element&&!xt(S)||(X==="noscript"||X==="noembed"||X==="noframes")&&Gt(Dk,S.innerHTML))return ls(S),!0;if(Be&&S.nodeType===Pn.text){const Ce=Cr(S.textContent);S.textContent!==Ce&&(Zr(s.removed,{element:S.cloneNode()}),S.textContent=Ce)}return pn(A.afterSanitizeElements,S,null),!1},So=function(S,z,X){if(Et[z]||Ke&&z==="patchsrc"||Ke&&z==="for"&&S!=="label"&&S!=="output"||is&&(z==="id"||z==="name")&&(X in r||X in vo))return!1;const ye=Le[z]||gt.attributeCheck instanceof Function&&gt.attributeCheck(z,S);if(!(Ot&&Gt(xe,z))){if(!(_t&&Gt(ze,z))){if(ye){if(!le[z]){if(!Gt(mt,Yi(X,Ee,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&S!=="script"&&Fh(X,"data:")===0&&nt[S])){if(!(V&&!Gt(_e,Yi(X,Ee,"")))){if(X)return!1}}}}}else if(!(gi(S)&&(We.tagNameCheck instanceof RegExp&&Gt(We.tagNameCheck,S)||We.tagNameCheck instanceof Function&&We.tagNameCheck(S))&&(We.attributeNameCheck instanceof RegExp&&Gt(We.attributeNameCheck,z)||We.attributeNameCheck instanceof Function&&We.attributeNameCheck(z,S))||z==="is"&&We.allowCustomizedBuiltInElements&&(We.tagNameCheck instanceof RegExp&&Gt(We.tagNameCheck,X)||We.tagNameCheck instanceof Function&&We.tagNameCheck(X))))return!1}}return!0},mi=Ge({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),gi=function(S){return!mi[Ji(S)]&&Gt(Te,S)},vi=function(S,z,X,ye){if(K&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!X)switch(k.getAttributeType(S,z)){case"TrustedHTML":return Ne(ye);case"TrustedScriptURL":return Fe(ye)}return ye},or=function(S,z,X,ye){try{X?S.setAttributeNS(X,z,ye):S.setAttribute(z,ye),Er(S)?ls(S):zh(s.removed)}catch{as(z,S)}},To=function(S){pn(A.beforeSanitizeAttributes,S,null);const z=S.attributes;if(!z||Er(S))return;Le=ir(A.uponSanitizeAttribute,Le,Pt,Xt);const X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Le,forceKeepAttr:void 0};let ye=z.length;const Ce=et(S.nodeName);for(;ye--;){const $e=z[ye],Ye=$e.name,Ze=$e.namespaceURI,wt=$e.value,kt=et(Ye),ys=wt;let Rt=Ye==="value"?ys:mk(ys);if(X.attrName=kt,X.attrValue=Rt,X.keepAttr=!0,X.forceKeepAttr=void 0,pn(A.uponSanitizeAttribute,S,X),Rt=X.attrValue,_n&&(kt==="id"||kt==="name")&&Fh(Rt,jn)!==0&&(as(Ye,S),Rt=jn+Rt),Ke&&Gt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Rt)){as(Ye,S);continue}if(kt==="attributename"&&$h(Rt,"href")){as(Ye,S);continue}if(!X.forceKeepAttr){if(!X.keepAttr){as(Ye,S);continue}if(!ge&&Gt(Mk,Rt)){as(Ye,S);continue}if(Be&&(Rt=Cr(Rt)),!So(Ce,kt,Rt)){as(Ye,S);continue}Rt=vi(Ce,kt,Ze,Rt),Rt!==ys&&or(S,Ye,Ze,Rt)}}pn(A.afterSanitizeAttributes,S,null)},Ms=function(S){let z=null;const X=An(S);for(pn(A.beforeSanitizeShadowDOM,S,null);z=X.nextNode();)if(pn(A.uponSanitizeShadowNode,z,null),ko(z,S),To(z),Ds(z.content)&&Ms(z.content),(O?O(z):z.nodeType)===Pn.element){const Ce=I(z);Ds(Ce)&&(Xe(Ce),Ms(Ce))}pn(A.afterSanitizeShadowDOM,S,null)},Xe=function(S){const z=[{node:S,shadow:null}];for(;z.length>0;){const X=z.pop();if(X.shadow){Ms(X.shadow);continue}const ye=X.node,$e=(O?O(ye):ye.nodeType)===Pn.element,Ye=T(ye);if(Ye)for(let Ze=Ye.length-1;Ze>=0;--Ze)z.push({node:Ye[Ze],shadow:null});if($e){const Ze=W?W(ye):null;if(typeof Ze=="string"&&et(Ze)==="template"){const wt=ye.content;Ds(wt)&&z.push({node:wt,shadow:null})}}if($e){const Ze=I(ye);Ds(Ze)&&z.push({node:null,shadow:Ze},{node:Ze,shadow:null})}}};return s.sanitize=function(re){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,X=null,ye=null,Ce=null;if(Ue=!re,Ue&&(re="<!-->"),typeof re!="string"&&!sr(re)&&(re=wk(re),typeof re!="string"))throw xr("dirty is not a string, aborting");if(!s.isSupported)return re;vt?(Me=ct,Le=Xt):br(S),(A.uponSanitizeElement.length>0||A.uponSanitizeAttribute.length>0)&&(Me=cn(Me)),A.uponSanitizeAttribute.length>0&&(Le=cn(Le)),s.removed=[];const $e=xn&&typeof re!="string"&&sr(re);if($e){wo(re);const wt=W?W(re):re.nodeName;if(typeof wt=="string"){const kt=et(wt);if(!Me[kt]||Ut[kt])throw Is(re),xr("root node is forbidden and cannot be sanitized in-place")}if(Er(re))throw Is(re),xr("root node is clobbered and cannot be sanitized in-place");try{Xe(re)}catch(kt){throw Is(re),kt}}else if(sr(re))z=nr("<!---->"),X=z.ownerDocument.importNode(re,!0),X.nodeType===Pn.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?z=X:z.appendChild(X),Xe(X);else{if(!yt&&!Be&&!ft&&re.indexOf("<")===-1)return K&&un?Ne(re):re;if(z=nr(re),!z)return yt?null:un?G:""}z&&nn&&ls(z.firstChild);const Ye=$e?re:z;try{const wt=An(Ye);for(;ye=wt.nextNode();)ko(ye,Ye),To(ye),Ds(ye.content)&&Ms(ye.content)}catch(wt){throw $e&&(Is(re),Qr(s.removed,kt=>{kt.element&&tr(kt.element)})),wt}if($e)return Qr(s.removed,wt=>{wt.element&&tr(wt.element)}),Be&&fn(re),re;if(yt){if(Be&&fn(z),$n)for(Ce=J.call(z.ownerDocument);z.firstChild;)Ce.appendChild(z.firstChild);else Ce=z;return(Le.shadowroot||Le.shadowrootmode)&&(Ce=b.call(o,Ce,!0)),Ce}let Ze=ft?z.outerHTML:z.innerHTML;return ft&&Me["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&Gt(Ak,z.ownerDocument.doctype.name)&&(Ze="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
420
+ `+Ze),Be&&(Ze=Cr(Ze)),K&&un?Ne(Ze):Ze},s.setConfig=function(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};br(re),vt=!0,ct=Me,Xt=Le},s.clearConfig=function(){vs=null,vt=!1,ct=null,Xt=null,K=ae,G=""},s.isValidAttribute=function(re,S,z){vs||br({});const X=et(re),ye=et(S);return So(X,ye,z)},s.addHook=function(re,S){typeof S=="function"&&qt(A,re)&&Zr(A[re],S)},s.removeHook=function(re,S){if(qt(A,re)){if(S!==void 0){const z=pk(A[re],S);return z===-1?void 0:hk(A[re],z,1)[0]}return zh(A[re])}},s.removeHooks=function(re){qt(A,re)&&(A[re]=[])},s.removeAllHooks=function(){A=Yh()},s}var md=jg();const Ok=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function Qh(n){return Ok.has(n.type)}function zk({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(b0,{size:12})}),c.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),c.jsx(Yu,{size:14,className:"tool-calls-chevron",style:{transform:a?"rotate(90deg)":"none"}})]}),a&&c.jsx("div",{className:"tool-calls-body",children:n.map(h=>c.jsx(_s,{item:h,runtimeType:s,turn:r,threads:o},h.id))})]})}qe.setOptions({breaks:!0,gfm:!0});function $k(n){const s=qe.parse(n);return md.sanitize(s)}function Zh(n,s){var a;const r=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let o=0;for(;r.nextNode();){const u=r.currentNode,f=((a=u.textContent)==null?void 0:a.length)??0;if(o+f>s)return{node:u,offset:s-o};o+=f}return null}function Fk(n,s,r){const o=document.createTreeWalker(n,NodeFilter.SHOW_TEXT),a=[];for(;o.nextNode();){const u=o.currentNode;if(!u.textContent||u.textContent.trim()==="")continue;const f=document.createRange();f.selectNodeContents(u),!(f.compareBoundaryPoints(Range.START_TO_END,s)<=0)&&(f.compareBoundaryPoints(Range.END_TO_START,s)>=0||a.push(u))}for(const u of a){const f=u.length;let h=0,m=f;if(u===s.startContainer&&(h=Math.min(s.startOffset,f)),u===s.endContainer&&(m=Math.min(s.endOffset,f)),h>=m)continue;m<f&&u.splitText(m);const g=h>0?u.splitText(h):u,x=r(),k=g.parentNode;k&&(k.insertBefore(x,g),x.appendChild(g))}}function Uk(n,s){n.querySelectorAll("mark[data-thread-id]").forEach(r=>{const o=r.parentNode;if(!o)return;const a=document.createTextNode(r.textContent||"");o.replaceChild(a,r),o.normalize()});for(const r of s){if(r.start_offset===null||r.end_offset===null)continue;const o=Zh(n,r.start_offset),a=Zh(n,r.end_offset);if(!o||!a)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(a.node,a.offset),Fk(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 Bk(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 Wk({itemId:n,turnId:s,sessionId:r,content:o,threads:a}){const u=w.useRef(null),f=w.useRef(null),h=w.useRef(null),m=w.useRef(""),g=w.useRef(0),[x,k]=w.useState(!1),[y,N]=w.useState({x:0,y:0}),[_,E]=w.useState(!1),[T,M]=w.useState({x:0,y:0}),[I,B]=w.useState(""),[O,W]=w.useState(null),[q,K]=w.useState(!1),G=L(H=>H.createThread),ae=L(H=>H.switchRightTab),de=L(H=>oa(H.sessionDetails[r])),oe=w.useCallback(async()=>{await Eu(o||""),K(!0),setTimeout(()=>K(!1),1500)},[o]),ke=w.useCallback(()=>{var b;if(!O)return;const H=`
421
+ \`\`\`QUOTE
422
+ ${O.text}
423
+ \`\`\`
424
+
425
+ `;L.setState({quotedText:H}),k(!1),W(null),(b=window.getSelection())==null||b.removeAllRanges()},[O]),Ne=w.useMemo(()=>$k(o||"…"),[o]),Fe=w.useMemo(()=>a.filter(H=>H.item_id===n),[a,n]);w.useEffect(()=>{u.current&&Uk(u.current,Fe)},[Ne,Fe]),w.useEffect(()=>{m.current=I},[I]),w.useEffect(()=>{function H(b){f.current&&!f.current.contains(b.target)&&(k(!1),m.current.trim()||E(!1))}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);const Q=w.useCallback(()=>{k(!1),m.current.trim()||E(!1)},[]),se=w.useCallback(()=>{const H=u.current;if(!H)return;const b=Bk(H);if(b&&b.text.trim().length>0){const A=window.getSelection();if(A&&A.rangeCount>0&&A.anchorNode&&A.focusNode){const ue=A.getRangeAt(0).getBoundingClientRect(),me=28,xe=6,ze=170;let _e=!1;try{const mt=document.createRange();mt.setStart(A.focusNode,A.focusOffset),mt.setEnd(A.focusNode,A.focusOffset);const Me=document.createRange();Me.setStart(A.anchorNode,A.anchorOffset),Me.setEnd(A.anchorNode,A.anchorOffset),_e=Me.compareBoundaryPoints(Range.START_TO_START,mt)>0}catch{_e=!1}let Ee=ue.top-me-xe;Ee<8&&(Ee=ue.bottom+xe);let Te=_e?ue.left-ze:ue.right;Te=Math.max(8,Math.min(Te,window.innerWidth-ze-8)),N({x:Te,y:Ee}),k(!0),W(b)}}else k(!1)},[]);w.useEffect(()=>{function H(b){const A=b.target;A&&(A.closest(".selection-actions")||A.closest(".thread-create-popover"))||se()}return document.addEventListener("mouseup",H),()=>document.removeEventListener("mouseup",H)},[se]);const ce=w.useCallback(()=>{k(!1),E(!0),M({x:y.x,y:y.y})},[y]);w.useLayoutEffect(()=>{if(!_)return;const H=h.current;if(!H)return;const b=H.offsetWidth,A=H.offsetHeight,ee=8;let ue=y.x,me=y.y;ue-b<ee&&(ue=b+ee),ue>window.innerWidth-ee&&(ue=window.innerWidth-ee),me<ee&&(me=ee),me+A>window.innerHeight-ee&&(me=window.innerHeight-A-ee),M({x:ue,y:me})},[_,y]);const P=w.useCallback(async()=>{var H;de||!O||!I.trim()||(await G(r,{itemId:n,turnId:s,startOffset:O.start,endOffset:O.end,selectedText:O.text,message:I.trim()}),B(""),E(!1),W(null),(H=window.getSelection())==null||H.removeAllRanges(),ae("threads"))},[O,I,G,r,n,s,ae,de]),J=w.useCallback(H=>{const b=H.target;if(b.tagName==="MARK"&&b.hasAttribute("data-thread-id")){H.preventDefault(),ae("threads");const A=b.getAttribute("data-thread-id");setTimeout(()=>{const ee=document.getElementById(`thread-${A}`);ee&&(ee.scrollIntoView({behavior:"smooth",block:"center"}),ee.classList.add("thread-card-highlighted"),setTimeout(()=>ee.classList.remove("thread-card-highlighted"),1500))},100)}},[ae]);return c.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[c.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:Ne},onMouseDown:Q,onClick:J}),c.jsx("button",{className:`copy-text-btn${q?" copied":""}`,onClick:oe,title:q?"Copied":"Copy message","aria-label":"Copy message text",children:q?c.jsx(er,{size:14}):c.jsx(Su,{size:14})}),x&&!_&&c.jsxs("div",{className:"selection-actions",style:{left:y.x,top:y.y},children:[!de&&c.jsxs("button",{className:"discuss-button",onClick:ce,title:"Start a discussion about this text",children:[c.jsx(u0,{size:14}),c.jsx("span",{children:"Discuss"})]}),c.jsxs("button",{className:"discuss-button",onClick:ke,title:"Quote this text in your message",children:[c.jsx(Fm,{size:14}),c.jsx("span",{children:"Quote"})]})]}),_&&c.jsxs("div",{ref:h,className:"thread-create-popover",style:{left:T.x,top:T.y},children:[c.jsxs("div",{className:"thread-create-header",children:[c.jsxs("span",{className:"thread-create-quote",children:['"',O==null?void 0:O.text.slice(0,80),O&&O.text.length>80?"…":"",'"']}),c.jsx("button",{className:"thread-create-close",onClick:()=>{E(!1),W(null)},children:c.jsx(Kn,{size:14})})]}),c.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:I,onChange:H=>B(H.target.value),autoFocus:!0,rows:2,onKeyDown:H=>{if(H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),P()),H.key==="Escape")if(m.current.trim()){const b=Date.now();g.current&&b-g.current<400?(g.current=0,E(!1),W(null)):g.current=b}else E(!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:P,disabled:!I.trim()||de,title:de?"Wait for the running turn to finish first":void 0,children:[c.jsx(ca,{size:13}),c.jsx("span",{children:"Send"})]})]})]})]})}const Jh=w.memo(Wk),ra=new Map,Rg=new Set,Du=new Set,em=new Map;function Ag(){Du.forEach(n=>n())}function Ig(n,s){return`${n}:${s}`}function Hk(n,s,r,o,a){var m;const u=Ig(s,r),f=ra.get(n)??new Map,h=new Map(f);((m=h.get(u))==null?void 0:m.answer)===a?h.delete(u):h.set(u,{itemIndex:s,groupIndex:r,question:o,answer:a}),ra.set(n,h),Ag()}function Vk(n){ra.delete(n),Ag()}function Gk(n){Rg.add(n),Vk(n)}function qk(n){const s=w.useCallback(r=>(Du.add(r),()=>{Du.delete(r)}),[]);return w.useSyncExternalStore(s,()=>ra.get(n)??em,()=>em)}function Kk(n){return[...n].sort((s,r)=>s.itemIndex-r.itemIndex||s.groupIndex-r.groupIndex).map(s=>`> ${s.question}
426
+ ${s.answer}`).join(`
427
+
428
+ `)}function tm({item:n,turn:s}){var N;const r=n.data??{},o=w.useMemo(()=>Array.isArray(r.groups)?r.groups.filter(_=>!!_&&Array.isArray(_.selections)&&_.selections.length>0):[],[r.groups]),a=qk(s.id),u=L(_=>s.session_id?_.sessionDetails[s.session_id]:null),f=L(_=>_.activeSessionId),h=s.items.findIndex(_=>_.id===n.id),m=u?((N=u.turns[u.turns.length-1])==null?void 0:N.id)===s.id:!0,g=Rg.has(s.id),x=g||Rm(u)||!m||s.session_id!==f,k=(_,E,T)=>{x||Hk(s.id,h,_,E,T)},y=()=>{const _=[...a.values()];if(_.length===0)return;const E=Kk(_);Gk(s.id),L.getState().submitPrompt(E)};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(Yx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Question"}),g&&c.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?c.jsxs("div",{className:"ask-user-groups",children:[o.map((_,E)=>c.jsxs("div",{className:"ask-user-group",children:[_.question&&c.jsx("div",{className:"ask-user-question",children:_.question}),c.jsx("div",{className:"ask-user-options",children:_.selections.map(T=>{var I;const M=((I=a.get(Ig(h,E)))==null?void 0:I.answer)===T;return c.jsx("button",{type:"button",className:`ask-user-option ${M?"selected":""}`,disabled:x,onClick:()=>k(E,_.question,T),children:T},T)})})]},E)),x?g&&c.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):c.jsxs("button",{type:"button",className:"ask-user-send",disabled:a.size===0,onClick:y,children:[c.jsx(ca,{size:12}),"Send"]})]}):r.question?c.jsx("p",{className:"user-message",children:r.question}):c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}qe.setOptions({breaks:!0,gfm:!0});function Xk({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($m,{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(Kn,{size:20})})]})})]})}function Yk(n){const s=qe.parse(n);return md.sanitize(s)}function nm(n){var s;return(s=n.data)!=null&&s.text?n.data.text:""}function Qk(n){const s=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return s?s[1]:n}const sm='<script>(function(){function report(){var h=Math.max(document.documentElement.scrollHeight,document.body?document.body.scrollHeight:0);if(h>0)parent.postMessage(Math.ceil(h),"*");}window.addEventListener("load",report);new ResizeObserver(report).observe(document.documentElement);report();})();<\/script>';function Zk(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${sm}</body>`):n+sm}function Jk({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:Zk(n),title:"HTML content",style:{width:"100%",height:`${s}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const rm=1e4;function eS({item:n,runtimeType:s,turn:r,threads:o}){var h,m,g,x,k,y,N,_;const a=n.status==="in_progress",[u,f]=w.useState(!1);switch(n.type){case"agent_message":{const{iconClass:E,iconText:T}=wu(s??"codex");return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${E}`,children:T}),c.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&c.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),c.jsx(Jh,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:nm(n)||"…",threads:o,runtimeType:s})]})}case"reasoning":return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Kx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),c.jsx("div",{dangerouslySetInnerHTML:{__html:Yk(nm(n))}})]});case"command_execution":{const E=n.data||{},T=Qk(E.command||""),M=E.aggregated_output||"",I=E.exit_code,B=a?"running…":I!==null?`exit ${I}`:"",O=M.length>rm,W=O&&!u?M.slice(0,rm)+`
429
+ … (truncated, click to expand)`:M;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Bm,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),B&&c.jsx("span",{className:"turn-header-meta",children:B})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:T})}),M&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:W})}),O&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(q=>!q),children:u?"Show less":`Show full output (${(M.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const E=(h=n.data)==null?void 0:h.changes,T=Array.isArray(E)?E:[],M=`${T.length} file${T.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(n0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:M})]}),c.jsx("div",{className:"file-change-list",children:T.map((I,B)=>{const O=I.kind==="add"?"A":I.kind==="delete"?"D":"M",W=I.kind==="add"?"fc-add":I.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${W}`,children:O}),c.jsx("span",{className:"fc-name",children:I.path})]},B)})})]})}case"mcp_tool_call":{const E=n.data||{},T=E.tool||"mcp";if(T==="Agent"){const G=E.arguments,ae=(G==null?void 0:G.description)||(G==null?void 0:G.prompt)||"Subagent",de=n.status==="failed",oe=a?"running…":de?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(ku,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:ae}),c.jsx("span",{className:`agent-call-status ${a?"running":de?"failed":"done"}`,children:oe})]})}const M=E.server||"",I=E.arguments,B=E.result,O=E.error,W=n.status==="failed"||!!O,q=a?"running…":W?"failed":"done",K=((m=B==null?void 0:B.content)==null?void 0:m.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(g0,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",T]}),M&&c.jsx("span",{className:"turn-header-meta",children:M}),c.jsx("span",{className:"turn-header-meta",style:W?{color:"var(--red)"}:void 0,children:q})]}),I&&Object.keys(I).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(I).map(([G,ae])=>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(ae)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof ae=="string"?ae:JSON.stringify(ae,null,2)})]},G))}),K.length>0&&K.map((G,ae)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:G})},ae)),O&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:O})})]})}case"web_search":{const E=((g=n.data)==null?void 0:g.query)||"";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(y0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),c.jsx("p",{className:"user-message",children:E})]})}case"todo_list":{const E=((x=n.data)==null?void 0:x.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(l0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:E.map((T,M)=>c.jsxs("li",{className:T.completed?"todo-done":"todo-pending",children:[T.completed?c.jsx(er,{size:14}):c.jsx(ci,{size:14})," ",T.text]},M))})]})}case"ask_user":return c.jsx(tm,{item:n,turn:r});case"final_result":{const E=n.data??{},T=E.text||"",M=E.html||null,I=Array.isArray(E.groups)?E.groups.filter(W=>!!W&&Array.isArray(W.selections)&&W.selections.length>0):[],{iconClass:B,iconText:O}=wu(s??"codex");return c.jsxs(c.Fragment,{children:[(T||M)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${B}`,children:O}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),T&&c.jsx(Jh,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:T,threads:o,runtimeType:s}),M&&c.jsx(Jk,{html:M})]}),I.length>0&&c.jsx(tm,{item:n,turn:r})]})}case"background_task":{const E=n.data||{},T=E.task_type||"unknown",M=E.subagent_type||null,I=E.description||"",B=E.status||"running",O=E.last_tool_name||null,W=E.token_count||null,q=T==="local_agent",K=T==="local_bash",G=q?ku:K?Um:zm,ae=q?`Subagent${M?`: ${M}`:""}`:K?"Monitor":"Background Task",de=B==="running"?"running…":B==="completed"?"done":B==="failed"?"failed":B==="stopped"?"stopped":B,oe=n.status==="failed"||B==="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:ae}),c.jsx("span",{className:"turn-header-meta",style:oe?{color:"var(--red)"}:void 0,children:de})]}),I&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:I}),O&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",O,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 E=((k=n.data)==null?void 0:k.trigger)??"auto",T=((y=n.data)==null?void 0:y.pre_tokens)??0,M=((N=n.data)==null?void 0:N.post_tokens)??0,I=T>0?Math.round((1-M/T)*100):0,B=E==="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(f0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:B})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[T.toLocaleString()," → ",M.toLocaleString()," tokens (",I,"% reduction)"]})]})}case"error":{const E=((_=n.data)==null?void 0:_.message)||"Unknown error";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:c.jsx(Qu,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Error"})]}),c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:E})})]})}default:return null}}const _s=w.memo(eS,(n,s)=>n.item===s.item&&n.runtimeType===s.runtimeType&&n.threads===s.threads&&n.turn.id===s.turn.id);function tS({turn:n,runtimeType:s,threads:r=[]}){en.trackRender("TurnContent");const[o,a]=w.useState(!1);w.useEffect(()=>{const T=n.items.some(M=>M.type==="background_task"&&M.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!T&&a(!1)},[n.status,n.items]);let u=-1;for(let T=n.items.length-1;T>=0;T--)if(n.items[T].type==="agent_message"){u=T;break}const f=u>=0,h=f?n.items.slice(0,u):n.items,m=n.items.some(T=>T.type==="final_result"||T.type==="ask_user"),g=!f&&n.status==="completed"&&n.agent_response&&!m?{id:`response-${n.id}`,turn_id:n.id,external_item_id:`response-${n.id}`,type:"agent_message",data:{text:n.agent_response},status:"completed",created_at:n.created_at,updated_at:n.updated_at}:null,k=h.filter(T=>{var M;return!(T.type==="reasoning"&&(!((M=T.data)!=null&&M.text)||T.data.text===""))}).filter(T=>!(T.type==="background_task"||T.type==="ask_user"||T.type==="final_result")),y=[];let N=null;for(const T of k)T.type==="agent_message"?(N&&y.push(N),N={agentMessage:T,toolItems:[],otherItems:[]}):(N||(N={agentMessage:null,toolItems:[],otherItems:[]}),Qh(T)?N.toolItems.push(T):N.otherItems.push(T));N&&y.push(N);const _=k.filter(T=>Qh(T)).length,E=_>0||k.length>0&&(n.status==="running"||n.status==="pending");return c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:n.user_prompt}),Array.isArray(n.attachments)&&n.attachments.length>0&&c.jsx(Xk,{attachments:n.attachments})]}),E&&c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>a(T=>!T),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(i0,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:_>0?`${_} tool call${_>1?"s":""}`:"thinking…"}),c.jsx(Yu,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:y.map((T,M)=>c.jsxs("div",{className:"intermediate-segment",children:[T.agentMessage&&c.jsx(_s,{item:T.agentMessage,runtimeType:s,turn:n,threads:r}),T.otherItems.map(I=>c.jsx(_s,{item:I,runtimeType:s,turn:n,threads:r},I.id)),T.toolItems.length>0&&c.jsx(zk,{items:T.toolItems,runtimeType:s,turn:n,threads:r})]},M))})]}),n.items.filter(T=>T.type==="background_task").map(T=>c.jsx(_s,{item:T,runtimeType:s,turn:n,threads:r},`task-${T.id}`)),f&&c.jsx(_s,{item:n.items[u],runtimeType:s,turn:n,threads:r},n.items[u].id),g&&c.jsx(_s,{item:g,runtimeType:s,turn:n,threads:r},g.id),f&&n.items.slice(u+1).filter(T=>T.type!=="ask_user"&&T.type!=="background_task"&&T.type!=="final_result").map(T=>c.jsx(_s,{item:T,runtimeType:s,turn:n,threads:r},T.id)),n.items.filter(T=>T.type==="final_result").map(T=>c.jsx(_s,{item:T,runtimeType:s,turn:n,threads:r},`final-${T.id}`)),n.items.filter(T=>T.type==="ask_user").map(T=>c.jsx(_s,{item:T,runtimeType:s,turn:n,threads:r},`ask-${T.id}`)),n.items.length===0&&!n.error&&(n.status==="pending"||n.status==="running")&&c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:n.status==="running"?"Agent is thinking…":"Waiting to start…"})}),n.error&&c.jsx("div",{className:"render-content",children:c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:n.error})})}),n.status==="aborted"&&c.jsxs("div",{className:"aborted-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(ci,{size:12})}),c.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const nS=w.memo(tS);function Dg(n,s="session",r=0){const o=[];if(s==="session")n.forEach((u,f)=>im(u,f,o));else{const u=n[r];u&&im(u,r,o)}const a=new Map;for(const u of o)a.set(u.path,u);return Array.from(a.values())}function im(n,s,r){var o;for(const a of n.items)if(a.type==="file_change"&&((o=a.data)!=null&&o.changes)){const u=a.data.changes;for(const f of u)r.push({path:f.path,kind:f.kind,turnIdx:s})}}const sS=[],Il=50;function rS(){en.trackRender("RenderArea");const n=L(M=>M.activeSessionId),s=L(M=>M.activeSessionId?M.sessionDetails[M.activeSessionId]:null),r=L(M=>M.activeTurnIndex),o=L(M=>M.activeRightTab),a=L(M=>M.changesScope),u=L(M=>M.submittingPrompt),f=L(M=>M.loading),h=L(M=>M.selectedChangePath),m=L(M=>M.setSelectedChangePath),g=(s==null?void 0:s.turns)??[],x=(s==null?void 0:s.threads)??sS,k=w.useRef(null),[y,N]=w.useState(Il);w.useEffect(()=>{N(Il)},[n]);const _=g.filter(M=>!M.thread_id),E=Math.max(0,_.length-y),T=_.slice(E);if(w.useEffect(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[n,g.length]),w.useEffect(()=>{if(!h||o!=="changes")return;const M=setTimeout(()=>{const I=h.replace(/[^a-zA-Z0-9]/g,"-"),B=document.getElementById(`diff-${I}`);B&&(B.scrollIntoView({behavior:"smooth",block:"start"}),B.classList.add("diff-highlight"),setTimeout(()=>B.classList.remove("diff-highlight"),1500)),m(null)},50);return()=>clearTimeout(M)},[h,o,m]),o==="changes"){if(!s)return c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})});const M=Dg(g,a,r);return M.length===0?c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"No file changes in this scope."})})}):c.jsx("div",{className:"render-scroll",ref:k,children:c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{style:{marginBottom:"20px"},children:[c.jsx("span",{style:{fontSize:"16px",fontWeight:600,color:"var(--text)"},children:a==="session"?"All Session Changes":"Current Turn Changes"}),c.jsxs("span",{style:{fontSize:"12px",color:"var(--text-muted)",marginLeft:"8px"},children:[M.length," file",M.length>1?"s":""]})]}),M.map(I=>{const B=I.path.split("/").pop()||I.path,O=I.path.replace("/"+B,""),W=I.kind==="add"?"Added":I.kind==="delete"?"Deleted":"Modified",q=I.kind==="add"?"fc-add":I.kind==="delete"?"fc-del":"fc-mod",K=I.kind==="add"?"A":I.kind==="delete"?"D":"M",G=I.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 ${q}`,children:K}),c.jsxs("span",{className:"diff-file-name",children:[O&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[O,"/"]}),B]}),c.jsx("span",{className:"diff-file-stats",children:c.jsx("span",{className:`diff-file-badge ${q}`,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)."})]},I.path)})]})})}return f&&!s?c.jsx("div",{className:"render-scroll",children:c.jsxs("div",{className:"skeleton-bars",children:[c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"})]})}):s?c.jsxs("div",{className:"render-scroll",ref:k,children:[u&&c.jsx("div",{className:"turn-block",children:c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:u})]}),c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),g.length===0&&!u&&c.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),E>0&&c.jsx("div",{className:"render-load-earlier",children:c.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>N(M=>M+Il),children:["Show ",Math.min(Il,E)," earlier turns (",E," hidden)"]})}),T.map((M,I)=>c.jsx("div",{id:`turn-${E+I}`,className:"turn-block",children:c.jsx(nS,{turn:M,runtimeType:s.runtime_type,threads:x})},M.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const iS=w.memo(rS),oS=[{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 lS(n){return n.map(s=>({id:s.name,label:`/${s.name}`,hint:s.description,capability:null,insertAsText:!0}))}function aS(n,s,r=[]){const o=[...oS,...lS(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 cS({commands:n,selectedIndex:s,onSelect:r,onHover:o}){return c.jsxs("div",{className:"slash-popup",children:[c.jsx("div",{className:"slash-popup-header",children:"Commands"}),n.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),n.map((a,u)=>c.jsxs("div",{className:`slash-popup-item ${u===s?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>r(a),children:[c.jsx("span",{className:"slash-popup-label",children:a.label}),c.jsx("span",{className:"slash-popup-hint",children:a.hint})]},a.id))]})}function hu({title:n,options:s,currentValue:r,onSelect:o,onClose:a}){return c.jsxs("div",{className:"slash-popup",children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:a,children:"← Back"}),c.jsx("span",{children:n})]}),s.map(u=>c.jsxs("div",{className:`slash-popup-item ${u.value===r?"selected":""}`,onClick:()=>o(u.value),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&c.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===r&&c.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function uS(n){return vn("/skills")}function dS({filter:n,onSelect:s,onClose:r}){const[o,a]=w.useState([]),[u,f]=w.useState(!0),[h,m]=w.useState(0),g=w.useRef(null);w.useEffect(()=>{uS().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const x=o.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())||k.description.toLowerCase().includes(n.toLowerCase()));return w.useEffect(()=>{m(0)},[n]),w.useEffect(()=>{function k(y){y.key==="ArrowDown"?(y.preventDefault(),m(N=>Math.min(N+1,x.length-1))):y.key==="ArrowUp"?(y.preventDefault(),m(N=>Math.max(N-1,0))):y.key==="Enter"?(y.preventDefault(),x[h]&&s(x[h])):y.key==="Escape"&&(y.preventDefault(),r())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[x,h,s,r]),c.jsxs("div",{className:"slash-popup",ref:g,children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:r,children:"← Back"}),c.jsx("span",{children:"Skills"})]}),u&&c.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&x.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),x.map((k,y)=>c.jsxs("div",{className:`slash-popup-item ${y===h?"selected":""}`,onMouseEnter:()=>m(y),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 fS(){return vn("/providers")}function pS(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return vn(`/providers/${n}/commands${r}`)}const hS={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function mS(n){const[s,r]=w.useState([]),[o,a]=w.useState(!0);w.useEffect(()=>{fS().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)??hS,loading:o}}const Jr=32,mu=200;function om(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function lm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let am=0;function gS(){return am+=1,`att-${Date.now()}-${am}`}function vS(){en.trackRender("CommandInputBar");const[n,s]=w.useState(""),r=w.useRef(null),o=w.useRef(Jr),a=w.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:m}=L(),g=L(V=>V.activeSessionId),x=L(V=>V.activeSessionId?V.sessionDetails[V.activeSessionId]:null),k=L(V=>V.quotedText),y=Rm(x),N=!g,{capabilities:_}=mS(x==null?void 0:x.runtime_type),E=(x==null?void 0:x.runtime_type)??null,T=_.imageAttachments,[M,I]=w.useState([]),[B,O]=w.useState(!1),[W,q]=w.useState(null),[K,G]=w.useState([]);w.useEffect(()=>{if(!E){G([]);return}let V=!1;return pS(E,(x==null?void 0:x.cwd)??void 0).then(ge=>{V||G(ge)}).catch(()=>{V||G([])}),()=>{V=!0}},[E,x==null?void 0:x.cwd]);const[ae,de]=w.useState(!1),[oe,ke]=w.useState(""),[Ne,Fe]=w.useState(0),[Q,se]=w.useState(void 0),[ce,P]=w.useState(!1),[J,H]=w.useState(""),[b,A]=w.useState([]),ee=ae?aS(oe,_,K):[];w.useEffect(()=>{k!==null&&(s(V=>V+k),setTimeout(()=>{if(r.current){mt(),r.current.focus();const V=r.current.value.length;r.current.setSelectionRange(V,V)}},0),L.setState({quotedText:null}))},[k]),w.useEffect(()=>{if(!y)return;function V(ge){ge.key==="Escape"&&(ge.preventDefault(),f())}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[y,f]),w.useEffect(()=>{de(!1),se(void 0),P(!1),A([]),I(V=>{for(const ge of V)ge.previewUrl&&URL.revokeObjectURL(ge.previewUrl);return[]})},[g]),w.useEffect(()=>{if(!W)return;function V(ge){ge.key==="Escape"&&(ge.preventDefault(),q(null))}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[W]);const ue=w.useCallback(V=>{if(!V)return;const ge=Array.from(V);for(const Be of ge){const Ke=new FileReader;Ke.onload=()=>{const vt=Ke.result.split(",")[1]??"",ct=Be.type.startsWith("image/")?URL.createObjectURL(Be):void 0;I(Xt=>[...Xt,{id:gS(),name:Be.name,media_type:Be.type||"application/octet-stream",data:vt,previewUrl:ct,size:Be.size}])},Ke.readAsDataURL(Be)}},[]),me=w.useCallback(V=>{I(ge=>{const Be=ge.find(Ke=>Ke.id===V);return Be!=null&&Be.previewUrl&&URL.revokeObjectURL(Be.previewUrl),ge.filter(Ke=>Ke.id!==V)})},[]),xe=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),!(!T||y)&&O(!0)},[T,y]),ze=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),O(!1)},[]),_e=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),O(!1),!(!T||y)&&ue(V.dataTransfer.files)},[T,y,ue]),Ee=w.useCallback(V=>{var Ke;if(!T)return;const ge=(Ke=V.clipboardData)==null?void 0:Ke.items;if(!ge)return;const Be=[];for(let ft=0;ft<ge.length;ft++){const vt=ge[ft];if(vt.type.startsWith("image/")){const ct=vt.getAsFile();ct&&Be.push(ct)}}Be.length>0&&(V.preventDefault(),ue(Be))},[T,ue]);function Te(V){const ge=r.current;ge&&(ge.style.height=`${V}px`,o.current=V)}function mt(){const V=r.current;if(V){if(V.scrollHeight>V.clientHeight){const ge=Math.min(V.scrollHeight,mu);ge!==o.current&&Te(ge);return}o.current>Jr&&(V.style.height="auto",Te(Math.min(V.scrollHeight,mu)))}}function Me(){const V=n.trim();if(!V||y)return;let ge=V;b.length>0&&(ge=`${b.map(ft=>`$${ft.name}`).join(" ")}
430
+
431
+ ${V}`);const Be=M.map(({id:Ke,previewUrl:ft,size:vt,...ct})=>ct);s(""),A([]),Te(Jr),de(!1),se(void 0),P(!1);for(const Ke of M)Ke.previewUrl&&URL.revokeObjectURL(Ke.previewUrl);I([]),u(ge,Be.length>0?Be:void 0)}function bt(V){if(V.insertAsText){const ge=`/${V.id} `;s(ge),de(!1),se(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Be=ge.length;r.current.setSelectionRange(Be,Be),mt()}});return}V.subPopup?se(V.subPopup):V.id==="skills"?(P(!0),H(""),de(!1),s("")):V.id==="model"?(m(!0),de(!1),s("")):(de(!1),s(""))}function Le(V){A(ge=>[...ge,V]),P(!1),s(""),Te(Jr)}function Pt(V){const ge=om(x==null?void 0:x.runtime_config);Q==="sandbox"?ge.sandboxMode=V:Q==="websearch"?ge.webSearchMode=V:Q==="network"&&(ge.networkAccessEnabled=V==="true"),h(ge),se(void 0),de(!1),s(""),Te(Jr)}function We(V){if(en.markKeystroke(),ae&&!Q){if(V.key==="ArrowDown"){V.preventDefault(),Fe(ge=>Math.min(ge+1,ee.length-1));return}if(V.key==="ArrowUp"){V.preventDefault(),Fe(ge=>Math.max(ge-1,0));return}if(V.key==="Enter"){V.preventDefault(),ee[Ne]&&bt(ee[Ne]);return}if(V.key==="Escape"){V.preventDefault(),de(!1),s("");return}}if(Q&&V.key==="Escape"){V.preventDefault(),se(void 0);return}if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)&&!y){V.preventDefault(),Me();return}V.key==="Escape"&&y&&(V.preventDefault(),f())}function Ut(V){en.markInputChange();const ge=V.target.value;s(ge),mt(),ge.startsWith("/")&&!ge.includes(" ")&&!y?(de(!0),ke(ge.slice(1)),Fe(0)):(de(!1),se(void 0)),ge.startsWith("$")&&!y?(P(!0),H(ge.slice(1))):ge.startsWith("$")||P(!1)}const Et=om(x==null?void 0:x.runtime_config),gt=[{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"}],_t=[{value:"disabled",label:"Disabled",description:"No web search"},{value:"cached",label:"Cached",description:"Use cached search results"},{value:"live",label:"Live",description:"Perform live web searches"}],Ot=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return c.jsxs("div",{className:`cmd-bar${B?" drag-over":""}`,onDragOver:xe,onDragLeave:ze,onDrop:_e,children:[ae&&!Q&&c.jsx(cS,{commands:ee,selectedIndex:Ne,onSelect:bt,onHover:Fe}),ae&&Q==="sandbox"&&c.jsx(hu,{title:"Sandbox Mode",options:gt,currentValue:Et.sandboxMode,onSelect:Pt,onClose:()=>se(void 0)}),ae&&Q==="websearch"&&c.jsx(hu,{title:"Web Search",options:_t,currentValue:Et.webSearchMode,onSelect:Pt,onClose:()=>se(void 0)}),ae&&Q==="network"&&c.jsx(hu,{title:"Network Access",options:Ot,currentValue:Et.networkAccessEnabled===!0?"true":"false",onSelect:Pt,onClose:()=>se(void 0)}),ce&&c.jsx(dS,{filter:J,onSelect:Le,onClose:()=>{P(!1),s("")}}),b.length>0&&c.jsx("div",{className:"skill-badges",children:b.map(V=>c.jsxs("span",{className:"skill-badge",children:["$",V.name,c.jsx("button",{className:"skill-badge-remove",onClick:()=>A(ge=>ge.filter(Be=>Be.id!==V.id)),children:"×"})]},V.id))}),M.length>0&&c.jsx("div",{className:"attachment-preview-area",children:M.map(V=>c.jsxs("div",{className:"attachment-chip",title:V.name,children:[V.previewUrl?c.jsx("img",{src:V.previewUrl,alt:V.name,className:"attachment-thumb",onClick:()=>q(V),style:{cursor:"pointer"}}):c.jsx($m,{size:20,className:"attachment-file-icon"}),c.jsxs("div",{className:"attachment-info",children:[c.jsx("span",{className:"attachment-name",children:V.name}),c.jsx("span",{className:"attachment-size",children:lm(V.size)})]}),c.jsx("button",{className:"attachment-remove",onClick:()=>me(V.id),title:"Remove attachment",children:c.jsx(Kn,{size:14})})]},V.id))}),T&&!y&&!N&&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=>{ue(V.target.files),V.target.value=""}}),c.jsxs("div",{className:"cmd-input-row",children:[T&&!y&&!N&&c.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var V;return(V=a.current)==null?void 0:V.click()},title:"Attach files",disabled:y,children:c.jsx(h0,{size:16})}),c.jsx("textarea",{ref:r,className:"cmd-textarea",placeholder:N?"Select or create a session…":y?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:n,disabled:y||N,rows:1,style:{minHeight:Jr,maxHeight:mu},onChange:Ut,onKeyDown:We,onPaste:Ee}),y?c.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:c.jsx(ci,{size:15})}):c.jsx("button",{className:"cmd-send-btn",onClick:Me,disabled:!n.trim()||N,title:"Send (⌘↵)",children:c.jsx(qx,{size:16})})]}),W&&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:W.previewUrl,alt:W.name}),c.jsxs("div",{className:"image-preview-info",children:[c.jsx("span",{children:W.name}),c.jsx("span",{children:lm(W.size)})]}),c.jsx("button",{className:"image-preview-close",onClick:()=>q(null),children:c.jsx(Kn,{size:20})})]})})]})}function yS(){const n=L(T=>T.activeSessionId),s=L(T=>T.activeSessionId?T.sessionDetails[T.activeSessionId]:null),r=L(T=>T.activeTurnIndex),o=L(T=>T.setActiveTurnIndex),a=L(T=>T.rewindToTurn),u=L(T=>T.restoreSession),f=L(T=>T.branchFromTurn),h=(s==null?void 0:s.turns)??[],m=oa(s),g=!!(s!=null&&s.rewound_at_turn_id),x=(s==null?void 0:s.runtime_type)==="repoburg",k=x?"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.",[y,N]=w.useState(null),_=w.useRef(null);if(aa(_,()=>N(null),!!y),qu(()=>N(null),!!y),h.length===0)return c.jsx("div",{className:"empty-state",children:"No turns yet"});function E(T){o(T),requestAnimationFrame(()=>{var M;(M=document.getElementById(`turn-${T}`))==null||M.scrollIntoView({behavior:"smooth",block:"start"})})}return c.jsxs("div",{className:"right-section",children:[c.jsx("div",{className:"right-section-title",children:"Conversation"}),h.map((T,M)=>{const I=M===r,B=T.user_prompt.length>50?T.user_prompt.slice(0,50)+"…":T.user_prompt,O=T.status==="running"||T.status==="pending";return c.jsx("div",{children:c.jsxs("div",{className:`turn-item ${I?"active":""}`,onClick:()=>E(M),onContextMenu:W=>{W.preventDefault(),N({x:W.clientX,y:W.clientY,turnId:T.id,turnIndex:M,isLast:M===h.length-1,isSlashCommand:T.user_prompt.trimStart().startsWith("/")})},children:[c.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:c.jsx(T0,{size:12})}),c.jsx("span",{className:"turn-item-label",children:B}),O&&c.jsx("span",{className:"turn-item-status",children:"running…"})]})},T.id)}),y&&c.jsxs("div",{ref:_,className:"ctx-menu",style:{position:"fixed",left:y.x,top:y.y,zIndex:500},children:[c.jsxs("div",{className:`ctx-menu-item ${y.isLast||m||y.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{y.isLast||m||y.isSlashCommand||(window.confirm(k)&&a(n,y.turnId),N(null))},children:[c.jsx(v0,{size:12})," Rewind to Here",y.isSlashCommand?" (slash command)":""]}),g&&!x&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(n),N(null)},children:[c.jsx(lo,{size:12})," Restore Rewind"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(n,y.turnId),N(null)},children:[c.jsx(s0,{size:12})," Branch from Here"]})]})]})}function xS(){const n=L(h=>h.activeSessionId?h.sessionDetails[h.activeSessionId]:null),s=L(h=>h.changesScope),r=L(h=>h.setChangesScope),o=L(h=>h.activeTurnIndex),a=L(h=>h.setSelectedChangePath),u=(n==null?void 0:n.turns)??[],f=Dg(u,s,o);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"changes-scope-toggle",children:[c.jsx("button",{className:`scope-btn ${s==="session"?"active":""}`,onClick:()=>r("session"),children:"Session"}),c.jsx("button",{className:`scope-btn ${s==="turngroup"?"active":""}`,onClick:()=>r("turngroup"),children:"Current Turn"})]}),f.length===0?c.jsx("div",{className:"empty-state",children:"No file changes in this scope"}):c.jsxs("div",{className:"right-section",children:[c.jsxs("div",{className:"right-section-title",children:["Changed Files (",f.length,")"]}),f.map(h=>{const m=h.kind==="add"?"fc-add":h.kind==="delete"?"fc-del":"fc-mod",g=h.kind==="add"?"A":h.kind==="delete"?"D":"M",x=h.path.split("/").pop()||h.path,k=h.path.replace("/"+x,"");return c.jsxs("div",{className:"file-change clickable",onClick:()=>a(h.path),children:[c.jsx("span",{className:`fc-status ${m}`,children:g}),c.jsxs("span",{className:"fc-name",children:[k&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[k,"/"]}),x]})]},h.path)})]})]})}const cm=2e4;function wS(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 kS({entry:n}){const{item:s,turnIndex:r,turnPrompt:o}=n,a=s.data||{},u=a.task_type||"unknown",f=a.subagent_type||null,h=a.description||"",m=a.status||"running",g=a.summary||null,x=a.last_tool_name||null,k=a.token_count||null,y=a.output||"",N=s.status==="in_progress",_=u==="local_agent",E=u==="local_bash",T=_?ku:E?Um:zm,M=_?`Subagent${f?`: ${f}`:""}`:E?"Monitor":"Background Task",I=m==="running"?"running…":m==="completed"?"done":m==="failed"?"failed":m==="stopped"?"stopped":m,B=s.status==="failed"||m==="failed",[O,W]=w.useState(N),[q,K]=w.useState(!1),G=w.useRef(null);w.useEffect(()=>{N&&W(!0)},[N]),w.useEffect(()=>{O&&N&&G.current&&(G.current.scrollTop=G.current.scrollHeight)},[O,N,y]);const ae=y.length>cm,de=ae&&!q?y.slice(0,cm)+`
432
+ … (truncated, click to expand)`:y,oe=N?null:m==="completed"?c.jsx(er,{size:12}):B?c.jsx(Qu,{size:12}):c.jsx(ci,{size:12});return c.jsxs("div",{className:`task-card ${N?"task-running":""} ${B?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>W(ke=>!ke),style:{cursor:"pointer"},children:[c.jsx("span",{className:"task-card-icon",children:c.jsx(T,{size:14})}),c.jsx("span",{className:"task-card-type",children:M}),c.jsxs("span",{className:`task-card-status ${B?"task-status-failed":N?"task-status-running":"task-status-done"}`,children:[oe," ",I]}),c.jsx(Yu,{size:14,className:"task-card-chevron",style:{transform:O?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&c.jsx("div",{className:"task-card-desc",children:h}),N&&x&&c.jsxs("div",{className:"task-card-meta",children:["last tool: ",x,k!=null&&` · ${k.toLocaleString()} tokens`]}),O&&c.jsxs("div",{className:"task-card-body",children:[y?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:G,children:c.jsx("code",{children:de})}),ae&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>K(ke=>!ke),children:q?"Show less":`Show full output (${(y.length/1024).toFixed(0)}KB)`})]}):g?c.jsx("pre",{className:"cmd-output task-output",children:c.jsx("code",{children:g})}):N?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 SS=w.memo(kS);function TS(){var h,m;const n=L(g=>g.activeSessionId?g.sessionDetails[g.activeSessionId]:null),s=(n==null?void 0:n.turns)??[],r=(n==null?void 0:n.backgroundTasks)??[],o=wS(s),a=[...o].sort((g,x)=>{const k=g.item.status==="in_progress",y=x.item.status==="in_progress";return k&&!y?-1:!k&&y?1:x.turnIndex-g.turnIndex}),u=new Map;for(const g of r)g.task_type==="local_bash"&&u.set(g.task_id,g.task_type);for(const g of o)if(g.item.status==="in_progress"){const x=((h=g.item.data)==null?void 0:h.task_id)??g.item.external_item_id,k=((m=g.item.data)==null?void 0:m.task_type)??"unknown";u.set(x,k)}const f=[...u.values()].filter(g=>g==="local_bash").length;return o.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 (",o.length,")",f>0&&c.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",f," running"]})]}),a.map(g=>c.jsx(SS,{entry:g},g.item.id))]})}const bS=w.memo(TS);function NS({thread:n,onClose:s}){const{activeSessionId:r,resolveThread:o,shareThread:a}=L(),[u,f]=w.useState(""),[h,m]=w.useState(!1),[g,x]=w.useState(!1);async function k(){if(!r||h)return;m(!0),await a(r,n.id,u)?s():m(!1)}async function y(){!r||g||(x(!0),await o(r,n.id),s())}const N=h||g;return c.jsx("div",{className:"dialog-overlay",onClick:N?void 0:s,children:c.jsxs("div",{className:"dialog",onClick:_=>_.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:N,children:c.jsx(Kn,{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:_=>f(_.target.value),rows:3,disabled:N,autoFocus:!0})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:s,disabled:N,children:"Cancel"}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:y,disabled:N,title:"Resolve without sharing",children:[g?c.jsx(ns,{size:13,className:"spin"}):c.jsx(Vl,{size:13}),"Resolve only"]}),c.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:N,children:[h?c.jsx(ns,{size:13,className:"spin"}):c.jsx(x0,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const um=[];qe.setOptions({breaks:!0,gfm:!0});function CS(n){const s=qe.parse(n);return md.sanitize(s)}function ES(n){var s,r,o;if(n.type==="agent_message"||n.type==="final_result"){const a=(s=n.data)==null?void 0:s.text;return typeof a=="string"&&a?a:null}if(n.type==="ask_user"){const a=Array.isArray((r=n.data)==null?void 0:r.groups)?n.data.groups:[],u=[(o=n.data)==null?void 0:o.question,...a.map(f=>f.question)].filter(f=>typeof f=="string"&&!!f);return u.length?u.join(`
433
+
434
+ `):null}return null}function _S(n){const s=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return s?s[1]:n}function jS({turn:n}){const s=_S(n.user_prompt),r=n.items.map(ES).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:CS(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 RS({thread:n,threadTurns:s,onStop:r,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:h}){var Ne,Fe,Q;const[m,g]=w.useState(""),[x,k]=w.useState(!0),y=w.useRef(null),N=w.useRef(null),[_,E]=w.useState(!1),[T,M]=w.useState({x:0,y:0}),[I,B]=w.useState(""),O=s.some(ai),W=28,q=120,K=w.useRef(W);w.useEffect(()=>{const se=N.current;se&&(se.scrollTop=se.scrollHeight)},[s.length,x]);function G(se){const ce=y.current;ce&&(ce.style.height=`${se}px`,K.current=se)}function ae(){const se=y.current;if(se){if(se.scrollHeight>se.clientHeight){const ce=Math.min(se.scrollHeight,q);ce!==K.current&&G(ce);return}K.current>W&&(se.style.height="auto",G(Math.min(se.scrollHeight,q)))}}const de=w.useCallback(()=>{E(!1)},[]),oe=w.useCallback(()=>{const se=N.current;if(!se)return;const ce=window.getSelection();if(!ce||ce.rangeCount===0||ce.isCollapsed){E(!1);return}const P=ce.getRangeAt(0);if(!se.contains(P.commonAncestorContainer)){E(!1);return}const J=P.commonAncestorContainer.nodeType===Node.TEXT_NODE?P.commonAncestorContainer.parentElement:P.commonAncestorContainer;if(!(J!=null&&J.closest(".thread-card-ai-response"))){E(!1);return}const H=ce.toString();if(!H.trim()){E(!1);return}const b=P.getBoundingClientRect(),A=28,ee=6,ue=170;let me=!1;if(ce.anchorNode&&ce.focusNode)try{const _e=document.createRange();_e.setStart(ce.focusNode,ce.focusOffset),_e.setEnd(ce.focusNode,ce.focusOffset);const Ee=document.createRange();Ee.setStart(ce.anchorNode,ce.anchorOffset),Ee.setEnd(ce.anchorNode,ce.anchorOffset),me=Ee.compareBoundaryPoints(Range.START_TO_START,_e)>0}catch{me=!1}let xe=b.top-A-ee;xe<8&&(xe=b.bottom+ee);let ze=me?b.left-ue:b.right;ze=Math.max(8,Math.min(ze,window.innerWidth-ue-8)),M({x:ze,y:xe}),B(H),E(!0)},[]);w.useEffect(()=>{function se(ce){const P=ce.target;P&&P.closest(".selection-actions")||oe()}return document.addEventListener("mouseup",se),()=>document.removeEventListener("mouseup",se)},[oe]);const ke=w.useCallback(()=>{var ce;const se=`
435
+ \`\`\`QUOTE
436
+ ${I}
437
+ \`\`\`
438
+
439
+ `;g(P=>P+se),E(!1),B(""),(ce=window.getSelection())==null||ce.removeAllRanges(),setTimeout(()=>{if(y.current){ae(),y.current.focus();const P=y.current.value.length;y.current.setSelectionRange(P,P)}},0)},[I]);return c.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[c.jsxs("div",{className:"thread-card-header",onClick:()=>k(se=>!se),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((Q=(Fe=(Ne=n.turns)==null?void 0:Ne[0])==null?void 0:Fe.user_prompt)==null?void 0:Q.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:se=>{se.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(p0,{size:12})}),c.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),x&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"thread-card-conversation",ref:N,onMouseDown:de,children:[s.map(se=>c.jsx(jS,{turn:se},se.id)),s.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),_&&c.jsx("div",{className:"selection-actions",style:{left:T.x,top:T.y},children:c.jsxs("button",{className:"discuss-button",onClick:ke,title:"Quote this text in your follow-up",children:[c.jsx(Fm,{size:14}),c.jsx("span",{children:"Quote"})]})}),n.status==="open"&&c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{ref:y,className:"thread-card-followup-input",placeholder:O?"Agent is running…":"Type a follow-up…",value:m,onChange:se=>{en.markInputChange(),g(se.target.value),ae()},disabled:O,rows:1,style:{minHeight:W,maxHeight:q},onKeyDown:se=>{en.markKeystroke(),se.key==="Enter"&&(se.metaKey||se.ctrlKey)&&!O&&m.trim()&&(se.preventDefault(),f(m.trim()),g(""),G(W))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:O||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:c.jsx(ca,{size:13})}),O&&c.jsx("button",{className:"thread-card-followup-stop",onClick:r,title:"Stop this thread's turn (Esc)",children:c.jsx(ci,{size:13})})]}),c.jsxs("div",{className:"thread-card-actions",children:[n.status==="open"?c.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[c.jsx(Vl,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(lo,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(hs,{size:13})," Delete"]})]})]})]})}function AS(){en.trackRender("ThreadsPanel");const n=L(I=>I.activeSessionId),s=L(I=>{var B;return I.activeSessionId?((B=I.sessionDetails[I.activeSessionId])==null?void 0:B.threads)??um:um}),r=L(I=>I.followupThread),o=L(I=>I.cancelThreadTurn),a=L(I=>I.reopenThread),u=L(I=>I.deleteThread),f=L(I=>I.activeRightTab),h=L(I=>I.switchRightTab),m=L(I=>I.deepLinkThreadId),g=L(I=>I.setDeepLinkThreadId),[x,k]=w.useState("open"),[y,N]=w.useState(null);w.useEffect(()=>{if(!m)return;const I=m;g(null),k(O=>s.some(W=>W.id===I&&W.status==="open")?O:"all");const B=setTimeout(()=>{const O=document.getElementById(`thread-${I}`);O&&(O.scrollIntoView({behavior:"smooth",block:"center"}),O.classList.add("thread-card-highlighted"),setTimeout(()=>O.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(B)},[m,g,s]);const _=s.filter(I=>x==="open"?I.status==="open":x==="resolved"?I.status==="resolved":!0),E=s.filter(I=>I.status==="open").length,T=s.filter(I=>I.status==="resolved").length;function M(I){f==="changes"&&h("turns"),setTimeout(()=>{const B=document.querySelector(`mark[data-thread-id="${I}"]`);B&&(B.scrollIntoView({behavior:"smooth",block:"center"}),B.classList.add("thread-mark-flash"),setTimeout(()=>B.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?s.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(d0,{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 ${x==="open"?"active":""}`,onClick:()=>k("open"),children:["Open (",E,")"]}),c.jsxs("button",{className:`thread-filter-tab ${x==="resolved"?"active":""}`,onClick:()=>k("resolved"),children:["Resolved (",T,")"]}),c.jsxs("button",{className:`thread-filter-tab ${x==="all"?"active":""}`,onClick:()=>k("all"),children:["All (",s.length,")"]})]}),_.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",x," threads."]}):_.map(I=>c.jsx(RS,{thread:I,threadTurns:I.turns??[],onStop:()=>o(n,I.id),onResolve:()=>N(I),onReopen:()=>a(n,I.id),onDelete:()=>u(n,I.id),onFollowup:B=>r(n,I.id,B),onLocate:()=>M(I.id)},I.id)),y&&c.jsx(NS,{thread:y,onClose:()=>N(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function IS(){const n=L(f=>f.apps),s=L(f=>f.activeAppTabId),r=L(f=>f.openAppTab),o=L(f=>f.startAppEdit),a=L(f=>f.toggleAppPin),u=L(f=>f.deleteApp);return n.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):c.jsx("div",{className:"apps-panel",children:n.map(f=>c.jsxs("div",{className:`apps-panel-row${s===f.id?" active":""}`,onClick:()=>r(f.id),title:f.description??void 0,children:[c.jsx("span",{className:"sidebar-app-icon",children:f.icon??"◧"}),c.jsxs("div",{className:"apps-panel-info",children:[c.jsx("span",{className:"apps-panel-title",children:f.title}),f.description&&c.jsx("span",{className:"apps-panel-desc",children:f.description})]}),c.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:h=>{h.stopPropagation(),o(f.id)},children:c.jsx(Pl,{size:12})}),c.jsx("button",{className:`apps-panel-action${f.pinned?" pinned":""}`,title:f.pinned?"Unpin app":"Pin app (sorts first)",onClick:h=>{h.stopPropagation(),a(f.id)},children:c.jsx(Gl,{size:12,fill:f.pinned?"currentColor":"none"})}),c.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:h=>{h.stopPropagation(),u(f.id)},children:c.jsx(hs,{size:12})})]},f.id))})}function DS(){var f,h;en.trackRender("RightPanel");const n=L(m=>m.activeRightTab),s=L(m=>m.switchRightTab),r=L(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),o=((f=r==null?void 0:r.backgroundTasks)==null?void 0:f.length)??0,a=((h=r==null?void 0:r.threads)==null?void 0:h.filter(m=>m.status==="open").length)??0,u=[{id:"turns",label:"Turns"},{id:"changes",label:"Changes"},{id:"tasks",label:"Tasks",badge:o||void 0},{id:"threads",label:"Threads",badge:a||void 0},{id:"apps",label:"Apps"}];return c.jsxs("div",{className:"ide-right",children:[c.jsx("div",{className:"right-tabs",children:u.map(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.jsxs("div",{className:"right-content",children:[n==="turns"&&c.jsx(yS,{}),n==="changes"&&c.jsx(xS,{}),n==="tasks"&&c.jsx(bS,{}),n==="threads"&&c.jsx(AS,{}),n==="apps"&&c.jsx(IS,{})]})]})}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"}},Mu=[{id:"codex",label:"Codex",available:!0,models:[{slug:"gpt-5.6-sol",displayName:"GPT-5.6-Sol",description:"Flagship — complex, open-ended work",defaultReasoning:"low",reasoningLevels:[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 MS(n){return Mu.find(s=>s.id===n)}function gd(n){const s=MS(n);return(s==null?void 0:s.models)??[]}function Mg(n,s){return gd(n).find(r=>r.slug===s)}function Lu(n,s){var r;return((r=Mg(n,s))==null?void 0:r.reasoningLevels)??[]}function Pu(n,s){var r;return(r=Mg(n,s))==null?void 0:r.defaultReasoning}function LS(){const{activeSessionId:n,sessions:s,updateModelConfig:r}=L(),o=L(Q=>Q.showModelSelector),a=L(Q=>Q.setShowModelSelector),u=s.find(Q=>Q.id===n),f=L(Q=>Q.models),h=L(Q=>Q.modelsLoading),m=L(Q=>Q.loadModels),[g,x]=w.useState(!1),k=w.useRef(null);if(aa(k,()=>x(!1),g),qu(()=>x(!1),g),w.useEffect(()=>{o&&(x(!0),a(!1))},[o,a]),w.useEffect(()=>{u!=null&&u.runtime_type&&m(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,m]),!u)return null;const y=u.runtime_type,N=u.model??"",_=u.model_reasoning_effort??"",E=f.length>0?f:[],T=gd(y),I=[...E.length>0?E:T];if(N&&!I.some(Q=>Q.slug===N)){const Q=T[0];I.unshift({slug:N,displayName:N,description:"Custom model",defaultReasoning:(Q==null?void 0:Q.defaultReasoning)??"medium",reasoningLevels:(Q==null?void 0:Q.reasoningLevels)??[]})}function B(Q){return I.find(se=>se.slug===Q)}function O(Q){var se;return E.length>0?((se=B(Q))==null?void 0:se.reasoningLevels)??[]:Lu(y,Q)}function W(Q){var se;return E.length>0?(se=B(Q))==null?void 0:se.defaultReasoning:Pu(y,Q)}const q=Mu.find(Q=>Q.id===y),K=B(N),G=N?O(N):[],ae=(q==null?void 0:q.label)??y,de=(K==null?void 0:K.displayName)??(N||"Default"),oe=G.find(Q=>Q.effort===_),ke=(oe==null?void 0:oe.label)??(_||"Default");function Ne(Q){var J;const se=O(Q),P=se.some(H=>H.effort===_)?_:W(Q)??((J=se[0])==null?void 0:J.effort)??"";r(Q,P),x(!1)}function Fe(Q){r(N,Q),x(!1)}return c.jsxs("div",{className:"model-selector",ref:k,children:[c.jsxs("button",{className:"model-selector-btn",onClick:()=>x(!g),title:"Change model and thinking level",children:[c.jsx("span",{className:"model-selector-provider",children:ae}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:de}),ke!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:ke})]}),c.jsx(ii,{size:12,className:"model-selector-chevron"})]}),g&&c.jsxs("div",{className:"model-selector-popover",children:[c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Mu.map(Q=>c.jsxs("div",{className:`model-selector-item ${Q.id===y?"selected":""} ${Q.available?"":"disabled"}`,onClick:()=>{if(Q.available){if(Q.id===y){x(!1);return}r("","",Q.id)}},children:[c.jsx("span",{children:Q.label}),!Q.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(c0,{size:10})," Soon"]}),Q.id===y&&c.jsx(er,{size:12})]},Q.id))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Model"}),h&&c.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!h&&I.length===0&&c.jsx("div",{className:"model-selector-empty",children:"No models available"}),I.map(Q=>c.jsxs("div",{className:`model-selector-item ${Q.slug===N?"selected":""}`,onClick:()=>Ne(Q.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:Q.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:Q.description})]}),Q.slug===N&&c.jsx(er,{size:12})]},Q.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(Q=>c.jsxs("div",{className:`model-selector-item ${Q.effort===_?"selected":""}`,onClick:()=>Fe(Q.effort),children:[c.jsx("span",{children:Q.label}),Q.effort===_&&c.jsx(er,{size:12})]},Q.effort))]})]})]})}function Dl(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function dm(){const n=L(s=>s.setShowRemoteModal);return c.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[c.jsx(N0,{size:14})," Repoburg"]})}function fm(){const n=L(r=>r.vscodeViewOpen),s=L(r=>r.toggleVscodeView);return c.jsxs("button",{className:`sb-item sb-btn${n?" sb-item-active":""}`,title:n?"Back to the agent view":"Open VS Code",onClick:s,children:[c.jsx(Zx,{size:14})," Code"]})}function PS(){var k,y;en.trackRender("StatusBar");const n=L(N=>N.activeSessionId),s=L(N=>n?N.sessions.find(_=>_.id===n)??null:null),r=L(N=>n?N.sessionDetails[n]??null:null),o=L(N=>N.wsConnected),a=L(N=>N.switchRightTab),u=(r==null?void 0:r.contextUsage)??null;if(!s)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(dm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(fm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",title:o?"WebSocket connected":"WebSocket disconnected",children:o?"Live":"Offline"}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(uh,{size:14})," K"]})]});const f=la(s),h=(r==null?void 0:r.backgroundTasks)??[],m=new Set,g=new Map;for(const N of h)m.add(N.task_id),g.set(N.task_id,N.task_type);for(const N of(r==null?void 0:r.turns)??[])for(const _ of N.items)if(_.type==="background_task"&&_.status==="in_progress"){const E=((k=_.data)==null?void 0:k.task_id)??_.external_item_id,T=((y=_.data)==null?void 0:y.task_type)??"unknown";m.add(E),g.set(E,T)}const x=[...g.values()].filter(N=>N==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(dm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(fm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(LS,{}),x>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:`${x} Monitor task${x>1?"s":""} running — click to view`,onClick:()=>a("tasks"),children:[c.jsx(Bm,{size:14})," ",x]})]}),c.jsx("div",{className:"sb-spacer"}),c.jsx("div",{className:"sb-item",title:o?"WebSocket connected":"WebSocket disconnected",children:o?"Live":"Offline"}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",style:s.status==="failed"?{color:"var(--red)"}:void 0,children:f.label}),u&&c.jsx(OS,{usage:u}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(uh,{size:14})," K"]})]})}function OS({usage:n}){const s=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",r=`${Dl(n.totalTokens)} / ${Dl(n.contextWindow)} tokens`;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),"% / ",Dl(n.totalTokens)," / ",Dl(n.contextWindow)]})})]})}function pm(n){return vn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function zS(n){return Ct("/vscode-web/start",{folder:n})}function $S(n){return Ct("/vscode-web/heartbeat",{id:n})}const FS=1e3,US=5*6e4;function BS(){const n=L(_=>_.vscodeState),s=L(_=>_.vscodeId),r=L(_=>_.vscodeToken),o=L(_=>_.setVscodeView),a=L(_=>{var T;const E=_.activeSessionId?_.sessions.find(M=>M.id===_.activeSessionId):null;return E!=null&&E.cwd?E.cwd:((T=_.workspaces.find(M=>M.deleted===0))==null?void 0:T.path)??null}),[u,f]=w.useState(!1),[h,m]=w.useState(0),g=w.useRef(null),x=ms(),k=x===""||x===window.location.origin,y=`${x}/vscode/${s??""}/?tkn=${r??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;w.useEffect(()=>{let _=!1;function E(){g.current&&(clearInterval(g.current),g.current=null)}async function T(){try{let I=await pm(a);if((I.state==="stopped"||I.state==="error")&&(I=await zS(a)),_||(o(I.state,I.id,I.token),I.state==="running"||I.state==="error"))return;g.current=setInterval(async()=>{const B=await pm(a);_||(o(B.state,B.id,B.token),(B.state==="running"||B.state==="error"||B.state==="stopped")&&E())},FS)}catch{_||o("error",null,null)}}T();const M=setInterval(()=>{const I=L.getState().vscodeId;I&&$S(I).catch(()=>{})},US);return()=>{_=!0,E(),clearInterval(M)}},[h,a,o]);function N(){f(!1),o("starting",null,null),m(_=>_+1)}return n!=="running"||!r||!s?c.jsx("div",{className:"vscode-view vscode-view--loading",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:N,children:[c.jsx(lo,{size:14})," Retry"]})]}):c.jsxs("span",{className:"vscode-view-hint",children:[c.jsx(ns,{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(ns,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:y,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},s)]}):c.jsxs("div",{className:"vscode-view vscode-view--loading",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(y,"_blank","noopener"),children:[c.jsx(e0,{size:14})," Open VS Code in a new tab"]})]})}const WS=`(function () {
440
+ var nextId = 1;
441
+ var pending = new Map();
442
+ var listeners = [];
443
+ window.addEventListener('message', function (e) {
444
+ var msg = e.data;
445
+ if (!msg || msg.source !== 'agentpane-host') return;
446
+ if (msg.id != null && pending.has(msg.id)) {
447
+ var p = pending.get(msg.id);
448
+ pending.delete(msg.id);
449
+ if (msg.ok) p.resolve(msg.result); else p.reject(new Error(msg.error || 'bridge error'));
450
+ } else if (msg.event) {
451
+ for (var i = 0; i < listeners.length; i++) {
452
+ try { listeners[i](msg.event, msg.payload); } catch (err) { /* app error */ }
453
+ }
454
+ }
455
+ });
456
+ function call(method, params) {
457
+ return new Promise(function (resolve, reject) {
458
+ var id = nextId++;
459
+ pending.set(id, { resolve: resolve, reject: reject });
460
+ parent.postMessage({ source: 'agentpane-app', id: id, method: method, params: params || null }, '*');
461
+ });
462
+ }
463
+ window.AgentPane = {
464
+ getApp: function () { return call('getApp'); },
465
+ getState: function () { return call('getState'); },
466
+ setState: function (data) { return call('setState', { data: data }); },
467
+ createSession: function (opts) { return call('createSession', opts); },
468
+ submitTurn: function (sessionId, prompt) { return call('submitTurn', { sessionId: sessionId, prompt: prompt }); },
469
+ onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
470
+ onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
471
+ onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
472
+ onStateChanged: function (cb) { listeners.push(function (event, payload) { if (event === 'state_changed') cb(payload || {}); }); },
473
+ resolveToolCall: function (callId, result) { return call('resolveToolCall', { callId: callId, result: result }); }
474
+ };
475
+ // Runtime error reporting — surface compile checks' blind side to the pane.
476
+ window.addEventListener('error', function (e) {
477
+ parent.postMessage({
478
+ source: 'agentpane-app', report: 'error',
479
+ message: e.message || 'Unknown error',
480
+ stack: (e.error && e.error.stack) || '',
481
+ line: e.lineno || 0, col: e.colno || 0
482
+ }, '*');
483
+ });
484
+ window.addEventListener('unhandledrejection', function (e) {
485
+ var r = e.reason;
486
+ var msg = r && (r.message || String(r)) || 'unknown';
487
+ parent.postMessage({
488
+ source: 'agentpane-app', report: 'error',
489
+ message: 'Unhandled promise rejection: ' + msg,
490
+ stack: (r && r.stack) || '', line: 0, col: 0
491
+ }, '*');
492
+ });
493
+ })();`;function hm(n){return n.replace(/<\/script/gi,"<\\/script")}function HS(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 mm(n,s,r){const o=HS(n,s);return o===-1?n+r:n.slice(0,o)+r+n.slice(o)}function VS(n,s,r){let o=n;const a=`<script>${hm(s)}<\/script>`;if(/<\/head>/i.test(o)?o=mm(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,r){const u=`<script>${hm(r)}<\/script>`;o=mm(o,"</body>",u)}return o}function GS({appId:n,workspace:s=""}){const r=w.useRef(null),o=w.useRef({pinned:!1,data:null}),[a,u]=w.useState(null),[f,h]=w.useState(null),[m,g]=w.useState([]);w.useEffect(()=>{let y=!0;tx(n,_=>{var E,T;return(T=(E=r.current)==null?void 0:E.contentWindow)==null?void 0:T.postMessage(_,"*")});const N=async _=>{var B,O,W,q,K,G,ae,de;if(_.source!==((B=r.current)==null?void 0:B.contentWindow))return;const E=_.data;if(!E||E.source!=="agentpane-app")return;if(E.report==="error"){const oe={message:String(E.message??"Unknown error"),stack:String(E.stack??"")};g(ke=>{const Ne=ke[ke.length-1];return Ne&&Ne.message===oe.message?ke:[...ke,oe].slice(-20)});return}if(typeof E.method!="string")return;let T=!0,M,I;try{switch(E.method){case"getApp":M={id:n};break;case"getState":M=o.current;break;case"setState":{const oe=((O=E.params)==null?void 0:O.data)??null,ke=await Am(n,{data:oe},s);o.current=ke,M=ke;break}case"createSession":{const oe=E.params??{},ke=await $u({title:typeof oe.title=="string"?oe.title:void 0,runtime_type:typeof oe.runtime_type=="string"?oe.runtime_type:void 0,model:typeof oe.model=="string"?oe.model:void 0,cwd:typeof oe.cwd=="string"?oe.cwd:void 0,origin_app_id:n});Zc(ke.id,n),L.getState().addSession(ke),M=ke;break}case"submitTurn":{const oe=String(((W=E.params)==null?void 0:W.sessionId)??""),ke=String(((q=E.params)==null?void 0:q.prompt)??""),Ne=await Em(oe,ke);Zc(oe,n),M=Ne;break}case"resolveToolCall":{const oe=String(((K=E.params)==null?void 0:K.callId)??""),ke=(G=E.params)==null?void 0:G.result;await Ex(oe,ke),M={ok:!0};break}default:throw new Error(`Unknown bridge method: ${E.method}`)}}catch(oe){T=!1,I=oe instanceof Error?oe.message:String(oe)}(de=(ae=r.current)==null?void 0:ae.contentWindow)==null||de.postMessage({source:"agentpane-host",id:E.id,ok:T,result:M,error:I},"*")};return window.addEventListener("message",N),lx(n,()=>{oh(n,s).then(_=>{y&&(o.current=_)}).catch(()=>{})}),ix(n,()=>{ih(n).then(_=>{y&&(u(_),g([]))}).catch(()=>{})}),(async()=>{try{const[_,E,T]=await Promise.all([ih(n),oh(n,s),Sx(n).catch(()=>[])]);if(!y)return;o.current=E,T.forEach(M=>Zc(M.id,n)),u(_)}catch(_){y&&h(_ instanceof Error?_.message:String(_))}})(),()=>{y=!1,nx(n),ox(n),ax(n),window.removeEventListener("message",N)}},[n,s]);const x=w.useMemo(()=>a?VS(a.html,WS,a.js):"",[a]);if(f)return c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!x)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((y,N)=>c.jsxs("div",{className:"miniapp-diag",children:[y.file,":",y.line,":",y.column," — ",y.message]},N))]}),c.jsx("iframe",{ref:r,className:"miniapp-frame",sandbox:"allow-scripts",title:`Mini app: ${n}`,srcDoc:x}),m.length>0&&c.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:m.map((y,N)=>c.jsxs("div",{className:"miniapp-rt-error",children:[c.jsx("div",{className:"miniapp-rt-error-message",children:y.message}),y.stack&&c.jsx("pre",{className:"miniapp-rt-error-stack",children:y.stack})]},N))})]})}function qS({appId:n,active:s}){const r=L(y=>y.apps),o=L(y=>y.workspaces),a=L(y=>y.appWorkspaces),u=L(y=>y.setAppWorkspace),f=L(y=>y.setActiveAppTab),h=L(y=>y.startAppEdit),m=r.find(y=>y.id===n),g=a[n]??"",x=o.filter(y=>y.deleted!==1),k=g!==""&&!x.some(y=>y.path===g)?g:null;return c.jsxs("div",{className:`miniapp-view ${s?"":"miniapp-view-hidden"}`,children:[c.jsxs("div",{className:"miniapp-header",children:[c.jsx("span",{className:"miniapp-header-icon",children:(m==null?void 0:m.icon)??"◧"}),c.jsx("span",{className:"miniapp-header-title",children:(m==null?void 0:m.title)??n}),c.jsxs("select",{className:"miniapp-workspace-select",title:"Workspace this app instance is bound to (state and pinning are scoped per workspace)",value:g,onChange:y=>u(n,y.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),x.map(y=>c.jsx("option",{value:y.path,children:y.label||y.path.split("/").pop()||y.path},y.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(m0,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>f(null),children:c.jsx(Kn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(GS,{appId:n,workspace:g},`${n}:${g}`)})]})}function KS({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const[u,f]=w.useState(!1),h=w.useRef(0),m=w.useRef(0),g=w.useCallback(y=>{const N=y.clientX-h.current,_=n==="left"?m.current+N:m.current-N,E=Math.min(r,Math.max(s,_));a(E)},[n,s,r,a]),x=w.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",x),document.body.classList.remove("is-resizing"),f(!1)},[g]);return{onPointerDown:w.useCallback(y=>{var N,_;y.preventDefault(),y.stopPropagation();try{(_=(N=y.currentTarget)==null?void 0:N.setPointerCapture)==null||_.call(N,y.pointerId)}catch{}h.current=y.clientX,m.current=o(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",g),window.addEventListener("pointerup",x)},[o,g,x]),dragging:u}}function gm({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=KS({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 XS(){en.trackRender("IdeWorkspace");const n=L(m=>m.sidebarWidth),s=L(m=>m.rightPanelWidth),r=L(m=>m.setSidebarWidth),o=L(m=>m.setRightPanelWidth),a=L(m=>m.vscodeViewOpen),u=L(m=>m.activeAppTabId),f=L(m=>m.openAppTabs);w.useEffect(()=>{const m=()=>{const g=Fl(),{rightPanelWidth:x,setRightPanelWidth:k}=L.getState();x>g&&k(g)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const h=`${n}px 6px 1fr 6px ${s}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${a?"ide-hidden":""}`,style:{gridTemplateColumns:h},children:[c.jsx(k1,{}),c.jsx(gm,{side:"left",minWidth:vu,maxWidth:yu,getWidth:()=>L.getState().sidebarWidth,setWidth:r}),c.jsxs("div",{className:"ide-center",children:[c.jsx(S1,{}),c.jsxs("div",{className:"ide-render",children:[f.map(m=>c.jsx(qS,{appId:m,active:u===m},m)),u==null&&c.jsx(iS,{})]}),c.jsx(vS,{})]}),c.jsx(gm,{side:"right",minWidth:$l,maxWidth:Fl(),getWidth:()=>L.getState().rightPanelWidth,setWidth:o}),c.jsx(DS,{})]}),a&&c.jsx(BS,{}),c.jsx(PS,{})]})}function YS(){const{showNewSessionDialog:n,setShowNewSessionDialog:s,createSession:r,lastModelConfig:o}=L(),a=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",f=(o==null?void 0:o.reasoning)??"",[h,m]=w.useState(""),[g,x]=w.useState(u),[k,y]=w.useState(f),[N,_]=w.useState("");if(!n)return null;const E=gd(a),T=g?Lu(a,g):[];function M(){r({title:h.trim()||void 0,model:g||void 0,model_reasoning_effort:k||void 0,cwd:N.trim()||void 0,runtime_type:a}),m(""),_("")}function I(O){O.key==="Escape"&&s(!1)}function B(O){var K;x(O);const W=Lu(a,O);W.some(G=>G.effort===k)||y(Pu(a,O)??((K=W[0])==null?void 0:K.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:O=>O.stopPropagation(),onKeyDown:I,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"New Session"}),c.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:c.jsx(Kn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.jsxs("label",{className:"dialog-label",children:["Title (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:h,onChange:O=>m(O.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Model",c.jsxs("select",{className:"dialog-input dialog-select",value:g,onChange:O=>B(O.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),E.map(O=>c.jsxs("option",{value:O.slug,children:[O.displayName," — ",O.description]},O.slug))]})]}),T.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:O=>y(O.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Pu(a,g),")"]}),T.map(O=>c.jsx("option",{value:O.effort,children:O.label},O.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:N,onChange:O=>_(O.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>s(!1),children:"Cancel"}),c.jsx("button",{className:"dialog-btn-create",onClick:M,children:"Create"})]})]})})}const QS=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,ZS=512*1024;function JS(n){const s=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(s)?s:""}function eT(){const{appCatalogOpen:n,closeAppCatalog:s,apps:r,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=L(),[f,h]=w.useState("examples"),[m,g]=w.useState(null),[x,k]=w.useState(null),[y,N]=w.useState(!1),[_,E]=w.useState(""),[T,M]=w.useState(""),[I,B]=w.useState(""),[O,W]=w.useState(""),[q,K]=w.useState(null),[G,ae]=w.useState(""),de=w.useRef(null);if(w.useEffect(()=>{n&&(g(null),Tx().then(g).catch(()=>g([])))},[n]),w.useEffect(()=>{de.current&&(de.current.webkitdirectory=!0)},[f]),!n)return null;const oe=new Set(r.map(P=>P.id));async function ke(P){k(P);try{await o(P)&&s()}finally{k(null)}}async function Ne(){if(y)return;const P=_.trim(),J=T.trim();if(!(!P||!J)){N(!0);try{await a({id:P,title:J,description:I.trim()||void 0,icon:O.trim()||void 0})&&(E(""),M(""),B(""),W(""),s())}finally{N(!1)}}}async function Fe(P){const J=Array.from(P.target.files??[]),H={};let b="";for(const A of J){const ue=(A.webkitRelativePath??"").split("/");!b&&ue.length>1&&(b=ue[0]);const me=ue[ue.length-1];if(!(!me||!QS.test(me))&&!(A.size>ZS))try{H[me]=await A.text()}catch{}}K(Object.keys(H).length>0?H:null),ae(JS(b))}async function Q(){if(!(y||!q||!G.trim())){N(!0);try{await u(G.trim(),q)&&(K(null),ae(""),s())}finally{N(!1)}}}function se(P){P.key==="Escape"&&s()}const ce=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return c.jsx("div",{className:"dialog-overlay",onClick:s,children:c.jsxs("div",{className:"dialog app-catalog",onClick:P=>P.stopPropagation(),onKeyDown:se,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Add Mini App"}),c.jsx("button",{className:"dialog-close",onClick:s,children:"✕"})]}),c.jsx("div",{className:"catalog-tabs",children:ce.map(P=>c.jsx("button",{className:`catalog-tab${f===P.key?" active":""}`,onClick:()=>h(P.key),children:P.label},P.key))}),c.jsxs("div",{className:"dialog-body catalog-body",children:[f==="examples"&&c.jsx("div",{className:"catalog-examples",children:m===null?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):m.length===0?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):m.map(P=>{const J=oe.has(P.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:P.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:P.title}),P.description&&c.jsx("span",{className:"example-desc",children:P.description})]}),c.jsx("button",{className:"example-install",disabled:J||x===P.id,onClick:()=>ke(P.id),title:J?"Already installed":"Install this example",children:J?"Installed":x===P.id?"Installing…":"Install"})]},P.id)})}),f==="new"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id (folder name)",c.jsx("input",{className:"dialog-input",type:"text",value:_,onChange:P=>E(P.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Title",c.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:P=>M(P.target.value),placeholder:"e.g. Todo List"})]}),c.jsxs("label",{className:"dialog-label",children:["Description (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:I,onChange:P=>B(P.target.value),placeholder:"What does this app do?"})]}),c.jsxs("label",{className:"dialog-label",children:["Icon (optional, emoji)",c.jsx("input",{className:"dialog-input",type:"text",value:O,onChange:P=>W(P.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!_.trim()||!T.trim(),onClick:Ne,children:[c.jsx(wr,{size:13})," Create App"]})]}),f==="upload"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.ts (or legacy app.js), …). A missing manifest.json is generated from the folder name."}),c.jsx("input",{ref:de,type:"file",multiple:!0,onChange:Fe}),q&&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:P=>ae(P.target.value)})]}),c.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(q).length," file(s):"," ",Object.keys(q).slice(0,6).join(", "),Object.keys(q).length>6?", …":""]})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!q||!G.trim(),onClick:Q,children:[c.jsx(S0,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:s,children:"Close"})})]})})}function tT(){const n=L(k=>k.showCommandPalette),s=L(k=>k.setShowCommandPalette),r=L(),[o,a]=w.useState(""),[u,f]=w.useState(0),h=w.useRef(null),m=w.useMemo(()=>{const k=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,y=oa(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:wr,action:()=>r.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:hs,action:()=>{r.activeSessionId&&r.deleteSession(r.activeSessionId)},available:!!r.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:ca,action:()=>{const N=document.querySelector(".cmd-input");N==null||N.focus()},available:!!r.activeSessionId&&!y},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:ci,action:()=>r.cancelTurn(),available:y},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:a0,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:t0,action:()=>r.switchRightTab("changes"),available:!!r.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Kn,action:()=>{r.activeSessionId&&r.closeTab(r.activeSessionId)},available:!!r.activeSessionId}]},[r]),g=w.useMemo(()=>{const k=o.toLowerCase().trim(),y=m.filter(N=>N.available);return k?y.filter(N=>N.label.toLowerCase().includes(k)||N.hint.toLowerCase().includes(k)):y},[m,o]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function x(k){if(k.key==="ArrowDown")k.preventDefault(),f(y=>Math.min(y+1,g.length-1));else if(k.key==="ArrowUp")k.preventDefault(),f(y=>Math.max(y-1,0));else if(k.key==="Enter"){k.preventDefault();const y=g[u];y&&(y.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:x}),c.jsx("span",{className:"palette-esc",children:"ESC"})]}),g.length===0?c.jsx("div",{className:"palette-empty",children:"No matching commands"}):c.jsx("div",{className:"palette-list",children:g.map((k,y)=>{const N=k.icon;return c.jsxs("div",{className:`palette-item ${y===u?"selected":""}`,onClick:()=>{k.action(),s(!1)},onMouseEnter:()=>f(y),children:[c.jsx("span",{className:"palette-item-icon",children:c.jsx(N,{size:16})}),c.jsx("span",{className:"palette-item-label",children:k.label}),c.jsx("span",{className:"palette-item-hint",children:k.hint}),y===u&&c.jsx(Jx,{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 vm=/^[a-z][a-z0-9-]{1,30}$/,nT=2e3;function sT(){const{showRemoteModal:n,setShowRemoteModal:s,selectSession:r}=L(),[o,a]=w.useState(null),[u,f]=w.useState(null),[h,m]=w.useState(!1),[g,x]=w.useState(!1),[k,y]=w.useState(!1),[N,_]=w.useState(!1),[E,T]=w.useState("main"),[M,I]=w.useState(""),[B,O]=w.useState(!1),[W,q]=w.useState(null),K=w.useRef(null);aa(K,()=>_(!1),N);const G=g||k,ae=w.useCallback(async()=>{m(!0),f(null);try{const P=await fetch(`${ms()}/remote/status`,{headers:{Accept:"application/json"}});if(!P.ok)throw new Error(`status ${P.status}`);a(await P.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);w.useEffect(()=>{n&&(T("main"),q(null),ae())},[n,ae]);const de=W!==null&&W.state==="running";if(w.useEffect(()=>{if(!de)return;const P=setInterval(async()=>{try{const J=await fetch(`${ms()}/remote/enable`,{headers:{Accept:"application/json"}});J.ok&&q(await J.json())}catch{}},nT);return()=>clearInterval(P)},[de]),!n)return null;const oe=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function ke(P){P.key==="Escape"&&s(!1)}async function Ne(P){if(vm.test(P)){O(!0);try{const J=await fetch(`${ms()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:P})});if(!J.ok)throw new Error(`enable ${J.status}`);q(await J.json()),T("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{O(!1)}}}function Fe(){W!=null&&W.troubleshootingSessionId&&(r(W.troubleshootingSessionId),s(!1))}async function Q(){x(!0);try{await fetch(`${ms()}/remote/disable`,{method:"POST"}),await ae()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{x(!1)}}async function se(){if(_(!1),!!window.confirm(`Remove the tunnel completely?
494
+
495
+ This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
496
+
497
+ This cannot be undone.`)){y(!0);try{const J=await fetch(`${ms()}/remote/uninstall`,{method:"DELETE"});if(!J.ok)throw new Error(`uninstall ${J.status}`);await ae()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{y(!1)}}}function ce(){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:M,onChange:b=>I(b.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:()=>T("main"),children:"Back"}),c.jsxs("button",{className:"dialog-btn-create",disabled:!vm.test(M)||B,onClick:()=>void Ne(M),children:[B?c.jsx(ns,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const P=["detect","provision","install","verify","ready"],J=P.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(ns,{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(er,{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:P.map((b,A)=>{const ee=H||J>-1&&A<J,ue=!H&&A===J&&W.state==="running";return c.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:ee||ue?1:.4,color:ee?"var(--green)":void 0},children:[ee?c.jsx(er,{size:13}):ue?c.jsx(ns,{size:13,className:"spin"}):c.jsx(Qx,{size:9,style:{marginLeft:2,marginRight:2}}),b]},b)})}),W.logs.length>0&&c.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:W.logs.slice(-3).map(b=>b.message).join(`
498
+ `)}),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:Fe,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 ae(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:P=>P.stopPropagation(),onKeyDown:ke,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(Kn,{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(ns,{size:14,className:"spin"})," Loading machine status…"]}),u&&c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),E==="setup"?ce():c.jsxs(c.Fragment,{children:[oe&&(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 Q(),disabled:G,children:[g?c.jsx(ns,{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:()=>_(P=>!P),disabled:G,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":N,children:k?c.jsx(ns,{size:14,className:"spin"}):c.jsx(ii,{size:14})}),N&&c.jsx("div",{ref:K,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 se(),children:[c.jsx(hs,{size:12})," Remove tunnel"]})})]})]}),!oe&&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 Ne(o.tunnel.mahlas),disabled:B,children:[B?c.jsx(ns,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(dh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>T("setup"),children:[c.jsx(dh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const rT={success:Xx,error:Qu,info:r0,warn:w0},iT=4e3;function oT({toast:n}){const s=L(f=>f.removeToast),r=rT[n.type],o=w.useRef(null);w.useEffect(()=>{function f(){o.current=setTimeout(()=>s(n.id),iT)}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(k0,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>s(n.id),children:c.jsx(Kn,{size:14})})]})}function lT(){const n=L(s=>s.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(s=>c.jsx(oT,{toast:s},s.id))})}let Gn=null,li=null,ro=1e3;const aT=1e4;function cT(){const n=ms();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Ou(){Gn&&(Gn.readyState===WebSocket.OPEN||Gn.readyState===WebSocket.CONNECTING)||(Gn=new WebSocket(cT()),Gn.onopen=()=>{const n=ro>1e3;if(ro=1e3,L.getState().setWsConnected(!0),L.getState().addLogEntry("INFO","WebSocket connected"),n){const s=L.getState();s.activeSessionId&&(s.refreshActiveSession(),s.addToast("info","WebSocket reconnected — session state reconciled"))}},Gn.onclose=()=>{L.getState().setWsConnected(!1),L.getState().addLogEntry("WARN","WebSocket disconnected"),L.getState().addToast("warn","WebSocket disconnected — reconnecting…"),dT()},Gn.onerror=()=>{},Gn.onmessage=n=>{try{const s=JSON.parse(n.data);en.trackWsEvent(typeof s.event=="string"?s.event:"unknown",typeof n.data=="string"?n.data.length:0);const r=fT[s.event];r&&r(s.data)}catch{}})}function uT(){li&&(clearTimeout(li),li=null),Gn&&(Gn.onclose=null,Gn.close(),Gn=null),L.getState().setWsConnected(!1)}function dT(){li||(li=window.setTimeout(()=>{li=null,Ou()},ro),ro=Math.min(ro*2,aT))}const fT={"turn:started":n=>{const s=n;en.note(`turn:started — ${s.turnId.slice(0,8)}`),L.getState().onTurnStarted(s.sessionId,s.turnId)},"item:started":n=>{const s=n;L.getState().onItemStarted(s.sessionId,s.turnId,s.item)},"item:updated":n=>{const s=n;L.getState().onItemUpdated(s.sessionId,s.turnId,s.item)},"item:completed":n=>{const s=n;L.getState().onItemCompleted(s.sessionId,s.turnId,s.item)},"item:delta":n=>{const s=n;L.getState().onItemDelta(s.sessionId,s.turnId,s.itemId,s.delta)},"turn:completed":n=>{const s=n;en.note(`turn:completed — ${s.turnId.slice(0,8)}`),L.getState().onTurnCompleted(s.sessionId,s.turnId,s.usage,s.hasUnreviewed,s.response??void 0)},"turn:tokenUsage":n=>{const s=n;L.getState().onTokenUsageUpdated(s.sessionId,s.turnId,s.usage)},"turn:contextUsage":n=>{const s=n,r={totalTokens:s.totalTokens,contextWindow:s.contextWindow,percentage:s.percentage};L.getState().onContextUsageUpdated(s.sessionId,r)},"turn:failed":n=>{const s=n;L.getState().onTurnFailed(s.sessionId,s.turnId,s.error)},"turn:cancelled":n=>{const s=n;L.getState().onTurnCancelled(s.sessionId,s.turnId)},"session:title":n=>{const s=n;L.getState().onSessionTitle(s.sessionId,s.title)},background_tasks:n=>{const s=n;en.note(`background_tasks — ${s.tasks.length} live (${s.tasks.map(r=>r.task_type).join(", ")||"none"})`),L.getState().onBackgroundTasksChanged(s.sessionId,s.tasks)},"thread:created":n=>{const s=n;L.getState().onThreadCreated(s.sessionId,s.thread,s.turn)},"thread:followup":n=>{const s=n;L.getState().onThreadFollowup(s.sessionId,s.threadId,s.turn)},"thread:resolved":n=>{const s=n;L.getState().onThreadResolved(s.sessionId,s.threadId,s.status)},"thread:deleted":n=>{const s=n;L.getState().onThreadDeleted(s.sessionId,s.threadId)},"app:tool_call":n=>{const s=n;sx(s.appId,s.callId,s.tool,s.args??{})},"app:source:updated":n=>{ux(n.appId)},"app:state_changed":n=>{cx(n.appId)}};function pT(){const n=L(s=>s.init);return w.useEffect(()=>{Dy(),n(),L.getState().loadApps(),Ou();function s(){if(document.visibilityState!=="visible")return;const r=L.getState(),o=r.activeSessionId;if(!o)return;const a=r.sessionDetails[o];r.wsConnected||Ou(),a&&a.is_running===1&&(r.refreshActiveSession(),r.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",s),()=>{uT(),document.removeEventListener("visibilitychange",s)}},[n]),null}function hT(){const n=L(a=>a.loading),s=L(a=>a.error),r=L(a=>a.sessions),o=L(a=>a.setShowCommandPalette);return w.useEffect(()=>en.start(),[]),w.useEffect(()=>{function a(u){(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),o(!0))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[o]),c.jsxs(c.Fragment,{children:[c.jsx(pT,{}),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(XS,{}),c.jsx(YS,{}),c.jsx(eT,{}),c.jsx(sT,{}),c.jsx(tT,{}),c.jsx(lT,{})]})]})}Ty.createRoot(document.getElementById("root")).render(c.jsx(it.StrictMode,{children:c.jsx(hT,{})}));