From b13f67079805c53fbf4b9a5cfad9d4f175c5b3fc Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Fri, 20 Mar 2026 10:18:35 +0100 Subject: [PATCH] auto-git: [add] dist/assets/index-z8MB-_Ve.js [change] dist/index.html [unlink] dist/assets/index-CmkVpybC.js --- dist/assets/index-CmkVpybC.js | 73 ----------------------------------- dist/assets/index-z8MB-_Ve.js | 73 +++++++++++++++++++++++++++++++++++ dist/index.html | 2 +- 3 files changed, 74 insertions(+), 74 deletions(-) delete mode 100644 dist/assets/index-CmkVpybC.js create mode 100644 dist/assets/index-z8MB-_Ve.js diff --git a/dist/assets/index-CmkVpybC.js b/dist/assets/index-CmkVpybC.js deleted file mode 100644 index 7fd9ba9..0000000 --- a/dist/assets/index-CmkVpybC.js +++ /dev/null @@ -1,73 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Tp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yc={exports:{}},xo={},wc={exports:{}},Q={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var tl=Symbol.for("react.element"),$p=Symbol.for("react.portal"),Mp=Symbol.for("react.fragment"),zp=Symbol.for("react.strict_mode"),Fp=Symbol.for("react.profiler"),Ip=Symbol.for("react.provider"),Op=Symbol.for("react.context"),Ap=Symbol.for("react.forward_ref"),Dp=Symbol.for("react.suspense"),Up=Symbol.for("react.memo"),Bp=Symbol.for("react.lazy"),Wa=Symbol.iterator;function Hp(e){return e===null||typeof e!="object"?null:(e=Wa&&e[Wa]||e["@@iterator"],typeof e=="function"?e:null)}var Sc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xc=Object.assign,kc={};function ur(e,t,n){this.props=e,this.context=t,this.refs=kc,this.updater=n||Sc}ur.prototype.isReactComponent={};ur.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")};ur.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ec(){}Ec.prototype=ur.prototype;function Es(e,t,n){this.props=e,this.context=t,this.refs=kc,this.updater=n||Sc}var Cs=Es.prototype=new Ec;Cs.constructor=Es;xc(Cs,ur.prototype);Cs.isPureReactComponent=!0;var Va=Array.isArray,Cc=Object.prototype.hasOwnProperty,Ns={current:null},Nc={key:!0,ref:!0,__self:!0,__source:!0};function _c(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Cc.call(t,r)&&!Nc.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,Y=M[A];if(0>>1;Al(Xe,$))Etl(Ze,Xe)?(M[A]=Ze,M[Et]=$,A=Et):(M[A]=Xe,M[Ge]=$,A=Ge);else if(Etl(Ze,$))M[A]=Ze,M[Et]=$,A=Et;else break e}}return S}function l(M,S){var $=M.sortIndex-S.sortIndex;return $!==0?$:M.id-S.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var s=[],u=[],p=1,y=null,g=3,x=!1,C=!1,N=!1,P=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(M){for(var S=n(u);S!==null;){if(S.callback===null)r(u);else if(S.startTime<=M)r(u),S.sortIndex=S.expirationTime,t(s,S);else break;S=n(u)}}function E(M){if(N=!1,d(M),!C)if(n(s)!==null)C=!0,Ee(j);else{var S=n(u);S!==null&&Je(E,S.startTime-M)}}function j(M,S){C=!1,N&&(N=!1,h(F),F=-1),x=!0;var $=g;try{for(d(S),y=n(s);y!==null&&(!(y.expirationTime>S)||M&&!ne());){var A=y.callback;if(typeof A=="function"){y.callback=null,g=y.priorityLevel;var Y=A(y.expirationTime<=S);S=e.unstable_now(),typeof Y=="function"?y.callback=Y:y===n(s)&&r(s),d(S)}else r(s);y=n(s)}if(y!==null)var Ce=!0;else{var Ge=n(u);Ge!==null&&Je(E,Ge.startTime-S),Ce=!1}return Ce}finally{y=null,g=$,x=!1}}var _=!1,R=null,F=-1,B=5,U=-1;function ne(){return!(e.unstable_now()-UM||125A?(M.sortIndex=$,t(u,M),n(s)===null&&M===n(u)&&(N?(h(F),F=-1):N=!0,Je(E,$-A))):(M.sortIndex=Y,t(s,M),C||x||(C=!0,Ee(j))),M},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(M){var S=g;return function(){var $=g;g=S;try{return M.apply(this,arguments)}finally{g=$}}}})(Tc);Rc.exports=Tc;var qp=Rc.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var eh=v,be=qp;function T(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Li=Object.prototype.hasOwnProperty,th=/^[: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]*$/,Qa={},Ka={};function nh(e){return Li.call(Ka,e)?!0:Li.call(Qa,e)?!1:th.test(e)?Ka[e]=!0:(Qa[e]=!0,!1)}function rh(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 lh(e,t,n,r){if(t===null||typeof t>"u"||rh(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 Ie(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var ke={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ke[e]=new Ie(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ke[t]=new Ie(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ke[e]=new Ie(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ke[e]=new Ie(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){ke[e]=new Ie(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ke[e]=new Ie(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ke[e]=new Ie(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ke[e]=new Ie(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ke[e]=new Ie(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ls=/[\-:]([a-z])/g;function Ps(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(Ls,Ps);ke[t]=new Ie(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(Ls,Ps);ke[t]=new Ie(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(Ls,Ps);ke[t]=new Ie(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ke[e]=new Ie(e,1,!1,e.toLowerCase(),null,!1,!1)});ke.xlinkHref=new Ie("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ke[e]=new Ie(e,1,!1,e.toLowerCase(),null,!0,!0)});function js(e,t,n,r){var l=ke.hasOwnProperty(t)?ke[t]:null;(l!==null?l.type!==0:r||!(2a||l[i]!==o[a]){var s=` -`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=a);break}}}finally{ei=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Er(e):""}function oh(e){switch(e.tag){case 5:return Er(e.type);case 16:return Er("Lazy");case 13:return Er("Suspense");case 19:return Er("SuspenseList");case 0:case 2:case 15:return e=ti(e.type,!1),e;case 11:return e=ti(e.type.render,!1),e;case 1:return e=ti(e.type,!0),e;default:return""}}function Ti(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 Dn:return"Fragment";case An:return"Portal";case Pi:return"Profiler";case Rs:return"StrictMode";case ji:return"Suspense";case Ri:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zc:return(e.displayName||"Context")+".Consumer";case Mc:return(e._context.displayName||"Context")+".Provider";case Ts:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $s:return t=e.displayName||null,t!==null?t:Ti(e.type)||"Memo";case Vt:t=e._payload,e=e._init;try{return Ti(e(t))}catch{}}return null}function ih(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 Ti(t);case 8:return t===Rs?"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 ln(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ic(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sh(e){var t=Ic(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yl(e){e._valueTracker||(e._valueTracker=sh(e))}function Oc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ic(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Jl(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 $i(e,t){var n=t.checked;return se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ja(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ln(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 Ac(e,t){t=t.checked,t!=null&&js(e,"checked",t,!1)}function Mi(e,t){Ac(e,t);var n=ln(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")?zi(e,t.type,n):t.hasOwnProperty("defaultValue")&&zi(e,t.type,ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ga(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 zi(e,t,n){(t!=="number"||Jl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cr=Array.isArray;function Gn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Or(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Lr={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},ah=["Webkit","ms","Moz","O"];Object.keys(Lr).forEach(function(e){ah.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Lr[t]=Lr[e]})});function Hc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Lr.hasOwnProperty(e)&&Lr[e]?(""+t).trim():t+"px"}function Wc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Hc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var uh=se({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 Oi(e,t){if(t){if(uh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(T(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(T(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(T(61))}if(t.style!=null&&typeof t.style!="object")throw Error(T(62))}}function Ai(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 Di=null;function Ms(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ui=null,Xn=null,Zn=null;function qa(e){if(e=ll(e)){if(typeof Ui!="function")throw Error(T(280));var t=e.stateNode;t&&(t=_o(t),Ui(e.stateNode,e.type,t))}}function Vc(e){Xn?Zn?Zn.push(e):Zn=[e]:Xn=e}function bc(){if(Xn){var e=Xn,t=Zn;if(Zn=Xn=null,qa(e),t)for(e=0;e>>=0,e===0?32:31-(Sh(e)/xh|0)|0}var Sl=64,xl=4194304;function Nr(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 ql(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~l;a!==0?r=Nr(a):(o&=i,o!==0&&(r=Nr(o)))}else i=n&~l,i!==0?r=Nr(i):o!==0&&(r=Nr(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function nl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ft(t),e[t]=n}function Nh(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=jr),au=" ",uu=!1;function df(e,t){switch(e){case"keyup":return qh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Un=!1;function tm(e,t){switch(e){case"compositionend":return pf(t);case"keypress":return t.which!==32?null:(uu=!0,au);case"textInput":return e=t.data,e===au&&uu?null:e;default:return null}}function nm(e,t){if(Un)return e==="compositionend"||!Bs&&df(e,t)?(e=cf(),Ol=As=Yt=null,Un=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=pu(n)}}function vf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yf(){for(var e=window,t=Jl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Jl(e.document)}return t}function Hs(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 fm(e){var t=yf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&vf(n.ownerDocument.documentElement,n)){if(r!==null&&Hs(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=hu(n,o);var i=hu(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Bn=null,Qi=null,Tr=null,Ki=!1;function mu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ki||Bn==null||Bn!==Jl(r)||(r=Bn,"selectionStart"in r&&Hs(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}),Tr&&Wr(Tr,r)||(Tr=r,r=no(Qi,"onSelect"),0Vn||(e.current=qi[Vn],qi[Vn]=null,Vn--)}function X(e,t){Vn++,qi[Vn]=e.current,e.current=t}var on={},Re=an(on),De=an(!1),kn=on;function rr(e,t){var n=e.type.contextTypes;if(!n)return on;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ue(e){return e=e.childContextTypes,e!=null}function lo(){ee(De),ee(Re)}function ku(e,t,n){if(Re.current!==on)throw Error(T(168));X(Re,t),X(De,n)}function Lf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(T(108,ih(e)||"Unknown",l));return se({},n,r)}function oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||on,kn=Re.current,X(Re,e),X(De,De.current),!0}function Eu(e,t,n){var r=e.stateNode;if(!r)throw Error(T(169));n?(e=Lf(e,t,kn),r.__reactInternalMemoizedMergedChildContext=e,ee(De),ee(Re),X(Re,e)):ee(De),X(De,n)}var Lt=null,Lo=!1,mi=!1;function Pf(e){Lt===null?Lt=[e]:Lt.push(e)}function Em(e){Lo=!0,Pf(e)}function un(){if(!mi&&Lt!==null){mi=!0;var e=0,t=G;try{var n=Lt;for(G=1;e>=i,l-=i,Pt=1<<32-ft(t)+l|n<F?(B=R,R=null):B=R.sibling;var U=g(h,R,d[F],E);if(U===null){R===null&&(R=B);break}e&&R&&U.alternate===null&&t(h,R),f=o(U,f,F),_===null?j=U:_.sibling=U,_=U,R=B}if(F===d.length)return n(h,R),te&&mn(h,F),j;if(R===null){for(;FF?(B=R,R=null):B=R.sibling;var ne=g(h,R,U.value,E);if(ne===null){R===null&&(R=B);break}e&&R&&ne.alternate===null&&t(h,R),f=o(ne,f,F),_===null?j=ne:_.sibling=ne,_=ne,R=B}if(U.done)return n(h,R),te&&mn(h,F),j;if(R===null){for(;!U.done;F++,U=d.next())U=y(h,U.value,E),U!==null&&(f=o(U,f,F),_===null?j=U:_.sibling=U,_=U);return te&&mn(h,F),j}for(R=r(h,R);!U.done;F++,U=d.next())U=x(R,h,F,U.value,E),U!==null&&(e&&U.alternate!==null&&R.delete(U.key===null?F:U.key),f=o(U,f,F),_===null?j=U:_.sibling=U,_=U);return e&&R.forEach(function(fe){return t(h,fe)}),te&&mn(h,F),j}function P(h,f,d,E){if(typeof d=="object"&&d!==null&&d.type===Dn&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case vl:e:{for(var j=d.key,_=f;_!==null;){if(_.key===j){if(j=d.type,j===Dn){if(_.tag===7){n(h,_.sibling),f=l(_,d.props.children),f.return=h,h=f;break e}}else if(_.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Vt&&_u(j)===_.type){n(h,_.sibling),f=l(_,d.props),f.ref=wr(h,_,d),f.return=h,h=f;break e}n(h,_);break}else t(h,_);_=_.sibling}d.type===Dn?(f=xn(d.props.children,h.mode,E,d.key),f.return=h,h=f):(E=bl(d.type,d.key,d.props,null,h.mode,E),E.ref=wr(h,f,d),E.return=h,h=E)}return i(h);case An:e:{for(_=d.key;f!==null;){if(f.key===_)if(f.tag===4&&f.stateNode.containerInfo===d.containerInfo&&f.stateNode.implementation===d.implementation){n(h,f.sibling),f=l(f,d.children||[]),f.return=h,h=f;break e}else{n(h,f);break}else t(h,f);f=f.sibling}f=Ei(d,h.mode,E),f.return=h,h=f}return i(h);case Vt:return _=d._init,P(h,f,_(d._payload),E)}if(Cr(d))return C(h,f,d,E);if(hr(d))return N(h,f,d,E);Pl(h,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,f!==null&&f.tag===6?(n(h,f.sibling),f=l(f,d),f.return=h,h=f):(n(h,f),f=ki(d,h.mode,E),f.return=h,h=f),i(h)):n(h,f)}return P}var or=$f(!0),Mf=$f(!1),ao=an(null),uo=null,Kn=null,Qs=null;function Ks(){Qs=Kn=uo=null}function Ys(e){var t=ao.current;ee(ao),e._currentValue=t}function ns(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 er(e,t){uo=e,Qs=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ae=!0),e.firstContext=null)}function lt(e){var t=e._currentValue;if(Qs!==e)if(e={context:e,memoizedValue:t,next:null},Kn===null){if(uo===null)throw Error(T(308));Kn=e,uo.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return t}var yn=null;function Js(e){yn===null?yn=[e]:yn.push(e)}function zf(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Js(t)):(n.next=l.next,l.next=n),t.interleaved=n,zt(e,r)}function zt(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 bt=!1;function Gs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ff(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 Rt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function en(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,zt(e,n)}return l=r.interleaved,l===null?(t.next=t,Js(r)):(t.next=l.next,l.next=t),r.interleaved=t,zt(e,n)}function Dl(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,Fs(e,n)}}function Lu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function co(e,t,n,r){var l=e.updateQueue;bt=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var s=a,u=s.next;s.next=null,i===null?o=u:i.next=u,i=s;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==i&&(a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=s))}if(o!==null){var y=l.baseState;i=0,p=u=s=null,a=o;do{var g=a.lane,x=a.eventTime;if((r&g)===g){p!==null&&(p=p.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var C=e,N=a;switch(g=t,x=n,N.tag){case 1:if(C=N.payload,typeof C=="function"){y=C.call(x,y,g);break e}y=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=N.payload,g=typeof C=="function"?C.call(x,y,g):C,g==null)break e;y=se({},y,g);break e;case 2:bt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,g=l.effects,g===null?l.effects=[a]:g.push(a))}else x={eventTime:x,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(u=p=x,s=y):p=p.next=x,i|=g;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;g=a,a=g.next,g.next=null,l.lastBaseUpdate=g,l.shared.pending=null}}while(!0);if(p===null&&(s=y),l.baseState=s,l.firstBaseUpdate=u,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Nn|=i,e.lanes=i,e.memoizedState=y}}function Pu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vi.transition;vi.transition={};try{e(!1),t()}finally{G=n,vi.transition=r}}function Zf(){return ot().memoizedState}function Lm(e,t,n){var r=nn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},qf(e))ed(t,n);else if(n=zf(e,t,n,r),n!==null){var l=ze();dt(n,e,r,l),td(n,t,r)}}function Pm(e,t,n){var r=nn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(qf(e))ed(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,n);if(l.hasEagerState=!0,l.eagerState=a,pt(a,i)){var s=t.interleaved;s===null?(l.next=l,Js(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=zf(e,t,l,r),n!==null&&(l=ze(),dt(n,e,r,l),td(n,t,r))}}function qf(e){var t=e.alternate;return e===oe||t!==null&&t===oe}function ed(e,t){$r=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function td(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fs(e,n)}}var ho={readContext:lt,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},jm={readContext:lt,useCallback:function(e,t){return vt().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Ru,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bl(4194308,4,Kf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bl(4,2,e,t)},useMemo:function(e,t){var n=vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=vt();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=Lm.bind(null,oe,e),[r.memoizedState,e]},useRef:function(e){var t=vt();return e={current:e},t.memoizedState=e},useState:ju,useDebugValue:la,useDeferredValue:function(e){return vt().memoizedState=e},useTransition:function(){var e=ju(!1),t=e[0];return e=_m.bind(null,e[1]),vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=oe,l=vt();if(te){if(n===void 0)throw Error(T(407));n=n()}else{if(n=t(),ye===null)throw Error(T(349));Cn&30||Df(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Ru(Bf.bind(null,r,o,e),[e]),r.flags|=2048,Xr(9,Uf.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=vt(),t=ye.identifierPrefix;if(te){var n=jt,r=Pt;n=(r&~(1<<32-ft(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Jr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[yt]=t,e[Qr]=r,fd(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ai(n,r),n){case"dialog":q("cancel",e),q("close",e),l=r;break;case"iframe":case"object":case"embed":q("load",e),l=r;break;case"video":case"audio":for(l=0;l<_r.length;l++)q(_r[l],e);l=r;break;case"source":q("error",e),l=r;break;case"img":case"image":case"link":q("error",e),q("load",e),l=r;break;case"details":q("toggle",e),l=r;break;case"input":Ja(e,r),l=$i(e,r),q("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=se({},r,{value:void 0}),q("invalid",e);break;case"textarea":Xa(e,r),l=Fi(e,r),q("invalid",e);break;default:l=r}Oi(n,l),a=l;for(o in a)if(a.hasOwnProperty(o)){var s=a[o];o==="style"?Wc(e,s):o==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&Bc(e,s)):o==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Or(e,s):typeof s=="number"&&Or(e,""+s):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Ir.hasOwnProperty(o)?s!=null&&o==="onScroll"&&q("scroll",e):s!=null&&js(e,o,s,i))}switch(n){case"input":yl(e),Ga(e,r,!1);break;case"textarea":yl(e),Za(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ln(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Gn(e,!!r.multiple,o,!1):r.defaultValue!=null&&Gn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=ro)}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 Pe(t),null;case 6:if(e&&t.stateNode!=null)pd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(T(166));if(n=wn(Yr.current),wn(St.current),Ll(t)){if(r=t.stateNode,n=t.memoizedProps,r[yt]=t,(o=r.nodeValue!==n)&&(e=Ve,e!==null))switch(e.tag){case 3:_l(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&_l(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[yt]=t,t.stateNode=r}return Pe(t),null;case 13:if(ee(le),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(te&&We!==null&&t.mode&1&&!(t.flags&128))Tf(),lr(),t.flags|=98560,o=!1;else if(o=Ll(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(T(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(T(317));o[yt]=t}else lr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pe(t),o=!1}else ct!==null&&(ys(ct),ct=null),o=!0;if(!o)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||le.current&1?ge===0&&(ge=3):fa())),t.updateQueue!==null&&(t.flags|=4),Pe(t),null);case 4:return ir(),cs(e,t),e===null&&Vr(t.stateNode.containerInfo),Pe(t),null;case 10:return Ys(t.type._context),Pe(t),null;case 17:return Ue(t.type)&&lo(),Pe(t),null;case 19:if(ee(le),o=t.memoizedState,o===null)return Pe(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Sr(o,!1);else{if(ge!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=fo(e),i!==null){for(t.flags|=128,Sr(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return X(le,le.current&1|2),t.child}e=e.sibling}o.tail!==null&&ce()>ar&&(t.flags|=128,r=!0,Sr(o,!1),t.lanes=4194304)}else{if(!r)if(e=fo(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Sr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!te)return Pe(t),null}else 2*ce()-o.renderingStartTime>ar&&n!==1073741824&&(t.flags|=128,r=!0,Sr(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ce(),t.sibling=null,n=le.current,X(le,r?n&1|2:n&1),t):(Pe(t),null);case 22:case 23:return ca(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?He&1073741824&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),null;case 24:return null;case 25:return null}throw Error(T(156,t.tag))}function Om(e,t){switch(Vs(t),t.tag){case 1:return Ue(t.type)&&lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ir(),ee(De),ee(Re),qs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zs(t),null;case 13:if(ee(le),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));lr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ee(le),null;case 4:return ir(),null;case 10:return Ys(t.type._context),null;case 22:case 23:return ca(),null;case 24:return null;default:return null}}var Rl=!1,je=!1,Am=typeof WeakSet=="function"?WeakSet:Set,I=null;function Yn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ae(e,t,r)}else n.current=null}function fs(e,t,n){try{n()}catch(r){ae(e,t,r)}}var Bu=!1;function Dm(e,t){if(Yi=eo,e=yf(),Hs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,a=-1,s=-1,u=0,p=0,y=e,g=null;t:for(;;){for(var x;y!==n||l!==0&&y.nodeType!==3||(a=i+l),y!==o||r!==0&&y.nodeType!==3||(s=i+r),y.nodeType===3&&(i+=y.nodeValue.length),(x=y.firstChild)!==null;)g=y,y=x;for(;;){if(y===e)break t;if(g===n&&++u===l&&(a=i),g===o&&++p===r&&(s=i),(x=y.nextSibling)!==null)break;y=g,g=y.parentNode}y=x}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ji={focusedElem:e,selectionRange:n},eo=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var C=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var N=C.memoizedProps,P=C.memoizedState,h=t.stateNode,f=h.getSnapshotBeforeUpdate(t.elementType===t.type?N:at(t.type,N),P);h.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(T(163))}}catch(E){ae(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return C=Bu,Bu=!1,C}function Mr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&fs(t,n,o)}l=l.next}while(l!==r)}}function Ro(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 ds(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 hd(e){var t=e.alternate;t!==null&&(e.alternate=null,hd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yt],delete t[Qr],delete t[Zi],delete t[xm],delete t[km])),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 md(e){return e.tag===5||e.tag===3||e.tag===4}function Hu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||md(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 ps(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=ro));else if(r!==4&&(e=e.child,e!==null))for(ps(e,t,n),e=e.sibling;e!==null;)ps(e,t,n),e=e.sibling}function hs(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(hs(e,t,n),e=e.sibling;e!==null;)hs(e,t,n),e=e.sibling}var Se=null,ut=!1;function Wt(e,t,n){for(n=n.child;n!==null;)gd(e,t,n),n=n.sibling}function gd(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(ko,n)}catch{}switch(n.tag){case 5:je||Yn(n,t);case 6:var r=Se,l=ut;Se=null,Wt(e,t,n),Se=r,ut=l,Se!==null&&(ut?(e=Se,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Se.removeChild(n.stateNode));break;case 18:Se!==null&&(ut?(e=Se,n=n.stateNode,e.nodeType===8?hi(e.parentNode,n):e.nodeType===1&&hi(e,n),Br(e)):hi(Se,n.stateNode));break;case 4:r=Se,l=ut,Se=n.stateNode.containerInfo,ut=!0,Wt(e,t,n),Se=r,ut=l;break;case 0:case 11:case 14:case 15:if(!je&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&fs(n,t,i),l=l.next}while(l!==r)}Wt(e,t,n);break;case 1:if(!je&&(Yn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ae(n,t,a)}Wt(e,t,n);break;case 21:Wt(e,t,n);break;case 22:n.mode&1?(je=(r=je)||n.memoizedState!==null,Wt(e,t,n),je=r):Wt(e,t,n);break;default:Wt(e,t,n)}}function Wu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Am),t.forEach(function(r){var l=Ym.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function st(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Bm(r/1960))-r,10e?16:e,Jt===null)var r=!1;else{if(e=Jt,Jt=null,vo=0,K&6)throw Error(T(331));var l=K;for(K|=4,I=e.current;I!==null;){var o=I,i=o.child;if(I.flags&16){var a=o.deletions;if(a!==null){for(var s=0;sce()-aa?Sn(e,0):sa|=n),Be(e,t)}function Cd(e,t){t===0&&(e.mode&1?(t=xl,xl<<=1,!(xl&130023424)&&(xl=4194304)):t=1);var n=ze();e=zt(e,t),e!==null&&(nl(e,t,n),Be(e,n))}function Km(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cd(e,n)}function Ym(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(T(314))}r!==null&&r.delete(t),Cd(e,n)}var Nd;Nd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||De.current)Ae=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ae=!1,Fm(e,t,n);Ae=!!(e.flags&131072)}else Ae=!1,te&&t.flags&1048576&&jf(t,so,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hl(e,t),e=t.pendingProps;var l=rr(t,Re.current);er(t,n),l=ta(null,t,r,e,l,n);var o=na();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ue(r)?(o=!0,oo(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Gs(t),l.updater=jo,t.stateNode=l,l._reactInternals=t,ls(t,r,e,n),t=ss(null,t,r,!0,o,n)):(t.tag=0,te&&o&&Ws(t),Me(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Gm(r),e=at(r,e),l){case 0:t=is(null,t,r,e,n);break e;case 1:t=Au(null,t,r,e,n);break e;case 11:t=Iu(null,t,r,e,n);break e;case 14:t=Ou(null,t,r,at(r.type,e),n);break e}throw Error(T(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:at(r,l),is(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:at(r,l),Au(e,t,r,l,n);case 3:e:{if(ad(t),e===null)throw Error(T(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Ff(e,t),co(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=sr(Error(T(423)),t),t=Du(e,t,r,n,l);break e}else if(r!==l){l=sr(Error(T(424)),t),t=Du(e,t,r,n,l);break e}else for(We=qt(t.stateNode.containerInfo.firstChild),Ve=t,te=!0,ct=null,n=Mf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lr(),r===l){t=Ft(e,t,n);break e}Me(e,t,r,n)}t=t.child}return t;case 5:return If(t),e===null&&ts(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,Gi(r,l)?i=null:o!==null&&Gi(r,o)&&(t.flags|=32),sd(e,t),Me(e,t,i,n),t.child;case 6:return e===null&&ts(t),null;case 13:return ud(e,t,n);case 4:return Xs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=or(t,null,r,n):Me(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:at(r,l),Iu(e,t,r,l,n);case 7:return Me(e,t,t.pendingProps,n),t.child;case 8:return Me(e,t,t.pendingProps.children,n),t.child;case 12:return Me(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,X(ao,r._currentValue),r._currentValue=i,o!==null)if(pt(o.value,i)){if(o.children===l.children&&!De.current){t=Ft(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=Rt(-1,n&-n),s.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?s.next=s:(s.next=p.next,p.next=s),u.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),ns(o.return,n,t),a.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(T(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),ns(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}Me(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,er(t,n),l=lt(l),r=r(l),t.flags|=1,Me(e,t,r,n),t.child;case 14:return r=t.type,l=at(r,t.pendingProps),l=at(r.type,l),Ou(e,t,r,l,n);case 15:return od(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:at(r,l),Hl(e,t),t.tag=1,Ue(r)?(e=!0,oo(t)):e=!1,er(t,n),nd(t,r,l),ls(t,r,l,n),ss(null,t,r,!0,e,n);case 19:return cd(e,t,n);case 22:return id(e,t,n)}throw Error(T(156,t.tag))};function _d(e,t){return Zc(e,t)}function Jm(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 nt(e,t,n,r){return new Jm(e,t,n,r)}function da(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gm(e){if(typeof e=="function")return da(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ts)return 11;if(e===$s)return 14}return 2}function rn(e,t){var n=e.alternate;return n===null?(n=nt(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 bl(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")da(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Dn:return xn(n.children,l,o,t);case Rs:i=8,l|=8;break;case Pi:return e=nt(12,n,t,l|2),e.elementType=Pi,e.lanes=o,e;case ji:return e=nt(13,n,t,l),e.elementType=ji,e.lanes=o,e;case Ri:return e=nt(19,n,t,l),e.elementType=Ri,e.lanes=o,e;case Fc:return $o(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mc:i=10;break e;case zc:i=9;break e;case Ts:i=11;break e;case $s:i=14;break e;case Vt:i=16,r=null;break e}throw Error(T(130,e==null?e:typeof e,""))}return t=nt(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function xn(e,t,n,r){return e=nt(7,e,r,t),e.lanes=n,e}function $o(e,t,n,r){return e=nt(22,e,r,t),e.elementType=Fc,e.lanes=n,e.stateNode={isHidden:!1},e}function ki(e,t,n){return e=nt(6,e,null,t),e.lanes=n,e}function Ei(e,t,n){return t=nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xm(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ri(0),this.expirationTimes=ri(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function pa(e,t,n,r,l,o,i,a,s){return e=new Xm(e,t,n,a,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=nt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gs(o),e}function Zm(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rd)}catch(e){console.error(e)}}Rd(),jc.exports=Qe;var Td=jc.exports,$d,Xu=Td;$d=Xu.createRoot,Xu.hydrateRoot;/** - * react-router v7.8.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */var Zu="popstate";function rg(e={}){function t(l,o){let{pathname:i="/",search:a="",hash:s=""}=jn(l.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),ws("",{pathname:i,search:a,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(l,o){let i=l.document.querySelector("base"),a="";if(i&&i.getAttribute("href")){let s=l.location.href,u=s.indexOf("#");a=u===-1?s:s.slice(0,u)}return a+"#"+(typeof o=="string"?o:qr(o))}function r(l,o){ht(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return og(t,n,r,e)}function ie(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ht(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function lg(){return Math.random().toString(36).substring(2,10)}function qu(e,t){return{usr:e.state,key:e.key,idx:t}}function ws(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?jn(t):t,state:n,key:t&&t.key||r||lg()}}function qr({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function jn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function og(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,a="POP",s=null,u=p();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function p(){return(i.state||{idx:null}).idx}function y(){a="POP";let P=p(),h=P==null?null:P-u;u=P,s&&s({action:a,location:N.location,delta:h})}function g(P,h){a="PUSH";let f=ws(N.location,P,h);n&&n(f,P),u=p()+1;let d=qu(f,u),E=N.createHref(f);try{i.pushState(d,"",E)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;l.location.assign(E)}o&&s&&s({action:a,location:N.location,delta:1})}function x(P,h){a="REPLACE";let f=ws(N.location,P,h);n&&n(f,P),u=p();let d=qu(f,u),E=N.createHref(f);i.replaceState(d,"",E),o&&s&&s({action:a,location:N.location,delta:0})}function C(P){return ig(P)}let N={get action(){return a},get location(){return e(l,i)},listen(P){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(Zu,y),s=P,()=>{l.removeEventListener(Zu,y),s=null}},createHref(P){return t(l,P)},createURL:C,encodeLocation(P){let h=C(P);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:g,replace:x,go(P){return i.go(P)}};return N}function ig(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ie(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:qr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Md(e,t,n="/"){return sg(e,t,n,!1)}function sg(e,t,n,r){let l=typeof t=="string"?jn(t):t,o=It(l.pathname||"/",n);if(o==null)return null;let i=zd(e);ag(i);let a=null;for(let s=0;a==null&&s{let p={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&s)return;ie(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let y=Tt([r,p.relativePath]),g=n.concat(p);i.children&&i.children.length>0&&(ie(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),zd(i.children,t,g,y,s)),!(i.path==null&&!i.index)&&t.push({path:y,score:mg(y,i.index),routesMeta:g})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let u of Fd(i.path))o(i,a,!0,u)}),t}function Fd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=Fd(r.join("/")),a=[];return a.push(...i.map(s=>s===""?o:[o,s].join("/"))),l&&a.push(...i),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function ag(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gg(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var ug=/^:[\w-]+$/,cg=3,fg=2,dg=1,pg=10,hg=-2,ec=e=>e==="*";function mg(e,t){let n=e.split("/"),r=n.length;return n.some(ec)&&(r+=hg),t&&(r+=fg),n.filter(l=>!ec(l)).reduce((l,o)=>l+(ug.test(o)?cg:o===""?dg:pg),r)}function gg(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function vg(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",i=[];for(let a=0;a{if(p==="*"){let C=a[g]||"";i=o.slice(0,o.length-C.length).replace(/(.)\/+$/,"$1")}const x=a[g];return y&&!x?u[p]=void 0:u[p]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function yg(e,t=!1,n=!0){ht(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function wg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ht(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function It(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Sg(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?jn(e):e;return{pathname:n?n.startsWith("/")?n:xg(n,t):t,search:Cg(r),hash:Ng(l)}}function xg(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Ci(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function kg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Id(e){let t=kg(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Od(e,t,n,r=!1){let l;typeof e=="string"?l=jn(e):(l={...e},ie(!l.pathname||!l.pathname.includes("?"),Ci("?","pathname","search",l)),ie(!l.pathname||!l.pathname.includes("#"),Ci("#","pathname","hash",l)),ie(!l.search||!l.search.includes("#"),Ci("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,a;if(i==null)a=n;else{let y=t.length-1;if(!r&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),y-=1;l.pathname=g.join("/")}a=y>=0?t[y]:"/"}let s=Sg(l,a),u=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||p)&&(s.pathname+="/"),s}var Tt=e=>e.join("/").replace(/\/\/+/g,"/"),Eg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Cg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ng=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _g(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Ad=["POST","PUT","PATCH","DELETE"];new Set(Ad);var Lg=["GET",...Ad];new Set(Lg);var dr=v.createContext(null);dr.displayName="DataRouter";var Oo=v.createContext(null);Oo.displayName="DataRouterState";v.createContext(!1);var Dd=v.createContext({isTransitioning:!1});Dd.displayName="ViewTransition";var Pg=v.createContext(new Map);Pg.displayName="Fetchers";var jg=v.createContext(null);jg.displayName="Await";var xt=v.createContext(null);xt.displayName="Navigation";var il=v.createContext(null);il.displayName="Location";var At=v.createContext({outlet:null,matches:[],isDataRoute:!1});At.displayName="Route";var va=v.createContext(null);va.displayName="RouteError";function Rg(e,{relative:t}={}){ie(sl(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=v.useContext(xt),{hash:l,pathname:o,search:i}=al(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:Tt([n,o])),r.createHref({pathname:a,search:i,hash:l})}function sl(){return v.useContext(il)!=null}function Rn(){return ie(sl(),"useLocation() may be used only in the context of a component."),v.useContext(il).location}var Ud="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Bd(e){v.useContext(xt).static||v.useLayoutEffect(e)}function Tg(){let{isDataRoute:e}=v.useContext(At);return e?Vg():$g()}function $g(){ie(sl(),"useNavigate() may be used only in the context of a component.");let e=v.useContext(dr),{basename:t,navigator:n}=v.useContext(xt),{matches:r}=v.useContext(At),{pathname:l}=Rn(),o=JSON.stringify(Id(r)),i=v.useRef(!1);return Bd(()=>{i.current=!0}),v.useCallback((s,u={})=>{if(ht(i.current,Ud),!i.current)return;if(typeof s=="number"){n.go(s);return}let p=Od(s,JSON.parse(o),l,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Tt([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,o,l,e])}v.createContext(null);function al(e,{relative:t}={}){let{matches:n}=v.useContext(At),{pathname:r}=Rn(),l=JSON.stringify(Id(n));return v.useMemo(()=>Od(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function Mg(e,t){return Hd(e,t)}function Hd(e,t,n,r,l){var f;ie(sl(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=v.useContext(xt),{matches:i}=v.useContext(At),a=i[i.length-1],s=a?a.params:{},u=a?a.pathname:"/",p=a?a.pathnameBase:"/",y=a&&a.route;{let d=y&&y.path||"";Wd(u,!y||d.endsWith("*")||d.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .`)}let g=Rn(),x;if(t){let d=typeof t=="string"?jn(t):t;ie(p==="/"||((f=d.pathname)==null?void 0:f.startsWith(p)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${d.pathname}" was given in the \`location\` prop.`),x=d}else x=g;let C=x.pathname||"/",N=C;if(p!=="/"){let d=p.replace(/^\//,"").split("/");N="/"+C.replace(/^\//,"").split("/").slice(d.length).join("/")}let P=Md(e,{pathname:N});ht(y||P!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),ht(P==null||P[P.length-1].route.element!==void 0||P[P.length-1].route.Component!==void 0||P[P.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let h=Ag(P&&P.map(d=>Object.assign({},d,{params:Object.assign({},s,d.params),pathname:Tt([p,o.encodeLocation?o.encodeLocation(d.pathname).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?p:Tt([p,o.encodeLocation?o.encodeLocation(d.pathnameBase).pathname:d.pathnameBase])})),i,n,r,l);return t&&h?v.createElement(il.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},h):h}function zg(){let e=Wg(),t=_g(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:l},n):null,i)}var Fg=v.createElement(zg,null),Ig=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?v.createElement(At.Provider,{value:this.props.routeContext},v.createElement(va.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Og({routeContext:e,match:t,children:n}){let r=v.useContext(dr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(At.Provider,{value:e},n)}function Ag(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let u=o.findIndex(p=>p.route.id&&(i==null?void 0:i[p.route.id])!==void 0);ie(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,u+1))}let a=!1,s=-1;if(n)for(let u=0;u=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((u,p,y)=>{let g,x=!1,C=null,N=null;n&&(g=i&&p.route.id?i[p.route.id]:void 0,C=p.route.errorElement||Fg,a&&(s<0&&y===0?(Wd("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,N=null):s===y&&(x=!0,N=p.route.hydrateFallbackElement||null)));let P=t.concat(o.slice(0,y+1)),h=()=>{let f;return g?f=C:x?f=N:p.route.Component?f=v.createElement(p.route.Component,null):p.route.element?f=p.route.element:f=u,v.createElement(Og,{match:p,routeContext:{outlet:u,matches:P,isDataRoute:n!=null},children:f})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?v.createElement(Ig,{location:n.location,revalidation:n.revalidation,component:C,error:g,children:h(),routeContext:{outlet:null,matches:P,isDataRoute:!0},unstable_onError:r}):h()},null)}function ya(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Dg(e){let t=v.useContext(dr);return ie(t,ya(e)),t}function Ug(e){let t=v.useContext(Oo);return ie(t,ya(e)),t}function Bg(e){let t=v.useContext(At);return ie(t,ya(e)),t}function wa(e){let t=Bg(e),n=t.matches[t.matches.length-1];return ie(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Hg(){return wa("useRouteId")}function Wg(){var r;let e=v.useContext(va),t=Ug("useRouteError"),n=wa("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Vg(){let{router:e}=Dg("useNavigate"),t=wa("useNavigate"),n=v.useRef(!1);return Bd(()=>{n.current=!0}),v.useCallback(async(l,o={})=>{ht(n.current,Ud),n.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var tc={};function Wd(e,t,n){!t&&!tc[e]&&(tc[e]=!0,ht(!1,n))}v.memo(bg);function bg({routes:e,future:t,state:n,unstable_onError:r}){return Hd(e,void 0,n,r,t)}function Vd(e){ie(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function Qg({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1}){ie(!sl(),"You cannot render a inside another . You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=v.useMemo(()=>({basename:i,navigator:l,static:o,future:{}}),[i,l,o]);typeof n=="string"&&(n=jn(n));let{pathname:s="/",search:u="",hash:p="",state:y=null,key:g="default"}=n,x=v.useMemo(()=>{let C=It(s,i);return C==null?null:{location:{pathname:C,search:u,hash:p,state:y,key:g},navigationType:r}},[i,s,u,p,y,g,r]);return ht(x!=null,` is not able to match the URL "${s}${u}${p}" because it does not start with the basename, so the won't render anything.`),x==null?null:v.createElement(xt.Provider,{value:a},v.createElement(il.Provider,{children:t,value:x}))}function Kg({children:e,location:t}){return Mg(Ss(e),t)}function Ss(e,t=[]){let n=[];return v.Children.forEach(e,(r,l)=>{if(!v.isValidElement(r))return;let o=[...t,l];if(r.type===v.Fragment){n.push.apply(n,Ss(r.props.children,o));return}ie(r.type===Vd,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),ie(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Ss(r.props.children,o)),n.push(i)}),n}var Ql="get",Kl="application/x-www-form-urlencoded";function Ao(e){return e!=null&&typeof e.tagName=="string"}function Yg(e){return Ao(e)&&e.tagName.toLowerCase()==="button"}function Jg(e){return Ao(e)&&e.tagName.toLowerCase()==="form"}function Gg(e){return Ao(e)&&e.tagName.toLowerCase()==="input"}function Xg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zg(e,t){return e.button===0&&(!t||t==="_self")&&!Xg(e)}var Ml=null;function qg(){if(Ml===null)try{new FormData(document.createElement("form"),0),Ml=!1}catch{Ml=!0}return Ml}var ev=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ni(e){return e!=null&&!ev.has(e)?(ht(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Kl}"`),null):e}function tv(e,t){let n,r,l,o,i;if(Jg(e)){let a=e.getAttribute("action");r=a?It(a,t):null,n=e.getAttribute("method")||Ql,l=Ni(e.getAttribute("enctype"))||Kl,o=new FormData(e)}else if(Yg(e)||Gg(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a `,C=`
${g}
`;return`
${x}${C}
`}),i=i.replace(/
\s*(?=
]*>[\s\S]*?<\/div>)\s*
/g,"$1"),i}function ty(e){const t=e.split(/\r?\n/);let n=null;for(let r=0;r/i,n=/<\/think(?:ing)?>/i,r=e.match(t);if(!r)return{think:null,answer:e};const l=r.index,o=r[0].length,i=e.substring(0,l).trim();let a=e.substring(l+o);const s=a.match(n);let u=null,p=i;return s?(u=a.substring(0,s.index).trim(),p+=a.substring(s.index+s[0].length)):u=a.trim(),{think:u||null,answer:p.trim()}}function ny({content:e,streamOutput:t,sources:n}){const{think:r,answer:l}=ep(e||""),[o,i]=$e.useState(!1),a=!!r;return m.jsxs("div",{className:"assistant-message",children:[a&&m.jsxs("div",{className:"assistant-thoughts",children:[m.jsxs("button",{className:"think-toggle",onClick:()=>i(s=>!s),"aria-expanded":o?"true":"false","aria-controls":"think-content",children:[m.jsx("span",{className:"think-toggle-icon","aria-hidden":"true",children:o?"▾":"▸"}),"Thoughts"]}),o&&m.jsx("div",{id:"think-content",className:"think-content",dangerouslySetInnerHTML:{__html:hc(r)}})]}),m.jsx("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:hc(l||e||"")}}),Array.isArray(n)&&n.length>0&&m.jsx("div",{className:"msg-sources chips",children:n.map((s,u)=>{let p=s,y=!1;try{const g=new URL(s);if(g.protocol==="file:"){y=!0;const x=g.pathname.split("/").filter(Boolean);p=decodeURIComponent(x[x.length-1]||s)}else p=(g.hostname||s).replace(/^www\./i,"")}catch{}return m.jsx("a",{className:"chip",href:s,target:"_blank",rel:"noreferrer",title:s,onClick:g=>{var x,C;if(y){g.preventDefault();try{const N=new URL(s);(C=(x=window.electronAPI)==null?void 0:x.openPath)==null||C.call(x,decodeURIComponent(N.pathname))}catch{}}},children:p},s+u)})})]})}const mc="websearch.searxUrl",gc="websearch.engines",vc="chat.libraryBySession";let tp="http://127.0.0.1:8000";const ry=48,ly=24;function oy(e){return e.backendApiUrl||e.ollamaApiUrl||tp}function iy(){var Ha;const[e,t]=v.useState([]),[n,r]=v.useState(null),[l,o]=v.useState("chats"),[i,a]=v.useState("General"),[s,u]=v.useState(null),[p,y]=v.useState(null),[g,x]=v.useState([]),[C,N]=v.useState([]),[P,h]=v.useState(null),[f,d]=v.useState(()=>{try{const c=localStorage.getItem(vc);return c?JSON.parse(c):{}}catch{return{}}}),[E,j]=v.useState(!1),[_,R]=v.useState(""),[F,B]=v.useState(""),[U,ne]=v.useState(!1),[fe,Ye]=v.useState(""),[kt,cn]=v.useState(""),Ee=v.useRef(null),Je=v.useRef(null),M=v.useRef(null),[S,$]=v.useState(tp),[A,Y]=v.useState("Default"),[Ce,Ge]=v.useState(!1),[Xe,Et]=v.useState(localStorage.getItem(mc)||"http://localhost:8888"),[Ze,np]=v.useState(()=>{try{const c=localStorage.getItem(gc);if(c)return JSON.parse(c)}catch{}return["duckduckgo","bing","wikipedia","github","stack_overflow"]});v.useEffect(()=>{localStorage.setItem(mc,Xe||"")},[Xe]),v.useEffect(()=>{try{localStorage.setItem(gc,JSON.stringify(Ze||[]))}catch{}},[Ze]);const[ul,rp]=v.useState(!1),[Dt,Do]=v.useState(!1),[uy,Uo]=v.useState(!0),[lp,Tn]=v.useState([]),[cl,Ea]=v.useState({}),[op,Bo]=v.useState(null),[Ho,fl]=v.useState("");function ip(c){const w=c.content||"";if(c.role==="assistant")try{const{answer:k}=ep(w);return(k||w).trim()}catch{return w.trim()}return w}async function Ca(c){try{await navigator.clipboard.writeText(ip(c))}catch(w){console.error("Failed to copy message:",w)}}function fn(c,w,k,L={}){const{removeIfEmpty:z=!1}=L;t(D=>D.map(H=>{if(H.session_id!==c)return H;const O=[];for(const W of H.messages||[]){if(W.id!==w){O.push(W);continue}z&&!k||O.push({...W,content:k})}return{...H,messages:O}}))}function Ut(c){return(c==null?void 0:c.name)==="AbortError"}function Wo(c){return c instanceof Error&&c.message?c.message:String(c)}async function Na(c,w,k){if(!c)return{contextBlock:null,sources:[]};const z=await(await fetch(`${S}/libraries/${c}/context`,{method:"POST",headers:{"Content-Type":"application/json"},signal:k,body:JSON.stringify({prompt:w,top_k:5})})).json();return{contextBlock:typeof(z==null?void 0:z.context_block)=="string"&&z.context_block.trim()?z.context_block.trim():null,sources:Array.isArray(z==null?void 0:z.sources)?z.sources:[]}}function sp(c,w){Bo(c),fl(w||"")}function dl(){Bo(null),fl("")}async function ap(c){var D;const w=(((D=Fn[c])==null?void 0:D.content)||"").trim(),L=(Ho??"").trim();if(L.length===0){dl();return}if(L===w){dl();return}const z=n;if(z){t(H=>H.map(O=>{if(O.session_id!==z)return O;const _e=(O.messages||[]).slice(0,c+1).map((he,qe)=>qe===c?{...he,content:L}:he);return{...O,messages:_e}})),Bo(null),fl(""),requestAnimationFrame(()=>Go("auto",z));try{const H=await fetch(`${S}/sessions/${z}/messages/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:L})});if(!H.ok)throw new Error(`HTTP ${H.status}`)}catch(H){console.error("Failed to update message:",H),t(O=>O.map(W=>{if(W.session_id!==z)return W;const he=(W.messages||[]).map((qe,V)=>V===c?{...qe,content:w}:qe);return{...W,messages:he}}));return}await _a(c,L)}}async function _a(c,w=null){var _e,he,qe,V,ue,we;const k=n;if(Dt||!k||typeof c!="number")return;const L=((_e=e.find(J=>J.session_id===k))==null?void 0:_e.messages)||[];let z=c;for(let J=c;J>=0;J--)if(((he=L[J])==null?void 0:he.role)==="user"){z=J;break}t(J=>J.map(re=>re.session_id===k?{...re,messages:(re.messages||[]).slice(0,z+1)}:re));const D=$a(k);let H=w??(((qe=L[z])==null?void 0:qe.content)||""),O=[];const W=[];try{const J=Ia(k),re=w??(((V=L[z])==null?void 0:V.content)||"");if((ue=J==null?void 0:J.states)!=null&&ue.is_indexed)try{const b=await Na(J.slug,re,D.signal);b.contextBlock&&W.push(b.contextBlock),Array.isArray(b.sources)&&O.push(...b.sources)}catch(b){if(Ut(b))throw b;console.warn("local library enrichment (regenerate) failed",b)}if(ul)try{const b=L.slice(Math.max(0,z-7),z+1).map(de=>({role:de.role,content:de.content||""}));b.length>0&&(b[b.length-1]={role:"user",content:re});const Z=await(await fetch(`${S}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({prompt:re,model:fe,messages:b,history_limit:8,searx_url:Xe||null,engines:Array.isArray(Ze)?Ze:null})})).json();Z&&typeof Z.context_block=="string"&&Z.context_block.trim()&&W.push(Z.context_block.trim()),Array.isArray(Z==null?void 0:Z.sources)&&O.push(...Z.sources)}catch(b){if(Ut(b))throw b;console.warn("web search enrichment (regenerate) failed",b)}if(O=[...new Set(O)],W.length>0?H=`${re} - -${W.join(` - -`)}`:H=null,Ce){const b=`msg-${Date.now()}-${Math.random()}`;let Nt="";t(Z=>Z.map(de=>de.session_id===k?{...de,messages:[...de.messages||[],{id:b,role:"assistant",content:"",sources:O}]}:de));try{const Z=await fetch(`${S}/sessions/${k}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({index:c,model:fe,stream:!0,enriched_message:H,sources:O||[]})});if(!Z.ok)throw new Error(`HTTP ${Z.status}`);const de=(we=Z.body)==null?void 0:we.getReader();if(!de)throw new Error("Missing response body");const Ht=new TextDecoder;let mt=!1;for(;;){const{value:hn,done:jp}=await de.read();if(jp)break;const Rp=Ht.decode(hn,{stream:!0});Nt+=Rp,fn(k,b,Nt),!mt&&Ne.current!==k&&(mt=!0,dn(Xo=>({...Xo,[k]:b})),Tn(Xo=>[...new Set([...Xo,k])]))}Ne.current!==k?(dn(hn=>({...hn,[k]:b})),Tn(hn=>[...new Set([...hn,k])])):$n.current[k]?Mn(hn=>({...hn,[k]:b})):requestAnimationFrame(()=>In(b,"smooth",k))}catch(Z){if(Ut(Z)){fn(k,b,Nt,{removeIfEmpty:!0});return}console.error(Z),fn(k,b,`Error: ${Wo(Z)}`,{removeIfEmpty:!0});return}}else{const b=await fetch(`${S}/sessions/${k}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({index:c,model:fe,stream:!1,enriched_message:H,sources:O||[]})});if(!b.ok)throw new Error(`HTTP ${b.status}`);const Nt=await b.json(),Z=`msg-${Date.now()}`;t(de=>de.map(Ht=>Ht.session_id===k?{...Ht,messages:[...Ht.messages||[],{role:"assistant",content:Nt.reply,id:Z,sources:O}]}:Ht)),Ne.current!==k?(dn(de=>({...de,[k]:Z})),Tn(de=>[...new Set([...de,k])])):$n.current[k]?Mn(de=>({...de,[k]:Z})):requestAnimationFrame(()=>In(Z,"smooth",k))}}catch(J){Ut(J)||console.error(J)}finally{Vo(D)}}const[La,up]=v.useState({}),$n=v.useRef({}),[cp,dn]=v.useState({}),pn=v.useRef({}),Pa=v.useRef({}),[ja,Mn]=v.useState({}),[fp,Ra]=v.useState({}),Ta=(c,w,k)=>c!=null&&c.id?c.id:`${k}:${w}`;v.useEffect(()=>{var w;if(!n)return;const c=((w=e.find(k=>k.session_id===n))==null?void 0:w.messages)||[];Ra(k=>{const L={};return c.forEach((z,D)=>{if(z.role!=="user")return;const H=Ta(z,D,n),W=(z.content||"").split(/\r\n|\r|\n/).length>30;L[H]=W?k[H]??!0:!1}),L})},[e,n]);function dp(c){Ra(w=>({...w,[c]:!(w[c]??!0)}))}const pr=$e.useCallback((c,w)=>{up(k=>{const L={...k,[c]:w};return $n.current=L,L})},[]),zn=v.useRef(null),pp=v.useRef(!1),hp=v.useRef(null),Ne=v.useRef(n);v.useEffect(()=>{Ne.current=n},[n]);const $a=$e.useCallback(c=>{const w=new AbortController;return zn.current={controller:w,sessionId:c},Do(!0),w},[]),Vo=$e.useCallback(c=>{var w;((w=zn.current)==null?void 0:w.controller)===c&&(zn.current=null,Do(!1))},[]),mp=$e.useCallback(()=>{const c=zn.current;c&&(zn.current=null,c.controller.abort(),Do(!1))},[]);v.useEffect(()=>()=>{var c;(c=zn.current)==null||c.controller.abort()},[]);const Bt=v.useRef(null),[gp,vp]=v.useState(230),[pl,Ma]=v.useState(!1),yp=$e.useCallback(c=>{Ma(!0)},[]),bo=$e.useCallback(()=>{Ma(!1)},[]),Qo=$e.useCallback(c=>{if(pl){const w=Math.max(230,Math.min(500,c.clientX));vp(w)}},[pl]);$e.useEffect(()=>(window.addEventListener("mousemove",Qo),window.addEventListener("mouseup",bo),()=>{window.removeEventListener("mousemove",Qo),window.removeEventListener("mouseup",bo)}),[Qo,bo]),$e.useEffect(()=>{pl?document.body.classList.add("no-select"):document.body.classList.remove("no-select")},[pl]),$e.useEffect(()=>{const c=async w=>{const k=w.target.closest(".codeblock__copy");if(!k)return;const L=k.closest(".codeblock"),z=L==null?void 0:L.querySelector("pre > code");if(z)try{await navigator.clipboard.writeText(z.textContent||""),k.classList.add("copied"),setTimeout(()=>k.classList.remove("copied"),800)}catch(D){console.error("Copy failed:",D)}};return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[]),v.useEffect(()=>{window.electronAPI.getSettings().then(w=>{$(oy(w)),Y(w.colorScheme||"Default"),Ye(w.chatModel||""),Ge(w.streamOutput||!1),Ea(w.scrollPositions||{}),el(w.colorScheme||"Default")});const c=()=>{var w;l==="chats"&&((w=Je.current)==null||w.focus())};return window.electronAPI.onWindowFocus(c),()=>{}},[l]),v.useEffect(()=>{el(A)},[A]);const wp=c=>{!c||!S||fetch(`${S}/history?session_id=${encodeURIComponent(c)}`).then(w=>w.json()).then(w=>{t(k=>k.map(L=>L.session_id===c?{...L,messages:w.messages||[]}:L))}).catch(()=>{})};async function hl(){if(S)try{const w=await(await fetch(`${S}/libraries`)).json(),k=Array.isArray(w.libraries)?w.libraries:[];if(x(k),k.length===0){h(null);return}k.some(L=>L.slug===P)||h(k[0].slug)}catch(c){console.warn("Failed to load libraries",c)}}async function Ko(){if(S)try{const w=await(await fetch(`${S}/jobs`)).json();N(Array.isArray(w.jobs)?w.jobs:[])}catch(c){console.warn("Failed to load library jobs",c)}}async function za(c=null){const k=(typeof c=="string"?c:_).trim();if(!k){B("Name is required.");return}try{B("");const L=await fetch(`${S}/libraries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})});if(!L.ok){const D=await L.text();throw new Error(D||`HTTP ${L.status}`)}const z=await L.json();j(!1),R(""),await hl(),z!=null&&z.slug&&h(z.slug)}catch(L){console.error("Failed to create library",L),B(String((L==null?void 0:L.message)||L))}}v.useEffect(()=>{S&&(Uo(!0),fetch(`${S}/sessions`).then(c=>c.json()).then(c=>{const w=c.sessions.map(k=>({...k,messages:[]}));t(w),w.length>0?r(w[0].session_id):r(null),Uo(!1)}).catch(()=>{Uo(!1)}))},[S]),v.useEffect(()=>{S&&(hl(),Ko())},[S]),v.useEffect(()=>{try{localStorage.setItem(vc,JSON.stringify(f||{}))}catch{}},[f]),v.useEffect(()=>{if(!S)return;const c=setInterval(()=>{hl(),Ko()},3e3);return()=>clearInterval(c)},[S,l,P]),v.useEffect(()=>{wp(n)},[n,S]),v.useEffect(()=>{const c=new Set(g.map(w=>w.slug));d(w=>{let k=!1;const L={};for(const[z,D]of Object.entries(w||{}))c.has(D)?L[z]=D:k=!0;return k?L:w})},[g]);const Yo=c=>{o(c)},Sp=c=>{Np(c)},Fn=v.useMemo(()=>{var c;return((c=e.find(w=>w.session_id===n))==null?void 0:c.messages)||[]},[n,e]),ml=v.useMemo(()=>g.find(c=>c.slug===P)||null,[P,g]),Ct=n&&f[n]||null,it=v.useMemo(()=>g.find(c=>c.slug===Ct)||null,[Ct,g]),Fa=v.useMemo(()=>Ct?C.some(c=>c.slug===Ct&&(c.status==="queued"||c.status==="running")):!1,[Ct,C]),Jo=v.useMemo(()=>{var c,w;return it?(c=it.files)!=null&&c.length?(w=it.states)!=null&&w.is_indexed?"":Fa?" (syncing)":" (needs sync)":" (empty)":""},[it,Fa]);function xp(c){return c&&f[c]||null}function Ia(c){const w=xp(c);return w&&g.find(k=>k.slug===w)||null}function Oa(c){return c?C.some(w=>w.slug===c&&(w.status==="queued"||w.status==="running")):!1}function Aa(c,w){c&&d(k=>{const L={...k||{}};return w?L[c]=w:delete L[c],L})}function kp(c){c&&d(w=>{let k=!1;const L={};for(const[z,D]of Object.entries(w||{})){if(D===c){k=!0;continue}L[z]=D}return k?L:w})}v.useEffect(()=>{if(!U)return;const c=w=>{var k;(k=M.current)!=null&&k.contains(w.target)||ne(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[U]),v.useEffect(()=>{ne(!1)},[n,l]),v.useEffect(()=>{const c=n,w=l;return()=>{if(w==="chats"&&c){const k=typeof pn.current[c]=="number"?pn.current[c]:Ee.current?Ee.current.scrollTop:0;Ea(L=>{const z={...L,[c]:k};return window.electronAPI.updateSettings({scrollPositions:z}),z})}}},[n,l]),v.useEffect(()=>{const c=Ee.current;if(!c)return;const w=()=>{const{scrollTop:k,scrollHeight:L,clientHeight:z}=c,D=L-k-z<=ly;if(n){const H=Pa.current[n],O=typeof H=="number"&&kc.removeEventListener("scroll",w)},[n,pr]),v.useEffect(()=>{const c=n;c&&La[c]===!1&&Mn(w=>{if(!(c in w))return w;const k={...w};return delete k[c],k})},[n,La]),v.useLayoutEffect(()=>{if(l!=="chats"||!n)return;const c=Ee.current;if(!c)return;Bt.current=null;const w=()=>{if(Bt.current===n)return;const H=typeof pn.current[n]=="number"?pn.current[n]:void 0,O=typeof H=="number"?H:cl[n];if(typeof O=="number"){c.scrollTop=O,Bt.current=n;return}Fn.length>0&&(c.scrollTop=c.scrollHeight,Bt.current=n)};w();const k=requestAnimationFrame(w),L=()=>{Bt.current!==n&&requestAnimationFrame(w)},z=new MutationObserver(L);z.observe(c,{childList:!0,subtree:!0});const D=new ResizeObserver(L);return D.observe(c),()=>{cancelAnimationFrame(k),z.disconnect(),D.disconnect()}},[n,l,Fn.length,cl]),v.useEffect(()=>{if(l!=="chats"||!n||Bt.current===n)return;const c=typeof pn.current[n]=="number"?pn.current[n]:void 0;typeof(typeof c=="number"?c:cl[n])!="number"&&Fn.length>0&&requestAnimationFrame(()=>{const k=Ee.current;k&&(k.scrollTop=k.scrollHeight,Bt.current=n)})},[Fn.length,n,l,cl]);const Go=(c="smooth",w=null)=>{const k=Ee.current;if(!k)return;const L=w??Ne.current;Ne.current===L&&(k.scrollTo({top:k.scrollHeight,behavior:c}),pr(L,!1))},In=(c,w="auto",k=null)=>{const L=Ee.current;if(!L)return;const z=k??Ne.current;if(Ne.current!==z)return;const D=document.getElementById(c);if(D){const H=Math.max(0,D.offsetTop-ry);L.scrollTo({top:H,behavior:w})}},Ep=()=>{const c=Ne.current,w=ja[c];w&&(In(w,"smooth",c),Mn(k=>{const{[c]:L,...z}=k;return z}))};async function Da(){var z,D,H;if(Dt||!kt.trim()||!fe)return;let c=n,w=!1;if(c){const O=e.find(W=>W.session_id===c);w=O&&O.name==="New Chat"&&O.messages.length===0}else{const O=await Ua();await new Promise(W=>setTimeout(W,200)),c=O.session_id,w=!0}const k={role:"user",content:kt.trim(),id:`msg-${Date.now()}-${Math.random()}`};pp.current=!0,hp.current=c,pr(c,!1),Ne.current===c&&(Bt.current=Ne.current),Td.flushSync(()=>{t(O=>O.map(W=>W.session_id===c?{...W,messages:[...W.messages||[],k]}:W)),cn("")}),requestAnimationFrame(()=>Go("auto",c));const L=$a(c);try{let O=[];try{O=[...(((z=e.find(we=>we.session_id===c))==null?void 0:z.messages)||[]).slice(-8).map(we=>({role:we.role,content:we.content||""})),{role:"user",content:k.content}]}catch{}let W=k.content,_e=[];const he=[],qe=Ia(c);if((D=qe==null?void 0:qe.states)!=null&&D.is_indexed)try{const V=await Na(qe.slug,k.content,L.signal);V.contextBlock&&he.push(V.contextBlock),Array.isArray(V.sources)&&_e.push(...V.sources)}catch(V){if(Ut(V))throw V;console.warn("local library enrichment failed",V)}if(ul)try{const ue=await(await fetch(`${S}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:L.signal,body:JSON.stringify({prompt:k.content,model:fe,messages:O,history_limit:8,searx_url:Xe||null,engines:Array.isArray(Ze)?Ze:null})})).json();ue&&typeof ue.context_block=="string"&&ue.context_block.trim()&&he.push(ue.context_block.trim()),Array.isArray(ue==null?void 0:ue.sources)&&_e.push(...ue.sources)}catch(V){if(Ut(V))throw V;console.warn("web search enrichment failed",V)}if(_e=[...new Set(_e)],he.length>0&&(W=`${k.content} - -${he.join(` - -`)}`),Ce){const V=`msg-${Date.now()}-${Math.random()}`;let ue="";const we={role:"assistant",content:"",id:V,sources:_e};t(J=>J.map(re=>re.session_id===c?{...re,messages:[...re.messages||[],we]}:re));try{const J=await fetch(`${S}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:L.signal,body:JSON.stringify({session_id:c,model:fe,message:k.content,enriched_message:he.length>0?W:null,stream:!0,sources:_e||[]})});if(!J.ok)throw new Error(`HTTP ${J.status}`);const re=(H=J.body)==null?void 0:H.getReader();if(!re)throw new Error("Missing response body");const b=new TextDecoder;let Nt=!1;for(;;){const{value:Z,done:de}=await re.read();if(de){fn(c,V,ue),Ne.current===c?$n.current[c]?Mn(mt=>({...mt,[c]:V})):requestAnimationFrame(()=>In(V,"smooth",c)):(dn(mt=>({...mt,[c]:V})),Tn(mt=>[...new Set([...mt,c])]));break}const Ht=b.decode(Z,{stream:!0});ue+=Ht,fn(c,V,ue),Ne.current===c&&!$n.current[c]&&Go("auto",c),Ne.current!==c&&!Nt&&(dn(mt=>({...mt,[c]:V})),Nt=!0)}}catch(J){if(Ut(J)){fn(c,V,ue,{removeIfEmpty:!0});return}console.error("Failed to send message:",J),fn(c,V,"Error: "+Wo(J),{removeIfEmpty:!0});return}}else{const V=await fetch(`${S}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:L.signal,body:JSON.stringify({session_id:c,model:fe,message:k.content,enriched_message:he.length>0?W:null,stream:!1,sources:_e||[]})});if(!V.ok)throw new Error(`HTTP ${V.status}`);const ue=await V.json(),we=`msg-${Date.now()}`,J={role:"assistant",content:ue.reply,id:we,sources:_e};t(re=>re.map(b=>b.session_id===c?{...b,messages:[...b.messages||[],J]}:b)),we&&(Ne.current===c?$n.current[c]?Mn(re=>({...re,[c]:we})):requestAnimationFrame(()=>In(we,"smooth",c)):dn(re=>({...re,[c]:we})))}Ne.current!==c&&Tn(V=>[...new Set([...V,c])]),w&&fetch(`${S}/generate-title`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c,message:k.content,model:fe})}).then(V=>V.json()).then(V=>{const ue=V.title.replace(/[\s\S]*?<\/think(?:ing)?>/i,"").trim();t(we=>we.map(J=>J.session_id===c?{...J,name:ue}:J))})}catch(O){if(Ut(O)){Vo(L);return}console.error("Failed to send message:",O);const W={role:"assistant",content:"Error: "+Wo(O),id:`msg-${Date.now()}-${Math.random()}`};t(_e=>_e.map(he=>he.session_id===c?{...he,messages:[...he.messages,W]}:he))}finally{Vo(L)}}function Cp(){rp(c=>!c)}async function Ua(){var z;const c="sess-"+Math.random().toString(36).slice(2)+Date.now().toString(36),k=await(await fetch(`${S}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})})).json(),L={...k,messages:[]};return t(D=>[L,...D]),r(k.session_id),(z=Je.current)==null||z.focus(),k}function Np(c){r(c),Tn(k=>k.filter(L=>L!==c));const w=cp[c];w&&requestAnimationFrame(()=>{let k=12;const L=()=>{if(!Ee.current)return;let D=document.getElementById(w);if(!D){const H=e.find(O=>O.session_id===c);if(H&&Array.isArray(H.messages))for(let O=H.messages.length-1;O>=0;O--){const W=H.messages[O];if(W.role==="assistant"&&W.id){D=document.getElementById(W.id);break}}}D?(In(D.id,"smooth",c),dn(H=>{const{[c]:O,...W}=H;return W})):k-- >0&&requestAnimationFrame(L)};requestAnimationFrame(L)})}function _p(c,w){fetch(`${S}/sessions/${c}/rename`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:w})}).then(()=>{t(k=>k.map(L=>L.session_id===c?{...L,name:w}:L)),u(null)})}function Lp(c,w){const k=(w||"").trim(),L=g.find(z=>z.slug===c);if(!L){y(null);return}if(!k||k===L.name){y(null);return}fetch(`${S}/libraries/${c}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})}).then(()=>{x(z=>z.map(D=>D.slug===c?{...D,name:k}:D)),y(null)})}function Ba(c){fetch(`${S}/sessions/${c}`,{method:"DELETE"}).then(()=>{const w=e.filter(k=>k.session_id!==c);t(w),d(k=>{const L={...k||{}};return delete L[c],L}),n===c&&r(w.length>0?w[0].session_id:null)})}v.useEffect(()=>{const c=e.filter(w=>w.name==="New Chat"&&w.session_id!==n&&w.messages.length===0);c.length>0&&c.forEach(w=>{Ba(w.session_id)})},[n,e,S]);const Pp=c=>{var k;window.getSelection().toString().length>0||document.activeElement!==Je.current&&(c.target.closest(".msg")||(k=Je.current)==null||k.focus())};return m.jsxs("div",{className:"app",style:{gridTemplateColumns:`${gp}px 1fr`},children:[m.jsxs("div",{className:"sidebar",children:[m.jsxs("div",{className:"sidebar-header",children:[m.jsx("div",{className:`sidebar-tab ${l==="chats"?"active":""}`,onClick:()=>Yo("chats"),children:"Chats"}),m.jsx("div",{className:`sidebar-tab ${l==="dbs"?"active":""}`,onClick:()=>Yo("dbs"),children:"DBs"}),m.jsx("div",{className:`sidebar-tab ${l==="settings"?"active":""}`,onClick:()=>Yo("settings"),children:"Settings"})]}),m.jsxs("div",{className:"sidebar-content",children:[l==="chats"&&m.jsx("div",{className:"chat-list",children:e.map(c=>m.jsx("div",{className:`chat-item ${c.session_id===n?"active":""}`,onClick:()=>Sp(c.session_id),children:s===c.session_id?m.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>u(null),onKeyDown:w=>{w.key==="Enter"?_p(c.session_id,w.target.value):w.key==="Escape"&&u(null)},autoFocus:!0}):m.jsxs(m.Fragment,{children:[m.jsx("span",{children:c.name}),m.jsxs("div",{className:"chat-item-buttons",children:[lp.includes(c.session_id)&&m.jsx("div",{className:"unread-dot"}),m.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),u(c.session_id)},children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:m.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),m.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),Ba(c.session_id)},children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[m.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},c.session_id))}),l==="dbs"&&m.jsx("div",{className:"db-list",children:g.length===0?m.jsx("div",{className:"empty-list-message",children:"No databases yet."}):g.map(c=>m.jsx("div",{className:`chat-item ${c.slug===P?"active":""}`,onClick:()=>h(c.slug),children:p===c.slug?m.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>y(null),onKeyDown:w=>{w.key==="Enter"?Lp(c.slug,w.target.value):w.key==="Escape"&&y(null)},autoFocus:!0}):m.jsxs(m.Fragment,{children:[m.jsx("span",{children:c.name}),m.jsxs("div",{className:"chat-item-buttons",children:[Ct===c.slug&&m.jsx("div",{className:"db-active-badge",children:"Chat"}),Oa(c.slug)&&m.jsx("div",{className:"db-active-badge",children:"Syncing"}),m.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),y(c.slug)},children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:m.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})})]})]})},c.slug))}),l==="settings"&&m.jsxs("div",{className:"settings-list",children:[m.jsx("div",{className:`settings-item ${i==="General"?"active":""}`,onClick:()=>a("General"),children:"General"}),m.jsx("div",{className:`settings-item ${i==="Interface"?"active":""}`,onClick:()=>a("Interface"),children:"Interface"}),m.jsx("div",{className:`settings-item ${i==="Websearch"?"active":""}`,onClick:()=>a("Websearch"),children:"Websearch"})]})]}),l!=="settings"&&m.jsxs("div",{className:"sidebar-footer",children:[l==="chats"&&m.jsx("button",{className:"button new-chat-button",onClick:Ua,children:"New Chat"}),l==="dbs"&&(E?m.jsxs("div",{className:"new-db-form",children:[m.jsx("input",{type:"text",className:"rename-input",value:_,onChange:c=>R(c.target.value),onKeyDown:c=>{c.key==="Enter"?za():c.key==="Escape"&&(j(!1),R(""),B(""))},placeholder:"Database name",autoFocus:!0}),F&&m.jsx("div",{className:"form-error",children:F}),m.jsxs("div",{className:"new-db-actions",children:[m.jsx("button",{className:"button new-db-button",onClick:()=>za(),children:"Create"}),m.jsx("button",{className:"button ghost",onClick:()=>{j(!1),R(""),B("")},children:"Cancel"})]})]}):m.jsx("button",{className:"button new-db-button",onClick:()=>{j(!0),B("")},children:"New Database"}))]}),m.jsx("div",{className:"resizer",onMouseDown:yp})]}),m.jsxs("div",{className:"main-content",children:[l==="chats"&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"header",children:[m.jsxs("strong",{children:["Chat - ",((Ha=e.find(c=>c.session_id===n))==null?void 0:Ha.name)||"New Chat"]}),it&&m.jsx("span",{className:"header-subtle",children:`DB: ${it.name}${Jo}`})]}),m.jsx("div",{className:"chat",ref:Ee,onClick:Pp,children:Fn.map((c,w)=>{const k=c.role==="user"&&op===w;return m.jsx("div",{id:c.id,className:"msg "+(c.role==="user"?"user":"assistant")+(k?" editing":""),children:c.role==="assistant"?m.jsxs("div",{className:"assistant-message-wrapper",children:[m.jsx(ny,{content:c.content,streamOutput:Ce,sources:c.sources}),!Dt&&m.jsxs("div",{className:"message-options-bar assistant-options",children:[m.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ca(c),children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),m.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),m.jsx("button",{className:"icon-button",title:"Regenerate response",onClick:()=>_a(w),children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})})})]})]}):m.jsxs("div",{className:"user-message-wrapper",children:[k?m.jsxs("div",{className:"msg-content msg-content--user editing",children:[m.jsx("div",{className:"user-edit-shadow","aria-hidden":"true",children:Ho}),m.jsx(ac,{className:"edit-message-input edit-overlay",value:Ho,onChange:L=>fl(L.target.value),onBlur:dl,onKeyDown:L=>{L.key==="Escape"&&(L.preventDefault(),dl()),L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),ap(w))},autoFocus:!0,minRows:1})]}):(()=>{const L=c.content||"",z=L.split(/\r\n|\r|\n/),D=z.length>30,H=Ta(c,w,n),O=D?fp[H]??!0:!1,W=O?z.slice(0,30).join(` -`)+` -…`:L;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"msg-content msg-content--user",children:W}),D&&m.jsx("button",{className:"user-msg-expand",onClick:()=>dp(H),"aria-expanded":O?"false":"true",children:O?"Show entire message":"Collapse"})]})})(),!Dt&&!k&&m.jsxs("div",{className:"message-options-bar user-options",children:[m.jsx("button",{className:"icon-button",title:"Edit message",onClick:()=>sp(w,c.content),children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M12 20h9"}),m.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),m.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ca(c),children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),m.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},c.id||w)})},n),ja[n]&&m.jsxs("button",{className:"new-msg-tip",onClick:Ep,title:"Jump to the new message","aria-label":"Jump to the new message",children:["New message",m.jsx("span",{style:{marginLeft:6},children:"↓"})]}),m.jsx("div",{className:"footer",children:m.jsxs("div",{className:"footer-content-wrapper",children:[m.jsx(ac,{ref:Je,className:"input",value:kt,onChange:c=>cn(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),Da())},placeholder:"Ask any question...",maxRows:13}),m.jsxs("div",{className:"footer-tool-group",ref:M,children:[m.jsx("button",{type:"button",className:"db-picker-toggle"+(it?" active":""),onClick:()=>{n&&ne(c=>!c)},title:it?`Database: ${it.name}${Jo}`:"Select database for this chat","aria-haspopup":"menu","aria-expanded":U,disabled:!n,children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("ellipse",{cx:"12",cy:"5",rx:"8",ry:"3"}),m.jsx("path",{d:"M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5"}),m.jsx("path",{d:"M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"})]})}),U&&m.jsxs("div",{className:"db-picker-menu",role:"menu",children:[m.jsxs("button",{type:"button",className:"db-picker-option"+(Ct?"":" selected"),onClick:()=>{Aa(n,null),ne(!1)},children:[m.jsx("span",{children:"No database"}),!Ct&&m.jsx("span",{className:"db-picker-status",children:"Selected"})]}),g.length===0?m.jsx("div",{className:"db-picker-empty",children:"No databases yet."}):g.map(c=>{var z,D,H;const w=Ct===c.slug,k=Oa(c.slug),L=(z=c.files)!=null&&z.length?(D=c.states)!=null&&D.is_indexed?"Ready":k?"Syncing":"Needs sync":"Empty";return m.jsxs("button",{type:"button",className:"db-picker-option"+(w?" selected":""),disabled:!((H=c.files)!=null&&H.length),onClick:()=>{Aa(n,c.slug),ne(!1)},children:[m.jsx("span",{children:c.name}),m.jsx("span",{className:"db-picker-status",children:w?"Selected":L})]},c.slug)})]})]}),m.jsx("button",{type:"button",className:"websearch-toggle"+(ul?" active":""),onClick:Cp,title:"Toggle web search","aria-pressed":ul,children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("circle",{cx:"12",cy:"12",r:"10"}),m.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),m.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}),m.jsx("button",{className:"button",onClick:Dt?mp:Da,title:Dt?"Cancel generation":"Send","aria-label":Dt?"Cancel generation":"Send",children:Dt?m.jsx("div",{className:"spinner"}):"Send"})]})})]}),l==="dbs"&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"header",children:[m.jsx("strong",{children:(ml==null?void 0:ml.name)||"Databases"}),it&&m.jsx("span",{className:"header-subtle",children:`Current chat DB: ${it.name}${Jo}`})]}),m.jsx(qv,{apiBase:S,library:ml,jobs:C,onRefresh:async()=>{await hl(),await Ko()},onDeleted:c=>{if(P===c){const w=g.find(k=>k.slug!==c);h((w==null?void 0:w.slug)||null)}kp(c)}})]}),l==="settings"&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"header",children:m.jsxs("strong",{children:[i," Settings"]})}),i==="General"&&m.jsx(Kv,{onModelChange:Ye,streamOutput:Ce,onStreamOutputChange:Ge}),i==="Interface"&&m.jsx(Xv,{}),i==="Websearch"&&m.jsx(ey,{searxUrl:Xe,setSearxUrl:Et,engines:Ze,setEngines:np})]})]})]})}function sy(){return v.useEffect(()=>{window.electronAPI.getSettings().then(e=>{el(e.colorScheme||"Default")})},[]),m.jsx($e.StrictMode,{children:m.jsx(gv,{children:m.jsx(Kg,{children:m.jsx(Vd,{path:"/",element:m.jsx(iy,{})})})})})}const ay=$d(document.getElementById("root"));ay.render(m.jsx(sy,{})); diff --git a/dist/assets/index-z8MB-_Ve.js b/dist/assets/index-z8MB-_Ve.js new file mode 100644 index 0000000..459e537 --- /dev/null +++ b/dist/assets/index-z8MB-_Ve.js @@ -0,0 +1,73 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function $p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yc={exports:{}},xo={},wc={exports:{}},b={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var tl=Symbol.for("react.element"),Mp=Symbol.for("react.portal"),zp=Symbol.for("react.fragment"),Fp=Symbol.for("react.strict_mode"),Ip=Symbol.for("react.profiler"),Op=Symbol.for("react.provider"),Ap=Symbol.for("react.context"),Dp=Symbol.for("react.forward_ref"),Up=Symbol.for("react.suspense"),Bp=Symbol.for("react.memo"),Hp=Symbol.for("react.lazy"),Wa=Symbol.iterator;function Wp(e){return e===null||typeof e!="object"?null:(e=Wa&&e[Wa]||e["@@iterator"],typeof e=="function"?e:null)}var Sc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xc=Object.assign,kc={};function ur(e,t,n){this.props=e,this.context=t,this.refs=kc,this.updater=n||Sc}ur.prototype.isReactComponent={};ur.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")};ur.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ec(){}Ec.prototype=ur.prototype;function Es(e,t,n){this.props=e,this.context=t,this.refs=kc,this.updater=n||Sc}var Cs=Es.prototype=new Ec;Cs.constructor=Es;xc(Cs,ur.prototype);Cs.isPureReactComponent=!0;var Va=Array.isArray,Cc=Object.prototype.hasOwnProperty,Ns={current:null},Nc={key:!0,ref:!0,__self:!0,__source:!0};function _c(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Cc.call(t,r)&&!Nc.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,pe=$[Z];if(0>>1;Zl(Et,W))Ctl(Je,Et)?($[Z]=Je,$[Ct]=W,Z=Ct):($[Z]=Et,$[pt]=W,Z=pt);else if(Ctl(Je,W))$[Z]=Je,$[Ct]=W,Z=Ct;else break e}}return z}function l($,z){var W=$.sortIndex-z.sortIndex;return W!==0?W:$.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var s=[],u=[],p=1,y=null,g=3,S=!1,k=!1,C=!1,L=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d($){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=$)r(u),z.sortIndex=z.expirationTime,t(s,z);else break;z=n(u)}}function E($){if(C=!1,d($),!k)if(n(s)!==null)k=!0,O(j);else{var z=n(u);z!==null&&Y(E,z.startTime-$)}}function j($,z){k=!1,C&&(C=!1,h(F),F=-1),S=!0;var W=g;try{for(d(z),y=n(s);y!==null&&(!(y.expirationTime>z)||$&&!le());){var Z=y.callback;if(typeof Z=="function"){y.callback=null,g=y.priorityLevel;var pe=Z(y.expirationTime<=z);z=e.unstable_now(),typeof pe=="function"?y.callback=pe:y===n(s)&&r(s),d(z)}else r(s);y=n(s)}if(y!==null)var kt=!0;else{var pt=n(u);pt!==null&&Y(E,pt.startTime-z),kt=!1}return kt}finally{y=null,g=W,S=!1}}var N=!1,P=null,F=-1,B=5,U=-1;function le(){return!(e.unstable_now()-U$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function($){switch(g){case 1:case 2:case 3:var z=3;break;default:z=g}var W=g;g=z;try{return $()}finally{g=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,z){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var W=g;g=$;try{return z()}finally{g=W}},e.unstable_scheduleCallback=function($,z,W){var Z=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0Z?($.sortIndex=W,t(u,$),n(s)===null&&$===n(u)&&(C?(h(F),F=-1):C=!0,Y(E,W-Z))):($.sortIndex=pe,t(s,$),k||S||(k=!0,O(j))),$},e.unstable_shouldYield=le,e.unstable_wrapCallback=function($){var z=g;return function(){var W=g;g=z;try{return $.apply(this,arguments)}finally{g=W}}}})(Tc);Rc.exports=Tc;var eh=Rc.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var th=v,Ke=eh;function R(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Li=Object.prototype.hasOwnProperty,nh=/^[: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]*$/,Ka={},ba={};function rh(e){return Li.call(ba,e)?!0:Li.call(Ka,e)?!1:nh.test(e)?ba[e]=!0:(Ka[e]=!0,!1)}function lh(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 oh(e,t,n,r){if(t===null||typeof t>"u"||lh(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 Oe(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var Ne={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ne[e]=new Oe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ne[t]=new Oe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ne[e]=new Oe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ne[e]=new Oe(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){Ne[e]=new Oe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ne[e]=new Oe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ne[e]=new Oe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ne[e]=new Oe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ne[e]=new Oe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ls=/[\-:]([a-z])/g;function Ps(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(Ls,Ps);Ne[t]=new Oe(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(Ls,Ps);Ne[t]=new Oe(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(Ls,Ps);Ne[t]=new Oe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ne[e]=new Oe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ne.xlinkHref=new Oe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ne[e]=new Oe(e,1,!1,e.toLowerCase(),null,!0,!0)});function js(e,t,n,r){var l=Ne.hasOwnProperty(t)?Ne[t]:null;(l!==null?l.type!==0:r||!(2a||l[i]!==o[a]){var s=` +`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=a);break}}}finally{ei=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Er(e):""}function ih(e){switch(e.tag){case 5:return Er(e.type);case 16:return Er("Lazy");case 13:return Er("Suspense");case 19:return Er("SuspenseList");case 0:case 2:case 15:return e=ti(e.type,!1),e;case 11:return e=ti(e.type.render,!1),e;case 1:return e=ti(e.type,!0),e;default:return""}}function Ti(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 Dn:return"Fragment";case An:return"Portal";case Pi:return"Profiler";case Rs:return"StrictMode";case ji:return"Suspense";case Ri:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zc:return(e.displayName||"Context")+".Consumer";case Mc:return(e._context.displayName||"Context")+".Provider";case Ts:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $s:return t=e.displayName||null,t!==null?t:Ti(e.type)||"Memo";case Qt:t=e._payload,e=e._init;try{return Ti(e(t))}catch{}}return null}function sh(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 Ti(t);case 8:return t===Rs?"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 on(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ic(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ah(e){var t=Ic(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yl(e){e._valueTracker||(e._valueTracker=ah(e))}function Oc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ic(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Jl(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 $i(e,t){var n=t.checked;return ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ja(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=on(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 Ac(e,t){t=t.checked,t!=null&&js(e,"checked",t,!1)}function Mi(e,t){Ac(e,t);var n=on(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")?zi(e,t.type,n):t.hasOwnProperty("defaultValue")&&zi(e,t.type,on(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ga(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 zi(e,t,n){(t!=="number"||Jl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cr=Array.isArray;function Gn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Or(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Lr={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},uh=["Webkit","ms","Moz","O"];Object.keys(Lr).forEach(function(e){uh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Lr[t]=Lr[e]})});function Hc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Lr.hasOwnProperty(e)&&Lr[e]?(""+t).trim():t+"px"}function Wc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Hc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var ch=ue({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 Oi(e,t){if(t){if(ch[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(R(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(R(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(R(61))}if(t.style!=null&&typeof t.style!="object")throw Error(R(62))}}function Ai(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 Di=null;function Ms(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ui=null,Xn=null,Zn=null;function qa(e){if(e=ll(e)){if(typeof Ui!="function")throw Error(R(280));var t=e.stateNode;t&&(t=_o(t),Ui(e.stateNode,e.type,t))}}function Vc(e){Xn?Zn?Zn.push(e):Zn=[e]:Xn=e}function Qc(){if(Xn){var e=Xn,t=Zn;if(Zn=Xn=null,qa(e),t)for(e=0;e>>=0,e===0?32:31-(xh(e)/kh|0)|0}var Sl=64,xl=4194304;function Nr(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 ql(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~l;a!==0?r=Nr(a):(o&=i,o!==0&&(r=Nr(o)))}else i=n&~l,i!==0?r=Nr(i):o!==0&&(r=Nr(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function nl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ut(t),e[t]=n}function _h(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=jr),au=" ",uu=!1;function df(e,t){switch(e){case"keyup":return em.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Un=!1;function nm(e,t){switch(e){case"compositionend":return pf(t);case"keypress":return t.which!==32?null:(uu=!0,au);case"textInput":return e=t.data,e===au&&uu?null:e;default:return null}}function rm(e,t){if(Un)return e==="compositionend"||!Bs&&df(e,t)?(e=cf(),Ol=As=Jt=null,Un=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=pu(n)}}function vf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yf(){for(var e=window,t=Jl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Jl(e.document)}return t}function Hs(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 dm(e){var t=yf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&vf(n.ownerDocument.documentElement,n)){if(r!==null&&Hs(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=hu(n,o);var i=hu(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Bn=null,Ki=null,Tr=null,bi=!1;function mu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bi||Bn==null||Bn!==Jl(r)||(r=Bn,"selectionStart"in r&&Hs(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}),Tr&&Wr(Tr,r)||(Tr=r,r=no(Ki,"onSelect"),0Vn||(e.current=qi[Vn],qi[Vn]=null,Vn--)}function q(e,t){Vn++,qi[Vn]=e.current,e.current=t}var sn={},Te=un(sn),Ue=un(!1),kn=sn;function rr(e,t){var n=e.type.contextTypes;if(!n)return sn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Be(e){return e=e.childContextTypes,e!=null}function lo(){ne(Ue),ne(Te)}function ku(e,t,n){if(Te.current!==sn)throw Error(R(168));q(Te,t),q(Ue,n)}function Lf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(R(108,sh(e)||"Unknown",l));return ue({},n,r)}function oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sn,kn=Te.current,q(Te,e),q(Ue,Ue.current),!0}function Eu(e,t,n){var r=e.stateNode;if(!r)throw Error(R(169));n?(e=Lf(e,t,kn),r.__reactInternalMemoizedMergedChildContext=e,ne(Ue),ne(Te),q(Te,e)):ne(Ue),q(Ue,n)}var Pt=null,Lo=!1,mi=!1;function Pf(e){Pt===null?Pt=[e]:Pt.push(e)}function Cm(e){Lo=!0,Pf(e)}function cn(){if(!mi&&Pt!==null){mi=!0;var e=0,t=X;try{var n=Pt;for(X=1;e>=i,l-=i,jt=1<<32-ut(t)+l|n<F?(B=P,P=null):B=P.sibling;var U=g(h,P,d[F],E);if(U===null){P===null&&(P=B);break}e&&P&&U.alternate===null&&t(h,P),f=o(U,f,F),N===null?j=U:N.sibling=U,N=U,P=B}if(F===d.length)return n(h,P),re&&mn(h,F),j;if(P===null){for(;FF?(B=P,P=null):B=P.sibling;var le=g(h,P,U.value,E);if(le===null){P===null&&(P=B);break}e&&P&&le.alternate===null&&t(h,P),f=o(le,f,F),N===null?j=le:N.sibling=le,N=le,P=B}if(U.done)return n(h,P),re&&mn(h,F),j;if(P===null){for(;!U.done;F++,U=d.next())U=y(h,U.value,E),U!==null&&(f=o(U,f,F),N===null?j=U:N.sibling=U,N=U);return re&&mn(h,F),j}for(P=r(h,P);!U.done;F++,U=d.next())U=S(P,h,F,U.value,E),U!==null&&(e&&U.alternate!==null&&P.delete(U.key===null?F:U.key),f=o(U,f,F),N===null?j=U:N.sibling=U,N=U);return e&&P.forEach(function(xe){return t(h,xe)}),re&&mn(h,F),j}function L(h,f,d,E){if(typeof d=="object"&&d!==null&&d.type===Dn&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case vl:e:{for(var j=d.key,N=f;N!==null;){if(N.key===j){if(j=d.type,j===Dn){if(N.tag===7){n(h,N.sibling),f=l(N,d.props.children),f.return=h,h=f;break e}}else if(N.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Qt&&_u(j)===N.type){n(h,N.sibling),f=l(N,d.props),f.ref=wr(h,N,d),f.return=h,h=f;break e}n(h,N);break}else t(h,N);N=N.sibling}d.type===Dn?(f=xn(d.props.children,h.mode,E,d.key),f.return=h,h=f):(E=Ql(d.type,d.key,d.props,null,h.mode,E),E.ref=wr(h,f,d),E.return=h,h=E)}return i(h);case An:e:{for(N=d.key;f!==null;){if(f.key===N)if(f.tag===4&&f.stateNode.containerInfo===d.containerInfo&&f.stateNode.implementation===d.implementation){n(h,f.sibling),f=l(f,d.children||[]),f.return=h,h=f;break e}else{n(h,f);break}else t(h,f);f=f.sibling}f=Ei(d,h.mode,E),f.return=h,h=f}return i(h);case Qt:return N=d._init,L(h,f,N(d._payload),E)}if(Cr(d))return k(h,f,d,E);if(hr(d))return C(h,f,d,E);Pl(h,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,f!==null&&f.tag===6?(n(h,f.sibling),f=l(f,d),f.return=h,h=f):(n(h,f),f=ki(d,h.mode,E),f.return=h,h=f),i(h)):n(h,f)}return L}var or=$f(!0),Mf=$f(!1),ao=un(null),uo=null,bn=null,Ks=null;function bs(){Ks=bn=uo=null}function Ys(e){var t=ao.current;ne(ao),e._currentValue=t}function ns(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 er(e,t){uo=e,Ks=bn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(De=!0),e.firstContext=null)}function tt(e){var t=e._currentValue;if(Ks!==e)if(e={context:e,memoizedValue:t,next:null},bn===null){if(uo===null)throw Error(R(308));bn=e,uo.dependencies={lanes:0,firstContext:e}}else bn=bn.next=e;return t}var yn=null;function Js(e){yn===null?yn=[e]:yn.push(e)}function zf(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Js(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ft(e,r)}function Ft(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 Kt=!1;function Gs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ff(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 Tt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function tn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ft(e,n)}return l=r.interleaved,l===null?(t.next=t,Js(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ft(e,n)}function Dl(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,Fs(e,n)}}function Lu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function co(e,t,n,r){var l=e.updateQueue;Kt=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var s=a,u=s.next;s.next=null,i===null?o=u:i.next=u,i=s;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==i&&(a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=s))}if(o!==null){var y=l.baseState;i=0,p=u=s=null,a=o;do{var g=a.lane,S=a.eventTime;if((r&g)===g){p!==null&&(p=p.next={eventTime:S,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var k=e,C=a;switch(g=t,S=n,C.tag){case 1:if(k=C.payload,typeof k=="function"){y=k.call(S,y,g);break e}y=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=C.payload,g=typeof k=="function"?k.call(S,y,g):k,g==null)break e;y=ue({},y,g);break e;case 2:Kt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,g=l.effects,g===null?l.effects=[a]:g.push(a))}else S={eventTime:S,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(u=p=S,s=y):p=p.next=S,i|=g;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;g=a,a=g.next,g.next=null,l.lastBaseUpdate=g,l.shared.pending=null}}while(!0);if(p===null&&(s=y),l.baseState=s,l.firstBaseUpdate=u,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Nn|=i,e.lanes=i,e.memoizedState=y}}function Pu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vi.transition;vi.transition={};try{e(!1),t()}finally{X=n,vi.transition=r}}function Zf(){return nt().memoizedState}function Pm(e,t,n){var r=rn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},qf(e))ed(t,n);else if(n=zf(e,t,n,r),n!==null){var l=Fe();ct(n,e,r,l),td(n,t,r)}}function jm(e,t,n){var r=rn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(qf(e))ed(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,n);if(l.hasEagerState=!0,l.eagerState=a,ft(a,i)){var s=t.interleaved;s===null?(l.next=l,Js(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=zf(e,t,l,r),n!==null&&(l=Fe(),ct(n,e,r,l),td(n,t,r))}}function qf(e){var t=e.alternate;return e===se||t!==null&&t===se}function ed(e,t){$r=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function td(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fs(e,n)}}var ho={readContext:tt,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useInsertionEffect:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useMutableSource:Pe,useSyncExternalStore:Pe,useId:Pe,unstable_isNewReconciler:!1},Rm={readContext:tt,useCallback:function(e,t){return gt().memoizedState=[e,t===void 0?null:t],e},useContext:tt,useEffect:Ru,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bl(4194308,4,bf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bl(4,2,e,t)},useMemo:function(e,t){var n=gt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=gt();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=Pm.bind(null,se,e),[r.memoizedState,e]},useRef:function(e){var t=gt();return e={current:e},t.memoizedState=e},useState:ju,useDebugValue:la,useDeferredValue:function(e){return gt().memoizedState=e},useTransition:function(){var e=ju(!1),t=e[0];return e=Lm.bind(null,e[1]),gt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=se,l=gt();if(re){if(n===void 0)throw Error(R(407));n=n()}else{if(n=t(),Se===null)throw Error(R(349));Cn&30||Df(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Ru(Bf.bind(null,r,o,e),[e]),r.flags|=2048,Xr(9,Uf.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=gt(),t=Se.identifierPrefix;if(re){var n=Rt,r=jt;n=(r&~(1<<32-ut(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Jr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[vt]=t,e[Kr]=r,fd(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ai(n,r),n){case"dialog":te("cancel",e),te("close",e),l=r;break;case"iframe":case"object":case"embed":te("load",e),l=r;break;case"video":case"audio":for(l=0;l<_r.length;l++)te(_r[l],e);l=r;break;case"source":te("error",e),l=r;break;case"img":case"image":case"link":te("error",e),te("load",e),l=r;break;case"details":te("toggle",e),l=r;break;case"input":Ja(e,r),l=$i(e,r),te("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=ue({},r,{value:void 0}),te("invalid",e);break;case"textarea":Xa(e,r),l=Fi(e,r),te("invalid",e);break;default:l=r}Oi(n,l),a=l;for(o in a)if(a.hasOwnProperty(o)){var s=a[o];o==="style"?Wc(e,s):o==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&Bc(e,s)):o==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Or(e,s):typeof s=="number"&&Or(e,""+s):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Ir.hasOwnProperty(o)?s!=null&&o==="onScroll"&&te("scroll",e):s!=null&&js(e,o,s,i))}switch(n){case"input":yl(e),Ga(e,r,!1);break;case"textarea":yl(e),Za(e);break;case"option":r.value!=null&&e.setAttribute("value",""+on(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Gn(e,!!r.multiple,o,!1):r.defaultValue!=null&&Gn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=ro)}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 je(t),null;case 6:if(e&&t.stateNode!=null)pd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(R(166));if(n=wn(Yr.current),wn(wt.current),Ll(t)){if(r=t.stateNode,n=t.memoizedProps,r[vt]=t,(o=r.nodeValue!==n)&&(e=Qe,e!==null))switch(e.tag){case 3:_l(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&_l(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[vt]=t,t.stateNode=r}return je(t),null;case 13:if(ne(ie),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(re&&Ve!==null&&t.mode&1&&!(t.flags&128))Tf(),lr(),t.flags|=98560,o=!1;else if(o=Ll(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(R(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(R(317));o[vt]=t}else lr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;je(t),o=!1}else at!==null&&(ys(at),at=null),o=!0;if(!o)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||ie.current&1?ye===0&&(ye=3):fa())),t.updateQueue!==null&&(t.flags|=4),je(t),null);case 4:return ir(),cs(e,t),e===null&&Vr(t.stateNode.containerInfo),je(t),null;case 10:return Ys(t.type._context),je(t),null;case 17:return Be(t.type)&&lo(),je(t),null;case 19:if(ne(ie),o=t.memoizedState,o===null)return je(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Sr(o,!1);else{if(ye!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=fo(e),i!==null){for(t.flags|=128,Sr(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return q(ie,ie.current&1|2),t.child}e=e.sibling}o.tail!==null&&de()>ar&&(t.flags|=128,r=!0,Sr(o,!1),t.lanes=4194304)}else{if(!r)if(e=fo(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Sr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!re)return je(t),null}else 2*de()-o.renderingStartTime>ar&&n!==1073741824&&(t.flags|=128,r=!0,Sr(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=de(),t.sibling=null,n=ie.current,q(ie,r?n&1|2:n&1),t):(je(t),null);case 22:case 23:return ca(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?We&1073741824&&(je(t),t.subtreeFlags&6&&(t.flags|=8192)):je(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function Am(e,t){switch(Vs(t),t.tag){case 1:return Be(t.type)&&lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ir(),ne(Ue),ne(Te),qs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zs(t),null;case 13:if(ne(ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));lr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ne(ie),null;case 4:return ir(),null;case 10:return Ys(t.type._context),null;case 22:case 23:return ca(),null;case 24:return null;default:return null}}var Rl=!1,Re=!1,Dm=typeof WeakSet=="function"?WeakSet:Set,I=null;function Yn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ce(e,t,r)}else n.current=null}function fs(e,t,n){try{n()}catch(r){ce(e,t,r)}}var Bu=!1;function Um(e,t){if(Yi=eo,e=yf(),Hs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,a=-1,s=-1,u=0,p=0,y=e,g=null;t:for(;;){for(var S;y!==n||l!==0&&y.nodeType!==3||(a=i+l),y!==o||r!==0&&y.nodeType!==3||(s=i+r),y.nodeType===3&&(i+=y.nodeValue.length),(S=y.firstChild)!==null;)g=y,y=S;for(;;){if(y===e)break t;if(g===n&&++u===l&&(a=i),g===o&&++p===r&&(s=i),(S=y.nextSibling)!==null)break;y=g,g=y.parentNode}y=S}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ji={focusedElem:e,selectionRange:n},eo=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var k=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var C=k.memoizedProps,L=k.memoizedState,h=t.stateNode,f=h.getSnapshotBeforeUpdate(t.elementType===t.type?C:it(t.type,C),L);h.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(E){ce(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return k=Bu,Bu=!1,k}function Mr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&fs(t,n,o)}l=l.next}while(l!==r)}}function Ro(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 ds(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 hd(e){var t=e.alternate;t!==null&&(e.alternate=null,hd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vt],delete t[Kr],delete t[Zi],delete t[km],delete t[Em])),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 md(e){return e.tag===5||e.tag===3||e.tag===4}function Hu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||md(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 ps(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=ro));else if(r!==4&&(e=e.child,e!==null))for(ps(e,t,n),e=e.sibling;e!==null;)ps(e,t,n),e=e.sibling}function hs(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(hs(e,t,n),e=e.sibling;e!==null;)hs(e,t,n),e=e.sibling}var Ee=null,st=!1;function Vt(e,t,n){for(n=n.child;n!==null;)gd(e,t,n),n=n.sibling}function gd(e,t,n){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(ko,n)}catch{}switch(n.tag){case 5:Re||Yn(n,t);case 6:var r=Ee,l=st;Ee=null,Vt(e,t,n),Ee=r,st=l,Ee!==null&&(st?(e=Ee,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ee.removeChild(n.stateNode));break;case 18:Ee!==null&&(st?(e=Ee,n=n.stateNode,e.nodeType===8?hi(e.parentNode,n):e.nodeType===1&&hi(e,n),Br(e)):hi(Ee,n.stateNode));break;case 4:r=Ee,l=st,Ee=n.stateNode.containerInfo,st=!0,Vt(e,t,n),Ee=r,st=l;break;case 0:case 11:case 14:case 15:if(!Re&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&fs(n,t,i),l=l.next}while(l!==r)}Vt(e,t,n);break;case 1:if(!Re&&(Yn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ce(n,t,a)}Vt(e,t,n);break;case 21:Vt(e,t,n);break;case 22:n.mode&1?(Re=(r=Re)||n.memoizedState!==null,Vt(e,t,n),Re=r):Vt(e,t,n);break;default:Vt(e,t,n)}}function Wu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Dm),t.forEach(function(r){var l=Jm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ot(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=de()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Hm(r/1960))-r,10e?16:e,Gt===null)var r=!1;else{if(e=Gt,Gt=null,vo=0,J&6)throw Error(R(331));var l=J;for(J|=4,I=e.current;I!==null;){var o=I,i=o.child;if(I.flags&16){var a=o.deletions;if(a!==null){for(var s=0;sde()-aa?Sn(e,0):sa|=n),He(e,t)}function Cd(e,t){t===0&&(e.mode&1?(t=xl,xl<<=1,!(xl&130023424)&&(xl=4194304)):t=1);var n=Fe();e=Ft(e,t),e!==null&&(nl(e,t,n),He(e,n))}function Ym(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cd(e,n)}function Jm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(R(314))}r!==null&&r.delete(t),Cd(e,n)}var Nd;Nd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ue.current)De=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return De=!1,Im(e,t,n);De=!!(e.flags&131072)}else De=!1,re&&t.flags&1048576&&jf(t,so,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hl(e,t),e=t.pendingProps;var l=rr(t,Te.current);er(t,n),l=ta(null,t,r,e,l,n);var o=na();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Be(r)?(o=!0,oo(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Gs(t),l.updater=jo,t.stateNode=l,l._reactInternals=t,ls(t,r,e,n),t=ss(null,t,r,!0,o,n)):(t.tag=0,re&&o&&Ws(t),ze(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Xm(r),e=it(r,e),l){case 0:t=is(null,t,r,e,n);break e;case 1:t=Au(null,t,r,e,n);break e;case 11:t=Iu(null,t,r,e,n);break e;case 14:t=Ou(null,t,r,it(r.type,e),n);break e}throw Error(R(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),is(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),Au(e,t,r,l,n);case 3:e:{if(ad(t),e===null)throw Error(R(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Ff(e,t),co(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=sr(Error(R(423)),t),t=Du(e,t,r,n,l);break e}else if(r!==l){l=sr(Error(R(424)),t),t=Du(e,t,r,n,l);break e}else for(Ve=en(t.stateNode.containerInfo.firstChild),Qe=t,re=!0,at=null,n=Mf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lr(),r===l){t=It(e,t,n);break e}ze(e,t,r,n)}t=t.child}return t;case 5:return If(t),e===null&&ts(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,Gi(r,l)?i=null:o!==null&&Gi(r,o)&&(t.flags|=32),sd(e,t),ze(e,t,i,n),t.child;case 6:return e===null&&ts(t),null;case 13:return ud(e,t,n);case 4:return Xs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=or(t,null,r,n):ze(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),Iu(e,t,r,l,n);case 7:return ze(e,t,t.pendingProps,n),t.child;case 8:return ze(e,t,t.pendingProps.children,n),t.child;case 12:return ze(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,q(ao,r._currentValue),r._currentValue=i,o!==null)if(ft(o.value,i)){if(o.children===l.children&&!Ue.current){t=It(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=Tt(-1,n&-n),s.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?s.next=s:(s.next=p.next,p.next=s),u.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),ns(o.return,n,t),a.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(R(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),ns(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}ze(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,er(t,n),l=tt(l),r=r(l),t.flags|=1,ze(e,t,r,n),t.child;case 14:return r=t.type,l=it(r,t.pendingProps),l=it(r.type,l),Ou(e,t,r,l,n);case 15:return od(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),Hl(e,t),t.tag=1,Be(r)?(e=!0,oo(t)):e=!1,er(t,n),nd(t,r,l),ls(t,r,l,n),ss(null,t,r,!0,e,n);case 19:return cd(e,t,n);case 22:return id(e,t,n)}throw Error(R(156,t.tag))};function _d(e,t){return Zc(e,t)}function Gm(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 qe(e,t,n,r){return new Gm(e,t,n,r)}function da(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xm(e){if(typeof e=="function")return da(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ts)return 11;if(e===$s)return 14}return 2}function ln(e,t){var n=e.alternate;return n===null?(n=qe(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 Ql(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")da(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Dn:return xn(n.children,l,o,t);case Rs:i=8,l|=8;break;case Pi:return e=qe(12,n,t,l|2),e.elementType=Pi,e.lanes=o,e;case ji:return e=qe(13,n,t,l),e.elementType=ji,e.lanes=o,e;case Ri:return e=qe(19,n,t,l),e.elementType=Ri,e.lanes=o,e;case Fc:return $o(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mc:i=10;break e;case zc:i=9;break e;case Ts:i=11;break e;case $s:i=14;break e;case Qt:i=16,r=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=qe(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function xn(e,t,n,r){return e=qe(7,e,r,t),e.lanes=n,e}function $o(e,t,n,r){return e=qe(22,e,r,t),e.elementType=Fc,e.lanes=n,e.stateNode={isHidden:!1},e}function ki(e,t,n){return e=qe(6,e,null,t),e.lanes=n,e}function Ei(e,t,n){return t=qe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zm(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ri(0),this.expirationTimes=ri(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function pa(e,t,n,r,l,o,i,a,s){return e=new Zm(e,t,n,a,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=qe(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gs(o),e}function qm(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rd)}catch(e){console.error(e)}}Rd(),jc.exports=be;var Td=jc.exports,$d,Xu=Td;$d=Xu.createRoot,Xu.hydrateRoot;/** + * react-router v7.8.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */var Zu="popstate";function lg(e={}){function t(l,o){let{pathname:i="/",search:a="",hash:s=""}=jn(l.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),ws("",{pathname:i,search:a,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(l,o){let i=l.document.querySelector("base"),a="";if(i&&i.getAttribute("href")){let s=l.location.href,u=s.indexOf("#");a=u===-1?s:s.slice(0,u)}return a+"#"+(typeof o=="string"?o:qr(o))}function r(l,o){dt(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return ig(t,n,r,e)}function ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function dt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function og(){return Math.random().toString(36).substring(2,10)}function qu(e,t){return{usr:e.state,key:e.key,idx:t}}function ws(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?jn(t):t,state:n,key:t&&t.key||r||og()}}function qr({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function jn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ig(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,a="POP",s=null,u=p();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function p(){return(i.state||{idx:null}).idx}function y(){a="POP";let L=p(),h=L==null?null:L-u;u=L,s&&s({action:a,location:C.location,delta:h})}function g(L,h){a="PUSH";let f=ws(C.location,L,h);n&&n(f,L),u=p()+1;let d=qu(f,u),E=C.createHref(f);try{i.pushState(d,"",E)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;l.location.assign(E)}o&&s&&s({action:a,location:C.location,delta:1})}function S(L,h){a="REPLACE";let f=ws(C.location,L,h);n&&n(f,L),u=p();let d=qu(f,u),E=C.createHref(f);i.replaceState(d,"",E),o&&s&&s({action:a,location:C.location,delta:0})}function k(L){return sg(L)}let C={get action(){return a},get location(){return e(l,i)},listen(L){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(Zu,y),s=L,()=>{l.removeEventListener(Zu,y),s=null}},createHref(L){return t(l,L)},createURL:k,encodeLocation(L){let h=k(L);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:g,replace:S,go(L){return i.go(L)}};return C}function sg(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ae(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:qr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Md(e,t,n="/"){return ag(e,t,n,!1)}function ag(e,t,n,r){let l=typeof t=="string"?jn(t):t,o=Ot(l.pathname||"/",n);if(o==null)return null;let i=zd(e);ug(i);let a=null;for(let s=0;a==null&&s{let p={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&s)return;ae(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let y=$t([r,p.relativePath]),g=n.concat(p);i.children&&i.children.length>0&&(ae(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),zd(i.children,t,g,y,s)),!(i.path==null&&!i.index)&&t.push({path:y,score:gg(y,i.index),routesMeta:g})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let u of Fd(i.path))o(i,a,!0,u)}),t}function Fd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=Fd(r.join("/")),a=[];return a.push(...i.map(s=>s===""?o:[o,s].join("/"))),l&&a.push(...i),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function ug(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vg(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var cg=/^:[\w-]+$/,fg=3,dg=2,pg=1,hg=10,mg=-2,ec=e=>e==="*";function gg(e,t){let n=e.split("/"),r=n.length;return n.some(ec)&&(r+=mg),t&&(r+=dg),n.filter(l=>!ec(l)).reduce((l,o)=>l+(cg.test(o)?fg:o===""?pg:hg),r)}function vg(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function yg(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",i=[];for(let a=0;a{if(p==="*"){let k=a[g]||"";i=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const S=a[g];return y&&!S?u[p]=void 0:u[p]=(S||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function wg(e,t=!1,n=!0){dt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Sg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return dt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ot(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function xg(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?jn(e):e;return{pathname:n?n.startsWith("/")?n:kg(n,t):t,search:Ng(r),hash:_g(l)}}function kg(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Ci(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Eg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Id(e){let t=Eg(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Od(e,t,n,r=!1){let l;typeof e=="string"?l=jn(e):(l={...e},ae(!l.pathname||!l.pathname.includes("?"),Ci("?","pathname","search",l)),ae(!l.pathname||!l.pathname.includes("#"),Ci("#","pathname","hash",l)),ae(!l.search||!l.search.includes("#"),Ci("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,a;if(i==null)a=n;else{let y=t.length-1;if(!r&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),y-=1;l.pathname=g.join("/")}a=y>=0?t[y]:"/"}let s=xg(l,a),u=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||p)&&(s.pathname+="/"),s}var $t=e=>e.join("/").replace(/\/\/+/g,"/"),Cg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ng=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_g=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Lg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Ad=["POST","PUT","PATCH","DELETE"];new Set(Ad);var Pg=["GET",...Ad];new Set(Pg);var dr=v.createContext(null);dr.displayName="DataRouter";var Oo=v.createContext(null);Oo.displayName="DataRouterState";v.createContext(!1);var Dd=v.createContext({isTransitioning:!1});Dd.displayName="ViewTransition";var jg=v.createContext(new Map);jg.displayName="Fetchers";var Rg=v.createContext(null);Rg.displayName="Await";var St=v.createContext(null);St.displayName="Navigation";var il=v.createContext(null);il.displayName="Location";var Dt=v.createContext({outlet:null,matches:[],isDataRoute:!1});Dt.displayName="Route";var va=v.createContext(null);va.displayName="RouteError";function Tg(e,{relative:t}={}){ae(sl(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=v.useContext(St),{hash:l,pathname:o,search:i}=al(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:$t([n,o])),r.createHref({pathname:a,search:i,hash:l})}function sl(){return v.useContext(il)!=null}function Rn(){return ae(sl(),"useLocation() may be used only in the context of a component."),v.useContext(il).location}var Ud="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Bd(e){v.useContext(St).static||v.useLayoutEffect(e)}function $g(){let{isDataRoute:e}=v.useContext(Dt);return e?Qg():Mg()}function Mg(){ae(sl(),"useNavigate() may be used only in the context of a component.");let e=v.useContext(dr),{basename:t,navigator:n}=v.useContext(St),{matches:r}=v.useContext(Dt),{pathname:l}=Rn(),o=JSON.stringify(Id(r)),i=v.useRef(!1);return Bd(()=>{i.current=!0}),v.useCallback((s,u={})=>{if(dt(i.current,Ud),!i.current)return;if(typeof s=="number"){n.go(s);return}let p=Od(s,JSON.parse(o),l,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:$t([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,o,l,e])}v.createContext(null);function al(e,{relative:t}={}){let{matches:n}=v.useContext(Dt),{pathname:r}=Rn(),l=JSON.stringify(Id(n));return v.useMemo(()=>Od(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function zg(e,t){return Hd(e,t)}function Hd(e,t,n,r,l){var f;ae(sl(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=v.useContext(St),{matches:i}=v.useContext(Dt),a=i[i.length-1],s=a?a.params:{},u=a?a.pathname:"/",p=a?a.pathnameBase:"/",y=a&&a.route;{let d=y&&y.path||"";Wd(u,!y||d.endsWith("*")||d.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let g=Rn(),S;if(t){let d=typeof t=="string"?jn(t):t;ae(p==="/"||((f=d.pathname)==null?void 0:f.startsWith(p)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${d.pathname}" was given in the \`location\` prop.`),S=d}else S=g;let k=S.pathname||"/",C=k;if(p!=="/"){let d=p.replace(/^\//,"").split("/");C="/"+k.replace(/^\//,"").split("/").slice(d.length).join("/")}let L=Md(e,{pathname:C});dt(y||L!=null,`No routes matched location "${S.pathname}${S.search}${S.hash}" `),dt(L==null||L[L.length-1].route.element!==void 0||L[L.length-1].route.Component!==void 0||L[L.length-1].route.lazy!==void 0,`Matched leaf route at location "${S.pathname}${S.search}${S.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let h=Dg(L&&L.map(d=>Object.assign({},d,{params:Object.assign({},s,d.params),pathname:$t([p,o.encodeLocation?o.encodeLocation(d.pathname).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?p:$t([p,o.encodeLocation?o.encodeLocation(d.pathnameBase).pathname:d.pathnameBase])})),i,n,r,l);return t&&h?v.createElement(il.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...S},navigationType:"POP"}},h):h}function Fg(){let e=Vg(),t=Lg(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:l},n):null,i)}var Ig=v.createElement(Fg,null),Og=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?v.createElement(Dt.Provider,{value:this.props.routeContext},v.createElement(va.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Ag({routeContext:e,match:t,children:n}){let r=v.useContext(dr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Dt.Provider,{value:e},n)}function Dg(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let u=o.findIndex(p=>p.route.id&&(i==null?void 0:i[p.route.id])!==void 0);ae(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,u+1))}let a=!1,s=-1;if(n)for(let u=0;u=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((u,p,y)=>{let g,S=!1,k=null,C=null;n&&(g=i&&p.route.id?i[p.route.id]:void 0,k=p.route.errorElement||Ig,a&&(s<0&&y===0?(Wd("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):s===y&&(S=!0,C=p.route.hydrateFallbackElement||null)));let L=t.concat(o.slice(0,y+1)),h=()=>{let f;return g?f=k:S?f=C:p.route.Component?f=v.createElement(p.route.Component,null):p.route.element?f=p.route.element:f=u,v.createElement(Ag,{match:p,routeContext:{outlet:u,matches:L,isDataRoute:n!=null},children:f})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?v.createElement(Og,{location:n.location,revalidation:n.revalidation,component:k,error:g,children:h(),routeContext:{outlet:null,matches:L,isDataRoute:!0},unstable_onError:r}):h()},null)}function ya(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ug(e){let t=v.useContext(dr);return ae(t,ya(e)),t}function Bg(e){let t=v.useContext(Oo);return ae(t,ya(e)),t}function Hg(e){let t=v.useContext(Dt);return ae(t,ya(e)),t}function wa(e){let t=Hg(e),n=t.matches[t.matches.length-1];return ae(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Wg(){return wa("useRouteId")}function Vg(){var r;let e=v.useContext(va),t=Bg("useRouteError"),n=wa("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Qg(){let{router:e}=Ug("useNavigate"),t=wa("useNavigate"),n=v.useRef(!1);return Bd(()=>{n.current=!0}),v.useCallback(async(l,o={})=>{dt(n.current,Ud),n.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var tc={};function Wd(e,t,n){!t&&!tc[e]&&(tc[e]=!0,dt(!1,n))}v.memo(Kg);function Kg({routes:e,future:t,state:n,unstable_onError:r}){return Hd(e,void 0,n,r,t)}function Vd(e){ae(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function bg({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1}){ae(!sl(),"You cannot render a inside another . You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=v.useMemo(()=>({basename:i,navigator:l,static:o,future:{}}),[i,l,o]);typeof n=="string"&&(n=jn(n));let{pathname:s="/",search:u="",hash:p="",state:y=null,key:g="default"}=n,S=v.useMemo(()=>{let k=Ot(s,i);return k==null?null:{location:{pathname:k,search:u,hash:p,state:y,key:g},navigationType:r}},[i,s,u,p,y,g,r]);return dt(S!=null,` is not able to match the URL "${s}${u}${p}" because it does not start with the basename, so the won't render anything.`),S==null?null:v.createElement(St.Provider,{value:a},v.createElement(il.Provider,{children:t,value:S}))}function Yg({children:e,location:t}){return zg(Ss(e),t)}function Ss(e,t=[]){let n=[];return v.Children.forEach(e,(r,l)=>{if(!v.isValidElement(r))return;let o=[...t,l];if(r.type===v.Fragment){n.push.apply(n,Ss(r.props.children,o));return}ae(r.type===Vd,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),ae(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Ss(r.props.children,o)),n.push(i)}),n}var Kl="get",bl="application/x-www-form-urlencoded";function Ao(e){return e!=null&&typeof e.tagName=="string"}function Jg(e){return Ao(e)&&e.tagName.toLowerCase()==="button"}function Gg(e){return Ao(e)&&e.tagName.toLowerCase()==="form"}function Xg(e){return Ao(e)&&e.tagName.toLowerCase()==="input"}function Zg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qg(e,t){return e.button===0&&(!t||t==="_self")&&!Zg(e)}var Ml=null;function ev(){if(Ml===null)try{new FormData(document.createElement("form"),0),Ml=!1}catch{Ml=!0}return Ml}var tv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ni(e){return e!=null&&!tv.has(e)?(dt(!1,`"${e}" is not a valid \`encType\` for \`\`/\`\` and will default to "${bl}"`),null):e}function nv(e,t){let n,r,l,o,i;if(Gg(e)){let a=e.getAttribute("action");r=a?Ot(a,t):null,n=e.getAttribute("method")||Kl,l=Ni(e.getAttribute("enctype"))||bl,o=new FormData(e)}else if(Jg(e)||Xg(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a
`,k=`
${g}
`;return`
${S}${k}
`}),i=i.replace(/
\s*(?=
]*>[\s\S]*?<\/div>)\s*
/g,"$1"),i}function ny(e){const t=e.split(/\r?\n/);let n=null;for(let r=0;r/i,n=/<\/think(?:ing)?>/i,r=e.match(t);if(!r)return{think:null,answer:e};const l=r.index,o=r[0].length,i=e.substring(0,l).trim();let a=e.substring(l+o);const s=a.match(n);let u=null,p=i;return s?(u=a.substring(0,s.index).trim(),p+=a.substring(s.index+s[0].length)):u=a.trim(),{think:u||null,answer:p.trim()}}function ry({content:e,streamOutput:t,sources:n}){const{think:r,answer:l}=ep(e||""),[o,i]=Me.useState(!1),a=!!r;return m.jsxs("div",{className:"assistant-message",children:[a&&m.jsxs("div",{className:"assistant-thoughts",children:[m.jsxs("button",{className:"think-toggle",onClick:()=>i(s=>!s),"aria-expanded":o?"true":"false","aria-controls":"think-content",children:[m.jsx("span",{className:"think-toggle-icon","aria-hidden":"true",children:o?"▾":"▸"}),"Thoughts"]}),o&&m.jsx("div",{id:"think-content",className:"think-content",dangerouslySetInnerHTML:{__html:hc(r)}})]}),m.jsx("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:hc(l||e||"")}}),Array.isArray(n)&&n.length>0&&m.jsx("div",{className:"msg-sources chips",children:n.map((s,u)=>{let p=s,y=!1;try{const g=new URL(s);if(g.protocol==="file:"){y=!0;const S=g.pathname.split("/").filter(Boolean);p=decodeURIComponent(S[S.length-1]||s)}else p=(g.hostname||s).replace(/^www\./i,"")}catch{}return m.jsx("a",{className:"chip",href:s,target:"_blank",rel:"noreferrer",title:s,onClick:g=>{var S,k;if(y){g.preventDefault();try{const C=new URL(s);(k=(S=window.electronAPI)==null?void 0:S.openPath)==null||k.call(S,decodeURIComponent(C.pathname))}catch{}}},children:p},s+u)})})]})}const mc="websearch.searxUrl",gc="websearch.engines",vc="chat.libraryBySession";let tp="http://127.0.0.1:8000";const ly=48,oy=24;function iy(e){return e.backendApiUrl||e.ollamaApiUrl||tp}function sy(){var Ha;const[e,t]=v.useState([]),[n,r]=v.useState(null),[l,o]=v.useState("chats"),[i,a]=v.useState("General"),[s,u]=v.useState(null),[p,y]=v.useState(null),[g,S]=v.useState([]),[k,C]=v.useState([]),[L,h]=v.useState(null),[f,d]=v.useState(()=>{try{const c=localStorage.getItem(vc);return c?JSON.parse(c):{}}catch{return{}}}),[E,j]=v.useState(!1),[N,P]=v.useState(""),[F,B]=v.useState(""),[U,le]=v.useState(!1),[xe,rt]=v.useState(""),[xt,T]=v.useState(""),O=v.useRef(null),Y=v.useRef(null),$=v.useRef(null),[z,W]=v.useState(tp),[Z,pe]=v.useState("Default"),[kt,pt]=v.useState(!1),[Et,Ct]=v.useState(localStorage.getItem(mc)||"http://localhost:8888"),[Je,np]=v.useState(()=>{try{const c=localStorage.getItem(gc);if(c)return JSON.parse(c)}catch{}return["duckduckgo","bing","wikipedia","github","stack_overflow"]});v.useEffect(()=>{localStorage.setItem(mc,Et||"")},[Et]),v.useEffect(()=>{try{localStorage.setItem(gc,JSON.stringify(Je||[]))}catch{}},[Je]);const[ul,rp]=v.useState(!1),[Ut,Do]=v.useState(!1),[cy,Uo]=v.useState(!0),[lp,Tn]=v.useState([]),[cl,Ea]=v.useState({}),[op,Bo]=v.useState(null),[Ho,fl]=v.useState("");function ip(c){const w=c.content||"";if(c.role==="assistant")try{const{answer:x}=ep(w);return(x||w).trim()}catch{return w.trim()}return w}async function Ca(c){try{await navigator.clipboard.writeText(ip(c))}catch(w){console.error("Failed to copy message:",w)}}function fn(c,w,x,_={}){const{removeIfEmpty:M=!1}=_;t(A=>A.map(H=>{if(H.session_id!==c)return H;const D=[];for(const V of H.messages||[]){if(V.id!==w){D.push(V);continue}M&&!x||D.push({...V,content:x})}return{...H,messages:D}}))}function Bt(c){return(c==null?void 0:c.name)==="AbortError"}function Wo(c){return c instanceof Error&&c.message?c.message:String(c)}async function Na(c,w,x){if(!c)return{contextBlock:null,sources:[]};const M=await(await fetch(`${z}/libraries/${c}/context`,{method:"POST",headers:{"Content-Type":"application/json"},signal:x,body:JSON.stringify({prompt:w,top_k:5})})).json();return{contextBlock:typeof(M==null?void 0:M.context_block)=="string"&&M.context_block.trim()?M.context_block.trim():null,sources:Array.isArray(M==null?void 0:M.sources)?M.sources:[]}}function sp(c,w){Bo(c),fl(w||"")}function dl(){Bo(null),fl("")}async function ap(c){var A;const w=(((A=Fn[c])==null?void 0:A.content)||"").trim(),_=(Ho??"").trim();if(_.length===0){dl();return}if(_===w){dl();return}const M=n;if(M){t(H=>H.map(D=>{if(D.session_id!==M)return D;const Le=(D.messages||[]).slice(0,c+1).map((ge,Ge)=>Ge===c?{...ge,content:_}:ge);return{...D,messages:Le}})),Bo(null),fl(""),requestAnimationFrame(()=>Go("auto",M));try{const H=await fetch(`${z}/sessions/${M}/messages/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:_})});if(!H.ok)throw new Error(`HTTP ${H.status}`)}catch(H){console.error("Failed to update message:",H),t(D=>D.map(V=>{if(V.session_id!==M)return V;const ge=(V.messages||[]).map((Ge,Q)=>Q===c?{...Ge,content:w}:Ge);return{...V,messages:ge}}));return}await _a(c,_)}}async function _a(c,w=null){var Le,ge,Ge,Q,fe,ke;const x=n;if(Ut||!x||typeof c!="number")return;const _=((Le=e.find(G=>G.session_id===x))==null?void 0:Le.messages)||[];let M=c;for(let G=c;G>=0;G--)if(((ge=_[G])==null?void 0:ge.role)==="user"){M=G;break}t(G=>G.map(oe=>oe.session_id===x?{...oe,messages:(oe.messages||[]).slice(0,M+1)}:oe));const A=$a(x);let H=w??(((Ge=_[M])==null?void 0:Ge.content)||""),D=[];const V=[];try{const G=Ia(x),oe=w??(((Q=_[M])==null?void 0:Q.content)||"");if((fe=G==null?void 0:G.states)!=null&&fe.is_indexed)try{const K=await Na(G.slug,oe,A.signal);K.contextBlock&&V.push(K.contextBlock),Array.isArray(K.sources)&&D.push(...K.sources)}catch(K){if(Bt(K))throw K;console.warn("local library enrichment (regenerate) failed",K)}if(ul)try{const K=_.slice(Math.max(0,M-7),M+1).map(he=>({role:he.role,content:he.content||""}));K.length>0&&(K[K.length-1]={role:"user",content:oe});const ee=await(await fetch(`${z}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:A.signal,body:JSON.stringify({prompt:oe,model:xe,messages:K,history_limit:8,searx_url:Et||null,engines:Array.isArray(Je)?Je:null})})).json();ee&&typeof ee.context_block=="string"&&ee.context_block.trim()&&V.push(ee.context_block.trim()),Array.isArray(ee==null?void 0:ee.sources)&&D.push(...ee.sources)}catch(K){if(Bt(K))throw K;console.warn("web search enrichment (regenerate) failed",K)}if(D=[...new Set(D)],V.length>0?H=`${oe} + +${V.join(` + +`)}`:H=null,kt){const K=`msg-${Date.now()}-${Math.random()}`;let _t="";t(ee=>ee.map(he=>he.session_id===x?{...he,messages:[...he.messages||[],{id:K,role:"assistant",content:"",sources:D}]}:he));try{const ee=await fetch(`${z}/sessions/${x}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:A.signal,body:JSON.stringify({index:c,model:xe,stream:!0,enriched_message:H,sources:D||[]})});if(!ee.ok)throw new Error(`HTTP ${ee.status}`);const he=(ke=ee.body)==null?void 0:ke.getReader();if(!he)throw new Error("Missing response body");const Wt=new TextDecoder;let ht=!1;for(;;){const{value:hn,done:Rp}=await he.read();if(Rp)break;const Tp=Wt.decode(hn,{stream:!0});_t+=Tp,fn(x,K,_t),!ht&&_e.current!==x&&(ht=!0,dn(Xo=>({...Xo,[x]:K})),Tn(Xo=>[...new Set([...Xo,x])]))}_e.current!==x?(dn(hn=>({...hn,[x]:K})),Tn(hn=>[...new Set([...hn,x])])):$n.current[x]?Mn(hn=>({...hn,[x]:K})):requestAnimationFrame(()=>In(K,"smooth",x))}catch(ee){if(Bt(ee)){fn(x,K,_t,{removeIfEmpty:!0});return}console.error(ee),fn(x,K,`Error: ${Wo(ee)}`,{removeIfEmpty:!0});return}}else{const K=await fetch(`${z}/sessions/${x}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:A.signal,body:JSON.stringify({index:c,model:xe,stream:!1,enriched_message:H,sources:D||[]})});if(!K.ok)throw new Error(`HTTP ${K.status}`);const _t=await K.json(),ee=`msg-${Date.now()}`;t(he=>he.map(Wt=>Wt.session_id===x?{...Wt,messages:[...Wt.messages||[],{role:"assistant",content:_t.reply,id:ee,sources:D}]}:Wt)),_e.current!==x?(dn(he=>({...he,[x]:ee})),Tn(he=>[...new Set([...he,x])])):$n.current[x]?Mn(he=>({...he,[x]:ee})):requestAnimationFrame(()=>In(ee,"smooth",x))}}catch(G){Bt(G)||console.error(G)}finally{Vo(A)}}const[La,up]=v.useState({}),$n=v.useRef({}),[cp,dn]=v.useState({}),pn=v.useRef({}),Pa=v.useRef({}),[ja,Mn]=v.useState({}),[fp,Ra]=v.useState({}),Ta=(c,w,x)=>c!=null&&c.id?c.id:`${x}:${w}`;v.useEffect(()=>{var w;if(!n)return;const c=((w=e.find(x=>x.session_id===n))==null?void 0:w.messages)||[];Ra(x=>{const _={};return c.forEach((M,A)=>{if(M.role!=="user")return;const H=Ta(M,A,n),V=(M.content||"").split(/\r\n|\r|\n/).length>30;_[H]=V?x[H]??!0:!1}),_})},[e,n]);function dp(c){Ra(w=>({...w,[c]:!(w[c]??!0)}))}const pr=Me.useCallback((c,w)=>{up(x=>{const _={...x,[c]:w};return $n.current=_,_})},[]),zn=v.useRef(null),pp=v.useRef(!1),hp=v.useRef(null),_e=v.useRef(n);v.useEffect(()=>{_e.current=n},[n]);const $a=Me.useCallback(c=>{const w=new AbortController;return zn.current={controller:w,sessionId:c},Do(!0),w},[]),Vo=Me.useCallback(c=>{var w;((w=zn.current)==null?void 0:w.controller)===c&&(zn.current=null,Do(!1))},[]),mp=Me.useCallback(()=>{const c=zn.current;c&&(zn.current=null,c.controller.abort(),Do(!1))},[]);v.useEffect(()=>()=>{var c;(c=zn.current)==null||c.controller.abort()},[]);const Ht=v.useRef(null),[gp,vp]=v.useState(230),[pl,Ma]=v.useState(!1),yp=Me.useCallback(c=>{Ma(!0)},[]),Qo=Me.useCallback(()=>{Ma(!1)},[]),Ko=Me.useCallback(c=>{if(pl){const w=Math.max(230,Math.min(500,c.clientX));vp(w)}},[pl]);Me.useEffect(()=>(window.addEventListener("mousemove",Ko),window.addEventListener("mouseup",Qo),()=>{window.removeEventListener("mousemove",Ko),window.removeEventListener("mouseup",Qo)}),[Ko,Qo]),Me.useEffect(()=>{pl?document.body.classList.add("no-select"):document.body.classList.remove("no-select")},[pl]),Me.useEffect(()=>{const c=async w=>{const x=w.target.closest(".codeblock__copy");if(!x)return;const _=x.closest(".codeblock"),M=_==null?void 0:_.querySelector("pre > code");if(M)try{await navigator.clipboard.writeText(M.textContent||""),x.classList.add("copied"),setTimeout(()=>x.classList.remove("copied"),800)}catch(A){console.error("Copy failed:",A)}};return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[]),v.useEffect(()=>{window.electronAPI.getSettings().then(w=>{W(iy(w)),pe(w.colorScheme||"Default"),rt(w.chatModel||""),pt(w.streamOutput||!1),Ea(w.scrollPositions||{}),el(w.colorScheme||"Default")});const c=()=>{var w;l==="chats"&&((w=Y.current)==null||w.focus())};return window.electronAPI.onWindowFocus(c),()=>{}},[l]),v.useEffect(()=>{el(Z)},[Z]);const wp=c=>{!c||!z||fetch(`${z}/history?session_id=${encodeURIComponent(c)}`).then(w=>w.json()).then(w=>{t(x=>x.map(_=>_.session_id===c?{..._,messages:w.messages||[]}:_))}).catch(()=>{})};async function hl(){if(z)try{const w=await(await fetch(`${z}/libraries`)).json(),x=Array.isArray(w.libraries)?w.libraries:[];if(S(x),x.length===0){h(null);return}x.some(_=>_.slug===L)||h(x[0].slug)}catch(c){console.warn("Failed to load libraries",c)}}async function bo(){if(z)try{const w=await(await fetch(`${z}/jobs`)).json();C(Array.isArray(w.jobs)?w.jobs:[])}catch(c){console.warn("Failed to load library jobs",c)}}async function za(c=null){const x=(typeof c=="string"?c:N).trim();if(!x){B("Name is required.");return}try{B("");const _=await fetch(`${z}/libraries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x})});if(!_.ok){const A=await _.text();throw new Error(A||`HTTP ${_.status}`)}const M=await _.json();j(!1),P(""),await hl(),M!=null&&M.slug&&h(M.slug)}catch(_){console.error("Failed to create library",_),B(String((_==null?void 0:_.message)||_))}}v.useEffect(()=>{z&&(Uo(!0),fetch(`${z}/sessions`).then(c=>c.json()).then(c=>{const w=c.sessions.map(x=>({...x,messages:[]}));t(w),w.length>0?r(w[0].session_id):r(null),Uo(!1)}).catch(()=>{Uo(!1)}))},[z]),v.useEffect(()=>{z&&(hl(),bo())},[z]),v.useEffect(()=>{try{localStorage.setItem(vc,JSON.stringify(f||{}))}catch{}},[f]),v.useEffect(()=>{if(!z)return;const c=setInterval(()=>{hl(),bo()},3e3);return()=>clearInterval(c)},[z,l,L]),v.useEffect(()=>{wp(n)},[n,z]),v.useEffect(()=>{const c=new Set(g.map(w=>w.slug));d(w=>{let x=!1;const _={};for(const[M,A]of Object.entries(w||{}))c.has(A)?_[M]=A:x=!0;return x?_:w})},[g]);const Yo=c=>{o(c)},Sp=c=>{Np(c)},Fn=v.useMemo(()=>{var c;return((c=e.find(w=>w.session_id===n))==null?void 0:c.messages)||[]},[n,e]),ml=v.useMemo(()=>g.find(c=>c.slug===L)||null,[L,g]),Nt=n&&f[n]||null,lt=v.useMemo(()=>g.find(c=>c.slug===Nt)||null,[Nt,g]),Fa=v.useMemo(()=>Nt?k.some(c=>c.slug===Nt&&(c.status==="queued"||c.status==="running")):!1,[Nt,k]),Jo=v.useMemo(()=>{var c,w;return lt?(c=lt.files)!=null&&c.length?(w=lt.states)!=null&&w.is_indexed?"":Fa?" (syncing)":" (needs sync)":" (empty)":""},[lt,Fa]);function xp(c){return c&&f[c]||null}function Ia(c){const w=xp(c);return w&&g.find(x=>x.slug===w)||null}function Oa(c){return c?k.some(w=>w.slug===c&&(w.status==="queued"||w.status==="running")):!1}function Aa(c,w){c&&d(x=>{const _={...x||{}};return w?_[c]=w:delete _[c],_})}function kp(c){c&&d(w=>{let x=!1;const _={};for(const[M,A]of Object.entries(w||{})){if(A===c){x=!0;continue}_[M]=A}return x?_:w})}v.useEffect(()=>{if(!U)return;const c=w=>{var x;(x=$.current)!=null&&x.contains(w.target)||le(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[U]),v.useEffect(()=>{le(!1)},[n,l]),v.useEffect(()=>{const c=n,w=l;return()=>{if(w==="chats"&&c){const x=typeof pn.current[c]=="number"?pn.current[c]:O.current?O.current.scrollTop:0;Ea(_=>{const M={..._,[c]:x};return window.electronAPI.updateSettings({scrollPositions:M}),M})}}},[n,l]),v.useEffect(()=>{const c=O.current;if(!c)return;const w=()=>{const{scrollTop:x,scrollHeight:_,clientHeight:M}=c,A=_-x-M<=oy;if(n){const H=Pa.current[n],D=typeof H=="number"&&xc.removeEventListener("scroll",w)},[n,pr]),v.useEffect(()=>{const c=n;c&&La[c]===!1&&Mn(w=>{if(!(c in w))return w;const x={...w};return delete x[c],x})},[n,La]),v.useLayoutEffect(()=>{if(l!=="chats"||!n)return;const c=O.current;if(!c)return;Ht.current=null;const w=()=>{if(Ht.current===n)return;const H=typeof pn.current[n]=="number"?pn.current[n]:void 0,D=typeof H=="number"?H:cl[n];if(typeof D=="number"){c.scrollTop=D,Ht.current=n;return}Fn.length>0&&(c.scrollTop=c.scrollHeight,Ht.current=n)};w();const x=requestAnimationFrame(w),_=()=>{Ht.current!==n&&requestAnimationFrame(w)},M=new MutationObserver(_);M.observe(c,{childList:!0,subtree:!0});const A=new ResizeObserver(_);return A.observe(c),()=>{cancelAnimationFrame(x),M.disconnect(),A.disconnect()}},[n,l,Fn.length,cl]),v.useEffect(()=>{if(l!=="chats"||!n||Ht.current===n)return;const c=typeof pn.current[n]=="number"?pn.current[n]:void 0;typeof(typeof c=="number"?c:cl[n])!="number"&&Fn.length>0&&requestAnimationFrame(()=>{const x=O.current;x&&(x.scrollTop=x.scrollHeight,Ht.current=n)})},[Fn.length,n,l,cl]);const Go=(c="smooth",w=null)=>{const x=O.current;if(!x)return;const _=w??_e.current;_e.current===_&&(x.scrollTo({top:x.scrollHeight,behavior:c}),pr(_,!1))},In=(c,w="auto",x=null)=>{const _=O.current;if(!_)return;const M=x??_e.current;if(_e.current!==M)return;const A=document.getElementById(c);if(A){const H=Math.max(0,A.offsetTop-ly);_.scrollTo({top:H,behavior:w})}},Ep=()=>{const c=_e.current,w=ja[c];w&&(In(w,"smooth",c),Mn(x=>{const{[c]:_,...M}=x;return M}))};async function Da(){var M,A,H;if(Ut||!xt.trim()||!xe)return;let c=n,w=!1;if(c){const D=e.find(V=>V.session_id===c);w=D&&D.name==="New Chat"&&D.messages.length===0}else{const D=await Ua();await new Promise(V=>setTimeout(V,200)),c=D.session_id,w=!0}const x={role:"user",content:xt.trim(),id:`msg-${Date.now()}-${Math.random()}`};pp.current=!0,hp.current=c,pr(c,!1),_e.current===c&&(Ht.current=_e.current),Td.flushSync(()=>{t(D=>D.map(V=>V.session_id===c?{...V,messages:[...V.messages||[],x]}:V)),T("")}),requestAnimationFrame(()=>Go("auto",c));const _=$a(c);try{let D=[];try{D=[...(((M=e.find(ke=>ke.session_id===c))==null?void 0:M.messages)||[]).slice(-8).map(ke=>({role:ke.role,content:ke.content||""})),{role:"user",content:x.content}]}catch{}let V=x.content,Le=[];const ge=[],Ge=Ia(c);if((A=Ge==null?void 0:Ge.states)!=null&&A.is_indexed)try{const Q=await Na(Ge.slug,x.content,_.signal);Q.contextBlock&&ge.push(Q.contextBlock),Array.isArray(Q.sources)&&Le.push(...Q.sources)}catch(Q){if(Bt(Q))throw Q;console.warn("local library enrichment failed",Q)}if(ul)try{const fe=await(await fetch(`${z}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:_.signal,body:JSON.stringify({prompt:x.content,model:xe,messages:D,history_limit:8,searx_url:Et||null,engines:Array.isArray(Je)?Je:null})})).json();fe&&typeof fe.context_block=="string"&&fe.context_block.trim()&&ge.push(fe.context_block.trim()),Array.isArray(fe==null?void 0:fe.sources)&&Le.push(...fe.sources)}catch(Q){if(Bt(Q))throw Q;console.warn("web search enrichment failed",Q)}if(Le=[...new Set(Le)],ge.length>0&&(V=`${x.content} + +${ge.join(` + +`)}`),kt){const Q=`msg-${Date.now()}-${Math.random()}`;let fe="";const ke={role:"assistant",content:"",id:Q,sources:Le};t(G=>G.map(oe=>oe.session_id===c?{...oe,messages:[...oe.messages||[],ke]}:oe));try{const G=await fetch(`${z}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:_.signal,body:JSON.stringify({session_id:c,model:xe,message:x.content,enriched_message:ge.length>0?V:null,stream:!0,sources:Le||[]})});if(!G.ok)throw new Error(`HTTP ${G.status}`);const oe=(H=G.body)==null?void 0:H.getReader();if(!oe)throw new Error("Missing response body");const K=new TextDecoder;let _t=!1;for(;;){const{value:ee,done:he}=await oe.read();if(he){fn(c,Q,fe),_e.current===c?$n.current[c]?Mn(ht=>({...ht,[c]:Q})):requestAnimationFrame(()=>In(Q,"smooth",c)):(dn(ht=>({...ht,[c]:Q})),Tn(ht=>[...new Set([...ht,c])]));break}const Wt=K.decode(ee,{stream:!0});fe+=Wt,fn(c,Q,fe),_e.current===c&&!$n.current[c]&&Go("auto",c),_e.current!==c&&!_t&&(dn(ht=>({...ht,[c]:Q})),_t=!0)}}catch(G){if(Bt(G)){fn(c,Q,fe,{removeIfEmpty:!0});return}console.error("Failed to send message:",G),fn(c,Q,"Error: "+Wo(G),{removeIfEmpty:!0});return}}else{const Q=await fetch(`${z}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:_.signal,body:JSON.stringify({session_id:c,model:xe,message:x.content,enriched_message:ge.length>0?V:null,stream:!1,sources:Le||[]})});if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const fe=await Q.json(),ke=`msg-${Date.now()}`,G={role:"assistant",content:fe.reply,id:ke,sources:Le};t(oe=>oe.map(K=>K.session_id===c?{...K,messages:[...K.messages||[],G]}:K)),ke&&(_e.current===c?$n.current[c]?Mn(oe=>({...oe,[c]:ke})):requestAnimationFrame(()=>In(ke,"smooth",c)):dn(oe=>({...oe,[c]:ke})))}_e.current!==c&&Tn(Q=>[...new Set([...Q,c])]),w&&fetch(`${z}/generate-title`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c,message:x.content,model:xe})}).then(Q=>Q.json()).then(Q=>{const fe=Q.title.replace(/[\s\S]*?<\/think(?:ing)?>/i,"").trim();t(ke=>ke.map(G=>G.session_id===c?{...G,name:fe}:G))})}catch(D){if(Bt(D)){Vo(_);return}console.error("Failed to send message:",D);const V={role:"assistant",content:"Error: "+Wo(D),id:`msg-${Date.now()}-${Math.random()}`};t(Le=>Le.map(ge=>ge.session_id===c?{...ge,messages:[...ge.messages,V]}:ge))}finally{Vo(_)}}function Cp(){rp(c=>!c)}async function Ua(){var M;const c="sess-"+Math.random().toString(36).slice(2)+Date.now().toString(36),x=await(await fetch(`${z}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})})).json(),_={...x,messages:[]};return t(A=>[_,...A]),r(x.session_id),(M=Y.current)==null||M.focus(),x}function Np(c){r(c),Tn(x=>x.filter(_=>_!==c));const w=cp[c];w&&requestAnimationFrame(()=>{let x=12;const _=()=>{if(!O.current)return;let A=document.getElementById(w);if(!A){const H=e.find(D=>D.session_id===c);if(H&&Array.isArray(H.messages))for(let D=H.messages.length-1;D>=0;D--){const V=H.messages[D];if(V.role==="assistant"&&V.id){A=document.getElementById(V.id);break}}}A?(In(A.id,"smooth",c),dn(H=>{const{[c]:D,...V}=H;return V})):x-- >0&&requestAnimationFrame(_)};requestAnimationFrame(_)})}function _p(c,w){fetch(`${z}/sessions/${c}/rename`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:w})}).then(()=>{t(x=>x.map(_=>_.session_id===c?{..._,name:w}:_)),u(null)})}function Lp(c,w){const x=(w||"").trim(),_=g.find(M=>M.slug===c);if(!_){y(null);return}if(!x||x===_.name){y(null);return}fetch(`${z}/libraries/${c}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x})}).then(()=>{S(M=>M.map(A=>A.slug===c?{...A,name:x}:A)),y(null)})}function Ba(c){fetch(`${z}/sessions/${c}`,{method:"DELETE"}).then(()=>{const w=e.filter(x=>x.session_id!==c);t(w),d(x=>{const _={...x||{}};return delete _[c],_}),n===c&&r(w.length>0?w[0].session_id:null)})}function Pp(c){fetch(`${z}/libraries/${c}`,{method:"DELETE"}).then(async w=>{var _;if(!w.ok){const M=await w.text();throw new Error(M||`HTTP ${w.status}`)}const x=g.filter(M=>M.slug!==c);S(x),C(M=>M.filter(A=>A.slug!==c)),y(M=>M===c?null:M),L===c&&h(((_=x[0])==null?void 0:_.slug)||null),kp(c)}).catch(w=>{console.error("Failed to delete library",w)})}v.useEffect(()=>{const c=e.filter(w=>w.name==="New Chat"&&w.session_id!==n&&w.messages.length===0);c.length>0&&c.forEach(w=>{Ba(w.session_id)})},[n,e,z]);const jp=c=>{var x;window.getSelection().toString().length>0||document.activeElement!==Y.current&&(c.target.closest(".msg")||(x=Y.current)==null||x.focus())};return m.jsxs("div",{className:"app",style:{gridTemplateColumns:`${gp}px 1fr`},children:[m.jsxs("div",{className:"sidebar",children:[m.jsxs("div",{className:"sidebar-header",children:[m.jsx("div",{className:`sidebar-tab ${l==="chats"?"active":""}`,onClick:()=>Yo("chats"),children:"Chats"}),m.jsx("div",{className:`sidebar-tab ${l==="dbs"?"active":""}`,onClick:()=>Yo("dbs"),children:"DBs"}),m.jsx("div",{className:`sidebar-tab ${l==="settings"?"active":""}`,onClick:()=>Yo("settings"),children:"Settings"})]}),m.jsxs("div",{className:"sidebar-content",children:[l==="chats"&&m.jsx("div",{className:"chat-list",children:e.map(c=>m.jsx("div",{className:`chat-item ${c.session_id===n?"active":""}`,onClick:()=>Sp(c.session_id),children:s===c.session_id?m.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>u(null),onKeyDown:w=>{w.key==="Enter"?_p(c.session_id,w.target.value):w.key==="Escape"&&u(null)},autoFocus:!0}):m.jsxs(m.Fragment,{children:[m.jsx("span",{children:c.name}),m.jsxs("div",{className:"chat-item-buttons",children:[lp.includes(c.session_id)&&m.jsx("div",{className:"unread-dot"}),m.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),u(c.session_id)},children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:m.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),m.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),Ba(c.session_id)},children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[m.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},c.session_id))}),l==="dbs"&&m.jsx("div",{className:"db-list",children:g.length===0?m.jsx("div",{className:"empty-list-message",children:"No databases yet."}):g.map(c=>m.jsx("div",{className:`chat-item ${c.slug===L?"active":""}`,onClick:()=>h(c.slug),children:p===c.slug?m.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>y(null),onKeyDown:w=>{w.key==="Enter"?Lp(c.slug,w.target.value):w.key==="Escape"&&y(null)},autoFocus:!0}):m.jsxs(m.Fragment,{children:[m.jsx("span",{children:c.name}),m.jsxs("div",{className:"chat-item-buttons",children:[Nt===c.slug&&m.jsx("div",{className:"db-active-badge",children:"Chat"}),Oa(c.slug)&&m.jsx("div",{className:"db-active-badge",children:"Syncing"}),m.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),y(c.slug)},children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:m.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),m.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),Pp(c.slug)},children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[m.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},c.slug))}),l==="settings"&&m.jsxs("div",{className:"settings-list",children:[m.jsx("div",{className:`settings-item ${i==="General"?"active":""}`,onClick:()=>a("General"),children:"General"}),m.jsx("div",{className:`settings-item ${i==="Interface"?"active":""}`,onClick:()=>a("Interface"),children:"Interface"}),m.jsx("div",{className:`settings-item ${i==="Websearch"?"active":""}`,onClick:()=>a("Websearch"),children:"Websearch"})]})]}),l!=="settings"&&m.jsxs("div",{className:"sidebar-footer",children:[l==="chats"&&m.jsx("button",{className:"button new-chat-button",onClick:Ua,children:"New Chat"}),l==="dbs"&&(E?m.jsxs("div",{className:"new-db-form",children:[m.jsx("input",{type:"text",className:"rename-input",value:N,onChange:c=>P(c.target.value),onKeyDown:c=>{c.key==="Enter"?za():c.key==="Escape"&&(j(!1),P(""),B(""))},placeholder:"Database name",autoFocus:!0}),F&&m.jsx("div",{className:"form-error",children:F}),m.jsxs("div",{className:"new-db-actions",children:[m.jsx("button",{className:"button new-db-button",onClick:()=>za(),children:"Create"}),m.jsx("button",{className:"button ghost",onClick:()=>{j(!1),P(""),B("")},children:"Cancel"})]})]}):m.jsx("button",{className:"button new-db-button",onClick:()=>{j(!0),B("")},children:"New Database"}))]}),m.jsx("div",{className:"resizer",onMouseDown:yp})]}),m.jsxs("div",{className:"main-content",children:[l==="chats"&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"header",children:[m.jsxs("strong",{children:["Chat - ",((Ha=e.find(c=>c.session_id===n))==null?void 0:Ha.name)||"New Chat"]}),lt&&m.jsx("span",{className:"header-subtle",children:`DB: ${lt.name}${Jo}`})]}),m.jsx("div",{className:"chat",ref:O,onClick:jp,children:Fn.map((c,w)=>{const x=c.role==="user"&&op===w;return m.jsx("div",{id:c.id,className:"msg "+(c.role==="user"?"user":"assistant")+(x?" editing":""),children:c.role==="assistant"?m.jsxs("div",{className:"assistant-message-wrapper",children:[m.jsx(ry,{content:c.content,streamOutput:kt,sources:c.sources}),!Ut&&m.jsxs("div",{className:"message-options-bar assistant-options",children:[m.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ca(c),children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),m.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),m.jsx("button",{className:"icon-button",title:"Regenerate response",onClick:()=>_a(w),children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})})})]})]}):m.jsxs("div",{className:"user-message-wrapper",children:[x?m.jsxs("div",{className:"msg-content msg-content--user editing",children:[m.jsx("div",{className:"user-edit-shadow","aria-hidden":"true",children:Ho}),m.jsx(ac,{className:"edit-message-input edit-overlay",value:Ho,onChange:_=>fl(_.target.value),onBlur:dl,onKeyDown:_=>{_.key==="Escape"&&(_.preventDefault(),dl()),_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),ap(w))},autoFocus:!0,minRows:1})]}):(()=>{const _=c.content||"",M=_.split(/\r\n|\r|\n/),A=M.length>30,H=Ta(c,w,n),D=A?fp[H]??!0:!1,V=D?M.slice(0,30).join(` +`)+` +…`:_;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"msg-content msg-content--user",children:V}),A&&m.jsx("button",{className:"user-msg-expand",onClick:()=>dp(H),"aria-expanded":D?"false":"true",children:D?"Show entire message":"Collapse"})]})})(),!Ut&&!x&&m.jsxs("div",{className:"message-options-bar user-options",children:[m.jsx("button",{className:"icon-button",title:"Edit message",onClick:()=>sp(w,c.content),children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M12 20h9"}),m.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),m.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ca(c),children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),m.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},c.id||w)})},n),ja[n]&&m.jsxs("button",{className:"new-msg-tip",onClick:Ep,title:"Jump to the new message","aria-label":"Jump to the new message",children:["New message",m.jsx("span",{style:{marginLeft:6},children:"↓"})]}),m.jsx("div",{className:"footer",children:m.jsxs("div",{className:"footer-content-wrapper",children:[m.jsx(ac,{ref:Y,className:"input",value:xt,onChange:c=>T(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),Da())},placeholder:"Ask any question...",maxRows:13}),m.jsxs("div",{className:"footer-tool-group",ref:$,children:[m.jsx("button",{type:"button",className:"db-picker-toggle"+(lt?" active":""),onClick:()=>{n&&le(c=>!c)},title:lt?`Database: ${lt.name}${Jo}`:"Select database for this chat","aria-haspopup":"menu","aria-expanded":U,disabled:!n,children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("ellipse",{cx:"12",cy:"5",rx:"8",ry:"3"}),m.jsx("path",{d:"M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5"}),m.jsx("path",{d:"M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"})]})}),U&&m.jsxs("div",{className:"db-picker-menu",role:"menu",children:[m.jsxs("button",{type:"button",className:"db-picker-option"+(Nt?"":" selected"),onClick:()=>{Aa(n,null),le(!1)},children:[m.jsx("span",{children:"No database"}),!Nt&&m.jsx("span",{className:"db-picker-status",children:"Selected"})]}),g.length===0?m.jsx("div",{className:"db-picker-empty",children:"No databases yet."}):g.map(c=>{var M,A,H;const w=Nt===c.slug,x=Oa(c.slug),_=(M=c.files)!=null&&M.length?(A=c.states)!=null&&A.is_indexed?"Ready":x?"Syncing":"Needs sync":"Empty";return m.jsxs("button",{type:"button",className:"db-picker-option"+(w?" selected":""),disabled:!((H=c.files)!=null&&H.length),onClick:()=>{Aa(n,c.slug),le(!1)},children:[m.jsx("span",{children:c.name}),m.jsx("span",{className:"db-picker-status",children:w?"Selected":_})]},c.slug)})]})]}),m.jsx("button",{type:"button",className:"websearch-toggle"+(ul?" active":""),onClick:Cp,title:"Toggle web search","aria-pressed":ul,children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("circle",{cx:"12",cy:"12",r:"10"}),m.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),m.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}),m.jsx("button",{className:"button",onClick:Ut?mp:Da,title:Ut?"Cancel generation":"Send","aria-label":Ut?"Cancel generation":"Send",children:Ut?m.jsx("div",{className:"spinner"}):"Send"})]})})]}),l==="dbs"&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"header",children:[m.jsx("strong",{children:(ml==null?void 0:ml.name)||"Databases"}),lt&&m.jsx("span",{className:"header-subtle",children:`Current chat DB: ${lt.name}${Jo}`})]}),m.jsx(ey,{apiBase:z,library:ml,jobs:k,onRefresh:async()=>{await hl(),await bo()}})]}),l==="settings"&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"header",children:m.jsxs("strong",{children:[i," Settings"]})}),i==="General"&&m.jsx(Yv,{onModelChange:rt,streamOutput:kt,onStreamOutputChange:pt}),i==="Interface"&&m.jsx(Zv,{}),i==="Websearch"&&m.jsx(ty,{searxUrl:Et,setSearxUrl:Ct,engines:Je,setEngines:np})]})]})]})}function ay(){return v.useEffect(()=>{window.electronAPI.getSettings().then(e=>{el(e.colorScheme||"Default")})},[]),m.jsx(Me.StrictMode,{children:m.jsx(vv,{children:m.jsx(Yg,{children:m.jsx(Vd,{path:"/",element:m.jsx(sy,{})})})})})}const uy=$d(document.getElementById("root"));uy.render(m.jsx(ay,{})); diff --git a/dist/index.html b/dist/index.html index c180210..c57f81c 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,7 +5,7 @@ LLM Desktop - +