@amd-gaia/agent-ui 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,550 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();var ka=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function to(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qh={exports:{}},no={},Kh={exports:{}},Ne={};/**
|
|
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 xl=Symbol.for("react.element"),pv=Symbol.for("react.portal"),gv=Symbol.for("react.fragment"),yv=Symbol.for("react.strict_mode"),xv=Symbol.for("react.profiler"),vv=Symbol.for("react.provider"),kv=Symbol.for("react.context"),wv=Symbol.for("react.forward_ref"),bv=Symbol.for("react.suspense"),jv=Symbol.for("react.memo"),Sv=Symbol.for("react.lazy"),gf=Symbol.iterator;function Nv(e){return e===null||typeof e!="object"?null:(e=gf&&e[gf]||e["@@iterator"],typeof e=="function"?e:null)}var Yh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xh=Object.assign,Jh={};function ns(e,t,n){this.props=e,this.context=t,this.refs=Jh,this.updater=n||Yh}ns.prototype.isReactComponent={};ns.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ns.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zh(){}Zh.prototype=ns.prototype;function Tu(e,t,n){this.props=e,this.context=t,this.refs=Jh,this.updater=n||Yh}var zu=Tu.prototype=new Zh;zu.constructor=Tu;Xh(zu,ns.prototype);zu.isPureReactComponent=!0;var yf=Array.isArray,ep=Object.prototype.hasOwnProperty,Lu={current:null},tp={key:!0,ref:!0,__self:!0,__source:!0};function np(e,t,n){var r,i={},l=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(l=""+t.key),t)ep.call(t,r)&&!tp.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:xl,type:e,key:l,ref:a,props:i,_owner:Lu.current}}function Cv(e,t){return{$$typeof:xl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Iu(e){return typeof e=="object"&&e!==null&&e.$$typeof===xl}function _v(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var xf=/\/+/g;function Eo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?_v(""+e.key):t.toString(36)}function sa(e,t,n,r,i){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case xl:case pv:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Eo(a,0):r,yf(i)?(n="",e!=null&&(n=e.replace(xf,"$&/")+"/"),sa(i,t,n,"",function(u){return u})):i!=null&&(Iu(i)&&(i=Cv(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(xf,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",yf(e))for(var o=0;o<e.length;o++){l=e[o];var c=r+Eo(l,o);a+=sa(l,t,n,c,i)}else if(c=Nv(e),typeof c=="function")for(e=c.call(e),o=0;!(l=e.next()).done;)l=l.value,c=r+Eo(l,o++),a+=sa(l,t,n,c,i);else if(l==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Al(e,t,n){if(e==null)return e;var r=[],i=0;return sa(e,r,"","",function(l){return t.call(n,l,i++)}),r}function Ev(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ut={current:null},la={transition:null},Tv={ReactCurrentDispatcher:Ut,ReactCurrentBatchConfig:la,ReactCurrentOwner:Lu};function rp(){throw Error("act(...) is not supported in production builds of React.")}Ne.Children={map:Al,forEach:function(e,t,n){Al(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Al(e,function(){t++}),t},toArray:function(e){return Al(e,function(t){return t})||[]},only:function(e){if(!Iu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ne.Component=ns;Ne.Fragment=gv;Ne.Profiler=xv;Ne.PureComponent=Tu;Ne.StrictMode=yv;Ne.Suspense=bv;Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Tv;Ne.act=rp;Ne.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Xh({},e.props),i=e.key,l=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,a=Lu.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)ep.call(t,c)&&!tp.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:xl,type:e.type,key:i,ref:l,props:r,_owner:a}};Ne.createContext=function(e){return e={$$typeof:kv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:vv,_context:e},e.Consumer=e};Ne.createElement=np;Ne.createFactory=function(e){var t=np.bind(null,e);return t.type=e,t};Ne.createRef=function(){return{current:null}};Ne.forwardRef=function(e){return{$$typeof:wv,render:e}};Ne.isValidElement=Iu;Ne.lazy=function(e){return{$$typeof:Sv,_payload:{_status:-1,_result:e},_init:Ev}};Ne.memo=function(e,t){return{$$typeof:jv,type:e,compare:t===void 0?null:t}};Ne.startTransition=function(e){var t=la.transition;la.transition={};try{e()}finally{la.transition=t}};Ne.unstable_act=rp;Ne.useCallback=function(e,t){return Ut.current.useCallback(e,t)};Ne.useContext=function(e){return Ut.current.useContext(e)};Ne.useDebugValue=function(){};Ne.useDeferredValue=function(e){return Ut.current.useDeferredValue(e)};Ne.useEffect=function(e,t){return Ut.current.useEffect(e,t)};Ne.useId=function(){return Ut.current.useId()};Ne.useImperativeHandle=function(e,t,n){return Ut.current.useImperativeHandle(e,t,n)};Ne.useInsertionEffect=function(e,t){return Ut.current.useInsertionEffect(e,t)};Ne.useLayoutEffect=function(e,t){return Ut.current.useLayoutEffect(e,t)};Ne.useMemo=function(e,t){return Ut.current.useMemo(e,t)};Ne.useReducer=function(e,t,n){return Ut.current.useReducer(e,t,n)};Ne.useRef=function(e){return Ut.current.useRef(e)};Ne.useState=function(e){return Ut.current.useState(e)};Ne.useSyncExternalStore=function(e,t,n){return Ut.current.useSyncExternalStore(e,t,n)};Ne.useTransition=function(){return Ut.current.useTransition()};Ne.version="18.3.1";Kh.exports=Ne;var p=Kh.exports;const Gi=to(p);/**
|
|
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 zv=p,Lv=Symbol.for("react.element"),Iv=Symbol.for("react.fragment"),Dv=Object.prototype.hasOwnProperty,Av=zv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Pv={key:!0,ref:!0,__self:!0,__source:!0};function ip(e,t,n){var r,i={},l=null,a=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Dv.call(t,r)&&!Pv.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Lv,type:e,key:l,ref:a,props:i,_owner:Av.current}}no.Fragment=Iv;no.jsx=ip;no.jsxs=ip;Qh.exports=no;var s=Qh.exports,xc={},sp={exports:{}},an={},lp={exports:{}},ap={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(T,P){var b=T.length;T.push(P);e:for(;0<b;){var J=b-1>>>1,B=T[J];if(0<i(B,P))T[J]=P,T[b]=B,b=J;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var P=T[0],b=T.pop();if(b!==P){T[0]=b;e:for(var J=0,B=T.length,S=B>>>1;J<S;){var oe=2*(J+1)-1,pe=T[oe],ae=oe+1,_e=T[ae];if(0>i(pe,b))ae<B&&0>i(_e,pe)?(T[J]=_e,T[ae]=b,J=ae):(T[J]=pe,T[oe]=b,J=oe);else if(ae<B&&0>i(_e,b))T[J]=_e,T[ae]=b,J=ae;else break e}}return P}function i(T,P){var b=T.sortIndex-P.sortIndex;return b!==0?b:T.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(T){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=T)r(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=n(u)}}function z(T){if(v=!1,j(T),!g)if(n(c)!==null)g=!0,xe(A);else{var P=n(u);P!==null&&ce(z,P.startTime-T)}}function A(T,P){g=!1,v&&(v=!1,x(C),C=-1),m=!0;var b=h;try{for(j(P),f=n(c);f!==null&&(!(f.expirationTime>P)||T&&!U());){var J=f.callback;if(typeof J=="function"){f.callback=null,h=f.priorityLevel;var B=J(f.expirationTime<=P);P=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(c)&&r(c),j(P)}else r(c);f=n(c)}if(f!==null)var S=!0;else{var oe=n(u);oe!==null&&ce(z,oe.startTime-P),S=!1}return S}finally{f=null,h=b,m=!1}}var _=!1,D=null,C=-1,M=5,N=-1;function U(){return!(e.unstable_now()-N<M)}function O(){if(D!==null){var T=e.unstable_now();N=T;var P=!0;try{P=D(!0,T)}finally{P?re():(_=!1,D=null)}}else _=!1}var re;if(typeof k=="function")re=function(){k(O)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,X=ie.port2;ie.port1.onmessage=O,re=function(){X.postMessage(null)}}else re=function(){w(O,0)};function xe(T){D=T,_||(_=!0,re())}function ce(T,P){C=w(function(){T(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,xe(A))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(T){switch(h){case 1:case 2:case 3:var P=3;break;default:P=h}var b=h;h=P;try{return T()}finally{h=b}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,P){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var b=h;h=T;try{return P()}finally{h=b}},e.unstable_scheduleCallback=function(T,P,b){var J=e.unstable_now();switch(typeof b=="object"&&b!==null?(b=b.delay,b=typeof b=="number"&&0<b?J+b:J):b=J,T){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=b+B,T={id:d++,callback:P,priorityLevel:T,startTime:b,expirationTime:B,sortIndex:-1},b>J?(T.sortIndex=b,t(u,T),n(c)===null&&T===n(u)&&(v?(x(C),C=-1):v=!0,ce(z,b-J))):(T.sortIndex=B,t(c,T),g||m||(g=!0,xe(A))),T},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(T){var P=h;return function(){var b=h;h=P;try{return T.apply(this,arguments)}finally{h=b}}}})(ap);lp.exports=ap;var Mv=lp.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 Rv=p,ln=Mv;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var op=new Set,Xs={};function di(e,t){qi(e,t),qi(e+"Capture",t)}function qi(e,t){for(Xs[e]=t,e=0;e<t.length;e++)op.add(t[e])}var Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vc=Object.prototype.hasOwnProperty,$v=/^[: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]*$/,vf={},kf={};function Fv(e){return vc.call(kf,e)?!0:vc.call(vf,e)?!1:$v.test(e)?kf[e]=!0:(vf[e]=!0,!1)}function Ov(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Uv(e,t,n,r){if(t===null||typeof t>"u"||Ov(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Bt(e,t,n,r,i,l,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=a}var _t={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_t[e]=new Bt(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 Bt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_t[e]=new Bt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_t[e]=new Bt(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 Bt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_t[e]=new Bt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_t[e]=new Bt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_t[e]=new Bt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_t[e]=new Bt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Du=/[\-:]([a-z])/g;function Au(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(Du,Au);_t[t]=new Bt(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(Du,Au);_t[t]=new Bt(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(Du,Au);_t[t]=new Bt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_t[e]=new Bt(e,1,!1,e.toLowerCase(),null,!1,!1)});_t.xlinkHref=new Bt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_t[e]=new Bt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pu(e,t,n,r){var i=_t.hasOwnProperty(t)?_t[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Uv(t,n,i,r)&&(n=null),r||i===null?Fv(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var rr=Rv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Pl=Symbol.for("react.element"),Ni=Symbol.for("react.portal"),Ci=Symbol.for("react.fragment"),Mu=Symbol.for("react.strict_mode"),kc=Symbol.for("react.profiler"),cp=Symbol.for("react.provider"),up=Symbol.for("react.context"),Ru=Symbol.for("react.forward_ref"),wc=Symbol.for("react.suspense"),bc=Symbol.for("react.suspense_list"),$u=Symbol.for("react.memo"),Sr=Symbol.for("react.lazy"),dp=Symbol.for("react.offscreen"),wf=Symbol.iterator;function xs(e){return e===null||typeof e!="object"?null:(e=wf&&e[wf]||e["@@iterator"],typeof e=="function"?e:null)}var Xe=Object.assign,To;function zs(e){if(To===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);To=t&&t[1]||""}return`
|
|
34
|
-
`+To+e}var zo=!1;function Lo(e,t){if(!e||zo)return"";zo=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
35
|
-
`),l=r.stack.split(`
|
|
36
|
-
`),a=i.length-1,o=l.length-1;1<=a&&0<=o&&i[a]!==l[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==l[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==l[o]){var c=`
|
|
37
|
-
`+i[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=o);break}}}finally{zo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?zs(e):""}function Bv(e){switch(e.tag){case 5:return zs(e.type);case 16:return zs("Lazy");case 13:return zs("Suspense");case 19:return zs("SuspenseList");case 0:case 2:case 15:return e=Lo(e.type,!1),e;case 11:return e=Lo(e.type.render,!1),e;case 1:return e=Lo(e.type,!0),e;default:return""}}function jc(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 Ci:return"Fragment";case Ni:return"Portal";case kc:return"Profiler";case Mu:return"StrictMode";case wc:return"Suspense";case bc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case up:return(e.displayName||"Context")+".Consumer";case cp:return(e._context.displayName||"Context")+".Provider";case Ru:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $u:return t=e.displayName||null,t!==null?t:jc(e.type)||"Memo";case Sr:t=e._payload,e=e._init;try{return jc(e(t))}catch{}}return null}function Hv(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 jc(t);case 8:return t===Mu?"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 $r(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Vv(e){var t=fp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ml(e){e._valueTracker||(e._valueTracker=Vv(e))}function mp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=fp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wa(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 Sc(e,t){var n=t.checked;return Xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function bf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$r(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function hp(e,t){t=t.checked,t!=null&&Pu(e,"checked",t,!1)}function Nc(e,t){hp(e,t);var n=$r(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Cc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Cc(e,t.type,$r(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Cc(e,t,n){(t!=="number"||wa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ls=Array.isArray;function $i(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$r(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function _c(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return Xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Sf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(W(92));if(Ls(n)){if(1<n.length)throw Error(W(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:$r(n)}}function pp(e,t){var n=$r(t.value),r=$r(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Nf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function gp(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 Ec(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?gp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Rl,yp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Rl=Rl||document.createElement("div"),Rl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Rl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Js(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ps={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},Wv=["Webkit","ms","Moz","O"];Object.keys(Ps).forEach(function(e){Wv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ps[t]=Ps[e]})});function xp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ps.hasOwnProperty(e)&&Ps[e]?(""+t).trim():t+"px"}function vp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=xp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Gv=Xe({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 Tc(e,t){if(t){if(Gv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function zc(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 Lc=null;function Fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ic=null,Fi=null,Oi=null;function Cf(e){if(e=wl(e)){if(typeof Ic!="function")throw Error(W(280));var t=e.stateNode;t&&(t=ao(t),Ic(e.stateNode,e.type,t))}}function kp(e){Fi?Oi?Oi.push(e):Oi=[e]:Fi=e}function wp(){if(Fi){var e=Fi,t=Oi;if(Oi=Fi=null,Cf(e),t)for(e=0;e<t.length;e++)Cf(t[e])}}function bp(e,t){return e(t)}function jp(){}var Io=!1;function Sp(e,t,n){if(Io)return e(t,n);Io=!0;try{return bp(e,t,n)}finally{Io=!1,(Fi!==null||Oi!==null)&&(jp(),wp())}}function Zs(e,t){var n=e.stateNode;if(n===null)return null;var r=ao(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(W(231,t,typeof n));return n}var Dc=!1;if(Jn)try{var vs={};Object.defineProperty(vs,"passive",{get:function(){Dc=!0}}),window.addEventListener("test",vs,vs),window.removeEventListener("test",vs,vs)}catch{Dc=!1}function qv(e,t,n,r,i,l,a,o,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Ms=!1,ba=null,ja=!1,Ac=null,Qv={onError:function(e){Ms=!0,ba=e}};function Kv(e,t,n,r,i,l,a,o,c){Ms=!1,ba=null,qv.apply(Qv,arguments)}function Yv(e,t,n,r,i,l,a,o,c){if(Kv.apply(this,arguments),Ms){if(Ms){var u=ba;Ms=!1,ba=null}else throw Error(W(198));ja||(ja=!0,Ac=u)}}function fi(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Np(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 _f(e){if(fi(e)!==e)throw Error(W(188))}function Xv(e){var t=e.alternate;if(!t){if(t=fi(e),t===null)throw Error(W(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var l=i.alternate;if(l===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===l.child){for(l=i.child;l;){if(l===n)return _f(i),e;if(l===r)return _f(i),t;l=l.sibling}throw Error(W(188))}if(n.return!==r.return)n=i,r=l;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=l;break}if(o===r){a=!0,r=i,n=l;break}o=o.sibling}if(!a){for(o=l.child;o;){if(o===n){a=!0,n=l,r=i;break}if(o===r){a=!0,r=l,n=i;break}o=o.sibling}if(!a)throw Error(W(189))}}if(n.alternate!==r)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?e:t}function Cp(e){return e=Xv(e),e!==null?_p(e):null}function _p(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_p(e);if(t!==null)return t;e=e.sibling}return null}var Ep=ln.unstable_scheduleCallback,Ef=ln.unstable_cancelCallback,Jv=ln.unstable_shouldYield,Zv=ln.unstable_requestPaint,it=ln.unstable_now,e1=ln.unstable_getCurrentPriorityLevel,Ou=ln.unstable_ImmediatePriority,Tp=ln.unstable_UserBlockingPriority,Sa=ln.unstable_NormalPriority,t1=ln.unstable_LowPriority,zp=ln.unstable_IdlePriority,ro=null,On=null;function n1(e){if(On&&typeof On.onCommitFiberRoot=="function")try{On.onCommitFiberRoot(ro,e,void 0,(e.current.flags&128)===128)}catch{}}var Tn=Math.clz32?Math.clz32:s1,r1=Math.log,i1=Math.LN2;function s1(e){return e>>>=0,e===0?32:31-(r1(e)/i1|0)|0}var $l=64,Fl=4194304;function Is(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 Na(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Is(o):(l&=a,l!==0&&(r=Is(l)))}else a=n&~i,a!==0?r=Is(a):l!==0&&(r=Is(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Tn(t),i=1<<n,r|=e[n],t&=~i;return r}function l1(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 a1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,l=e.pendingLanes;0<l;){var a=31-Tn(l),o=1<<a,c=i[a];c===-1?(!(o&n)||o&r)&&(i[a]=l1(o,t)):c<=t&&(e.expiredLanes|=o),l&=~o}}function Pc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Lp(){var e=$l;return $l<<=1,!($l&4194240)&&($l=64),e}function Do(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tn(t),e[t]=n}function o1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Tn(n),l=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~l}}function Uu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Tn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Re=0;function Ip(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Dp,Bu,Ap,Pp,Mp,Mc=!1,Ol=[],zr=null,Lr=null,Ir=null,el=new Map,tl=new Map,Cr=[],c1="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 Tf(e,t){switch(e){case"focusin":case"focusout":zr=null;break;case"dragenter":case"dragleave":Lr=null;break;case"mouseover":case"mouseout":Ir=null;break;case"pointerover":case"pointerout":el.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":tl.delete(t.pointerId)}}function ks(e,t,n,r,i,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[i]},t!==null&&(t=wl(t),t!==null&&Bu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function u1(e,t,n,r,i){switch(t){case"focusin":return zr=ks(zr,e,t,n,r,i),!0;case"dragenter":return Lr=ks(Lr,e,t,n,r,i),!0;case"mouseover":return Ir=ks(Ir,e,t,n,r,i),!0;case"pointerover":var l=i.pointerId;return el.set(l,ks(el.get(l)||null,e,t,n,r,i)),!0;case"gotpointercapture":return l=i.pointerId,tl.set(l,ks(tl.get(l)||null,e,t,n,r,i)),!0}return!1}function Rp(e){var t=Kr(e.target);if(t!==null){var n=fi(t);if(n!==null){if(t=n.tag,t===13){if(t=Np(n),t!==null){e.blockedOn=t,Mp(e.priority,function(){Ap(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function aa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Rc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Lc=r,n.target.dispatchEvent(r),Lc=null}else return t=wl(n),t!==null&&Bu(t),e.blockedOn=n,!1;t.shift()}return!0}function zf(e,t,n){aa(e)&&n.delete(t)}function d1(){Mc=!1,zr!==null&&aa(zr)&&(zr=null),Lr!==null&&aa(Lr)&&(Lr=null),Ir!==null&&aa(Ir)&&(Ir=null),el.forEach(zf),tl.forEach(zf)}function ws(e,t){e.blockedOn===t&&(e.blockedOn=null,Mc||(Mc=!0,ln.unstable_scheduleCallback(ln.unstable_NormalPriority,d1)))}function nl(e){function t(i){return ws(i,e)}if(0<Ol.length){ws(Ol[0],e);for(var n=1;n<Ol.length;n++){var r=Ol[n];r.blockedOn===e&&(r.blockedOn=null)}}for(zr!==null&&ws(zr,e),Lr!==null&&ws(Lr,e),Ir!==null&&ws(Ir,e),el.forEach(t),tl.forEach(t),n=0;n<Cr.length;n++)r=Cr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Cr.length&&(n=Cr[0],n.blockedOn===null);)Rp(n),n.blockedOn===null&&Cr.shift()}var Ui=rr.ReactCurrentBatchConfig,Ca=!0;function f1(e,t,n,r){var i=Re,l=Ui.transition;Ui.transition=null;try{Re=1,Hu(e,t,n,r)}finally{Re=i,Ui.transition=l}}function m1(e,t,n,r){var i=Re,l=Ui.transition;Ui.transition=null;try{Re=4,Hu(e,t,n,r)}finally{Re=i,Ui.transition=l}}function Hu(e,t,n,r){if(Ca){var i=Rc(e,t,n,r);if(i===null)Ho(e,t,r,_a,n),Tf(e,r);else if(u1(i,e,t,n,r))r.stopPropagation();else if(Tf(e,r),t&4&&-1<c1.indexOf(e)){for(;i!==null;){var l=wl(i);if(l!==null&&Dp(l),l=Rc(e,t,n,r),l===null&&Ho(e,t,r,_a,n),l===i)break;i=l}i!==null&&r.stopPropagation()}else Ho(e,t,r,null,n)}}var _a=null;function Rc(e,t,n,r){if(_a=null,e=Fu(r),e=Kr(e),e!==null)if(t=fi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Np(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return _a=e,null}function $p(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(e1()){case Ou:return 1;case Tp:return 4;case Sa:case t1:return 16;case zp:return 536870912;default:return 16}default:return 16}}var Er=null,Vu=null,oa=null;function Fp(){if(oa)return oa;var e,t=Vu,n=t.length,r,i="value"in Er?Er.value:Er.textContent,l=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[l-r];r++);return oa=i.slice(e,1<r?1-r:void 0)}function ca(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 Ul(){return!0}function Lf(){return!1}function on(e){function t(n,r,i,l,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=l,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Ul:Lf,this.isPropagationStopped=Lf,this}return Xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ul)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ul)},persist:function(){},isPersistent:Ul}),t}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wu=on(rs),kl=Xe({},rs,{view:0,detail:0}),h1=on(kl),Ao,Po,bs,io=Xe({},kl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gu,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!==bs&&(bs&&e.type==="mousemove"?(Ao=e.screenX-bs.screenX,Po=e.screenY-bs.screenY):Po=Ao=0,bs=e),Ao)},movementY:function(e){return"movementY"in e?e.movementY:Po}}),If=on(io),p1=Xe({},io,{dataTransfer:0}),g1=on(p1),y1=Xe({},kl,{relatedTarget:0}),Mo=on(y1),x1=Xe({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),v1=on(x1),k1=Xe({},rs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),w1=on(k1),b1=Xe({},rs,{data:0}),Df=on(b1),j1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},S1={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"},N1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function C1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=N1[e])?!!t[e]:!1}function Gu(){return C1}var _1=Xe({},kl,{key:function(e){if(e.key){var t=j1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ca(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?S1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gu,charCode:function(e){return e.type==="keypress"?ca(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ca(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),E1=on(_1),T1=Xe({},io,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Af=on(T1),z1=Xe({},kl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gu}),L1=on(z1),I1=Xe({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),D1=on(I1),A1=Xe({},io,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),P1=on(A1),M1=[9,13,27,32],qu=Jn&&"CompositionEvent"in window,Rs=null;Jn&&"documentMode"in document&&(Rs=document.documentMode);var R1=Jn&&"TextEvent"in window&&!Rs,Op=Jn&&(!qu||Rs&&8<Rs&&11>=Rs),Pf=" ",Mf=!1;function Up(e,t){switch(e){case"keyup":return M1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _i=!1;function $1(e,t){switch(e){case"compositionend":return Bp(t);case"keypress":return t.which!==32?null:(Mf=!0,Pf);case"textInput":return e=t.data,e===Pf&&Mf?null:e;default:return null}}function F1(e,t){if(_i)return e==="compositionend"||!qu&&Up(e,t)?(e=Fp(),oa=Vu=Er=null,_i=!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 Op&&t.locale!=="ko"?null:t.data;default:return null}}var O1={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 Rf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!O1[e.type]:t==="textarea"}function Hp(e,t,n,r){kp(r),t=Ea(t,"onChange"),0<t.length&&(n=new Wu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var $s=null,rl=null;function U1(e){eg(e,0)}function so(e){var t=zi(e);if(mp(t))return e}function B1(e,t){if(e==="change")return t}var Vp=!1;if(Jn){var Ro;if(Jn){var $o="oninput"in document;if(!$o){var $f=document.createElement("div");$f.setAttribute("oninput","return;"),$o=typeof $f.oninput=="function"}Ro=$o}else Ro=!1;Vp=Ro&&(!document.documentMode||9<document.documentMode)}function Ff(){$s&&($s.detachEvent("onpropertychange",Wp),rl=$s=null)}function Wp(e){if(e.propertyName==="value"&&so(rl)){var t=[];Hp(t,rl,e,Fu(e)),Sp(U1,t)}}function H1(e,t,n){e==="focusin"?(Ff(),$s=t,rl=n,$s.attachEvent("onpropertychange",Wp)):e==="focusout"&&Ff()}function V1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return so(rl)}function W1(e,t){if(e==="click")return so(t)}function G1(e,t){if(e==="input"||e==="change")return so(t)}function q1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var In=typeof Object.is=="function"?Object.is:q1;function il(e,t){if(In(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!vc.call(t,i)||!In(e[i],t[i]))return!1}return!0}function Of(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Uf(e,t){var n=Of(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Of(n)}}function Gp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qp(){for(var e=window,t=wa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wa(e.document)}return t}function Qu(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 Q1(e){var t=qp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gp(n.ownerDocument.documentElement,n)){if(r!==null&&Qu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=Uf(n,l);var a=Uf(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var K1=Jn&&"documentMode"in document&&11>=document.documentMode,Ei=null,$c=null,Fs=null,Fc=!1;function Bf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fc||Ei==null||Ei!==wa(r)||(r=Ei,"selectionStart"in r&&Qu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fs&&il(Fs,r)||(Fs=r,r=Ea($c,"onSelect"),0<r.length&&(t=new Wu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ei)))}function Bl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ti={animationend:Bl("Animation","AnimationEnd"),animationiteration:Bl("Animation","AnimationIteration"),animationstart:Bl("Animation","AnimationStart"),transitionend:Bl("Transition","TransitionEnd")},Fo={},Qp={};Jn&&(Qp=document.createElement("div").style,"AnimationEvent"in window||(delete Ti.animationend.animation,delete Ti.animationiteration.animation,delete Ti.animationstart.animation),"TransitionEvent"in window||delete Ti.transitionend.transition);function lo(e){if(Fo[e])return Fo[e];if(!Ti[e])return e;var t=Ti[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qp)return Fo[e]=t[n];return e}var Kp=lo("animationend"),Yp=lo("animationiteration"),Xp=lo("animationstart"),Jp=lo("transitionend"),Zp=new Map,Hf="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 Or(e,t){Zp.set(e,t),di(t,[e])}for(var Oo=0;Oo<Hf.length;Oo++){var Uo=Hf[Oo],Y1=Uo.toLowerCase(),X1=Uo[0].toUpperCase()+Uo.slice(1);Or(Y1,"on"+X1)}Or(Kp,"onAnimationEnd");Or(Yp,"onAnimationIteration");Or(Xp,"onAnimationStart");Or("dblclick","onDoubleClick");Or("focusin","onFocus");Or("focusout","onBlur");Or(Jp,"onTransitionEnd");qi("onMouseEnter",["mouseout","mouseover"]);qi("onMouseLeave",["mouseout","mouseover"]);qi("onPointerEnter",["pointerout","pointerover"]);qi("onPointerLeave",["pointerout","pointerover"]);di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));di("onBeforeInput",["compositionend","keypress","textInput","paste"]);di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ds="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(" "),J1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ds));function Vf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Yv(r,t,void 0,e),e.currentTarget=null}function eg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==l&&i.isPropagationStopped())break e;Vf(i,o,u),l=c}else for(a=0;a<r.length;a++){if(o=r[a],c=o.instance,u=o.currentTarget,o=o.listener,c!==l&&i.isPropagationStopped())break e;Vf(i,o,u),l=c}}}if(ja)throw e=Ac,ja=!1,Ac=null,e}function Ve(e,t){var n=t[Vc];n===void 0&&(n=t[Vc]=new Set);var r=e+"__bubble";n.has(r)||(tg(t,e,2,!1),n.add(r))}function Bo(e,t,n){var r=0;t&&(r|=4),tg(n,e,r,t)}var Hl="_reactListening"+Math.random().toString(36).slice(2);function sl(e){if(!e[Hl]){e[Hl]=!0,op.forEach(function(n){n!=="selectionchange"&&(J1.has(n)||Bo(n,!1,e),Bo(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hl]||(t[Hl]=!0,Bo("selectionchange",!1,t))}}function tg(e,t,n,r){switch($p(t)){case 1:var i=f1;break;case 4:i=m1;break;default:i=Hu}n=i.bind(null,t,n,e),i=void 0,!Dc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ho(e,t,n,r,i){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;a=a.return}for(;o!==null;){if(a=Kr(o),a===null)return;if(c=a.tag,c===5||c===6){r=l=a;continue e}o=o.parentNode}}r=r.return}Sp(function(){var u=l,d=Fu(n),f=[];e:{var h=Zp.get(e);if(h!==void 0){var m=Wu,g=e;switch(e){case"keypress":if(ca(n)===0)break e;case"keydown":case"keyup":m=E1;break;case"focusin":g="focus",m=Mo;break;case"focusout":g="blur",m=Mo;break;case"beforeblur":case"afterblur":m=Mo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=If;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=g1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=L1;break;case Kp:case Yp:case Xp:m=v1;break;case Jp:m=D1;break;case"scroll":m=h1;break;case"wheel":m=P1;break;case"copy":case"cut":case"paste":m=w1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Af}var v=(t&4)!==0,w=!v&&e==="scroll",x=v?h!==null?h+"Capture":null:h;v=[];for(var k=u,j;k!==null;){j=k;var z=j.stateNode;if(j.tag===5&&z!==null&&(j=z,x!==null&&(z=Zs(k,x),z!=null&&v.push(ll(k,z,j)))),w)break;k=k.return}0<v.length&&(h=new m(h,g,null,n,d),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Lc&&(g=n.relatedTarget||n.fromElement)&&(Kr(g)||g[Zn]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?Kr(g):null,g!==null&&(w=fi(g),g!==w||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(v=If,z="onMouseLeave",x="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(v=Af,z="onPointerLeave",x="onPointerEnter",k="pointer"),w=m==null?h:zi(m),j=g==null?h:zi(g),h=new v(z,k+"leave",m,n,d),h.target=w,h.relatedTarget=j,z=null,Kr(d)===u&&(v=new v(x,k+"enter",g,n,d),v.target=j,v.relatedTarget=w,z=v),w=z,m&&g)t:{for(v=m,x=g,k=0,j=v;j;j=yi(j))k++;for(j=0,z=x;z;z=yi(z))j++;for(;0<k-j;)v=yi(v),k--;for(;0<j-k;)x=yi(x),j--;for(;k--;){if(v===x||x!==null&&v===x.alternate)break t;v=yi(v),x=yi(x)}v=null}else v=null;m!==null&&Wf(f,h,m,v,!1),g!==null&&w!==null&&Wf(f,w,g,v,!0)}}e:{if(h=u?zi(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var A=B1;else if(Rf(h))if(Vp)A=G1;else{A=V1;var _=H1}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(A=W1);if(A&&(A=A(e,u))){Hp(f,A,n,d);break e}_&&_(e,h,u),e==="focusout"&&(_=h._wrapperState)&&_.controlled&&h.type==="number"&&Cc(h,"number",h.value)}switch(_=u?zi(u):window,e){case"focusin":(Rf(_)||_.contentEditable==="true")&&(Ei=_,$c=u,Fs=null);break;case"focusout":Fs=$c=Ei=null;break;case"mousedown":Fc=!0;break;case"contextmenu":case"mouseup":case"dragend":Fc=!1,Bf(f,n,d);break;case"selectionchange":if(K1)break;case"keydown":case"keyup":Bf(f,n,d)}var D;if(qu)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else _i?Up(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Op&&n.locale!=="ko"&&(_i||C!=="onCompositionStart"?C==="onCompositionEnd"&&_i&&(D=Fp()):(Er=d,Vu="value"in Er?Er.value:Er.textContent,_i=!0)),_=Ea(u,C),0<_.length&&(C=new Df(C,e,null,n,d),f.push({event:C,listeners:_}),D?C.data=D:(D=Bp(n),D!==null&&(C.data=D)))),(D=R1?$1(e,n):F1(e,n))&&(u=Ea(u,"onBeforeInput"),0<u.length&&(d=new Df("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=D))}eg(f,t)})}function ll(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ea(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,l=i.stateNode;i.tag===5&&l!==null&&(i=l,l=Zs(e,n),l!=null&&r.unshift(ll(e,l,i)),l=Zs(e,t),l!=null&&r.push(ll(e,l,i))),e=e.return}return r}function yi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Wf(e,t,n,r,i){for(var l=t._reactName,a=[];n!==null&&n!==r;){var o=n,c=o.alternate,u=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&u!==null&&(o=u,i?(c=Zs(n,l),c!=null&&a.unshift(ll(n,c,o))):i||(c=Zs(n,l),c!=null&&a.push(ll(n,c,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var Z1=/\r\n?/g,ek=/\u0000|\uFFFD/g;function Gf(e){return(typeof e=="string"?e:""+e).replace(Z1,`
|
|
38
|
-
`).replace(ek,"")}function Vl(e,t,n){if(t=Gf(t),Gf(e)!==t&&n)throw Error(W(425))}function Ta(){}var Oc=null,Uc=null;function Bc(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 Hc=typeof setTimeout=="function"?setTimeout:void 0,tk=typeof clearTimeout=="function"?clearTimeout:void 0,qf=typeof Promise=="function"?Promise:void 0,nk=typeof queueMicrotask=="function"?queueMicrotask:typeof qf<"u"?function(e){return qf.resolve(null).then(e).catch(rk)}:Hc;function rk(e){setTimeout(function(){throw e})}function Vo(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),nl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);nl(t)}function Dr(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 Qf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var is=Math.random().toString(36).slice(2),Rn="__reactFiber$"+is,al="__reactProps$"+is,Zn="__reactContainer$"+is,Vc="__reactEvents$"+is,ik="__reactListeners$"+is,sk="__reactHandles$"+is;function Kr(e){var t=e[Rn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Zn]||n[Rn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qf(e);e!==null;){if(n=e[Rn])return n;e=Qf(e)}return t}e=n,n=e.parentNode}return null}function wl(e){return e=e[Rn]||e[Zn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function zi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function ao(e){return e[al]||null}var Wc=[],Li=-1;function Ur(e){return{current:e}}function We(e){0>Li||(e.current=Wc[Li],Wc[Li]=null,Li--)}function Be(e,t){Li++,Wc[Li]=e.current,e.current=t}var Fr={},Dt=Ur(Fr),qt=Ur(!1),ti=Fr;function Qi(e,t){var n=e.type.contextTypes;if(!n)return Fr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Qt(e){return e=e.childContextTypes,e!=null}function za(){We(qt),We(Dt)}function Kf(e,t,n){if(Dt.current!==Fr)throw Error(W(168));Be(Dt,t),Be(qt,n)}function ng(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(W(108,Hv(e)||"Unknown",i));return Xe({},n,r)}function La(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Fr,ti=Dt.current,Be(Dt,e),Be(qt,qt.current),!0}function Yf(e,t,n){var r=e.stateNode;if(!r)throw Error(W(169));n?(e=ng(e,t,ti),r.__reactInternalMemoizedMergedChildContext=e,We(qt),We(Dt),Be(Dt,e)):We(qt),Be(qt,n)}var qn=null,oo=!1,Wo=!1;function rg(e){qn===null?qn=[e]:qn.push(e)}function lk(e){oo=!0,rg(e)}function Br(){if(!Wo&&qn!==null){Wo=!0;var e=0,t=Re;try{var n=qn;for(Re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}qn=null,oo=!1}catch(i){throw qn!==null&&(qn=qn.slice(e+1)),Ep(Ou,Br),i}finally{Re=t,Wo=!1}}return null}var Ii=[],Di=0,Ia=null,Da=0,un=[],dn=0,ni=null,Qn=1,Kn="";function Gr(e,t){Ii[Di++]=Da,Ii[Di++]=Ia,Ia=e,Da=t}function ig(e,t,n){un[dn++]=Qn,un[dn++]=Kn,un[dn++]=ni,ni=e;var r=Qn;e=Kn;var i=32-Tn(r)-1;r&=~(1<<i),n+=1;var l=32-Tn(t)+i;if(30<l){var a=i-i%5;l=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Qn=1<<32-Tn(t)+i|n<<i|r,Kn=l+e}else Qn=1<<l|n<<i|r,Kn=e}function Ku(e){e.return!==null&&(Gr(e,1),ig(e,1,0))}function Yu(e){for(;e===Ia;)Ia=Ii[--Di],Ii[Di]=null,Da=Ii[--Di],Ii[Di]=null;for(;e===ni;)ni=un[--dn],un[dn]=null,Kn=un[--dn],un[dn]=null,Qn=un[--dn],un[dn]=null}var rn=null,nn=null,Qe=!1,En=null;function sg(e,t){var n=mn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Xf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,rn=e,nn=Dr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,rn=e,nn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ni!==null?{id:Qn,overflow:Kn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=mn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,rn=e,nn=null,!0):!1;default:return!1}}function Gc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function qc(e){if(Qe){var t=nn;if(t){var n=t;if(!Xf(e,t)){if(Gc(e))throw Error(W(418));t=Dr(n.nextSibling);var r=rn;t&&Xf(e,t)?sg(r,n):(e.flags=e.flags&-4097|2,Qe=!1,rn=e)}}else{if(Gc(e))throw Error(W(418));e.flags=e.flags&-4097|2,Qe=!1,rn=e}}}function Jf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rn=e}function Wl(e){if(e!==rn)return!1;if(!Qe)return Jf(e),Qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Bc(e.type,e.memoizedProps)),t&&(t=nn)){if(Gc(e))throw lg(),Error(W(418));for(;t;)sg(e,t),t=Dr(t.nextSibling)}if(Jf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){nn=Dr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}nn=null}}else nn=rn?Dr(e.stateNode.nextSibling):null;return!0}function lg(){for(var e=nn;e;)e=Dr(e.nextSibling)}function Ki(){nn=rn=null,Qe=!1}function Xu(e){En===null?En=[e]:En.push(e)}var ak=rr.ReactCurrentBatchConfig;function js(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(W(309));var r=n.stateNode}if(!r)throw Error(W(147,e));var i=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(a){var o=i.refs;a===null?delete o[l]:o[l]=a},t._stringRef=l,t)}if(typeof e!="string")throw Error(W(284));if(!n._owner)throw Error(W(290,e))}return e}function Gl(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Zf(e){var t=e._init;return t(e._payload)}function ag(e){function t(x,k){if(e){var j=x.deletions;j===null?(x.deletions=[k],x.flags|=16):j.push(k)}}function n(x,k){if(!e)return null;for(;k!==null;)t(x,k),k=k.sibling;return null}function r(x,k){for(x=new Map;k!==null;)k.key!==null?x.set(k.key,k):x.set(k.index,k),k=k.sibling;return x}function i(x,k){return x=Rr(x,k),x.index=0,x.sibling=null,x}function l(x,k,j){return x.index=j,e?(j=x.alternate,j!==null?(j=j.index,j<k?(x.flags|=2,k):j):(x.flags|=2,k)):(x.flags|=1048576,k)}function a(x){return e&&x.alternate===null&&(x.flags|=2),x}function o(x,k,j,z){return k===null||k.tag!==6?(k=Jo(j,x.mode,z),k.return=x,k):(k=i(k,j),k.return=x,k)}function c(x,k,j,z){var A=j.type;return A===Ci?d(x,k,j.props.children,z,j.key):k!==null&&(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Sr&&Zf(A)===k.type)?(z=i(k,j.props),z.ref=js(x,k,j),z.return=x,z):(z=ga(j.type,j.key,j.props,null,x.mode,z),z.ref=js(x,k,j),z.return=x,z)}function u(x,k,j,z){return k===null||k.tag!==4||k.stateNode.containerInfo!==j.containerInfo||k.stateNode.implementation!==j.implementation?(k=Zo(j,x.mode,z),k.return=x,k):(k=i(k,j.children||[]),k.return=x,k)}function d(x,k,j,z,A){return k===null||k.tag!==7?(k=ei(j,x.mode,z,A),k.return=x,k):(k=i(k,j),k.return=x,k)}function f(x,k,j){if(typeof k=="string"&&k!==""||typeof k=="number")return k=Jo(""+k,x.mode,j),k.return=x,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Pl:return j=ga(k.type,k.key,k.props,null,x.mode,j),j.ref=js(x,null,k),j.return=x,j;case Ni:return k=Zo(k,x.mode,j),k.return=x,k;case Sr:var z=k._init;return f(x,z(k._payload),j)}if(Ls(k)||xs(k))return k=ei(k,x.mode,j,null),k.return=x,k;Gl(x,k)}return null}function h(x,k,j,z){var A=k!==null?k.key:null;if(typeof j=="string"&&j!==""||typeof j=="number")return A!==null?null:o(x,k,""+j,z);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Pl:return j.key===A?c(x,k,j,z):null;case Ni:return j.key===A?u(x,k,j,z):null;case Sr:return A=j._init,h(x,k,A(j._payload),z)}if(Ls(j)||xs(j))return A!==null?null:d(x,k,j,z,null);Gl(x,j)}return null}function m(x,k,j,z,A){if(typeof z=="string"&&z!==""||typeof z=="number")return x=x.get(j)||null,o(k,x,""+z,A);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case Pl:return x=x.get(z.key===null?j:z.key)||null,c(k,x,z,A);case Ni:return x=x.get(z.key===null?j:z.key)||null,u(k,x,z,A);case Sr:var _=z._init;return m(x,k,j,_(z._payload),A)}if(Ls(z)||xs(z))return x=x.get(j)||null,d(k,x,z,A,null);Gl(k,z)}return null}function g(x,k,j,z){for(var A=null,_=null,D=k,C=k=0,M=null;D!==null&&C<j.length;C++){D.index>C?(M=D,D=null):M=D.sibling;var N=h(x,D,j[C],z);if(N===null){D===null&&(D=M);break}e&&D&&N.alternate===null&&t(x,D),k=l(N,k,C),_===null?A=N:_.sibling=N,_=N,D=M}if(C===j.length)return n(x,D),Qe&&Gr(x,C),A;if(D===null){for(;C<j.length;C++)D=f(x,j[C],z),D!==null&&(k=l(D,k,C),_===null?A=D:_.sibling=D,_=D);return Qe&&Gr(x,C),A}for(D=r(x,D);C<j.length;C++)M=m(D,x,C,j[C],z),M!==null&&(e&&M.alternate!==null&&D.delete(M.key===null?C:M.key),k=l(M,k,C),_===null?A=M:_.sibling=M,_=M);return e&&D.forEach(function(U){return t(x,U)}),Qe&&Gr(x,C),A}function v(x,k,j,z){var A=xs(j);if(typeof A!="function")throw Error(W(150));if(j=A.call(j),j==null)throw Error(W(151));for(var _=A=null,D=k,C=k=0,M=null,N=j.next();D!==null&&!N.done;C++,N=j.next()){D.index>C?(M=D,D=null):M=D.sibling;var U=h(x,D,N.value,z);if(U===null){D===null&&(D=M);break}e&&D&&U.alternate===null&&t(x,D),k=l(U,k,C),_===null?A=U:_.sibling=U,_=U,D=M}if(N.done)return n(x,D),Qe&&Gr(x,C),A;if(D===null){for(;!N.done;C++,N=j.next())N=f(x,N.value,z),N!==null&&(k=l(N,k,C),_===null?A=N:_.sibling=N,_=N);return Qe&&Gr(x,C),A}for(D=r(x,D);!N.done;C++,N=j.next())N=m(D,x,C,N.value,z),N!==null&&(e&&N.alternate!==null&&D.delete(N.key===null?C:N.key),k=l(N,k,C),_===null?A=N:_.sibling=N,_=N);return e&&D.forEach(function(O){return t(x,O)}),Qe&&Gr(x,C),A}function w(x,k,j,z){if(typeof j=="object"&&j!==null&&j.type===Ci&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case Pl:e:{for(var A=j.key,_=k;_!==null;){if(_.key===A){if(A=j.type,A===Ci){if(_.tag===7){n(x,_.sibling),k=i(_,j.props.children),k.return=x,x=k;break e}}else if(_.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Sr&&Zf(A)===_.type){n(x,_.sibling),k=i(_,j.props),k.ref=js(x,_,j),k.return=x,x=k;break e}n(x,_);break}else t(x,_);_=_.sibling}j.type===Ci?(k=ei(j.props.children,x.mode,z,j.key),k.return=x,x=k):(z=ga(j.type,j.key,j.props,null,x.mode,z),z.ref=js(x,k,j),z.return=x,x=z)}return a(x);case Ni:e:{for(_=j.key;k!==null;){if(k.key===_)if(k.tag===4&&k.stateNode.containerInfo===j.containerInfo&&k.stateNode.implementation===j.implementation){n(x,k.sibling),k=i(k,j.children||[]),k.return=x,x=k;break e}else{n(x,k);break}else t(x,k);k=k.sibling}k=Zo(j,x.mode,z),k.return=x,x=k}return a(x);case Sr:return _=j._init,w(x,k,_(j._payload),z)}if(Ls(j))return g(x,k,j,z);if(xs(j))return v(x,k,j,z);Gl(x,j)}return typeof j=="string"&&j!==""||typeof j=="number"?(j=""+j,k!==null&&k.tag===6?(n(x,k.sibling),k=i(k,j),k.return=x,x=k):(n(x,k),k=Jo(j,x.mode,z),k.return=x,x=k),a(x)):n(x,k)}return w}var Yi=ag(!0),og=ag(!1),Aa=Ur(null),Pa=null,Ai=null,Ju=null;function Zu(){Ju=Ai=Pa=null}function ed(e){var t=Aa.current;We(Aa),e._currentValue=t}function Qc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Bi(e,t){Pa=e,Ju=Ai=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Gt=!0),e.firstContext=null)}function gn(e){var t=e._currentValue;if(Ju!==e)if(e={context:e,memoizedValue:t,next:null},Ai===null){if(Pa===null)throw Error(W(308));Ai=e,Pa.dependencies={lanes:0,firstContext:e}}else Ai=Ai.next=e;return t}var Yr=null;function td(e){Yr===null?Yr=[e]:Yr.push(e)}function cg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,td(t)):(n.next=i.next,i.next=n),t.interleaved=n,er(e,r)}function er(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Nr=!1;function nd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ug(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 Xn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ar(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Le&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,er(e,n)}return i=r.interleaved,i===null?(t.next=t,td(r)):(t.next=i.next,i.next=t),r.interleaved=t,er(e,n)}function ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Uu(e,n)}}function em(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?i=l=a:l=l.next=a,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ma(e,t,n,r){var i=e.updateQueue;Nr=!1;var l=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?l=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(l!==null){var f=i.baseState;a=0,d=u=c=null,o=l;do{var h=o.lane,m=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=e,v=o;switch(h=t,m=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(m,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,h=typeof g=="function"?g.call(m,f,h):g,h==null)break e;f=Xe({},f,h);break e;case 2:Nr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else m={eventTime:m,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);ii|=a,e.lanes=a,e.memoizedState=f}}function tm(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(W(191,i));i.call(r)}}}var bl={},Un=Ur(bl),ol=Ur(bl),cl=Ur(bl);function Xr(e){if(e===bl)throw Error(W(174));return e}function rd(e,t){switch(Be(cl,t),Be(ol,e),Be(Un,bl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ec(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ec(t,e)}We(Un),Be(Un,t)}function Xi(){We(Un),We(ol),We(cl)}function dg(e){Xr(cl.current);var t=Xr(Un.current),n=Ec(t,e.type);t!==n&&(Be(ol,e),Be(Un,n))}function id(e){ol.current===e&&(We(Un),We(ol))}var Ke=Ur(0);function Ra(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Go=[];function sd(){for(var e=0;e<Go.length;e++)Go[e]._workInProgressVersionPrimary=null;Go.length=0}var da=rr.ReactCurrentDispatcher,qo=rr.ReactCurrentBatchConfig,ri=0,Ye=null,ft=null,xt=null,$a=!1,Os=!1,ul=0,ok=0;function Tt(){throw Error(W(321))}function ld(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!In(e[n],t[n]))return!1;return!0}function ad(e,t,n,r,i,l){if(ri=l,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,da.current=e===null||e.memoizedState===null?fk:mk,e=n(r,i),Os){l=0;do{if(Os=!1,ul=0,25<=l)throw Error(W(301));l+=1,xt=ft=null,t.updateQueue=null,da.current=hk,e=n(r,i)}while(Os)}if(da.current=Fa,t=ft!==null&&ft.next!==null,ri=0,xt=ft=Ye=null,$a=!1,t)throw Error(W(300));return e}function od(){var e=ul!==0;return ul=0,e}function Pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?Ye.memoizedState=xt=e:xt=xt.next=e,xt}function yn(){if(ft===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=xt===null?Ye.memoizedState:xt.next;if(t!==null)xt=t,ft=e;else{if(e===null)throw Error(W(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},xt===null?Ye.memoizedState=xt=e:xt=xt.next=e}return xt}function dl(e,t){return typeof t=="function"?t(e):t}function Qo(e){var t=yn(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=ft,i=r.baseQueue,l=n.pending;if(l!==null){if(i!==null){var a=i.next;i.next=l.next,l.next=a}r.baseQueue=i=l,n.pending=null}if(i!==null){l=i.next,r=r.baseState;var o=a=null,c=null,u=l;do{var d=u.lane;if((ri&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=f,a=r):c=c.next=f,Ye.lanes|=d,ii|=d}u=u.next}while(u!==null&&u!==l);c===null?a=r:c.next=o,In(r,t.memoizedState)||(Gt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do l=i.lane,Ye.lanes|=l,ii|=l,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ko(e){var t=yn(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,l=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do l=e(l,a.action),a=a.next;while(a!==i);In(l,t.memoizedState)||(Gt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function fg(){}function mg(e,t){var n=Ye,r=yn(),i=t(),l=!In(r.memoizedState,i);if(l&&(r.memoizedState=i,Gt=!0),r=r.queue,cd(gg.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||xt!==null&&xt.memoizedState.tag&1){if(n.flags|=2048,fl(9,pg.bind(null,n,r,i,t),void 0,null),vt===null)throw Error(W(349));ri&30||hg(n,t,i)}return i}function hg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function pg(e,t,n,r){t.value=n,t.getSnapshot=r,yg(t)&&xg(e)}function gg(e,t,n){return n(function(){yg(t)&&xg(e)})}function yg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!In(e,n)}catch{return!0}}function xg(e){var t=er(e,1);t!==null&&zn(t,e,1,-1)}function nm(e){var t=Pn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:dl,lastRenderedState:e},t.queue=e,e=e.dispatch=dk.bind(null,Ye,e),[t.memoizedState,e]}function fl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function vg(){return yn().memoizedState}function fa(e,t,n,r){var i=Pn();Ye.flags|=e,i.memoizedState=fl(1|t,n,void 0,r===void 0?null:r)}function co(e,t,n,r){var i=yn();r=r===void 0?null:r;var l=void 0;if(ft!==null){var a=ft.memoizedState;if(l=a.destroy,r!==null&&ld(r,a.deps)){i.memoizedState=fl(t,n,l,r);return}}Ye.flags|=e,i.memoizedState=fl(1|t,n,l,r)}function rm(e,t){return fa(8390656,8,e,t)}function cd(e,t){return co(2048,8,e,t)}function kg(e,t){return co(4,2,e,t)}function wg(e,t){return co(4,4,e,t)}function bg(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 jg(e,t,n){return n=n!=null?n.concat([e]):null,co(4,4,bg.bind(null,t,e),n)}function ud(){}function Sg(e,t){var n=yn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ld(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ng(e,t){var n=yn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ld(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Cg(e,t,n){return ri&21?(In(n,t)||(n=Lp(),Ye.lanes|=n,ii|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gt=!0),e.memoizedState=n)}function ck(e,t){var n=Re;Re=n!==0&&4>n?n:4,e(!0);var r=qo.transition;qo.transition={};try{e(!1),t()}finally{Re=n,qo.transition=r}}function _g(){return yn().memoizedState}function uk(e,t,n){var r=Mr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Eg(e))Tg(t,n);else if(n=cg(e,t,n,r),n!==null){var i=Ot();zn(n,e,r,i),zg(n,t,r)}}function dk(e,t,n){var r=Mr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Eg(e))Tg(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var a=t.lastRenderedState,o=l(a,n);if(i.hasEagerState=!0,i.eagerState=o,In(o,a)){var c=t.interleaved;c===null?(i.next=i,td(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=cg(e,t,i,r),n!==null&&(i=Ot(),zn(n,e,r,i),zg(n,t,r))}}function Eg(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function Tg(e,t){Os=$a=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Uu(e,n)}}var Fa={readContext:gn,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useInsertionEffect:Tt,useLayoutEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useMutableSource:Tt,useSyncExternalStore:Tt,useId:Tt,unstable_isNewReconciler:!1},fk={readContext:gn,useCallback:function(e,t){return Pn().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:rm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fa(4194308,4,bg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fa(4194308,4,e,t)},useInsertionEffect:function(e,t){return fa(4,2,e,t)},useMemo:function(e,t){var n=Pn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Pn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=uk.bind(null,Ye,e),[r.memoizedState,e]},useRef:function(e){var t=Pn();return e={current:e},t.memoizedState=e},useState:nm,useDebugValue:ud,useDeferredValue:function(e){return Pn().memoizedState=e},useTransition:function(){var e=nm(!1),t=e[0];return e=ck.bind(null,e[1]),Pn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ye,i=Pn();if(Qe){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),vt===null)throw Error(W(349));ri&30||hg(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,rm(gg.bind(null,r,l,e),[e]),r.flags|=2048,fl(9,pg.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Pn(),t=vt.identifierPrefix;if(Qe){var n=Kn,r=Qn;n=(r&~(1<<32-Tn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ul++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ok++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},mk={readContext:gn,useCallback:Sg,useContext:gn,useEffect:cd,useImperativeHandle:jg,useInsertionEffect:kg,useLayoutEffect:wg,useMemo:Ng,useReducer:Qo,useRef:vg,useState:function(){return Qo(dl)},useDebugValue:ud,useDeferredValue:function(e){var t=yn();return Cg(t,ft.memoizedState,e)},useTransition:function(){var e=Qo(dl)[0],t=yn().memoizedState;return[e,t]},useMutableSource:fg,useSyncExternalStore:mg,useId:_g,unstable_isNewReconciler:!1},hk={readContext:gn,useCallback:Sg,useContext:gn,useEffect:cd,useImperativeHandle:jg,useInsertionEffect:kg,useLayoutEffect:wg,useMemo:Ng,useReducer:Ko,useRef:vg,useState:function(){return Ko(dl)},useDebugValue:ud,useDeferredValue:function(e){var t=yn();return ft===null?t.memoizedState=e:Cg(t,ft.memoizedState,e)},useTransition:function(){var e=Ko(dl)[0],t=yn().memoizedState;return[e,t]},useMutableSource:fg,useSyncExternalStore:mg,useId:_g,unstable_isNewReconciler:!1};function Cn(e,t){if(e&&e.defaultProps){t=Xe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Kc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Xe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var uo={isMounted:function(e){return(e=e._reactInternals)?fi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ot(),i=Mr(e),l=Xn(r,i);l.payload=t,n!=null&&(l.callback=n),t=Ar(e,l,i),t!==null&&(zn(t,e,i,r),ua(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ot(),i=Mr(e),l=Xn(r,i);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=Ar(e,l,i),t!==null&&(zn(t,e,i,r),ua(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ot(),r=Mr(e),i=Xn(n,r);i.tag=2,t!=null&&(i.callback=t),t=Ar(e,i,r),t!==null&&(zn(t,e,r,n),ua(t,e,r))}};function im(e,t,n,r,i,l,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,a):t.prototype&&t.prototype.isPureReactComponent?!il(n,r)||!il(i,l):!0}function Lg(e,t,n){var r=!1,i=Fr,l=t.contextType;return typeof l=="object"&&l!==null?l=gn(l):(i=Qt(t)?ti:Dt.current,r=t.contextTypes,l=(r=r!=null)?Qi(e,i):Fr),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=uo,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=l),t}function sm(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&uo.enqueueReplaceState(t,t.state,null)}function Yc(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},nd(e);var l=t.contextType;typeof l=="object"&&l!==null?i.context=gn(l):(l=Qt(t)?ti:Dt.current,i.context=Qi(e,l)),i.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(Kc(e,t,l,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&uo.enqueueReplaceState(i,i.state,null),Ma(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Ji(e,t){try{var n="",r=t;do n+=Bv(r),r=r.return;while(r);var i=n}catch(l){i=`
|
|
39
|
-
Error generating stack: `+l.message+`
|
|
40
|
-
`+l.stack}return{value:e,source:t,stack:i,digest:null}}function Yo(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var pk=typeof WeakMap=="function"?WeakMap:Map;function Ig(e,t,n){n=Xn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ua||(Ua=!0,au=r),Xc(e,t)},n}function Dg(e,t,n){n=Xn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Xc(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Xc(e,t),typeof r!="function"&&(Pr===null?Pr=new Set([this]):Pr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function lm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new pk;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Tk.bind(null,e,t,n),t.then(e,e))}function am(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 om(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Xn(-1,1),t.tag=2,Ar(n,t,1))),n.lanes|=1),e)}var gk=rr.ReactCurrentOwner,Gt=!1;function $t(e,t,n,r){t.child=e===null?og(t,null,n,r):Yi(t,e.child,n,r)}function cm(e,t,n,r,i){n=n.render;var l=t.ref;return Bi(t,i),r=ad(e,t,n,r,l,i),n=od(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,tr(e,t,i)):(Qe&&n&&Ku(t),t.flags|=1,$t(e,t,r,i),t.child)}function um(e,t,n,r,i){if(e===null){var l=n.type;return typeof l=="function"&&!xd(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Ag(e,t,l,r,i)):(e=ga(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&i)){var a=l.memoizedProps;if(n=n.compare,n=n!==null?n:il,n(a,r)&&e.ref===t.ref)return tr(e,t,i)}return t.flags|=1,e=Rr(l,r),e.ref=t.ref,e.return=t,t.child=e}function Ag(e,t,n,r,i){if(e!==null){var l=e.memoizedProps;if(il(l,r)&&e.ref===t.ref)if(Gt=!1,t.pendingProps=r=l,(e.lanes&i)!==0)e.flags&131072&&(Gt=!0);else return t.lanes=e.lanes,tr(e,t,i)}return Jc(e,t,n,r,i)}function Pg(e,t,n){var r=t.pendingProps,i=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Be(Mi,tn),tn|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Be(Mi,tn),tn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,Be(Mi,tn),tn|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,Be(Mi,tn),tn|=r;return $t(e,t,i,n),t.child}function Mg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Jc(e,t,n,r,i){var l=Qt(n)?ti:Dt.current;return l=Qi(t,l),Bi(t,i),n=ad(e,t,n,r,l,i),r=od(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,tr(e,t,i)):(Qe&&r&&Ku(t),t.flags|=1,$t(e,t,n,i),t.child)}function dm(e,t,n,r,i){if(Qt(n)){var l=!0;La(t)}else l=!1;if(Bi(t,i),t.stateNode===null)ma(e,t),Lg(t,n,r),Yc(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=gn(u):(u=Qt(n)?ti:Dt.current,u=Qi(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||c!==u)&&sm(t,a,r,u),Nr=!1;var h=t.memoizedState;a.state=h,Ma(t,r,a,i),c=t.memoizedState,o!==r||h!==c||qt.current||Nr?(typeof d=="function"&&(Kc(t,n,d,r),c=t.memoizedState),(o=Nr||im(t,n,o,r,h,c,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ug(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:Cn(t.type,o),a.props=u,f=t.pendingProps,h=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=gn(c):(c=Qt(n)?ti:Dt.current,c=Qi(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||h!==c)&&sm(t,a,r,c),Nr=!1,h=t.memoizedState,a.state=h,Ma(t,r,a,i);var g=t.memoizedState;o!==f||h!==g||qt.current||Nr?(typeof m=="function"&&(Kc(t,n,m,r),g=t.memoizedState),(u=Nr||im(t,n,u,r,h,g,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,g,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,g,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),a.props=r,a.state=g,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Zc(e,t,n,r,l,i)}function Zc(e,t,n,r,i,l){Mg(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&Yf(t,n,!1),tr(e,t,l);r=t.stateNode,gk.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Yi(t,e.child,null,l),t.child=Yi(t,null,o,l)):$t(e,t,o,l),t.memoizedState=r.state,i&&Yf(t,n,!0),t.child}function Rg(e){var t=e.stateNode;t.pendingContext?Kf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Kf(e,t.context,!1),rd(e,t.containerInfo)}function fm(e,t,n,r,i){return Ki(),Xu(i),t.flags|=256,$t(e,t,n,r),t.child}var eu={dehydrated:null,treeContext:null,retryLane:0};function tu(e){return{baseLanes:e,cachePool:null,transitions:null}}function $g(e,t,n){var r=t.pendingProps,i=Ke.current,l=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Be(Ke,i&1),e===null)return qc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,l?(r=t.mode,l=t.child,a={mode:"hidden",children:a},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=a):l=ho(a,r,0,null),e=ei(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=tu(n),t.memoizedState=eu,e):dd(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return yk(e,t,a,r,o,i,n);if(l){l=r.fallback,a=t.mode,i=e.child,o=i.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Rr(i,c),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?l=Rr(o,l):(l=ei(l,a,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,a=e.child.memoizedState,a=a===null?tu(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},l.memoizedState=a,l.childLanes=e.childLanes&~n,t.memoizedState=eu,r}return l=e.child,e=l.sibling,r=Rr(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function dd(e,t){return t=ho({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ql(e,t,n,r){return r!==null&&Xu(r),Yi(t,e.child,null,n),e=dd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yk(e,t,n,r,i,l,a){if(n)return t.flags&256?(t.flags&=-257,r=Yo(Error(W(422))),ql(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,i=t.mode,r=ho({mode:"visible",children:r.children},i,0,null),l=ei(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&Yi(t,e.child,null,a),t.child.memoizedState=tu(a),t.memoizedState=eu,l);if(!(t.mode&1))return ql(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,l=Error(W(419)),r=Yo(l,r,void 0),ql(e,t,a,r)}if(o=(a&e.childLanes)!==0,Gt||o){if(r=vt,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==l.retryLane&&(l.retryLane=i,er(e,i),zn(r,e,i,-1))}return yd(),r=Yo(Error(W(421))),ql(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=zk.bind(null,e),i._reactRetry=t,null):(e=l.treeContext,nn=Dr(i.nextSibling),rn=t,Qe=!0,En=null,e!==null&&(un[dn++]=Qn,un[dn++]=Kn,un[dn++]=ni,Qn=e.id,Kn=e.overflow,ni=t),t=dd(t,r.children),t.flags|=4096,t)}function mm(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qc(e.return,t,n)}function Xo(e,t,n,r,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=i)}function Fg(e,t,n){var r=t.pendingProps,i=r.revealOrder,l=r.tail;if($t(e,t,r.children,n),r=Ke.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mm(e,n,t);else if(e.tag===19)mm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Be(Ke,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ra(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Xo(t,!1,i,n,l);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ra(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Xo(t,!0,n,null,l);break;case"together":Xo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ma(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function tr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ii|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,n=Rr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Rr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xk(e,t,n){switch(t.tag){case 3:Rg(t),Ki();break;case 5:dg(t);break;case 1:Qt(t.type)&&La(t);break;case 4:rd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Be(Aa,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Be(Ke,Ke.current&1),t.flags|=128,null):n&t.child.childLanes?$g(e,t,n):(Be(Ke,Ke.current&1),e=tr(e,t,n),e!==null?e.sibling:null);Be(Ke,Ke.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Fg(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Be(Ke,Ke.current),r)break;return null;case 22:case 23:return t.lanes=0,Pg(e,t,n)}return tr(e,t,n)}var Og,nu,Ug,Bg;Og=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};nu=function(){};Ug=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Xr(Un.current);var l=null;switch(n){case"input":i=Sc(e,i),r=Sc(e,r),l=[];break;case"select":i=Xe({},i,{value:void 0}),r=Xe({},r,{value:void 0}),l=[];break;case"textarea":i=_c(e,i),r=_c(e,r),l=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ta)}Tc(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Xs.hasOwnProperty(u)?l||(l=[]):(l=l||[]).push(u,null));for(u in r){var c=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&o[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(l||(l=[]),l.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(l=l||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(l=l||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Xs.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Ve("scroll",e),l||o===c||(l=[])):(l=l||[]).push(u,c))}n&&(l=l||[]).push("style",n);var u=l;(t.updateQueue=u)&&(t.flags|=4)}};Bg=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ss(e,t){if(!Qe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vk(e,t,n){var r=t.pendingProps;switch(Yu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(t),null;case 1:return Qt(t.type)&&za(),zt(t),null;case 3:return r=t.stateNode,Xi(),We(qt),We(Dt),sd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Wl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,En!==null&&(uu(En),En=null))),nu(e,t),zt(t),null;case 5:id(t);var i=Xr(cl.current);if(n=t.type,e!==null&&t.stateNode!=null)Ug(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(W(166));return zt(t),null}if(e=Xr(Un.current),Wl(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Rn]=t,r[al]=l,e=(t.mode&1)!==0,n){case"dialog":Ve("cancel",r),Ve("close",r);break;case"iframe":case"object":case"embed":Ve("load",r);break;case"video":case"audio":for(i=0;i<Ds.length;i++)Ve(Ds[i],r);break;case"source":Ve("error",r);break;case"img":case"image":case"link":Ve("error",r),Ve("load",r);break;case"details":Ve("toggle",r);break;case"input":bf(r,l),Ve("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},Ve("invalid",r);break;case"textarea":Sf(r,l),Ve("invalid",r)}Tc(n,l),i=null;for(var a in l)if(l.hasOwnProperty(a)){var o=l[a];a==="children"?typeof o=="string"?r.textContent!==o&&(l.suppressHydrationWarning!==!0&&Vl(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(l.suppressHydrationWarning!==!0&&Vl(r.textContent,o,e),i=["children",""+o]):Xs.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Ve("scroll",r)}switch(n){case"input":Ml(r),jf(r,l,!0);break;case"textarea":Ml(r),Nf(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Ta)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=gp(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Rn]=t,e[al]=r,Og(e,t,!1,!1),t.stateNode=e;e:{switch(a=zc(n,r),n){case"dialog":Ve("cancel",e),Ve("close",e),i=r;break;case"iframe":case"object":case"embed":Ve("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ds.length;i++)Ve(Ds[i],e);i=r;break;case"source":Ve("error",e),i=r;break;case"img":case"image":case"link":Ve("error",e),Ve("load",e),i=r;break;case"details":Ve("toggle",e),i=r;break;case"input":bf(e,r),i=Sc(e,r),Ve("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Xe({},r,{value:void 0}),Ve("invalid",e);break;case"textarea":Sf(e,r),i=_c(e,r),Ve("invalid",e);break;default:i=r}Tc(n,i),o=i;for(l in o)if(o.hasOwnProperty(l)){var c=o[l];l==="style"?vp(e,c):l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&yp(e,c)):l==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Js(e,c):typeof c=="number"&&Js(e,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Xs.hasOwnProperty(l)?c!=null&&l==="onScroll"&&Ve("scroll",e):c!=null&&Pu(e,l,c,a))}switch(n){case"input":Ml(e),jf(e,r,!1);break;case"textarea":Ml(e),Nf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+$r(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?$i(e,!!r.multiple,l,!1):r.defaultValue!=null&&$i(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Ta)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return zt(t),null;case 6:if(e&&t.stateNode!=null)Bg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(n=Xr(cl.current),Xr(Un.current),Wl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rn]=t,(l=r.nodeValue!==n)&&(e=rn,e!==null))switch(e.tag){case 3:Vl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Vl(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rn]=t,t.stateNode=r}return zt(t),null;case 13:if(We(Ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&nn!==null&&t.mode&1&&!(t.flags&128))lg(),Ki(),t.flags|=98560,l=!1;else if(l=Wl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(W(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(W(317));l[Rn]=t}else Ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zt(t),l=!1}else En!==null&&(uu(En),En=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ke.current&1?ht===0&&(ht=3):yd())),t.updateQueue!==null&&(t.flags|=4),zt(t),null);case 4:return Xi(),nu(e,t),e===null&&sl(t.stateNode.containerInfo),zt(t),null;case 10:return ed(t.type._context),zt(t),null;case 17:return Qt(t.type)&&za(),zt(t),null;case 19:if(We(Ke),l=t.memoizedState,l===null)return zt(t),null;if(r=(t.flags&128)!==0,a=l.rendering,a===null)if(r)Ss(l,!1);else{if(ht!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ra(e),a!==null){for(t.flags|=128,Ss(l,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,a=l.alternate,a===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,l.type=a.type,e=a.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Be(Ke,Ke.current&1|2),t.child}e=e.sibling}l.tail!==null&&it()>Zi&&(t.flags|=128,r=!0,Ss(l,!1),t.lanes=4194304)}else{if(!r)if(e=Ra(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ss(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!Qe)return zt(t),null}else 2*it()-l.renderingStartTime>Zi&&n!==1073741824&&(t.flags|=128,r=!0,Ss(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(n=l.last,n!==null?n.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=it(),t.sibling=null,n=Ke.current,Be(Ke,r?n&1|2:n&1),t):(zt(t),null);case 22:case 23:return gd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tn&1073741824&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function kk(e,t){switch(Yu(t),t.tag){case 1:return Qt(t.type)&&za(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(),We(qt),We(Dt),sd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return id(t),null;case 13:if(We(Ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return We(Ke),null;case 4:return Xi(),null;case 10:return ed(t.type._context),null;case 22:case 23:return gd(),null;case 24:return null;default:return null}}var Ql=!1,Lt=!1,wk=typeof WeakSet=="function"?WeakSet:Set,ne=null;function Pi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){et(e,t,r)}else n.current=null}function ru(e,t,n){try{n()}catch(r){et(e,t,r)}}var hm=!1;function bk(e,t){if(Oc=Ca,e=qp(),Qu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var a=0,o=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(o=a+i),f!==l||r!==0&&f.nodeType!==3||(c=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===i&&(o=a),h===l&&++d===r&&(c=a),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uc={focusedElem:e,selectionRange:n},Ca=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,w=g.memoizedState,x=t.stateNode,k=x.getSnapshotBeforeUpdate(t.elementType===t.type?v:Cn(t.type,v),w);x.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var j=t.stateNode.containerInfo;j.nodeType===1?j.textContent="":j.nodeType===9&&j.documentElement&&j.removeChild(j.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(z){et(t,t.return,z)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return g=hm,hm=!1,g}function Us(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&ru(t,n,l)}i=i.next}while(i!==r)}}function fo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function iu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Hg(e){var t=e.alternate;t!==null&&(e.alternate=null,Hg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rn],delete t[al],delete t[Vc],delete t[ik],delete t[sk])),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 Vg(e){return e.tag===5||e.tag===3||e.tag===4}function pm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vg(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 su(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ta));else if(r!==4&&(e=e.child,e!==null))for(su(e,t,n),e=e.sibling;e!==null;)su(e,t,n),e=e.sibling}function lu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(lu(e,t,n),e=e.sibling;e!==null;)lu(e,t,n),e=e.sibling}var Nt=null,_n=!1;function vr(e,t,n){for(n=n.child;n!==null;)Wg(e,t,n),n=n.sibling}function Wg(e,t,n){if(On&&typeof On.onCommitFiberUnmount=="function")try{On.onCommitFiberUnmount(ro,n)}catch{}switch(n.tag){case 5:Lt||Pi(n,t);case 6:var r=Nt,i=_n;Nt=null,vr(e,t,n),Nt=r,_n=i,Nt!==null&&(_n?(e=Nt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nt.removeChild(n.stateNode));break;case 18:Nt!==null&&(_n?(e=Nt,n=n.stateNode,e.nodeType===8?Vo(e.parentNode,n):e.nodeType===1&&Vo(e,n),nl(e)):Vo(Nt,n.stateNode));break;case 4:r=Nt,i=_n,Nt=n.stateNode.containerInfo,_n=!0,vr(e,t,n),Nt=r,_n=i;break;case 0:case 11:case 14:case 15:if(!Lt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,a=l.destroy;l=l.tag,a!==void 0&&(l&2||l&4)&&ru(n,t,a),i=i.next}while(i!==r)}vr(e,t,n);break;case 1:if(!Lt&&(Pi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){et(n,t,o)}vr(e,t,n);break;case 21:vr(e,t,n);break;case 22:n.mode&1?(Lt=(r=Lt)||n.memoizedState!==null,vr(e,t,n),Lt=r):vr(e,t,n);break;default:vr(e,t,n)}}function gm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new wk),t.forEach(function(r){var i=Lk.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function jn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var l=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:Nt=o.stateNode,_n=!1;break e;case 3:Nt=o.stateNode.containerInfo,_n=!0;break e;case 4:Nt=o.stateNode.containerInfo,_n=!0;break e}o=o.return}if(Nt===null)throw Error(W(160));Wg(l,a,i),Nt=null,_n=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){et(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Gg(t,e),t=t.sibling}function Gg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jn(t,e),An(e),r&4){try{Us(3,e,e.return),fo(3,e)}catch(v){et(e,e.return,v)}try{Us(5,e,e.return)}catch(v){et(e,e.return,v)}}break;case 1:jn(t,e),An(e),r&512&&n!==null&&Pi(n,n.return);break;case 5:if(jn(t,e),An(e),r&512&&n!==null&&Pi(n,n.return),e.flags&32){var i=e.stateNode;try{Js(i,"")}catch(v){et(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var l=e.memoizedProps,a=n!==null?n.memoizedProps:l,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&l.type==="radio"&&l.name!=null&&hp(i,l),zc(o,a);var u=zc(o,l);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?vp(i,f):d==="dangerouslySetInnerHTML"?yp(i,f):d==="children"?Js(i,f):Pu(i,d,f,u)}switch(o){case"input":Nc(i,l);break;case"textarea":pp(i,l);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!l.multiple;var m=l.value;m!=null?$i(i,!!l.multiple,m,!1):h!==!!l.multiple&&(l.defaultValue!=null?$i(i,!!l.multiple,l.defaultValue,!0):$i(i,!!l.multiple,l.multiple?[]:"",!1))}i[al]=l}catch(v){et(e,e.return,v)}}break;case 6:if(jn(t,e),An(e),r&4){if(e.stateNode===null)throw Error(W(162));i=e.stateNode,l=e.memoizedProps;try{i.nodeValue=l}catch(v){et(e,e.return,v)}}break;case 3:if(jn(t,e),An(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{nl(t.containerInfo)}catch(v){et(e,e.return,v)}break;case 4:jn(t,e),An(e);break;case 13:jn(t,e),An(e),i=e.child,i.flags&8192&&(l=i.memoizedState!==null,i.stateNode.isHidden=l,!l||i.alternate!==null&&i.alternate.memoizedState!==null||(hd=it())),r&4&&gm(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Lt=(u=Lt)||d,jn(t,e),Lt=u):jn(t,e),An(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ne=e,d=e.child;d!==null;){for(f=ne=d;ne!==null;){switch(h=ne,m=h.child,h.tag){case 0:case 11:case 14:case 15:Us(4,h,h.return);break;case 1:Pi(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){et(r,n,v)}}break;case 5:Pi(h,h.return);break;case 22:if(h.memoizedState!==null){xm(f);continue}}m!==null?(m.return=h,ne=m):xm(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(o=f.stateNode,c=f.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=xp("display",a))}catch(v){et(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){et(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:jn(t,e),An(e),r&4&&gm(e);break;case 21:break;default:jn(t,e),An(e)}}function An(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Vg(n)){var r=n;break e}n=n.return}throw Error(W(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Js(i,""),r.flags&=-33);var l=pm(e);lu(e,l,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=pm(e);su(e,o,a);break;default:throw Error(W(161))}}catch(c){et(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function jk(e,t,n){ne=e,qg(e)}function qg(e,t,n){for(var r=(e.mode&1)!==0;ne!==null;){var i=ne,l=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Ql;if(!a){var o=i.alternate,c=o!==null&&o.memoizedState!==null||Lt;o=Ql;var u=Lt;if(Ql=a,(Lt=c)&&!u)for(ne=i;ne!==null;)a=ne,c=a.child,a.tag===22&&a.memoizedState!==null?vm(i):c!==null?(c.return=a,ne=c):vm(i);for(;l!==null;)ne=l,qg(l),l=l.sibling;ne=i,Ql=o,Lt=u}ym(e)}else i.subtreeFlags&8772&&l!==null?(l.return=i,ne=l):ym(e)}}function ym(e){for(;ne!==null;){var t=ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Lt||fo(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Lt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Cn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&tm(t,l,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}tm(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&nl(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}Lt||t.flags&512&&iu(t)}catch(h){et(t,t.return,h)}}if(t===e){ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,ne=n;break}ne=t.return}}function xm(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ne=n;break}ne=t.return}}function vm(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fo(4,t)}catch(c){et(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){et(t,i,c)}}var l=t.return;try{iu(t)}catch(c){et(t,l,c)}break;case 5:var a=t.return;try{iu(t)}catch(c){et(t,a,c)}}}catch(c){et(t,t.return,c)}if(t===e){ne=null;break}var o=t.sibling;if(o!==null){o.return=t.return,ne=o;break}ne=t.return}}var Sk=Math.ceil,Oa=rr.ReactCurrentDispatcher,fd=rr.ReactCurrentOwner,hn=rr.ReactCurrentBatchConfig,Le=0,vt=null,ct=null,Ct=0,tn=0,Mi=Ur(0),ht=0,ml=null,ii=0,mo=0,md=0,Bs=null,Wt=null,hd=0,Zi=1/0,Gn=null,Ua=!1,au=null,Pr=null,Kl=!1,Tr=null,Ba=0,Hs=0,ou=null,ha=-1,pa=0;function Ot(){return Le&6?it():ha!==-1?ha:ha=it()}function Mr(e){return e.mode&1?Le&2&&Ct!==0?Ct&-Ct:ak.transition!==null?(pa===0&&(pa=Lp()),pa):(e=Re,e!==0||(e=window.event,e=e===void 0?16:$p(e.type)),e):1}function zn(e,t,n,r){if(50<Hs)throw Hs=0,ou=null,Error(W(185));vl(e,n,r),(!(Le&2)||e!==vt)&&(e===vt&&(!(Le&2)&&(mo|=n),ht===4&&_r(e,Ct)),Kt(e,r),n===1&&Le===0&&!(t.mode&1)&&(Zi=it()+500,oo&&Br()))}function Kt(e,t){var n=e.callbackNode;a1(e,t);var r=Na(e,e===vt?Ct:0);if(r===0)n!==null&&Ef(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ef(n),t===1)e.tag===0?lk(km.bind(null,e)):rg(km.bind(null,e)),nk(function(){!(Le&6)&&Br()}),n=null;else{switch(Ip(r)){case 1:n=Ou;break;case 4:n=Tp;break;case 16:n=Sa;break;case 536870912:n=zp;break;default:n=Sa}n=ty(n,Qg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Qg(e,t){if(ha=-1,pa=0,Le&6)throw Error(W(327));var n=e.callbackNode;if(Hi()&&e.callbackNode!==n)return null;var r=Na(e,e===vt?Ct:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ha(e,r);else{t=r;var i=Le;Le|=2;var l=Yg();(vt!==e||Ct!==t)&&(Gn=null,Zi=it()+500,Zr(e,t));do try{_k();break}catch(o){Kg(e,o)}while(!0);Zu(),Oa.current=l,Le=i,ct!==null?t=0:(vt=null,Ct=0,t=ht)}if(t!==0){if(t===2&&(i=Pc(e),i!==0&&(r=i,t=cu(e,i))),t===1)throw n=ml,Zr(e,0),_r(e,r),Kt(e,it()),n;if(t===6)_r(e,r);else{if(i=e.current.alternate,!(r&30)&&!Nk(i)&&(t=Ha(e,r),t===2&&(l=Pc(e),l!==0&&(r=l,t=cu(e,l))),t===1))throw n=ml,Zr(e,0),_r(e,r),Kt(e,it()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(W(345));case 2:qr(e,Wt,Gn);break;case 3:if(_r(e,r),(r&130023424)===r&&(t=hd+500-it(),10<t)){if(Na(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ot(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Hc(qr.bind(null,e,Wt,Gn),t);break}qr(e,Wt,Gn);break;case 4:if(_r(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-Tn(r);l=1<<a,a=t[a],a>i&&(i=a),r&=~l}if(r=i,r=it()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Sk(r/1960))-r,10<r){e.timeoutHandle=Hc(qr.bind(null,e,Wt,Gn),r);break}qr(e,Wt,Gn);break;case 5:qr(e,Wt,Gn);break;default:throw Error(W(329))}}}return Kt(e,it()),e.callbackNode===n?Qg.bind(null,e):null}function cu(e,t){var n=Bs;return e.current.memoizedState.isDehydrated&&(Zr(e,t).flags|=256),e=Ha(e,t),e!==2&&(t=Wt,Wt=n,t!==null&&uu(t)),e}function uu(e){Wt===null?Wt=e:Wt.push.apply(Wt,e)}function Nk(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],l=i.getSnapshot;i=i.value;try{if(!In(l(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _r(e,t){for(t&=~md,t&=~mo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Tn(t),r=1<<n;e[n]=-1,t&=~r}}function km(e){if(Le&6)throw Error(W(327));Hi();var t=Na(e,0);if(!(t&1))return Kt(e,it()),null;var n=Ha(e,t);if(e.tag!==0&&n===2){var r=Pc(e);r!==0&&(t=r,n=cu(e,r))}if(n===1)throw n=ml,Zr(e,0),_r(e,t),Kt(e,it()),n;if(n===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,qr(e,Wt,Gn),Kt(e,it()),null}function pd(e,t){var n=Le;Le|=1;try{return e(t)}finally{Le=n,Le===0&&(Zi=it()+500,oo&&Br())}}function si(e){Tr!==null&&Tr.tag===0&&!(Le&6)&&Hi();var t=Le;Le|=1;var n=hn.transition,r=Re;try{if(hn.transition=null,Re=1,e)return e()}finally{Re=r,hn.transition=n,Le=t,!(Le&6)&&Br()}}function gd(){tn=Mi.current,We(Mi)}function Zr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,tk(n)),ct!==null)for(n=ct.return;n!==null;){var r=n;switch(Yu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&za();break;case 3:Xi(),We(qt),We(Dt),sd();break;case 5:id(r);break;case 4:Xi();break;case 13:We(Ke);break;case 19:We(Ke);break;case 10:ed(r.type._context);break;case 22:case 23:gd()}n=n.return}if(vt=e,ct=e=Rr(e.current,null),Ct=tn=t,ht=0,ml=null,md=mo=ii=0,Wt=Bs=null,Yr!==null){for(t=0;t<Yr.length;t++)if(n=Yr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,l=n.pending;if(l!==null){var a=l.next;l.next=i,r.next=a}n.pending=r}Yr=null}return e}function Kg(e,t){do{var n=ct;try{if(Zu(),da.current=Fa,$a){for(var r=Ye.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}$a=!1}if(ri=0,xt=ft=Ye=null,Os=!1,ul=0,fd.current=null,n===null||n.return===null){ht=1,ml=t,ct=null;break}e:{var l=e,a=n.return,o=n,c=t;if(t=Ct,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=o,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=am(a);if(m!==null){m.flags&=-257,om(m,a,o,l,t),m.mode&1&&lm(l,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(c),t.updateQueue=v}else g.add(c);break e}else{if(!(t&1)){lm(l,u,t),yd();break e}c=Error(W(426))}}else if(Qe&&o.mode&1){var w=am(a);if(w!==null){!(w.flags&65536)&&(w.flags|=256),om(w,a,o,l,t),Xu(Ji(c,o));break e}}l=c=Ji(c,o),ht!==4&&(ht=2),Bs===null?Bs=[l]:Bs.push(l),l=a;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var x=Ig(l,c,t);em(l,x);break e;case 1:o=c;var k=l.type,j=l.stateNode;if(!(l.flags&128)&&(typeof k.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(Pr===null||!Pr.has(j)))){l.flags|=65536,t&=-t,l.lanes|=t;var z=Dg(l,o,t);em(l,z);break e}}l=l.return}while(l!==null)}Jg(n)}catch(A){t=A,ct===n&&n!==null&&(ct=n=n.return);continue}break}while(!0)}function Yg(){var e=Oa.current;return Oa.current=Fa,e===null?Fa:e}function yd(){(ht===0||ht===3||ht===2)&&(ht=4),vt===null||!(ii&268435455)&&!(mo&268435455)||_r(vt,Ct)}function Ha(e,t){var n=Le;Le|=2;var r=Yg();(vt!==e||Ct!==t)&&(Gn=null,Zr(e,t));do try{Ck();break}catch(i){Kg(e,i)}while(!0);if(Zu(),Le=n,Oa.current=r,ct!==null)throw Error(W(261));return vt=null,Ct=0,ht}function Ck(){for(;ct!==null;)Xg(ct)}function _k(){for(;ct!==null&&!Jv();)Xg(ct)}function Xg(e){var t=ey(e.alternate,e,tn);e.memoizedProps=e.pendingProps,t===null?Jg(e):ct=t,fd.current=null}function Jg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=kk(n,t),n!==null){n.flags&=32767,ct=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ht=6,ct=null;return}}else if(n=vk(n,t,tn),n!==null){ct=n;return}if(t=t.sibling,t!==null){ct=t;return}ct=t=e}while(t!==null);ht===0&&(ht=5)}function qr(e,t,n){var r=Re,i=hn.transition;try{hn.transition=null,Re=1,Ek(e,t,n,r)}finally{hn.transition=i,Re=r}return null}function Ek(e,t,n,r){do Hi();while(Tr!==null);if(Le&6)throw Error(W(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(W(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(o1(e,l),e===vt&&(ct=vt=null,Ct=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Kl||(Kl=!0,ty(Sa,function(){return Hi(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=hn.transition,hn.transition=null;var a=Re;Re=1;var o=Le;Le|=4,fd.current=null,bk(e,n),Gg(n,e),Q1(Uc),Ca=!!Oc,Uc=Oc=null,e.current=n,jk(n),Zv(),Le=o,Re=a,hn.transition=l}else e.current=n;if(Kl&&(Kl=!1,Tr=e,Ba=i),l=e.pendingLanes,l===0&&(Pr=null),n1(n.stateNode),Kt(e,it()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ua)throw Ua=!1,e=au,au=null,e;return Ba&1&&e.tag!==0&&Hi(),l=e.pendingLanes,l&1?e===ou?Hs++:(Hs=0,ou=e):Hs=0,Br(),null}function Hi(){if(Tr!==null){var e=Ip(Ba),t=hn.transition,n=Re;try{if(hn.transition=null,Re=16>e?16:e,Tr===null)var r=!1;else{if(e=Tr,Tr=null,Ba=0,Le&6)throw Error(W(331));var i=Le;for(Le|=4,ne=e.current;ne!==null;){var l=ne,a=l.child;if(ne.flags&16){var o=l.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(ne=u;ne!==null;){var d=ne;switch(d.tag){case 0:case 11:case 15:Us(8,d,l)}var f=d.child;if(f!==null)f.return=d,ne=f;else for(;ne!==null;){d=ne;var h=d.sibling,m=d.return;if(Hg(d),d===u){ne=null;break}if(h!==null){h.return=m,ne=h;break}ne=m}}}var g=l.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}ne=l}}if(l.subtreeFlags&2064&&a!==null)a.return=l,ne=a;else e:for(;ne!==null;){if(l=ne,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Us(9,l,l.return)}var x=l.sibling;if(x!==null){x.return=l.return,ne=x;break e}ne=l.return}}var k=e.current;for(ne=k;ne!==null;){a=ne;var j=a.child;if(a.subtreeFlags&2064&&j!==null)j.return=a,ne=j;else e:for(a=k;ne!==null;){if(o=ne,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:fo(9,o)}}catch(A){et(o,o.return,A)}if(o===a){ne=null;break e}var z=o.sibling;if(z!==null){z.return=o.return,ne=z;break e}ne=o.return}}if(Le=i,Br(),On&&typeof On.onPostCommitFiberRoot=="function")try{On.onPostCommitFiberRoot(ro,e)}catch{}r=!0}return r}finally{Re=n,hn.transition=t}}return!1}function wm(e,t,n){t=Ji(n,t),t=Ig(e,t,1),e=Ar(e,t,1),t=Ot(),e!==null&&(vl(e,1,t),Kt(e,t))}function et(e,t,n){if(e.tag===3)wm(e,e,n);else for(;t!==null;){if(t.tag===3){wm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Pr===null||!Pr.has(r))){e=Ji(n,e),e=Dg(t,e,1),t=Ar(t,e,1),e=Ot(),t!==null&&(vl(t,1,e),Kt(t,e));break}}t=t.return}}function Tk(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ot(),e.pingedLanes|=e.suspendedLanes&n,vt===e&&(Ct&n)===n&&(ht===4||ht===3&&(Ct&130023424)===Ct&&500>it()-hd?Zr(e,0):md|=n),Kt(e,t)}function Zg(e,t){t===0&&(e.mode&1?(t=Fl,Fl<<=1,!(Fl&130023424)&&(Fl=4194304)):t=1);var n=Ot();e=er(e,t),e!==null&&(vl(e,t,n),Kt(e,n))}function zk(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zg(e,n)}function Lk(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(W(314))}r!==null&&r.delete(t),Zg(e,n)}var ey;ey=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||qt.current)Gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Gt=!1,xk(e,t,n);Gt=!!(e.flags&131072)}else Gt=!1,Qe&&t.flags&1048576&&ig(t,Da,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ma(e,t),e=t.pendingProps;var i=Qi(t,Dt.current);Bi(t,n),i=ad(null,t,r,e,i,n);var l=od();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qt(r)?(l=!0,La(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,nd(t),i.updater=uo,t.stateNode=i,i._reactInternals=t,Yc(t,r,e,n),t=Zc(null,t,r,!0,l,n)):(t.tag=0,Qe&&l&&Ku(t),$t(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ma(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Dk(r),e=Cn(r,e),i){case 0:t=Jc(null,t,r,e,n);break e;case 1:t=dm(null,t,r,e,n);break e;case 11:t=cm(null,t,r,e,n);break e;case 14:t=um(null,t,r,Cn(r.type,e),n);break e}throw Error(W(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cn(r,i),Jc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cn(r,i),dm(e,t,r,i,n);case 3:e:{if(Rg(t),e===null)throw Error(W(387));r=t.pendingProps,l=t.memoizedState,i=l.element,ug(e,t),Ma(t,r,null,n);var a=t.memoizedState;if(r=a.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=Ji(Error(W(423)),t),t=fm(e,t,r,n,i);break e}else if(r!==i){i=Ji(Error(W(424)),t),t=fm(e,t,r,n,i);break e}else for(nn=Dr(t.stateNode.containerInfo.firstChild),rn=t,Qe=!0,En=null,n=og(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ki(),r===i){t=tr(e,t,n);break e}$t(e,t,r,n)}t=t.child}return t;case 5:return dg(t),e===null&&qc(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,a=i.children,Bc(r,i)?a=null:l!==null&&Bc(r,l)&&(t.flags|=32),Mg(e,t),$t(e,t,a,n),t.child;case 6:return e===null&&qc(t),null;case 13:return $g(e,t,n);case 4:return rd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Yi(t,null,r,n):$t(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cn(r,i),cm(e,t,r,i,n);case 7:return $t(e,t,t.pendingProps,n),t.child;case 8:return $t(e,t,t.pendingProps.children,n),t.child;case 12:return $t(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,a=i.value,Be(Aa,r._currentValue),r._currentValue=a,l!==null)if(In(l.value,a)){if(l.children===i.children&&!qt.current){t=tr(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){a=l.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(l.tag===1){c=Xn(-1,n&-n),c.tag=2;var u=l.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Qc(l.return,n,t),o.lanes|=n;break}c=c.next}}else if(l.tag===10)a=l.type===t.type?null:l.child;else if(l.tag===18){if(a=l.return,a===null)throw Error(W(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Qc(a,n,t),a=l.sibling}else a=l.child;if(a!==null)a.return=l;else for(a=l;a!==null;){if(a===t){a=null;break}if(l=a.sibling,l!==null){l.return=a.return,a=l;break}a=a.return}l=a}$t(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Bi(t,n),i=gn(i),r=r(i),t.flags|=1,$t(e,t,r,n),t.child;case 14:return r=t.type,i=Cn(r,t.pendingProps),i=Cn(r.type,i),um(e,t,r,i,n);case 15:return Ag(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cn(r,i),ma(e,t),t.tag=1,Qt(r)?(e=!0,La(t)):e=!1,Bi(t,n),Lg(t,r,i),Yc(t,r,i,n),Zc(null,t,r,!0,e,n);case 19:return Fg(e,t,n);case 22:return Pg(e,t,n)}throw Error(W(156,t.tag))};function ty(e,t){return Ep(e,t)}function Ik(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(e,t,n,r){return new Ik(e,t,n,r)}function xd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dk(e){if(typeof e=="function")return xd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ru)return 11;if(e===$u)return 14}return 2}function Rr(e,t){var n=e.alternate;return n===null?(n=mn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ga(e,t,n,r,i,l){var a=2;if(r=e,typeof e=="function")xd(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ci:return ei(n.children,i,l,t);case Mu:a=8,i|=8;break;case kc:return e=mn(12,n,t,i|2),e.elementType=kc,e.lanes=l,e;case wc:return e=mn(13,n,t,i),e.elementType=wc,e.lanes=l,e;case bc:return e=mn(19,n,t,i),e.elementType=bc,e.lanes=l,e;case dp:return ho(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cp:a=10;break e;case up:a=9;break e;case Ru:a=11;break e;case $u:a=14;break e;case Sr:a=16,r=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=mn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function ei(e,t,n,r){return e=mn(7,e,r,t),e.lanes=n,e}function ho(e,t,n,r){return e=mn(22,e,r,t),e.elementType=dp,e.lanes=n,e.stateNode={isHidden:!1},e}function Jo(e,t,n){return e=mn(6,e,null,t),e.lanes=n,e}function Zo(e,t,n){return t=mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ak(e,t,n,r,i){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=Do(0),this.expirationTimes=Do(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Do(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function vd(e,t,n,r,i,l,a,o,c){return e=new Ak(e,t,n,o,c),t===1?(t=1,l===!0&&(t|=8)):t=0,l=mn(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},nd(l),e}function Pk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ni,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ny(e){if(!e)return Fr;e=e._reactInternals;e:{if(fi(e)!==e||e.tag!==1)throw Error(W(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Qt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(W(171))}if(e.tag===1){var n=e.type;if(Qt(n))return ng(e,n,t)}return t}function ry(e,t,n,r,i,l,a,o,c){return e=vd(n,r,!0,e,i,l,a,o,c),e.context=ny(null),n=e.current,r=Ot(),i=Mr(n),l=Xn(r,i),l.callback=t??null,Ar(n,l,i),e.current.lanes=i,vl(e,i,r),Kt(e,r),e}function po(e,t,n,r){var i=t.current,l=Ot(),a=Mr(i);return n=ny(n),t.context===null?t.context=n:t.pendingContext=n,t=Xn(l,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ar(i,t,a),e!==null&&(zn(e,i,a,l),ua(e,i,a)),a}function Va(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 bm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function kd(e,t){bm(e,t),(e=e.alternate)&&bm(e,t)}function Mk(){return null}var iy=typeof reportError=="function"?reportError:function(e){console.error(e)};function wd(e){this._internalRoot=e}go.prototype.render=wd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));po(e,t,null,null)};go.prototype.unmount=wd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;si(function(){po(null,e,null,null)}),t[Zn]=null}};function go(e){this._internalRoot=e}go.prototype.unstable_scheduleHydration=function(e){if(e){var t=Pp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cr.length&&t!==0&&t<Cr[n].priority;n++);Cr.splice(n,0,e),n===0&&Rp(e)}};function bd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function jm(){}function Rk(e,t,n,r,i){if(i){if(typeof r=="function"){var l=r;r=function(){var u=Va(a);l.call(u)}}var a=ry(t,r,e,0,null,!1,!1,"",jm);return e._reactRootContainer=a,e[Zn]=a.current,sl(e.nodeType===8?e.parentNode:e),si(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var u=Va(c);o.call(u)}}var c=vd(e,0,!1,null,null,!1,!1,"",jm);return e._reactRootContainer=c,e[Zn]=c.current,sl(e.nodeType===8?e.parentNode:e),si(function(){po(t,c,n,r)}),c}function xo(e,t,n,r,i){var l=n._reactRootContainer;if(l){var a=l;if(typeof i=="function"){var o=i;i=function(){var c=Va(a);o.call(c)}}po(t,a,e,i)}else a=Rk(n,t,e,i,r);return Va(a)}Dp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Is(t.pendingLanes);n!==0&&(Uu(t,n|1),Kt(t,it()),!(Le&6)&&(Zi=it()+500,Br()))}break;case 13:si(function(){var r=er(e,1);if(r!==null){var i=Ot();zn(r,e,1,i)}}),kd(e,1)}};Bu=function(e){if(e.tag===13){var t=er(e,134217728);if(t!==null){var n=Ot();zn(t,e,134217728,n)}kd(e,134217728)}};Ap=function(e){if(e.tag===13){var t=Mr(e),n=er(e,t);if(n!==null){var r=Ot();zn(n,e,t,r)}kd(e,t)}};Pp=function(){return Re};Mp=function(e,t){var n=Re;try{return Re=e,t()}finally{Re=n}};Ic=function(e,t,n){switch(t){case"input":if(Nc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ao(r);if(!i)throw Error(W(90));mp(r),Nc(r,i)}}}break;case"textarea":pp(e,n);break;case"select":t=n.value,t!=null&&$i(e,!!n.multiple,t,!1)}};bp=pd;jp=si;var $k={usingClientEntryPoint:!1,Events:[wl,zi,ao,kp,wp,pd]},Ns={findFiberByHostInstance:Kr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Fk={bundleType:Ns.bundleType,version:Ns.version,rendererPackageName:Ns.rendererPackageName,rendererConfig:Ns.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:rr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Cp(e),e===null?null:e.stateNode},findFiberByHostInstance:Ns.findFiberByHostInstance||Mk,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 Yl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yl.isDisabled&&Yl.supportsFiber)try{ro=Yl.inject(Fk),On=Yl}catch{}}an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$k;an.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!bd(t))throw Error(W(200));return Pk(e,t,null,n)};an.createRoot=function(e,t){if(!bd(e))throw Error(W(299));var n=!1,r="",i=iy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=vd(e,1,!1,null,null,n,!1,r,i),e[Zn]=t.current,sl(e.nodeType===8?e.parentNode:e),new wd(t)};an.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(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=Cp(t),e=e===null?null:e.stateNode,e};an.flushSync=function(e){return si(e)};an.hydrate=function(e,t,n){if(!yo(t))throw Error(W(200));return xo(null,e,t,!0,n)};an.hydrateRoot=function(e,t,n){if(!bd(e))throw Error(W(405));var r=n!=null&&n.hydratedSources||null,i=!1,l="",a=iy;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=ry(t,null,e,1,n??null,i,!1,l,a),e[Zn]=t.current,sl(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new go(t)};an.render=function(e,t,n){if(!yo(t))throw Error(W(200));return xo(null,e,t,!1,n)};an.unmountComponentAtNode=function(e){if(!yo(e))throw Error(W(40));return e._reactRootContainer?(si(function(){xo(null,null,e,!1,function(){e._reactRootContainer=null,e[Zn]=null})}),!0):!1};an.unstable_batchedUpdates=pd;an.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!yo(n))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return xo(e,t,n,!1,r)};an.version="18.3.1-next-f1338f8080-20240426";function sy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sy)}catch(e){console.error(e)}}sy(),sp.exports=an;var Ok=sp.exports,Sm=Ok;xc.createRoot=Sm.createRoot,xc.hydrateRoot=Sm.hydrateRoot;/**
|
|
41
|
-
* @license lucide-react v0.312.0 - ISC
|
|
42
|
-
*
|
|
43
|
-
* This source code is licensed under the ISC license.
|
|
44
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/var Uk={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"};/**
|
|
46
|
-
* @license lucide-react v0.312.0 - ISC
|
|
47
|
-
*
|
|
48
|
-
* This source code is licensed under the ISC license.
|
|
49
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/const Bk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),K=(e,t)=>{const n=p.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:l=2,absoluteStrokeWidth:a,className:o="",children:c,...u},d)=>p.createElement("svg",{ref:d,...Uk,width:i,height:i,stroke:r,strokeWidth:a?Number(l)*24/Number(i):l,className:["lucide",`lucide-${Bk(e)}`,o].join(" "),...u},[...t.map(([f,h])=>p.createElement(f,h)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
|
|
51
|
-
* @license lucide-react v0.312.0 - ISC
|
|
52
|
-
*
|
|
53
|
-
* This source code is licensed under the ISC license.
|
|
54
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
-
*/const kt=K("AlertCircle",[["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"}]]);/**
|
|
56
|
-
* @license lucide-react v0.312.0 - ISC
|
|
57
|
-
*
|
|
58
|
-
* This source code is licensed under the ISC license.
|
|
59
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
-
*/const pn=K("AlertTriangle",[["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-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
61
|
-
* @license lucide-react v0.312.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const ly=K("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
66
|
-
* @license lucide-react v0.312.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const Nm=K("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
71
|
-
* @license lucide-react v0.312.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const ay=K("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
76
|
-
* @license lucide-react v0.312.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const Hk=K("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
81
|
-
* @license lucide-react v0.312.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const Cm=K("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
86
|
-
* @license lucide-react v0.312.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const oy=K("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
|
|
91
|
-
* @license lucide-react v0.312.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const ki=K("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
|
|
96
|
-
* @license lucide-react v0.312.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const du=K("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"}]]);/**
|
|
101
|
-
* @license lucide-react v0.312.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const Jr=K("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]);/**
|
|
106
|
-
* @license lucide-react v0.312.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const Vk=K("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
|
|
111
|
-
* @license lucide-react v0.312.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const nr=K("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
116
|
-
* @license lucide-react v0.312.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const wi=K("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
121
|
-
* @license lucide-react v0.312.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const li=K("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
126
|
-
* @license lucide-react v0.312.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const ai=K("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
131
|
-
* @license lucide-react v0.312.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const Wk=K("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
136
|
-
* @license lucide-react v0.312.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const ss=K("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
141
|
-
* @license lucide-react v0.312.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const cy=K("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
146
|
-
* @license lucide-react v0.312.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const Gk=K("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
151
|
-
* @license lucide-react v0.312.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const Wa=K("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
156
|
-
* @license lucide-react v0.312.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const qk=K("Code2",[["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"}]]);/**
|
|
161
|
-
* @license lucide-react v0.312.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const Qk=K("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
166
|
-
* @license lucide-react v0.312.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const jl=K("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"}]]);/**
|
|
171
|
-
* @license lucide-react v0.312.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const uy=K("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
176
|
-
* @license lucide-react v0.312.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const bi=K("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
181
|
-
* @license lucide-react v0.312.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const Kk=K("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
|
|
186
|
-
* @license lucide-react v0.312.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const oi=K("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
191
|
-
* @license lucide-react v0.312.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const Vi=K("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"}]]);/**
|
|
196
|
-
* @license lucide-react v0.312.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const dy=K("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
|
|
201
|
-
* @license lucide-react v0.312.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const Yk=K("FilePen",[["path",{d:"M12 22h6a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v10",key:"x7tsz2"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10.4 12.6a2 2 0 1 1 3 3L8 21l-4 1 1-4Z",key:"o3xyfb"}]]);/**
|
|
206
|
-
* @license lucide-react v0.312.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const $n=K("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"}]]);/**
|
|
211
|
-
* @license lucide-react v0.312.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const fy=K("File",[["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"}]]);/**
|
|
216
|
-
* @license lucide-react v0.312.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const Yn=K("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
221
|
-
* @license lucide-react v0.312.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const _m=K("FolderSearch",[["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.5-1.5",key:"3sg1j"}]]);/**
|
|
226
|
-
* @license lucide-react v0.312.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const my=K("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"}]]);/**
|
|
231
|
-
* @license lucide-react v0.312.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const Em=K("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);/**
|
|
236
|
-
* @license lucide-react v0.312.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const hy=K("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
241
|
-
* @license lucide-react v0.312.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const Xk=K("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
246
|
-
* @license lucide-react v0.312.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const Jk=K("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/**
|
|
251
|
-
* @license lucide-react v0.312.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const Zk=K("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
|
|
256
|
-
* @license lucide-react v0.312.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const ew=K("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
261
|
-
* @license lucide-react v0.312.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const tw=K("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:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
266
|
-
* @license lucide-react v0.312.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const nw=K("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
271
|
-
* @license lucide-react v0.312.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const py=K("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
276
|
-
* @license lucide-react v0.312.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const mt=K("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
281
|
-
* @license lucide-react v0.312.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const rw=K("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
|
|
286
|
-
* @license lucide-react v0.312.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const gy=K("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"}]]);/**
|
|
291
|
-
* @license lucide-react v0.312.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const iw=K("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
296
|
-
* @license lucide-react v0.312.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const sw=K("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
301
|
-
* @license lucide-react v0.312.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const fu=K("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"}]]);/**
|
|
306
|
-
* @license lucide-react v0.312.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const lw=K("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
311
|
-
* @license lucide-react v0.312.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const aw=K("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
316
|
-
* @license lucide-react v0.312.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const ow=K("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
321
|
-
* @license lucide-react v0.312.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const cw=K("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
326
|
-
* @license lucide-react v0.312.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const uw=K("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
331
|
-
* @license lucide-react v0.312.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const dw=K("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
|
|
336
|
-
* @license lucide-react v0.312.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const fw=K("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
|
|
341
|
-
* @license lucide-react v0.312.0 - ISC
|
|
342
|
-
*
|
|
343
|
-
* This source code is licensed under the ISC license.
|
|
344
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const mw=K("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
346
|
-
* @license lucide-react v0.312.0 - ISC
|
|
347
|
-
*
|
|
348
|
-
* This source code is licensed under the ISC license.
|
|
349
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
-
*/const hl=K("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
351
|
-
* @license lucide-react v0.312.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const Vs=K("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
356
|
-
* @license lucide-react v0.312.0 - ISC
|
|
357
|
-
*
|
|
358
|
-
* This source code is licensed under the ISC license.
|
|
359
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
-
*/const Fn=K("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
361
|
-
* @license lucide-react v0.312.0 - ISC
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the ISC license.
|
|
364
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/const hw=K("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
366
|
-
* @license lucide-react v0.312.0 - ISC
|
|
367
|
-
*
|
|
368
|
-
* This source code is licensed under the ISC license.
|
|
369
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
-
*/const pw=K("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
371
|
-
* @license lucide-react v0.312.0 - ISC
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the ISC license.
|
|
374
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/const Ga=K("ShieldAlert",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
376
|
-
* @license lucide-react v0.312.0 - ISC
|
|
377
|
-
*
|
|
378
|
-
* This source code is licensed under the ISC license.
|
|
379
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
-
*/const gw=K("ShieldOff",[["path",{d:"M19.7 14a6.9 6.9 0 0 0 .3-2V5l-8-3-3.2 1.2",key:"342pvf"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M4.7 4.7 4 5v7c0 6 8 10 8 10a20.3 20.3 0 0 0 5.62-4.38",key:"p0ycf4"}]]);/**
|
|
381
|
-
* @license lucide-react v0.312.0 - ISC
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the ISC license.
|
|
384
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/const Cs=K("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
|
|
386
|
-
* @license lucide-react v0.312.0 - ISC
|
|
387
|
-
*
|
|
388
|
-
* This source code is licensed under the ISC license.
|
|
389
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
-
*/const yy=K("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
|
|
391
|
-
* @license lucide-react v0.312.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/const yw=K("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
|
396
|
-
* @license lucide-react v0.312.0 - ISC
|
|
397
|
-
*
|
|
398
|
-
* This source code is licensed under the ISC license.
|
|
399
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
-
*/const xw=K("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/**
|
|
401
|
-
* @license lucide-react v0.312.0 - ISC
|
|
402
|
-
*
|
|
403
|
-
* This source code is licensed under the ISC license.
|
|
404
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
-
*/const vw=K("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
406
|
-
* @license lucide-react v0.312.0 - ISC
|
|
407
|
-
*
|
|
408
|
-
* This source code is licensed under the ISC license.
|
|
409
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
-
*/const Tm=K("StopCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]);/**
|
|
411
|
-
* @license lucide-react v0.312.0 - ISC
|
|
412
|
-
*
|
|
413
|
-
* This source code is licensed under the ISC license.
|
|
414
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
-
*/const kw=K("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
416
|
-
* @license lucide-react v0.312.0 - ISC
|
|
417
|
-
*
|
|
418
|
-
* This source code is licensed under the ISC license.
|
|
419
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
-
*/const ww=K("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
|
|
421
|
-
* @license lucide-react v0.312.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* This source code is licensed under the ISC license.
|
|
424
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const zm=K("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
426
|
-
* @license lucide-react v0.312.0 - ISC
|
|
427
|
-
*
|
|
428
|
-
* This source code is licensed under the ISC license.
|
|
429
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
-
*/const qa=K("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
431
|
-
* @license lucide-react v0.312.0 - ISC
|
|
432
|
-
*
|
|
433
|
-
* This source code is licensed under the ISC license.
|
|
434
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
-
*/const ci=K("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"}]]);/**
|
|
436
|
-
* @license lucide-react v0.312.0 - ISC
|
|
437
|
-
*
|
|
438
|
-
* This source code is licensed under the ISC license.
|
|
439
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
-
*/const Lm=K("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
441
|
-
* @license lucide-react v0.312.0 - ISC
|
|
442
|
-
*
|
|
443
|
-
* This source code is licensed under the ISC license.
|
|
444
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
-
*/const pl=K("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"}]]);/**
|
|
446
|
-
* @license lucide-react v0.312.0 - ISC
|
|
447
|
-
*
|
|
448
|
-
* This source code is licensed under the ISC license.
|
|
449
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
-
*/const bw=K("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"}]]);/**
|
|
451
|
-
* @license lucide-react v0.312.0 - ISC
|
|
452
|
-
*
|
|
453
|
-
* This source code is licensed under the ISC license.
|
|
454
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
-
*/const jw=K("WifiOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 4.17-2.65",key:"11utq1"}],["path",{d:"M10.66 5c4.01-.36 8.14.9 11.34 3.76",key:"hxefdu"}],["path",{d:"M16.85 11.25a10 10 0 0 1 2.22 1.68",key:"q734kn"}],["path",{d:"M5 13a10 10 0 0 1 5.24-2.76",key:"piq4yl"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
|
|
456
|
-
* @license lucide-react v0.312.0 - ISC
|
|
457
|
-
*
|
|
458
|
-
* This source code is licensed under the ISC license.
|
|
459
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
-
*/const mu=K("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"}]]);/**
|
|
461
|
-
* @license lucide-react v0.312.0 - ISC
|
|
462
|
-
*
|
|
463
|
-
* This source code is licensed under the ISC license.
|
|
464
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
-
*/const tt=K("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
466
|
-
* @license lucide-react v0.312.0 - ISC
|
|
467
|
-
*
|
|
468
|
-
* This source code is licensed under the ISC license.
|
|
469
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
-
*/const Ws=K("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),Sw={},Im=e=>{let t;const n=new Set,r=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(Sw?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,i,c);return c},Nw=e=>e?Im(e):Im;var xy={exports:{}},vy={},ky={exports:{}},wy={};/**
|
|
471
|
-
* @license React
|
|
472
|
-
* use-sync-external-store-shim.production.js
|
|
473
|
-
*
|
|
474
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
475
|
-
*
|
|
476
|
-
* This source code is licensed under the MIT license found in the
|
|
477
|
-
* LICENSE file in the root directory of this source tree.
|
|
478
|
-
*/var es=p;function Cw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _w=typeof Object.is=="function"?Object.is:Cw,Ew=es.useState,Tw=es.useEffect,zw=es.useLayoutEffect,Lw=es.useDebugValue;function Iw(e,t){var n=t(),r=Ew({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return zw(function(){i.value=n,i.getSnapshot=t,ec(i)&&l({inst:i})},[e,n,t]),Tw(function(){return ec(i)&&l({inst:i}),e(function(){ec(i)&&l({inst:i})})},[e]),Lw(n),n}function ec(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_w(e,n)}catch{return!0}}function Dw(e,t){return t()}var Aw=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Dw:Iw;wy.useSyncExternalStore=es.useSyncExternalStore!==void 0?es.useSyncExternalStore:Aw;ky.exports=wy;var Pw=ky.exports;/**
|
|
479
|
-
* @license React
|
|
480
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
481
|
-
*
|
|
482
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
483
|
-
*
|
|
484
|
-
* This source code is licensed under the MIT license found in the
|
|
485
|
-
* LICENSE file in the root directory of this source tree.
|
|
486
|
-
*/var vo=p,Mw=Pw;function Rw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $w=typeof Object.is=="function"?Object.is:Rw,Fw=Mw.useSyncExternalStore,Ow=vo.useRef,Uw=vo.useEffect,Bw=vo.useMemo,Hw=vo.useDebugValue;vy.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var l=Ow(null);if(l.current===null){var a={hasValue:!1,value:null};l.current=a}else a=l.current;l=Bw(function(){function c(m){if(!u){if(u=!0,d=m,m=r(m),i!==void 0&&a.hasValue){var g=a.value;if(i(g,m))return f=g}return f=m}if(g=f,$w(d,m))return g;var v=r(m);return i!==void 0&&i(g,v)?(d=m,g):(d=m,f=v)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,i]);var o=Fw(e,l[0],l[1]);return Uw(function(){a.hasValue=!0,a.value=o},[o]),Hw(o),o};xy.exports=vy;var Vw=xy.exports;const Ww=to(Vw),by={},{useDebugValue:Gw}=Gi,{useSyncExternalStoreWithSelector:qw}=Ww;let Dm=!1;const Qw=e=>e;function Kw(e,t=Qw,n){(by?"production":void 0)!=="production"&&n&&!Dm&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Dm=!0);const r=qw(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Gw(r),r}const Am=e=>{(by?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Nw(e):e,n=(r,i)=>Kw(t,r,i);return Object.assign(n,t),n},jy=e=>e?Am(e):Am,we=jy((e,t)=>({agents:[],activeAgentId:(()=>{try{return localStorage.getItem("gaia-active-agent-id")||"chat"}catch{return"chat"}})(),setAgents:n=>e({agents:n}),setActiveAgentId:n=>{try{localStorage.setItem("gaia-active-agent-id",n)}catch{}e({activeAgentId:n})},sessions:[],currentSessionId:null,pendingDeleteIds:[],setSessions:n=>e(r=>({sessions:n.filter(i=>!r.pendingDeleteIds.includes(i.id))})),setCurrentSession:n=>e({currentSessionId:n}),addSession:n=>e(r=>({sessions:[n,...r.sessions]})),removeSession:n=>e(r=>({sessions:r.sessions.filter(i=>i.id!==n),currentSessionId:r.currentSessionId===n?null:r.currentSessionId,messages:r.currentSessionId===n?[]:r.messages})),updateSessionInList:(n,r)=>e(i=>({sessions:i.sessions.map(l=>l.id===n?{...l,...r}:l)})),addPendingDelete:n=>e(r=>({pendingDeleteIds:[...r.pendingDeleteIds,n]})),removePendingDelete:n=>e(r=>({pendingDeleteIds:r.pendingDeleteIds.filter(i=>i!==n)})),messages:[],setMessages:n=>e({messages:n}),addMessage:n=>e(r=>({messages:[...r.messages,n]})),removeMessage:n=>e(r=>({messages:r.messages.filter(i=>i.id!==n)})),removeMessagesFrom:n=>e(r=>{const i=r.messages.findIndex(l=>l.id===n);return i===-1?r:{messages:r.messages.slice(0,i)}}),isStreaming:!1,streamingContent:"",setStreaming:n=>e({isStreaming:n}),appendStreamContent:n=>e(r=>({streamingContent:r.streamingContent+n})),setStreamContent:n=>e({streamingContent:n}),clearStreamContent:()=>e({streamingContent:""}),agentSteps:[],addAgentStep:n=>e(r=>({agentSteps:[...r.agentSteps.map(i=>({...i,active:!1})),n]})),updateLastAgentStep:n=>e(r=>{if(r.agentSteps.length===0)return r;const i=[...r.agentSteps];return i[i.length-1]={...i[i.length-1],...n},{agentSteps:i}}),appendThinkingContent:n=>e(r=>{if(r.agentSteps.length===0)return r;const i=[...r.agentSteps],l=i[i.length-1];return l.type!=="thinking"?r:(i[i.length-1]={...l,detail:(l.detail?l.detail+`
|
|
487
|
-
`:"")+n,active:!0},{agentSteps:i})}),updateLastToolStep:n=>e(r=>{if(r.agentSteps.length===0)return r;const i=[...r.agentSteps];for(let l=i.length-1;l>=0;l--)if(i[l].type==="tool")return i[l]={...i[l],...n},{agentSteps:i};return r}),clearAgentSteps:()=>e({agentSteps:[]}),documents:[],setDocuments:n=>e({documents:n}),systemStatus:null,backendConnected:!0,setSystemStatus:n=>e({systemStatus:n}),setBackendConnected:n=>e({backendConnected:n}),theme:(()=>{try{return localStorage.getItem("gaia-chat-theme")||"dark"}catch{return"dark"}})(),showDocLibrary:!1,showFileBrowser:!1,showSettings:!1,showMemoryDashboard:!1,toggleTheme:()=>e(n=>{const r=n.theme==="dark"?"light":"dark";try{localStorage.setItem("gaia-chat-theme",r)}catch{}return document.documentElement.setAttribute("data-theme",r),{theme:r}}),sidebarOpen:typeof window<"u"?window.innerWidth>768:!0,sidebarCollapsed:(()=>{try{return typeof window<"u"&&localStorage.getItem("gaia-chat-sidebar-collapsed")==="true"}catch{return!1}})(),sidebarWidth:(()=>{try{return typeof window<"u"?parseInt(localStorage.getItem("gaia-chat-sidebar-width")||"300",10):300}catch{return 300}})(),isLoadingMessages:!1,pendingPrompt:null,setShowDocLibrary:n=>e({showDocLibrary:n}),setShowFileBrowser:n=>e({showFileBrowser:n}),setShowSettings:n=>e({showSettings:n}),setShowMemoryDashboard:n=>e({showMemoryDashboard:n}),toggleSidebar:()=>e(n=>({sidebarOpen:!n.sidebarOpen})),setSidebarOpen:n=>e({sidebarOpen:n}),toggleSidebarCollapsed:()=>e(n=>{const r=!n.sidebarCollapsed;try{localStorage.setItem("gaia-chat-sidebar-collapsed",String(r))}catch{}return{sidebarCollapsed:r}}),setSidebarCollapsed:n=>{try{localStorage.setItem("gaia-chat-sidebar-collapsed",String(n))}catch{}e({sidebarCollapsed:n})},setSidebarWidth:n=>{const r=Math.max(200,Math.min(500,n));try{localStorage.setItem("gaia-chat-sidebar-width",String(r))}catch{}e({sidebarWidth:r})},setLoadingMessages:n=>e({isLoadingMessages:n}),setPendingPrompt:n=>e({pendingPrompt:n})})),Yw=/^https?:\/\/(127\.0\.0\.1|localhost):\d+\/api$/,Xw="http://localhost:4200/api";function jd(){if(typeof window>"u")return"/api";if(window.location.protocol==="file:"){const e=new URLSearchParams(window.location.search).get("api");return e&&Yw.test(e)?e:Xw}return"/api"}const Jw={api:"#4fc3f7",store:"#ce93d8",chat:"#81c784",stream:"#ffb74d",ui:"#90a4ae",doc:"#a1887f",system:"#e57373",nav:"#fff176"},Zw={api:"fetch",store:"state",chat:"chat",stream:"stream",ui:"ui",doc:"docs",system:"sys",nav:"nav"},ya=(()=>{try{if(localStorage.getItem("gaia-debug")==="true")return!0;if(typeof location<"u"){const e=new URLSearchParams(location.search);if(e.has("debug")||e.has("verbose"))return!0}}catch{}return!1})();function _s(){const e=new Date;return e.toLocaleTimeString("en-US",{hour12:!1})+"."+String(e.getMilliseconds()).padStart(3,"0")}function kr(e){const t=Jw[e]||"#ccc",r=`%c[${Zw[e]||e}]`,i=`color: ${t}; font-weight: bold;`,l="color: #888; font-weight: normal;";return{info:(a,...o)=>{if(!ya)return;const c=_s();o.length>0?console.log(`${r} %c${c} %c${a}`,i,l,"color: inherit;",...o):console.log(`${r} %c${c} %c${a}`,i,l,"color: inherit;")},warn:(a,...o)=>{const c=_s();console.warn(`${r} %c${c} %c${a}`,i,l,"color: inherit;",...o)},error:(a,...o)=>{const c=_s();console.error(`${r} %c${c} %c${a}`,i,l,"color: inherit;",...o)},debug:(a,...o)=>{if(!ya)return;const c=_s();console.debug(`${r} %c${c} %c${a}`,i,l,"color: #999;",...o)},timed:(a,o,...c)=>{if(!ya)return;const u=Math.round(performance.now()-o),d=_s(),f=u>2e3?"color: #e57373;":u>500?"color: #ffb74d;":"color: #81c784;";c.length>0?console.log(`${r} %c${d} %c${a} %c(${u}ms)`,i,l,"color: inherit;",f,...c):console.log(`${r} %c${d} %c${a} %c(${u}ms)`,i,l,"color: inherit;",f)},time:()=>performance.now()}}const E={api:kr("api"),store:kr("store"),chat:kr("chat"),stream:kr("stream"),ui:kr("ui"),doc:kr("doc"),system:kr("system"),nav:kr("nav")};function e0(e){console.log("%c GAIA %c v"+e+" %c Local AI Desktop","background: #E23C40; color: white; font-weight: bold; padding: 4px 8px; border-radius: 4px 0 0 4px;","background: #333; color: #fff; padding: 4px 8px;","background: #1a1a1a; color: #888; padding: 4px 8px; border-radius: 0 4px 4px 0;"),console.log(ya?"%cVerbose logging enabled. Categories: [fetch] [state] [chat] [stream] [ui] [docs] [sys] [nav]":'%cVerbose logging: add ?debug to URL or run localStorage.setItem("gaia-debug","true")',"color: #666; font-style: italic;")}const ko=jd();function Sy(e,t){switch(e){case 403:return t||"Access denied.";case 404:return t||"The requested item was not found.";case 413:return t||"File too large to process.";case 500:return"Server error. Please try again.";case 502:return"Service unavailable. Is the backend running?";case 503:return t||"Service unavailable.";default:return t||`Request failed (HTTP ${e})`}}async function ye(e,t,n,r){const i=`${ko}${t}`,l=E.api.time();E.api.info(`${e} ${i}`,n!==void 0?{body:n}:"");const o={method:e,headers:{...r,...n!==void 0?{"Content-Type":"application/json"}:{}},body:n!==void 0?JSON.stringify(n):void 0};let c;try{c=await fetch(i,o)}catch(f){throw E.api.error(`${e} ${i} - network error`,f),f}if(!c.ok){const f=await c.text().catch(()=>"");E.api.error(`${e} ${i} - HTTP ${c.status}`,{errorText:f});let h=f;try{h=JSON.parse(f).detail||f}catch{}throw new Error(Sy(c.status,h))}if(!(c.headers.get("content-type")||"").includes("application/json")){E.api.timed(`${e} ${i} -> ${c.status} (no body)`,l);return}const d=await c.json();return E.api.timed(`${e} ${i} -> ${c.status}`,l,d),d}async function Sd(){return ye("GET","/system/status")}async function t0(){return ye("GET","/settings")}async function n0(e){return ye("PUT","/settings",e)}async function r0(e,t){return ye("POST","/system/load-model",{model_name:e,ctx_size:t})}async function i0(e,t=!1){return ye("POST","/system/download-model",{model_name:e,force:t})}async function Nd(){return ye("GET","/agents")}const mi={"x-gaia-ui":"1"};async function s0(){return ye("GET","/connectors")}async function Ny(e){return ye("GET",`/connectors/${e}`)}async function Cy(e,t){return ye("POST",`/connectors/${e}/authorize`,{scopes:t},mi)}async function _y(e,t){return ye("POST",`/connectors/${e}/configure`,{config:t},mi)}async function Cd(e){await ye("DELETE",`/connectors/${e}`,void 0,mi)}async function Ey(e){return ye("POST",`/connectors/${e}/enable`,{},mi)}async function Ty(e){return ye("POST",`/connectors/${e}/disable`,{},mi)}async function l0(){return ye("GET","/connectors/agent-mcps")}async function a0(e){return ye("GET",`/connectors/${e}/grants`)}async function o0(e,t,n){await ye("PUT",`/connectors/${e}/grants/${encodeURIComponent(t)}`,{scopes:n},mi)}async function c0(e,t){await ye("DELETE",`/connectors/${e}/grants/${encodeURIComponent(t)}`,void 0,mi)}async function u0(){return ye("GET","/sessions")}async function hu(e={}){return ye("POST","/sessions",e)}async function tc(e,t){return ye("PUT",`/sessions/${e}`,t)}async function zy(e){return ye("DELETE",`/sessions/${e}`)}async function d0(e){return ye("PATCH",`/sessions/${e}/private`)}async function As(e){return ye("GET",`/sessions/${e}/messages`)}async function f0(e){return ye("GET",`/sessions/${e}/export?format=markdown`)}async function m0(e,t){return ye("DELETE",`/sessions/${e}/messages/${t}`)}async function h0(e,t){return ye("DELETE",`/sessions/${e}/messages/${t}/and-below`)}const p0=new Set(["status","step","thinking","plan","tool_start","tool_end","tool_result","tool_args","tool_confirm","agent_error","permission_request","policy_alert"]);function Ly(e,t,n,r,i,l){let a;typeof n=="function"?a={onChunk:n,onAgentEvent:()=>{},onDone:()=>{},onError:h=>{E.stream.error("Unhandled stream error",h)}}:a=n;const o=new AbortController,c=E.stream.time();let u=0,d=0,f=0;return E.stream.info(`Starting SSE stream for session=${e}`,{messageLength:t.length}),fetch(`${ko}/chat/send`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:e,message:t,stream:!0,...l?{agent_type:l}:{}}),signal:o.signal}).then(async h=>{var x,k;if(E.stream.info(`SSE connection opened -> HTTP ${h.status}`),!h.ok){const j=await h.text().catch(()=>"");E.stream.error(`SSE connection failed: HTTP ${h.status}`,j),a.onError(new Error(`HTTP ${h.status}: ${j}`));return}const m=(x=h.body)==null?void 0:x.getReader();if(!m){E.stream.error("No response body reader available"),a.onError(new Error("No response body"));return}const g=new TextDecoder;let v="",w=!1;try{for(;;){const{done:j,value:z}=await m.read();if(j){E.stream.debug("SSE reader done (stream ended)");break}v+=g.decode(z,{stream:!0});const A=v.split(`
|
|
488
|
-
`);v=A.pop()||"";for(const _ of A)if(_.startsWith("data: ")){const D=_.slice(6).trim();if(!D)continue;try{const C=JSON.parse(D);C.type==="chunk"?(u++,d+=(C.content||"").length,(u<=3||u%50===0)&&E.stream.debug(`Chunk #${u} (+${(C.content||"").length} chars)`),a.onChunk(C)):C.type==="answer"?a.onChunk(C):C.type==="done"?(w=!0,E.stream.timed(`Stream complete: ${u} chunks, ${d} chars, ${f} agent events`,c),a.onDone(C)):C.type==="error"?(E.stream.error("Stream error event:",C.content),a.onError(new Error(C.content||"Unknown error"))):C.type==="agent_created"?(E.stream.info(`Agent created: ${C.agent_id}`),(k=a.onAgentCreated)==null||k.call(a,C)):p0.has(C.type)?(f++,E.stream.debug(`Agent event: ${C.type}`,C),a.onAgentEvent(C)):E.stream.warn(`Unknown SSE event type: ${C.type}`,C)}catch{E.stream.warn("Malformed SSE data, skipping",{raw:D.slice(0,100)})}}}}finally{m.releaseLock()}w||(E.stream.timed(`SSE connection closed without done event: ${u} chunks, ${f} agent events`,c),a.onDone({type:"done"}))}).catch(h=>{h.name==="AbortError"?E.stream.warn(`Stream aborted by user after ${u} chunks`):(E.stream.error("Stream fetch error",h),a.onError(h))}),o}async function g0(e,t,n,r){return ye("POST","/chat/confirm",{session_id:e,confirm_id:t,action:n,remember:r})}async function Iy(e,t){return ye("POST","/chat/confirm-tool",{session_id:e,approved:t})}async function y0(e){return ye("POST","/chat/cancel",{session_id:e})}async function ji(){return ye("GET","/documents")}async function Dy(e){return ye("POST","/documents/upload-path",{filepath:e})}async function Ay(e){const t=`${ko}/documents/upload`,n=E.api.time();E.api.info(`POST ${t}`,{fileName:e.name,size:e.size});const r=new FormData;r.append("file",e);let i;try{i=await fetch(t,{method:"POST",body:r})}catch(a){throw E.api.error(`POST ${t} - network error`,a),a}if(!i.ok){const a=await i.text().catch(()=>"");E.api.error(`POST ${t} - HTTP ${i.status}`,{errorText:a});let o=a;try{o=JSON.parse(a).detail||a}catch{}throw new Error(Sy(i.status,o))}const l=await i.json();return E.api.timed(`POST ${t} -> ${i.status}`,n,l),l}async function x0(e){return ye("DELETE",`/documents/${e}`)}async function v0(e){return ye("GET",`/documents/${e}/status`)}async function k0(e){return ye("POST",`/documents/${e}/cancel`)}async function Qa(e,t){return ye("POST",`/sessions/${e}/documents`,{document_id:t})}async function w0(e,t){return ye("DELETE",`/sessions/${e}/documents/${t}`)}async function b0(e){const t=e?`?path=${encodeURIComponent(e)}`:"";return ye("GET",`/files/browse${t}`)}async function j0(e,t=!0){return ye("POST","/documents/index-folder",{folder_path:e,recursive:t})}async function _d(e,t=!0){return ye("POST","/files/open",{path:e,reveal:t})}async function Pm(e){const t=`${ko}/files/upload`,n=E.api.time();E.api.info(`POST ${t}`,{fileName:e.name,size:e.size});const r=new FormData;r.append("file",e);const i=await fetch(t,{method:"POST",body:r});if(!i.ok){const a=await i.text().catch(()=>"Upload failed");throw E.api.error(`POST ${t} - HTTP ${i.status}`,{errorText:a}),new Error(`Upload failed: ${a}`)}const l=await i.json();return E.api.timed(`POST ${t} -> ${i.status}`,n,l),l}async function S0(e,t,n){const r=new URLSearchParams({query:e});return t&&r.set("file_types",t),r.set("max_results",String(n)),ye("GET",`/files/search?${r}`)}async function N0(e,t){const n=new URLSearchParams({path:e});return ye("GET",`/files/preview?${n}`)}async function C0(){return ye("POST","/tunnel/start")}async function _0(){return ye("POST","/tunnel/stop")}async function Py(){return ye("GET","/tunnel/status")}async function E0(){return ye("GET","/mcp/status")}function Ri(e){return e.replace(/-/g,"").slice(0,7)}function T0(e,t){const n=t.replace(/^#/,"").toLowerCase();if(!n||n.length<4)return null;const r=e.find(i=>i.id.replace(/-/g,"").toLowerCase().startsWith(n));return r?r.id:null}const My=""+new URL("gaia-robot-NKaQnEIp.png",import.meta.url).href;function z0(e,t){e.stopPropagation(),e.preventDefault();const n=Ri(t),r=`${window.location.origin}${window.location.pathname}#${n}`;navigator.clipboard.writeText(r).then(()=>{E.ui.info(`Copied session link: ${r}`)}).catch(()=>{E.ui.warn("Clipboard write failed")})}function Mm({session:e,isActive:t,isPendingDelete:n,isDeleting:r,onSelect:i,onKeyDown:l,onDelete:a,formatTime:o}){const[c,u]=p.useState(!1),d=p.useCallback(f=>{z0(f,e.id),u(!0),setTimeout(()=>u(!1),1500)},[e.id]);return s.jsxs("div",{className:`session-item ${t?"active":""} ${r?"session-deleting":""}`,onClick:()=>i(e.id),onKeyDown:f=>l(f,e.id),role:"button",tabIndex:0,"aria-label":`Open task: ${e.title}`,"aria-current":t?"true":void 0,children:[s.jsxs("span",{className:"session-title",children:[e.private&&s.jsx(dy,{size:10,className:"session-private-icon","aria-label":"Private session"}),e.title]}),s.jsxs("a",{className:`session-hash ${c?"copied":""}`,href:`#${Ri(e.id)}`,onClick:d,title:c?"Copied!":`Copy link #${Ri(e.id)}`,"aria-label":`Copy link for session ${Ri(e.id)}`,children:["#",Ri(e.id)]}),s.jsx("span",{className:"session-time",children:o(e.updated_at)}),n?s.jsxs("button",{className:"session-delete confirm",onClick:f=>a(f,e.id),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&a(f,e.id)},title:"Click to confirm delete","aria-label":`Confirm delete: ${e.title}`,children:[s.jsx(ci,{size:12}),s.jsx("span",{className:"confirm-label",children:"Delete?"})]}):s.jsx("button",{className:"session-delete",onClick:f=>a(f,e.id),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&a(f,e.id)},title:"Delete","aria-label":`Delete: ${e.title}`,children:s.jsx(ci,{size:13})})]})}function L0({onNewTask:e,tunnelActive:t,tunnelLoading:n,onMobileToggle:r}){const{sessions:i,currentSessionId:l,setCurrentSession:a,removeSession:o,addSession:c,setMessages:u,theme:d,toggleTheme:f,setShowSettings:h,setShowMemoryDashboard:m,sidebarOpen:g,setSidebarOpen:v,setLoadingMessages:w,sidebarCollapsed:x,toggleSidebarCollapsed:k,sidebarWidth:j,setSidebarWidth:z,addPendingDelete:A,removePendingDelete:_}=we(),[D,C]=p.useState(""),[M,N]=p.useState(null),[U,O]=p.useState(null),[re,ie]=p.useState(!1),[X,xe]=p.useState(null),ce=p.useRef(null),T=p.useRef(null),P=p.useRef(null);p.useEffect(()=>{const L=()=>{var F;x?(k(),requestAnimationFrame(()=>{var Y;return(Y=T.current)==null?void 0:Y.focus()})):(F=T.current)==null||F.focus()};return window.addEventListener("gaia:focus-search",L),()=>window.removeEventListener("gaia:focus-search",L)},[x,k]);const b=D?i.filter(L=>L.title.toLowerCase().includes(D.toLowerCase())):i,J=p.useMemo(()=>{if(D)return null;const L=new Date,F=new Date(L.getFullYear(),L.getMonth(),L.getDate()).getTime(),Y=F-864e5,ue=F-7*864e5,he=[{label:"Today",sessions:[]},{label:"Yesterday",sessions:[]},{label:"Previous 7 Days",sessions:[]},{label:"Older",sessions:[]}];for(const H of b){const le=new Date(H.updated_at).getTime();le>=F?he[0].sessions.push(H):le>=Y?he[1].sessions.push(H):le>=ue?he[2].sessions.push(H):he[3].sessions.push(H)}return he.filter(H=>H.sessions.length>0)},[b,D]),B=p.useCallback(async L=>{var Y;if(L===l)return;const F=((Y=i.find(ue=>ue.id===L))==null?void 0:Y.title)||"?";E.nav.info(`Selecting session: "${F}" (${L})`),a(L),u([]),w(!0),window.innerWidth<=768&&v(!1);try{const ue=await As(L);if(!(we.getState().currentSessionId===L)){E.nav.debug(`Discarding stale message load for session=${L} (user switched away)`);return}u(ue.messages||[]),E.nav.info(`Loaded ${(ue.messages||[]).length} message(s) for "${F}"`)}catch(ue){E.nav.error(`Failed to load messages for session ${L}`,ue),u([])}finally{w(!1)}},[l,i,a,u,v,w]),S=p.useCallback(async(L,F)=>{L.stopPropagation(),L.preventDefault();const Y=i.find(he=>he.id===F),ue=(Y==null?void 0:Y.title)||"?";if(M===F){E.chat.info(`Deleting session: "${ue}" (${F})`),N(null),O(F),A(F),zy(F).then(()=>{E.chat.info(`Session deleted from backend: "${ue}"`),_(F)}).catch(H=>{E.chat.warn(`Backend delete failed for "${ue}"`,H),_(F)}),X!=null&&X.timer&&clearTimeout(X.timer);const he=setTimeout(()=>{xe(null)},5e3);Y&&xe({session:Y,timer:he}),setTimeout(()=>{o(F),O(null)},250);return}E.chat.debug(`Delete pending confirmation for: "${ue}" (${F})`),N(F),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>N(he=>he===F?null:he),3e3)},[M,i,o,X,A,_]),oe=p.useCallback(()=>{if(!X)return;clearTimeout(X.timer);const{session:L}=X;E.chat.info(`Undo delete: re-creating "${L.title}"`),_(L.id),hu({title:L.title}).then(F=>{c(F),E.chat.info(`Undo delete: re-created "${F.title}" (new id=${F.id})`)}).catch(F=>{E.chat.warn(`Undo delete failed for "${L.title}"`,F)}),xe(null)},[X,c,_]);p.useEffect(()=>{if(!M)return;const L=()=>N(null);return window.addEventListener("click",L,{once:!0}),()=>window.removeEventListener("click",L)},[M]);const pe=p.useCallback((L,F)=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),B(F))},[B]),ae=p.useRef(null),_e=p.useCallback(L=>{L.preventDefault(),ie(!0),E.ui.debug("Sidebar resize started");const F=L.clientX,Y=j,ue=H=>{const le=H.clientX-F;z(Y+le)},he=()=>{ie(!1),document.removeEventListener("mousemove",ue),document.removeEventListener("mouseup",he),document.body.style.cursor="",document.body.style.userSelect="",ae.current=null,E.ui.debug("Sidebar resize ended")};ae.current=he,document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",ue),document.addEventListener("mouseup",he)},[j,z]);p.useEffect(()=>()=>{ae.current&&ae.current(),P.current&&clearTimeout(P.current)},[]);const He=L=>{const F=new Date(L),ue=new Date().getTime()-F.getTime(),he=Math.floor(ue/6e4);if(he<1)return"now";if(he<60)return`${he}m`;const H=Math.floor(he/60);if(H<24)return`${H}h`;const le=Math.floor(H/24);return le<7?`${le}d`:F.toLocaleDateString(void 0,{month:"short",day:"numeric"})},Ge=typeof window<"u"&&window.innerWidth<=768?void 0:{width:x?56:j,minWidth:x?56:j};return s.jsxs("aside",{ref:ce,className:`sidebar ${g?"open":""} ${x?"collapsed":""} ${re?"resizing":""}`,style:Ge,role:"complementary","aria-label":"Task sidebar",children:[s.jsxs("div",{className:"sidebar-top",children:[s.jsxs("div",{className:"sidebar-brand",children:[s.jsx("div",{className:"brand-icon","aria-hidden":"true",children:s.jsx("img",{src:My,alt:"",width:28,height:28})}),s.jsxs("div",{className:"brand-text",children:[s.jsx("span",{className:"brand-name",children:"GAIA"}),s.jsxs("span",{className:"brand-version",children:["v","0.18.0"]}),s.jsx("span",{className:"beta-badge",children:"BETA"})]})]}),s.jsxs("div",{className:"sidebar-top-actions",children:[s.jsx("button",{className:"new-task-btn",onClick:e,title:"New Task","aria-label":"New Task",children:s.jsx(hl,{size:18})}),s.jsx("button",{className:"collapse-btn",onClick:k,title:x?"Expand sidebar":"Collapse sidebar","aria-label":x?"Expand sidebar":"Collapse sidebar",children:x?s.jsx(uw,{size:18}):s.jsx(cw,{size:18})})]})]}),s.jsxs("div",{className:"sidebar-search",children:[s.jsx(Fn,{size:14,className:"search-icon","aria-hidden":"true"}),s.jsx("input",{ref:T,type:"text",placeholder:"Search... (Ctrl+K)",value:D,onChange:L=>C(L.target.value),"aria-label":"Search tasks"})]}),s.jsxs("nav",{className:"session-list","aria-label":"Task sessions",children:[b.length===0&&s.jsx("div",{className:"empty-hint",children:D?"No results":"No tasks yet"}),J?J.map(L=>s.jsxs("div",{children:[s.jsx("div",{className:"session-group-label",children:L.label}),L.sessions.map(F=>s.jsx(Mm,{session:F,isActive:F.id===l,isPendingDelete:M===F.id,isDeleting:U===F.id,onSelect:B,onKeyDown:pe,onDelete:S,formatTime:He},F.id))]},L.label)):b.map(L=>s.jsx(Mm,{session:L,isActive:L.id===l,isPendingDelete:M===L.id,isDeleting:U===L.id,onSelect:B,onKeyDown:pe,onDelete:S,formatTime:He},L.id))]}),s.jsxs("div",{className:"sidebar-bottom",children:[s.jsxs("div",{className:"privacy-badge",children:[s.jsx("span",{className:"privacy-dot","aria-hidden":"true"}),s.jsx("span",{children:"100% Local"}),s.jsxs("span",{className:"version-badge",children:["v","0.18.0"]})]}),s.jsxs("div",{className:"sidebar-actions",children:[r&&s.jsx("button",{className:`btn-icon mobile-toggle-btn ${t?"active":""} ${n?"loading":""}`,onClick:r,disabled:n,title:t?"Stop mobile access":"Enable mobile access","aria-label":t?"Stop mobile access":"Enable mobile access",children:s.jsx(yy,{size:17})}),s.jsx("button",{className:"btn-icon",onClick:()=>m(!0),title:"Memory Dashboard","aria-label":"Memory Dashboard",children:s.jsx(Jr,{size:17})}),s.jsx("button",{className:"btn-icon",onClick:()=>h(!0),title:"Settings","aria-label":"Settings",children:s.jsx(pw,{size:17})}),s.jsx("button",{className:"btn-icon",onClick:f,title:"Toggle theme","aria-label":`Switch to ${d==="dark"?"light":"dark"} theme`,children:d==="dark"?s.jsx(kw,{size:17}):s.jsx(aw,{size:17})})]})]}),!x&&s.jsx("div",{className:"sidebar-resize-handle",onMouseDown:_e,title:"Drag to resize sidebar","aria-hidden":"true"}),X&&s.jsxs("div",{className:"toast toast-undo",role:"status",children:["Deleted “",X.session.title,"”",s.jsx("span",{className:"toast-action",onClick:oe,children:"Undo"})]})]})}function I0(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const D0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,A0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P0={};function Rm(e,t){return(P0.jsx?A0:D0).test(e)}const M0=/[ \t\n\f\r]/g;function R0(e){return typeof e=="object"?e.type==="text"?$m(e.value):!1:$m(e)}function $m(e){return e.replace(M0,"")===""}class Sl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Sl.prototype.normal={};Sl.prototype.property={};Sl.prototype.space=void 0;function Ry(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Sl(n,r,t)}function pu(e){return e.toLowerCase()}class Yt{constructor(t,n){this.attribute=n,this.property=t}}Yt.prototype.attribute="";Yt.prototype.booleanish=!1;Yt.prototype.boolean=!1;Yt.prototype.commaOrSpaceSeparated=!1;Yt.prototype.commaSeparated=!1;Yt.prototype.defined=!1;Yt.prototype.mustUseProperty=!1;Yt.prototype.number=!1;Yt.prototype.overloadedBoolean=!1;Yt.prototype.property="";Yt.prototype.spaceSeparated=!1;Yt.prototype.space=void 0;let $0=0;const ke=hi(),at=hi(),gu=hi(),G=hi(),Ue=hi(),Wi=hi(),en=hi();function hi(){return 2**++$0}const yu=Object.freeze(Object.defineProperty({__proto__:null,boolean:ke,booleanish:at,commaOrSpaceSeparated:en,commaSeparated:Wi,number:G,overloadedBoolean:gu,spaceSeparated:Ue},Symbol.toStringTag,{value:"Module"})),nc=Object.keys(yu);class Ed extends Yt{constructor(t,n,r,i){let l=-1;if(super(t,n),Fm(this,"space",i),typeof r=="number")for(;++l<nc.length;){const a=nc[l];Fm(this,nc[l],(r&yu[a])===yu[a])}}}Ed.prototype.defined=!0;function Fm(e,t,n){n&&(e[t]=n)}function ls(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new Ed(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[pu(r)]=r,n[pu(l.attribute)]=r}return new Sl(t,n,e.space)}const $y=ls({properties:{ariaActiveDescendant:null,ariaAtomic:at,ariaAutoComplete:null,ariaBusy:at,ariaChecked:at,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:Ue,ariaCurrent:null,ariaDescribedBy:Ue,ariaDetails:null,ariaDisabled:at,ariaDropEffect:Ue,ariaErrorMessage:null,ariaExpanded:at,ariaFlowTo:Ue,ariaGrabbed:at,ariaHasPopup:null,ariaHidden:at,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ue,ariaLevel:G,ariaLive:null,ariaModal:at,ariaMultiLine:at,ariaMultiSelectable:at,ariaOrientation:null,ariaOwns:Ue,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:at,ariaReadOnly:at,ariaRelevant:null,ariaRequired:at,ariaRoleDescription:Ue,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:at,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Fy(e,t){return t in e?e[t]:t}function Oy(e,t){return Fy(e,t.toLowerCase())}const F0=ls({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wi,acceptCharset:Ue,accessKey:Ue,action:null,allow:null,allowFullScreen:ke,allowPaymentRequest:ke,allowUserMedia:ke,alt:null,as:null,async:ke,autoCapitalize:null,autoComplete:Ue,autoFocus:ke,autoPlay:ke,blocking:Ue,capture:null,charSet:null,checked:ke,cite:null,className:Ue,cols:G,colSpan:null,content:null,contentEditable:at,controls:ke,controlsList:Ue,coords:G|Wi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ke,defer:ke,dir:null,dirName:null,disabled:ke,download:gu,draggable:at,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ke,formTarget:null,headers:Ue,height:G,hidden:gu,high:G,href:null,hrefLang:null,htmlFor:Ue,httpEquiv:Ue,id:null,imageSizes:null,imageSrcSet:null,inert:ke,inputMode:null,integrity:null,is:null,isMap:ke,itemId:null,itemProp:Ue,itemRef:Ue,itemScope:ke,itemType:Ue,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ke,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:ke,muted:ke,name:null,nonce:null,noModule:ke,noValidate:ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ke,optimum:G,pattern:null,ping:Ue,placeholder:null,playsInline:ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ke,referrerPolicy:null,rel:Ue,required:ke,reversed:ke,rows:G,rowSpan:G,sandbox:Ue,scope:null,scoped:ke,seamless:ke,selected:ke,shadowRootClonable:ke,shadowRootDelegatesFocus:ke,shadowRootMode:null,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:at,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:ke,useMap:null,value:at,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ue,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ke,declare:ke,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:ke,noHref:ke,noShade:ke,noWrap:ke,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:at,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ke,disableRemotePlayback:ke,prefix:null,property:null,results:G,security:null,unselectable:null},space:"html",transform:Oy}),O0=ls({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:en,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:Ue,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wi,g2:Wi,glyphName:Wi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:en,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ue,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:en,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:en,rev:en,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:en,requiredFeatures:en,requiredFonts:en,requiredFormats:en,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:en,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:en,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:en,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Fy}),Uy=ls({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),By=ls({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Oy}),Hy=ls({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),U0={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},B0=/[A-Z]/g,Om=/-[a-z]/g,H0=/^data[-\w.:]+$/i;function V0(e,t){const n=pu(t);let r=t,i=Yt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&H0.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Om,G0);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Om.test(l)){let a=l.replace(B0,W0);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Ed}return new i(r,t)}function W0(e){return"-"+e.toLowerCase()}function G0(e){return e.charAt(1).toUpperCase()}const q0=Ry([$y,F0,Uy,By,Hy],"html"),Td=Ry([$y,O0,Uy,By,Hy],"svg");function Q0(e){return e.join(" ").trim()}var zd={},Um=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,K0=/\n/g,Y0=/^\s*/,X0=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,J0=/^:\s*/,Z0=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,eb=/^[;\s]*/,tb=/^\s+|\s+$/g,nb=`
|
|
489
|
-
`,Bm="/",Hm="*",Qr="",rb="comment",ib="declaration";function sb(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var v=g.match(K0);v&&(n+=v.length);var w=g.lastIndexOf(nb);r=~w?g.length-w:r+g.length}function l(){var g={line:n,column:r};return function(v){return v.position=new a(g),u(),v}}function a(g){this.start=g,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(g){var v=new Error(t.source+":"+n+":"+r+": "+g);if(v.reason=g,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function c(g){var v=g.exec(e);if(v){var w=v[0];return i(w),e=e.slice(w.length),v}}function u(){c(Y0)}function d(g){var v;for(g=g||[];v=f();)v!==!1&&g.push(v);return g}function f(){var g=l();if(!(Bm!=e.charAt(0)||Hm!=e.charAt(1))){for(var v=2;Qr!=e.charAt(v)&&(Hm!=e.charAt(v)||Bm!=e.charAt(v+1));)++v;if(v+=2,Qr===e.charAt(v-1))return o("End of comment missing");var w=e.slice(2,v-2);return r+=2,i(w),e=e.slice(v),r+=2,g({type:rb,comment:w})}}function h(){var g=l(),v=c(X0);if(v){if(f(),!c(J0))return o("property missing ':'");var w=c(Z0),x=g({type:ib,property:Vm(v[0].replace(Um,Qr)),value:w?Vm(w[0].replace(Um,Qr)):Qr});return c(eb),x}}function m(){var g=[];d(g);for(var v;v=h();)v!==!1&&(g.push(v),d(g));return g}return u(),m()}function Vm(e){return e?e.replace(tb,Qr):Qr}var lb=sb,ab=ka&&ka.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zd,"__esModule",{value:!0});zd.default=cb;const ob=ab(lb);function cb(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,ob.default)(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:a,value:o}=l;i?t(a,o,l):o&&(n=n||{},n[a]=o)}),n}var wo={};Object.defineProperty(wo,"__esModule",{value:!0});wo.camelCase=void 0;var ub=/^--[a-zA-Z0-9_-]+$/,db=/-([a-z])/g,fb=/^[^-]+$/,mb=/^-(webkit|moz|ms|o|khtml)-/,hb=/^-(ms)-/,pb=function(e){return!e||fb.test(e)||ub.test(e)},gb=function(e,t){return t.toUpperCase()},Wm=function(e,t){return"".concat(t,"-")},yb=function(e,t){return t===void 0&&(t={}),pb(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(hb,Wm):e=e.replace(mb,Wm),e.replace(db,gb))};wo.camelCase=yb;var xb=ka&&ka.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},vb=xb(zd),kb=wo;function xu(e,t){var n={};return!e||typeof e!="string"||(0,vb.default)(e,function(r,i){r&&i&&(n[(0,kb.camelCase)(r,t)]=i)}),n}xu.default=xu;var wb=xu;const bb=to(wb),Vy=Wy("end"),Ld=Wy("start");function Wy(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function jb(e){const t=Ld(e),n=Vy(e);if(t&&n)return{start:t,end:n}}function Gs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Gm(e.position):"start"in e||"end"in e?Gm(e):"line"in e||"column"in e?vu(e):""}function vu(e){return qm(e&&e.line)+":"+qm(e&&e.column)}function Gm(e){return vu(e&&e.start)+"-"+vu(e&&e.end)}function qm(e){return e&&typeof e=="number"?e:1}class At extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(a=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Gs(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}At.prototype.file="";At.prototype.name="";At.prototype.reason="";At.prototype.message="";At.prototype.stack="";At.prototype.column=void 0;At.prototype.line=void 0;At.prototype.ancestors=void 0;At.prototype.cause=void 0;At.prototype.fatal=void 0;At.prototype.place=void 0;At.prototype.ruleId=void 0;At.prototype.source=void 0;const Id={}.hasOwnProperty,Sb=new Map,Nb=/[A-Z]/g,Cb=new Set(["table","tbody","thead","tfoot","tr"]),_b=new Set(["td","th"]),Gy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Eb(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Mb(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Pb(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Td:q0,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=qy(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function qy(e,t,n){if(t.type==="element")return Tb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ib(e,t,n);if(t.type==="mdxjsEsm")return Lb(e,t);if(t.type==="root")return Db(e,t,n);if(t.type==="text")return Ab(e,t)}function Tb(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Td,e.schema=i),e.ancestors.push(t);const l=Ky(e,t.tagName,!1),a=Rb(e,t);let o=Ad(e,t);return Cb.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!R0(c):!0})),Qy(e,a,l,t),Dd(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function zb(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}gl(e,t.position)}function Lb(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);gl(e,t.position)}function Ib(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Td,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:Ky(e,t.name,!0),a=$b(e,t),o=Ad(e,t);return Qy(e,a,l,t),Dd(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function Db(e,t,n){const r={};return Dd(r,Ad(e,t)),e.create(t,e.Fragment,r,n)}function Ab(e,t){return t.value}function Qy(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Dd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Pb(e,t,n){return r;function r(i,l,a,o){const u=Array.isArray(a.children)?n:t;return o?u(l,a,o):u(l,a)}}function Mb(e,t){return n;function n(r,i,l,a){const o=Array.isArray(l.children),c=Ld(r);return t(i,l,a,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Rb(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Id.call(t.properties,i)){const l=Fb(e,i,t.properties[i]);if(l){const[a,o]=l;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&_b.has(t.tagName)?r=o:n[a]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function $b(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const a=l.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else gl(e,t.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else gl(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Ad(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Sb;for(;++r<t.children.length;){const l=t.children[r];let a;if(e.passKeys){const c=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(c){const u=i.get(c)||0;a=c+"-"+u,i.set(c,u+1)}}const o=qy(e,l,a);o!==void 0&&n.push(o)}return n}function Fb(e,t,n){const r=V0(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?I0(n):Q0(n)),r.property==="style"){let i=typeof n=="object"?n:Ob(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Ub(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?U0[r.property]||r.property:r.attribute,n]}}function Ob(e,t){try{return bb(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new At("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Gy+"#cannot-parse-style-attribute",i}}function Ky(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,a;for(;++l<i.length;){const o=Rm(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=a}else r=Rm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Id.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);gl(e)}function gl(e,t){const n=new At("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Gy+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ub(e){const t={};let n;for(n in e)Id.call(e,n)&&(t[Bb(n)]=e[n]);return t}function Bb(e){let t=e.replace(Nb,Hb);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Hb(e){return"-"+e.toLowerCase()}const rc={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Vb={};function Pd(e,t){const n=Vb,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Yy(e,r,i)}function Yy(e,t,n){if(Wb(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Qm(e.children,t,n)}return Array.isArray(e)?Qm(e,t,n):""}function Qm(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Yy(e[i],t,n);return r.join("")}function Wb(e){return!!(e&&typeof e=="object")}const Km=document.createElement("i");function Md(e){const t="&"+e+";";Km.innerHTML=t;const n=Km.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function sn(e,t,n,r){const i=e.length;let l=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<r.length;)a=r.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function fn(e,t){return e.length>0?(sn(e,e.length,0,t),e):t}const Ym={}.hasOwnProperty;function Xy(e){const t={};let n=-1;for(;++n<e.length;)Gb(t,e[n]);return t}function Gb(e,t){let n;for(n in t){const i=(Ym.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){Ym.call(i,a)||(i[a]=[]);const o=l[a];qb(i[a],Array.isArray(o)?o:o?[o]:[])}}}function qb(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);sn(e,0,0,r)}function Jy(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ln(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ft=Hr(/[A-Za-z]/),It=Hr(/[\dA-Za-z]/),Qb=Hr(/[#-'*+\--9=?A-Z^-~]/);function Ka(e){return e!==null&&(e<32||e===127)}const ku=Hr(/\d/),Kb=Hr(/[\dA-Fa-f]/),Yb=Hr(/[!-/:-@[-`{-~]/);function fe(e){return e!==null&&e<-2}function Oe(e){return e!==null&&(e<0||e===32)}function Se(e){return e===-2||e===-1||e===32}const bo=Hr(new RegExp("\\p{P}|\\p{S}","u")),ui=Hr(/\s/);function Hr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function as(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&It(e.charCodeAt(n+1))&&It(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(a=String.fromCharCode(l,o),i=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Te(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return a;function a(c){return Se(c)?(e.enter(n),o(c)):t(c)}function o(c){return Se(c)&&l++<i?(e.consume(c),o):(e.exit(n),t(c))}}const Xb={tokenize:Jb};function Jb(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Te(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),l(o)}function l(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return fe(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),a)}}const Zb={tokenize:ej},Xm={tokenize:tj};function ej(e){const t=this,n=[];let r=0,i,l,a;return o;function o(j){if(r<n.length){const z=n[r];return t.containerState=z[1],e.attempt(z[0].continuation,c,u)(j)}return u(j)}function c(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&k();const z=t.events.length;let A=z,_;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){_=t.events[A][1].end;break}x(r);let D=z;for(;D<t.events.length;)t.events[D][1].end={..._},D++;return sn(t.events,A+1,0,t.events.slice(z)),t.events.length=D,u(j)}return o(j)}function u(j){if(r===n.length){if(!i)return h(j);if(i.currentConstruct&&i.currentConstruct.concrete)return g(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xm,d,f)(j)}function d(j){return i&&k(),x(r),h(j)}function f(j){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,g(j)}function h(j){return t.containerState={},e.attempt(Xm,m,g)(j)}function m(j){return r++,n.push([t.currentConstruct,t.containerState]),h(j)}function g(j){if(j===null){i&&k(),x(0),e.consume(j);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),v(j)}function v(j){if(j===null){w(e.exit("chunkFlow"),!0),x(0),e.consume(j);return}return fe(j)?(e.consume(j),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(j),v)}function w(j,z){const A=t.sliceStream(j);if(z&&A.push(null),j.previous=l,l&&(l.next=j),l=j,i.defineSkip(j.start),i.write(A),t.parser.lazy[j.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<a&&(!i.events[_][1].end||i.events[_][1].end.offset>a))return;const D=t.events.length;let C=D,M,N;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){if(M){N=t.events[C][1].end;break}M=!0}for(x(r),_=D;_<t.events.length;)t.events[_][1].end={...N},_++;sn(t.events,C+1,0,t.events.slice(D)),t.events.length=_}}function x(j){let z=n.length;for(;z-- >j;){const A=n[z];t.containerState=A[1],A[0].exit.call(t,e)}n.length=j}function k(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function tj(e,t,n){return Te(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ts(e){if(e===null||Oe(e)||ui(e))return 1;if(bo(e))return 2}function jo(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const wu={name:"attention",resolveAll:nj,tokenize:rj};function nj(e,t){let n=-1,r,i,l,a,o,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};Jm(f,-c),Jm(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=fn(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=fn(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",l,t]]),u=fn(u,jo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=fn(u,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=fn(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,sn(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function rj(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ts(r);let l;return a;function a(c){return l=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===l)return e.consume(c),o;const u=e.exit("attentionSequence"),d=ts(c),f=!d||d===2&&i||n.includes(c),h=!i||i===2&&d||n.includes(r);return u._open=!!(l===42?f:f&&(i||!h)),u._close=!!(l===42?h:h&&(d||!f)),t(c)}}function Jm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ij={name:"autolink",tokenize:sj};function sj(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(m){return Ft(m)?(e.consume(m),a):m===64?n(m):u(m)}function a(m){return m===43||m===45||m===46||It(m)?(r=1,o(m)):u(m)}function o(m){return m===58?(e.consume(m),r=0,c):(m===43||m===45||m===46||It(m))&&r++<32?(e.consume(m),o):(r=0,u(m))}function c(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Ka(m)?n(m):(e.consume(m),c)}function u(m){return m===64?(e.consume(m),d):Qb(m)?(e.consume(m),u):n(m)}function d(m){return It(m)?f(m):n(m)}function f(m){return m===46?(e.consume(m),r=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||It(m))&&r++<63){const g=m===45?h:f;return e.consume(m),g}return n(m)}}const Nl={partial:!0,tokenize:lj};function lj(e,t,n){return r;function r(l){return Se(l)?Te(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||fe(l)?t(l):n(l)}}const Zy={continuation:{tokenize:oj},exit:cj,name:"blockQuote",tokenize:aj};function aj(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return Se(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function oj(e,t,n){const r=this;return i;function i(a){return Se(a)?Te(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(Zy,t,n)(a)}}function cj(e){e.exit("blockQuote")}const ex={name:"characterEscape",tokenize:uj};function uj(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return Yb(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const tx={name:"characterReference",tokenize:dj};function dj(e,t,n){const r=this;let i=0,l,a;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),l=31,a=It,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=Kb,d):(e.enter("characterReferenceValue"),l=7,a=ku,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return a===It&&!Md(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(f)&&i++<l?(e.consume(f),d):n(f)}}const Zm={partial:!0,tokenize:mj},eh={concrete:!0,name:"codeFenced",tokenize:fj};function fj(e,t,n){const r=this,i={partial:!0,tokenize:A};let l=0,a=0,o;return c;function c(_){return u(_)}function u(_){const D=r.events[r.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(_)}function d(_){return _===o?(a++,e.consume(_),d):a<3?n(_):(e.exit("codeFencedFenceSequence"),Se(_)?Te(e,f,"whitespace")(_):f(_))}function f(_){return _===null||fe(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(Zm,v,z)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(_))}function h(_){return _===null||fe(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(_)):Se(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Te(e,m,"whitespace")(_)):_===96&&_===o?n(_):(e.consume(_),h)}function m(_){return _===null||fe(_)?f(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(_))}function g(_){return _===null||fe(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(_)):_===96&&_===o?n(_):(e.consume(_),g)}function v(_){return e.attempt(i,z,w)(_)}function w(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),x}function x(_){return l>0&&Se(_)?Te(e,k,"linePrefix",l+1)(_):k(_)}function k(_){return _===null||fe(_)?e.check(Zm,v,z)(_):(e.enter("codeFlowValue"),j(_))}function j(_){return _===null||fe(_)?(e.exit("codeFlowValue"),k(_)):(e.consume(_),j)}function z(_){return e.exit("codeFenced"),t(_)}function A(_,D,C){let M=0;return N;function N(X){return _.enter("lineEnding"),_.consume(X),_.exit("lineEnding"),U}function U(X){return _.enter("codeFencedFence"),Se(X)?Te(_,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):O(X)}function O(X){return X===o?(_.enter("codeFencedFenceSequence"),re(X)):C(X)}function re(X){return X===o?(M++,_.consume(X),re):M>=a?(_.exit("codeFencedFenceSequence"),Se(X)?Te(_,ie,"whitespace")(X):ie(X)):C(X)}function ie(X){return X===null||fe(X)?(_.exit("codeFencedFence"),D(X)):C(X)}}}function mj(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const ic={name:"codeIndented",tokenize:pj},hj={partial:!0,tokenize:gj};function pj(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Te(e,l,"linePrefix",5)(u)}function l(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):fe(u)?e.attempt(hj,a,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||fe(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function gj(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Te(e,l,"linePrefix",5)(a)}function l(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):fe(a)?i(a):n(a)}}const yj={name:"codeText",previous:vj,resolve:xj,tokenize:kj};function xj(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function vj(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kj(e,t,n){let r=0,i,l;return a;function a(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(l=e.enter("codeTextSequence"),i=0,d(f)):fe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||fe(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(l.type="codeTextData",u(f))}}class wj{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Es(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Es(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Es(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Es(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Es(this.left,n.reverse())}}}function Es(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function nx(e){const t={};let n=-1,r,i,l,a,o,c,u;const d=new wj(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,l=0,l<c.length&&c[l][1].type==="lineEndingBlank"&&(l+=2),l<c.length&&c[l][1].type==="content"))for(;++l<c.length&&c[l][1].type!=="content";)c[l][1].type==="chunkText"&&(c[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,bj(d,n)),n=t[n],u=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(a=d.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return sn(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function bj(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,c=[],u={};let d,f,h=-1,m=n,g=0,v=0;const w=[v];for(;m;){for(;e.get(++i)[1]!==m;);l.push(i),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),f&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=m,m=m.next}for(m=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(v=h+1,w.push(v),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):w.pop(),h=w.length;h--;){const x=o.slice(w[h],w[h+1]),k=l.pop();c.push([k,k+x.length-1]),e.splice(k,2,x)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const jj={resolve:Nj,tokenize:Cj},Sj={partial:!0,tokenize:_j};function Nj(e){return nx(e),e}function Cj(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?l(o):fe(o)?e.check(Sj,a,l)(o):(e.consume(o),i)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function _j(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Te(e,l,"linePrefix")}function l(a){if(a===null||fe(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function rx(e,t,n,r,i,l,a,o,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(x),e.exit(l),h):x===null||x===32||x===41||Ka(x)?n(x):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),v(x))}function h(x){return x===62?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(e.exit("chunkString"),e.exit(o),h(x)):x===null||x===60||fe(x)?n(x):(e.consume(x),x===92?g:m)}function g(x){return x===60||x===62||x===92?(e.consume(x),m):m(x)}function v(x){return!d&&(x===null||x===41||Oe(x))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(x)):d<u&&x===40?(e.consume(x),d++,v):x===41?(e.consume(x),d--,v):x===null||x===32||x===40||Ka(x)?n(x):(e.consume(x),x===92?w:v)}function w(x){return x===40||x===41||x===92?(e.consume(x),v):v(x)}}function ix(e,t,n,r,i,l){const a=this;let o=0,c;return u;function u(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(l),d}function d(m){return o>999||m===null||m===91||m===93&&!c||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(l),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):fe(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||fe(m)||o++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!Se(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),o++,f):f(m)}}function sx(e,t,n,r,i,l){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,c):n(h)}function c(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(l),u(h))}function u(h){return h===a?(e.exit(l),c(a)):h===null?n(h):fe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Te(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||fe(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function qs(e,t){let n;return r;function r(i){return fe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Se(i)?Te(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Ej={name:"definition",tokenize:zj},Tj={partial:!0,tokenize:Lj};function zj(e,t,n){const r=this;let i;return l;function l(m){return e.enter("definition"),a(m)}function a(m){return ix.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=Ln(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return Oe(m)?qs(e,u)(m):u(m)}function u(m){return rx(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(Tj,f,f)(m)}function f(m){return Se(m)?Te(e,h,"whitespace")(m):h(m)}function h(m){return m===null||fe(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function Lj(e,t,n){return r;function r(o){return Oe(o)?qs(e,i)(o):n(o)}function i(o){return sx(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return Se(o)?Te(e,a,"whitespace")(o):a(o)}function a(o){return o===null||fe(o)?t(o):n(o)}}const Ij={name:"hardBreakEscape",tokenize:Dj};function Dj(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return fe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const Aj={name:"headingAtx",resolve:Pj,tokenize:Mj};function Pj(e,t){let n=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},sn(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function Mj(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),l(d)}function l(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||Oe(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||fe(d)?(e.exit("atxHeading"),t(d)):Se(d)?Te(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||Oe(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const Rj=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],th=["pre","script","style","textarea"],$j={concrete:!0,name:"htmlFlow",resolveTo:Uj,tokenize:Bj},Fj={partial:!0,tokenize:Vj},Oj={partial:!0,tokenize:Hj};function Uj(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Bj(e,t,n){const r=this;let i,l,a,o,c;return u;function u(S){return d(S)}function d(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),f}function f(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),l=!0,v):S===63?(e.consume(S),i=3,r.interrupt?t:b):Ft(S)?(e.consume(S),a=String.fromCharCode(S),w):n(S)}function h(S){return S===45?(e.consume(S),i=2,m):S===91?(e.consume(S),i=5,o=0,g):Ft(S)?(e.consume(S),i=4,r.interrupt?t:b):n(S)}function m(S){return S===45?(e.consume(S),r.interrupt?t:b):n(S)}function g(S){const oe="CDATA[";return S===oe.charCodeAt(o++)?(e.consume(S),o===oe.length?r.interrupt?t:O:g):n(S)}function v(S){return Ft(S)?(e.consume(S),a=String.fromCharCode(S),w):n(S)}function w(S){if(S===null||S===47||S===62||Oe(S)){const oe=S===47,pe=a.toLowerCase();return!oe&&!l&&th.includes(pe)?(i=1,r.interrupt?t(S):O(S)):Rj.includes(a.toLowerCase())?(i=6,oe?(e.consume(S),x):r.interrupt?t(S):O(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):l?k(S):j(S))}return S===45||It(S)?(e.consume(S),a+=String.fromCharCode(S),w):n(S)}function x(S){return S===62?(e.consume(S),r.interrupt?t:O):n(S)}function k(S){return Se(S)?(e.consume(S),k):N(S)}function j(S){return S===47?(e.consume(S),N):S===58||S===95||Ft(S)?(e.consume(S),z):Se(S)?(e.consume(S),j):N(S)}function z(S){return S===45||S===46||S===58||S===95||It(S)?(e.consume(S),z):A(S)}function A(S){return S===61?(e.consume(S),_):Se(S)?(e.consume(S),A):j(S)}function _(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),c=S,D):Se(S)?(e.consume(S),_):C(S)}function D(S){return S===c?(e.consume(S),c=null,M):S===null||fe(S)?n(S):(e.consume(S),D)}function C(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||Oe(S)?A(S):(e.consume(S),C)}function M(S){return S===47||S===62||Se(S)?j(S):n(S)}function N(S){return S===62?(e.consume(S),U):n(S)}function U(S){return S===null||fe(S)?O(S):Se(S)?(e.consume(S),U):n(S)}function O(S){return S===45&&i===2?(e.consume(S),xe):S===60&&i===1?(e.consume(S),ce):S===62&&i===4?(e.consume(S),J):S===63&&i===3?(e.consume(S),b):S===93&&i===5?(e.consume(S),P):fe(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Fj,B,re)(S)):S===null||fe(S)?(e.exit("htmlFlowData"),re(S)):(e.consume(S),O)}function re(S){return e.check(Oj,ie,B)(S)}function ie(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),X}function X(S){return S===null||fe(S)?re(S):(e.enter("htmlFlowData"),O(S))}function xe(S){return S===45?(e.consume(S),b):O(S)}function ce(S){return S===47?(e.consume(S),a="",T):O(S)}function T(S){if(S===62){const oe=a.toLowerCase();return th.includes(oe)?(e.consume(S),J):O(S)}return Ft(S)&&a.length<8?(e.consume(S),a+=String.fromCharCode(S),T):O(S)}function P(S){return S===93?(e.consume(S),b):O(S)}function b(S){return S===62?(e.consume(S),J):S===45&&i===2?(e.consume(S),b):O(S)}function J(S){return S===null||fe(S)?(e.exit("htmlFlowData"),B(S)):(e.consume(S),J)}function B(S){return e.exit("htmlFlow"),t(S)}}function Hj(e,t,n){const r=this;return i;function i(a){return fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l):n(a)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Vj(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Nl,t,n)}}const Wj={name:"htmlText",tokenize:Gj};function Gj(e,t,n){const r=this;let i,l,a;return o;function o(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),c}function c(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),A):b===63?(e.consume(b),j):Ft(b)?(e.consume(b),C):n(b)}function u(b){return b===45?(e.consume(b),d):b===91?(e.consume(b),l=0,g):Ft(b)?(e.consume(b),k):n(b)}function d(b){return b===45?(e.consume(b),m):n(b)}function f(b){return b===null?n(b):b===45?(e.consume(b),h):fe(b)?(a=f,ce(b)):(e.consume(b),f)}function h(b){return b===45?(e.consume(b),m):f(b)}function m(b){return b===62?xe(b):b===45?h(b):f(b)}function g(b){const J="CDATA[";return b===J.charCodeAt(l++)?(e.consume(b),l===J.length?v:g):n(b)}function v(b){return b===null?n(b):b===93?(e.consume(b),w):fe(b)?(a=v,ce(b)):(e.consume(b),v)}function w(b){return b===93?(e.consume(b),x):v(b)}function x(b){return b===62?xe(b):b===93?(e.consume(b),x):v(b)}function k(b){return b===null||b===62?xe(b):fe(b)?(a=k,ce(b)):(e.consume(b),k)}function j(b){return b===null?n(b):b===63?(e.consume(b),z):fe(b)?(a=j,ce(b)):(e.consume(b),j)}function z(b){return b===62?xe(b):j(b)}function A(b){return Ft(b)?(e.consume(b),_):n(b)}function _(b){return b===45||It(b)?(e.consume(b),_):D(b)}function D(b){return fe(b)?(a=D,ce(b)):Se(b)?(e.consume(b),D):xe(b)}function C(b){return b===45||It(b)?(e.consume(b),C):b===47||b===62||Oe(b)?M(b):n(b)}function M(b){return b===47?(e.consume(b),xe):b===58||b===95||Ft(b)?(e.consume(b),N):fe(b)?(a=M,ce(b)):Se(b)?(e.consume(b),M):xe(b)}function N(b){return b===45||b===46||b===58||b===95||It(b)?(e.consume(b),N):U(b)}function U(b){return b===61?(e.consume(b),O):fe(b)?(a=U,ce(b)):Se(b)?(e.consume(b),U):M(b)}function O(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,re):fe(b)?(a=O,ce(b)):Se(b)?(e.consume(b),O):(e.consume(b),ie)}function re(b){return b===i?(e.consume(b),i=void 0,X):b===null?n(b):fe(b)?(a=re,ce(b)):(e.consume(b),re)}function ie(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||Oe(b)?M(b):(e.consume(b),ie)}function X(b){return b===47||b===62||Oe(b)?M(b):n(b)}function xe(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function ce(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),T}function T(b){return Se(b)?Te(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):P(b)}function P(b){return e.enter("htmlTextData"),a(b)}}const Rd={name:"labelEnd",resolveAll:Yj,resolveTo:Xj,tokenize:Jj},qj={tokenize:Zj},Qj={tokenize:eS},Kj={tokenize:tS};function Yj(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&sn(e,0,e.length,n),e}function Xj(e,t){let n=e.length,r=0,i,l,a,o;for(;n--;)if(i=e[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const c={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[l][1].start},end:{...e[a][1].end}},d={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",c,t],["enter",u,t]],o=fn(o,e.slice(l+1,l+r+3)),o=fn(o,[["enter",d,t]]),o=fn(o,jo(t.parser.constructs.insideSpan.null,e.slice(l+r+4,a-3),t)),o=fn(o,[["exit",d,t],e[a-2],e[a-1],["exit",u,t]]),o=fn(o,e.slice(a+1)),o=fn(o,[["exit",c,t]]),sn(e,l,e.length,o),e}function Jj(e,t,n){const r=this;let i=r.events.length,l,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return o;function o(h){return l?l._inactive?f(h):(a=r.parser.defined.includes(Ln(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(qj,d,a?d:f)(h):h===91?e.attempt(Qj,d,a?u:f)(h):a?d(h):f(h)}function u(h){return e.attempt(Kj,d,f)(h)}function d(h){return t(h)}function f(h){return l._balanced=!0,n(h)}}function Zj(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Oe(f)?qs(e,l)(f):l(f)}function l(f){return f===41?d(f):rx(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return Oe(f)?qs(e,c)(f):d(f)}function o(f){return n(f)}function c(f){return f===34||f===39||f===40?sx(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return Oe(f)?qs(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function eS(e,t,n){const r=this;return i;function i(o){return ix.call(r,e,l,a,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(Ln(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function tS(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const nS={name:"labelStartImage",resolveAll:Rd.resolveAll,tokenize:rS};function rS(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),l}function l(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const iS={name:"labelStartLink",resolveAll:Rd.resolveAll,tokenize:sS};function sS(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),l}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const sc={name:"lineEnding",tokenize:lS};function lS(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Te(e,t,"linePrefix")}}const xa={name:"thematicBreak",tokenize:aS};function aS(e,t,n){let r=0,i;return l;function l(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||fe(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Se(u)?Te(e,o,"whitespace")(u):o(u))}}const Vt={continuation:{tokenize:dS},exit:mS,name:"list",tokenize:uS},oS={partial:!0,tokenize:hS},cS={partial:!0,tokenize:fS};function uS(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:ku(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(xa,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return ku(m)&&++a<10?(e.consume(m),c):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Nl,r.interrupt?n:d,e.attempt(oS,h,f))}function d(m){return r.containerState.initialBlankLine=!0,l++,h(m)}function f(m){return Se(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function dS(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Nl,i,l);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Te(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!Se(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(cS,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Te(e,e.attempt(Vt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function fS(e,t,n){const r=this;return Te(e,i,"listItemIndent",r.containerState.size+1);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(l):n(l)}}function mS(e){e.exit(this.containerState.type)}function hS(e,t,n){const r=this;return Te(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const a=r.events[r.events.length-1];return!Se(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const nh={name:"setextUnderline",resolveTo:pS,tokenize:gS};function pS(e,t){let n=e.length,r,i,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",a,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function gS(e,t,n){const r=this;let i;return l;function l(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Se(u)?Te(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||fe(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const yS={tokenize:xS};function xS(e){const t=this,n=e.attempt(Nl,r,e.attempt(this.parser.constructs.flowInitial,i,Te(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jj,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const vS={resolveAll:ax()},kS=lx("string"),wS=lx("text");function lx(e){return{resolveAll:ax(e==="text"?bS:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,a,o);return a;function a(d){return u(d)?l(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),l(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=i[d];let h=-1;if(f)for(;++h<f.length;){const m=f[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function ax(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function bS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let l=i.length,a=-1,o=0,c;for(;l--;){const u=i[l];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)c=!0,o++;else if(u!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:r.start._bufferIndex+a,_index:r.start._index+l,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const jS={42:Vt,43:Vt,45:Vt,48:Vt,49:Vt,50:Vt,51:Vt,52:Vt,53:Vt,54:Vt,55:Vt,56:Vt,57:Vt,62:Zy},SS={91:Ej},NS={[-2]:ic,[-1]:ic,32:ic},CS={35:Aj,42:xa,45:[nh,xa],60:$j,61:nh,95:xa,96:eh,126:eh},_S={38:tx,92:ex},ES={[-5]:sc,[-4]:sc,[-3]:sc,33:nS,38:tx,42:wu,60:[ij,Wj],91:iS,92:[Ij,ex],93:Rd,95:wu,96:yj},TS={null:[wu,vS]},zS={null:[42,95]},LS={null:[]},IS=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:zS,contentInitial:SS,disable:LS,document:jS,flow:CS,flowInitial:NS,insideSpan:TS,string:_S,text:ES},Symbol.toStringTag,{value:"Module"}));function DS(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let a=[],o=[];const c={attempt:D(A),check:D(_),consume:k,enter:j,exit:z,interrupt:D(_,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&l.push(t),u;function f(U){return a=fn(a,U),w(),a[a.length-1]!==null?[]:(C(t,0),u.events=jo(l,u.events,u),u.events)}function h(U,O){return PS(m(U),O)}function m(U){return AS(a,U)}function g(){const{_bufferIndex:U,_index:O,line:re,column:ie,offset:X}=r;return{_bufferIndex:U,_index:O,line:re,column:ie,offset:X}}function v(U){i[U.line]=U.column,N()}function w(){let U;for(;r._index<a.length;){const O=a[r._index];if(typeof O=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<O.length;)x(O.charCodeAt(r._bufferIndex));else x(O)}}function x(U){d=d(U)}function k(U){fe(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,N()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=U}function j(U,O){const re=O||{};return re.type=U,re.start=g(),u.events.push(["enter",re,u]),o.push(re),re}function z(U){const O=o.pop();return O.end=g(),u.events.push(["exit",O,u]),O}function A(U,O){C(U,O.from)}function _(U,O){O.restore()}function D(U,O){return re;function re(ie,X,xe){let ce,T,P,b;return Array.isArray(ie)?B(ie):"tokenize"in ie?B([ie]):J(ie);function J(ae){return _e;function _e(He){const nt=He!==null&&ae[He],Ge=He!==null&&ae.null,L=[...Array.isArray(nt)?nt:nt?[nt]:[],...Array.isArray(Ge)?Ge:Ge?[Ge]:[]];return B(L)(He)}}function B(ae){return ce=ae,T=0,ae.length===0?xe:S(ae[T])}function S(ae){return _e;function _e(He){return b=M(),P=ae,ae.partial||(u.currentConstruct=ae),ae.name&&u.parser.constructs.disable.null.includes(ae.name)?pe():ae.tokenize.call(O?Object.assign(Object.create(u),O):u,c,oe,pe)(He)}}function oe(ae){return U(P,b),X}function pe(ae){return b.restore(),++T<ce.length?S(ce[T]):xe}}}function C(U,O){U.resolveAll&&!l.includes(U)&&l.push(U),U.resolve&&sn(u.events,O,u.events.length-O,U.resolve(u.events.slice(O),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function M(){const U=g(),O=u.previous,re=u.currentConstruct,ie=u.events.length,X=Array.from(o);return{from:ie,restore:xe};function xe(){r=U,u.previous=O,u.currentConstruct=re,u.events.length=ie,o=X,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function AS(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,l)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}l>0&&a.push(e[i].slice(0,l))}return a}function PS(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
|
|
490
|
-
`;break}case-3:{a=`\r
|
|
491
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(l)}i=l===-2,r.push(a)}return r.join("")}function MS(e){const r={constructs:Xy([IS,...(e||{}).extensions||[]]),content:i(Xb),defined:[],document:i(Zb),flow:i(yS),lazy:{},string:i(kS),text:i(wS)};return r;function i(l){return a;function a(o){return DS(r,l,o)}}}function RS(e){for(;!nx(e););return e}const rh=/[\0\t\n\r]/g;function $S(){let e=1,t="",n=!0,r;return i;function i(l,a,o){const c=[];let u,d,f,h,m;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l)),f=0,t="",n&&(l.charCodeAt(0)===65279&&f++,n=void 0);f<l.length;){if(rh.lastIndex=f,u=rh.exec(l),h=u&&u.index!==void 0?u.index:l.length,m=l.charCodeAt(h),!u){t=l.slice(f);break}if(m===10&&f===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<h&&(c.push(l.slice(f,h)),e+=h-f),m){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const FS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function OS(e){return e.replace(FS,US)}function US(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return Jy(n.slice(l?2:1),l?16:10)}return Md(n)||e}const ox={}.hasOwnProperty;function BS(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),HS(n)(RS(MS(n).document().write($S()(e,t,!0))))}function HS(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Ae),autolinkProtocol:M,autolinkEmail:M,atxHeading:l(he),blockQuote:l(Ge),characterEscape:M,characterReference:M,codeFenced:l(L),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:l(L,a),codeText:l(F,a),codeTextData:M,data:M,codeFlowValue:M,definition:l(Y),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:l(ue),hardBreakEscape:l(H),hardBreakTrailing:l(H),htmlFlow:l(le,a),htmlFlowData:M,htmlText:l(le,a),htmlTextData:M,image:l(Pe),label:a,link:l(Ae),listItem:l(ut),listItemValue:h,listOrdered:l($e,f),listUnordered:l($e),paragraph:l(je),reference:S,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:l(he),strong:l(Je),thematicBreak:l(os)},exit:{atxHeading:c(),atxHeadingSequence:A,autolink:c(),autolinkEmail:nt,autolinkProtocol:He,blockQuote:c(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ae,characterReference:_e,codeFenced:c(w),codeFencedFence:v,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:N,codeIndented:c(x),codeText:c(X),codeTextData:N,data:N,definition:c(),definitionDestinationString:z,definitionLabelString:k,definitionTitleString:j,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(re),htmlFlowData:N,htmlText:c(ie),htmlTextData:N,image:c(ce),label:P,labelText:T,lineEnding:U,link:c(xe),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:b,resourceTitleString:J,resource:B,setextHeading:c(C),setextHeadingLineSequence:D,setextHeadingText:_,strong:c(),thematicBreak:c()}};cx(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let Q={type:"root",children:[]};const de={stack:[Q],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:d,data:n},ve=[];let be=-1;for(;++be<$.length;)if($[be][1].type==="listOrdered"||$[be][1].type==="listUnordered")if($[be][0]==="enter")ve.push(be);else{const wt=ve.pop();be=i($,wt,be)}for(be=-1;++be<$.length;){const wt=t[$[be][0]];ox.call(wt,$[be][1].type)&&wt[$[be][1].type].call(Object.assign({sliceSerialize:$[be][2].sliceSerialize},de),$[be][1])}if(de.tokenStack.length>0){const wt=de.tokenStack[de.tokenStack.length-1];(wt[1]||ih).call(de,void 0,wt[0])}for(Q.position={start:wr($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:wr($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be<t.transforms.length;)Q=t.transforms[be](Q)||Q;return Q}function i($,Q,de){let ve=Q-1,be=-1,wt=!1,pt,qe,Pt,Xt;for(;++ve<=de;){const rt=$[ve];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?be++:be--,Xt=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(pt&&!Xt&&!be&&!Pt&&(Pt=ve),Xt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Xt=void 0}if(!be&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||be===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(pt){let Mt=ve;for(qe=void 0;Mt--;){const bt=$[Mt];if(bt[1].type==="lineEnding"||bt[1].type==="lineEndingBlank"){if(bt[0]==="exit")continue;qe&&($[qe][1].type="lineEndingBlank",wt=!0),bt[1].type="lineEnding",qe=Mt}else if(!(bt[1].type==="linePrefix"||bt[1].type==="blockQuotePrefix"||bt[1].type==="blockQuotePrefixWhitespace"||bt[1].type==="blockQuoteMarker"||bt[1].type==="listItemIndent"))break}Pt&&(!qe||Pt<qe)&&(pt._spread=!0),pt.end=Object.assign({},qe?$[qe][1].start:rt[1].end),$.splice(qe||ve,0,["exit",pt,rt[2]]),ve++,de++}if(rt[1].type==="listItemPrefix"){const Mt={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};pt=Mt,$.splice(ve,0,["enter",Mt,rt[2]]),ve++,de++,Pt=void 0,Xt=!0}}}return $[Q][1]._spread=wt,de}function l($,Q){return de;function de(ve){o.call(this,$(ve),ve),Q&&Q.call(this,ve)}}function a(){this.stack.push({type:"fragment",children:[]})}function o($,Q,de){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([Q,de||void 0]),$.position={start:wr(Q.start),end:void 0}}function c($){return Q;function Q(de){$&&$.call(this,de),u.call(this,de)}}function u($,Q){const de=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==$.type&&(Q?Q.call(this,$,ve[0]):(ve[1]||ih).call(this,$,ve[0]));else throw new Error("Cannot close `"+$.type+"` ("+Gs({start:$.start,end:$.end})+"): it’s not open");de.position.end=wr($.end)}function d(){return Pd(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h($){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function m(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=$}function g(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=$}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$.replace(/(\r?\n|\r)$/g,"")}function k($){const Q=this.resume(),de=this.stack[this.stack.length-1];de.label=Q,de.identifier=Ln(this.sliceSerialize($)).toLowerCase()}function j(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.title=$}function z(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.url=$}function A($){const Q=this.stack[this.stack.length-1];if(!Q.depth){const de=this.sliceSerialize($).length;Q.depth=de}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function D($){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function M($){const de=this.stack[this.stack.length-1].children;let ve=de[de.length-1];(!ve||ve.type!=="text")&&(ve=Vr(),ve.position={start:wr($.start),end:void 0},de.push(ve)),this.stack.push(ve)}function N($){const Q=this.stack.pop();Q.value+=this.sliceSerialize($),Q.position.end=wr($.end)}function U($){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const de=Q.children[Q.children.length-1];de.position.end=wr($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(M.call(this,$),N.call(this,$))}function O(){this.data.atHardBreak=!0}function re(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$}function ie(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$}function X(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$}function xe(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=Q,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function ce(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=Q,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function T($){const Q=this.sliceSerialize($),de=this.stack[this.stack.length-2];de.label=OS(Q),de.identifier=Ln(Q).toLowerCase()}function P(){const $=this.stack[this.stack.length-1],Q=this.resume(),de=this.stack[this.stack.length-1];if(this.data.inReference=!0,de.type==="link"){const ve=$.children;de.children=ve}else de.alt=Q}function b(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.url=$}function J(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.title=$}function B(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function oe($){const Q=this.resume(),de=this.stack[this.stack.length-1];de.label=Q,de.identifier=Ln(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function pe($){this.data.characterReferenceType=$.type}function ae($){const Q=this.sliceSerialize($),de=this.data.characterReferenceType;let ve;de?(ve=Jy(Q,de==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=Md(Q);const be=this.stack[this.stack.length-1];be.value+=ve}function _e($){const Q=this.stack.pop();Q.position.end=wr($.end)}function He($){N.call(this,$);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize($)}function nt($){N.call(this,$);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize($)}function Ge(){return{type:"blockquote",children:[]}}function L(){return{type:"code",lang:null,meta:null,value:""}}function F(){return{type:"inlineCode",value:""}}function Y(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ue(){return{type:"emphasis",children:[]}}function he(){return{type:"heading",depth:0,children:[]}}function H(){return{type:"break"}}function le(){return{type:"html",value:""}}function Pe(){return{type:"image",title:null,url:"",alt:null}}function Ae(){return{type:"link",title:null,url:"",children:[]}}function $e($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function ut($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function je(){return{type:"paragraph",children:[]}}function Je(){return{type:"strong",children:[]}}function Vr(){return{type:"text",value:""}}function os(){return{type:"thematicBreak"}}}function wr(e){return{line:e.line,column:e.column,offset:e.offset}}function cx(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?cx(e,r):VS(e,r)}}function VS(e,t){let n;for(n in t)if(ox.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function ih(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Gs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Gs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Gs({start:t.start,end:t.end})+") is still open")}function WS(e){const t=this;t.parser=n;function n(r){return BS(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function GS(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function qS(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
492
|
-
`}]}function QS(e,t){const n=t.value?t.value+`
|
|
493
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function KS(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YS(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function XS(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=as(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=l+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function JS(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZS(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ux(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function e2(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ux(e,t);const i={src:as(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function t2(e,t){const n={src:as(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function n2(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function r2(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ux(e,t);const i={href:as(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function i2(e,t){const n={href:as(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function s2(e,t,n){const r=e.all(t),i=n?l2(n):dx(t),l={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
|
494
|
-
`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
|
|
495
|
-
`});const u={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,u),e.applyData(t,u)}function l2(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=dx(n[r])}return t}function dx(e){const t=e.spread;return t??e.children.length>1}function a2(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function o2(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c2(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function u2(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d2(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Ld(t.children[1]),c=Vy(t.children[t.children.length-1]);o&&c&&(a.position={start:o,end:c}),i.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function f2(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let c=-1;const u=[];for(;++c<o;){const f=t.children[c],h={},m=a?a[c]:void 0;m&&(h.align=m);let g={type:"element",tagName:l,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),u.push(g)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function m2(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const sh=9,lh=32;function h2(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(ah(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(ah(t.slice(i),i>0,!1)),l.join("")}function ah(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===sh||l===lh;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===sh||l===lh;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function p2(e,t){const n={type:"text",value:h2(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function g2(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const y2={blockquote:GS,break:qS,code:QS,delete:KS,emphasis:YS,footnoteReference:XS,heading:JS,html:ZS,imageReference:e2,image:t2,inlineCode:n2,linkReference:r2,link:i2,listItem:s2,list:a2,paragraph:o2,root:c2,strong:u2,table:d2,tableCell:m2,tableRow:f2,text:p2,thematicBreak:g2,toml:Xl,yaml:Xl,definition:Xl,footnoteDefinition:Xl};function Xl(){}const fx=-1,So=0,Qs=1,Ya=2,$d=3,Fd=4,Od=5,Ud=6,mx=7,hx=8,oh=typeof self=="object"?self:globalThis,x2=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,a]=t[i];switch(l){case So:case fx:return n(a,i);case Qs:{const o=n([],i);for(const c of a)o.push(r(c));return o}case Ya:{const o=n({},i);for(const[c,u]of a)o[r(c)]=r(u);return o}case $d:return n(new Date(a),i);case Fd:{const{source:o,flags:c}=a;return n(new RegExp(o,c),i)}case Od:{const o=n(new Map,i);for(const[c,u]of a)o.set(r(c),r(u));return o}case Ud:{const o=n(new Set,i);for(const c of a)o.add(r(c));return o}case mx:{const{name:o,message:c}=a;return n(new oh[o](c),i)}case hx:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new oh[l](a),i)};return r},ch=e=>x2(new Map,e)(0),xi="",{toString:v2}={},{keys:k2}=Object,Ts=e=>{const t=typeof e;if(t!=="object"||!e)return[So,t];const n=v2.call(e).slice(8,-1);switch(n){case"Array":return[Qs,xi];case"Object":return[Ya,xi];case"Date":return[$d,xi];case"RegExp":return[Fd,xi];case"Map":return[Od,xi];case"Set":return[Ud,xi];case"DataView":return[Qs,n]}return n.includes("Array")?[Qs,n]:n.includes("Error")?[mx,n]:[Ya,n]},Jl=([e,t])=>e===So&&(t==="function"||t==="symbol"),w2=(e,t,n,r)=>{const i=(a,o)=>{const c=r.push(a)-1;return n.set(o,c),c},l=a=>{if(n.has(a))return n.get(a);let[o,c]=Ts(a);switch(o){case So:{let d=a;switch(c){case"bigint":o=hx,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([fx],a)}return i([o,d],a)}case Qs:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),i([c,[...h]],a)}const d=[],f=i([o,d],a);for(const h of a)d.push(l(h));return f}case Ya:{if(c)switch(c){case"BigInt":return i([c,a.toString()],a);case"Boolean":case"Number":case"String":return i([c,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const d=[],f=i([o,d],a);for(const h of k2(a))(e||!Jl(Ts(a[h])))&&d.push([l(h),l(a[h])]);return f}case $d:return i([o,a.toISOString()],a);case Fd:{const{source:d,flags:f}=a;return i([o,{source:d,flags:f}],a)}case Od:{const d=[],f=i([o,d],a);for(const[h,m]of a)(e||!(Jl(Ts(h))||Jl(Ts(m))))&&d.push([l(h),l(m)]);return f}case Ud:{const d=[],f=i([o,d],a);for(const h of a)(e||!Jl(Ts(h)))&&d.push(l(h));return f}}const{message:u}=a;return i([o,{name:c,message:u}],a)};return l},uh=(e,{json:t,lossy:n}={})=>{const r=[];return w2(!(t||n),!!t,new Map,r)(e),r},Xa=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ch(uh(e,t)):structuredClone(e):(e,t)=>ch(uh(e,t));function b2(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function j2(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function S2(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||b2,r=e.options.footnoteBackLabel||j2,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),h=as(f.toLowerCase());let m=0;const g=[],v=e.footnoteCounts.get(f);for(;v!==void 0&&++m<=v;){g.length>0&&g.push({type:"text",value:" "});let k=typeof n=="string"?n:n(c,m);typeof k=="string"&&(k={type:"text",value:k}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const k=w.children[w.children.length-1];k&&k.type==="text"?k.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...g)}else d.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,x),o.push(x)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Xa(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
496
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
497
|
-
`}]}}const No=function(e){if(e==null)return E2;if(typeof e=="function")return Co(e);if(typeof e=="object")return Array.isArray(e)?N2(e):C2(e);if(typeof e=="string")return _2(e);throw new Error("Expected function, string, or object as test")};function N2(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=No(e[n]);return Co(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function C2(e){const t=e;return Co(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function _2(e){return Co(t);function t(n){return n&&n.type===e}}function Co(e){return t;function t(n,r,i){return!!(T2(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function E2(){return!0}function T2(e){return e!==null&&typeof e=="object"&&"type"in e}const px=[],z2=!0,bu=!1,L2="skip";function gx(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const l=No(i),a=r?-1:1;o(e,void 0,[])();function o(c,u,d){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const m=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=px,g,v,w;if((!t||l(c,u,d[d.length-1]||void 0))&&(m=I2(n(c,d)),m[0]===bu))return m;if("children"in c&&c.children){const x=c;if(x.children&&m[0]!==L2)for(v=(r?x.children.length:-1)+a,w=d.concat(x);v>-1&&v<x.children.length;){const k=x.children[v];if(g=o(k,v,w)(),g[0]===bu)return g;v=typeof g[1]=="number"?g[1]:v+a}}return m}}}function I2(e){return Array.isArray(e)?e:typeof e=="number"?[z2,e]:e==null?px:[e]}function Bd(e,t,n,r){let i,l,a;typeof t=="function"&&typeof n!="function"?(l=void 0,a=t,i=n):(l=t,a=n,i=r),gx(e,l,o,i);function o(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return a(c,f,d)}}const ju={}.hasOwnProperty,D2={};function A2(e,t){const n=t||D2,r=new Map,i=new Map,l=new Map,a={...y2,...n.handlers},o={all:u,applyData:M2,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:a,one:c,options:n,patch:P2,wrap:$2};return Bd(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),o;function c(d,f){const h=d.type,m=o.handlers[h];if(ju.call(o.handlers,h)&&m)return m(o,d,f);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in d){const{children:v,...w}=d,x=Xa(w);return x.children=o.all(d),x}return Xa(d)}return(o.options.unknownHandler||R2)(o,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let m=-1;for(;++m<h.length;){const g=o.one(h[m],d);if(g){if(m&&h[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=dh(g.value)),!Array.isArray(g)&&g.type==="element")){const v=g.children[0];v&&v.type==="text"&&(v.value=dh(v.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function P2(e,t){e.position&&(t.position=jb(e))}function M2(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,Xa(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function R2(e,t){const n=t.data||{},r="value"in t&&!(ju.call(n,"hProperties")||ju.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function $2(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
498
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
499
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
500
|
-
`}),n}function dh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fh(e,t){const n=A2(e,t),r=n.one(e,void 0),i=S2(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
501
|
-
`},i),l}function F2(e,t){return e&&"run"in e?async function(n,r){const i=fh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return fh(n,{file:r,...e||t})}}function mh(e){if(e)throw e}var va=Object.prototype.hasOwnProperty,yx=Object.prototype.toString,hh=Object.defineProperty,ph=Object.getOwnPropertyDescriptor,gh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):yx.call(t)==="[object Array]"},yh=function(t){if(!t||yx.call(t)!=="[object Object]")return!1;var n=va.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&va.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||va.call(t,i)},xh=function(t,n){hh&&n.name==="__proto__"?hh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},vh=function(t,n){if(n==="__proto__")if(va.call(t,n)){if(ph)return ph(t,n).value}else return;return t[n]},O2=function e(){var t,n,r,i,l,a,o=arguments[0],c=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},c=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=vh(o,n),i=vh(t,n),o!==i&&(d&&i&&(yh(i)||(l=gh(i)))?(l?(l=!1,a=r&&gh(r)?r:[]):a=r&&yh(r)?r:{},xh(o,{name:n,newValue:e(d,a,i)})):typeof i<"u"&&xh(o,{name:n,newValue:i}));return o};const lc=to(O2);function Su(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function U2(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(c,...u){const d=e[++l];let f=-1;if(c){a(c);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,d?B2(d,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function B2(e,t){let n;return r;function r(...a){const o=e.length>a.length;let c;o&&a.push(i);try{c=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return i(d)}o||(c&&c.then&&typeof c.then=="function"?c.then(l,i):c instanceof Error?i(c):l(c))}function i(a,...o){n||(n=!0,t(a,...o))}function l(a){i(null,a)}}const Mn={basename:H2,dirname:V2,extname:W2,join:G2,sep:"/"};function H2(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Cl(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else a<0&&(l=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function V2(e){if(Cl(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function W2(e){Cl(e);let t=e.length,n=-1,r=0,i=-1,l=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function G2(...e){let t=-1,n;for(;++t<e.length;)Cl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":q2(n)}function q2(e){Cl(e);const t=e.codePointAt(0)===47;let n=Q2(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Q2(e,t){let n="",r=0,i=-1,l=0,a=-1,o,c;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||l===1))if(i!==a-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=a,l=0;continue}}else if(n.length>0){n="",r=0,i=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,l=0}else o===46&&l>-1?l++:l=-1}return n}function Cl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const K2={cwd:Y2};function Y2(){return"/"}function Nu(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function X2(e){if(typeof e=="string")e=new URL(e);else if(!Nu(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return J2(e)}function J2(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ac=["history","path","basename","stem","extname","dirname"];class xx{constructor(t){let n;t?Nu(t)?n={path:t}:typeof t=="string"||Z2(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":K2.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ac.length;){const l=ac[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)ac.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Mn.basename(this.path):void 0}set basename(t){cc(t,"basename"),oc(t,"basename"),this.path=Mn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mn.dirname(this.path):void 0}set dirname(t){kh(this.basename,"dirname"),this.path=Mn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mn.extname(this.path):void 0}set extname(t){if(oc(t,"extname"),kh(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Mn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Nu(t)&&(t=X2(t)),cc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mn.basename(this.path,this.extname):void 0}set stem(t){cc(t,"stem"),oc(t,"stem"),this.path=Mn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new At(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function oc(e,t){if(e&&e.includes(Mn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mn.sep+"`")}function cc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function kh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Z2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eN=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},tN={}.hasOwnProperty;class Hd extends eN{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=U2()}copy(){const t=new Hd;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(lc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fc("data",this.frozen),this.namespace[t]=n,this):tN.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Zl(t),r=this.parser||this.Parser;return uc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),uc("process",this.parser||this.Parser),dc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,a){const o=Zl(t),c=r.parse(o);r.run(c,o,function(d,f,h){if(d||!f||!h)return u(d);const m=f,g=r.stringify(m,h);iN(g)?h.value=g:h.result=g,u(d,h)});function u(d,f){d||!f?a(d):l?l(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),uc("processSync",this.parser||this.Parser),dc("processSync",this.compiler||this.Compiler),this.process(t,i),bh("processSync","process",n),r;function i(l,a){n=!0,mh(l),r=a}}run(t,n,r){wh(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(a,o){const c=Zl(n);i.run(t,c,u);function u(d,f,h){const m=f||t;d?o(d):a?a(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),bh("runSync","run",r),i;function l(a,o){mh(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=Zl(n),i=this.compiler||this.Compiler;return dc("stringify",i),wh(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(fc("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=lc(!0,i.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];l(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[m,...g]=d;const v=r[h][1];Su(v)&&Su(m)&&(m=lc(!0,v,m)),r[h]=[u,m,...g]}}}}const nN=new Hd().freeze();function uc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wh(e){if(!Su(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function bh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zl(e){return rN(e)?e:new xx(e)}function rN(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function iN(e){return typeof e=="string"||sN(e)}function sN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",jh=[],Sh={allowDangerousHtml:!0},aN=/^(https?|ircs?|mailto|xmpp)$/i,oN=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cN(e){const t=uN(e),n=dN(e);return fN(t.runSync(t.parse(n),n),e)}function uN(e){const t=e.rehypePlugins||jh,n=e.remarkPlugins||jh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Sh}:Sh;return nN().use(WS).use(n).use(F2,r).use(t)}function dN(e){const t=e.children||"",n=new xx;return typeof t=="string"&&(n.value=t),n}function fN(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,l=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||mN;for(const d of oN)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+lN+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Bd(e,u),Eb(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in rc)if(Object.hasOwn(rc,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],v=rc[m];(v===null||v.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):l?l.includes(d.tagName):!1;if(!m&&r&&typeof f=="number"&&(m=!r(d,f,h)),m&&h&&typeof f=="number")return o&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function mN(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||aN.test(e.slice(0,t))?e:""}const hN=["script","iframe","object","embed","style"];function pN(e){if(!e)return"";if(e.startsWith("#")||e.startsWith("/"))return e;const t=e.indexOf(":");if(t===-1)return e;const n=e.slice(0,t).toLowerCase();return n==="https"||n==="http"||n==="mailto"?e:""}function Nh(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function gN(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function yN(e,t,n){const i=No((n||{}).ignore||[]),l=xN(t);let a=-1;for(;++a<l.length;)gx(e,"text",o);function o(u,d){let f=-1,h;for(;++f<d.length;){const m=d[f],g=h?h.children:void 0;if(i(m,g?g.indexOf(m):void 0,h))return;h=m}if(h)return c(u,d)}function c(u,d){const f=d[d.length-1],h=l[a][0],m=l[a][1];let g=0;const w=f.children.indexOf(u);let x=!1,k=[];h.lastIndex=0;let j=h.exec(u.value);for(;j;){const z=j.index,A={index:j.index,input:j.input,stack:[...d,u]};let _=m(...j,A);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?h.lastIndex=z+1:(g!==z&&k.push({type:"text",value:u.value.slice(g,z)}),Array.isArray(_)?k.push(..._):_&&k.push(_),g=z+j[0].length,x=!0),!h.global)break;j=h.exec(u.value)}return x?(g<u.value.length&&k.push({type:"text",value:u.value.slice(g)}),f.children.splice(w,1,...k)):k=[u],w+k.length}}function xN(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([vN(i[0]),kN(i[1])])}return t}function vN(e){return typeof e=="string"?new RegExp(gN(e),"g"):e}function kN(e){return typeof e=="function"?e:function(){return e}}const mc="phrasing",hc=["autolink","link","image","label"];function wN(){return{transforms:[EN],enter:{literalAutolink:jN,literalAutolinkEmail:pc,literalAutolinkHttp:pc,literalAutolinkWww:pc},exit:{literalAutolink:_N,literalAutolinkEmail:CN,literalAutolinkHttp:SN,literalAutolinkWww:NN}}}function bN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mc,notInConstruct:hc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mc,notInConstruct:hc},{character:":",before:"[ps]",after:"\\/",inConstruct:mc,notInConstruct:hc}]}}function jN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pc(e){this.config.enter.autolinkProtocol.call(this,e)}function SN(e){this.config.exit.autolinkProtocol.call(this,e)}function NN(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function CN(e){this.config.exit.autolinkEmail.call(this,e)}function _N(e){this.exit(e)}function EN(e){yN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,TN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),zN]],{ignore:["link","linkReference"]})}function TN(e,t,n,r,i){let l="";if(!vx(i)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!LN(n)))return!1;const a=IN(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function zN(e,t,n,r){return!vx(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function LN(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function IN(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Nh(e,"(");let l=Nh(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function vx(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ui(n)||bo(n))&&(!t||n!==47)}kx.peek=UN;function DN(){this.buffer()}function AN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function PN(){this.buffer()}function MN(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function RN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ln(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $N(e){this.exit(e)}function FN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ln(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ON(e){this.exit(e)}function UN(){return"["}function kx(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),a(),l+=i.move("]"),l}function BN(){return{enter:{gfmFootnoteCallString:DN,gfmFootnoteCall:AN,gfmFootnoteDefinitionLabelString:PN,gfmFootnoteDefinition:MN},exit:{gfmFootnoteCallString:RN,gfmFootnoteCall:$N,gfmFootnoteDefinitionLabelString:FN,gfmFootnoteDefinition:ON}}}function HN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kx},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,a){const o=l.createTracker(a);let c=o.move("[^");const u=l.enter("footnoteDefinition"),d=l.enter("label");return c+=o.move(l.safe(l.associationId(r),{before:c,after:"]"})),d(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?`
|
|
502
|
-
`:" ")+l.indentLines(l.containerFlow(r,o.current()),t?wx:VN))),u(),c}}function VN(e,t,n){return t===0?e:wx(e,t,n)}function wx(e,t,n){return(n?"":" ")+e}const WN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];bx.peek=YN;function GN(){return{canContainEols:["delete"],enter:{strikethrough:QN},exit:{strikethrough:KN}}}function qN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:WN}],handlers:{delete:bx}}}function QN(e){this.enter({type:"delete",children:[]},e)}function KN(e){this.exit(e)}function bx(e,t,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),l(),a}function YN(){return"~"}function XN(e){return e.length}function JN(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||XN,l=[],a=[],o=[],c=[];let u=0,d=-1;for(;++d<e.length;){const v=[],w=[];let x=-1;for(e[d].length>u&&(u=e[d].length);++x<e[d].length;){const k=ZN(e[d][x]);if(n.alignDelimiters!==!1){const j=i(k);w[x]=j,(c[x]===void 0||j>c[x])&&(c[x]=j)}v.push(k)}a[d]=v,o[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)l[f]=Ch(r[f]);else{const v=Ch(r);for(;++f<u;)l[f]=v}f=-1;const h=[],m=[];for(;++f<u;){const v=l[f];let w="",x="";v===99?(w=":",x=":"):v===108?w=":":v===114&&(x=":");let k=n.alignDelimiters===!1?1:Math.max(1,c[f]-w.length-x.length);const j=w+"-".repeat(k)+x;n.alignDelimiters!==!1&&(k=w.length+k+x.length,k>c[f]&&(c[f]=k),m[f]=k),h[f]=j}a.splice(1,0,h),o.splice(1,0,m),d=-1;const g=[];for(;++d<a.length;){const v=a[d],w=o[d];f=-1;const x=[];for(;++f<u;){const k=v[f]||"";let j="",z="";if(n.alignDelimiters!==!1){const A=c[f]-(w[f]||0),_=l[f];_===114?j=" ".repeat(A):_===99?A%2?(j=" ".repeat(A/2+.5),z=" ".repeat(A/2-.5)):(j=" ".repeat(A/2),z=j):z=" ".repeat(A)}n.delimiterStart!==!1&&!f&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||f)&&x.push(" "),n.alignDelimiters!==!1&&x.push(j),x.push(k),n.alignDelimiters!==!1&&x.push(z),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&x.push("|")}g.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
|
|
503
|
-
`)}function ZN(e){return e==null?"":String(e)}function Ch(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function eC(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),tC);return i(),a}function tC(e,t,n){return">"+(n?"":" ")+e}function nC(e,t){return _h(e,t.inConstruct,!0)&&!_h(e,t.notInConstruct,!1)}function _h(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Eh(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
504
|
-
`&&nC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
505
|
-
`}function rC(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>a&&(a=l):l=1,i=r+t.length,r=n.indexOf(t,i);return a}function iC(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function sC(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function lC(e,t,n,r){const i=sC(n),l=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(iC(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(l,aC);return f(),h}const o=n.createTracker(r),c=i.repeat(Math.max(rC(l,i)+1,3)),u=n.enter("codeFenced");let d=o.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
|
|
506
|
-
`,encode:["`"],...o.current()})),f()}return d+=o.move(`
|
|
507
|
-
`),l&&(d+=o.move(l+`
|
|
508
|
-
`)),d+=o.move(c),u(),d}function aC(e,t,n){return(n?"":" ")+e}function Vd(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function oC(e,t,n,r){const i=Vd(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
509
|
-
`,...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),a(),u}function cC(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function yl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ja(e,t,n){const r=ts(e),i=ts(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}jx.peek=uC;function jx(e,t,n,r){const i=cC(n),l=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let c=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=c.charCodeAt(0),d=Ja(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=yl(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Ja(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+yl(f));const m=a.move(i);return l(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+m}function uC(e,t,n){return n.options.emphasis||"*"}function dC(e,t){let n=!1;return Bd(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,bu}),!!((!e.depth||e.depth<3)&&Pd(e)&&(t.options.setext||n))}function fC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(dC(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...l.current(),before:`
|
|
510
|
-
`,after:`
|
|
511
|
-
`});return f(),d(),h+`
|
|
512
|
-
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
513
|
-
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),c=n.enter("phrasing");l.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
514
|
-
`,...l.current()});return/^[\t ]/.test(u)&&(u=yl(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),o(),u}Sx.peek=mC;function Sx(e){return e.value||""}function mC(){return"<"}Nx.peek=hC;function Nx(e,t,n,r){const i=Vd(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),u+=c.move(")"),a(),u}function hC(){return"!"}Cx.peek=pC;function Cx(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const u=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,l(),i==="full"||!u||u!==f?c+=o.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function pC(){return"!"}_x.peek=gC;function _x(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const a=n.unsafe[l],o=n.compilePattern(a);let c;if(a.atBreak)for(;c=o.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return i+r+i}function gC(){return"`"}function Ex(e,t){const n=Pd(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Tx.peek=yC;function Tx(e,t,n,r){const i=Vd(n),l=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,c;if(Ex(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=d,f}o=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${l}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),c()),u+=a.move(")"),o(),u}function yC(e,t,n){return Ex(e,n)?"<":"["}zx.peek=xC;function zx(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,l(),i==="full"||!u||u!==f?c+=o.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function xC(){return"["}function Wd(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function vC(e){const t=Wd(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function kC(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Lx(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function wC(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?kC(n):Wd(n);const o=e.ordered?a==="."?")":".":vC(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Lx(n)===a&&d){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=l,i(),u}function bC(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function jC(e,t,n,r){const i=bC(n);let l=n.bulletCurrent||Wd(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(a-l.length)),o.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(a))+f:(m?l:l+" ".repeat(a-l.length))+f}}function SC(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),i(),a}const NC=No(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function CC(e,t,n,r){return(e.children.some(function(a){return NC(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function _C(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ix.peek=EC;function Ix(e,t,n,r){const i=_C(n),l=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let c=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=c.charCodeAt(0),d=Ja(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=yl(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Ja(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+yl(f));const m=a.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+m}function EC(e,t,n){return n.options.strong||"*"}function TC(e,t,n,r){return n.safe(e.value,r)}function zC(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function LC(e,t,n){const r=(Lx(n)+(n.options.ruleSpaces?" ":"")).repeat(zC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Dx={blockquote:eC,break:Eh,code:lC,definition:oC,emphasis:jx,hardBreak:Eh,heading:fC,html:Sx,image:Nx,imageReference:Cx,inlineCode:_x,link:Tx,linkReference:zx,list:wC,listItem:jC,paragraph:SC,root:CC,strong:Ix,text:TC,thematicBreak:LC};function IC(){return{enter:{table:DC,tableData:Th,tableHeader:Th,tableRow:PC},exit:{codeText:MC,table:AC,tableData:gc,tableHeader:gc,tableRow:gc}}}function DC(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function AC(e){this.exit(e),this.data.inTable=void 0}function PC(e){this.enter({type:"tableRow",children:[]},e)}function gc(e){this.exit(e)}function Th(e){this.enter({type:"tableCell",children:[]},e)}function MC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,RC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function RC(e,t){return t==="|"?t:e}function $C(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
515
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:c,tableRow:o}};function a(m,g,v,w){return u(d(m,v,w),m.align)}function o(m,g,v,w){const x=f(m,v,w),k=u([x]);return k.slice(0,k.indexOf(`
|
|
516
|
-
`))}function c(m,g,v,w){const x=v.enter("tableCell"),k=v.enter("phrasing"),j=v.containerPhrasing(m,{...w,before:l,after:l});return k(),x(),j}function u(m,g){return JN(m,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(m,g,v){const w=m.children;let x=-1;const k=[],j=g.enter("table");for(;++x<w.length;)k[x]=f(w[x],g,v);return j(),k}function f(m,g,v){const w=m.children;let x=-1;const k=[],j=g.enter("tableRow");for(;++x<w.length;)k[x]=c(w[x],m,g,v);return j(),k}function h(m,g,v){let w=Dx.inlineCode(m,g,v);return v.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function FC(){return{exit:{taskListCheckValueChecked:zh,taskListCheckValueUnchecked:zh,paragraph:UC}}}function OC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:BC}}}function zh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function UC(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,a;for(;++l<i.length;){const o=i[l];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function BC(e,t,n,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);l&&o.move(a);let c=Dx.listItem(e,t,n,{...r,...o.current()});return l&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+a}}function HC(){return[wN(),BN(),GN(),IC(),FC()]}function VC(e){return{extensions:[bN(),HN(e),qN(),$C(e),OC()]}}const WC={tokenize:XC,partial:!0},Ax={tokenize:JC,partial:!0},Px={tokenize:ZC,partial:!0},Mx={tokenize:e_,partial:!0},GC={tokenize:t_,partial:!0},Rx={name:"wwwAutolink",tokenize:KC,previous:Fx},$x={name:"protocolAutolink",tokenize:YC,previous:Ox},ir={name:"emailAutolink",tokenize:QC,previous:Ux},Bn={};function qC(){return{text:Bn}}let Wr=48;for(;Wr<123;)Bn[Wr]=ir,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);Bn[43]=ir;Bn[45]=ir;Bn[46]=ir;Bn[95]=ir;Bn[72]=[ir,$x];Bn[104]=[ir,$x];Bn[87]=[ir,Rx];Bn[119]=[ir,Rx];function QC(e,t,n){const r=this;let i,l;return a;function a(f){return!Cu(f)||!Ux.call(r,r.previous)||Gd(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Cu(f)?(e.consume(f),o):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(GC,d,u)(f):f===45||f===95||It(f)?(l=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),i=!0,c}function d(f){return l&&i&&Ft(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function KC(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Fx.call(r,r.previous)||Gd(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(WC,e.attempt(Ax,e.attempt(Px,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function YC(e,t,n){const r=this;let i="",l=!1;return a;function a(f){return(f===72||f===104)&&Ox.call(r,r.previous)&&!Gd(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(Ft(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),l?u:(l=!0,c)):n(f)}function u(f){return f===null||Ka(f)||Oe(f)||ui(f)||bo(f)?n(f):e.attempt(Ax,e.attempt(Px,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function XC(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function JC(e,t,n){let r,i,l;return a;function a(u){return u===46||u===95?e.check(Mx,c,o)(u):u===null||Oe(u)||ui(u)||u!==45&&bo(u)?c(u):(l=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function c(u){return i||r||!l?n(u):t(u)}}function ZC(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Mx,t,l)(a):a===null||Oe(a)||ui(a)?t(a):(e.consume(a),i)}function l(a){return a===41&&r++,e.consume(a),i}}function e_(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),i):o===60||o===null||Oe(o)||ui(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Oe(o)||ui(o)?t(o):r(o)}function l(o){return Ft(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):Ft(o)?(e.consume(o),a):n(o)}}function t_(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return It(l)?n(l):t(l)}}function Fx(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Oe(e)}function Ox(e){return!Ft(e)}function Ux(e){return!(e===47||Cu(e))}function Cu(e){return e===43||e===45||e===46||e===95||It(e)}function Gd(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const n_={tokenize:u_,partial:!0};function r_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:a_,continuation:{tokenize:o_},exit:c_}},text:{91:{name:"gfmFootnoteCall",tokenize:l_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:i_,resolveTo:s_}}}}function i_(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return n(c);const u=Ln(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!l.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function s_(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function l_(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(l>999||f===93&&!a||f===null||f===91||Oe(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Ln(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Oe(f)||(a=!0),l++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),l++,u):u(f)}}function a_(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,a=0,o;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!o||g===null||g===91||Oe(g))return n(g);if(g===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return l=Ln(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Oe(g)||(o=!0),a++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),a++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(l)||i.push(l),Te(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function o_(e,t,n){return e.check(Nl,t,e.attempt(n_,t,n))}function c_(e){e.exit("gfmFootnoteDefinition")}function u_(e,t,n){const r=this;return Te(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function d_(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let u=c;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[c][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[c][1].end)},f={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[c][1].start)},h=[["enter",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",f,o]],m=o.parser.constructs.insideSpan.null;m&&sn(h,h.length,0,jo(m,a.slice(u+1,c),o)),sn(h,h.length,0,[["exit",f,o],["enter",a[c][1],o],["exit",a[c][1],o],["exit",d,o]]),sn(a,u-1,c-u+3,h),c=u+h.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function l(a,o,c){const u=this.previous,d=this.events;let f=0;return h;function h(g){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(g):(a.enter("strikethroughSequenceTemporary"),m(g))}function m(g){const v=ts(u);if(g===126)return f>1?c(g):(a.consume(g),f++,m);if(f<2&&!n)return c(g);const w=a.exit("strikethroughSequenceTemporary"),x=ts(g);return w._open=!x||x===2&&!!v,w._close=!v||v===2&&!!x,o(g)}}}class f_{constructor(){this.map=[]}add(t,n,r){m_(this,t,n,r)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0}}function m_(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function h_(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function p_(){return{flow:{null:{name:"table",tokenize:g_,resolveAll:y_}}}}function g_(e,t,n){const r=this;let i=0,l=0,a;return o;function o(N){let U=r.events.length-1;for(;U>-1;){const ie=r.events[U][1].type;if(ie==="lineEnding"||ie==="linePrefix")U--;else break}const O=U>-1?r.events[U][1].type:null,re=O==="tableHead"||O==="tableRow"?_:c;return re===_&&r.parser.lazy[r.now().line]?n(N):re(N)}function c(N){return e.enter("tableHead"),e.enter("tableRow"),u(N)}function u(N){return N===124||(a=!0,l+=1),d(N)}function d(N){return N===null?n(N):fe(N)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),m):n(N):Se(N)?Te(e,d,"whitespace")(N):(l+=1,a&&(a=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(N)))}function f(N){return N===null||N===124||Oe(N)?(e.exit("data"),d(N)):(e.consume(N),N===92?h:f)}function h(N){return N===92||N===124?(e.consume(N),f):f(N)}function m(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),a=!1,Se(N)?Te(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?w(N):N===124?(a=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),v):A(N)}function v(N){return Se(N)?Te(e,w,"whitespace")(N):w(N)}function w(N){return N===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),x):N===45?(l+=1,x(N)):N===null||fe(N)?z(N):A(N)}function x(N){return N===45?(e.enter("tableDelimiterFiller"),k(N)):A(N)}function k(N){return N===45?(e.consume(N),k):N===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(N))}function j(N){return Se(N)?Te(e,z,"whitespace")(N):z(N)}function z(N){return N===124?g(N):N===null||fe(N)?!a||i!==l?A(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):A(N)}function A(N){return n(N)}function _(N){return e.enter("tableRow"),D(N)}function D(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),D):N===null||fe(N)?(e.exit("tableRow"),t(N)):Se(N)?Te(e,D,"whitespace")(N):(e.enter("data"),C(N))}function C(N){return N===null||N===124||Oe(N)?(e.exit("data"),D(N)):(e.consume(N),N===92?M:C)}function M(N){return N===92||N===124?(e.consume(N),C):C(N)}}function y_(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,d,f;const h=new f_;for(;++n<e.length;){const m=e[n],g=m[1];m[0]==="enter"?g.type==="tableHead"?(o=!1,c!==0&&(Lh(h,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,l=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,t]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(l[1]!==0&&(a[0]=a[1],f=ea(h,t,l,i,void 0,f),l=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(a[0]=a[1],f=ea(h,t,l,i,void 0,f)),l=a,a=[l[1],n,0,0])):g.type==="tableHead"?(o=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,l[1]!==0?(a[0]=a[1],f=ea(h,t,l,i,n,f)):a[1]!==0&&(f=ea(h,t,a,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&Lh(h,t,c,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=h_(t.events,n))}return e}function ea(e,t,n,r,i,l){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},Si(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const c=Si(t.events,n[1]);if(l={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const u=Si(t.events,n[2]),d=Si(t.events,n[3]),f={type:o,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],m=t.events[n[3]];if(h[1].end=Object.assign({},m[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,v=n[3]-n[2]-1;e.add(g,v,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(l.end=Object.assign({},Si(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function Lh(e,t,n,r,i){const l=[],a=Si(t.events,n);i&&(i.end=Object.assign({},a),l.push(["exit",i,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function Si(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const x_={name:"tasklistCheck",tokenize:k_};function v_(){return{text:{91:x_}}}function k_(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),l)}function l(c){return Oe(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return fe(c)?t(c):Se(c)?e.check({tokenize:w_},t,n)(c):n(c)}}function w_(e,t,n){return Te(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function b_(e){return Xy([qC(),r_(),d_(e),p_(),v_()])}const j_={};function S_(e){const t=this,n=e||j_,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(b_(n)),l.push(HC()),a.push(VC(n))}const N_={search_file:{label:"Searched files",activeLabel:"Searching files",icon:Fn,color:"#3b82f6"},search_files:{label:"Searched files",activeLabel:"Searching files",icon:Fn,color:"#3b82f6"},search_file_content:{label:"Searched content",activeLabel:"Searching content",icon:Fn,color:"#3b82f6"},search_directory:{label:"Searched directory",activeLabel:"Searching directory",icon:Fn,color:"#3b82f6"},read_file:{label:"Read file",activeLabel:"Reading file",icon:$n,color:"#8b5cf6"},write_file:{label:"Wrote file",activeLabel:"Writing file",icon:Yk,color:"#f59e0b"},get_file_info:{label:"Got file info",activeLabel:"Getting file info",icon:$n,color:"#8b5cf6"},browse_directory:{label:"Browsed directory",activeLabel:"Browsing directory",icon:Yn,color:"#a78bfa"},list_directory:{label:"Listed directory",activeLabel:"Listing directory",icon:Yn,color:"#a78bfa"},list_recent_files:{label:"Listed recent files",activeLabel:"Listing recent files",icon:Yn,color:"#a78bfa"},analyze_data_file:{label:"Analyzed data",activeLabel:"Analyzing data",icon:Cm,color:"#ec4899"},run_shell_command:{label:"Ran command",activeLabel:"Running command",icon:qa,color:"#22c55e"},execute_code:{label:"Executed code",activeLabel:"Executing code",icon:qk,color:"#f59e0b"},query_documents:{label:"Queried documents",activeLabel:"Querying documents",icon:ki,color:"#06b6d4"},query_specific_file:{label:"Queried file",activeLabel:"Querying file",icon:ki,color:"#06b6d4"},search_indexed_chunks:{label:"Searched chunks",activeLabel:"Searching chunks",icon:ki,color:"#06b6d4"},semantic_search:{label:"Searched documents",activeLabel:"Searching documents",icon:ki,color:"#06b6d4"},evaluate_retrieval:{label:"Evaluated retrieval",activeLabel:"Evaluating retrieval",icon:ki,color:"#06b6d4"},index_document:{label:"Indexed document",activeLabel:"Indexing document",icon:bi,color:"#f97316"},index_directory:{label:"Indexed directory",activeLabel:"Indexing directory",icon:bi,color:"#f97316"},index_file:{label:"Indexed file",activeLabel:"Indexing file",icon:bi,color:"#f97316"},list_indexed_documents:{label:"Listed documents",activeLabel:"Listing documents",icon:bi,color:"#f97316"},summarize_document:{label:"Summarized",activeLabel:"Summarizing",icon:$n,color:"#8b5cf6"},dump_document:{label:"Extracted text",activeLabel:"Extracting text",icon:$n,color:"#8b5cf6"},rag_status:{label:"Checked RAG status",activeLabel:"Checking RAG",icon:bi,color:"#f97316"},add_watch_directory:{label:"Added watch dir",activeLabel:"Adding watch dir",icon:Yn,color:"#a78bfa"},web_search:{label:"Searched web",activeLabel:"Searching web",icon:hy,color:"#14b8a6"},analyze_data:{label:"Analyzed data",activeLabel:"Analyzing data",icon:Cm,color:"#ec4899"}},Ih={label:"Used tool",activeLabel:"Using tool",icon:mu,color:"#3b82f6"};function C_(e){return e?e.startsWith("mcp_")?{label:"MCP tool",activeLabel:"Running MCP tool",icon:hy,color:"#7c3aed"}:N_[e]||Ih:Ih}function Bx({steps:e,isActive:t,variant:n="inline"}){const[r,i]=p.useState(!1),[l,a]=p.useState(new Set),o=p.useRef(0),c=p.useRef(new Map),u=p.useRef(t);p.useEffect(()=>{u.current=t},[t]),p.useEffect(()=>()=>{c.current.forEach(C=>clearTimeout(C)),c.current.clear()},[]);const d=p.useMemo(()=>{const C=[];for(const M of e){const N=C[C.length-1];if(M.type==="thinking"&&N&&N.type==="thinking"){const U=(N.detail||"")+(M.detail||"");C[C.length-1]={...M,detail:U||N.detail};continue}if(M.type==="status"&&N&&N.type==="status"&&M.active!==!1){C[C.length-1]={...M,label:M.label||N.label};continue}if(M.type==="thinking"&&N&&N.type==="status"&&N.active!==!1){C[C.length-1]={...N,type:"thinking",detail:M.detail||N.detail,active:M.active};continue}if(M.type==="status"&&N&&N.type==="thinking"){C[C.length-1]={...N,label:M.label||N.label,active:M.active??N.active};continue}C.push(M)}return C},[e]),f=d.filter(C=>C.type==="tool"),h=d.filter(C=>C.type==="policy_alert"),m=h.length>0,[g,v]=p.useState(""),[w,x]=p.useState("all"),k=p.useMemo(()=>!g&&w==="all"?d:d.filter(C=>{var M;return C.type!=="tool"?!0:!(g&&!((M=C.tool)!=null&&M.toLowerCase().includes(g.toLowerCase()))||w==="success"&&C.success!==!0||w==="error"&&C.success!==!1)}),[d,g,w]),z=d.filter(C=>C.type==="error").length>0;p.useEffect(()=>{m&&i(!0)},[m]),p.useEffect(()=>{o.current=d.length;const C=d.filter(M=>M.type==="tool"&&!M.mcpServer).map(M=>M.id);C.length>0&&a(M=>{const N=new Set(M);return C.forEach(U=>N.add(U)),N})},[d]);const A=p.useCallback(C=>{const M=c.current.get(C);M&&(clearTimeout(M),c.current.delete(C)),a(N=>{const U=new Set(N);return U.has(C)?U.delete(C):U.add(C),U})},[]);if(d.length===0)return null;const _=d.length,D=m?`Blocked by policy · ${h.length} alert${h.length!==1?"s":""}`:`${_} step${_!==1?"s":""}`+(f.length>0?` · ${f.length} tool${f.length!==1?"s":""}`:"");return s.jsxs("div",{className:`agent-activity ${n} ${t?"active":"done"} ${z?"has-errors":""} ${m?"has-policy-alerts":""}`,children:[s.jsxs("button",{className:"agent-summary-bar",onClick:()=>i(!r),"aria-expanded":r,"aria-label":r?"Collapse agent activity":"Expand agent activity",children:[s.jsxs("div",{className:"agent-summary-left",children:[z?s.jsx(kt,{size:14,className:"agent-icon-error"}):s.jsx(Ws,{size:14,className:"agent-icon-done"}),s.jsx("span",{className:"agent-summary-text",children:D})]}),s.jsx("div",{className:"agent-summary-right",children:r?s.jsx(ai,{size:14}):s.jsx(ss,{size:14})})]}),d.length>0&&s.jsxs("div",{className:`agent-flow-wrap ${r?"flow-expanded":"flow-collapsed"}`,children:[r&&f.length>=2&&s.jsxs("div",{className:"activity-filter-bar",children:[s.jsx("input",{type:"text",className:"activity-filter-input",placeholder:"Filter by tool name...","aria-label":"Filter by tool name",value:g,onChange:C=>v(C.target.value)}),s.jsxs("select",{className:"activity-filter-select","aria-label":"Filter by status",value:w,onChange:C=>x(C.target.value),children:[s.jsx("option",{value:"all",children:"All"}),s.jsx("option",{value:"success",children:"Success"}),s.jsx("option",{value:"error",children:"Error"})]})]}),s.jsx("div",{className:"agent-flow",children:k.map(C=>C.type==="thinking"?s.jsx(__,{step:C},C.id):C.type==="status"?s.jsx(E_,{step:C},C.id):C.type==="tool"?s.jsx(L_,{step:C,isExpanded:l.has(C.id),onToggle:()=>A(C.id)},C.id):C.type==="plan"?s.jsx(I_,{step:C},C.id):C.type==="error"?s.jsx(D_,{step:C},C.id):C.type==="policy_alert"?s.jsx(A_,{step:C},C.id):null)})]})]})}function __({step:e}){const t=e.detail||e.label||"",n=p.useRef(null);return p.useEffect(()=>{e.active&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[t,e.active]),t?s.jsxs("div",{ref:n,className:"flow-thought-hacker",children:[s.jsx("span",{children:t}),e.active&&s.jsx("span",{className:"flow-thought-cursor"})]}):null}function E_({step:e}){const t=e.detail||e.label||"";return t?s.jsx("div",{className:`flow-thought ${e.active?"active":""}`,children:s.jsx("span",{className:"flow-thought-text",children:t})}):null}function T_(e){const t=/[A-Z]:[\\\/](?:[^\s*?"<>|,;)}\]]+[\\\/])*[^\s*?"<>|,;)}\]]*/gi,n=[];let r=0,i;for(;(i=t.exec(e))!==null;){i.index>r&&n.push(e.slice(r,i.index));const l=i[0],a=l.replace(/[)}\]]+$/,""),o=()=>{_d(a).catch(c=>E.ui.error("Failed to open path",c))};n.push(s.jsxs("span",{className:"tool-result-path",onClick:o,title:`Open: ${a}`,role:"button",tabIndex:0,onKeyDown:c=>{c.key==="Enter"&&o()},children:[s.jsx(Yn,{size:10,style:{flexShrink:0,opacity:.7}}),a]},i.index)),a.length<l.length&&n.push(l.slice(a.length)),r=i.index+l.length}return n.length===0?e:(r<e.length&&n.push(e.slice(r)),s.jsx(s.Fragment,{children:n}))}function z_({fileList:e}){const[t,n]=p.useState(!1),r=5,i=t?e.files:e.files.slice(0,r),l=e.total-r,a=(c,u)=>{const d=c.name||c.filename||c.file_name;return d?String(d):c.file_path?String(c.file_path).replace(/\\/g,"/").split("/").pop()||`File ${u+1}`:`File ${u+1}`},o=c=>c.directory?String(c.directory):"";return s.jsxs("div",{className:"file-list-view",children:[i.map((c,u)=>s.jsxs("div",{className:"file-list-item",children:[s.jsx(fy,{size:11,className:"file-list-icon"}),s.jsx("span",{className:"file-list-name",children:a(c,u)}),o(c)&&s.jsx("span",{className:"file-list-dir",children:o(c)})]},u)),l>0&&!t&&s.jsxs("button",{className:"file-list-more",onClick:()=>n(!0),children:["+",l," more"]}),t&&e.files.length<e.total&&s.jsxs("span",{className:"file-list-truncated",children:["Showing ",e.files.length," of ",e.total," files"]})]})}function L_({step:e,isExpanded:t,onToggle:n}){var c,u;const r=C_(e.tool),i=r.icon,l=r.color,a=e.active?r.activeLabel:r.label,o=!!(e.detail||e.result||e.commandOutput||(u=(c=e.fileList)==null?void 0:c.files)!=null&&u.length);return s.jsxs("div",{className:`flow-tool ${e.active?"active":""} ${e.success===!1?"error":""}`,children:[s.jsxs("button",{className:"flow-tool-header",onClick:o?n:void 0,style:o?void 0:{cursor:"default"},children:[s.jsxs("div",{className:"flow-tool-left",children:[e.active?s.jsx(mt,{size:13,className:"flow-tool-spinner",style:{color:l}}):e.success===!1?s.jsx(kt,{size:13,style:{color:"#ef4444"}}):e.success===!0?s.jsx(nr,{size:13,style:{color:"#22c55e"}}):s.jsx(i,{size:13,style:{color:l}}),s.jsx("span",{className:"flow-tool-label",children:a}),s.jsx("span",{className:"flow-tool-badge",style:{"--badge-color":l},children:e.tool}),e.mcpServer&&s.jsxs("span",{className:"flow-tool-mcp-server",children:["via ",e.mcpServer]})]}),s.jsxs("div",{className:"flow-tool-right",children:[e.latencyMs!=null&&!e.active&&s.jsxs("span",{className:"flow-tool-latency",children:[Math.round(e.latencyMs),"ms"]}),o&&s.jsx("span",{className:`flow-tool-chevron ${t?"expanded":""}`,children:s.jsx(ss,{size:12})})]})]}),t&&o&&s.jsxs("div",{className:"flow-tool-detail",children:[e.detail&&!e.commandOutput&&s.jsxs("div",{className:"step-detail-args",children:[s.jsx("span",{className:"detail-section-label",children:"Arguments"}),s.jsx("div",{className:"detail-args-content",children:R_(e.detail)})]}),e.commandOutput&&s.jsx(M_,{output:e.commandOutput}),e.result&&!e.commandOutput&&s.jsxs("div",{className:`step-detail-result ${e.success===!1?"result-error":"result-success"}`,children:[s.jsx("span",{className:"detail-section-label",children:e.success===!1?"Error":"Result"}),s.jsx("div",{className:"detail-result-content",children:T_(e.result)})]}),e.retrievalChunks&&e.retrievalChunks.length>0&&s.jsx(P_,{chunks:e.retrievalChunks}),e.fileList&&e.fileList.files.length>0&&s.jsx(z_,{fileList:e.fileList})]})]})}function I_({step:e}){const[t,n]=p.useState(!1);return!e.planSteps||e.planSteps.length===0?null:s.jsxs("div",{className:"flow-plan",children:[s.jsxs("button",{className:"flow-plan-header flow-plan-toggle",onClick:()=>n(r=>!r),"aria-expanded":t,title:t?"Collapse plan":"Expand plan",children:[s.jsx(py,{size:12}),s.jsx("span",{children:"Plan"}),s.jsxs("span",{className:"flow-plan-count",children:["(",e.planSteps.length,")"]}),t?s.jsx(ai,{size:11}):s.jsx(ss,{size:11})]}),t&&s.jsx("ol",{className:"flow-plan-list",children:e.planSteps.map((r,i)=>s.jsx("li",{className:"flow-plan-item",children:r},i))})]})}function D_({step:e}){return s.jsxs("div",{className:"flow-error",children:[s.jsx(kt,{size:13}),s.jsx("span",{children:e.detail||e.label||"An error occurred"})]})}function A_({step:e}){return s.jsxs("div",{className:"flow-policy-alert",children:[s.jsxs("div",{className:"flow-policy-alert-header",children:[s.jsx(Ga,{size:14}),s.jsx("span",{className:"flow-policy-alert-title",children:"Policy Shield"}),s.jsx("span",{className:"flow-policy-alert-decision",children:e.decision||"BLOCK"})]}),s.jsxs("div",{className:"flow-policy-alert-body",children:[s.jsxs("div",{className:"flow-policy-alert-line",children:[s.jsx("span",{children:"Tool"}),s.jsx("code",{children:e.tool||"unknown tool"})]}),s.jsx("div",{className:"flow-policy-alert-reason",children:e.reason||e.detail}),e.ruleIds&&e.ruleIds.length>0&&s.jsxs("div",{className:"flow-policy-alert-line",children:[s.jsx("span",{children:"Rules"}),s.jsx("code",{children:e.ruleIds.join(", ")})]}),e.policyVersion&&s.jsxs("div",{className:"flow-policy-alert-line",children:[s.jsx("span",{children:"Policy"}),s.jsx("code",{children:e.policyVersion})]}),s.jsxs("div",{className:"flow-policy-alert-line",children:[s.jsx("span",{children:"Receipt"}),e.receiptId?s.jsx("code",{children:e.receiptId}):s.jsx("em",{children:"Receipt unavailable"})]})]})]})}function P_({chunks:e}){const[t,n]=p.useState(new Set),r=i=>{n(l=>{const a=new Set(l);return a.has(i)?a.delete(i):a.add(i),a})};return s.jsxs("div",{className:"chunks-view",children:[s.jsxs("span",{className:"detail-section-label",children:["Retrieved Chunks (",e.length,")"]}),s.jsx("div",{className:"chunks-list",children:e.map(i=>{const l=t.has(i.id);return s.jsxs("div",{className:`chunk-card ${l?"expanded":""}`,children:[s.jsxs("button",{className:"chunk-header",onClick:()=>r(i.id),children:[s.jsxs("div",{className:"chunk-header-left",children:[s.jsx(ki,{size:11,style:{color:"#06b6d4",flexShrink:0}}),i.source&&s.jsx("span",{className:"chunk-source",children:i.source}),i.page!=null&&s.jsxs("span",{className:"chunk-page",children:["p.",i.page]}),i.score!=null&&i.score>0&&s.jsx("span",{className:"chunk-score",children:i.score.toFixed(2)})]}),s.jsx("span",{className:`chunk-chevron ${l?"expanded":""}`,children:s.jsx(ss,{size:11})})]}),s.jsx("div",{className:`chunk-body ${l?"show":""}`,children:l?s.jsx("pre",{className:"chunk-content",children:i.content}):s.jsx("div",{className:"chunk-preview",children:i.preview})})]},i.id)})})]})}function M_({output:e}){const[t,n]=p.useState(!1),r=p.useRef(null);p.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const i=p.useCallback(()=>{const o=e.stdout||e.stderr||"";navigator.clipboard.writeText(o).catch(()=>{}),n(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),2e3)},[e]),l=!!(e.stdout||e.stderr),a=e.returnCode!==0;return s.jsxs("div",{className:`cmd-output ${a?"cmd-error":""}`,children:[s.jsxs("div",{className:"cmd-header",children:[s.jsxs("div",{className:"cmd-header-left",children:[s.jsx(qa,{size:12,className:"cmd-header-icon"}),s.jsx("span",{className:"cmd-header-title",children:"Terminal"}),e.cwd&&s.jsx("span",{className:"cmd-cwd",children:e.cwd})]}),s.jsxs("div",{className:"cmd-header-right",children:[e.durationSeconds!=null&&s.jsxs("span",{className:"cmd-duration",children:[e.durationSeconds.toFixed(1),"s"]}),e.returnCode!==0&&s.jsxs("span",{className:"cmd-exit-code",children:["exit ",e.returnCode]}),l&&s.jsx("button",{className:`cmd-copy ${t?"copied":""}`,onClick:i,title:t?"Copied!":"Copy output",children:t?s.jsx(li,{size:11}):s.jsx(jl,{size:11})})]})]}),s.jsxs("div",{className:"cmd-line",children:[s.jsx("span",{className:"cmd-prompt",children:"$"}),s.jsx("span",{className:"cmd-text",children:e.command})]}),e.stdout&&s.jsx("pre",{className:"cmd-stdout",children:e.stdout}),e.stderr&&s.jsx("pre",{className:"cmd-stderr",children:e.stderr}),e.truncated&&s.jsx("div",{className:"cmd-truncated",children:"Output was truncated (exceeded size limit)"}),!l&&s.jsx("div",{className:"cmd-empty",children:"No output"})]})}function R_(e){const t=e.includes(`
|
|
517
|
-
`)?e.split(`
|
|
518
|
-
`).filter(Boolean):e.split(", ").filter(Boolean);return t.length<=1?s.jsx("span",{className:"arg-value",children:e}):s.jsx("div",{className:"args-grid",children:t.map((n,r)=>{const i=n.indexOf(":");if(i>0&&i<30){const l=n.slice(0,i).trim(),a=n.slice(i+1).trim();return s.jsxs("div",{className:"arg-row",children:[s.jsx("span",{className:"arg-key",children:l}),s.jsx("span",{className:"arg-value",children:a})]},r)}return s.jsx("div",{className:"arg-row",children:s.jsx("span",{className:"arg-value",children:n})},r)})})}function $_(e){if(!e)return!1;if(e.includes("NOT_CONNECTED:")||e.includes("AGENT_NOT_GRANTED:")||e.includes("AUTH_REQUIRED:"))return!0;const t=e.toLowerCase();return!!(t.includes("connectors → google")||t.includes("connections → google")||t.includes("email agent needs additional google permissions"))}function F_(e){var n;const t=window;(n=t.gaia)!=null&&n.openExternal?t.gaia.openExternal(e):window.open(e,"_blank","noopener")}function O_({connectorId:e="google"}){const[t,n]=p.useState(!1),[r,i]=p.useState(null),[l,a]=p.useState(!1),o=p.useCallback(async()=>{n(!0),i(null);try{const c=await Ny(e),u=c.available_scopes&&c.available_scopes.length>0?c.available_scopes:c.default_scopes,d=await Cy(e,u);F_(d.authorization_url),a(!0)}catch(c){i(c instanceof Error?c.message:String(c))}finally{n(!1)}},[e]);return s.jsxs("div",{className:"email-connect-cta",role:"region","aria-label":"Connect Google",children:[s.jsxs("div",{className:"email-connect-cta__text",children:[s.jsx(kt,{size:14,className:"email-connect-cta__icon"}),s.jsx("span",{children:l?"A browser tab opened for Google sign-in. Return here when finished.":"Connect your Google account to use Email Triage."})]}),s.jsxs("button",{className:"email-connect-cta__button",onClick:()=>void o(),disabled:t,children:[t?s.jsx(mt,{size:12,className:"email-connect-cta__spinner"}):s.jsx(Vi,{size:12}),s.jsx("span",{children:l?"Reopen Google sign-in":"Connect Google"})]}),r&&s.jsx("div",{className:"email-connect-cta__error",role:"alert",children:r})]})}function Dh(e){if(!e||typeof e!="object")return!1;const t=e;return t.kind!=="email_pre_scan"?!1:Array.isArray(t.urgent)&&Array.isArray(t.actionable)&&Array.isArray(t.suggested_archives)&&Array.isArray(t.suggested_drafts)&&typeof t.informational_count=="number"}function U_(e){e&&window.dispatchEvent(new CustomEvent("gaia:send-message",{detail:{text:e}}))}function B_(e){const t=e.thread_id||e.message_id;if(!t)return;const n=`https://mail.google.com/mail/u/0/#inbox/${encodeURIComponent(t)}`;window.open(n,"_blank","noopener,noreferrer")}function H_(e){if(!e)return"(unknown)";const t=e.trim(),n=t.indexOf("<");return n>0?t.slice(0,n).trim().replace(/^"|"$/g,""):t}function Ah({payload:e}){const[t,n]=p.useState(()=>new Set),r=p.useCallback(m=>{n(g=>{const v=new Set(g);return v.add(m),v})},[]),[i,l]=p.useState(null),a=p.useRef(null);p.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const o=p.useCallback((m,g)=>{i||(l(m),a.current=setTimeout(()=>{l(v=>v===m?null:v)},5e3),U_(g))},[i]),c=p.useCallback(m=>{o(m.message_id,`Archive message id ${m.message_id}.`)},[o]),u=p.useCallback(m=>{o(m.message_id,`Draft a reply to message id ${m.message_id}.`)},[o]),d=p.useMemo(()=>[{key:"urgent",title:"Urgent",icon:s.jsx(kt,{size:14}),items:e.urgent.filter(m=>!t.has(m.message_id)),intent:"urgent"},{key:"actionable",title:"Needs a response",icon:s.jsx(iw,{size:14}),items:e.actionable.filter(m=>!t.has(m.message_id)),intent:"actionable"},{key:"archives",title:"Suggested archives",icon:s.jsx(ly,{size:14}),items:e.suggested_archives.filter(m=>!t.has(m.message_id)),intent:"archive"}],[e,t]),f=d.reduce((m,g)=>m+g.items.length,0),h=e.informational_count;return s.jsxs("div",{className:"email-pre-scan",role:"region","aria-label":"Inbox pre-scan",children:[s.jsxs("div",{className:"email-pre-scan__header",children:[s.jsx(Zk,{size:16,"aria-hidden":"true"}),s.jsx("span",{className:"email-pre-scan__title",children:"Inbox pre-scan"}),s.jsxs("span",{className:"email-pre-scan__totals",children:[f," surfaced",h>0?` · ${h} informational`:""]})]}),d.map(m=>m.items.length>0?s.jsx(V_,{def:m,pendingRow:i,onApproveArchive:c,onReply:u,onDismiss:r,onOpen:B_},m.key):null),f===0&&s.jsxs("div",{className:"email-pre-scan__empty",children:[s.jsx(nr,{size:14}),s.jsx("span",{children:"Nothing to surface — your inbox looks quiet."})]}),s.jsx(G_,{applied:e.preferences_applied})]})}function V_({def:e,pendingRow:t,onApproveArchive:n,onReply:r,onDismiss:i,onOpen:l}){return s.jsxs("section",{className:`email-pre-scan__section email-pre-scan__section--${e.intent}`,children:[s.jsxs("header",{className:"email-pre-scan__section-header",children:[e.icon,s.jsx("span",{className:"email-pre-scan__section-title",children:e.title}),s.jsx("span",{className:"email-pre-scan__section-count",children:e.items.length})]}),s.jsx("ul",{className:"email-pre-scan__list",children:e.items.map(a=>s.jsx(W_,{item:a,intent:e.intent,isPending:t!==null,onApproveArchive:n,onReply:r,onDismiss:i,onOpen:l},a.message_id))})]})}function W_({item:e,intent:t,isPending:n,onApproveArchive:r,onReply:i,onDismiss:l,onOpen:a}){const o=e.reason??e.why??"",c=H_(e.sender);return s.jsxs("li",{className:"email-pre-scan__row",children:[s.jsxs("div",{className:"email-pre-scan__row-text",children:[s.jsxs("div",{className:"email-pre-scan__row-meta",children:[s.jsx("span",{className:"email-pre-scan__row-sender",title:e.sender,children:c}),s.jsx("span",{className:"email-pre-scan__row-subject",title:e.subject,children:e.subject||"(no subject)"})]}),o&&s.jsx("div",{className:"email-pre-scan__row-reason",title:o,children:o})]}),s.jsxs("div",{className:"email-pre-scan__row-actions",role:"group","aria-label":"Actions for this email",children:[t==="archive"?s.jsxs("button",{className:"email-pre-scan__action email-pre-scan__action--primary",onClick:()=>r(e),disabled:n,title:"Approve archive","aria-label":`Approve archive for "${e.subject}"`,children:[s.jsx(ly,{size:12}),s.jsx("span",{children:"Archive"})]}):s.jsxs("button",{className:"email-pre-scan__action email-pre-scan__action--primary",onClick:()=>i(e),disabled:n,title:"Draft a reply","aria-label":`Draft a reply to "${e.subject}"`,children:[s.jsx(xw,{size:12}),s.jsx("span",{children:"Reply"})]}),s.jsxs("button",{className:"email-pre-scan__action",onClick:()=>a(e),title:"Open in Gmail","aria-label":`Open "${e.subject}" in Gmail`,children:[s.jsx(Vi,{size:12}),s.jsx("span",{children:"Open"})]}),s.jsx("button",{className:"email-pre-scan__action email-pre-scan__action--ghost",onClick:()=>l(e.message_id),title:"Dismiss this row","aria-label":`Dismiss "${e.subject}"`,children:s.jsx(tt,{size:12})})]})]})}function G_({applied:e}){const t=(e==null?void 0:e.priority_senders)??[],n=(e==null?void 0:e.low_priority_senders)??[],r=(e==null?void 0:e.category_defaults)??{};return t.length>0||n.length>0||Object.keys(r).length>0?s.jsxs("div",{className:"email-pre-scan__preferences","aria-label":"Active session preferences",children:[s.jsx("span",{className:"email-pre-scan__preferences-label",children:"Session preferences:"}),t.length>0&&s.jsxs("span",{className:"email-pre-scan__preferences-chip",title:"Always urgent",children:["+ ",t.length," priority sender",t.length===1?"":"s"]}),n.length>0&&s.jsxs("span",{className:"email-pre-scan__preferences-chip",title:"Always low-priority",children:["− ",n.length," low-priority sender",n.length===1?"":"s"]}),Object.entries(r).map(([l,a])=>s.jsxs("span",{className:"email-pre-scan__preferences-chip",title:`${l} → ${a}`,children:[l," → ",a]},l))]}):null}function q_({active:e}){const t="Thinking...",[n,r]=p.useState(0),[i,l]=p.useState("typing"),a=p.useRef(e);return p.useEffect(()=>{if(i!=="typing")return;if(n>=t.length){l("idle");return}const o=setTimeout(()=>r(c=>c+1),30);return()=>clearTimeout(o)},[i,n]),p.useEffect(()=>{a.current&&!e&&l("erasing"),a.current=e},[e]),p.useEffect(()=>{if(i!=="erasing")return;if(n<=0){l("done");return}const o=setTimeout(()=>r(c=>c-1),20);return()=>clearTimeout(o)},[i,n]),p.useEffect(()=>{e&&i==="done"&&(r(0),l("typing"))},[e,i]),i==="done"?null:s.jsxs("span",{className:"thinking-indicator",children:[s.jsx("span",{className:"thinking-indicator-text",children:t.slice(0,n)}),e&&s.jsx("span",{className:"cursor"})]})}function Q_(e){if(!e)return!1;const t=e.toLowerCase();return t.startsWith("error:")||t.startsWith("error -")||t.includes("traceback (most recent")||t.includes("object has no attribute")||t.includes("is lemonade server running")||t.includes("connection refused")||t.includes("failed to fetch")}const K_=/\s*\{\s*"?tool"?\s*:\s*"[^"]+"\s*,\s*"?tool_args"?\s*:\s*\{[^}]*\}\s*\}/g;function Y_(e){const t=['"thought"','"answer"','"tool"'];let n="",r=0;for(;r<e.length;){const i=e.indexOf("{",r);if(i===-1){n+=e.slice(r);break}const l=e.slice(i,i+50);if(!t.some(d=>l.includes(d))){n+=e.slice(r,i+1),r=i+1;continue}n+=e.slice(r,i);let o=0,c=i;for(;c<e.length;c++)if(e[c]==="{")o++;else if(e[c]==="}"&&(o--,o===0))break;if(o!==0)break;const u=e.slice(i,c+1);try{const d=JSON.parse(u);d.answer&&(n+=d.answer)}catch{const d=u.indexOf('"answer"');if(d!==-1){const f=u.indexOf(":",d+8);if(f!==-1){let h=f+1;for(;h<u.length&&/\s/.test(u[h]);)h++;if(h<u.length&&u[h]==='"'){let m=u.slice(h+1);m.endsWith('"}')?m=m.slice(0,-2):m.endsWith('"')&&(m=m.slice(0,-1)),n+=m.replace(/\\"/g,'"').replace(/\\n/g,`
|
|
519
|
-
`).replace(/\\\\/g,"\\")}}}}r=c+1}return n}const X_=new Set(["email_pre_scan","email-pre-scan"]),J_=new Set(["python","py","javascript","js","typescript","ts","java","c","cpp","csharp","cs","go","rust","ruby","rb","php","swift","kotlin","scala","r","perl","lua","bash","sh","zsh","powershell","ps1","sql","html","css","scss","sass","less","xml","json","yaml","yml","toml","ini","csv","markdown","md","dockerfile","docker","makefile","cmake","nginx","apache","graphql","proto","protobuf","jsx","tsx","vue","svelte","dart","elixir","ex","erlang","haskell","hs","ocaml","ml","fsharp","fs","clojure","clj","lisp","scheme","racket","zig","nim","crystal","julia","matlab","octave","fortran","cobol","pascal","delphi","ada","assembly","asm","nasm","wasm","solidity","sol","verilog","vhdl","text","txt","plaintext","diff","patch","log","email_pre_scan","email-pre-scan"]);function Z_(e){return e.replace(/```(\w*)[ \t]*\n([\s\S]*?)```/g,(t,n,r)=>{const i=n.toLowerCase();return i&&X_.has(i)||i&&J_.has(i)?t:r.trim()})}const eE={email_pre_scan:"email_pre_scan","email-pre-scan":"email_pre_scan"};function tE(e){const t=e.trimStart();if(!t.startsWith("{"))return e;const n=t.match(/^\{"kind"\s*:\s*"([^"]+)"/);if(!n)return e;const r=eE[n[1]];if(!r)return e;let i=0,l=-1,a=!1,o=!1;for(let f=0;f<t.length;f++){const h=t[f];if(o){o=!1;continue}if(a){h==="\\"?o=!0:h==='"'&&(a=!1);continue}if(h==='"')a=!0;else if(h==="{")i++;else if(h==="}"&&--i===0){l=f;break}}if(l===-1)return e;const c=t.slice(0,l+1),u=t.slice(l+1);return`${e.slice(0,e.length-t.length)}\`\`\`${r}
|
|
520
|
-
${c}
|
|
521
|
-
\`\`\`
|
|
522
|
-
${u}`}function nE(e){if(!e)return e;let t=e;t=tE(t),t=t.replace(K_,""),t=Y_(t),t=t.replace(/<think>[\s\S]*?<\/think>/g,"");const n=(t.match(/\\n/g)||[]).length,r=(t.match(/\n/g)||[]).length;return n>2&&n>r*2&&(t=t.replace(/\\n/g,`
|
|
523
|
-
`),t=t.replace(/\\"/g,'"')),t=Z_(t).trim(),t}function rE(e){if(!e)return"";const t=new Date(e),r=new Date().getTime()-t.getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const l=Math.floor(i/60);return l<24?`${l}h ago`:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Ph(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):""}function iE(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function Mh({message:e,isStreaming:t,showTerminalCursor:n,agentSteps:r,agentStepsActive:i,onDelete:l,onResend:a,latencyMs:o,agentName:c}){var A,_,D;const u=e.role==="assistant"&&Q_(e.content),d=p.useMemo(()=>nE(e.content),[e.content]),[f,h]=p.useState(!1),[m,g]=p.useState(!1),v=p.useRef(null),w=p.useRef(null);p.useEffect(()=>()=>{v.current&&clearTimeout(v.current),w.current&&clearTimeout(w.current)},[]);const x=p.useCallback(()=>{var C;if((C=navigator.clipboard)!=null&&C.writeText)navigator.clipboard.writeText(e.content).catch(()=>{});else{const M=document.createElement("textarea");M.value=e.content,M.style.position="fixed",M.style.opacity="0",document.body.appendChild(M),M.select(),document.execCommand("copy"),document.body.removeChild(M)}h(!0),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>h(!1),2e3)},[e.content]),k=p.useCallback(()=>{if(!m){g(!0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>g(!1),3e3);return}g(!1),w.current&&clearTimeout(w.current),l==null||l(e.id)},[m,e.id,l]),j=p.useCallback(()=>{a==null||a(e)},[e,a]),z=e.created_at?`${e.role==="user"?"Sent":"Replied"} ${Ph(e.created_at)}`:void 0;return s.jsx("div",{className:`msg msg-${e.role} ${u?"msg-error":""}`,title:z,children:s.jsxs("div",{className:"msg-inner",children:[s.jsxs("div",{className:"msg-header",children:[s.jsx("div",{className:"msg-header-left",children:e.role==="assistant"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"msg-avatar msg-avatar-assistant","aria-hidden":"true",children:s.jsx("img",{src:My,alt:""})}),s.jsx("span",{className:"msg-role-brand",children:"GAIA"}),(()=>{const M=((c==null?void 0:c.trim())??"").replace(/^gaia\b\s*/i,"");return M?s.jsx("span",{className:"msg-role-agent",children:M}):null})(),(t||e.created_at)&&s.jsx("span",{className:"msg-header-sep",children:"|"}),t&&s.jsx(q_,{active:!!i||!d}),!t&&e.created_at&&s.jsx("span",{className:"msg-timestamp",children:rE(e.created_at)})]})}),!t&&s.jsxs("div",{className:"msg-actions",children:[e.role==="user"&&a&&s.jsx("button",{className:"msg-action-btn",onClick:j,title:"Resend message","aria-label":"Resend message",children:s.jsx(Vs,{size:12})}),s.jsx("button",{className:`msg-copy ${f?"copied":""}`,onClick:x,title:f?"Copied!":"Copy message","aria-label":f?"Copied to clipboard":"Copy message",children:f?s.jsx(li,{size:12}):s.jsx(jl,{size:12})}),l&&s.jsx("button",{className:`msg-action-btn msg-delete ${m?"confirm":""}`,onClick:k,title:m?"Click again to confirm":"Delete message","aria-label":m?"Confirm delete message":"Delete message",children:s.jsx(ci,{size:12})})]})]}),s.jsxs("div",{className:"msg-body",children:[r&&r.length>0&&s.jsx(Bx,{steps:r,isActive:i??!1,variant:i?"inline":"summary"}),u&&s.jsxs("div",{className:"error-banner",children:[s.jsx(pn,{size:14}),s.jsx("span",{children:"Something went wrong"})]}),s.jsx(_u,{content:d,showCursor:(t||n)&&!!d&&!i}),e.role==="assistant"&&!t&&$_(d)&&s.jsx(O_,{}),e.role==="assistant"&&!t&&(e.stats||o!=null||e.created_at)&&s.jsxs("div",{className:"msg-stats","aria-label":"Message performance stats",children:[e.created_at&&s.jsx("span",{className:"msg-stats-ts",title:"Message timestamp",children:Ph(e.created_at)}),o!=null&&o>0&&s.jsx("span",{title:"Total response time",children:iE(o)}),((A=e.stats)==null?void 0:A.tokens_per_second)!=null&&e.stats.tokens_per_second>0&&s.jsxs("span",{title:"Tokens per second",children:[e.stats.tokens_per_second," tok/s"]}),((_=e.stats)==null?void 0:_.time_to_first_token)!=null&&e.stats.time_to_first_token>0&&s.jsxs("span",{title:"Time to first token",children:[(e.stats.time_to_first_token*1e3).toFixed(0),"ms TTFT"]}),((D=e.stats)==null?void 0:D.output_tokens)!=null&&e.stats.output_tokens>0&&s.jsxs("span",{title:"Input → output tokens",children:[(e.stats.input_tokens??0).toLocaleString()," → ",e.stats.output_tokens.toLocaleString()," tokens"]})]})]})]})})}function sE({lang:e,code:t}){const[n,r]=p.useState(!1),i=p.useRef(null);p.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]);const l=p.useCallback(()=>{var a;if((a=navigator.clipboard)!=null&&a.writeText)navigator.clipboard.writeText(t).catch(()=>{});else{const o=document.createElement("textarea");o.value=t,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)}r(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>r(!1),2e3)},[t]);return s.jsxs("div",{className:"code-block",children:[s.jsxs("div",{className:"code-header",children:[s.jsx("span",{className:"code-lang",children:e||"code"}),s.jsxs("button",{className:`code-copy ${n?"copied":""}`,onClick:l,title:n?"Copied!":"Copy","aria-label":n?"Copied to clipboard":"Copy code",children:[n?s.jsx(li,{size:13}):s.jsx(jl,{size:13}),s.jsx("span",{children:n?"Copied":"Copy"})]})]}),s.jsx("pre",{children:s.jsx("code",{children:t})})]})}const lE=/[A-Z]:[\\\/](?:[^\s*?"<>|,;)}\]]+[\\\/])*[^\s*?"<>|,;)}\]]*\.\w{1,5}/gi,aE=/[A-Z]:[\\\/](?:[^\s*?"<>|,;)}\]]+[\\\/])+/gi;function oE({path:e}){const t=n=>{n.preventDefault(),_d(e).catch(r=>{E.ui.error("Failed to open path",r)})};return s.jsxs("span",{className:"file-path-link",onClick:t,title:`Open in file explorer: ${e}`,role:"button",tabIndex:0,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t(n))},children:[s.jsx(Yn,{size:12,className:"file-path-icon"}),e]})}function cE(e){const t=new RegExp(`(${lE.source}|${aE.source})`,"gi"),n=[];let r=0,i;for(;(i=t.exec(e))!==null;)i.index>r&&n.push(e.slice(r,i.index)),n.push(s.jsx(oE,{path:i[0]},i.index)),r=t.lastIndex;return n.length===0?e:(r<e.length&&n.push(e.slice(r)),s.jsx(s.Fragment,{children:n}))}function br(e){return Gi.Children.map(e,t=>typeof t=="string"?cE(t):t)}const uE=/```(email[_-]pre[_-]scan)[ \t]*\r?\n([\s\S]*?)\r?\n```/;function _u({content:e,showCursor:t}){if(!e&&!t)return null;if(!e&&t)return s.jsx("span",{className:"cursor"});const n=uE.exec(e);if(n){const r=e.slice(0,n.index).trim(),i=n[2],l=e.slice(n.index+n[0].length).trim();try{const a=JSON.parse(i);if(Dh(a))return s.jsxs("div",{className:"md-content",children:[r&&s.jsx(_u,{content:r}),s.jsx(Ah,{payload:a}),l&&s.jsx(_u,{content:l}),t&&s.jsx("span",{className:"cursor"})]})}catch{}}return s.jsxs("div",{className:"md-content",children:[s.jsx(cN,{remarkPlugins:[S_],disallowedElements:[...hN],urlTransform:pN,components:{code({className:r,children:i,...l}){return s.jsx("code",{className:"inline-code",...l,children:i})},pre({children:r}){var l,a;const i=Gi.Children.toArray(r)[0];if(Gi.isValidElement(i)&&(i.type==="code"||((l=i.props)==null?void 0:l.className)!==void 0||typeof((a=i.props)==null?void 0:a.children)=="string")){const o=i.props,c=(o==null?void 0:o.className)||"",u=/language-([\w-]+)/.exec(c),d=String((o==null?void 0:o.children)||"").replace(/\n$/,""),f=(u==null?void 0:u[1])||"";if(f==="email_pre_scan"||f==="email-pre-scan")try{const h=JSON.parse(d);if(Dh(h))return s.jsx(Ah,{payload:h})}catch{}return s.jsx(sE,{lang:f,code:d})}return s.jsx("pre",{children:r})},table({children:r}){return s.jsx("div",{className:"md-table-wrap",children:s.jsx("table",{className:"md-table",children:r})})},a({href:r,children:i}){return s.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"md-link",children:i})},p({children:r}){return s.jsx("p",{className:"md-p",children:br(r)})},h1({children:r}){return s.jsx("h2",{className:"md-h2",children:br(r)})},h2({children:r}){return s.jsx("h3",{className:"md-h3",children:br(r)})},h3({children:r}){return s.jsx("h4",{className:"md-h4",children:br(r)})},ul({children:r}){return s.jsx("ul",{className:"md-ul",children:r})},ol({children:r}){return s.jsx("ol",{className:"md-ol",children:r})},li({children:r}){return s.jsx("li",{className:"md-li",children:br(r)})},blockquote({children:r}){return s.jsx("blockquote",{className:"md-blockquote",children:br(r)})},hr(){return s.jsx("hr",{className:"md-hr"})},td({children:r}){return s.jsx("td",{children:br(r)})},th({children:r}){return s.jsx("th",{children:br(r)})}},children:e}),t&&s.jsx("span",{className:"cursor"})]})}const dE=500,Za="gaia_always_allow_tools",ot=jy((e,t)=>({notifications:[],showPanel:!1,typeFilter:null,addNotification:n=>e(r=>({notifications:[n,...r.notifications].slice(0,dE)})),dismiss:n=>e(r=>({notifications:r.notifications.map(i=>i.id===n?{...i,dismissed:!0}:i)})),markRead:n=>e(r=>({notifications:r.notifications.map(i=>i.id===n?{...i,read:!0}:i)})),markAllRead:()=>e(n=>({notifications:n.notifications.map(r=>({...r,read:!0}))})),clearAll:()=>e({notifications:[]}),setShowPanel:n=>e({showPanel:n}),setTypeFilter:n=>e({typeFilter:n}),respondToPermission:async(n,r,i)=>{var c;const l=t().notifications.find(u=>u.id===n),a=l==null?void 0:l.agentId,o=window.gaiaAPI;if((c=o==null?void 0:o.notification)!=null&&c.respondPermission)try{await o.notification.respondPermission(n,r,i)}catch(u){console.error("[notificationStore] Failed to send permission response via IPC:",u);return}else if(a)try{await Iy(a,r==="allow")}catch(u){console.error("[notificationStore] Failed to send permission response via REST:",u);return}if(r==="allow"&&i&&l!=null&&l.tool){const u=JSON.parse(localStorage.getItem(Za)||"[]");u.includes(l.tool)||(u.push(l.tool),localStorage.setItem(Za,JSON.stringify(u)))}e(u=>({notifications:u.notifications.map(d=>d.id===n?{...d,response:r,respondedAt:Date.now(),read:!0}:d)}))}})),Hx=e=>e.notifications.filter(t=>!t.read&&!t.dismissed).length,fE=e=>{const t=e.notifications.filter(n=>!n.dismissed);return e.typeFilter?t.filter(n=>n.type===e.typeFilter):t},mE=e=>e.notifications.find(t=>t.type==="permission_request"&&!t.response&&!t.dismissed)??null,Vx="https://github.com/amd/gaia/issues/new",hE=[{label:"Image",extensions:new Set([".jpg",".jpeg",".png",".gif",".bmp",".tiff",".webp",".ico",".heic",".heif"]),message:"Image files cannot be indexed for text search.",alternatives:["Index PDFs that contain images — text is extracted automatically","Paste image descriptions or OCR text directly into the chat","Use GAIA's VLM agent for image analysis: gaia vlm"],featureTitle:"Support image file indexing and OCR"},{label:"Video",extensions:new Set([".mp4",".avi",".mkv",".mov",".wmv",".flv",".webm",".m4v"]),message:"Video files are not supported for indexing.",alternatives:["Extract subtitles or transcripts from videos and index those","Use GAIA's voice/talk mode for audio: gaia talk"],featureTitle:"Support video file indexing"},{label:"Audio",extensions:new Set([".mp3",".wav",".flac",".aac",".ogg",".wma",".m4a",".opus"]),message:"Audio files are not supported for indexing.",alternatives:["Use GAIA's voice mode for speech interaction: gaia talk","Transcribe audio to text first, then index the transcript"],featureTitle:"Support audio file transcription and indexing"},{label:"Archive",extensions:new Set([".zip",".rar",".7z",".tar",".gz",".bz2",".xz",".tgz"]),message:"Archive files must be extracted before indexing.",alternatives:["Extract the archive contents to a folder","Then index the folder or individual files from the Document Library"],featureTitle:"Support automatic archive extraction for indexing"},{label:"Executable",extensions:new Set([".exe",".msi",".dll",".so",".app",".dmg",".bin",".com"]),message:"Executable and binary files cannot be indexed.",alternatives:["Index source code files (.py, .js, .ts, .java, etc.) instead","Index documentation or README files from the project"],featureTitle:"Support binary file analysis"},{label:"Database",extensions:new Set([".sqlite",".db",".mdb",".accdb",".dbf"]),message:"Database files are not supported for direct indexing.",alternatives:["Export data to CSV or JSON format, then index those files","Use SQL queries to extract relevant data to a text file"],featureTitle:"Support database file indexing"},{label:"Microsoft Office",extensions:new Set([".doc",".docx",".ppt",".pptx",".xls"]),message:"Word, PowerPoint, and legacy Excel (.xls) files are not yet supported — GAIA does not currently ship parsers for these formats.",alternatives:["Save as PDF from Word or PowerPoint, then index the PDF","Re-save legacy .xls workbooks as .xlsx — GAIA supports modern Excel files"],featureTitle:"Support Microsoft Office (docx, pptx, xls) indexing"}];function Ks(e){const t=e.toLowerCase().startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`;for(const n of hE)if(n.extensions.has(t))return n;return null}const pE=new Set([".pdf",".txt",".md",".csv",".json",".xlsx",".html",".htm",".xml",".svg",".yaml",".yml",".py",".js",".ts",".java",".c",".cpp",".h",".rs",".go",".rb",".sh",".bat",".ps1",".log",".cfg",".ini",".toml"]);function eo(e){const t=e.toLowerCase().startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`;return pE.has(t)}function Wx(){const e="0.18.0",t=navigator.userAgent,n=navigator.platform||"unknown";return`**Environment:**
|
|
524
|
-
- GAIA Version: ${e}
|
|
525
|
-
- Platform: ${n}
|
|
526
|
-
- User Agent: ${t}
|
|
527
|
-
- Interface: Agent UI (Web)`}function Rh(e,t){const n=["## Feature Description","",`I would like GAIA to support: **${e}**`,"","## Use Case","","_Describe how you would use this feature:_","","## Current Workaround","","_Is there a workaround you are currently using?_","","---",Wx(),"","_Submitted from GAIA Agent UI_"].join(`
|
|
528
|
-
`),r=new URLSearchParams({title:`[Feature] ${e}`,body:n,labels:"enhancement,agent-ui"});return`${Vx}?${r.toString()}`}function Eu(e,t){const n=["## Bug Description","",e,"","## Steps to Reproduce","","1. Open GAIA Agent UI","2. _Describe what you did:_","3. ","","## Expected Behavior","","_What did you expect to happen?_","","## Actual Behavior","","_What happened instead?_","","---",Wx(),"","_Submitted from GAIA Agent UI_"].join(`
|
|
529
|
-
`),r=new URLSearchParams({title:`[Bug] ${e}`,body:n,labels:"bug,agent-ui"});return`${Vx}?${r.toString()}`}function Gx({filename:e,error:t,onDismiss:n,timeout:r=15e3}){var m;const i=p.useRef(null);p.useEffect(()=>(r>0&&(i.current=setTimeout(n,r)),()=>{i.current&&clearTimeout(i.current)}),[n,r]);const l=e.includes(".")?"."+((m=e.split(".").pop())==null?void 0:m.toLowerCase()):"",a=l?Ks(l):null,o=t.toLowerCase().includes("unsupported file type")||t.toLowerCase().includes("not supported for indexing")||a!==null,c=t.toLowerCase().includes("fetch")||t.toLowerCase().includes("network")||t.toLowerCase().includes("connect");let u,d,f,h=kt;return o&&a?(u=`${a.label} files not supported`,d=a.message,f=Rh(a.featureTitle),h=pn):o?(u=`File type not supported: ${l}`,d="This file format cannot be indexed. Supported: PDF, TXT, MD, CSV, JSON, XLSX, HTML, XML, YAML, and 30+ code file formats.",f=Rh(`Support ${l} file indexing`),h=pn):c?(u="Connection error",d="Could not reach the GAIA server. Make sure the backend is running.",f=Eu(`Upload connection error for ${e}`),h=kt):(u=`Failed to index "${e}"`,d=t||"An unexpected error occurred during indexing.",f=Eu(`Indexing error: ${t.slice(0,80)}`),h=Vk),s.jsxs("div",{className:"upload-error-toast",role:"alert",children:[s.jsx(h,{size:16}),s.jsxs("div",{className:"upload-error-content",children:[s.jsx("div",{className:"upload-error-title",children:u}),s.jsxs("div",{className:"upload-error-detail",children:[d," ",o?s.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",children:"Request this feature →"}):s.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",children:"Report this issue →"})]})]}),s.jsx("button",{className:"upload-error-dismiss",onClick:n,"aria-label":"Dismiss",children:s.jsx(tt,{size:14})})]})}function gE({sessionId:e,onClose:t}){const[n,r]=p.useState(!1),[i,l]=p.useState([]),[a,o]=p.useState([]),c=p.useRef(0),u=p.useRef(null),d=p.useCallback(m=>{l(g=>[...g,m])},[]);p.useEffect(()=>()=>{u.current&&(u.current.abort(),u.current=null)},[]);const f=p.useCallback(()=>{if(n)return;r(!0),l([]),o([]);const m=Ly(e,"dashboard:refresh",{onChunk:g=>{},onAgentEvent:g=>{const v=++c.current,w=Date.now();g.type==="tool_start"?d({id:v,type:"tool",label:"Using tool",tool:g.tool,detail:g.detail,active:!0,timestamp:w}):g.type==="thinking"?d({id:v,type:"thinking",label:"Thinking",detail:g.content,active:!0,timestamp:w}):g.type==="tool_result"?(d({id:v,type:"tool",label:g.title||"Tool result",detail:g.summary,active:!1,success:g.success,timestamp:w}),o(x=>[...x,{id:v,title:g.title,summary:g.summary}])):g.type==="status"&&d({id:v,type:"status",label:g.message||"Working",detail:g.message,active:g.status==="working",timestamp:w})},onDone:g=>{E.stream.info("Dashboard stream done",g),r(!1)},onError:g=>{E.stream.error("Dashboard stream error",g),r(!1)}});u.current=m},[e,n,d]),h=p.useCallback(async()=>{try{await y0(e),r(!1),u.current&&(u.current.abort(),u.current=null)}catch(m){E.stream.error("Cancel request failed",m)}},[e]);return s.jsxs("div",{className:"dashboard-progress",children:[s.jsxs("div",{className:"dashboard-progress-bar",children:[s.jsxs("div",{className:"dashboard-progress-left",children:[s.jsx(mt,{className:`spin ${n?"visible":"hidden"}`}),s.jsx("strong",{className:"dashboard-title",children:"Refresh progress"})]}),s.jsxs("div",{className:"dashboard-controls",children:[s.jsx("button",{className:"btn btn-plain",onClick:()=>f(),disabled:n,title:"Start refresh",children:"Start"}),s.jsx("button",{className:"btn btn-plain",onClick:h,disabled:!n,title:"Cancel refresh",children:"Cancel"}),s.jsx("button",{className:"btn btn-plain",onClick:()=>{t&&t()},title:"Close",children:"Close"})]})]}),s.jsxs("div",{className:"dashboard-body",children:[s.jsx("div",{className:"dashboard-steps",children:s.jsx(Bx,{steps:i,isActive:n,variant:"inline"})}),s.jsxs("div",{className:"dashboard-surfaced",children:[s.jsx("h4",{children:"Surfaced"}),s.jsx("div",{className:"surfaced-list",children:a.map(m=>s.jsx("div",{className:"surfaced-card",children:s.jsxs("div",{className:"surfaced-card-body",children:[s.jsx("div",{className:"surfaced-card-title",children:m.title||"Result"}),s.jsx("div",{className:"surfaced-card-summary",children:m.summary})]})},m.id))})]})]})]})}const yE=["Summarize a document","Find a file on my computer","Analyze a spreadsheet","Show my recent files"],xE=/\s*\{\s*"?(?:tool|thought|goal)"?\s*:\s*"[^"]*"[^}]*(?:"?tool_args"?\s*:\s*\{[^}]*\})?\s*\}/g;function vE(e){const t=e.trim();if(!t.startsWith("{")||!t.includes('"thought"')&&!t.includes('"answer"')&&!t.includes('"goal"'))return e;try{const a=JSON.parse(t);if(a.answer!==void 0)return String(a.answer)}catch{}const n=t.indexOf('"answer"');if(n===-1)return"";const r=t.indexOf(":",n+8);if(r===-1)return"";let i=r+1;for(;i<t.length&&/\s/.test(t[i]);)i++;if(i>=t.length||t[i]!=='"')return"";let l=t.slice(i+1);return l.endsWith('"}')?l=l.slice(0,-2):l.endsWith('"')&&(l=l.slice(0,-1)),l.replace(/\\"/g,'"').replace(/\\n/g,`
|
|
530
|
-
`).replace(/\\\\/g,"\\")}function ta(e,t){var i;const n=++t.current,r=Date.now();switch(e.type){case"thinking":return{id:n,type:"thinking",label:"Thinking",detail:e.content,active:!0,timestamp:r};case"tool_start":return{id:n,type:"tool",label:"Using tool",tool:e.tool,detail:e.detail,active:!0,timestamp:r,mcpServer:e.mcp_server};case"plan":return{id:n,type:"plan",label:"Created plan",planSteps:e.steps,active:!1,success:!0,timestamp:r};case"step":return{id:n,type:"status",label:`Step ${e.step}${e.total?` of ${e.total}`:""}`,active:!0,timestamp:r};case"status":return(i=e.message)!=null&&i.startsWith("Agent: ")?null:{id:n,type:"status",label:e.message||e.status||"Working",active:e.status==="working",timestamp:r};case"agent_error":return{id:n,type:"error",label:"Error",detail:e.content,success:!1,active:!1,timestamp:r};case"policy_alert":{const l=e.tool||"unknown tool",a=e.reason||e.message||e.content||"Tool execution was blocked by governance policy.";return{id:n,type:"policy_alert",label:`Policy blocked ${l}`,detail:a,tool:l,decision:e.decision||"BLOCK",reason:a,ruleIds:e.rule_ids??[],policyVersion:e.policy_version,receiptId:e.receipt_id,success:!1,active:!1,timestamp:r}}default:return null}}function kE(e){return`policy-receipt-${encodeURIComponent(e)}`}function wE({sessionId:e,onCreateAgent:t,onAgentChange:n}){var Il,gi,hs;const{sessions:r,messages:i,setMessages:l,addMessage:a,removeMessage:o,removeMessagesFrom:c,updateSessionInList:u,isStreaming:d,streamingContent:f,setStreaming:h,setStreamContent:m,clearStreamContent:g,agentSteps:v,addAgentStep:w,updateLastAgentStep:x,appendThinkingContent:k,updateLastToolStep:j,clearAgentSteps:z,documents:A,setDocuments:_,setShowDocLibrary:D,setShowFileBrowser:C,setShowMemoryDashboard:M,isLoadingMessages:N,setLoadingMessages:U,systemStatus:O,agents:re,activeAgentId:ie,setActiveAgentId:X}=we(),xe=ot(I=>I.addNotification),ce=ot(I=>I.showPanel),T=ot(I=>I.setShowPanel),P=ot(I=>I.setTypeFilter),b=ot(Hx),J=we(I=>I.pendingPrompt),B=r.find(I=>I.id===e),S=new Set((B==null?void 0:B.document_ids)??[]),oe=A.filter(I=>S.has(I.id)),[pe,ae]=p.useState(""),[_e,He]=p.useState(!1),[nt,Ge]=p.useState(""),[L,F]=p.useState(!1),[Y,ue]=p.useState(!1),[he,H]=p.useState([]),[le,Pe]=p.useState([]),[Ae,$e]=p.useState(!1),[ut,je]=p.useState(null),[Je,Vr]=p.useState(null),[os,$]=p.useState(!1),[Q,de]=p.useState(!1),ve=p.useRef(null),be=(B==null?void 0:B.agent_type)||ie,wt=(Il=re.find(I=>I.id===(B==null?void 0:B.agent_type)))==null?void 0:Il.name,pt=(gi=re.find(I=>I.id===ie))==null?void 0:gi.name;p.useEffect(()=>{if(!Q)return;const I=q=>{ve.current&&!ve.current.contains(q.target)&&de(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[Q]);const qe=p.useCallback(async I=>{if(de(!1),I===be)return;const q=be;if(X(I),i.length===0){u(e,{agent_type:I});try{await tc(e,{agent_type:I})}catch{u(e,{agent_type:q}),X(q)}}else n==null||n(I)},[be,i.length,e,X,u,n]),[Pt,Xt]=p.useState(!1),rt=p.useRef(""),Mt=p.useRef([]),bt=p.useRef(!1);p.useEffect(()=>{f&&(rt.current=f)},[f]),p.useEffect(()=>{v.length>0&&(Mt.current=v.map(I=>({...I,active:!1})))},[v]),p.useEffect(()=>{if(!d&&bt.current){Xt(!0);const I=setTimeout(()=>{Xt(!1),rt.current="",Mt.current=[]},350);return()=>clearTimeout(I)}bt.current=d},[d]);const xn=p.useRef(null),cn=p.useRef(null),Jt=p.useRef(null),Zt=p.useRef(null),sr=p.useRef(0),vn=p.useRef(!1),cs=p.useRef(()=>{}),kn=p.useRef(""),gt=p.useRef(null),Hn=p.useRef(null),lr=p.useRef(null),_l=p.useRef(0),ar=p.useRef(!0),or=p.useCallback(()=>{gt.current=null,kn.current&&m(kn.current)},[m]),cr=p.useRef(null),st=p.useRef(0);p.useEffect(()=>{E.chat.info(`ChatView mounted for session=${e}, loading messages...`);const I=E.chat.time();U(!0);let q=!1;const te=(Z=!1)=>{As(e).then(ge=>{if(q)return;const Ee=(ge.messages||[]).map(yt=>({...yt,agentSteps:yt.agentSteps||yt.agent_steps||void 0,stats:yt.stats||yt.inference_stats||void 0}));Z?(l(Ee),st.current=Ee.length,E.chat.timed(`Loaded ${Ee.length} message(s) for session=${e}`,I)):Ee.length!==st.current&&!we.getState().isStreaming&&(E.chat.info(`Messages changed externally: ${st.current} -> ${Ee.length}`),l(Ee),st.current=Ee.length)}).catch(ge=>{q||Z&&(E.chat.error(`Failed to load messages for session=${e}`,ge),l([]))}).finally(()=>{!q&&Z&&U(!1)})};return te(!0),cr.current=setInterval(()=>te(!1),3e3),()=>{q=!0,cr.current&&clearInterval(cr.current)}},[e,l,U]),p.useEffect(()=>{ji().then(I=>_(I.documents||[])).catch(()=>{})},[_]),p.useEffect(()=>{const I=we.getState().pendingPrompt;if(!I)return;E.chat.info(`Consuming pending prompt: "${I.slice(0,60)}"`),we.getState().setPendingPrompt(null),ae(I);let q=!1;return requestAnimationFrame(()=>{q||cs.current(I)}),()=>{q=!0}},[J]),p.useEffect(()=>{if(!ar.current)return;const q=Date.now()-_l.current,te=100,Z=()=>{var ge;_l.current=Date.now(),(ge=xn.current)==null||ge.scrollIntoView({behavior:"smooth"})};q>=te&&Z(),lr.current&&clearTimeout(lr.current),lr.current=setTimeout(Z,te)},[i,f,v]),p.useEffect(()=>{var I;(I=Jt.current)==null||I.focus()},[e]),p.useEffect(()=>()=>{Zt.current&&(Zt.current.abort(),Zt.current=null),gt.current!==null&&(cancelAnimationFrame(gt.current),gt.current=null),lr.current&&(clearTimeout(lr.current),lr.current=null),Hn.current&&(clearTimeout(Hn.current),Hn.current=null),Vr(null),kn.current="",Pe(I=>(I.forEach(q=>{q.url&&URL.revokeObjectURL(q.url)}),[]))},[e]);const ur=p.useCallback(()=>{const I=cn.current;if(!I)return;const q=I.scrollHeight-I.scrollTop-I.clientHeight;ar.current=q<=80,ue(q>200)},[]),us=p.useCallback(()=>{var I;ar.current=!0,(I=xn.current)==null||I.scrollIntoView({behavior:"smooth"})},[]),wn=p.useCallback(()=>{E.stream.warn("User stopped generation"),Zt.current&&(Zt.current.abort(),Zt.current=null),gt.current!==null&&(cancelAnimationFrame(gt.current),gt.current=null);const I=we.getState(),q=kn.current||I.streamingContent;if(q){E.stream.info(`Saving partial response (${q.length} chars)`);const te=I.agentSteps,Z={id:Date.now()+1,session_id:e,role:"assistant",content:q,created_at:new Date().toISOString(),rag_sources:null,agentSteps:te.length>0?[...te]:void 0};a(Z)}kn.current="",h(!1),g(),H([]),z()},[e,a,h,g,z]);p.useEffect(()=>{const I=q=>{q.key==="Escape"&&d&&(q.preventDefault(),wn()),q.key==="k"&&(q.ctrlKey||q.metaKey)&&(q.preventDefault(),window.dispatchEvent(new CustomEvent("gaia:focus-search")))};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[d,wn]);const Vn=I=>{ae(I.target.value);const q=I.target;q.style.height="auto",q.style.height=Math.min(q.scrollHeight,200)+"px"},dr=p.useCallback(async I=>{var Z;const q=(Z=I.clipboardData)==null?void 0:Z.items;if(!q)return;const te=[];for(const ge of Array.from(q))ge.type.startsWith("image/")&&te.push(ge);if(te.length!==0){I.preventDefault();for(const ge of te){const Ee=ge.getAsFile();if(!Ee)continue;const yt=`attach-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,gr=URL.createObjectURL(Ee),lt={id:yt,file:Ee,name:Ee.name||`screenshot-${new Date().toISOString().slice(0,19).replace(/[T:]/g,"-")}.png`,url:gr,uploading:!0,uploaded:!1,isImage:!0};Pe(Et=>[...Et,lt]),E.chat.info(`Pasted image: ${lt.name} (${Ee.size} bytes)`);try{const Et=await Pm(Ee);Pe(St=>St.map(V=>V.id===yt?{...V,uploading:!1,uploaded:!0,serverUrl:Et.url}:V)),E.chat.info(`Upload complete: ${lt.name} -> ${Et.url}`)}catch(Et){E.chat.error(`Upload failed: ${lt.name}`,Et),Pe(St=>St.map(V=>V.id===yt?{...V,uploading:!1,error:"Upload failed"}:V))}}}},[]),El=p.useCallback(async I=>{var te;I.preventDefault(),I.stopPropagation(),F(!1);const q=(te=I.dataTransfer)==null?void 0:te.files;if(!(!q||q.length===0))for(const Z of Array.from(q)){const ge=Z.type.startsWith("image/"),Ee=`attach-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,yt=ge?URL.createObjectURL(Z):"",gr={id:Ee,file:Z,name:Z.name,url:yt,uploading:!0,uploaded:!1,isImage:ge};Pe(lt=>[...lt,gr]),E.chat.info(`Dropped file: ${Z.name} (${Z.size} bytes, image=${ge})`);try{const lt=await Pm(Z);Pe(Et=>Et.map(St=>St.id===Ee?{...St,uploading:!1,uploaded:!0,serverUrl:lt.url}:St)),E.chat.info(`Upload complete: ${Z.name} -> ${lt.url}`)}catch(lt){E.chat.error(`Upload failed: ${Z.name}`,lt),Pe(Et=>Et.map(St=>St.id===Ee?{...St,uploading:!1,error:"Upload failed"}:St))}}},[]),Tl=p.useCallback(I=>{Pe(q=>{const te=q.find(Z=>Z.id===I);return te!=null&&te.url&&URL.revokeObjectURL(te.url),q.filter(Z=>Z.id!==I)})},[]),bn=p.useCallback(async I=>{const q=(I||pe).trim(),te=le.length>0&&le.some(V=>V.uploaded);ar.current=!0;const Z=(O==null?void 0:O.init_state)==="initializing";if(!q&&!te||d||Z){!q&&!te&&E.chat.debug("Send blocked: empty message"),d&&E.chat.debug("Send blocked: already streaming"),Z&&E.chat.debug("Send blocked: system initializing");return}let ge=q;const Ee=le.filter(V=>V.uploaded&&V.serverUrl);if(Ee.length>0){const V=Ee.map(ee=>ee.isImage?``:`[${ee.name}](${ee.serverUrl})`).join(`
|
|
531
|
-
`);ge=ge?`${ge}
|
|
532
|
-
|
|
533
|
-
${V}`:V}E.chat.info(`Sending message to session=${e}`,{length:ge.length,preview:ge.slice(0,80)}),ae(""),Jt.current&&(Jt.current.style.height="auto",Jt.current.focus()),Pe(V=>(V.forEach(ee=>{ee.url&&URL.revokeObjectURL(ee.url)}),[]));const yt={id:Date.now(),session_id:e,role:"user",content:ge,created_at:new Date().toISOString(),rag_sources:null};a(yt),h(!0),g(),z(),H([]),sr.current=0,vn.current=!1,E.stream.info("Starting agent stream...");const gr=E.stream.time();let lt="",Et=!1;kn.current="";const St=Ly(e,ge,{onChunk:V=>{const ee=V.content||"";if(ee){V.type==="answer"?lt=ee:(vn.current&<.length>0&&(lt+=`
|
|
534
|
-
|
|
535
|
-
`,vn.current=!1),lt+=ee);let Ce=lt.replace(xE,"").trim();if(Ce=vE(Ce),Ce){const dt=Ce.lastIndexOf("{");if(dt>-1){const Ie=Ce.slice(dt);/^\{\s*"(?:thought|answer|goal|tool)"/.test(Ie)&&(Ie.match(/\{/g)||[]).length>(Ie.match(/\}/g)||[]).length&&(Ce=Ce.slice(0,dt).trim())}}kn.current=Ce,gt.current===null&&(gt.current=requestAnimationFrame(or))}},onAgentEvent:V=>{var Ce,dt,Ie;if(V.type==="tool_confirm"){if(!V.confirm_id){console.error("[ChatView] tool_confirm event missing confirm_id, ignoring");return}const ze=V.tool||"";if(JSON.parse(localStorage.getItem(Za)||"[]").includes(ze)){g0(e,V.confirm_id,"allow",!1).catch(Ze=>console.error("[ChatView] auto-confirm failed:",Ze));return}const Ht={id:V.confirm_id,type:"permission_request",agentId:"chat",agentName:"GAIA",title:`Allow ${ze}?`,message:`The agent wants to execute: ${ze}`,timestamp:Date.now(),read:!1,dismissed:!1,priority:"high",tool:ze,toolArgs:V.args,timeoutSeconds:V.timeout_seconds??60};xe(Ht);return}if(V.type==="permission_request"){const ze=V.tool||"";if(JSON.parse(localStorage.getItem(Za)||"[]").includes(ze)){Iy(e,!0).catch(Ze=>console.error("[ChatView] auto-confirm failed:",Ze));return}const{addNotification:Ht}=ot.getState();Ht({id:V.confirm_id??`perm-${Date.now()}`,type:"permission_request",agentId:e,agentName:"GAIA",title:`Allow ${ze}?`,message:`The agent wants to execute: ${ze}`,timestamp:Date.now(),read:!1,dismissed:!1,priority:"high",tool:ze,toolArgs:V.args,timeoutSeconds:V.timeout_seconds??60});return}if(V.type==="policy_alert"){const ze=V.tool||"unknown tool",Me=V.reason||V.message||V.content||"Tool execution was blocked by governance policy.",Ht={id:V.receipt_id??`policy-${Date.now()}-${sr.current+1}`,type:"policy_alert",agentId:e,agentName:"GAIA",title:`Blocked: ${ze} is restricted by policy.`,message:Me,timestamp:Date.now(),read:!1,dismissed:!1,priority:"critical",tool:ze,decision:V.decision||"BLOCK",reason:Me,ruleIds:V.rule_ids??[],policyVersion:V.policy_version,receiptId:V.receipt_id};xe(Ht);const Ze=ta(V,sr);Ze&&w(Ze),Vr({tool:ze,receiptId:V.receipt_id}),Hn.current&&clearTimeout(Hn.current),Hn.current=setTimeout(()=>Vr(null),5200);return}if(V.type==="tool_end"){j({active:!1,success:V.success!==!1});return}if(V.type==="tool_result"){const ze={result:V.summary||V.title||"Done",active:!1,success:V.success!==!1,latencyMs:V.latency_ms};V.command_output&&(ze.commandOutput={command:V.command_output.command,stdout:V.command_output.stdout,stderr:V.command_output.stderr,returnCode:V.command_output.return_code,cwd:V.command_output.cwd,durationSeconds:V.command_output.duration_seconds,truncated:V.command_output.truncated}),(Ce=V.result_data)!=null&&Ce.chunks&&V.result_data.chunks.length>0&&(ze.retrievalChunks=V.result_data.chunks.map(Me=>({id:Me.id,source:Me.source,sourcePath:Me.sourcePath,page:Me.page,score:Me.score,preview:Me.preview,content:Me.content}))),((dt=V.result_data)==null?void 0:dt.type)==="file_list"&&((Ie=V.result_data.files)==null?void 0:Ie.length)>0&&(ze.fileList={files:V.result_data.files,total:V.result_data.total??V.result_data.files.length}),j(ze);return}if(V.type==="tool_args"){j({detail:V.detail||JSON.stringify(V.args)});return}if(V.type==="thinking"){const ze=we.getState().agentSteps,Me=ze[ze.length-1];if(Me&&Me.type==="thinking"){k(V.content||"");return}const Ht=ta(V,sr);Ht&&w(Ht);return}if(V.type==="status"){const ze=V.status,Me=(V.message||"").trim();if(Me.toLowerCase().startsWith("executing "))return;if(ze==="working"||ze==="warning"||ze==="info"){const Ht=we.getState().agentSteps,Ze=Ht[Ht.length-1];if(Ze&&Ze.type==="status"&&Ze.active){x({label:Me||"Working",detail:Me});return}if(Ze&&Ze.type==="thinking"&&Ze.active){x({label:Me||"Thinking"});return}const ps=ta(V,sr);ps&&w(ps)}return}if(V.type==="step")return;const ee=ta(V,sr);ee&&(w(ee),V.type==="tool_start"&&(vn.current=!0))},onDone:V=>{if(Et)return;Et=!0,gt.current!==null&&(cancelAnimationFrame(gt.current),gt.current=null),kn.current="";const ee=V.content||lt;E.chat.timed(`Agent response complete: ${ee.length} chars`,gr);const Ce=we.getState().agentSteps.map(Ie=>({...Ie,active:!1})),dt=Ce.some(Ie=>Ie.type==="policy_alert");if(ee||dt){st.current=we.getState().messages.length+1;const Ie={id:V.message_id||Date.now()+1,session_id:e,role:"assistant",content:ee,created_at:new Date().toISOString(),rag_sources:null,agentSteps:Ce.length>0?Ce:void 0,stats:V.stats||void 0};a(Ie)}if(H(Ce),h(!1),g(),z(),Jt.current&&Jt.current.focus(),setTimeout(()=>{As(e).then(Ie=>{if(we.getState().currentSessionId!==e)return;const ze=(Ie.messages||[]).map(Me=>({...Me,agentSteps:Me.agentSteps||Me.agent_steps||void 0,stats:Me.stats||Me.inference_stats||void 0}));l(ze),st.current=ze.length}).catch(()=>{})},300),B&&B.title==="New Task"){const Ie=q.slice(0,50)+(q.length>50?"...":"");tc(e,{title:Ie}).then(()=>u(e,{title:Ie})).catch(ze=>E.chat.error("Auto-title failed",ze))}},onError:V=>{gt.current!==null&&(cancelAnimationFrame(gt.current),gt.current=null),kn.current="",E.chat.error(`Chat error for session=${e}`,V);let ee;const Ce=V.message||"",dt=`
|
|
536
|
-
|
|
537
|
-
---
|
|
538
|
-
*Unexpected error?* [Report it on GitHub](${Eu(Ce.slice(0,80))})`;Ce.includes("Lemonade")||Ce.includes("LLM")||Ce.includes("Could not get response")?ee="Could not reach the LLM server. Make sure Lemonade Server is running:\n\n```\nlemonade-server serve\n```\n\nThen try sending your message again."+dt:V instanceof TypeError||Ce.includes("fetch")||Ce.includes("Failed to fetch")||Ce.includes("NetworkError")?ee="Cannot connect to the GAIA server. Make sure the backend is running:\n\n```\ngaia chat --ui\n```"+dt:Ce.includes("500")?ee="The server encountered an error. This usually means Lemonade Server is not running or the model failed to load.\n\nStart Lemonade Server with:\n```\nlemonade-server serve\n```"+dt:Ce.includes("timed out")||Ce.includes("timeout")||Ce.includes("Timeout")?ee=`The request timed out. The query may be too complex — try breaking it into simpler questions.
|
|
539
|
-
|
|
540
|
-
If Lemonade Server is running but responses are slow, the model may need more resources.`+dt:ee=`Error: ${Ce}`+dt;const Ie={id:Date.now()+2,session_id:e,role:"assistant",content:ee,created_at:new Date().toISOString(),rag_sources:null};a(Ie),h(!1),g(),z()},onAgentCreated:()=>{Nd().then(V=>we.getState().setAgents(V.agents||[])).catch(()=>{})}},void 0,void 0,ie);Zt.current=St},[pe,le,d,e,B,a,l,h,or,g,u,w,x,k,j,z,ie,xe]);cs.current=bn,p.useEffect(()=>{const I=q=>{var ge;const Z=(ge=q.detail)==null?void 0:ge.text;typeof Z=="string"&&Z.trim()&&cs.current(Z)};return window.addEventListener("gaia:send-message",I),()=>window.removeEventListener("gaia:send-message",I)},[]),p.useEffect(()=>{!d&&Jt.current&&Jt.current.focus()},[d]);const fr=p.useCallback(async I=>{d||(E.chat.info(`Deleting message ${I} from session=${e}`),je(I),setTimeout(async()=>{o(I),je(null);try{await m0(e,I)}catch(q){E.chat.error(`Failed to delete message ${I}`,q),As(e).then(te=>{we.getState().currentSessionId===e&&l(te.messages||[])}).catch(()=>{})}},250))},[e,d,o,l]),jt=p.useCallback(async I=>{if(d||I.role!=="user")return;const q=I.content;E.chat.info(`Resending message ${I.id} from session=${e}`,{preview:q.slice(0,80)}),c(I.id);try{await h0(e,I.id)}catch(te){E.chat.error(`Failed to delete messages from ${I.id}`,te),As(e).then(Z=>{we.getState().currentSessionId===e&&l(Z.messages||[])}).catch(()=>{});return}bn(q)},[e,d,c,l,bn]),mr=I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),bn())},ds=()=>{Ge((B==null?void 0:B.title)||""),He(!0)},Dn=async()=>{nt.trim()&&nt!==(B==null?void 0:B.title)&&(await tc(e,{title:nt.trim()}),u(e,{title:nt.trim()})),He(!1)},Wn=p.useCallback(async()=>{if(e)try{const I=await d0(e);u(e,{private:I.private})}catch(I){E.ui.warn("Failed to toggle private mode",I)}},[e,u]),hr=async()=>{try{const I=await f0(e),q=new Blob([I.content],{type:"text/markdown"}),te=URL.createObjectURL(q),Z=document.createElement("a");Z.href=te;const ge=((B==null?void 0:B.title)||"chat").replace(/[/\\:*?"<>|]/g,"_").slice(0,100);Z.download=`${ge}.md`,Z.click(),URL.revokeObjectURL(te)}catch(I){E.chat.error("Export failed",I)}},zl=p.useCallback(async(I,q)=>{I.stopPropagation();const te=A.find(Z=>Z.id===q);E.doc.info(`Detaching document from session: ${(te==null?void 0:te.filename)||q}`);try{await w0(e,q);const Z=we.getState().sessions.find(Ee=>Ee.id===e),ge=((Z==null?void 0:Z.document_ids)??[]).filter(Ee=>Ee!==q);u(e,{document_ids:ge}),ge.length<=3&&$e(!1),E.doc.info(`Detached document from session: ${(te==null?void 0:te.filename)||q}`)}catch(Z){E.doc.error(`Failed to detach document: ${(te==null?void 0:te.filename)||q}`,Z)}},[A,e,u]),Ll=p.useCallback(async I=>{if(I.preventDefault(),I.stopPropagation(),F(!1),I.dataTransfer.files.length!==0)for(const q of Array.from(I.dataTransfer.files)){E.doc.info(`Dropped on chat view: ${q.name}`);try{const te=await Ay(q);if(e&&(te!=null&&te.id))try{await Qa(e,te.id);const Z=we.getState().sessions.find(Ee=>Ee.id===e),ge=(Z==null?void 0:Z.document_ids)??[];ge.includes(te.id)||u(e,{document_ids:[...ge,te.id]}),E.doc.info(`Auto-attached "${q.name}" to session ${e}`)}catch(Z){E.doc.warn(`Could not attach dropped document to session: ${Z}`)}}catch(te){E.doc.error(`Upload failed: ${q.name}`,te)}}},[e,u]),fs=I=>{I.preventDefault(),I.stopPropagation(),F(!0)},_o=I=>{I.preventDefault(),I.stopPropagation(),F(!1)},pi=I=>{ae(I),bn(I)},pr=!N&&i.length===0&&!d,ms=p.useMemo(()=>{const I=new Map;let q;for(const te of i)if(te.role==="user"&&te.created_at)q=new Date(te.created_at).getTime();else if(te.role==="assistant"&&te.created_at&&q!==void 0){const Z=new Date(te.created_at).getTime();Z>q&&I.set(te.id,Z-q),q=void 0}return I},[i]);return s.jsxs("main",{className:`task-view ${L?"drag-active":""}`,onDrop:Ll,onDragOver:fs,onDragLeave:_o,children:[os&&s.jsx("div",{className:"dashboard-overlay",children:s.jsx(gE,{sessionId:e,onClose:()=>$(!1)})}),s.jsxs("header",{className:"task-header",children:[s.jsx("div",{className:"task-header-left",children:_e?s.jsx("input",{className:"title-edit",value:nt,onChange:I=>Ge(I.target.value),onBlur:Dn,onKeyDown:I=>I.key==="Enter"&&Dn(),autoFocus:!0,"aria-label":"Edit task title"}):s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"task-title",children:(B==null?void 0:B.title)||"New Task"}),s.jsx("button",{className:"btn-icon-sm",onClick:ds,title:"Rename","aria-label":"Rename task",children:s.jsx(fw,{size:13})})]})}),s.jsxs("div",{className:"chat-header-right",children:[s.jsxs("span",{className:`model-badge ${O!=null&&O.model_loaded?"":"no-model"}`,title:O!=null&&O.model_loaded&&(O!=null&&O.model_context_size)?`${O.model_loaded} · context window: ${O.model_context_size.toLocaleString()} tokens`:(O==null?void 0:O.model_loaded)||"No model loaded",children:[(O==null?void 0:O.model_loaded)||"No model loaded",(O==null?void 0:O.model_loaded)&&(O==null?void 0:O.model_context_size)!=null&&s.jsxs("span",{className:"model-ctx-size",children:[" · ",O.model_context_size%1024===0?`${O.model_context_size/1024}K`:O.model_context_size.toLocaleString()]})]}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>D(!0),title:"Documents","aria-label":"Attach documents",children:s.jsx(dw,{size:15})}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>C(!0),title:"Browse files","aria-label":"Browse files",children:s.jsx(_m,{size:15})}),s.jsx("button",{className:`btn-icon-sm${B!=null&&B.private?" active":""}`,onClick:Wn,title:B!=null&&B.private?"Private mode on — click to disable":"Enable private mode (nothing saved to memory)","aria-label":B!=null&&B.private?"Disable private mode":"Enable private mode","aria-pressed":!!(B!=null&&B.private),children:s.jsx(dy,{size:15})}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>M(!0),title:"Memory","aria-label":"Open memory dashboard",children:s.jsx(Jr,{size:15})}),s.jsx("button",{className:"btn-icon-sm",onClick:hr,title:"Export","aria-label":"Export task",children:s.jsx(oi,{size:15})}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>$(I=>!I),title:"Refresh dashboard","aria-label":"Refresh dashboard",children:s.jsx(Nm,{size:15})}),s.jsxs("button",{className:`notification-center-trigger ${b>0?"has-unread":""}`,onClick:()=>T(!ce),"aria-label":"Open notification center","aria-expanded":ce,title:"Notifications",children:[s.jsx(oy,{size:15}),b>0&&s.jsx("span",{className:"notification-center-trigger-badge",children:b>99?"99+":b})]})]})]}),oe.length>0&&(()=>{const I=[...oe].sort((Z,ge)=>{const Ee=Z.last_accessed_at||Z.indexed_at||"";return(ge.last_accessed_at||ge.indexed_at||"").localeCompare(Ee)}),q=Ae?I:I.slice(0,3),te=I.length-3;return s.jsxs("div",{className:`doc-context-bar${Ae?" doc-context-expanded":""}`,"aria-label":`${oe.length} indexed document${oe.length!==1?"s":""}`,children:[s.jsx(nr,{size:12,className:"doc-context-icon"}),s.jsxs("span",{className:"doc-context-label",onClick:()=>D(!0),title:"Click to manage documents",role:"button",tabIndex:0,children:[oe.length," indexed"]}),s.jsxs("div",{className:`doc-context-pills${Ae?" doc-context-pills-expanded":""}`,children:[q.map(Z=>s.jsxs("span",{className:"doc-pill",title:Z.filepath||Z.filename,children:[s.jsx($n,{size:9,className:"doc-pill-icon"}),s.jsx("span",{className:"doc-pill-name",children:Z.filename}),s.jsx("button",{className:"doc-pill-remove",onClick:ge=>zl(ge,Z.id),title:`Remove ${Z.filename} from this session`,"aria-label":`Remove ${Z.filename} from this session`,children:s.jsx(tt,{size:10})})]},Z.id)),!Ae&&te>0&&s.jsxs("button",{className:"doc-pill-more",onClick:Z=>{Z.stopPropagation(),$e(!0)},title:"Show all indexed files","aria-label":`Show ${te} more files`,children:["+",te," more"]}),Ae&&te>0&&s.jsx("button",{className:"doc-pill-collapse",onClick:Z=>{Z.stopPropagation(),$e(!1)},title:"Show fewer files","aria-label":"Collapse file list",children:"show less"})]})]})})(),s.jsxs("div",{className:"messages-scroll",ref:cn,onScroll:ur,children:[N&&s.jsx("div",{className:"skeleton-messages","aria-label":"Loading messages",children:[0,1,2].map(I=>s.jsxs("div",{className:"skeleton-msg",children:[s.jsxs("div",{className:"skeleton-header",children:[s.jsx("div",{className:"skeleton-avatar"}),s.jsx("div",{className:"skeleton-role"})]}),s.jsxs("div",{className:"skeleton-lines",children:[s.jsx("div",{className:"skeleton-line"}),s.jsx("div",{className:"skeleton-line"}),I!==2&&s.jsx("div",{className:"skeleton-line"})]})]},I))}),pr&&s.jsxs("div",{className:"empty-task",children:[s.jsx("div",{className:"empty-task-icon",children:s.jsx(fu,{size:36,strokeWidth:1.2})}),s.jsx("h4",{className:"empty-task-title",children:"What can I help you with?"}),s.jsx("p",{className:"empty-task-desc",children:"Ask about your documents, search files, or analyze data — powered by local AI."}),s.jsx("div",{className:"empty-task-suggestions",children:yE.map(I=>s.jsx("button",{className:"empty-task-chip",onClick:()=>pi(I),children:I},I))})]}),i.map((I,q)=>{const te=!d&&!Pt&&I.role==="assistant"&&i.slice(q+1).every(Ee=>Ee.role!=="assistant");if(Pt&&I.role==="assistant"&&q===i.length-1)return null;const ge=ms.get(I.id);return s.jsx("div",{className:ut===I.id?"msg-deleting":void 0,children:s.jsx(Mh,{message:I,showTerminalCursor:te,agentSteps:I.role==="assistant"?I.agentSteps:void 0,onDelete:d?void 0:fr,onResend:!d&&I.role==="user"?jt:void 0,latencyMs:ge,agentName:I.role==="assistant"?wt:void 0})},I.id)}),(d||Pt)&&s.jsx("div",{className:`streaming-bubble ${Pt?"stream-ending":"stream-active"}`,children:s.jsx(Mh,{message:{id:-1,session_id:e,role:"assistant",content:(d?f:rt.current)||"",created_at:"",rag_sources:null},isStreaming:d,showTerminalCursor:Pt,agentSteps:d?v:Mt.current,agentStepsActive:d&&v.some(I=>I.active),agentName:pt})}),s.jsx("div",{ref:xn})]}),Y&&s.jsx("button",{className:"scroll-bottom-btn",onClick:us,title:"Scroll to bottom","aria-label":"Scroll to bottom",children:s.jsx(Nm,{size:16})}),L&&s.jsxs("div",{className:"drag-overlay",children:[s.jsx(pl,{size:32,strokeWidth:1.5}),s.jsx("span",{children:"Drop files to index"})]}),Je&&s.jsxs("div",{className:"toast policy-alert-toast",role:"alert",children:[s.jsxs("span",{children:["Blocked: ",Je.tool," is restricted by policy."]}),Je.receiptId?s.jsx("button",{type:"button",className:"policy-alert-toast-link",onClick:()=>{const I=Je.receiptId;I&&(P("policy_alert"),T(!0),window.setTimeout(()=>{var q;(q=document.getElementById(kE(I)))==null||q.scrollIntoView({behavior:"smooth",block:"center"})},80))},children:"View receipt"}):s.jsx("span",{className:"policy-alert-toast-missing",children:"Receipt unavailable"})]}),s.jsxs("div",{className:"input-area",children:[s.jsxs("div",{className:`input-box ${le.length>0?"has-attachments":""}`,onDrop:El,onDragOver:I=>{I.preventDefault(),I.stopPropagation()},children:[s.jsxs("div",{className:"input-content",children:[le.length>0&&s.jsx("div",{className:"attachment-strip",children:le.map(I=>s.jsxs("div",{className:`attachment-preview ${I.error?"attachment-error":""}`,children:[I.isImage&&I.url?s.jsx("img",{src:I.url,alt:I.name,className:"attachment-thumb"}):s.jsx("div",{className:"attachment-file-icon",children:s.jsx($n,{size:16})}),s.jsx("span",{className:"attachment-name",title:I.name,children:I.name.length>20?I.name.slice(0,17)+"...":I.name}),I.uploading&&s.jsx("span",{className:"attachment-spinner"}),I.error&&s.jsx("span",{className:"attachment-error-text",children:I.error}),s.jsx("button",{className:"attachment-remove",onClick:()=>Tl(I.id),title:"Remove","aria-label":`Remove ${I.name}`,children:s.jsx(tt,{size:12})})]},I.id))}),s.jsx("textarea",{ref:Jt,className:"msg-input",value:pe,onChange:Vn,onKeyDown:mr,onPaste:dr,placeholder:"Type a message or paste an image... (Shift+Enter for new line)",rows:1,disabled:d||(O==null?void 0:O.init_state)==="initializing","aria-label":"Message input"})]}),s.jsxs("div",{className:"input-btns",children:[s.jsx("button",{className:"btn-icon-sm",onClick:()=>D(!0),title:"Upload document","aria-label":"Upload document",children:s.jsx(pl,{size:15})}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>C(!0),title:"Browse files","aria-label":"Browse files",children:s.jsx(_m,{size:15})}),d?s.jsx("button",{className:"stop-btn",onClick:wn,title:"Stop generating","aria-label":"Stop generating",children:s.jsx(vw,{size:14})}):s.jsx("button",{className:"send-btn",onClick:()=>bn(),disabled:!pe.trim()&&!le.some(I=>I.uploaded),title:"Send (Enter)","aria-label":"Send message",children:s.jsx(hw,{size:16})})]})]}),s.jsxs("div",{className:"input-footer",children:[t&&s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"create-agent-btn",onClick:t,title:"Build a custom agent","aria-label":"Build a custom agent",children:s.jsx(hl,{size:10})}),re.length>1&&s.jsx("span",{className:"input-footer-sep"})]}),re.length>1&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"agent-picker",ref:ve,children:[s.jsxs("button",{className:"agent-picker-btn",onClick:()=>!d&&de(I=>!I),title:"Switch agent","aria-label":"Switch agent",disabled:d,children:[s.jsx(du,{size:10}),s.jsx("span",{children:((hs=re.find(I=>I.id===be))==null?void 0:hs.name)||"Agent"}),s.jsx(ai,{size:10})]}),Q&&s.jsx("div",{className:"agent-picker-dropdown",children:re.map(I=>s.jsxs("button",{className:`agent-picker-option${I.id===be?" active":""}`,onClick:()=>qe(I.id),children:[s.jsx(du,{size:12}),s.jsx("span",{children:I.name})]},I.id))})]}),s.jsx("span",{className:"input-footer-sep"})]}),s.jsxs("span",{className:"input-footer-item",children:[s.jsx(gy,{size:10}),s.jsx("span",{children:"100% local & private"})]}),s.jsx("span",{className:"input-footer-sep"}),s.jsxs("span",{className:"input-footer-item",children:[s.jsx("kbd",{className:"kbd-hint",children:"Enter"}),s.jsx("span",{children:"send"})]}),s.jsxs("span",{className:"input-footer-item",children:[s.jsx("kbd",{className:"kbd-hint",children:"Shift+Enter"}),s.jsx("span",{children:"new line"})]}),d&&s.jsxs("span",{className:"input-footer-item",children:[s.jsx("kbd",{className:"kbd-hint",children:"Esc"}),s.jsx("span",{children:"stop"})]}),s.jsx("span",{className:"input-footer-sep"}),s.jsxs("span",{className:"input-footer-item",children:[s.jsx("kbd",{className:"kbd-hint",children:"Ctrl+K"}),s.jsx("span",{children:"search"})]}),s.jsxs("span",{className:"input-footer-item",children:[s.jsx("kbd",{className:"kbd-hint",children:"Ctrl+V"}),s.jsx("span",{children:"paste image"})]})]})]})]})}const $h="GAIA",na="Your private AI assistant, running 100% locally on AMD Ryzen AI",bE=65,jE=350;function qx(e,t){return t===","||t==="."?60+Math.random()*50:t===" "?15+Math.random()*25:Math.random()<.35?8+Math.random()*12:Math.random()<.06?45+Math.random()*35:18+Math.random()*22}const SE=["Scan my Downloads and tell me what I should clean up","Index a folder of documents so I can chat about them","What have I been working on lately? Show my recent files","What hardware is in my PC? Tell me about my CPU and GPU"];function NE({onNewTask:e,onSendPrompt:t,onCreateAgent:n}){const{systemStatus:r,agents:i,activeAgentId:l,setActiveAgentId:a}=we(),o=p.useMemo(()=>{var C;const D=i.find(M=>M.id===l);return(C=D==null?void 0:D.conversation_starters)!=null&&C.length?D.conversation_starters:SE},[i,l]),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,v]=p.useState(!1),[w,x]=p.useState("title"),[k,j]=p.useState(!1),z=r!==null&&!r.initialized,A=(r==null?void 0:r.init_state)==="initializing",_=r!==null&&r.lemonade_running&&!r.model_loaded;return p.useEffect(()=>{let D=0;const C=setInterval(()=>{D++,D<=$h.length?u($h.slice(0,D)):(clearInterval(C),f(!0))},bE);return()=>clearInterval(C)},[]),p.useEffect(()=>{if(!d)return;let D=!1;const C=setTimeout(()=>{if(D)return;x("subtitle");let N=0;const U=()=>{if(!D)if(N++,N<=na.length){m(na.slice(0,N));const O=na[N-1],re=N>1?na[N-2]:"",ie=qx(O,re);M.current=setTimeout(U,ie)}else v(!0),x("done")};U()},jE),M={current:null};return()=>{D=!0,clearTimeout(C),M.current&&clearTimeout(M.current)}},[d]),p.useEffect(()=>{if(!g)return;const D=setTimeout(()=>j(!0),200);return()=>clearTimeout(D)},[g]),s.jsx("main",{className:"welcome",children:s.jsxs("div",{className:`welcome-inner ${k?"content-revealed":""}`,children:[s.jsxs("h1",{className:`welcome-title${d?" typing-done":""}`,children:[c.length>=4?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"gaia-glow",children:c.slice(0,4)}),s.jsx("span",{children:c.slice(4)})]}):c,w==="title"&&s.jsx("span",{className:`terminal-cursor${d?" blink":""}`})]}),s.jsx("p",{className:"welcome-sub",children:s.jsxs("span",{className:"typewriter-text",children:[h,(w==="subtitle"||w==="done")&&s.jsx("span",{className:`terminal-cursor terminal-cursor-sub${w==="done"?" blink":""}`})]})}),s.jsxs("span",{className:"welcome-version",children:["v","0.18.0"," ",s.jsx("span",{className:"beta-badge",children:"BETA"})]}),s.jsxs("div",{className:"features",children:[s.jsx(ra,{icon:s.jsx(gy,{size:22}),title:"Private",desc:"Data stays on your device",codeHint:"> encrypt --local",expandedDesc:"All processing happens on-device. No cloud, no tracking, complete data privacy."}),s.jsx(ra,{icon:s.jsx(Ws,{size:22}),title:"Fast",desc:"NPU acceleration",codeHint:"> npu.accelerate()",expandedDesc:"Hardware-accelerated with AMD Ryzen AI NPU for real-time local inference."}),s.jsx(ra,{icon:s.jsx($n,{size:22}),title:"Smart",desc:"Document Q&A",codeHint:'> rag.query("...")',expandedDesc:"RAG-powered document Q&A — index files and chat with their contents."}),s.jsx(ra,{icon:s.jsx(Kk,{size:22}),title:"Free",desc:"No subscriptions",codeHint:"> license: MIT",expandedDesc:"No API keys, no subscriptions, no hidden costs. Fully open-source."})]}),i.length>1&&s.jsx("div",{className:"agent-pills",children:i.map(D=>s.jsxs("button",{className:`agent-pill${D.id===l?" active":""}`,onClick:()=>a(D.id),title:D.description||D.name,children:[s.jsx(du,{size:14}),s.jsx("span",{children:D.name})]},D.id))}),z&&s.jsxs("div",{className:"welcome-setup-hint",children:[s.jsx(qa,{size:14}),s.jsxs("span",{children:[s.jsx("strong",{children:"First time?"})," Run ",s.jsx("code",{children:"gaia init --profile chat"})," in a terminal to install Lemonade Server and download the required AI model",r!=null&&r.default_model_size_gb?` (~${r.default_model_size_gb.toFixed(1)} GB).`:"."]})]}),!z&&_&&s.jsxs("div",{className:"welcome-setup-hint",children:[s.jsx(qa,{size:14}),s.jsxs("span",{children:["No model loaded. Run ",s.jsx("code",{children:"gaia init --profile chat"})," to download",r!=null&&r.default_model_size_gb?` (~${r.default_model_size_gb.toFixed(1)} GB).`:"."]})]}),s.jsxs("div",{className:"welcome-actions",children:[s.jsx("button",{className:"btn-primary start-btn",onClick:e,disabled:A,children:"Start a New Task"}),n&&s.jsxs("button",{className:"build-agent-btn",onClick:n,disabled:A,children:[s.jsx(hl,{size:14}),"Build a Custom Agent"]})]}),s.jsxs("div",{className:"suggestions",children:[s.jsx("span",{className:"suggestions-label",children:"Try asking:"}),s.jsx("div",{className:"suggestion-chips",children:o.map(D=>s.jsx("button",{className:"chip",onClick:()=>t(D),disabled:A,children:D},D))})]}),s.jsx("p",{className:"welcome-copyright",children:"© 2025–2026 Advanced Micro Devices, Inc. All rights reserved."})]})})}function ra({icon:e,title:t,desc:n,expandedDesc:r,codeHint:i}){const[l,a]=p.useState("idle"),[o,c]=p.useState(i),[u,d]=p.useState(""),f=p.useRef(null),h=()=>{a("erasing"),d("");let v=i.length;const w=()=>{if(v--,v>=0)c(i.slice(0,v)),f.current=setTimeout(w,15+Math.random()*20);else{a("typing"),c("");let x=0;const k=()=>{if(x++,x<=r.length){d(r.slice(0,x));const j=r[x-1],z=x>1?r[x-2]:"";f.current=setTimeout(k,qx(j,z))}else a("done")};k()}};w()},m=()=>{f.current&&clearTimeout(f.current),a("idle"),c(i),d("")};p.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const g=l!=="idle";return s.jsxs("div",{className:`feature-card ${g?"feature-hovered":""}`,onMouseEnter:h,onMouseLeave:m,children:[s.jsx("div",{className:"feature-icon",children:e}),s.jsx("h3",{children:t}),s.jsx("p",{children:n}),s.jsxs("div",{className:"feature-terminal",children:[l==="idle"&&s.jsx("span",{className:"feature-code-hint",children:i}),l==="erasing"&&s.jsxs("span",{className:"feature-inline",children:[s.jsx("span",{className:"feature-code-hint feature-code-erasing",children:o}),s.jsx("span",{className:"terminal-cursor terminal-cursor-sm"})]}),(l==="typing"||l==="done")&&s.jsxs("span",{className:"feature-inline",children:[s.jsx("span",{className:"feature-expanded-text",children:u}),s.jsx("span",{className:`terminal-cursor terminal-cursor-sm${l==="done"?" blink":""}`})]})]})]})}function CE(e){const t=Math.floor((Date.now()-e)/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return`${n}m ${r}s`}function _E(e){try{const t=new Date(e);if(isNaN(t.getTime()))return"";const r=new Date().getTime()-t.getTime(),i=Math.floor(r/1e3),l=Math.floor(i/60),a=Math.floor(l/60),o=Math.floor(a/24);return i<60?"just now":l<60?`${l}m ago`:a<24?`${a}h ago`:o===1?"yesterday":o<7?`${o}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return""}}function EE(e){try{const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"})}catch{return""}}function TE(){const{documents:e,setDocuments:t,setShowDocLibrary:n,setShowFileBrowser:r,currentSessionId:i,sessions:l,updateSessionInList:a}=we(),o=l.find(T=>T.id===i)??null,[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,v]=p.useState(""),[w,x]=p.useState(null),k=p.useRef(new Map),[,j]=p.useState(0);p.useEffect(()=>{E.doc.info("Loading document library...");const T=E.doc.time();ji().then(P=>{const b=P.documents||[];t(b),E.doc.timed(`Loaded ${b.length} document(s), ${P.total_chunks||0} chunks, ${P.total_size_bytes||0} bytes total`,T)}).catch(P=>{E.doc.error("Failed to load documents",P),t([])})},[t]);const z=e.some(T=>T.indexing_status==="indexing"||T.indexing_status==="pending");p.useEffect(()=>{if(!z)return;const T=we.getState().documents;for(const J of T)(J.indexing_status==="indexing"||J.indexing_status==="pending")&&!k.current.has(J.id)&&k.current.set(J.id,Date.now());let P=!1;const b=setInterval(async()=>{if(j(J=>J+1),!P){P=!0;try{const B=we.getState().documents.filter(S=>S.indexing_status==="indexing"||S.indexing_status==="pending");for(const S of B)try{const oe=await v0(S.id);if(oe.indexing_status!=="indexing"&&oe.indexing_status!=="pending"){k.current.delete(S.id);const pe=await ji();t(pe.documents||[]);break}}catch{}}finally{P=!1}}},2e3);return()=>clearInterval(b)},[z,t]),p.useEffect(()=>{const T=new Set(e.filter(P=>P.indexing_status==="indexing"||P.indexing_status==="pending").map(P=>P.id));for(const P of k.current.keys())T.has(P)||k.current.delete(P)},[e]),p.useEffect(()=>{const T=setInterval(async()=>{try{const b=(await ji()).documents||[],J=we.getState().documents;(b.length!==J.length||b.some((S,oe)=>{const pe=J.find(ae=>ae.id===S.id);return!pe||pe.indexing_status!==S.indexing_status||pe.indexed_at!==S.indexed_at||pe.chunk_count!==S.chunk_count}))&&(t(b),E.doc.debug("Document list refreshed (server-side changes detected)"))}catch{}},15e3);return()=>clearInterval(T)},[t]);const A=e.reduce((T,P)=>T+P.file_size,0),_=e.reduce((T,P)=>T+P.chunk_count,0),D=T=>{if(T<=0)return"0 B";const P=1024,b=["B","KB","MB","GB"],J=Math.min(Math.floor(Math.log(T)/Math.log(P)),b.length-1);return parseFloat((T/Math.pow(P,J)).toFixed(1))+" "+b[J]},C=p.useCallback(async(T,P)=>{var B;const b=T.includes(".")?"."+((B=T.split(".").pop())==null?void 0:B.toLowerCase()):"";if(b&&!eo(b)){const S=Ks(b),oe=S?S.message:`The file type "${b}" is not supported for indexing.`;E.doc.warn(`Unsupported file type: ${T} (${b})`),x({filename:T,error:oe});return}E.doc.info(`Indexing document: ${T}`);const J=E.doc.time();f(!0),m(`Indexing ${T}...`),x(null);try{const S=await P();if(E.doc.timed(`Indexed "${T}": ${(S==null?void 0:S.chunk_count)||"?"} chunks`,J),i&&(S!=null&&S.id))try{await Qa(i,S.id);const pe=we.getState().sessions.find(_e=>_e.id===i),ae=(pe==null?void 0:pe.document_ids)??[];ae.includes(S.id)||a(i,{document_ids:[...ae,S.id]}),E.doc.info(`Auto-attached "${T}" to session ${i}`)}catch(pe){E.doc.warn(`Could not attach document to session: ${pe}`)}const oe=await ji();t(oe.documents||[]),m("")}catch(S){E.doc.error(`Failed to index "${T}"`,S);const oe=S instanceof Error?S.message:"Upload failed";x({filename:T,error:oe}),m("")}finally{f(!1)}},[i,a,t]),M=p.useCallback(async(T,P)=>{await C(P,()=>Dy(T))},[C]),N=p.useCallback(async T=>{await C(T.name,()=>Ay(T))},[C]),U=p.useCallback(async T=>{T.preventDefault(),u(!1);const P=Array.from(T.dataTransfer.files);E.doc.info(`Dropped ${P.length} file(s) into Document Library`);for(const b of P)await N(b)},[N]),O=p.useCallback(async T=>{const P=e.find(b=>b.id===T);E.doc.info(`Deleting document: ${(P==null?void 0:P.filename)||T}`);try{await x0(T),k.current.delete(T),t(e.filter(b=>b.id!==T)),E.doc.info(`Deleted document: ${(P==null?void 0:P.filename)||T}`)}catch(b){E.doc.error(`Failed to delete document: ${(P==null?void 0:P.filename)||T}`,b)}},[e,t]),re=p.useCallback(async(T,P)=>{E.doc.info(`Opening folder for: ${T}`);try{await _d(T,!0)}catch(b){E.doc.error(`Failed to open folder for: ${P}`,b)}},[]),ie=p.useCallback(async T=>{const P=e.find(b=>b.id===T);E.doc.info(`Cancelling indexing for: ${(P==null?void 0:P.filename)||T}`);try{await k0(T),k.current.delete(T);const b=await ji();t(b.documents||[]),E.doc.info(`Cancelled indexing for: ${(P==null?void 0:P.filename)||T}`)}catch(b){E.doc.error(`Failed to cancel indexing: ${(P==null?void 0:P.filename)||T}`,b)}},[e,t]),X=p.useCallback(async T=>{if(!i)return;const P=e.find(b=>b.id===T);E.doc.info(`Attaching document to session: ${(P==null?void 0:P.filename)||T}`);try{await Qa(i,T);const b=we.getState().sessions.find(B=>B.id===i),J=(b==null?void 0:b.document_ids)??[];J.includes(T)||a(i,{document_ids:[...J,T]}),E.doc.info(`Attached "${(P==null?void 0:P.filename)||T}" to session ${i}`)}catch(b){E.doc.error(`Failed to attach document to session: ${(P==null?void 0:P.filename)||T}`,b)}},[i,e,a]),xe=p.useCallback(async T=>{T.preventDefault(),g.trim()&&(E.doc.info(`Indexing from path input: ${g.trim()}`),await M(g.trim(),g.trim().split(/[\\/]/).pop()||"file"),v(""))},[g,M]),ce=T=>{const P=T.indexing_status||"complete",b=k.current.get(T.id),J=T.indexed_at?_E(T.indexed_at):"",B=T.indexed_at?EE(T.indexed_at):"";switch(P){case"indexing":case"pending":return s.jsxs("div",{className:"doc-indexing-status",children:[s.jsxs("div",{className:"doc-indexing-bar",children:[s.jsx("div",{className:"doc-indexing-bar-track",children:s.jsx("div",{className:"doc-indexing-bar-fill"})}),s.jsxs("span",{className:"doc-indexing-label",children:[s.jsx(rw,{size:12,className:"doc-spin"}),"Indexing",b?` (${CE(b)})`:"..."]})]}),s.jsxs("button",{className:"btn-cancel",onClick:S=>{S.stopPropagation(),ie(T.id)},title:"Cancel indexing","aria-label":`Cancel indexing ${T.filename}`,children:[s.jsx(Tm,{size:14}),"Cancel"]})]});case"failed":return s.jsxs("span",{className:"doc-status-badge doc-status-failed",children:[s.jsx(kt,{size:12})," Failed"]});case"cancelled":return s.jsxs("span",{className:"doc-status-badge doc-status-cancelled",children:[s.jsx(Tm,{size:12})," Cancelled"]});case"missing":return s.jsxs("span",{className:"doc-status-badge doc-status-missing",children:[s.jsx(kt,{size:12})," File missing"]});default:return s.jsxs("span",{className:"doc-meta",children:[D(T.file_size)," · ",T.chunk_count," chunks",J&&s.jsxs("span",{className:"doc-timestamp",title:`Indexed: ${B}`,children:[s.jsx(Wa,{size:10}),J]})]})}};return s.jsx("div",{className:"modal-overlay",onClick:()=>n(!1),role:"dialog","aria-modal":"true","aria-label":"Document Library",children:s.jsxs("div",{className:"modal-panel doc-modal",onClick:T=>T.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h3",{children:"Document Library"}),s.jsx("button",{className:"btn-icon",onClick:()=>n(!1),"aria-label":"Close document library",children:s.jsx(tt,{size:18})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsx("div",{className:`drop-zone ${c?"drag-over":""} ${d?"uploading":""}`,onDragOver:T=>{T.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:U,children:d?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"upload-spinner"}),s.jsx("p",{children:h})]}):s.jsxs(s.Fragment,{children:[s.jsx(pl,{size:32,strokeWidth:1.5}),s.jsx("p",{children:"Drop files here to index"}),s.jsx("span",{className:"drop-hint",children:"PDF, TXT, MD, code files, and 50+ formats"})]})}),s.jsxs("form",{className:"path-input-form",onSubmit:xe,children:[s.jsx(Yn,{size:16,className:"path-icon"}),s.jsx("input",{type:"text",className:"path-input",value:g,onChange:T=>v(T.target.value),placeholder:"Or enter file path: C:\\docs\\manual.pdf","aria-label":"File path to index"}),s.jsx("button",{type:"submit",className:"btn-secondary",disabled:!g.trim()||d,children:"Index"}),s.jsxs("button",{type:"button",className:"btn-secondary",onClick:()=>{n(!1),r(!0)},title:"Browse files on this computer",children:[s.jsx(Fn,{size:14}),"Browse Files"]})]}),w&&s.jsx(Gx,{filename:w.filename,error:w.error,onDismiss:()=>x(null)}),e.length>0&&s.jsxs("div",{className:"doc-stats",children:[s.jsxs("span",{children:[e.length," document",e.length!==1?"s":""]}),s.jsx("span",{children:"·"}),s.jsxs("span",{children:[_," chunks"]}),s.jsx("span",{children:"·"}),s.jsx("span",{children:D(A)})]}),s.jsxs("div",{className:"doc-list",children:[e.length===0&&!d&&s.jsxs("div",{className:"empty-docs",children:[s.jsx($n,{size:32,strokeWidth:1}),s.jsx("p",{children:"No documents indexed yet"}),s.jsx("span",{children:"Drop files above or enter a file path"})]}),e.map(T=>{var P;return s.jsxs("div",{className:`doc-row ${T.indexing_status==="indexing"?"doc-row-indexing":""}`,children:[s.jsxs("div",{className:"doc-info",children:[s.jsx("span",{className:"doc-name",children:T.filename}),ce(T)]}),s.jsxs("div",{className:"doc-row-actions",children:[T.filepath&&s.jsx("button",{className:"btn-icon-sm doc-open-folder",onClick:()=>re(T.filepath,T.filename),title:`Open folder: ${T.filepath}`,"aria-label":`Open containing folder for ${T.filename}`,children:s.jsx(Yn,{size:14})}),i&&T.indexing_status==="complete"&&!((P=o==null?void 0:o.document_ids)!=null&&P.includes(T.id))&&s.jsx("button",{className:"btn-icon-sm doc-attach",onClick:()=>X(T.id),title:"Use in current session","aria-label":`Attach ${T.filename} to current session`,children:s.jsx(nw,{size:14})}),T.indexing_status!=="indexing"&&T.indexing_status!=="pending"&&s.jsx("button",{className:"btn-icon-sm doc-delete",onClick:()=>O(T.id),title:"Remove","aria-label":`Remove ${T.filename}`,children:s.jsx(ci,{size:14})})]})]},T.id)})]})]})]})})}function zE(e){if(e.type==="folder")return s.jsx(my,{size:16});const t=(e.extension||"").toLowerCase();return[".csv",".xlsx",".xls",".tsv"].includes(t)?s.jsx(ww,{size:16}):[".py",".js",".ts",".java",".c",".cpp",".go",".rs"].includes(t)?s.jsx(Qk,{size:16}):[".pdf",".doc",".docx",".txt",".md"].includes(t)?s.jsx($n,{size:16}):s.jsx(fy,{size:16})}function LE(e){if(e<=0)return"";const t=1024,n=["B","KB","MB","GB"],r=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1);return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]}function IE(e){if(!e)return"";const t=new Date(e),n=new Date,r=n.getTime()-t.getTime(),i=Math.floor(r/36e5);if(i<1)return"Just now";if(i<24)return`${i}h ago`;const l=Math.floor(i/24);return l<7?`${l}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:t.getFullYear()!==n.getFullYear()?"numeric":void 0})}function DE(e){switch(e){case"home":return s.jsx(Jk,{size:14});case"desktop":return s.jsx(lw,{size:14});case"documents":return s.jsx($n,{size:14});case"download":return s.jsx(oi,{size:14});default:return s.jsx(my,{size:14})}}const AE=[{label:"All Files",value:""},{label:"Documents",value:"pdf,doc,docx,txt,md"},{label:"Spreadsheets",value:"csv,xlsx,xls,tsv"},{label:"Code",value:"py,js,ts,java,c,cpp,go,rs,rb,sh"},{label:"Data",value:"json,xml,yaml,yml,csv,tsv"}];async function Fh(e,t,n,r){var f;const i=[],l=[];for(const h of e){const m=h.includes(".")?"."+((f=h.split(".").pop())==null?void 0:f.toLowerCase()):"";m&&!eo(m)?l.push(h):i.push(h)}const a=[],o=[];let c=0,u="";const d=new Set(t.filter(h=>h.type==="folder").map(h=>h.path));for(const h of i)try{if(d.has(h)){const m=await j0(h),g=[];m.documents.forEach(v=>{v.id&&g.push(v.id)}),g.length>0&&(g.forEach(v=>a.push(v)),o.push(h))}else{const m=await Dy(h);m!=null&&m.id&&(a.push(m.id),o.push(h))}}catch(m){c++,u=m instanceof Error?m.message:"Unknown error"}if(n&&a.length>0){for(const v of a)try{await Qa(n,v)}catch(w){E.doc.warn(`Could not attach document to session: ${w}`)}const h=we.getState().sessions.find(v=>v.id===n),m=(h==null?void 0:h.document_ids)??[],g=a.filter(v=>!m.includes(v));g.length>0&&r(n,{document_ids:[...m,...g]})}return{docIds:a,supported:i,succeededFiles:o,unsupported:l,failed:c,lastError:u}}function PE(){const{setShowFileBrowser:e,currentSessionId:t,updateSessionInList:n,setPendingPrompt:r}=we(),[i,l]=p.useState(""),[a,o]=p.useState(null),[c,u]=p.useState([]),[d,f]=p.useState([]),[h,m]=p.useState(!1),[g,v]=p.useState(null),[w,x]=p.useState(""),[k,j]=p.useState(null),[z,A]=p.useState(!1),[_,D]=p.useState(""),[C,M]=p.useState(new Set),[N,U]=p.useState(null),[O,re]=p.useState(!1),[ie,X]=p.useState(new Set),[xe,ce]=p.useState(null),T=p.useRef(null),[P,b]=p.useState(null),J=p.useCallback(async L=>{m(!0),v(null),j(null),x("");try{const F=await b0(L);l(F.current_path),o(F.parent_path),u(F.entries),F.quick_links.length>0&&f(F.quick_links),E.ui.info(`Browsing: ${F.current_path} (${F.entries.length} items)`)}catch(F){const Y=F instanceof Error?F.message:"Failed to load directory";v(Y),E.ui.error("Browse failed",F)}finally{m(!1)}},[]);p.useEffect(()=>{J()},[J]),p.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]);const B=p.useCallback(async()=>{if(!w.trim()){j(null);return}A(!0),v(null);try{const L=await S0(w.trim(),_||void 0,30);j(L.results),E.ui.info(`Search "${w}": ${L.total} results`)}catch(L){const F=L instanceof Error?L.message:"Search failed";v(F),E.ui.error("Search failed",L)}finally{A(!1)}},[w,_]),S=L=>{L.key==="Enter"&&B()},oe=p.useCallback(L=>{L.type==="folder"&&(J(L.path),M(new Set),U(null))},[J]),pe=p.useCallback(async L=>{re(!0);try{const F=await N0(L);U(F)}catch(F){E.ui.error("Preview failed",F)}finally{re(!1)}},[]),ae=p.useCallback(async()=>{if(C.size===0)return;const L=Array.from(C);if(b(null),!L.some(Y=>{var he;const ue=Y.includes(".")?"."+((he=Y.split(".").pop())==null?void 0:he.toLowerCase()):"";return!ue||eo(ue)})){const Y=L[0],ue=Y.lastIndexOf("."),he=ue>0?Y.slice(ue).toLowerCase():"",H=Ks(he);b({filename:L.length===1?Y.split(/[\\/]/).pop()||Y:`${L.length} files`,error:H?H.message:`File type "${he}" is not supported for indexing.`});return}X(new Set(L)),ce(`Indexing ${L.length} file(s)...`);try{const Y=await Fh(L,c,t,n);if(Y.failed>0)ce(`Done: ${Y.docIds.length} indexed, ${Y.failed} failed`),b({filename:`${Y.failed} file(s)`,error:Y.lastError||"Indexing failed for some files"});else{const ue=Y.unsupported.length>0?` (${Y.unsupported.length} skipped — unsupported type)`:"";ce(`Successfully indexed ${Y.docIds.length} file(s)${ue}`)}T.current&&clearTimeout(T.current),T.current=setTimeout(()=>ce(null),5e3),M(new Set)}catch(Y){E.doc.error("Index selected failed",Y),b({filename:L.length===1?L[0].split(/[\\/]/).pop()||L[0]:`${L.length} files`,error:Y instanceof Error?Y.message:"An unexpected error occurred."})}finally{X(new Set)}},[C,t,n,c]),_e=p.useCallback(async()=>{if(C.size===0)return;const L=Array.from(C);b(null),X(new Set(L)),ce(`Indexing ${L.length} file(s) for analysis...`);try{const F=await Fh(L,c,t,n);if(F.supported.length===0){const he=L[0].lastIndexOf("."),H=he>0?L[0].slice(he).toLowerCase():"",le=Ks(H);b({filename:L.length===1?L[0].split(/[\\/]/).pop()||L[0]:`${L.length} files`,error:(le==null?void 0:le.message)??`File type "${H}" is not supported for indexing.`});return}if(F.docIds.length===0){b({filename:F.supported.length===1?F.supported[0].split(/[\\/]/).pop()||F.supported[0]:`${F.supported.length} files`,error:"Failed to index selected file(s). Please try again."});return}F.failed>0&&ce(`Warning: ${F.failed} file(s) failed to index and will be excluded.`);const Y=(F.succeededFiles.length>0?F.succeededFiles:F.supported).map(he=>he.split(/[\\/]/).pop()||he),ue=Y.length===1?`Please analyze this document for me: ${Y[0]}`:`Please analyze these documents for me:
|
|
541
|
-
${Y.map(he=>`- ${he}`).join(`
|
|
542
|
-
`)}`;r(ue),e(!1),M(new Set)}catch(F){E.doc.error("Ask Agent failed",F),b({filename:L.length===1?L[0].split(/[\\/]/).pop()||L[0]:`${L.length} files`,error:F instanceof Error?F.message:"An unexpected error occurred."})}finally{X(new Set),ce(null)}},[C,t,n,c,r,e]),He=i?i.replace(/\\/g,"/").split("/").filter(Boolean):[],nt=He.map((L,F)=>({label:L,path:He.slice(0,F+1).join("/")+(F===0&&L.includes(":")?"/":"")})),Ge=k?k.map(L=>({name:L.name,path:L.path,type:"file",size:L.size,extension:L.extension||"",modified:L.modified||""})):c;return s.jsx("div",{className:"modal-overlay",onClick:()=>e(!1),role:"dialog","aria-modal":"true","aria-label":"File Browser",children:s.jsxs("div",{className:`modal-panel file-browser-modal ${N?"has-preview":""}`,onClick:L=>L.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsxs("h3",{children:[s.jsx(Yn,{size:18})," File Browser"]}),s.jsx("button",{className:"btn-icon",onClick:()=>e(!1),"aria-label":"Close",children:s.jsx(tt,{size:18})})]}),s.jsxs("div",{className:"file-browser-body",children:[s.jsx("div",{className:"fb-quick-links",children:d.map(L=>s.jsxs("button",{className:"fb-quick-link",onClick:()=>J(L.path),title:L.path,children:[DE(L.icon),s.jsx("span",{children:L.name})]},L.path))}),s.jsxs("div",{className:"fb-search-bar",children:[s.jsxs("div",{className:"fb-search-input-wrap",children:[s.jsx(Fn,{size:14,className:"fb-search-icon"}),s.jsx("input",{type:"text",className:"fb-search-input",placeholder:"Search files on your PC...",value:w,onChange:L=>x(L.target.value),onKeyDown:S,"aria-label":"Search files"}),w&&s.jsx("button",{className:"fb-search-clear",onClick:()=>{x(""),j(null)},"aria-label":"Clear search",children:s.jsx(tt,{size:12})})]}),s.jsx("select",{className:"fb-type-filter",value:_,onChange:L=>D(L.target.value),"aria-label":"File type filter",children:AE.map(L=>s.jsx("option",{value:L.value,children:L.label},L.value))}),s.jsx("button",{className:"fb-search-btn",onClick:B,disabled:!w.trim()||z,children:z?"Searching...":"Search"})]}),!k&&s.jsxs("div",{className:"fb-breadcrumb",children:[s.jsx("button",{className:"fb-crumb",onClick:()=>J("/"),children:s.jsx(Xk,{size:12})}),nt.map((L,F)=>s.jsxs("span",{className:"fb-crumb-item",children:[s.jsx(ss,{size:12,className:"fb-crumb-sep"}),s.jsx("button",{className:"fb-crumb",onClick:()=>J(L.path),children:L.label})]},F)),a&&s.jsx("button",{className:"fb-up-btn",onClick:()=>J(a),title:"Go up",children:s.jsx(Hk,{size:14})})]}),k&&s.jsxs("div",{className:"fb-search-header",children:[s.jsxs("span",{children:["Found ",k.length,' result(s) for "',w,'"']}),s.jsx("button",{className:"fb-back-btn",onClick:()=>{j(null),x("")},children:"Back to browsing"})]}),g&&s.jsx("div",{className:"fb-error",children:g}),s.jsxs("div",{className:"fb-content",children:[s.jsxs("div",{className:"fb-file-list",children:[h&&s.jsx("div",{className:"fb-loading",children:"Loading..."}),!h&&Ge.length===0&&s.jsx("div",{className:"fb-empty",children:k?"No files found":"This folder is empty"}),!h&&Ge.map(L=>{var he;const F=L.extension||(L.name.includes(".")?"."+((he=L.name.split(".").pop())==null?void 0:he.toLowerCase()):""),Y=L.type==="file"&&F&&!eo(F),ue=Y?Ks(F):null;return s.jsxs("div",{className:`fb-entry ${L.type} ${C.has(L.path)?"selected":""} ${Y?"unsupported":""}`,onClick:()=>L.type==="folder"?oe(L):pe(L.path),onDoubleClick:()=>L.type==="folder"?oe(L):void 0,title:Y?`${(ue==null?void 0:ue.label)||"This"} file type cannot be indexed`:L.path,children:[s.jsx("input",{type:"checkbox",className:"fb-entry-checkbox",checked:C.has(L.path),onChange:()=>{M(H=>{const le=new Set(H);return le.has(L.path)?le.delete(L.path):le.add(L.path),le})},onClick:H=>H.stopPropagation(),"aria-label":`Select ${L.name}`}),s.jsx("span",{className:"fb-entry-icon",children:zE(L)}),s.jsx("span",{className:"fb-entry-name",title:L.path,children:L.name}),Y&&s.jsx("span",{className:"fb-unsupported-badge",children:"Not indexable"}),s.jsx("span",{className:"fb-entry-size",children:L.type==="file"?LE(L.size):""}),s.jsx("span",{className:"fb-entry-date",children:IE(L.modified)})]},L.path)})]}),N&&s.jsxs("div",{className:"fb-preview",children:[s.jsxs("div",{className:"fb-preview-header",children:[s.jsx("span",{className:"fb-preview-name",children:N.name}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>U(null),"aria-label":"Close preview",children:s.jsx(tt,{size:14})})]}),s.jsxs("div",{className:"fb-preview-meta",children:[s.jsx("span",{children:N.size_display}),N.total_lines&&s.jsxs("span",{children:[N.total_lines," lines"]}),N.columns&&s.jsxs("span",{children:[N.columns.length," columns"]}),N.row_count!==null&&s.jsxs("span",{children:[N.row_count," rows"]})]}),N.columns&&s.jsxs("div",{className:"fb-preview-columns",children:[s.jsx("strong",{children:"Columns:"})," ",N.columns.join(", ")]}),O?s.jsx("div",{className:"fb-preview-loading",children:"Loading preview..."}):N.is_text&&N.preview_lines.length>0?s.jsx("pre",{className:"fb-preview-content",children:N.preview_lines.slice(0,30).join(`
|
|
543
|
-
`)}):s.jsx("div",{className:"fb-preview-binary",children:"Binary file - no preview available"})]})]}),P&&s.jsx(Gx,{filename:P.filename,error:P.error,onDismiss:()=>b(null)}),s.jsxs("div",{className:"fb-actions",children:[s.jsx("div",{className:"fb-selection-info",children:C.size>0?`${C.size} item(s) selected`:"Select files to index or analyze"}),xe&&s.jsx("span",{className:"fb-index-status",children:xe}),s.jsxs("div",{className:"fb-action-btns",children:[s.jsxs("button",{className:"fb-action-btn secondary",onClick:ae,disabled:C.size===0||ie.size>0,title:"Index selected files for RAG search",children:[s.jsx(pl,{size:14}),"Index Selected"]}),s.jsxs("button",{className:"fb-action-btn primary",onClick:_e,disabled:C.size===0||ie.size>0,title:"Index and send selected files to the chat agent for analysis",children:[s.jsx(Jr,{size:14}),"Ask Agent"]})]})]})]})]})})}const qd="/api";async function De(e,t,n){const r=`${qd}${t}`,i={};e!=="GET"&&(i["X-Gaia-UI"]="1"),n!==void 0&&(i["Content-Type"]="application/json");const l={method:e,headers:Object.keys(i).length>0?i:void 0,body:n!==void 0?JSON.stringify(n):void 0},a=await fetch(r,l);if(!a.ok){const c=await a.text().catch(()=>"");let u=c;try{u=JSON.parse(c).detail||c}catch{}throw new Error(u||`Memory API error (HTTP ${a.status})`)}if((a.headers.get("content-type")||"").includes("application/json"))return a.json()}function Qx(e){const t=[];for(const[n,r]of Object.entries(e))if(!(r==null||r===""))if(Array.isArray(r))for(const i of r)t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`);else t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`);return t.length?`?${t.join("&")}`:""}function ME(){return De("GET","/memory/stats")}function RE(e=30){return De("GET",`/memory/activity?days=${e}`)}function $E(e={}){return De("GET",`/memory/knowledge${Qx(e)}`)}function FE(e){return De("POST","/memory/knowledge",e)}function Oh(e,t){return De("PUT",`/memory/knowledge/${encodeURIComponent(e)}`,t)}function OE(e){return De("DELETE",`/memory/knowledge/${encodeURIComponent(e)}`)}function UE(){return De("GET","/memory/entities")}function BE(){return De("GET","/memory/tools")}function HE(e=20){return De("GET",`/memory/conversations?limit=${e}`)}function VE(e,t=20){return De("GET",`/memory/conversations/search?query=${encodeURIComponent(e)}&limit=${t}`)}function WE(e){return De("GET",`/memory/conversations/${encodeURIComponent(e)}`)}function GE(e=7){return De("GET",`/memory/upcoming?days=${e}`)}function qE(){return De("GET","/memory/embedding-coverage")}function QE(){return De("POST","/memory/consolidate")}function KE(){return De("POST","/memory/rebuild-embeddings")}function YE(){return De("POST","/memory/reconcile")}function XE(){return De("POST","/memory/rebuild-fts")}function JE(){return De("POST","/memory/refresh-system-context")}function ZE(){return new EventSource(`${qd}/memory/stream-discovery`)}function eT(e){return new EventSource(`${qd}/memory/stream-inference?include_browser=${e}`)}function tT(e){return De("POST","/memory/commit-discovery",{items:e})}function nT(e){return De("POST","/memory/commit-inference",{insights:e})}function rT(){return De("GET","/memory/settings")}function vi(e){return De("PUT","/memory/settings",e)}function iT(){return De("DELETE","/memory/all")}function sT(){return De("POST","/memory/reinitialize")}function lT(){return De("GET","/goals/stats")}function aT(e={}){return De("GET",`/goals${Qx(e)}`)}function oT(e){return De("POST","/goals",e)}function cT(e){return De("PUT",`/goals/${encodeURIComponent(e)}/approve`)}function uT(e){return De("PUT",`/goals/${encodeURIComponent(e)}/reject`)}function dT(e){return De("PUT",`/goals/${encodeURIComponent(e)}/cancel`)}function fT(e){return De("DELETE",`/goals/${encodeURIComponent(e)}`)}function Uh(e){if(!e)return"—";try{const t=new Date(e);if(isNaN(t.getTime()))return"—";const n={month:"short",day:"numeric"};return t.getFullYear()!==new Date().getFullYear()&&(n.year="numeric"),t.toLocaleDateString(void 0,n)}catch{return"—"}}function Nn(e){if(!e)return"";try{const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function jr(e){if(!e)return"—";try{const t=new Date(e);if(isNaN(t.getTime()))return"—";const n=Date.now(),r=t.getTime()-n,i=Math.abs(r),l=Math.floor(i/1e3),a=Math.floor(i/6e4),o=Math.floor(i/36e5),c=Math.floor(i/864e5);return r<0?l<5?"just now":l<60?`${l}s ago`:o===0?`${a}m ago`:c===0?`${o}h ago`:c===1?"yesterday":c<30?`${c}d ago`:Nn(e):l<5?"now":l<60?`in ${l}s`:o===0?`in ${a}m`:c===0?`in ${o}h`:c===1?"tomorrow":c<30?`in ${c}d`:Nn(e)}catch{return"—"}}function mT(e){if(e<=0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1);return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]}function hT(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function Bh(e){try{return new Date(e).getTime()<Date.now()}catch{return!1}}function pT(e){return e>=.7?"high":e>=.4?"medium":"low"}function Hh(e){return e>=.9?"high":e>=.7?"medium":"low"}function gT(e,t){const n=Uh(e),r=Uh(t);return n==="—"&&r==="—"?"":n===r?n:`${n} – ${r}`}function yT(e){if(e.length===0)return 0;const t=new Date().toISOString().slice(0,10),n=e.find(r=>r.date===t);return n?n.knowledge_added:0}const Vh=["fact","preference","error","skill","note","reminder"],xT={work:"blue",technical:"purple",personal:"green",general:"gray"};function vT(){var Zd,ef,tf,nf,rf,sf,lf,af,of,cf,uf,df,ff,mf,hf,pf;const{setShowMemoryDashboard:e}=we(),[t,n]=p.useState(null),[r,i]=p.useState([]),[l,a]=p.useState(null),[o,c]=p.useState([]),[u,d]=p.useState([]),[f,h]=p.useState([]),[m,g]=p.useState(null),[v,w]=p.useState([]),[x,k]=p.useState(!0),[j,z]=p.useState(null),[A,_]=p.useState(null),[D,C]=p.useState(!1),[M,N]=p.useState(null),[U,O]=p.useState([]),re=p.useRef(0),[ie,X]=p.useState([]),[xe,ce]=p.useState(""),[T,P]=p.useState(""),[b,J]=p.useState(""),[B,S]=p.useState("updated_at"),[oe,pe]=p.useState("desc"),[ae,_e]=p.useState(0),[He,nt]=p.useState(!1),Ge=15,[L,F]=p.useState(""),[Y,ue]=p.useState(null),he=p.useRef(null),[H,le]=p.useState(null),[Pe,Ae]=p.useState(!1),[$e,ut]=p.useState(null),[je,Je]=p.useState({content:"",category:"fact",domain:"",context:"global",entity:"",sensitive:!1,due_at:""}),[Vr,os]=p.useState(new Set),[$,Q]=p.useState(!1),[de,ve]=p.useState(!1),[be,wt]=p.useState(!1),[pt,qe]=p.useState(!1),[Pt,Xt]=p.useState(!1),[rt,Mt]=p.useState(!1),[bt,xn]=p.useState(null),[cn,Jt]=p.useState("dashboard"),[Zt,sr]=p.useState([]),[vn,cs]=p.useState(null),[kn,gt]=p.useState(!1),[Hn,lr]=p.useState(null),[_l,ar]=p.useState(!1),[or,cr]=p.useState({title:"",description:"",priority:"medium"}),[st,ur]=p.useState("idle"),[us,wn]=p.useState([]),[Vn,dr]=p.useState([]),[El,Tl]=p.useState(null),bn=p.useRef(null),fr=p.useRef(null),[jt,mr]=p.useState("idle"),[ds,Dn]=p.useState([]),[Wn,hr]=p.useState([]),[zl,Ll]=p.useState(null),[fs,_o]=p.useState(!1),pi=p.useRef(null),pr=p.useRef(null),[ms,Il]=p.useState(30),[gi,hs]=p.useState(!1),[I,q]=p.useState(!1),[te,Z]=p.useState(!1),[ge,Ee]=p.useState(!1),[yt,gr]=p.useState(!1),[lt,Et]=p.useState(!1),St=p.useRef(null),V=p.useRef(null),ee=p.useCallback((y,R="info")=>{const se=++re.current;O(me=>[...me,{id:se,text:y,type:R}]),setTimeout(()=>{O(me=>me.filter(Fe=>Fe.id!==se))},4e3)},[]);p.useEffect(()=>{if(!D)return;const y=R=>{V.current&&!V.current.contains(R.target)&&C(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[D]),p.useEffect(()=>{const y=R=>{R.key==="Escape"&&(bt?xn(null):Pt?Xt(!1):rt?Mt(!1):H?le(null):D?C(!1):Pe||$e?(Ae(!1),ut(null)):M?N(null):e(!1))};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[H,D,Pe,$e,M,e,bt,Pt,rt]);const Ce=p.useCallback(async()=>{try{const y=await ME();n(y)}catch(y){E.system.warn("Failed to load memory stats",y)}},[]),dt=p.useCallback(async()=>{try{const y=await RE(ms);i(y)}catch(y){E.system.warn("Failed to load memory activity",y)}},[ms]),Ie=p.useCallback(async()=>{try{const y=await $E({category:ie.length>0?ie:void 0,context:xe||void 0,entity:T||void 0,search:b||void 0,sort_by:B,order:oe,offset:ae,limit:Ge,include_sensitive:!0,include_superseded:He});a(y)}catch(y){E.system.warn("Failed to load knowledge",y)}},[ie,xe,T,b,B,oe,ae,He]),ze=p.useCallback(async()=>{try{const y=await BE();c(y)}catch(y){E.system.warn("Failed to load tool summary",y)}},[]),Me=p.useCallback(async()=>{try{const y=await HE(20);d(y)}catch(y){E.system.warn("Failed to load conversations",y)}},[]),Ht=p.useCallback(async()=>{try{const y=await GE(7);h(y)}catch(y){E.system.warn("Failed to load upcoming items",y)}},[]),Ze=p.useCallback(async()=>{try{const y=await qE();g(y)}catch(y){E.system.warn("Failed to load embedding coverage",y)}},[]),ps=p.useCallback(async()=>{try{const y=await UE();w(y||[])}catch(y){E.system.warn("Failed to load entities",y)}},[]),Kd=p.useCallback(async()=>{try{const y=await rT();ve(y.mcp_memory_enabled),Q(y.memory_enabled),wt(y.system_discovery_consent)}catch(y){E.system.warn("Failed to load memory settings",y)}},[]),yr=p.useCallback(async()=>{gt(!0);try{const[y,R]=await Promise.all([aT(),lT()]);sr(y.goals),cs(R)}catch(y){E.system.warn("Failed to load goals",y)}finally{gt(!1)}},[]),Rt=p.useCallback(async()=>{k(!0),z(null);try{await Promise.all([Ce(),dt(),Ie(),ze(),Me(),Ht(),Ze(),ps(),Kd(),yr()])}catch(y){z("Failed to load memory data. Is the backend running?"),E.system.error("Memory dashboard load failed",y)}finally{k(!1)}},[Ce,dt,Ie,ze,Me,Ht,Ze,ps,Kd,yr]);p.useEffect(()=>{Rt()},[Rt]),p.useEffect(()=>{Ie()},[Ie]);const Yd=p.useRef(!0);p.useEffect(()=>{if(Yd.current){Yd.current=!1;return}dt()},[dt]);const Yx=p.useCallback(y=>{J(y),Et(!0),St.current&&clearTimeout(St.current),St.current=setTimeout(()=>{_e(0),Et(!1)},300)},[]),Xx=p.useCallback(async()=>{if(je.content.trim())try{await FE({content:je.content,category:je.category,domain:je.domain||void 0,context:je.context,entity:je.entity||void 0,sensitive:je.sensitive,due_at:je.due_at||void 0}),Ae(!1),Je({content:"",category:"fact",domain:"",context:"global",entity:"",sensitive:!1,due_at:""}),Ie(),Ce(),Ze(),E.ui.info("Created new knowledge entry"),ee("Memory created successfully","success")}catch(y){E.system.error("Failed to create knowledge",y),ee("Failed to create memory","error")}},[je,Ie,Ce,Ze,ee]),Jx=p.useCallback(async()=>{if(!(!$e||!je.content.trim()))try{await Oh($e,{content:je.content,category:je.category,domain:je.domain||void 0,context:je.context,entity:je.entity||void 0,sensitive:je.sensitive,due_at:je.due_at||void 0}),ut(null),Je({content:"",category:"fact",domain:"",context:"global",entity:"",sensitive:!1,due_at:""}),Ie(),E.ui.info(`Updated knowledge ${$e}`),ee("Memory updated","success")}catch(y){E.system.error("Failed to update knowledge",y),ee("Failed to update memory","error")}},[$e,je,Ie,ee]),Zx=p.useCallback(async y=>{try{await OE(y),Ie(),Ce(),Ze(),E.ui.info(`Deleted knowledge ${y}`),ee("Memory deleted","info")}catch(R){E.system.error("Failed to delete knowledge",R),ee("Failed to delete memory","error")}},[Ie,Ce,Ze,ee]),ev=p.useCallback(async y=>{try{await Oh(y.id,{sensitive:!y.sensitive}),Ie(),E.ui.info(`Toggled sensitive for ${y.id}: ${!y.sensitive}`),ee(y.sensitive?"Unmarked as sensitive":"Marked as sensitive","info")}catch(R){E.system.error("Failed to toggle sensitive",R),ee("Failed to toggle sensitive flag","error")}},[Ie,ee]),tv=p.useCallback(y=>{ut(y.id),Ae(!1),Je({content:y.content,category:y.category,domain:y.domain||"",context:y.context,entity:y.entity||"",sensitive:y.sensitive,due_at:y.due_at||""})},[]),nv=p.useCallback(y=>{navigator.clipboard.writeText(y).catch(()=>{}),E.ui.info(`Copied knowledge ID: ${y}`),ee("ID copied to clipboard","info")},[ee]),rv=p.useCallback(y=>{if(F(y),he.current&&clearTimeout(he.current),!y.trim()){ue(null);return}he.current=setTimeout(async()=>{try{const R=await VE(y.trim(),20);ue(R)}catch(R){E.system.warn("Conversation search failed",R)}},300)},[]),Xd=p.useCallback(async y=>{try{const R=await WE(y);le({sessionId:y,turns:R})}catch(R){E.system.error("Failed to load conversation detail",R)}},[]),iv=p.useCallback(y=>{X(R=>R.includes(y)?R.filter(se=>se!==y):[...R,y]),_e(0)},[]),gs=p.useCallback(y=>{B===y?pe(R=>R==="desc"?"asc":"desc"):(S(y),pe("desc")),_e(0)},[B]),sv=p.useCallback(async()=>{hs(!0),C(!1);try{const y=await QE();await Rt(),ee(`Consolidated ${y.consolidated??0} sessions, extracted ${y.extracted_items??0} items`,"success")}catch(y){E.system.error("Failed to consolidate sessions",y),ee("Failed to consolidate sessions","error")}finally{hs(!1)}},[Rt,ee]),lv=p.useCallback(async()=>{q(!0),C(!1);try{const y=await KE();await Ze(),ee(`Backfilled ${y.backfilled??0} embeddings${y.total_without?` (${y.total_without} were missing)`:""}`,"success")}catch(y){E.system.error("Failed to rebuild embeddings",y),ee("Failed to rebuild embeddings","error")}finally{q(!1)}},[Ze,ee]),av=p.useCallback(async()=>{Z(!0),C(!1);try{const y=await YE();await Rt(),ee(`Checked ${y.pairs_checked??0} pairs: ${y.reinforced??0} reinforced, ${y.contradicted??0} contradicted`,"success")}catch(y){E.system.error("Failed to reconcile memory",y),ee("Failed to reconcile memory","error")}finally{Z(!1)}},[Rt,ee]),ov=p.useCallback(async()=>{Ee(!0),C(!1);try{await XE(),await Rt(),ee("FTS indexes rebuilt successfully","success")}catch(y){E.system.error("Failed to rebuild FTS index",y),ee("Failed to rebuild FTS indexes","error")}finally{Ee(!1)}},[Rt,ee]),cv=p.useCallback(async()=>{gr(!0),C(!1);try{const y=await JE();await Rt(),y.skipped?ee("System context collection is disabled — enable it in settings","error"):ee(`System context refreshed: ${y.stored} facts updated`,"success")}catch(y){E.system.error("Failed to refresh system context",y),ee("Failed to refresh system context","error")}finally{gr(!1)}},[Rt,ee]),Jd=gi||I||te||ge||yt,uv=p.useCallback(()=>{ur("running"),wn([]),dr([]),Tl(null);const y=ZE();fr.current=y,y.onmessage=R=>{try{const se=JSON.parse(R.data);if(se.type==="log")wn(me=>[...me,{text:se.message,kind:"log"}]);else if(se.type==="finding"){const me=se.item;wn(Fe=>[...Fe,{text:` Found: ${me.content}`,kind:"finding"}]),dr(Fe=>[...Fe,{...me,_checked:!0}])}else se.type==="error"?wn(me=>[...me,{text:` Error: ${se.message}`,kind:"error"}]):se.type==="done"&&(y.close(),fr.current=null,wn(me=>[...me,{text:`Done. ${se.total??0} items discovered.`,kind:"log"}]),ur("review"))}catch{wn(se=>[...se,{text:"Failed to parse event data.",kind:"error"}])}},y.onerror=()=>{y.close(),fr.current=null,wn(R=>[...R,{text:"Connection error. Is the GAIA server running?",kind:"error"}]),dr(R=>(ur(R.length>0?"review":"idle"),R))}},[]),dv=p.useCallback(async()=>{const y=Vn.filter(R=>R._checked);if(y.length!==0){ur("saving");try{const R=y.map(({_checked:me,...Fe})=>Fe),se=await tT(R);Tl(se.stored),ur("done"),ee(`Saved ${se.stored} items to memory`,"success")}catch(R){E.system.error("Failed to commit discovery items",R),ee("Failed to save discovery items","error"),ur("review")}}},[Vn,ee]),fv=p.useCallback(()=>{mr("running"),Dn([]),hr([]),Ll(null);const y=eT(fs);pr.current=y,y.onmessage=R=>{try{const se=JSON.parse(R.data);if(se.type==="log")Dn(me=>[...me,{text:se.message,kind:"log"}]);else if(se.type==="insight"){const me=se.item;Dn(Fe=>[...Fe,{text:` Insight: ${me.content}`,kind:"finding"}]),hr(Fe=>[...Fe,{...me,_checked:!0}])}else se.type==="error"?Dn(me=>[...me,{text:` Error: ${se.message}`,kind:"error"}]):se.type==="done"&&(y.close(),pr.current=null,Dn(me=>[...me,{text:`Done. ${se.total??0} insights generated.`,kind:"log"}]),mr("review"))}catch{Dn(se=>[...se,{text:"Failed to parse event data.",kind:"error"}])}},y.onerror=()=>{y.close(),pr.current=null,Dn(R=>[...R,{text:"Connection error. Is Lemonade Server running?",kind:"error"}]),hr(R=>(mr(R.length>0?"review":"idle"),R))}},[fs]),mv=p.useCallback(async()=>{const y=Wn.filter(R=>R._checked);if(y.length!==0){mr("saving");try{const R=y.map(({_checked:me,...Fe})=>Fe),se=await nT(R);Ll(se.stored),mr("done"),ee(`Saved ${se.stored} insights to memory`,"success")}catch(R){E.system.error("Failed to commit inference insights",R),ee("Failed to save inference insights","error"),mr("review")}}},[Wn,ee]);p.useEffect(()=>{bn.current&&(bn.current.scrollTop=bn.current.scrollHeight)},[us]),p.useEffect(()=>{pi.current&&(pi.current.scrollTop=pi.current.scrollHeight)},[ds]),p.useEffect(()=>()=>{fr.current&&(fr.current.close(),fr.current=null),pr.current&&(pr.current.close(),pr.current=null)},[]);const ys=y=>B!==y?null:s.jsx("span",{className:"mem-sort-arrow",children:oe==="desc"?"↓":"↑"}),Dl=Math.max(1,...r.map(y=>y.conversations+y.tool_calls+y.knowledge_added+y.errors)),hv=(Zd=t==null?void 0:t.knowledge)!=null&&Zd.by_context?Object.keys(t.knowledge.by_context):[];return s.jsxs("div",{className:"memory-dashboard-page",children:[s.jsxs("div",{className:"memory-dashboard-header",children:[s.jsxs("div",{className:"memory-dashboard-header-left",children:[s.jsx("button",{className:"btn-icon settings-back-btn",onClick:()=>e(!1),"aria-label":"Back",children:s.jsx(ay,{size:18})}),s.jsxs("h3",{children:["Memory Dashboard ",s.jsx("span",{style:{fontSize:11,fontWeight:600,color:"#f59e0b",background:"rgba(245,158,11,0.15)",padding:"2px 8px",borderRadius:4,marginLeft:8,verticalAlign:"middle",letterSpacing:"0.5px"},children:"BETA"})]})]}),s.jsxs("div",{className:"memory-dashboard-header-actions",children:[m&&m.total_items>0&&s.jsxs("div",{className:"mem-embedding-coverage",title:`${m.with_embedding} of ${m.total_items} entries embedded`,children:[s.jsx("div",{className:"mem-embedding-bar",children:s.jsx("div",{className:"mem-embedding-fill",style:{width:`${Math.round(m.coverage_pct)}%`}})}),s.jsxs("span",{className:"mem-embedding-label",children:[Math.round(m.coverage_pct),"% embedded"]})]}),s.jsxs("div",{className:"mem-maintenance-wrap",ref:V,children:[s.jsxs("button",{className:`btn-icon ${Jd?"mem-spinning":""}`,onClick:()=>C(y=>!y),title:"Maintenance actions","aria-label":"Maintenance actions","aria-expanded":D,children:[Jd?s.jsx("div",{className:"mem-spinner-sm"}):s.jsx(bi,{size:16}),s.jsx(ai,{size:10,style:{marginLeft:2}})]}),D&&s.jsxs("div",{className:"mem-maintenance-menu",role:"menu",children:[s.jsxs("button",{className:"mem-maintenance-item",onClick:sv,disabled:gi,role:"menuitem",children:[s.jsx(Em,{size:14}),gi?"Consolidating...":"Consolidate Sessions"]}),s.jsxs("button",{className:"mem-maintenance-item",onClick:lv,disabled:I,role:"menuitem",children:[s.jsx(Ws,{size:14}),I?"Rebuilding...":"Rebuild Embeddings"]}),s.jsxs("button",{className:"mem-maintenance-item",onClick:av,disabled:te,role:"menuitem",children:[s.jsx(wi,{size:14}),te?"Reconciling...":"Reconcile Memory"]}),s.jsx("div",{className:"mem-maintenance-divider"}),s.jsxs("button",{className:"mem-maintenance-item",onClick:cv,disabled:yt,role:"menuitem",children:[s.jsx(Vs,{size:14}),yt?"Refreshing...":"Refresh System Context"]}),s.jsx("div",{className:"mem-maintenance-divider"}),s.jsxs("button",{className:"mem-maintenance-item",onClick:ov,disabled:ge,role:"menuitem",children:[s.jsx(Fn,{size:14}),ge?"Rebuilding...":"Rebuild FTS Indexes"]})]})]}),s.jsx("button",{className:"btn-icon",onClick:Rt,title:"Refresh","aria-label":"Refresh dashboard",children:s.jsx(Vs,{size:16})})]})]}),s.jsxs("div",{className:"mem-tab-bar",role:"tablist",children:[s.jsxs("button",{className:`mem-tab-btn${cn==="dashboard"?" mem-tab-active":""}`,onClick:()=>Jt("dashboard"),role:"tab","aria-selected":cn==="dashboard",children:[s.jsx(Jr,{size:14})," Dashboard"]}),s.jsxs("button",{className:`mem-tab-btn${cn==="goals"?" mem-tab-active":""}`,onClick:()=>{Jt("goals"),yr()},role:"tab","aria-selected":cn==="goals",children:[s.jsx(zm,{size:14})," Goals",vn&&(vn.goals.pending_approval??0)>0&&s.jsx("span",{className:"mem-tab-badge",children:vn.goals.pending_approval})]}),s.jsxs("button",{className:`mem-tab-btn${cn==="profile"?" mem-tab-active":""}`,onClick:()=>Jt("profile"),role:"tab","aria-selected":cn==="profile",children:[s.jsx(bw,{size:14})," Profile"]})]}),s.jsxs("div",{className:"memory-dashboard-body",children:[cn==="dashboard"&&s.jsx(s.Fragment,{children:x&&!t?s.jsxs("div",{className:"mem-loading",children:[s.jsx("div",{className:"mem-spinner"}),"Loading memory data..."]}):j?s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(pn,{size:32})}),s.jsx("p",{children:j}),s.jsxs("button",{className:"btn-secondary",onClick:Rt,style:{marginTop:12},children:[s.jsx(Vs,{size:14})," Retry"]})]}):s.jsxs(s.Fragment,{children:[!$&&s.jsxs("div",{className:"mem-empty-state",style:{margin:"40px 0"},children:[s.jsx("div",{className:"mem-empty-icon",style:{opacity:.5},children:s.jsx(Cs,{size:32})}),s.jsx("p",{style:{color:"#888",fontSize:14},children:"Memory is disabled. Enable it in Settings below to start storing knowledge, conversations, and preferences."})]}),$&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mem-stat-cards",children:[s.jsxs("div",{className:"mem-stat-card","data-accent":"purple",children:[s.jsx("div",{className:"mem-stat-value",children:((ef=t==null?void 0:t.knowledge)==null?void 0:ef.total)??0}),s.jsx("div",{className:"mem-stat-label",children:"Stored"}),s.jsx("div",{className:"mem-stat-sub",children:(()=>{var R;const y=yT(r);return y>0?`+${y} today`:(R=t==null?void 0:t.knowledge)!=null&&R.by_category?Object.entries(t.knowledge.by_category).slice(0,3).map(([se,me])=>`${me} ${se}s`).join(", "):"No entries"})()})]}),s.jsxs("div",{className:"mem-stat-card","data-accent":"gold",children:[s.jsx("div",{className:"mem-stat-value",children:((tf=t==null?void 0:t.knowledge)==null?void 0:tf.total_retrievals)??0}),s.jsx("div",{className:"mem-stat-label",children:"Retrieved"}),s.jsx("div",{className:"mem-stat-sub",children:(nf=t==null?void 0:t.knowledge)!=null&&nf.total&&((rf=t==null?void 0:t.knowledge)!=null&&rf.total_retrievals)?`avg ${(t.knowledge.total_retrievals/t.knowledge.total).toFixed(1)}x per memory`:"No recalls yet"})]}),s.jsxs("div",{className:"mem-stat-card","data-accent":"blue",children:[s.jsx("div",{className:"mem-stat-value",children:((sf=t==null?void 0:t.conversations)==null?void 0:sf.total_sessions)??0}),s.jsx("div",{className:"mem-stat-label",children:"Sessions"}),s.jsx("div",{className:"mem-stat-sub",children:gT(((lf=t==null?void 0:t.conversations)==null?void 0:lf.first_session)??null,((af=t==null?void 0:t.conversations)==null?void 0:af.last_session)??null)||`${((of=t==null?void 0:t.conversations)==null?void 0:of.total_turns)??0} total turns`})]}),s.jsxs("div",{className:"mem-stat-card","data-accent":"green",children:[s.jsx("div",{className:"mem-stat-value",children:((cf=t==null?void 0:t.tools)==null?void 0:cf.total_calls)??0}),s.jsx("div",{className:"mem-stat-label",children:"Tool Calls"}),s.jsxs("div",{className:"mem-stat-sub",children:[((uf=t==null?void 0:t.tools)==null?void 0:uf.unique_tools)??0," tools"]})]}),s.jsxs("div",{className:"mem-stat-card","data-accent":"red",children:[s.jsx("div",{className:"mem-stat-value",children:((df=t==null?void 0:t.tools)==null?void 0:df.overall_success_rate)!=null?`${Math.round(t.tools.overall_success_rate*100)}%`:"—"}),s.jsx("div",{className:"mem-stat-label",children:"Success Rate"}),s.jsxs("div",{className:"mem-stat-sub",children:[((ff=t==null?void 0:t.tools)==null?void 0:ff.total_errors)??0," errors"]})]})]}),s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title mem-section-title-row",children:[s.jsxs("span",{className:"mem-section-title-left",children:[s.jsx(Lm,{size:14})," Activity"]}),s.jsx("div",{className:"mem-range-tabs",role:"group","aria-label":"Activity range",children:[1,7,30].map(y=>s.jsx("button",{className:`mem-range-tab${ms===y?" active":""}`,onClick:()=>Il(y),children:y===1?"1D":y===7?"7D":"30D"},y))})]}),r.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mem-activity-chart",children:r.map((y,R)=>{const se=y.conversations+y.tool_calls+y.knowledge_added+y.errors,me=R===0||R===r.length-1||R%7===0,Fe=new Date(y.date+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"});return s.jsxs("div",{className:"mem-activity-bar-group",onMouseEnter:()=>_(R),onMouseLeave:()=>_(null),children:[y.errors>0&&s.jsx("div",{className:"mem-activity-bar errors",style:{height:`${y.errors/Dl*100}%`}}),y.knowledge_added>0&&s.jsx("div",{className:"mem-activity-bar knowledge",style:{height:`${y.knowledge_added/Dl*100}%`}}),y.tool_calls>0&&s.jsx("div",{className:"mem-activity-bar tool_calls",style:{height:`${y.tool_calls/Dl*100}%`}}),y.conversations>0&&s.jsx("div",{className:"mem-activity-bar conversations",style:{height:`${y.conversations/Dl*100}%`}}),me&&s.jsx("span",{className:"mem-activity-date-label",children:Fe}),A===R&&se>0&&s.jsxs("div",{className:"mem-activity-tooltip",children:[s.jsx("strong",{children:Fe}),s.jsx("br",{}),y.conversations>0&&s.jsxs(s.Fragment,{children:[y.conversations," conversations",s.jsx("br",{})]}),y.tool_calls>0&&s.jsxs(s.Fragment,{children:[y.tool_calls," tool calls",s.jsx("br",{})]}),y.knowledge_added>0&&s.jsxs(s.Fragment,{children:[y.knowledge_added," learned",s.jsx("br",{})]}),y.errors>0&&s.jsxs(s.Fragment,{children:[y.errors," errors"]})]})]},y.date)})}),s.jsxs("div",{className:"mem-activity-legend",children:[s.jsxs("span",{className:"mem-activity-legend-item",children:[s.jsx("span",{className:"mem-activity-legend-dot conversations"})," Conversations"]}),s.jsxs("span",{className:"mem-activity-legend-item",children:[s.jsx("span",{className:"mem-activity-legend-dot tool_calls"})," Tool Calls"]}),s.jsxs("span",{className:"mem-activity-legend-item",children:[s.jsx("span",{className:"mem-activity-legend-dot knowledge"})," Knowledge"]}),s.jsxs("span",{className:"mem-activity-legend-item",children:[s.jsx("span",{className:"mem-activity-legend-dot errors"})," Errors"]})]})]}):s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(Lm,{size:28})}),s.jsx("p",{children:"No activity data yet"})]})]}),s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title mem-section-title-row",children:[s.jsxs("span",{className:"mem-section-title-left",children:[s.jsx(Jr,{size:14})," Knowledge Browser",l&&l.total>0&&s.jsx("span",{className:"mem-section-count",children:l.total})]}),!Pe&&!$e&&s.jsxs("button",{className:"mem-section-add-btn",onClick:()=>Ae(!0),title:"Add a memory entry",children:[s.jsx(hl,{size:13})," Add"]})]}),s.jsxs("div",{className:"mem-filters",children:[s.jsxs("div",{className:"mem-category-pills",role:"group","aria-label":"Filter by category",children:[Vh.map(y=>s.jsx("button",{className:`mem-category-pill ${y}${ie.includes(y)?" active":""}`,onClick:()=>iv(y),"aria-pressed":ie.includes(y),children:y},y)),ie.length>0&&s.jsx("button",{className:"mem-category-pill clear",onClick:()=>{X([]),_e(0)},"aria-label":"Clear category filters",children:"✕ Clear"})]}),s.jsxs("select",{className:"mem-filter-select",value:xe,onChange:y=>{ce(y.target.value),_e(0)},"aria-label":"Filter by context",children:[s.jsx("option",{value:"",children:"All Contexts"}),hv.map(y=>s.jsx("option",{value:y,children:y},y))]}),s.jsxs("select",{className:"mem-filter-select",value:T,onChange:y=>{P(y.target.value),_e(0)},"aria-label":"Filter by entity",children:[s.jsx("option",{value:"",children:"All Entities"}),v.map(y=>s.jsxs("option",{value:y.entity,children:[y.entity," (",y.count,")"]},y.entity))]}),s.jsxs("div",{className:"mem-filter-search-wrap",children:[lt?s.jsx("div",{className:"mem-spinner-sm search-icon",style:{width:12,height:12,borderWidth:1.5}}):s.jsx(Fn,{size:13,className:"search-icon"}),s.jsx("input",{className:"mem-filter-search",type:"text",placeholder:"Search memories...",value:b,onChange:y=>Yx(y.target.value),"aria-label":"Search memories"})]}),s.jsxs("label",{className:"mem-filter-toggle",title:"Show entries that have been superseded by newer versions",children:[s.jsx("input",{type:"checkbox",checked:He,onChange:y=>nt(y.target.checked)}),s.jsx("span",{children:"Superseded"})]})]}),(Pe||$e)&&s.jsxs("div",{className:"mem-inline-form",children:[s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Content"}),s.jsx("textarea",{value:je.content,onChange:y=>Je(R=>({...R,content:y.target.value})),placeholder:"What should the agent remember?"})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Category"}),s.jsx("select",{value:je.category,onChange:y=>Je(R=>({...R,category:y.target.value})),children:Vh.map(y=>s.jsx("option",{value:y,children:y.charAt(0).toUpperCase()+y.slice(1)},y))})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Context"}),s.jsx("input",{type:"text",value:je.context,onChange:y=>Je(R=>({...R,context:y.target.value})),placeholder:"global"})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Domain"}),s.jsx("input",{type:"text",value:je.domain,onChange:y=>Je(R=>({...R,domain:y.target.value})),placeholder:"e.g., python, frontend"})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Entity"}),s.jsx("input",{type:"text",value:je.entity,onChange:y=>Je(R=>({...R,entity:y.target.value})),placeholder:"e.g., person:sarah_chen"})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Due At"}),s.jsx("input",{type:"text",value:je.due_at,onChange:y=>Je(R=>({...R,due_at:y.target.value})),placeholder:"ISO 8601 (e.g., 2026-03-25T09:00:00-07:00)"})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Sensitive"}),s.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontSize:12},children:[s.jsx("input",{type:"checkbox",checked:je.sensitive,onChange:y=>Je(R=>({...R,sensitive:y.target.checked}))}),"Mark as sensitive (excluded from system prompt)"]})]}),s.jsxs("div",{className:"mem-inline-form-actions",children:[s.jsx("button",{className:"btn-secondary",onClick:()=>{Ae(!1),ut(null)},children:"Cancel"}),s.jsx("button",{className:"btn-primary",onClick:$e?Jx:Xx,style:{padding:"8px 20px",fontSize:13},children:$e?"Update":"Save"})]})]}),l&&l.items.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"mem-knowledge-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsxs("th",{onClick:()=>gs("category"),className:B==="category"?"sorted":"",children:["Category",ys("category")]}),s.jsx("th",{children:"Content"}),s.jsxs("th",{onClick:()=>gs("context"),className:B==="context"?"sorted":"",children:["Context",ys("context")]}),s.jsx("th",{children:"Entity"}),s.jsxs("th",{onClick:()=>gs("confidence"),className:B==="confidence"?"sorted":"",children:["Confidence",ys("confidence")]}),s.jsx("th",{children:"Source"}),s.jsxs("th",{onClick:()=>gs("updated_at"),className:B==="updated_at"?"sorted":"",children:["Updated",ys("updated_at")]}),s.jsxs("th",{onClick:()=>gs("created_at"),className:B==="created_at"?"sorted":"",children:["Created",ys("created_at")]}),s.jsx("th",{children:"Due"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:l.items.map(y=>{const R=M===y.id,se=y.has_embedding;return s.jsxs(Gi.Fragment,{children:[s.jsxs("tr",{className:`${y.superseded_by?"mem-superseded-row":""} ${R?"mem-expanded-row":""}`,onClick:()=>N(R?null:y.id),onKeyDown:me=>{(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),N(R?null:y.id))},tabIndex:0,role:"row","aria-expanded":R,style:{cursor:"pointer"},children:[s.jsx("td",{children:s.jsx("span",{className:`mem-cat-badge ${y.category}`,children:y.category})}),s.jsx("td",{children:s.jsxs("div",{className:"mem-content-cell",title:y.content,children:[se!==void 0&&s.jsx("span",{className:`mem-embed-dot ${se?"embedded":"missing"}`,title:se?"Embedded":"Embedding missing",children:s.jsx(Gk,{size:6,fill:"currentColor"})}),y.sensitive&&s.jsx("span",{className:"mem-sensitive-badge",title:"Sensitive",children:s.jsx(Cs,{size:11})}),s.jsx("span",{className:y.sensitive&&!Vr.has(y.id)?"mem-sensitive-blur":y.superseded_by?"mem-superseded-text":"",onClick:me=>{y.sensitive&&(me.stopPropagation(),os(Fe=>{const xr=new Set(Fe);return xr.has(y.id)?xr.delete(y.id):xr.add(y.id),xr}))},children:y.content})]})}),s.jsx("td",{children:s.jsx("span",{className:"mem-date-cell",children:y.context})}),s.jsx("td",{children:y.entity?s.jsx("span",{className:"mem-entity-link",onClick:me=>{me.stopPropagation(),P(y.entity),_e(0)},title:`Filter by ${y.entity}`,children:y.entity}):s.jsx("span",{className:"mem-date-cell",children:"—"})}),s.jsx("td",{children:s.jsxs("div",{className:"mem-confidence",children:[s.jsx("div",{className:"mem-confidence-bar",children:s.jsx("div",{className:`mem-confidence-fill ${pT(y.confidence)}`,style:{width:`${y.confidence*100}%`}})}),y.confidence.toFixed(2)]})}),s.jsx("td",{children:s.jsx("span",{className:"mem-date-cell",children:y.source||"—"})}),s.jsx("td",{children:s.jsx("span",{className:"mem-date-cell",title:Nn(y.updated_at),children:jr(y.updated_at)})}),s.jsx("td",{children:s.jsx("span",{className:"mem-date-cell",title:Nn(y.created_at),children:jr(y.created_at)})}),s.jsx("td",{children:y.due_at?s.jsx("span",{className:`mem-due-badge ${Bh(y.due_at)?"overdue":"upcoming"}`,title:Nn(y.due_at),children:jr(y.due_at)}):s.jsx("span",{className:"mem-due-badge none",children:"—"})}),s.jsx("td",{children:s.jsxs("div",{className:"mem-row-actions",onClick:me=>me.stopPropagation(),children:[s.jsx("button",{className:"mem-row-action-btn",onClick:()=>tv(y),title:"Edit",children:s.jsx(mw,{size:13})}),s.jsx("button",{className:"mem-row-action-btn",onClick:()=>ev(y),title:y.sensitive?"Unmark sensitive":"Mark sensitive",children:y.sensitive?s.jsx(gw,{size:13}):s.jsx(Cs,{size:13})}),s.jsx("button",{className:"mem-row-action-btn",onClick:()=>nv(y.id),title:"Copy ID",children:s.jsx(jl,{size:13})}),s.jsx("button",{className:"mem-row-action-btn delete",onClick:()=>Zx(y.id),title:"Delete",children:s.jsx(ci,{size:13})})]})})]}),R&&s.jsx("tr",{className:"mem-detail-row",children:s.jsx("td",{colSpan:10,children:s.jsxs("div",{className:"mem-detail-panel",children:[s.jsxs("div",{className:"mem-detail-grid",children:[s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"ID"}),s.jsx("span",{className:"mem-detail-value",children:y.id})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Domain"}),s.jsx("span",{className:"mem-detail-value",children:y.domain||"—"})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Source"}),s.jsx("span",{className:"mem-detail-value",children:y.source||"—"})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Use Count"}),s.jsx("span",{className:"mem-detail-value",children:y.use_count??0})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Created"}),s.jsx("span",{className:"mem-detail-value",children:Nn(y.created_at)})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Updated"}),s.jsx("span",{className:"mem-detail-value",children:Nn(y.updated_at)})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Last Used"}),s.jsx("span",{className:"mem-detail-value",children:Nn(y.last_used)})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Reminded At"}),s.jsx("span",{className:"mem-detail-value",children:Nn(y.reminded_at)})]}),y.superseded_by&&s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Superseded By"}),s.jsx("span",{className:"mem-detail-value mem-detail-chain",children:y.superseded_by})]}),y.metadata&&s.jsxs("div",{className:"mem-detail-field mem-detail-full",children:[s.jsx("span",{className:"mem-detail-label",children:"Metadata"}),s.jsx("span",{className:"mem-detail-value",children:typeof y.metadata=="object"?JSON.stringify(y.metadata,null,2):y.metadata})]})]}),s.jsxs("div",{className:"mem-detail-content-full",children:[s.jsx("span",{className:"mem-detail-label",children:"Full Content"}),s.jsx("div",{className:"mem-detail-content-text",children:y.content})]})]})})})]},y.id)})})]})}),s.jsxs("div",{className:"mem-pagination",children:[s.jsxs("span",{children:[ae+1,"–",Math.min(ae+Ge,l.total)," of ",l.total]}),s.jsxs("div",{className:"mem-pagination-btns",children:[s.jsx("button",{className:"mem-page-btn",disabled:ae===0,onClick:()=>_e(Math.max(0,ae-Ge)),children:s.jsx(Wk,{size:14})}),s.jsx("button",{className:"mem-page-btn",disabled:ae+Ge>=l.total,onClick:()=>_e(ae+Ge),children:s.jsx(ss,{size:14})})]})]})]}):s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(Jr,{size:28})}),s.jsx("p",{children:b||ie.length>0||xe||T?"No matching memories":"No memories stored yet"})]})]}),s.jsxs("div",{className:"mem-two-col",children:[s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title",children:[s.jsx(mu,{size:14})," Tool Performance"]}),o.length>0?s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"mem-tool-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Tool"}),s.jsx("th",{children:"Calls"}),s.jsx("th",{children:"Success"}),s.jsx("th",{children:"Avg Time"}),s.jsx("th",{children:"Last Used"}),s.jsx("th",{children:"Last Error"})]})}),s.jsx("tbody",{children:o.map(y=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("span",{className:"mem-tool-name",children:y.tool_name})}),s.jsx("td",{children:y.total_calls}),s.jsx("td",{children:s.jsxs("div",{className:"mem-confidence",children:[s.jsx("div",{className:"mem-confidence-bar",style:{width:40},children:s.jsx("div",{className:`mem-confidence-fill ${Hh(y.success_rate)}`,style:{width:`${y.success_rate*100}%`}})}),s.jsxs("span",{className:`mem-success-rate ${Hh(y.success_rate)}`,children:[Math.round(y.success_rate*100),"%"]})]})}),s.jsx("td",{children:hT(y.avg_duration_ms)}),s.jsx("td",{children:s.jsx("span",{className:"mem-date-cell",title:Nn(y.last_used),children:jr(y.last_used)})}),s.jsx("td",{children:s.jsx("span",{className:"mem-tool-error",title:y.last_error||"",children:y.last_error||"—"})})]},y.tool_name))})]})}):s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(mu,{size:28})}),s.jsx("p",{children:"No tool calls recorded yet"})]})]}),s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title",children:[s.jsx(Wa,{size:14})," Upcoming & Overdue"]}),f.length>0?s.jsx("div",{className:"mem-temporal-list",children:f.map(y=>{const R=Bh(y.due_at);return s.jsxs("div",{className:`mem-temporal-item ${R?"overdue":"upcoming"}`,children:[s.jsx("span",{className:"mem-temporal-icon",children:R?s.jsx(pn,{size:16}):s.jsx(Wa,{size:16})}),s.jsxs("div",{className:"mem-temporal-content",children:[s.jsx("div",{className:"mem-temporal-text",children:y.content}),s.jsxs("div",{className:"mem-temporal-date",children:[R?"OVERDUE":"Due",": ",jr(y.due_at),y.context!=="global"&&` · ${y.context}`]})]})]},y.id)})}):s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(wi,{size:28})}),s.jsx("p",{children:"Nothing upcoming or overdue"})]})]})]}),s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title",children:[s.jsx(fu,{size:14})," Conversation History"]}),s.jsxs("div",{className:"mem-conv-search",children:[s.jsx(Fn,{size:13,className:"search-icon"}),s.jsx("input",{type:"text",placeholder:"Search conversations...",value:L,onChange:y=>rv(y.target.value),"aria-label":"Search conversations"}),L&&s.jsx("button",{className:"mem-search-clear",onClick:()=>{F(""),ue(null)},"aria-label":"Clear search",children:s.jsx(tt,{size:12})})]}),Y!==null?Y.length>0?s.jsx("div",{className:"mem-conv-list",children:Y.map(y=>s.jsxs("div",{className:"mem-conv-item",onClick:()=>Xd(y.session_id),children:[s.jsxs("div",{className:"mem-conv-info",children:[s.jsxs("div",{className:"mem-conv-session-id",children:[s.jsx("span",{className:`mem-conv-turn-role ${y.role}`,children:y.role})," ",y.session_id.slice(0,8),"..."]}),s.jsx("div",{className:"mem-conv-preview",children:y.content})]}),s.jsx("div",{className:"mem-conv-meta",children:s.jsx("span",{children:jr(y.timestamp)})})]},y.id))}):s.jsx("div",{className:"mem-empty",children:s.jsxs("p",{children:["No conversations match “",L,"”"]})}):u.length>0?s.jsx("div",{className:"mem-conv-list",children:u.map(y=>s.jsxs("div",{className:"mem-conv-item",onClick:()=>Xd(y.session_id),children:[s.jsxs("div",{className:"mem-conv-info",children:[s.jsxs("div",{className:"mem-conv-session-id",children:[y.session_id.slice(0,8),"...",y.consolidated&&s.jsx("span",{className:"mem-consolidated-badge",title:"Consolidated",children:s.jsx(Em,{size:11})})]}),y.first_message&&s.jsx("div",{className:"mem-conv-preview",children:y.first_message})]}),s.jsxs("div",{className:"mem-conv-meta",children:[s.jsxs("span",{children:[y.turn_count," turns"]}),s.jsx("span",{children:jr(y.last_activity)})]})]},y.session_id))}):s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(fu,{size:28})}),s.jsx("p",{children:"No conversation history in memory"})]})]}),H&&s.jsxs("div",{className:"mem-conv-detail-overlay",children:[s.jsxs("div",{className:"mem-conv-detail-header",children:[s.jsxs("h4",{children:["Session: ",H.sessionId.slice(0,12),"..."]}),s.jsx("button",{className:"btn-icon",onClick:()=>le(null),children:s.jsx(tt,{size:16})})]}),s.jsxs("div",{className:"mem-conv-detail-body",children:[H.turns.map(y=>s.jsxs("div",{className:"mem-conv-turn",children:[s.jsxs("div",{className:"mem-conv-turn-header",children:[s.jsx("div",{className:`mem-conv-turn-role ${y.role}`,children:y.role}),s.jsx("span",{className:"mem-conv-turn-time",title:Nn(y.timestamp),children:jr(y.timestamp)})]}),s.jsx("div",{className:"mem-conv-turn-content",children:y.content})]},y.id)),H.turns.length===0&&s.jsx("div",{className:"mem-empty",children:"No turns found"})]})]})]}),s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title",children:[s.jsx(Cs,{size:14})," Settings ",s.jsx("span",{style:{fontSize:10,fontWeight:600,color:"#f59e0b",background:"rgba(245,158,11,0.15)",padding:"1px 6px",borderRadius:4,marginLeft:6,verticalAlign:"middle",letterSpacing:"0.5px"},children:"BETA"})]}),s.jsxs("div",{className:"mem-setting-row",children:[s.jsxs("div",{className:"mem-setting-info",children:[s.jsx("span",{className:"mem-setting-label",children:"Memory enabled"}),s.jsx("span",{className:"mem-setting-desc",children:"When disabled, no knowledge or conversation data is stored during any session (global incognito)."})]}),s.jsx("button",{className:`mem-toggle${$?" mem-toggle-on":""}`,disabled:pt,onClick:async()=>{if(!$){xn("memory");return}qe(!0);try{const y=await vi({memory_enabled:!1});Q(y.memory_enabled)}catch(y){E.system.warn("Failed to disable memory",y)}finally{qe(!1)}},"aria-pressed":$,"aria-label":`Memory is ${$?"enabled":"disabled"}`,children:$?"On":"Off"})]}),bt&&(()=>{const R={memory:{title:"Enable Agent Memory?",description:"Agent memory is a work-in-progress. By enabling it:",bullets:[["Conversations and facts are stored ","locally on this machine"],["Stored data ","may be lost"," during updates"],["You can disable it at any time from this settings panel"]],buttonLabel:"Enable Memory",onConfirm:async()=>{const se=await vi({memory_enabled:!0});Q(se.memory_enabled),ee("Memory enabled","info")}},mcp:{title:"Enable MCP Memory Access?",description:"This exposes memory data to external MCP clients:",bullets:[["MCP clients can ","read your stored memories"," (read-only)"],["Requires an ","MCP server restart"," to take effect"],["Intended for debugging and troubleshooting only"]],buttonLabel:"Enable MCP Access",onConfirm:async()=>{const se=await vi({mcp_memory_enabled:!0});ve(se.mcp_memory_enabled),ee("MCP memory access enabled","info")}},discovery:{title:"Enable System Discovery?",description:"This scans your system to personalize responses:",bullets:[["Collects ","hardware, software, and environment"," information"],["Scans files, git repos, browser history, and SSH config"],["All data stays ","local on this machine"]],buttonLabel:"Enable Discovery",onConfirm:async()=>{var me;const se=await vi({system_discovery_consent:!0});if(wt(se.system_discovery_consent),se.system_context_error)ee(`System discovery enabled but scan failed: ${se.system_context_error}`,"error");else{const Fe=((me=se.system_context_refresh)==null?void 0:me.stored)??0;ee(`System discovery enabled — ${Fe} system facts collected`,"info")}Rt()}}}[bt];return s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",zIndex:9998,backdropFilter:"blur(4px)"},onClick:()=>xn(null)}),s.jsxs("div",{style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:9999,background:"#1a1a2e",border:"1px solid #333",borderRadius:12,padding:"28px 32px",maxWidth:420,width:"90vw",boxShadow:"0 20px 60px rgba(0,0,0,0.5)"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:16},children:[s.jsx("span",{style:{fontSize:11,fontWeight:700,color:"#f59e0b",background:"rgba(245,158,11,0.15)",padding:"3px 10px",borderRadius:4,letterSpacing:"0.5px"},children:"BETA"}),s.jsx("span",{style:{fontSize:16,fontWeight:600,color:"#e0e0e0"},children:R.title})]}),s.jsx("p",{style:{fontSize:13,lineHeight:1.6,color:"#999",margin:"0 0 8px"},children:R.description}),s.jsx("ul",{style:{fontSize:13,lineHeight:1.7,color:"#999",margin:"0 0 24px",paddingLeft:20},children:R.bullets.map((se,me)=>s.jsx("li",{children:se.map((Fe,xr)=>xr%2===1?s.jsx("strong",{style:{color:"#ccc"},children:Fe},xr):s.jsx("span",{children:Fe},xr))},me))}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[s.jsx("button",{className:"btn-secondary",onClick:()=>xn(null),style:{padding:"8px 20px",fontSize:13,borderRadius:6},children:"Cancel"}),s.jsx("button",{disabled:pt,onClick:async()=>{qe(!0);try{await R.onConfirm()}catch(se){E.system.warn("Failed to update setting",se),ee("Failed to update setting. Please try again.","error")}finally{qe(!1),xn(null)}},style:{padding:"8px 24px",fontSize:13,fontWeight:600,borderRadius:6,border:"none",cursor:"pointer",background:"linear-gradient(135deg, #f59e0b, #d97706)",color:"#000"},children:R.buttonLabel})]})]})]})})(),s.jsxs("div",{className:"mem-setting-row",children:[s.jsxs("div",{className:"mem-setting-info",children:[s.jsx("span",{className:"mem-setting-label",children:"MCP memory access"}),s.jsx("span",{className:"mem-setting-desc",children:"Expose read-only memory tools to MCP clients (for debug/troubleshooting). Requires MCP server restart."})]}),s.jsx("button",{className:`mem-toggle${de?" mem-toggle-on":""}`,disabled:pt,onClick:async()=>{if(!de){xn("mcp");return}qe(!0);try{const y=await vi({mcp_memory_enabled:!1});ve(y.mcp_memory_enabled)}catch(y){E.system.warn("Failed to update memory settings",y)}finally{qe(!1)}},"aria-label":"Toggle MCP memory access","aria-pressed":de,children:de?"On":"Off"})]}),s.jsxs("div",{className:"mem-setting-row",children:[s.jsxs("div",{className:"mem-setting-info",children:[s.jsx("span",{className:"mem-setting-label",children:"System discovery"}),s.jsx("span",{className:"mem-setting-desc",children:"Allow GAIA to scan your system for hardware, software, and environment information to personalize responses."})]}),s.jsx("button",{className:`mem-toggle${be?" mem-toggle-on":""}`,disabled:pt,onClick:async()=>{if(!be){xn("discovery");return}qe(!0);try{const y=await vi({system_discovery_consent:!1});wt(y.system_discovery_consent)}catch(y){E.system.warn("Failed to update system discovery setting",y)}finally{qe(!1)}},"aria-label":"Toggle system discovery","aria-pressed":be,children:be?"On":"Off"})]}),s.jsxs("div",{className:"mem-setting-row mem-setting-row-danger",children:[s.jsxs("div",{className:"mem-setting-info",children:[s.jsx("span",{className:"mem-setting-label",children:"Re-initialize memory"}),s.jsx("span",{className:"mem-setting-desc",children:"Wipe all memories, conversations, and tool logs, then re-collect system information. This cannot be undone."})]}),rt?s.jsxs("div",{className:"mem-delete-confirm",children:[s.jsx("span",{className:"mem-delete-confirm-label",children:"Are you sure?"}),s.jsx("button",{className:"mem-btn-danger",disabled:pt,onClick:async()=>{qe(!0);try{const y=await sT();ee(`Re-initialized: cleared ${y.cleared.knowledge} entries, restored ${y.system_context.stored} system facts`,"info"),Rt()}catch(y){E.system.warn("Failed to reinitialize memory",y),ee("Failed to re-initialize memory","error")}finally{qe(!1),Mt(!1)}},children:"Yes, re-initialize"}),s.jsx("button",{className:"btn-secondary",onClick:()=>Mt(!1),style:{padding:"6px 14px",fontSize:12},children:"Cancel"})]}):s.jsx("button",{className:"mem-btn-danger",disabled:pt,onClick:()=>Mt(!0),children:"Re-initialize"})]}),s.jsxs("div",{className:"mem-setting-row mem-setting-row-danger",children:[s.jsxs("div",{className:"mem-setting-info",children:[s.jsx("span",{className:"mem-setting-label",children:"Delete all memories"}),s.jsx("span",{className:"mem-setting-desc",children:"Permanently wipe all knowledge entries, conversation history, and tool logs. This cannot be undone."})]}),Pt?s.jsxs("div",{className:"mem-delete-confirm",children:[s.jsx("span",{className:"mem-delete-confirm-label",children:"Are you sure?"}),s.jsx("button",{className:"mem-btn-danger",disabled:pt,onClick:async()=>{qe(!0);try{const y=await iT();ee(`Deleted ${y.knowledge} knowledge entries, ${y.conversations} conversations`,"info"),Rt()}catch(y){E.system.warn("Failed to clear memory",y),ee("Failed to clear memory","error")}finally{qe(!1),Xt(!1)}},children:"Yes, delete all"}),s.jsx("button",{className:"btn-secondary",onClick:()=>Xt(!1),style:{padding:"6px 14px",fontSize:12},children:"Cancel"})]}):s.jsx("button",{className:"mem-btn-danger",disabled:pt,onClick:()=>Xt(!0),children:"Delete All"})]})]}),t&&s.jsxs("div",{className:"mem-db-footer",children:[s.jsxs("span",{children:["Database: ",mT(t.db_size_bytes),((mf=t.knowledge)==null?void 0:mf.avg_confidence)!=null&&` · Avg confidence: ${t.knowledge.avg_confidence.toFixed(2)}`]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[((hf=t.knowledge)==null?void 0:hf.entity_count)!=null&&t.knowledge.entity_count>0&&s.jsxs("span",{children:[t.knowledge.entity_count," entities"]}),((pf=t.knowledge)==null?void 0:pf.sensitive_count)!=null&&t.knowledge.sensitive_count>0&&s.jsxs("span",{children:[s.jsx(Cs,{size:10})," ",t.knowledge.sensitive_count," sensitive"]})]})]})]})}),cn==="profile"&&s.jsxs("div",{className:"mem-profile-grid",children:[s.jsxs("div",{className:"mem-profile-card",children:[s.jsxs("div",{className:"mem-profile-card-title",children:[s.jsx(uy,{size:16})," System Discovery"]}),s.jsx("p",{className:"mem-profile-desc",children:"Scan your system to discover apps, projects, and usage patterns."}),s.jsx("button",{className:"btn-primary mem-profile-run-btn",disabled:st==="running"||st==="saving",onClick:uv,children:st==="running"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mem-spinner-sm"})," Running..."]}):"Run Discovery"}),us.length>0&&s.jsx("div",{className:"mem-log",ref:bn,children:us.map((y,R)=>s.jsx("div",{className:`mem-log-line ${y.kind}`,children:y.text},R))}),(st==="review"||st==="saving"||st==="done")&&Vn.length>0&&s.jsxs("div",{className:"mem-review-section",children:[s.jsx("div",{className:"mem-review-header",children:"Review & Save"}),s.jsx("div",{className:"mem-review-list",children:Vn.map((y,R)=>s.jsxs("label",{className:"mem-review-item",children:[s.jsx("input",{type:"checkbox",checked:y._checked,disabled:st==="saving"||st==="done",onChange:()=>{dr(se=>se.map((me,Fe)=>Fe===R?{...me,_checked:!me._checked}:me))}}),s.jsx("span",{className:"mem-review-content",children:y.content}),s.jsx("span",{className:"mem-source-badge",children:y._source_name||y.category}),s.jsxs("span",{className:"mem-conf-badge",children:[Math.round(y.confidence*100),"%"]})]},R))}),s.jsxs("div",{className:"mem-review-actions",children:[s.jsx("button",{className:"btn-primary",disabled:st==="saving"||st==="done"||Vn.filter(y=>y._checked).length===0,onClick:dv,children:st==="saving"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mem-spinner-sm"})," Saving..."]}):`Save Selected (${Vn.filter(y=>y._checked).length})`}),s.jsxs("span",{className:"mem-review-select-links",children:[s.jsx("a",{onClick:()=>dr(y=>y.map(R=>({...R,_checked:!0}))),children:"Select All"})," / ",s.jsx("a",{onClick:()=>dr(y=>y.map(R=>({...R,_checked:!1}))),children:"None"})]})]})]}),st==="done"&&El!==null&&s.jsxs("div",{className:"mem-profile-success",children:[s.jsx(wi,{size:14})," Saved ",El," items to memory"]}),st==="review"&&Vn.length===0&&s.jsx("div",{className:"mem-profile-empty",children:"No items discovered."})]}),s.jsxs("div",{className:"mem-profile-card",children:[s.jsxs("div",{className:"mem-profile-card-title",children:[s.jsx(yw,{size:16})," AI Profile Inference"]}),s.jsx("p",{className:"mem-profile-desc",children:"Use the local LLM to generate profile insights from your data."}),s.jsx("p",{className:"mem-profile-note",children:"Requires Lemonade Server running."}),s.jsxs("label",{className:"mem-profile-checkbox",children:[s.jsx("input",{type:"checkbox",checked:fs,onChange:y=>_o(y.target.checked),disabled:jt==="running"||jt==="saving"}),"Include browser history"]}),s.jsx("button",{className:"btn-primary mem-profile-run-btn",disabled:jt==="running"||jt==="saving",onClick:fv,children:jt==="running"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mem-spinner-sm"})," Running..."]}):"Run Inference"}),ds.length>0&&s.jsx("div",{className:"mem-log",ref:pi,children:ds.map((y,R)=>s.jsx("div",{className:`mem-log-line ${y.kind}`,children:y.text},R))}),(jt==="review"||jt==="saving"||jt==="done")&&Wn.length>0&&s.jsxs("div",{className:"mem-review-section",children:[s.jsx("div",{className:"mem-review-header",children:"Review & Save"}),s.jsx("div",{className:"mem-review-list",children:Wn.map((y,R)=>s.jsxs("label",{className:"mem-review-item",children:[s.jsx("input",{type:"checkbox",checked:y._checked,disabled:jt==="saving"||jt==="done",onChange:()=>{hr(se=>se.map((me,Fe)=>Fe===R?{...me,_checked:!me._checked}:me))}}),s.jsx("span",{className:"mem-review-content",children:y.content}),s.jsx("span",{className:`mem-domain-badge ${xT[y.domain]||"gray"}`,children:y.domain}),s.jsxs("span",{className:"mem-conf-badge",children:[Math.round(y.confidence*100),"%"]})]},R))}),s.jsxs("div",{className:"mem-review-actions",children:[s.jsx("button",{className:"btn-primary",disabled:jt==="saving"||jt==="done"||Wn.filter(y=>y._checked).length===0,onClick:mv,children:jt==="saving"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mem-spinner-sm"})," Saving..."]}):`Save Selected (${Wn.filter(y=>y._checked).length})`}),s.jsxs("span",{className:"mem-review-select-links",children:[s.jsx("a",{onClick:()=>hr(y=>y.map(R=>({...R,_checked:!0}))),children:"Select All"})," / ",s.jsx("a",{onClick:()=>hr(y=>y.map(R=>({...R,_checked:!1}))),children:"None"})]})]})]}),jt==="done"&&zl!==null&&s.jsxs("div",{className:"mem-profile-success",children:[s.jsx(wi,{size:14})," Saved ",zl," insights to memory"]}),jt==="review"&&Wn.length===0&&s.jsx("div",{className:"mem-profile-empty",children:"No insights generated."})]})]}),cn==="goals"&&s.jsxs("div",{className:"mem-goals-tab",children:[s.jsx("div",{className:"mem-goals-stats-row",children:["queued","in_progress","completed","failed"].map(y=>s.jsxs("div",{className:`mem-goals-stat-pill mem-goal-status-${y.replace("_","-")}`,children:[s.jsx("span",{className:"mem-goals-stat-n",children:(vn==null?void 0:vn.goals[y])??0}),s.jsx("span",{className:"mem-goals-stat-label",children:y.replace("_"," ")})]},y))}),Zt.filter(y=>y.status==="pending_approval").length>0&&s.jsxs("div",{className:"mem-goals-approval-banner",children:[s.jsxs("div",{className:"mem-goals-approval-title",children:[s.jsx(Ws,{size:14})," Agent suggested ",Zt.filter(y=>y.status==="pending_approval").length," goal(s) — review before execution"]}),Zt.filter(y=>y.status==="pending_approval").map(y=>s.jsxs("div",{className:"mem-goals-approval-item",children:[s.jsxs("div",{className:"mem-goals-approval-text",children:[s.jsx("strong",{children:y.title}),s.jsx("span",{children:y.description})]}),s.jsxs("div",{className:"mem-goals-approval-actions",children:[s.jsx("button",{className:"btn-danger-sm",onClick:async()=>{await uT(y.id),yr()},children:"Reject"}),s.jsx("button",{className:"btn-secondary",onClick:async()=>{await cT(y.id),yr()},children:"Accept"})]})]},y.id))]}),s.jsx("div",{className:"mem-goals-toolbar",children:s.jsxs("button",{className:"btn-primary",onClick:()=>ar(y=>!y),children:[s.jsx(hl,{size:14})," New Goal"]})}),_l&&s.jsxs("div",{className:"mem-goals-add-form",children:[s.jsx("input",{className:"mem-input",placeholder:"Goal title",value:or.title,onChange:y=>cr(R=>({...R,title:y.target.value}))}),s.jsx("textarea",{className:"mem-input",placeholder:"Description — what should the agent work toward?",rows:2,value:or.description,onChange:y=>cr(R=>({...R,description:y.target.value}))}),s.jsxs("div",{className:"mem-goals-form-row",children:[s.jsxs("select",{className:"mem-select",value:or.priority,onChange:y=>cr(R=>({...R,priority:y.target.value})),children:[s.jsx("option",{value:"low",children:"Low priority"}),s.jsx("option",{value:"medium",children:"Medium priority"}),s.jsx("option",{value:"high",children:"High priority"})]}),s.jsx("button",{className:"btn-primary",onClick:async()=>{or.title.trim()&&(await oT(or),cr({title:"",description:"",priority:"medium"}),ar(!1),yr())},children:"Create"}),s.jsx("button",{className:"btn-secondary",onClick:()=>ar(!1),children:"Cancel"})]})]}),kn?s.jsxs("div",{className:"mem-loading",children:[s.jsx("div",{className:"mem-spinner"})," Loading goals..."]}):Zt.filter(y=>y.status!=="pending_approval"&&y.status!=="rejected").length===0?s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(zm,{size:32})}),s.jsx("p",{children:"No goals yet. Create one or let the agent suggest goals in autonomous mode."})]}):s.jsx("div",{className:"mem-goals-list",children:Zt.filter(y=>y.status!=="pending_approval"&&y.status!=="rejected").map(y=>s.jsxs("div",{className:`mem-goal-card mem-goal-status-${y.status.replace("_","-")}`,children:[s.jsxs("div",{className:"mem-goal-header",onClick:()=>lr(R=>R===y.id?null:y.id),children:[s.jsxs("div",{className:"mem-goal-header-left",children:[s.jsx("span",{className:`mem-goal-status-dot status-${y.status.replace("_","-")}`}),s.jsx("span",{className:"mem-goal-title",children:y.title}),s.jsx("span",{className:`mem-goal-priority mem-priority-${y.priority}`,children:y.priority}),y.source!=="user"&&s.jsxs("span",{className:"mem-goal-source-badge",children:[s.jsx(Ws,{size:10})," ",y.source.replace("_"," ")]})]}),s.jsxs("div",{className:"mem-goal-header-right",children:[s.jsxs("span",{className:"mem-goal-task-count",children:[s.jsx(py,{size:12}),y.tasks.filter(R=>R.status==="completed").length,"/",y.tasks.length]}),y.status==="queued"&&s.jsx("button",{className:"mem-goal-action-btn mem-goal-cancel-btn",onClick:async R=>{R.stopPropagation(),await dT(y.id),yr()},children:"Cancel"}),s.jsx("button",{className:"mem-goal-action-btn mem-goal-delete-btn",onClick:async R=>{R.stopPropagation(),confirm(`Delete goal "${y.title}"?`)&&(await fT(y.id),yr())},children:s.jsx(ci,{size:12})}),s.jsx(ai,{size:14,className:Hn===y.id?"mem-chevron-open":""})]})]}),Hn===y.id&&s.jsxs("div",{className:"mem-goal-body",children:[y.description&&s.jsx("p",{className:"mem-goal-desc",children:y.description}),y.progress_notes&&s.jsx("p",{className:"mem-goal-progress",children:y.progress_notes}),y.tasks.length>0?s.jsx("div",{className:"mem-task-list",children:y.tasks.map(R=>s.jsxs("div",{className:`mem-task-row mem-task-status-${R.status}`,children:[s.jsx("span",{className:`mem-task-dot status-${R.status}`}),s.jsx("span",{className:"mem-task-desc",children:R.description}),s.jsx("span",{className:"mem-task-status-label",children:R.status}),R.result&&s.jsx("span",{className:"mem-task-result",children:R.result})]},R.id))}):s.jsx("p",{className:"mem-goal-no-tasks",children:"No tasks yet — the agent will break this down when it starts."})]})]},y.id))})]})]}),U.length>0&&s.jsx("div",{className:"mem-toast-container","aria-live":"polite",children:U.map(y=>s.jsxs("div",{className:`mem-toast mem-toast-${y.type}`,role:"status",children:[y.type==="success"&&s.jsx(wi,{size:14}),y.type==="error"&&s.jsx(pn,{size:14}),y.type==="info"&&s.jsx(Jr,{size:14}),s.jsx("span",{children:y.text})]},y.id))})]})}const Ys=32768,Qd="Qwen3.5-35B-A3B-GGUF",kT=3e5,wT=18e5,bT=1e4;function Kx(e,t){const[n,r]=p.useState(!1),[i,l]=p.useState(!1),a=p.useRef(null),o=p.useRef(null),c=p.useRef(null),u=p.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),o.current&&(clearTimeout(o.current),o.current=null),c.current&&(clearInterval(c.current),c.current=null)},[]);p.useEffect(()=>u,[u]);const d=p.useCallback((g,v)=>{c.current&&clearInterval(c.current),c.current=setInterval(async()=>{var w,x;try{const k=await Sd();v==="load"?((w=k.model_loaded)==null?void 0:w.toLowerCase())===g.toLowerCase()&&(r(!1),a.current&&(clearTimeout(a.current),a.current=null),c.current&&(clearInterval(c.current),c.current=null)):(k.model_downloaded===!0||((x=k.model_loaded)==null?void 0:x.toLowerCase())===g.toLowerCase())&&(l(!1),o.current&&(clearTimeout(o.current),o.current=null),c.current&&(clearInterval(c.current),c.current=null))}catch{}},bT)},[]),f=e??Qd,h=p.useCallback(async(g,v)=>{const w=g??f,x=v??Ys;r(!0);try{await r0(w,x),E.system.info(`Load model triggered: ${w} (ctx=${x})`),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>r(!1),kT),d(w,"load")}catch(k){E.system.error("Failed to trigger model load",k),r(!1)}},[f,t,d]),m=p.useCallback(async(g=!1,v)=>{const w=v??f;l(!0);try{await i0(w,g),E.system.info(`Download model triggered: ${w} (force=${g})`),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>l(!1),wT),d(w,"download")}catch(x){E.system.error("Failed to trigger model download",x),l(!1)}},[f,d]);return{isLoadingModel:n,isDownloadingModel:i,loadModel:h,downloadModel:m}}const Wh=jd();function jT(){const{agents:e,setAgents:t}=we(),[n,r]=p.useState({kind:"idle"}),i=p.useRef(null),l=p.useRef(null),a=p.useRef(null);p.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),p.useEffect(()=>{var g;n.kind==="error"&&((g=a.current)==null||g.scrollIntoView({behavior:"smooth",block:"nearest"}))},[n]);const o=p.useCallback((g,v=5e3)=>{r(g),l.current&&clearTimeout(l.current),(g.kind==="success"||g.kind==="error")&&(l.current=setTimeout(()=>r({kind:"idle"}),v))},[]),c=p.useCallback(async()=>{try{const g=await Nd();t(g.agents||[])}catch(g){E.api.warn("Failed to refresh agents after import",g)}},[t]),u=e.filter(g=>g.source!=="builtin"),d=p.useCallback(async()=>{if(window.confirm(`Exported bundle contains your agent source files as-is. Any API keys, tokens, or credentials in agent.py will be included in the bundle. Review before sharing.
|
|
544
|
-
|
|
545
|
-
Continue?`)){o({kind:"working",message:"Exporting…"});try{const v=await fetch(`${Wh}/agents/export`,{method:"POST",headers:{"X-Gaia-UI":"1"}});if(!v.ok){const j=await v.text().catch(()=>"");let z=j;try{z=JSON.parse(j).detail||j}catch{}throw new Error(z||`Export failed (HTTP ${v.status})`)}const w=await v.blob(),x=URL.createObjectURL(w),k=document.createElement("a");k.href=x,k.download="gaia-agents-export.zip",document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(x),o({kind:"success",message:"Export downloaded."})}catch(v){console.error("Agent export failed:",v);const w=v instanceof Error?v.message:String(v);E.api.error("Agent export failed",v),o({kind:"error",message:`Export failed: ${w}`})}}},[o]),f=p.useCallback(()=>{var g;(g=i.current)==null||g.click()},[]),h=p.useCallback(async g=>{var j;const v=(j=g.target.files)==null?void 0:j[0];if(g.target.value="",!v)return;let w=null;if(v.size<=100*1024*1024)try{w=await ST(v)}catch(z){E.api.warn("Could not pre-read bundle.json from zip",z)}const x=w&&w.length>0?`Agents to install: ${w.join(", ")}`:"Agents to install: (unable to read bundle contents — contents will be validated by the server)";if(window.confirm(`Importing this bundle will run third-party Python code on your machine when the agent is selected. Only import bundles from sources you trust.
|
|
546
|
-
|
|
547
|
-
`+x+`
|
|
548
|
-
|
|
549
|
-
Import?`)){o({kind:"working",message:"Uploading…"});try{const z=new FormData;z.append("bundle",v,v.name);const A=await fetch(`${Wh}/agents/import`,{method:"POST",headers:{"X-Gaia-UI":"1"},body:z});if(!A.ok){const N=await A.text().catch(()=>"");let U=N;try{U=JSON.parse(N).detail||N}catch{}throw new Error(U||`Import failed (HTTP ${A.status})`)}const _=await A.json(),D=_.imported||[],C=_.overwritten||[];await c();let M;if(D.length===0?M="No agents imported":(M=`Installed ${D.length} agent(s): ${D.join(", ")}`,C.length>0&&(M+=` (replaced: ${C.join(", ")})`)),_.requires_restart&&(M+=" — restart required for replaced agents to take full effect"),_.errors&&_.errors.length>0){const N=_.errors.map(U=>`${U.id}: ${U.error}`).join("; ");o({kind:"error",message:`${M}. Errors: ${N}`})}else o({kind:"success",message:M})}catch(z){console.error("Agent import failed:",z);const A=z instanceof Error?z.message:String(z);E.api.error("Agent import failed",z),o({kind:"error",message:`Import failed: ${A}`})}}},[o,c]),m=n.kind==="working";return s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"Custom Agents"}),u.length===0?s.jsx("p",{className:"danger-warning",style:{marginBottom:12},children:"No custom agents installed yet. Import a bundle below to add one."}):s.jsx("div",{className:"status-grid",style:{marginBottom:12},children:u.map(g=>s.jsxs("div",{className:"status-row",children:[s.jsx("span",{className:"status-label",children:g.name}),s.jsxs("div",{className:"status-value-wrap",children:[s.jsx("span",{className:"status-value ok",children:g.id}),g.source&&g.source!=="builtin"&&s.jsx("span",{className:"status-hint",children:s.jsx("code",{children:g.source})})]})]},g.id))}),s.jsxs("div",{className:"setting-actions",style:{display:"flex",gap:8,flexWrap:"wrap"},children:[s.jsx("button",{className:"btn-model-save",onClick:d,disabled:m||u.length===0,title:u.length===0?"No custom agents to export":void 0,children:m&&n.message.startsWith("Export")?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Exporting…"]}):s.jsxs(s.Fragment,{children:[s.jsx(oi,{size:13,style:{verticalAlign:-2,marginRight:6}}),"Export All"]})}),s.jsx("button",{className:"btn-model-save",onClick:f,disabled:m,children:m&&n.message.startsWith("Upload")?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Uploading…"]}):s.jsxs(s.Fragment,{children:[s.jsx(pl,{size:13,style:{verticalAlign:-2,marginRight:6}}),"Import"]})}),s.jsx("input",{ref:i,type:"file",accept:".zip,application/zip",style:{display:"none"},onChange:h})]}),n.kind!=="idle"&&s.jsxs("div",{ref:a,className:"danger-warning",style:{marginTop:12,display:"flex",alignItems:"center",gap:8,color:n.kind==="error"?"var(--accent-gold)":"var(--text-secondary)"},role:"status",children:[n.kind==="working"&&s.jsx(mt,{size:14,className:"btn-spinner"}),n.kind==="success"&&s.jsx(nr,{size:14}),n.kind==="error"&&s.jsx(kt,{size:14}),s.jsx("span",{children:n.message})]})]})}async function ST(e){const t=await e.arrayBuffer(),n=new DataView(t),r=new Uint8Array(t),i=Math.min(t.byteLength,65557),l=t.byteLength-i;let a=-1;for(let d=t.byteLength-22;d>=l;d--)if(n.getUint32(d,!0)===101010256){a=d;break}if(a<0)return null;const o=n.getUint16(a+10,!0);let u=n.getUint32(a+16,!0);for(let d=0;d<o;d++){if(u+46>t.byteLength||n.getUint32(u,!0)!==33639248)return null;const f=n.getUint16(u+10,!0),h=n.getUint32(u+20,!0),m=n.getUint16(u+28,!0),g=n.getUint16(u+30,!0),v=n.getUint16(u+32,!0),w=n.getUint32(u+42,!0);if(new TextDecoder("utf-8").decode(r.subarray(u+46,u+46+m))==="bundle.json"){if(w+30>t.byteLength||n.getUint32(w,!0)!==67324752)return null;const k=n.getUint16(w+26,!0),j=n.getUint16(w+28,!0),z=w+30+k+j,A=z+h;if(A>t.byteLength)return null;const _=r.subarray(z,A);let D;if(f===0)D=new TextDecoder("utf-8").decode(_);else if(f===8){const N=new DecompressionStream("deflate-raw"),U=new Blob([_]).stream().pipeThrough(N),O=await new Response(U).arrayBuffer();D=new TextDecoder("utf-8").decode(O)}else return null;const C=JSON.parse(D),M=C==null?void 0:C.agent_ids;return Array.isArray(M)&&M.every(N=>typeof N=="string")?M:null}u+=46+m+g+v}return null}const Gh=E.api;function NT(e){switch(e){case"connector.configured":return"configured";case"connector.disconnected":return"disconnected";case"connection.revoked":return"disconnected";case"connector.oauth.completed":return"oauth_completed";case"connection.connected":return"oauth_completed";case"connector.oauth.error":return"oauth_error";case"connector.tested":return"tested";case"connector.enabled":return"enabled";case"connector.disabled":return"disabled";case"connector.grant.changed":return"grant_changed";default:return null}}function CT(e){const t=p.useRef(e);p.useEffect(()=>{t.current=e},[e]),p.useEffect(()=>{const n=`${jd()}/connectors/events`;let r=null,i=1e3,l=null,a=!1;const o=()=>{a||(r=new EventSource(n),r.onopen=()=>{i=1e3},r.onmessage=c=>{try{const u=JSON.parse(c.data),d=NT(u.type);if(d===null){Gh.debug("connectors-sse: ignoring event",u.type);return}const f=u.payload??{},h=f.connector_id??f.provider??null;t.current({connectorId:h,reason:d,payload:f})}catch(u){Gh.warn("connectors-sse: malformed event",u)}},r.onerror=()=>{r==null||r.close(),r=null,!a&&(l=setTimeout(o,i),i=Math.min(i*2,3e4))})};return o(),()=>{a=!0,l&&clearTimeout(l),r==null||r.close()}},[])}function _T(e){return e.type==="mcp_server"&&e.configured}function ET({connector:e,onChanged:t}){const[n,r]=p.useState(!1),[i,l]=p.useState(!1),[a,o]=p.useState(null),[c,u]=p.useState(null),d=p.useRef(null),f=p.useRef(null);if(p.useEffect(()=>{if(!n)return;const v=w=>{const x=w.target;d.current&&!d.current.contains(x)&&f.current&&!f.current.contains(x)&&r(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[n]),p.useEffect(()=>{if(!n)return;const v=w=>{w.key==="Escape"&&r(!1)};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n]),p.useEffect(()=>{if(!n)return;const v=()=>{if(!d.current)return;const w=d.current.getBoundingClientRect();u({top:w.bottom+4,right:window.innerWidth-w.right})};return window.addEventListener("resize",v),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",v),window.removeEventListener("scroll",v,!0)}},[n]),!_T(e))return null;const h=v=>{v.stopPropagation(),v.preventDefault()},m=v=>{if(h(v),!n&&d.current){const w=d.current.getBoundingClientRect();u({top:w.bottom+4,right:window.innerWidth-w.right})}r(w=>!w)},g=async v=>{l(!0),o(null);try{await v(),r(!1),t()}catch(w){o(w instanceof Error?w.message:String(w))}finally{l(!1)}};return s.jsxs("div",{className:"connector-tile-menu",onClick:h,onKeyDown:h,children:[s.jsx("button",{ref:d,type:"button",className:"connector-tile-menu-trigger","aria-haspopup":"menu","aria-expanded":n,"aria-label":"Connector actions",onClick:m,disabled:i,children:s.jsx(ow,{size:14})}),n&&c&&s.jsxs("div",{ref:f,role:"menu",className:"connector-tile-menu-popup",style:{position:"fixed",top:c.top,right:c.right},children:[e.enabled?s.jsx("button",{role:"menuitem",type:"button",className:"connector-tile-menu-item",onClick:()=>void g(()=>Ty(e.id)),disabled:i,children:"Disable"}):s.jsx("button",{role:"menuitem",type:"button",className:"connector-tile-menu-item",onClick:()=>void g(()=>Ey(e.id)),disabled:i,children:"Enable"}),s.jsx("div",{className:"connector-tile-menu-divider"}),s.jsx("button",{role:"menuitem",type:"button",className:"connector-tile-menu-item connector-tile-menu-item--danger",onClick:()=>void g(()=>Cd(e.id)),disabled:i,children:"Disconnect"}),a&&s.jsx("div",{className:"connector-tile-menu-error",children:a})]})]})}const TT={"https://www.googleapis.com/auth/gmail.readonly":"Read emails","https://www.googleapis.com/auth/gmail.modify":"Organize emails (archive, label, trash)","https://www.googleapis.com/auth/gmail.send":"Send emails on your behalf","https://www.googleapis.com/auth/gmail.compose":"Compose emails","https://www.googleapis.com/auth/calendar.readonly":"View calendar events","https://www.googleapis.com/auth/calendar.events":"Create & respond to calendar events","https://www.googleapis.com/auth/drive.readonly":"Read Google Drive files","https://www.googleapis.com/auth/drive.file":"Manage Drive files created by this app","https://www.googleapis.com/auth/spreadsheets.readonly":"Read Google Sheets","https://www.googleapis.com/auth/spreadsheets":"Edit Google Sheets",openid:"Identify you",email:"See your email address",profile:"See your basic profile info"};function zT(e){return TT[e]??e.split(/[/.:]/).pop()??e}function LT(){const[e,t]=p.useState([]),[n,r]=p.useState([]),[i,l]=p.useState(!0),[a,o]=p.useState(null),[c,u]=p.useState(null),d=p.useCallback(async()=>{try{const[{connectors:m},{agent_mcps:g}]=await Promise.all([s0(),l0()]);t(m),r(g),o(null)}catch(m){o(m instanceof Error?m.message:String(m))}finally{l(!1)}},[]);p.useEffect(()=>{d()},[d]);const f=m=>u(g=>g===m?null:m),h=p.useCallback(async m=>{try{const g=await Ny(m);t(v=>v.map(w=>w.id===m?g:w))}catch{d()}},[d]);return CT(p.useCallback(m=>{m.connectorId?h(m.connectorId):d()},[h,d])),s.jsxs("section",{className:"settings-section connectors-section",children:[s.jsx("h4",{children:"Connectors"}),s.jsx("p",{className:"settings-help",children:"Connect external accounts and MCP servers so agents can use them on your behalf. Each agent must be granted scopes individually."}),a&&s.jsxs("div",{className:"error-banner",children:[s.jsx(kt,{size:14}),s.jsx("span",{children:a})]}),i?s.jsx("div",{className:"connectors-loading",children:s.jsx(mt,{size:16,className:"spin"})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"connectors-list",children:e.map(m=>s.jsx(IT,{connector:m,expanded:c===m.id,onToggle:()=>f(m.id),onChanged:()=>void h(m.id)},m.id))}),n.length>0&&s.jsx(MT,{servers:n,expanded:c,onToggle:f})]})]})}function IT({connector:e,expanded:t,onToggle:n,onChanged:r}){const i=()=>e.configured?e.type==="mcp_server"&&e.enabled===!1?s.jsx("span",{className:"connector-status disabled",children:"Disabled"}):s.jsxs("span",{className:"connector-status ok",children:[s.jsx(nr,{size:12}),e.account_id??"Configured"]}):s.jsx("span",{className:"connector-status idle",children:"Not configured"});return s.jsxs("div",{className:`connector-tile${t?" connector-tile--open":""}`,children:[s.jsxs("button",{className:"connector-tile-header",onClick:n,"aria-expanded":t,children:[s.jsx("span",{className:"connector-tile-name",children:e.display_name}),s.jsx("span",{className:"connector-tile-type",children:e.type==="oauth_pkce"?"OAuth":"MCP"}),i(),s.jsx(ET,{connector:e,onChanged:r}),s.jsx("span",{className:"connector-tile-chevron",children:t?s.jsx(cy,{size:14}):s.jsx(ai,{size:14})})]}),t&&s.jsxs("div",{className:"connector-detail",children:[e.type==="oauth_pkce"?s.jsx(DT,{connector:e,onChanged:r}):s.jsx(AT,{connector:e,onChanged:r}),e.configured&&s.jsx($T,{connectorId:e.id})]})]})}function DT({connector:e,onChanged:t}){const[n,r]=p.useState(!1),[i,l]=p.useState(null),[a,o]=p.useState({});p.useEffect(()=>{const g=()=>{t()};return window.addEventListener("focus",g),()=>window.removeEventListener("focus",g)},[t]);const c=g=>{var w;const v=window;(w=v.gaia)!=null&&w.openExternal?v.gaia.openExternal(g):window.open(g,"_blank","noopener")},u=async()=>{var g;r(!0),l(null);try{const v=await Cy(e.id,(g=e.available_scopes)!=null&&g.length?e.available_scopes:e.default_scopes);c(v.authorization_url)}catch(v){l(v instanceof Error?v.message:String(v))}finally{r(!1)}},d=async()=>{r(!0),l(null);try{await Cd(e.id),t()}catch(g){l(g instanceof Error?g.message:String(g))}finally{r(!1)}},f=async()=>{var v;const g=(e.oauth_setup_fields??[]).filter(w=>{var x;return w.required!==!1&&!((x=a[w.key])!=null&&x.trim())}).map(w=>w.label);if(g.length){l(`Required: ${g.join(", ")}`);return}r(!0),l(null);try{const w=(v=e.available_scopes)!=null&&v.length?e.available_scopes:e.default_scopes,x=await _y(e.id,{...a,scopes:w}),k=typeof x.authorization_url=="string"?x.authorization_url:null;k&&c(k),t()}catch(w){l(w instanceof Error?w.message:String(w))}finally{r(!1)}},h=e.oauth_setup_fields??[],m=e.configurable===!1&&!e.configured&&h.length>0;return s.jsxs("div",{className:"configure-body",children:[e.description&&s.jsx("p",{className:"connector-desc",children:e.description}),m&&s.jsxs("div",{className:"oauth-setup-form",children:[s.jsx("p",{className:"connector-desc",children:"First-time setup — provide your OAuth client credentials below. They’re stored encrypted in your OS keyring and reused for future connections."}),h.map(g=>s.jsxs("label",{className:"oauth-setup-field",children:[s.jsx("span",{className:"oauth-setup-label",children:g.label}),s.jsx("input",{type:g.kind==="secret"?"password":"text",className:"oauth-setup-input",placeholder:g.placeholder,value:a[g.key]??"",onChange:v=>o(w=>({...w,[g.key]:v.target.value})),autoComplete:"off",spellCheck:!1}),g.help_md&&s.jsx("span",{className:"oauth-setup-help",children:g.help_md})]},g.key))]}),i&&s.jsxs("div",{className:"configure-error",children:[s.jsx(kt,{size:12})," ",i]}),s.jsxs("div",{className:"configure-actions",children:[e.configured?s.jsx("button",{className:"btn-secondary",disabled:n,onClick:()=>void d(),children:n?s.jsx(mt,{size:12,className:"spin"}):"Disconnect"}):m?s.jsx("button",{className:"btn-primary",disabled:n,onClick:()=>void f(),children:n?s.jsx(mt,{size:12,className:"spin"}):s.jsxs(s.Fragment,{children:[s.jsx(Vi,{size:12})," Save & Connect"]})}):e.configurable===!1?s.jsx("span",{className:"connector-setup-required",title:e.config_error??void 0,children:"Setup required"}):s.jsx("button",{className:"btn-primary",disabled:n,onClick:()=>void u(),children:n?s.jsx(mt,{size:12,className:"spin"}):s.jsxs(s.Fragment,{children:[s.jsx(Vi,{size:12})," Connect"]})}),(e.docs_url||e.product_url)&&s.jsxs("a",{href:e.docs_url||e.product_url||"#",target:"_blank",rel:"noopener noreferrer",className:"connector-product-link",children:["Learn more ",s.jsx(Vi,{size:11})]})]})]})}function AT({connector:e,onChanged:t}){const[n,r]=p.useState(()=>Object.fromEntries(e.mcp_env_keys.map(m=>[m,""]))),[i,l]=p.useState(!1),[a,o]=p.useState(!1),[c,u]=p.useState(null);p.useEffect(()=>{r(Object.fromEntries(e.mcp_env_keys.map(m=>[m,""])))},[e.mcp_env_keys.join(",")]);const d=async()=>{const m=Object.fromEntries(Object.entries(n).filter(([,g])=>g.trim()!==""));if(Object.keys(m).length!==0){l(!0),u(null),o(!1);try{await _y(e.id,m),o(!0),t(),setTimeout(()=>o(!1),2200)}catch(g){u(g instanceof Error?g.message:String(g))}finally{l(!1)}}},f=async()=>{l(!0),u(null);try{await Cd(e.id),r(Object.fromEntries(e.mcp_env_keys.map(m=>[m,""]))),t()}catch(m){u(m instanceof Error?m.message:String(m))}finally{l(!1)}},h=async()=>{l(!0),u(null);try{e.enabled?await Ty(e.id):await Ey(e.id),t()}catch(m){u(m instanceof Error?m.message:String(m))}finally{l(!1)}};return s.jsxs("div",{className:"configure-body",children:[e.description&&s.jsx("p",{className:"connector-desc",children:e.description}),c&&s.jsxs("div",{className:"configure-error",children:[s.jsx(kt,{size:12})," ",c]}),e.configured&&s.jsxs("div",{className:"connector-toggle-row",children:[s.jsx("span",{className:"connector-toggle-label",children:"Active"}),s.jsxs("span",{className:"toggle-switch",children:[s.jsx("input",{type:"checkbox",checked:e.enabled!==!1,onChange:()=>void h(),disabled:i,"aria-label":e.enabled?"Disable this MCP server":"Enable this MCP server"}),s.jsx("span",{className:"toggle-track"})]})]}),e.configured&&e.enabled===!1&&s.jsx("p",{className:"connector-toggle-help",children:"Credentials and per-agent grants are preserved. Re-enable to make this server's tools available again."}),e.mcp_env_keys.map(m=>s.jsxs("div",{className:"mcp-key-row",children:[s.jsx("label",{className:"mcp-key-label",children:m}),s.jsx("input",{type:"password",className:"mcp-key-input",placeholder:e.configured?"••••••••":"Enter value",value:n[m]??"",onChange:g=>r(v=>({...v,[m]:g.target.value})),spellCheck:!1,autoComplete:"off"})]},m)),s.jsxs("div",{className:"configure-actions",children:[s.jsx("button",{className:`btn-model-save${a?" saved":""}`,disabled:i||Object.values(n).every(m=>m.trim()===""),onClick:()=>void d(),children:i?s.jsx(mt,{size:12,className:"spin"}):a?s.jsxs(s.Fragment,{children:[s.jsx(nr,{size:12})," Saved"]}):"Save"}),e.configured&&s.jsx("button",{className:"btn-secondary",disabled:i,onClick:()=>void f(),children:"Disconnect"}),e.product_url&&s.jsxs("a",{href:e.product_url,target:"_blank",rel:"noopener noreferrer",className:"connector-product-link",children:["Docs ",s.jsx(Vi,{size:11})]})]})]})}function PT({agent:e,connectorId:t,grantedScopes:n,onChanged:r}){var m;const i=(m=e.required_connections)==null?void 0:m.find(g=>g.connector_id===t),l=e.namespaced_agent_id;if(!i||!l)return null;const[a,o]=p.useState(()=>new Set(n)),[c,u]=p.useState(null),[d,f]=p.useState(null);p.useEffect(()=>{o(new Set(n))},[n.join(",")]);const h=async g=>{if(c!==null)return;const v=new Set(a);v.has(g)?v.delete(g):v.add(g),o(v),u(g),f(null);try{v.size===0?await c0(t,l):await o0(t,l,[...v]),r()}catch(w){o(new Set(n)),f(w instanceof Error?w.message:String(w))}finally{u(null)}};return s.jsxs("div",{className:"grant-agent-card",children:[s.jsx("div",{className:"grant-agent-card-name",children:e.name}),s.jsx("div",{className:"grant-scope-list",children:i.scopes.map(g=>s.jsxs("label",{className:"grant-scope-item",children:[s.jsx("span",{className:"grant-scope-label",children:zT(g)}),s.jsxs("span",{className:"toggle-switch",children:[s.jsx("input",{type:"checkbox",checked:a.has(g),onChange:()=>void h(g),disabled:c!==null}),s.jsx("span",{className:"toggle-track"})]})]},g))}),d&&s.jsxs("div",{className:"grant-scope-warning grant-scope-warning--error",children:[s.jsx(kt,{size:11})," ",d]})]})}function MT({servers:e,expanded:t,onToggle:n}){return s.jsxs("div",{className:"agent-mcps-section",children:[s.jsx("div",{className:"agent-mcps-section-header",children:"Custom agent servers"}),s.jsx("div",{className:"connectors-list",children:e.map(r=>{const i=`${r.agent_id}::${r.server_name}`;return s.jsx(RT,{server:r,expanded:t===i,onToggle:()=>n(i)},i)})})]})}function RT({server:e,expanded:t,onToggle:n}){const r=[e.command,...e.args].join(" ");return s.jsxs("div",{className:`agent-mcp-tile${t?" agent-mcp-tile--open":""}`,children:[s.jsxs("button",{type:"button",className:"agent-mcp-tile-header",onClick:n,"aria-expanded":t,children:[s.jsx("span",{className:"agent-mcp-server-name",children:e.server_name}),s.jsxs("span",{className:"agent-mcp-agent-label",children:["via ",e.agent_name]}),e.disabled?s.jsx("span",{className:"agent-mcp-status disabled",children:"Disabled"}):s.jsxs("span",{className:"agent-mcp-status enabled",children:[s.jsx(nr,{size:11})," Active"]}),s.jsx("span",{className:"agent-mcp-readonly-badge",children:"read-only"}),s.jsx("span",{className:"agent-mcp-chevron",children:t?s.jsx(cy,{size:14}):s.jsx(ai,{size:14})})]}),t&&s.jsxs("div",{className:"agent-mcp-detail",children:[r&&s.jsx("div",{className:"agent-mcp-command-row",children:r}),s.jsx("div",{className:"agent-mcp-config-path",children:e.config_path}),s.jsxs("div",{className:"agent-mcp-config-hint",children:["Edit the agent's ",s.jsx("code",{children:"mcp_servers.json"})," to change this server."]})]})]})}function $T({connectorId:e}){const{agents:t}=we(),[n,r]=p.useState({}),[i,l]=p.useState(!0),a=p.useCallback(async()=>{try{const{grants:c}=await a0(e);r(c)}catch{r({})}finally{l(!1)}},[e]);if(p.useEffect(()=>{a()},[a]),i)return null;const o=t.filter(c=>{var u;return c.namespaced_agent_id&&((u=c.required_connections)==null?void 0:u.some(d=>d.connector_id===e))});return s.jsxs("div",{className:"connection-grants",children:[s.jsx("div",{className:"grants-header",children:"Per-agent grants"}),o.length===0?s.jsx("div",{className:"grants-empty",children:"No agents require access to this connector."}):o.map(c=>s.jsx(PT,{agent:c,connectorId:e,grantedScopes:n[c.namespaced_agent_id]??[],onChanged:()=>void a()},c.namespaced_agent_id))]})}function FT(){const{setShowSettings:e,sessions:t,removeSession:n,agents:r}=we(),[i,l]=p.useState(null),[a,o]=p.useState(!0),[c,u]=p.useState([]),[d,f]=p.useState(""),[h,m]=p.useState(""),[g,v]=p.useState(!1),[w,x]=p.useState(!1),[k,j]=p.useState(null),[z,A]=p.useState(!1),_=p.useRef(null);p.useEffect(()=>{E.system.info("Checking system status...");const L=E.system.time();Sd().then(F=>{l(F),E.system.timed("System status received",L,{lemonade:F.lemonade_running?"running":"stopped",model:F.model_loaded||"none",embedding:F.embedding_model_loaded?"yes":"no",disk:`${F.disk_space_gb}GB free`,memory:F.memory_available_gb!=null?`${F.memory_available_gb}GB available`:"unknown"}),F.lemonade_running||E.system.warn("Lemonade Server is NOT running.")}).catch(F=>{E.system.error("Failed to get system status",F),l(null)}).finally(()=>o(!1)),E0().then(F=>u(F.servers)).catch(()=>{}),t0().then(F=>{const Y=F.custom_model??"";f(Y),m(Y)}).catch(F=>{E.system.error("Failed to load settings",F)}).finally(()=>v(!0))},[]),p.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]);const D=p.useCallback(async()=>{const L=d.trim(),F=L.length>0?L:"";x(!0),j(null),A(!1);try{E.system.info("Saving custom_model override",{custom_model:F});const ue=(await n0({custom_model:F})).custom_model??"";f(ue),m(ue),A(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>A(!1),2200)}catch(Y){const ue=Y instanceof Error?Y.message:String(Y);E.system.error("Failed to save custom_model",Y),j(ue)}finally{x(!1)}},[d]),C=d.trim()!==h.trim(),M=(i==null?void 0:i.default_model_name)??Qd,{isLoadingModel:N,isDownloadingModel:U,loadModel:O,downloadModel:re}=Kx(M),ie=[{label:"4K",value:4096},{label:"8K",value:8192},{label:"16K",value:16384},{label:"32K",value:32768}],X=(i==null?void 0:i.model_context_size)??null,[xe,ce]=p.useState("");p.useEffect(()=>{X!=null&&ce(String(X))},[X]);const T=(()=>{const L=parseInt(xe,10);return Number.isFinite(L)&&L>0?L:null})(),P=T!=null&&T!==X,b=(i==null?void 0:i.model_loaded)??M,J=p.useCallback(async()=>{T&&(E.system.info(`Reloading ${b} with ctx_size=${T}`),await O(b,T))},[T,b,O]),[B,S]=p.useState(!1),oe=p.useRef(null);p.useEffect(()=>()=>{oe.current&&clearTimeout(oe.current)},[]);const pe=p.useCallback(async()=>{if(!B){S(!0),oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>S(!1),4e3);return}S(!1),oe.current&&clearTimeout(oe.current),E.system.warn(`Clearing ALL data: ${t.length} session(s)`);const L=E.system.time();let F=0;for(const Y of t)try{await zy(Y.id),n(Y.id),F++}catch(ue){E.system.error(`Failed to delete session ${Y.id}`,ue)}E.system.timed(`Cleared ${F}/${t.length} session(s)`,L),e(!1)},[B,t,n,e]),ae="0.18.0",_e=!!(i!=null&&i.lemonade_running&&i.model_loaded&&i.expected_model_loaded===!1),He=!!(i!=null&&i.lemonade_running&&i.model_loaded&&i.context_size_sufficient===!1),nt=!!(i!=null&&i.lemonade_running&&!i.model_loaded&&i.model_downloaded===!1),Ge=_e||He;return s.jsxs("div",{className:"settings-page",children:[s.jsxs("div",{className:"settings-page-header",children:[s.jsx("button",{className:"btn-icon settings-back-btn",onClick:()=>e(!1),"aria-label":"Back",children:s.jsx(ay,{size:18})}),s.jsx("h3",{children:"Settings"})]}),s.jsxs("div",{className:"settings-page-body",children:[s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"System Status"}),a?s.jsx("p",{className:"loading-text",children:"Checking system..."}):i?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"status-grid",children:[s.jsx(Sn,{label:"Lemonade Server",value:i.lemonade_running?`Running${i.lemonade_version?` v${i.lemonade_version}`:""}`:"Not Running",ok:i.lemonade_running,hint:i.lemonade_running?void 0:i.initialized?"Run: lemonade-server serve":"Run: gaia init --profile chat"}),s.jsx(Sn,{label:"Model",value:i.model_loaded||"None loaded",ok:!!i.model_loaded&&i.expected_model_loaded!==!1,hint:i.model_loaded?i.expected_model_loaded===!1?`Expected: ${M}`:void 0:"Run: gaia init --profile chat"}),i.model_size_gb!=null&&s.jsx(Sn,{label:"Model Size",value:`${i.model_size_gb} GB`,ok:!0}),i.model_device&&s.jsx(Sn,{label:"Device",value:i.model_device.toUpperCase(),ok:i.model_device!=="cpu"}),i.model_context_size!=null&&s.jsx(Sn,{label:"Context Window",value:`${(i.model_context_size/1024).toFixed(0)}K tokens`,ok:i.context_size_sufficient}),i.model_labels&&i.model_labels.length>0&&s.jsx(Sn,{label:"Capabilities",value:i.model_labels.join(", "),ok:!0}),s.jsx(Sn,{label:"Embedding Model",value:i.embedding_model_loaded?"Available":"Not loaded",ok:i.embedding_model_loaded}),i.gpu_name&&s.jsx(Sn,{label:"GPU",value:`${i.gpu_name}${i.gpu_vram_gb?` (${i.gpu_vram_gb} GB)`:""}`,ok:!0}),s.jsx(Sn,{label:"Disk Space",value:`${i.disk_space_gb} GB free`,ok:i.disk_space_gb>5,hint:!i.model_loaded&&i.disk_space_gb<30?`Models require ~25 GB — only ${i.disk_space_gb} GB available`:void 0}),s.jsx(Sn,{label:"Memory",value:i.memory_available_gb!=null?`${i.memory_available_gb} GB available`:"unknown",ok:i.memory_available_gb!=null&&i.memory_available_gb>2}),i.processor_name&&s.jsx(Sn,{label:"Processor",value:i.processor_name,ok:i.device_supported!==!1})]}),nt&&s.jsxs("div",{className:"model-action-row model-action-row--download",children:[s.jsxs("div",{className:"model-action-info",children:[s.jsx("span",{className:"model-action-label",children:"Model not downloaded."}),s.jsxs("span",{className:"model-action-desc",children:[s.jsx("strong",{children:M})," is required for GAIA Chat (~25 GB)."]})]}),s.jsx("button",{className:"btn-model-action btn-model-action--download",onClick:()=>re(!1),disabled:U,children:U?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Downloading…"]}):"Download"})]}),Ge&&s.jsxs("div",{className:"model-action-row model-action-row--load",children:[s.jsxs("div",{className:"model-action-info",children:[s.jsx("span",{className:"model-action-label",children:_e?"Wrong model loaded.":"Context window too small."}),s.jsxs("span",{className:"model-action-desc",children:["Load ",s.jsx("strong",{children:M})," with ",(Ys/1024).toFixed(0),"K token context."]})]}),s.jsx("button",{className:"btn-model-action btn-model-action--load",onClick:()=>O(),disabled:N,children:N?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Loading…"]}):"Load Model"})]}),i.lemonade_running&&s.jsxs("div",{className:"force-redownload-row",children:[s.jsx("span",{className:"force-redownload-label",children:"If the model file is corrupted:"}),s.jsx("button",{className:"btn-force-redownload",onClick:()=>re(!0),disabled:U,children:U?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:12,className:"btn-spinner"})," Downloading…"]}):"Force Re-download"})]})]}):s.jsxs("div",{className:"status-error",children:[s.jsx("p",{children:"Could not connect to server"}),s.jsx("code",{children:"gaia chat --ui"})]})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"Active Model"}),s.jsx("p",{className:"model-override-desc",children:"Override the model used by the active agent. Leave empty to use the current agent’s preferred model."}),s.jsxs("div",{className:"model-input-row",children:[s.jsx("input",{type:"text",className:`model-input${h?" has-override":""}`,placeholder:"Use agent default",value:d,onChange:L=>{f(L.target.value),j(null),A(!1)},onKeyDown:L=>{L.key==="Enter"&&!w&&C&&g&&(L.preventDefault(),D())},disabled:!g||w,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-label":"Custom model override"}),s.jsx("div",{className:"model-btn-group",children:s.jsx("button",{className:`btn-model-save${z?" saved":""}`,onClick:()=>{D()},disabled:!g||w||!C&&!z,"aria-label":"Save custom model",children:w?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Saving…"]}):z?s.jsxs(s.Fragment,{children:[s.jsx(nr,{size:13})," Saved"]}):"Save"})})]}),s.jsxs("p",{className:"model-status-hint",children:["Accepts a Lemonade model ID (e.g. ",s.jsx("code",{children:"Qwen3-4B-Instruct-2507-GGUF"}),")"," ","or a HuggingFace ID (e.g. ",s.jsx("code",{children:"unsloth/Qwen3-4B-GGUF"}),")."]}),k&&s.jsxs("div",{className:"model-warning",role:"alert",children:[s.jsx(kt,{size:14}),s.jsxs("div",{className:"model-warning-content",children:[s.jsx("strong",{children:"Could not save"}),s.jsx("p",{children:k})]})]})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"Context Size"}),s.jsx("p",{className:"model-override-desc",children:"Reload the active model with a different context window. Larger contexts use more memory and slow inference; going past the model’s training length may degrade quality."}),s.jsx("div",{className:"ctx-preset-row",children:ie.map(L=>{const F=T===L.value;return s.jsx("button",{className:`btn-ctx-preset${F?" active":""}`,onClick:()=>ce(String(L.value)),disabled:N,type:"button",children:L.label},L.value)})}),s.jsxs("div",{className:"model-input-row",children:[s.jsx("input",{type:"number",className:"model-input",placeholder:X!=null?String(X):"4096",value:xe,min:512,step:1024,onChange:L=>ce(L.target.value),disabled:N,"aria-label":"Context size in tokens"}),s.jsx("div",{className:"model-btn-group",children:s.jsx("button",{className:"btn-model-save",onClick:()=>{J()},disabled:N||!P||!(i!=null&&i.lemonade_running),"aria-label":"Reload model with new context size",children:N?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Reloading…"]}):"Apply"})})]}),s.jsxs("p",{className:"model-status-hint",children:["Current: ",s.jsx("code",{children:X!=null?`${X.toLocaleString()} tokens`:"unknown"}),(i==null?void 0:i.model_loaded)&&s.jsxs(s.Fragment,{children:[" on ",s.jsx("code",{children:i.model_loaded})]}),"."]})]}),i&&i.memory_available_gb!=null&&(()=>{const L=i.memory_available_gb,F=r.filter(Y=>Y.min_memory_gb!=null&&Y.min_memory_gb>L);return F.length===0?null:s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"Memory Warnings"}),s.jsx("div",{className:"status-grid",children:F.map(Y=>s.jsxs("div",{className:"status-row status-row--has-hint",children:[s.jsx("span",{className:"status-label",children:Y.name}),s.jsxs("div",{className:"status-value-wrap",children:[s.jsxs("span",{className:"status-value warn memory-warning-value",children:[s.jsx(kt,{size:12}),"Needs ~",Y.min_memory_gb," GB free"]}),s.jsxs("span",{className:"status-hint",children:["Only ",i.memory_available_gb," GB available — model load may fail or swap heavily."]})]})]},Y.id))})]})})(),c.length>0&&s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"MCP Servers"}),s.jsx("div",{className:"status-grid",children:c.map(L=>s.jsxs("div",{className:"status-row",children:[s.jsx("span",{className:"status-label",children:L.name}),s.jsx("div",{className:"status-value-wrap",children:L.connected?s.jsxs("span",{className:"status-value ok mcp-status-connected",children:[s.jsx(nr,{size:12}),L.tool_count," tool",L.tool_count!==1?"s":""]}):s.jsxs("span",{className:"status-value warn mcp-status-failed",title:L.error??void 0,children:[s.jsx(kt,{size:12}),"Failed"]})})]},L.name))})]}),s.jsx(jT,{}),s.jsx(LT,{}),s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"About"}),s.jsxs("div",{className:"about-info",children:[s.jsxs("p",{children:["GAIA v",ae," ",s.jsx("span",{className:"beta-badge",children:"BETA"})]}),s.jsx("p",{className:"about-sub",children:"Privacy-first AI chat for AMD Ryzen AI PCs."})]})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"Privacy & Data"}),s.jsxs("div",{className:"setting-row",children:[s.jsx("span",{children:"Data location"}),s.jsx("code",{className:"setting-path",children:"~/.gaia/chat/"})]}),s.jsx("div",{className:"danger-divider"}),s.jsxs("div",{className:"setting-actions",children:[s.jsx("p",{className:"danger-warning",children:"This will permanently delete all sessions, messages, and documents."}),s.jsx("button",{className:"btn-danger",onClick:pe,children:B?"Click again to confirm":"Clear All Data"})]})]})]})]})}function Sn({label:e,value:t,ok:n,hint:r}){return s.jsxs("div",{className:`status-row${r?" status-row--has-hint":""}`,children:[s.jsx("span",{className:"status-label",children:e}),s.jsxs("div",{className:"status-value-wrap",children:[s.jsx("span",{className:`status-value ${n?"ok":"warn"}`,children:t}),r&&s.jsx("span",{className:"status-hint",children:s.jsx("code",{children:r})})]})]})}const OT="modulepreload",UT=function(e,t){return new URL(e,t).href},qh={},BT=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){const a=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=UT(u,r),u in qh)return;qh[u]=!0;const d=u.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(!!r)for(let g=a.length-1;g>=0;g--){const v=a[g];if(v.href===u&&(!d||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${f}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":OT,d||(m.as="script"),m.crossOrigin="",m.href=u,c&&m.setAttribute("nonce",c),document.head.appendChild(m),d)return new Promise((g,v)=>{m.addEventListener("load",g),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&l(o.reason);return t().catch(l)})};let yc=null;function HT({isOpen:e,onClose:t,onStop:n,error:r}){const[i,l]=p.useState(null),[a,o]=p.useState(!1),c=p.useRef(null),u=p.useCallback(async()=>{try{const m=await Py();return l(m),m}catch(m){return E.system.error("Failed to fetch tunnel status",m),null}},[]);p.useEffect(()=>{if(!e||r)return;u();const m=setInterval(async()=>{const g=await u();g!=null&&g.active&&(g!=null&&g.url)&&clearInterval(m)},2e3);return()=>clearInterval(m)},[e,r,u]),p.useEffect(()=>{if(!(i!=null&&i.active)||!i.url||!i.token||!c.current)return;const m=`${i.url}/?token=${i.token}`;E.system.info(`Generating QR code for: ${m}`),(async()=>{if(!yc)try{const w=await BT(()=>import("./browser-CTB2jwNe.js").then(x=>x.b),[],import.meta.url);yc=w.default||w}catch{E.system.error("QR code library not available - install with: npm install qrcode");return}const v=document.documentElement.getAttribute("data-theme")==="dark";try{await yc.toCanvas(c.current,m,{width:200,margin:2,color:{dark:v?"#e6edf3":"#111827",light:v?"#0d0d0d":"#ffffff"}})}catch(w){E.system.error("QR code generation failed",w)}})()},[i==null?void 0:i.active,i==null?void 0:i.url,i==null?void 0:i.token]);const d=p.useRef(null),f=p.useCallback(()=>{if(!(i!=null&&i.url)||!(i!=null&&i.token))return;const m=`${i.url}/?token=${i.token}`;navigator.clipboard.writeText(m).then(()=>{o(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>o(!1),2e3)})},[i]);if(p.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),!e)return null;const h=i!=null&&i.active&&(i!=null&&i.url)&&(i!=null&&i.token)?`${i.url}/?token=${i.token}`:"";return s.jsx("div",{className:"modal-overlay",onClick:t,role:"dialog","aria-modal":"true","aria-label":"Mobile Access",children:s.jsxs("div",{className:"modal-panel mobile-modal",onClick:m=>m.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsxs("h3",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[s.jsx(yy,{size:18}),"Mobile Access"]}),s.jsx("button",{className:"btn-icon",onClick:t,"aria-label":"Close",children:s.jsx(tt,{size:18})})]}),s.jsxs("div",{className:"modal-body mobile-modal-body",children:[s.jsxs("div",{className:"tunnel-status",children:[s.jsx("span",{className:`status-dot ${i!=null&&i.active?"active":r?"error":"starting"}`}),s.jsx("span",{children:i!=null&&i.active?"Tunnel active":r?"Connection failed":"Starting tunnel..."}),!(i!=null&&i.active)&&!r&&s.jsx("span",{className:"tunnel-spinner"})]}),r&&s.jsx("div",{className:"tunnel-error",children:r}),s.jsx("div",{className:"qr-code-area",children:i!=null&&i.active?s.jsx("canvas",{ref:c}):r?s.jsx("div",{className:"qr-placeholder error",children:"Failed to connect"}):s.jsxs("div",{className:"qr-placeholder",children:[s.jsx("div",{className:"placeholder-spinner"}),s.jsx("span",{children:"Connecting..."})]})}),(i==null?void 0:i.active)&&h&&s.jsxs("div",{className:"tunnel-url-area",children:[s.jsx("label",{children:"Mobile URL"}),s.jsxs("div",{className:"tunnel-url-row",children:[s.jsx("input",{type:"text",readOnly:!0,value:h}),s.jsxs("button",{className:`copy-url-btn ${a?"copied":""}`,onClick:f,title:"Copy URL",children:[a?s.jsx(li,{size:13}):s.jsx(jl,{size:13}),a?"Copied":"Copy"]})]})]}),(i==null?void 0:i.active)&&(i==null?void 0:i.publicIp)&&(i==null?void 0:i.url)&&!i.url.includes("ngrok-free.app")&&s.jsxs("div",{className:"tunnel-password-hint",children:[s.jsx("label",{children:"Tunnel Password"}),s.jsx("div",{className:"tunnel-password-value",children:i.publicIp}),s.jsx("span",{className:"tunnel-password-note",children:"Enter this when the tunnel page asks for a password"})]}),s.jsx("div",{className:"mobile-instructions",children:s.jsxs("ol",{children:[s.jsx("li",{children:"Scan the QR code with your phone's camera"}),(i==null?void 0:i.url)&&!i.url.includes("ngrok-free.app")&&s.jsx("li",{children:"Enter the tunnel password shown above when prompted"}),s.jsx("li",{children:"Chat with GAIA from your mobile device"}),s.jsx("li",{children:"Your data stays secure via encrypted tunnel"})]})}),s.jsxs("div",{className:"mobile-access-actions",children:[(i==null?void 0:i.active)&&n&&s.jsx("button",{className:"btn-danger",onClick:n,title:"Close the tunnel and revoke the mobile URL",children:"Stop Tunnel"}),s.jsx("button",{className:"btn-secondary",onClick:t,children:"Close"})]})]})]})})}function VT({onRetry:e}){var j;const{backendConnected:t,systemStatus:n,currentSessionId:r,messages:i}=we(),[l,a]=p.useState(!1),o=!!r&&i.length>0,c=(n==null?void 0:n.default_model_name)??Qd,{isLoadingModel:u,isDownloadingModel:d,loadModel:f,downloadModel:h}=Kx(c),m=p.useRef(n==null?void 0:n.lemonade_running),g=p.useRef(n==null?void 0:n.model_downloaded),v=p.useRef(n==null?void 0:n.context_size_sufficient),w=p.useRef(n==null?void 0:n.expected_model_loaded);p.useEffect(()=>{if(o)return;const z=n==null?void 0:n.lemonade_running,A=n==null?void 0:n.model_downloaded,_=n==null?void 0:n.context_size_sufficient,D=n==null?void 0:n.expected_model_loaded;let C=!1;m.current!==z&&(m.current=z,z===!1&&(C=!0)),g.current!==A&&(g.current=A,A===!1&&(C=!0)),v.current!==_&&(v.current=_,_===!1&&(C=!0)),w.current!==D&&(w.current=D,D===!1&&(C=!0)),C&&a(!1)},[n,o]);const x=(n==null?void 0:n.download_progress)??null;if(d||(x==null?void 0:x.state)==="downloading"||(x==null?void 0:x.state)==="starting"||(x==null?void 0:x.state)==="error"){const z=n!=null&&n.default_model_size_gb?`~${n.default_model_size_gb.toFixed(1)} GB`:"large download",A=(x==null?void 0:x.state)==="error";return s.jsxs("div",{className:`connection-banner ${A?"connection-banner--error":"connection-banner--warning"}`,role:A?"alert":"status",children:[s.jsx("div",{className:"connection-banner__icon",children:A?s.jsx(pn,{size:16}):s.jsx(oi,{size:16})}),s.jsx("div",{className:"connection-banner__text",children:A?s.jsxs(s.Fragment,{children:["Download of ",s.jsx("strong",{children:c})," failed."," ",(x==null?void 0:x.message)&&s.jsx("span",{className:"connection-banner__hint",children:x.message})]}):s.jsxs(s.Fragment,{children:["Downloading ",s.jsx("strong",{children:c})," (",z,").",(x==null?void 0:x.state)==="downloading"&&x.file&&s.jsxs(s.Fragment,{children:[" ",s.jsxs("span",{className:"connection-banner__hint",children:["File ",x.file_index," / ",x.total_files,": ",s.jsx("code",{children:x.file})]})]})]})}),A?s.jsx("button",{className:"connection-banner__retry",onClick:()=>h(!1),children:"Retry"}):s.jsx("span",{className:"connection-banner__loading connection-banner__progress",children:x&&x.state==="downloading"&&x.total_bytes>0?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"connection-banner__progress-bar",role:"progressbar","aria-valuenow":x.percent,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Download progress",children:s.jsx("span",{className:"connection-banner__progress-fill",style:{width:`${x.percent}%`}})}),s.jsxs("span",{className:"connection-banner__progress-label",children:[x.percent,"% ·"," ",(x.downloaded_bytes/1e9).toFixed(2)," /"," ",(x.total_bytes/1e9).toFixed(2)," GB"]})]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"connection-banner__spinner"}),(x==null?void 0:x.state)==="starting"?"Starting download…":"Downloading…"]})}),A&&s.jsx("button",{className:"connection-banner__dismiss",onClick:()=>a(!0),"aria-label":"Dismiss",children:s.jsx(tt,{size:14})})]})}if((n==null?void 0:n.init_state)==="initializing"){const z=(j=n.init_tasks)==null?void 0:j.find(_=>_.status==="running"),A=(z==null?void 0:z.name)||"Preparing AI system";return s.jsxs("div",{className:"connection-banner connection-banner--init",role:"status",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(mt,{size:16,className:"connection-banner__spinner"})}),s.jsxs("div",{className:"connection-banner__text",children:[A,s.jsxs("span",{className:"thinking-dots",children:[s.jsx("span",{children:"."}),s.jsx("span",{children:"."}),s.jsx("span",{children:"."})]})]})]})}if(l||o)return null;if(!t)return s.jsxs("div",{className:"connection-banner connection-banner--error",role:"alert",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(jw,{size:16})}),s.jsxs("div",{className:"connection-banner__text",children:["Cannot connect to GAIA server."," ",s.jsxs("span",{className:"connection-banner__hint",children:["Start it with: ",s.jsx("code",{children:"gaia chat --ui"})]})]}),e&&s.jsx("button",{className:"connection-banner__retry",onClick:e,children:"Retry"})]});if(n&&!n.lemonade_running)return s.jsxs("div",{className:"connection-banner connection-banner--warning",role:"status",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(pn,{size:16})}),s.jsxs("div",{className:"connection-banner__text",children:["LLM server is not responding — it may be busy or not running."," ",s.jsxs("span",{className:"connection-banner__hint",children:["If not started, run: ",s.jsx("code",{children:"lemonade-server serve"})]})]}),e&&s.jsx("button",{className:"connection-banner__retry",onClick:e,children:"Check again"}),s.jsx("button",{className:"connection-banner__dismiss",onClick:()=>a(!0),"aria-label":"Dismiss",children:s.jsx(tt,{size:14})})]});if(n&&n.lemonade_running&&!n.model_loaded&&n.model_downloaded===!1){const z=n.default_model_size_gb?`~${n.default_model_size_gb.toFixed(1)} GB`:"large download";return s.jsxs("div",{className:"connection-banner connection-banner--warning",role:"status",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(oi,{size:16})}),s.jsxs("div",{className:"connection-banner__text",children:["Required model ",s.jsx("strong",{children:c})," is not downloaded (",z,")."]}),s.jsx("button",{className:"connection-banner__retry",onClick:()=>h(!1),children:"Download"}),e&&s.jsx("button",{className:"connection-banner__retry connection-banner__retry--secondary",onClick:e,children:"Recheck"}),s.jsx("button",{className:"connection-banner__dismiss",onClick:()=>a(!0),"aria-label":"Dismiss",children:s.jsx(tt,{size:14})})]})}if(n&&n.lemonade_running&&n.model_loaded&&n.expected_model_loaded===!1&&!n.embedding_model_loaded){const z=n.model_loaded,A=n.context_size_sufficient===!1;return s.jsxs("div",{className:"connection-banner connection-banner--warning",role:"status",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(uy,{size:16})}),s.jsxs("div",{className:"connection-banner__text",children:["Wrong model loaded: ",s.jsx("strong",{children:z}),"."," ","GAIA Chat requires ",s.jsx("strong",{children:c}),".",A&&s.jsxs(s.Fragment,{children:[" ","Context window is also too small."]})]}),u?s.jsxs("span",{className:"connection-banner__loading",children:[s.jsx(mt,{size:13,className:"connection-banner__spinner"}),"Loading…"]}):s.jsx("button",{className:"connection-banner__retry",onClick:()=>f(),children:"Load Now"}),e&&!u&&s.jsx("button",{className:"connection-banner__retry connection-banner__retry--secondary",onClick:e,children:"Recheck"}),s.jsx("button",{className:"connection-banner__dismiss",onClick:()=>a(!0),"aria-label":"Dismiss",children:s.jsx(tt,{size:14})})]})}if(n&&n.lemonade_running&&n.model_loaded&&n.context_size_sufficient===!1){const z=n.model_context_size??0,A=n.lemonade_url??"http://localhost:13305";return s.jsxs("div",{className:"connection-banner connection-banner--warning",role:"status",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(tw,{size:16})}),s.jsxs("div",{className:"connection-banner__text",children:["LLM context window is too small (",z.toLocaleString()," tokens;"," ",Ys.toLocaleString()," required)."," ",s.jsxs("span",{className:"connection-banner__hint",children:["In"," ",s.jsx("a",{className:"connection-banner__link",href:A,target:"_blank",rel:"noreferrer",children:"Lemonade"}),", set ctx‑size to ",Ys.toLocaleString(),", or restart with:"," ",s.jsxs("code",{children:["lemonade-server serve --ctx-size ",Ys]})]})]}),e&&s.jsx("button",{className:"connection-banner__retry",onClick:e,children:"Check again"}),s.jsx("button",{className:"connection-banner__dismiss",onClick:()=>a(!0),"aria-label":"Dismiss",children:s.jsx(tt,{size:14})})]})}return null}const WT={status:"idle",version:null,progress:0,releaseNotes:null,error:null};function GT(){const[e,t]=p.useState(WT);return p.useEffect(()=>{const n=window.gaiaUpdater;if(!n)return;let r=!0;n.getStatus().then(l=>{r&&l&&t(l)}).catch(()=>{});const i=n.onStatusChange(l=>{r&&l&&t(l)});return()=>{r=!1;try{i()}catch{}}},[]),e}function qT(){const e=GT(),[t,n]=p.useState(!1),r=p.useCallback(()=>{const i=window.gaiaUpdater;i==null||i.check().catch(()=>{})},[]);if(t||e.status==="idle"||e.status==="checking"||e.status==="disabled")return null;if(e.status==="downloading"){const i=Math.max(0,Math.min(100,e.progress));return s.jsxs("div",{className:"update-chip update-chip--downloading",role:"status","aria-live":"polite",title:`Downloading update${e.version?` ${e.version}`:""}…`,children:[s.jsx(oi,{size:13,className:"update-chip__icon"}),s.jsxs("span",{className:"update-chip__label",children:["Downloading update… ",i,"%"]})]})}return e.status==="available"?s.jsxs("div",{className:"update-chip update-chip--available",role:"status",title:e.releaseNotes||"A new version is available.",children:[s.jsx(oi,{size:13,className:"update-chip__icon"}),s.jsxs("span",{className:"update-chip__label",children:["Update available",e.version?`: ${e.version}`:""]}),s.jsx("button",{type:"button",className:"update-chip__dismiss",onClick:()=>n(!0),"aria-label":"Dismiss update notification",children:s.jsx(tt,{size:11})})]}):e.status==="downloaded"?s.jsxs("div",{className:"update-chip update-chip--ready",role:"status","aria-live":"polite",children:[s.jsx(Vs,{size:13,className:"update-chip__icon"}),s.jsx("button",{type:"button",className:"update-chip__action",onClick:r,title:"Click to restart and apply the update",children:"Update ready — restart to apply"})]}):e.status==="error"?s.jsxs("div",{className:"update-chip update-chip--error",role:"status",title:e.error||"Update check failed.",children:[s.jsx(pn,{size:13,className:"update-chip__icon"}),s.jsx("span",{className:"update-chip__label",children:"Update check failed"}),s.jsx("button",{type:"button",className:"update-chip__dismiss",onClick:()=>n(!0),"aria-label":"Dismiss update error",children:s.jsx(tt,{size:11})})]}):null}function QT(){const e=ot(mE),t=ot(n=>n.respondToPermission);return e?s.jsx("div",{className:"permission-overlay",role:"dialog","aria-modal":"true","aria-label":"Permission Request",children:s.jsx(KT,{notification:e,onRespond:t},e.id)}):null}function KT({notification:e,onRespond:t}){const n=e.timeoutSeconds!=null&&e.timeoutSeconds>0,[r,i]=p.useState(n?e.timeoutSeconds:null),l=p.useRef(null),[a,o]=p.useState(!1),[c,u]=p.useState(!1),d=p.useRef(!1),f=p.useRef(t);f.current=t,p.useEffect(()=>{if(n)return l.current=setInterval(()=>{i(w=>w===null||w<=1?(l.current&&clearInterval(l.current),0):w-1)},1e3),()=>{l.current&&clearInterval(l.current)}},[n]),p.useEffect(()=>{if(r===0){if(d.current)return;d.current=!0,o(!0),f.current(e.id,"deny",!1)}},[r,e.id]);const h=p.useCallback(async()=>{if(!d.current){d.current=!0,o(!0),l.current&&clearInterval(l.current);try{await t(e.id,"allow",c)}finally{d.current=!1,o(!1)}}},[e.id,t,c]),m=p.useCallback(async()=>{if(!d.current){d.current=!0,o(!0),l.current&&clearInterval(l.current);try{await t(e.id,"deny",!1)}finally{d.current=!1,o(!1)}}},[e.id,t]);p.useEffect(()=>{const w=x=>{x.key==="Enter"&&!x.shiftKey?(x.preventDefault(),h()):x.key==="Escape"&&(x.preventDefault(),m())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[h,m]);const g=e.toolArgs,v=g&&Object.keys(g).length>0;return s.jsxs("div",{className:"permission-prompt",children:[s.jsxs("div",{className:"permission-header",children:[s.jsx("div",{className:"permission-header-icon",children:s.jsx(Ga,{size:24})}),s.jsxs("div",{className:"permission-header-text",children:[s.jsx("h2",{className:"permission-title",children:"Permission Request"}),s.jsx("span",{className:"permission-agent",children:e.agentName})]}),r!==null&&r>0&&s.jsxs("div",{className:"permission-countdown",title:"Auto-deny on timeout",children:[s.jsx(Wa,{size:14}),s.jsxs("span",{children:[r,"s"]})]})]}),s.jsxs("div",{className:"permission-body",children:[s.jsx("p",{className:"permission-message",children:e.message}),e.tool&&s.jsxs("div",{className:"permission-tool-info",children:[s.jsxs("div",{className:"permission-tool-header",children:[s.jsx(pn,{size:14}),s.jsx("span",{children:"Tool Invocation"})]}),s.jsx("div",{className:"permission-tool-name",children:s.jsx("code",{children:e.tool})}),v&&s.jsx("div",{className:"permission-tool-args",children:s.jsx("pre",{children:JSON.stringify(g,null,2)})})]}),e.priority==="critical"&&s.jsxs("div",{className:"permission-critical-banner",children:[s.jsx(pn,{size:14}),s.jsx("span",{children:"This is a critical-tier operation"})]}),s.jsxs("label",{className:"permission-remember",children:[s.jsx("input",{type:"checkbox",checked:c,onChange:w=>u(w.target.checked),disabled:a}),s.jsx("span",{children:"Always allow this tool"})]})]}),s.jsxs("div",{className:"permission-actions",children:[s.jsxs("button",{className:"permission-btn permission-btn-deny",onClick:m,disabled:a,title:"Deny (Esc)",children:[s.jsx(tt,{size:16}),"Deny"]}),s.jsxs("button",{className:"permission-btn permission-btn-allow",onClick:h,disabled:a,title:"Allow (Enter)",children:[s.jsx(li,{size:16}),"Allow"]})]}),s.jsxs("div",{className:"permission-hints",children:[s.jsxs("span",{children:[s.jsx("kbd",{children:"Enter"})," Allow"]}),s.jsxs("span",{children:[s.jsx("kbd",{children:"Esc"})," Deny"]})]})]})}const YT={permission_request:{icon:s.jsx(Ga,{size:16}),colorClass:"notif-type-permission",label:"Permission"},policy_alert:{icon:s.jsx(Ga,{size:16}),colorClass:"notif-type-policy",label:"Policy"},security_alert:{icon:s.jsx(pn,{size:16}),colorClass:"notif-type-security",label:"Security"},status_change:{icon:s.jsx(wi,{size:16}),colorClass:"notif-type-status",label:"Status"},info:{icon:s.jsx(ew,{size:16}),colorClass:"notif-type-info",label:"Info"},error:{icon:s.jsx(kt,{size:16}),colorClass:"notif-type-error",label:"Error"}};function XT(e){const n=Date.now()-e,r=Math.floor(n/1e3);if(r<60)return"just now";const i=Math.floor(r/60);if(i<60)return`${i}m ago`;const l=Math.floor(i/60);if(l<24)return`${l}h ago`;const a=Math.floor(l/24);return a<7?`${a}d ago`:new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function JT({onClose:e}){const t=ot(fE),n=ot(Hx),r=ot(w=>w.markRead),i=ot(w=>w.markAllRead),l=ot(w=>w.clearAll),a=ot(w=>w.dismiss),o=ot(w=>w.addNotification),c=ot(w=>w.respondToPermission),u=ot(w=>w.typeFilter),d=ot(w=>w.setTypeFilter),f=p.useRef(!1);p.useEffect(()=>{var x;const w=window.gaiaAPI;!((x=w==null?void 0:w.notification)!=null&&x.onNotification)||f.current||(f.current=!0,w.notification.onNotification(k=>{o(k)}))},[o]);const h=p.useCallback(w=>{r(w)},[r]),m=p.useCallback(w=>{c(w.id,"allow",!1)},[c]),g=p.useCallback(w=>{c(w.id,"deny",!1)},[c]);p.useEffect(()=>{const w=x=>{x.key==="Escape"&&!x.defaultPrevented&&e()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[e]);const v=[{key:null,label:"All"},{key:"permission_request",label:"Permissions"},{key:"policy_alert",label:"Policy"},{key:"error",label:"Errors"},{key:"security_alert",label:"Security"},{key:"status_change",label:"Status"},{key:"info",label:"Info"}];return s.jsxs("div",{className:"notification-center",role:"dialog","aria-label":"Notification Center",children:[s.jsxs("div",{className:"notification-center-header",children:[s.jsxs("div",{className:"notification-center-title-row",children:[s.jsx("h2",{className:"notification-center-title",children:"Notifications"}),n>0&&s.jsx("span",{className:"notification-center-badge",children:n})]}),s.jsx("button",{className:"btn-icon notification-center-close",onClick:e,"aria-label":"Close notification center",children:s.jsx(tt,{size:18})})]}),s.jsx("div",{className:"notification-filter-bar",role:"tablist","aria-label":"Filter notifications",children:v.map(w=>s.jsx("button",{role:"tab","aria-selected":u===w.key,className:`notification-filter-tab ${u===w.key?"active":""}`,onClick:()=>d(w.key),children:w.label},w.key??"all"))}),s.jsx("div",{className:"notification-list",children:t.length===0?s.jsxs("div",{className:"notification-empty",children:[s.jsx(oy,{size:40,strokeWidth:1.2}),s.jsx("span",{children:"No notifications"})]}):t.map(w=>{const x=YT[w.type];return s.jsxs("div",{className:`notification-item ${w.read?"":"unread"} ${x.colorClass}`,id:w.type==="policy_alert"&&w.receiptId?`policy-receipt-${encodeURIComponent(w.receiptId)}`:void 0,onClick:()=>h(w.id),role:"button",tabIndex:0,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&h(w.id)},children:[!w.read&&s.jsx("span",{className:"notification-unread-dot"}),s.jsx("span",{className:"notification-icon",children:x.icon}),s.jsxs("div",{className:"notification-content",children:[s.jsxs("div",{className:"notification-content-header",children:[s.jsx("span",{className:"notification-agent",children:w.agentName}),s.jsx("span",{className:"notification-time",children:XT(w.timestamp)})]}),w.title&&s.jsx("span",{className:"notification-title",children:w.title}),s.jsx("span",{className:"notification-message",children:w.message}),w.type==="permission_request"&&w.tool&&s.jsxs("span",{className:"notification-tool",children:["Tool: ",s.jsx("code",{children:w.tool})]}),w.type==="policy_alert"&&s.jsxs("div",{className:"notification-policy-details",children:[w.tool&&s.jsxs("span",{className:"notification-tool",children:["Tool: ",s.jsx("code",{children:w.tool})]}),w.reason&&s.jsxs("span",{className:"notification-policy-reason",children:["Reason: ",w.reason]}),w.ruleIds&&w.ruleIds.length>0&&s.jsxs("span",{className:"notification-tool",children:["Rules: ",s.jsx("code",{children:w.ruleIds.join(", ")})]}),w.policyVersion&&s.jsxs("span",{className:"notification-tool",children:["Policy: ",s.jsx("code",{children:w.policyVersion})]}),s.jsxs("span",{className:"notification-tool",children:["Receipt:"," ",w.receiptId?s.jsx("code",{children:w.receiptId}):s.jsx("em",{children:"Receipt unavailable"})]})]}),w.type==="permission_request"&&!w.response&&s.jsxs("div",{className:"notification-actions",children:[s.jsxs("button",{className:"notification-action-btn notification-action-allow",onClick:k=>{k.stopPropagation(),m(w)},children:[s.jsx(li,{size:14}),"Approve"]}),s.jsxs("button",{className:"notification-action-btn notification-action-deny",onClick:k=>{k.stopPropagation(),g(w)},children:[s.jsx(tt,{size:14}),"Deny"]})]}),w.type==="permission_request"&&w.response&&s.jsx("span",{className:`notification-response-badge ${w.response==="allow"?"response-allow":"response-deny"}`,children:w.response==="allow"?"Approved":"Denied"})]}),s.jsx("button",{className:"notification-dismiss",onClick:k=>{k.stopPropagation(),a(w.id)},"aria-label":"Dismiss notification",children:s.jsx(tt,{size:14})})]},w.id)})}),t.length>0&&s.jsxs("div",{className:"notification-center-footer",children:[s.jsxs("button",{className:"notification-footer-btn",onClick:i,disabled:n===0,children:[s.jsx(li,{size:14}),"Mark All Read"]}),s.jsxs("button",{className:"notification-footer-btn notification-footer-clear",onClick:l,children:[s.jsx(ci,{size:14}),"Clear"]})]})]})}function ia({show:e,children:t,duration:n=250}){const[r,i]=p.useState(!1),[l,a]=p.useState("idle");return p.useEffect(()=>{if(e)i(!0),requestAnimationFrame(()=>a("entering"));else if(r){a("exiting");const o=setTimeout(()=>{i(!1),a("idle")},n);return()=>clearTimeout(o)}},[e,r,n]),r?s.jsx("div",{className:`animated-presence ${l}`,"data-duration":n,children:t}):null}function ZT(){const{currentSessionId:e,setSessions:t,setCurrentSession:n,addSession:r,removeSession:i,updateSessionInList:l,setMessages:a,showDocLibrary:o,showFileBrowser:c,showSettings:u,showMemoryDashboard:d,sidebarOpen:f,toggleSidebar:h,setSidebarOpen:m,systemStatus:g,setSystemStatus:v,setBackendConnected:w,setAgents:x}=we(),k=ot(H=>H.showPanel),j=ot(H=>H.setShowPanel),z=p.useRef(""),A=p.useCallback(async()=>{try{const le=(await Nd()).agents||[],Pe=le.map(Ae=>Ae.id).sort().join(",");Pe!==z.current&&(z.current=Pe,x(le))}catch{}},[x]);p.useEffect(()=>{A();const H=setInterval(A,3e4);return()=>clearInterval(H)},[A]);const[_,D]=p.useState(!1),[C,M]=p.useState(!1),[N,U]=p.useState(!1),[O,re]=p.useState(null),ie=p.useRef(null),X=p.useRef(0),xe=3,ce=p.useCallback(async()=>{try{const H=await Sd();if(w(!0),H.lemonade_running)X.current=0,v(H);else if(X.current+=1,E.system.warn(`Lemonade health check failed (${X.current}/${xe})`),X.current>=xe)v(H);else{const le=we.getState().systemStatus;le&&le.lemonade_running?v({...le,disk_space_gb:H.disk_space_gb,memory_available_gb:H.memory_available_gb}):v(H)}E.system.info("System status:",{lemonade:H.lemonade_running,model:H.model_loaded,failCount:X.current})}catch(H){E.system.warn("System status check failed",H),w(!1),v(null)}},[v,w]),T=p.useRef(3e3);p.useEffect(()=>(ce(),T.current=3e3,ie.current=setInterval(ce,3e3),()=>{ie.current&&clearInterval(ie.current)}),[ce]),p.useEffect(()=>{const H=g==null?void 0:g.init_state;if(!H||H==="initializing")return;const le=15e3;le!==T.current&&(T.current=le,ie.current&&clearInterval(ie.current),ie.current=setInterval(ce,le))},[g==null?void 0:g.init_state,ce]);const P=p.useRef(null),b=p.useRef("");p.useEffect(()=>{e0("0.18.0"),E.system.info("App mounting, loading sessions...");const H=E.system.time(),le=Ae=>Ae.map($e=>`${$e.id}|${$e.updated_at}|${$e.title}`).join(`
|
|
550
|
-
`),Pe=(Ae=!1)=>{u0().then($e=>{const ut=$e.sessions||[];if(Ae){t(ut),w(!0),b.current=le(ut),E.system.timed(`Loaded ${ut.length} session(s)`,H);return}const je=we.getState().sessions;if(ut.length===0&&je.length>0){E.system.warn(`Session poll returned 0 sessions but sidebar has ${je.length} — skipping update to prevent data loss`);return}const Je=le(ut);Je!==b.current&&(E.system.info(`Session list changed (${je.length} → ${ut.length} sessions)`),t(ut),b.current=Je)}).catch($e=>{Ae&&(E.system.error("Failed to load sessions from backend",$e),E.system.warn("Is the Python backend running? Start it with: gaia chat --ui"))})};return Pe(!0),P.current=setInterval(()=>Pe(!1),5e3),()=>{P.current&&clearInterval(P.current)}},[t,r,i,l,w]),p.useEffect(()=>{if(e)return;const le=new URLSearchParams(window.location.search).get("session"),Pe=window.location.hash.replace(/^#/,""),Ae=le||Pe;if(!Ae)return;E.nav.info(`URL session parameter: ${Ae}`);const $e=setTimeout(()=>{const{sessions:ut}=we.getState();let je=ut.some(Je=>Je.id===Ae)?Ae:T0(ut,Ae);je?(n(je),a([])):E.nav.warn(`Session ${Ae} not found in loaded sessions`)},500);return()=>clearTimeout($e)},[e,n,a]),p.useEffect(()=>{if(e){const H=Ri(e);window.location.hash!==`#${H}`&&window.history.replaceState(null,"",`#${H}`)}else window.location.hash&&window.history.replaceState(null,"",window.location.pathname+window.location.search)},[e]),p.useEffect(()=>{Py().then(H=>{M(H.active===!0)}).catch(()=>{})},[]),p.useEffect(()=>{const H=()=>{window.innerWidth>768&&m(!0)};return window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[m]);const[J,B]=p.useState(null),S=p.useCallback(async()=>{E.chat.info("Creating new task session..."),B(null);try{const{activeAgentId:H}=we.getState(),le=await hu({title:"New Task",agent_type:H});E.chat.info(`Session created: id=${le.id}, title="${le.title}"`),r(le),n(le.id),a([]),window.innerWidth<=768&&m(!1)}catch(H){E.chat.error("Failed to create session",H),ce(),B("Failed to create task. Is the server running?"),setTimeout(()=>B(null),6e3)}},[r,n,a,m,ce]),oe=p.useCallback(async H=>{we.getState().setActiveAgentId(H),await S()},[S]),{setPendingPrompt:pe}=we(),ae=p.useCallback(async H=>{E.chat.info(`New task with prompt: "${H.slice(0,60)}..."`),pe(H),await S()},[S,pe]),_e=p.useCallback(async()=>{E.chat.info("Creating builder agent session..."),B(null);try{pe("Hi, I'd like to create a new custom agent.");const H=await hu({title:"New Agent",agent_type:"builder"});E.chat.info(`Builder session created: id=${H.id}`),r(H),n(H.id),a([]),window.innerWidth<=768&&m(!1)}catch(H){pe(null),E.chat.error("Failed to create builder session",H),ce(),B("Failed to create task. Is the server running?"),setTimeout(()=>B(null),6e3)}},[r,n,a,m,ce,pe]),He=p.useCallback(async()=>{if(C){E.system.info("Reopening mobile access modal (tunnel already running)"),re(null),D(!0);return}E.system.info("Starting mobile access tunnel..."),D(!0),U(!0),re(null);try{const H=await C0();H.error?(E.system.error("Tunnel failed to start:",H.error),M(!1),re(H.error)):(M(!0),E.system.info("Tunnel started successfully"))}catch(H){E.system.error("Tunnel start error:",H),M(!1),re(H instanceof Error?H.message:"Failed to connect")}finally{U(!1)}},[C]),nt=p.useCallback(async()=>{E.system.info("Stopping mobile access tunnel...");try{await _0()}catch(H){E.system.warn("stopTunnel call failed (continuing)",H)}M(!1),re(null),D(!1)},[]);p.useEffect(()=>{const{sessions:H,setActiveAgentId:le}=we.getState(),Pe=H.find(Ae=>Ae.id===e);Pe!=null&&Pe.agent_type&&le(Pe.agent_type)},[e]),p.useEffect(()=>{e?E.nav.info(`Viewing session: ${e}`):E.nav.info("Viewing welcome screen (no session selected)")},[e]),p.useEffect(()=>{o&&E.ui.info("Document Library opened")},[o]),p.useEffect(()=>{u&&E.ui.info("Settings page opened")},[u]);const[Ge,L]=p.useState(typeof window<"u"&&window.innerWidth<=768);p.useEffect(()=>{const H=()=>L(window.innerWidth<=768);return window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]);const[F,Y]=p.useState(!1),[ue,he]=p.useState(null);return p.useEffect(()=>{if(e!==ue){Y(!0);const H=setTimeout(()=>{he(e),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Y(!1)})})},220);return()=>clearTimeout(H)}},[e,ue]),s.jsxs("div",{className:"app",children:[s.jsx("button",{className:"sidebar-toggle",onClick:h,"aria-label":f?"Close sidebar":"Open sidebar",children:s.jsx(sw,{size:18})}),s.jsx("div",{className:`sidebar-overlay ${f?"visible":""}`,onClick:()=>m(!1),"aria-hidden":"true"}),s.jsx(L0,{onNewTask:S,tunnelActive:C,tunnelLoading:N,onMobileToggle:He}),s.jsx("div",{className:"main-content",children:u?s.jsx(FT,{}):d?s.jsx(vT,{}):s.jsxs(s.Fragment,{children:[s.jsx(VT,{onRetry:ce}),s.jsx("div",{className:`view-container ${F?"view-transitioning":""}`,children:ue?s.jsx(wE,{sessionId:ue,onCreateAgent:_e,onAgentChange:oe},ue):s.jsx(NE,{onNewTask:S,onSendPrompt:ae,onCreateAgent:_e})})]})}),s.jsx(ia,{show:o,children:s.jsx(TE,{})}),s.jsx(ia,{show:c,children:s.jsx(PE,{})}),s.jsx(ia,{show:k,children:s.jsx("div",{className:"notification-center-popover",children:s.jsx(JT,{onClose:()=>j(!1)})})}),!Ge&&s.jsx(ia,{show:_,children:s.jsx(HT,{isOpen:_,onClose:()=>D(!1),onStop:nt,error:O})}),s.jsx(QT,{}),s.jsx(qT,{}),J&&s.jsx("div",{className:"toast",role:"alert",children:J})]})}const ez=localStorage.getItem("gaia-chat-theme");ez!=="light"&&document.documentElement.setAttribute("data-theme","dark");xc.createRoot(document.getElementById("root")).render(s.jsx(Gi.StrictMode,{children:s.jsx(ZT,{})}));
|