From ccd930f11d52501db49cb13c3094665b88ad43fd Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Fri, 17 Apr 2026 10:33:44 +0200 Subject: [PATCH] auto-git: [change] dist/index.html [unlink] dist/assets/index-CY4Ajh2W.js --- dist/assets/index-CY4Ajh2W.js | 88 ----------------------------------- dist/index.html | 2 +- 2 files changed, 1 insertion(+), 89 deletions(-) delete mode 100644 dist/assets/index-CY4Ajh2W.js diff --git a/dist/assets/index-CY4Ajh2W.js b/dist/assets/index-CY4Ajh2W.js deleted file mode 100644 index e7eb127..0000000 --- a/dist/assets/index-CY4Ajh2W.js +++ /dev/null @@ -1,88 +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 km(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qd={exports:{}},_i={},Gd={exports:{}},Y={};/** - * @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 Gl=Symbol.for("react.element"),Em=Symbol.for("react.portal"),Cm=Symbol.for("react.fragment"),Nm=Symbol.for("react.strict_mode"),_m=Symbol.for("react.profiler"),Rm=Symbol.for("react.provider"),jm=Symbol.for("react.context"),Lm=Symbol.for("react.forward_ref"),Tm=Symbol.for("react.suspense"),Pm=Symbol.for("react.memo"),Mm=Symbol.for("react.lazy"),cc=Symbol.iterator;function Am(e){return e===null||typeof e!="object"?null:(e=cc&&e[cc]||e["@@iterator"],typeof e=="function"?e:null)}var Yd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Jd=Object.assign,Xd={};function Qr(e,t,n){this.props=e,this.context=t,this.refs=Xd,this.updater=n||Yd}Qr.prototype.isReactComponent={};Qr.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")};Qr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function qd(){}qd.prototype=Qr.prototype;function za(e,t,n){this.props=e,this.context=t,this.refs=Xd,this.updater=n||Yd}var ba=za.prototype=new qd;ba.constructor=za;Jd(ba,Qr.prototype);ba.isPureReactComponent=!0;var dc=Array.isArray,Zd=Object.prototype.hasOwnProperty,Ua={current:null},ef={key:!0,ref:!0,__self:!0,__source:!0};function tf(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)Zd.call(t,r)&&!ef.hasOwnProperty(r)&&(l[r]=t[r]);var s=arguments.length-2;if(s===1)l.children=n;else if(1>>1,ee=I[te];if(0>>1;tel(wt,W))Oel(Re,wt)?(I[te]=Re,I[Oe]=W,te=Oe):(I[te]=wt,I[Be]=W,te=Be);else if(Oel(Re,W))I[te]=Re,I[Oe]=W,te=Oe;else break e}}return b}function l(I,b){var W=I.sortIndex-b.sortIndex;return W!==0?W:I.id-b.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,s=i.now();e.unstable_now=function(){return i.now()-s}}var a=[],d=[],m=1,w=null,y=3,x=!1,E=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(I){for(var b=n(d);b!==null;){if(b.callback===null)r(d);else if(b.startTime<=I)r(d),b.sortIndex=b.expirationTime,t(a,b);else break;b=n(d)}}function N(I){if(C=!1,g(I),!E)if(n(a)!==null)E=!0,B(P);else{var b=n(d);b!==null&&J(N,b.startTime-I)}}function P(I,b){E=!1,C&&(C=!1,v(D),D=-1),x=!0;var W=y;try{for(g(b),w=n(a);w!==null&&(!(w.expirationTime>b)||I&&!ie());){var te=w.callback;if(typeof te=="function"){w.callback=null,y=w.priorityLevel;var ee=te(w.expirationTime<=b);b=e.unstable_now(),typeof ee=="function"?w.callback=ee:w===n(a)&&r(a),g(b)}else r(a);w=n(a)}if(w!==null)var pe=!0;else{var Be=n(d);Be!==null&&J(N,Be.startTime-b),pe=!1}return pe}finally{w=null,y=W,x=!1}}var $=!1,O=null,D=-1,H=5,U=-1;function ie(){return!(e.unstable_now()-UI||125te?(I.sortIndex=W,t(d,I),n(a)===null&&I===n(d)&&(C?(v(D),D=-1):C=!0,J(N,W-te))):(I.sortIndex=ee,t(a,I),E||x||(E=!0,B(P))),I},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(I){var b=y;return function(){var W=y;y=b;try{return I.apply(this,arguments)}finally{y=W}}}})(sf);of.exports=sf;var Wm=of.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 Vm=f,at=Wm;function j(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"),bs=Object.prototype.hasOwnProperty,Km=/^[: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]*$/,pc={},hc={};function Qm(e){return bs.call(hc,e)?!0:bs.call(pc,e)?!1:Km.test(e)?hc[e]=!0:(pc[e]=!0,!1)}function Gm(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 Ym(e,t,n,r){if(t===null||typeof t>"u"||Gm(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 Ye(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 $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new Ye(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new Ye(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new Ye(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new Ye(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){$e[e]=new Ye(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new Ye(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new Ye(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new Ye(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new Ye(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ha=/[\-:]([a-z])/g;function Wa(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(Ha,Wa);$e[t]=new Ye(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(Ha,Wa);$e[t]=new Ye(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(Ha,Wa);$e[t]=new Ye(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new Ye(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new Ye("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new Ye(e,1,!1,e.toLowerCase(),null,!0,!0)});function Va(e,t,n,r){var l=$e.hasOwnProperty(t)?$e[t]:null;(l!==null?l.type!==0:r||!(2s||l[i]!==o[s]){var a=` -`+l[i].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=i&&0<=s);break}}}finally{ss=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?gl(e):""}function Jm(e){switch(e.tag){case 5:return gl(e.type);case 16:return gl("Lazy");case 13:return gl("Suspense");case 19:return gl("SuspenseList");case 0:case 2:case 15:return e=as(e.type,!1),e;case 11:return e=as(e.type.render,!1),e;case 1:return e=as(e.type,!0),e;default:return""}}function Ws(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 Er:return"Fragment";case kr:return"Portal";case Us:return"Profiler";case Ka:return"StrictMode";case Bs:return"Suspense";case Hs:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case cf:return(e.displayName||"Context")+".Consumer";case uf:return(e._context.displayName||"Context")+".Provider";case Qa:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ga:return t=e.displayName||null,t!==null?t:Ws(e.type)||"Memo";case dn:t=e._payload,e=e._init;try{return Ws(e(t))}catch{}}return null}function Xm(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 Ws(t);case 8:return t===Ka?"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 Nn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ff(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qm(e){var t=ff(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 So(e){e._valueTracker||(e._valueTracker=qm(e))}function pf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ff(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ei(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 Vs(e,t){var n=t.checked;return ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Nn(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 hf(e,t){t=t.checked,t!=null&&Va(e,"checked",t,!1)}function Ks(e,t){hf(e,t);var n=Nn(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")?Qs(e,t.type,n):t.hasOwnProperty("defaultValue")&&Qs(e,t.type,Nn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vc(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 Qs(e,t,n){(t!=="number"||ei(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vl=Array.isArray;function Ir(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=xo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Sl={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},Zm=["Webkit","ms","Moz","O"];Object.keys(Sl).forEach(function(e){Zm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Sl[t]=Sl[e]})});function yf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Sl.hasOwnProperty(e)&&Sl[e]?(""+t).trim():t+"px"}function wf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=yf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var eg=ye({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 Js(e,t){if(t){if(eg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(j(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(j(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(j(61))}if(t.style!=null&&typeof t.style!="object")throw Error(j(62))}}function Xs(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 qs=null;function Ya(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zs=null,$r=null,Or=null;function Sc(e){if(e=Xl(e)){if(typeof Zs!="function")throw Error(j(280));var t=e.stateNode;t&&(t=Pi(t),Zs(e.stateNode,e.type,t))}}function Sf(e){$r?Or?Or.push(e):Or=[e]:$r=e}function xf(){if($r){var e=$r,t=Or;if(Or=$r=null,Sc(e),t)for(e=0;e>>=0,e===0?32:31-(dg(e)/fg|0)|0}var ko=64,Eo=4194304;function yl(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 li(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 s=i&~l;s!==0?r=yl(s):(o&=i,o!==0&&(r=yl(o)))}else i=n&~l,i!==0?r=yl(i):o!==0&&(r=yl(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 Yl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=n}function gg(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=kl),Lc=" ",Tc=!1;function Uf(e,t){switch(e){case"keyup":return Wg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cr=!1;function Kg(e,t){switch(e){case"compositionend":return Bf(t);case"keypress":return t.which!==32?null:(Tc=!0,Lc);case"textInput":return e=t.data,e===Lc&&Tc?null:e;default:return null}}function Qg(e,t){if(Cr)return e==="compositionend"||!ru&&Uf(e,t)?(e=zf(),Bo=eu=mn=null,Cr=!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=Ic(n)}}function Kf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qf(){for(var e=window,t=ei();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ei(e.document)}return t}function lu(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 nv(e){var t=Qf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Kf(n.ownerDocument.documentElement,n)){if(r!==null&&lu(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=$c(n,o);var i=$c(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,Nr=null,oa=null,Cl=null,ia=!1;function Oc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ia||Nr==null||Nr!==ei(r)||(r=Nr,"selectionStart"in r&&lu(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}),Cl&&Ol(Cl,r)||(Cl=r,r=si(oa,"onSelect"),0jr||(e.current=fa[jr],fa[jr]=null,jr--)}function ae(e,t){jr++,fa[jr]=e.current,e.current=t}var _n={},Ue=jn(_n),et=jn(!1),Qn=_n;function Ur(e,t){var n=e.type.contextTypes;if(!n)return _n;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 tt(e){return e=e.childContextTypes,e!=null}function ui(){de(et),de(Ue)}function Hc(e,t,n){if(Ue.current!==_n)throw Error(j(168));ae(Ue,t),ae(et,n)}function np(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(j(108,Xm(e)||"Unknown",l));return ye({},n,r)}function ci(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_n,Qn=Ue.current,ae(Ue,e),ae(et,et.current),!0}function Wc(e,t,n){var r=e.stateNode;if(!r)throw Error(j(169));n?(e=np(e,t,Qn),r.__reactInternalMemoizedMergedChildContext=e,de(et),de(Ue),ae(Ue,e)):de(et),ae(et,n)}var Qt=null,Mi=!1,ks=!1;function rp(e){Qt===null?Qt=[e]:Qt.push(e)}function hv(e){Mi=!0,rp(e)}function Ln(){if(!ks&&Qt!==null){ks=!0;var e=0,t=oe;try{var n=Qt;for(oe=1;e>=i,l-=i,Gt=1<<32-Nt(t)+l|n<D?(H=O,O=null):H=O.sibling;var U=y(v,O,g[D],N);if(U===null){O===null&&(O=H);break}e&&O&&U.alternate===null&&t(v,O),h=o(U,h,D),$===null?P=U:$.sibling=U,$=U,O=H}if(D===g.length)return n(v,O),fe&&bn(v,D),P;if(O===null){for(;DD?(H=O,O=null):H=O.sibling;var ie=y(v,O,U.value,N);if(ie===null){O===null&&(O=H);break}e&&O&&ie.alternate===null&&t(v,O),h=o(ie,h,D),$===null?P=ie:$.sibling=ie,$=ie,O=H}if(U.done)return n(v,O),fe&&bn(v,D),P;if(O===null){for(;!U.done;D++,U=g.next())U=w(v,U.value,N),U!==null&&(h=o(U,h,D),$===null?P=U:$.sibling=U,$=U);return fe&&bn(v,D),P}for(O=r(v,O);!U.done;D++,U=g.next())U=x(O,v,D,U.value,N),U!==null&&(e&&U.alternate!==null&&O.delete(U.key===null?D:U.key),h=o(U,h,D),$===null?P=U:$.sibling=U,$=U);return e&&O.forEach(function(_e){return t(v,_e)}),fe&&bn(v,D),P}function R(v,h,g,N){if(typeof g=="object"&&g!==null&&g.type===Er&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case wo:e:{for(var P=g.key,$=h;$!==null;){if($.key===P){if(P=g.type,P===Er){if($.tag===7){n(v,$.sibling),h=l($,g.props.children),h.return=v,v=h;break e}}else if($.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===dn&&Qc(P)===$.type){n(v,$.sibling),h=l($,g.props),h.ref=dl(v,$,g),h.return=v,v=h;break e}n(v,$);break}else t(v,$);$=$.sibling}g.type===Er?(h=Kn(g.props.children,v.mode,N,g.key),h.return=v,v=h):(N=Jo(g.type,g.key,g.props,null,v.mode,N),N.ref=dl(v,h,g),N.return=v,v=N)}return i(v);case kr:e:{for($=g.key;h!==null;){if(h.key===$)if(h.tag===4&&h.stateNode.containerInfo===g.containerInfo&&h.stateNode.implementation===g.implementation){n(v,h.sibling),h=l(h,g.children||[]),h.return=v,v=h;break e}else{n(v,h);break}else t(v,h);h=h.sibling}h=Ts(g,v.mode,N),h.return=v,v=h}return i(v);case dn:return $=g._init,R(v,h,$(g._payload),N)}if(vl(g))return E(v,h,g,N);if(il(g))return C(v,h,g,N);To(v,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,h!==null&&h.tag===6?(n(v,h.sibling),h=l(h,g),h.return=v,v=h):(n(v,h),h=Ls(g,v.mode,N),h.return=v,v=h),i(v)):n(v,h)}return R}var Hr=sp(!0),ap=sp(!1),pi=jn(null),hi=null,Pr=null,au=null;function uu(){au=Pr=hi=null}function cu(e){var t=pi.current;de(pi),e._currentValue=t}function ma(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 Fr(e,t){hi=e,au=Pr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ze=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(au!==e)if(e={context:e,memoizedValue:t,next:null},Pr===null){if(hi===null)throw Error(j(308));Pr=e,hi.dependencies={lanes:0,firstContext:e}}else Pr=Pr.next=e;return t}var Hn=null;function du(e){Hn===null?Hn=[e]:Hn.push(e)}function up(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,du(t)):(n.next=l.next,l.next=n),t.interleaved=n,en(e,r)}function en(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 fn=!1;function fu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cp(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 Jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Z&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,en(e,n)}return l=r.interleaved,l===null?(t.next=t,du(r)):(t.next=l.next,l.next=t),r.interleaved=t,en(e,n)}function Wo(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,Xa(e,n)}}function Gc(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 mi(e,t,n,r){var l=e.updateQueue;fn=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,s=l.shared.pending;if(s!==null){l.shared.pending=null;var a=s,d=a.next;a.next=null,i===null?o=d:i.next=d,i=a;var m=e.alternate;m!==null&&(m=m.updateQueue,s=m.lastBaseUpdate,s!==i&&(s===null?m.firstBaseUpdate=d:s.next=d,m.lastBaseUpdate=a))}if(o!==null){var w=l.baseState;i=0,m=d=a=null,s=o;do{var y=s.lane,x=s.eventTime;if((r&y)===y){m!==null&&(m=m.next={eventTime:x,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var E=e,C=s;switch(y=t,x=n,C.tag){case 1:if(E=C.payload,typeof E=="function"){w=E.call(x,w,y);break e}w=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=C.payload,y=typeof E=="function"?E.call(x,w,y):E,y==null)break e;w=ye({},w,y);break e;case 2:fn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,y=l.effects,y===null?l.effects=[s]:y.push(s))}else x={eventTime:x,lane:y,tag:s.tag,payload:s.payload,callback:s.callback,next:null},m===null?(d=m=x,a=w):m=m.next=x,i|=y;if(s=s.next,s===null){if(s=l.shared.pending,s===null)break;y=s,s=y.next,y.next=null,l.lastBaseUpdate=y,l.shared.pending=null}}while(!0);if(m===null&&(a=w),l.baseState=a,l.firstBaseUpdate=d,l.lastBaseUpdate=m,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);Jn|=i,e.lanes=i,e.memoizedState=w}}function Yc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Cs.transition;Cs.transition={};try{e(!1),t()}finally{oe=n,Cs.transition=r}}function Rp(){return vt().memoizedState}function yv(e,t,n){var r=En(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},jp(e))Lp(t,n);else if(n=up(e,t,n,r),n!==null){var l=Qe();_t(n,e,r,l),Tp(n,t,r)}}function wv(e,t,n){var r=En(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(jp(e))Lp(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,s=o(i,n);if(l.hasEagerState=!0,l.eagerState=s,Rt(s,i)){var a=t.interleaved;a===null?(l.next=l,du(t)):(l.next=a.next,a.next=l),t.interleaved=l;return}}catch{}finally{}n=up(e,t,l,r),n!==null&&(l=Qe(),_t(n,e,r,l),Tp(n,t,r))}}function jp(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function Lp(e,t){Nl=vi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Tp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xa(e,n)}}var yi={readContext:gt,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},Sv={readContext:gt,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Xc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ko(4194308,4,kp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ko(4,2,e,t)},useMemo:function(e,t){var n=Ot();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ot();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=yv.bind(null,ge,e),[r.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:Jc,useDebugValue:Su,useDeferredValue:function(e){return Ot().memoizedState=e},useTransition:function(){var e=Jc(!1),t=e[0];return e=vv.bind(null,e[1]),Ot().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ge,l=Ot();if(fe){if(n===void 0)throw Error(j(407));n=n()}else{if(n=t(),Pe===null)throw Error(j(349));Yn&30||hp(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Xc(gp.bind(null,r,o,e),[e]),r.flags|=2048,Wl(9,mp.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ot(),t=Pe.identifierPrefix;if(fe){var n=Yt,r=Gt;n=(r&~(1<<32-Nt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Bl++,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[Dt]=t,e[zl]=r,bp(e,t,!1,!1),t.stateNode=e;e:{switch(i=Xs(n,r),n){case"dialog":ce("cancel",e),ce("close",e),l=r;break;case"iframe":case"object":case"embed":ce("load",e),l=r;break;case"video":case"audio":for(l=0;lKr&&(t.flags|=128,r=!0,fl(o,!1),t.lanes=4194304)}else{if(!r)if(e=gi(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!fe)return ze(t),null}else 2*ke()-o.renderingStartTime>Kr&&n!==1073741824&&(t.flags|=128,r=!0,fl(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=ke(),t.sibling=null,n=me.current,ae(me,r?n&1|2:n&1),t):(ze(t),null);case 22:case 23:return _u(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ot&1073741824&&(ze(t),t.subtreeFlags&6&&(t.flags|=8192)):ze(t),null;case 24:return null;case 25:return null}throw Error(j(156,t.tag))}function jv(e,t){switch(iu(t),t.tag){case 1:return tt(t.type)&&ui(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wr(),de(et),de(Ue),mu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return hu(t),null;case 13:if(de(me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));Br()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(me),null;case 4:return Wr(),null;case 10:return cu(t.type._context),null;case 22:case 23:return _u(),null;case 24:return null;default:return null}}var Mo=!1,be=!1,Lv=typeof WeakSet=="function"?WeakSet:Set,F=null;function Mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function Ca(e,t,n){try{n()}catch(r){Se(e,t,r)}}var ad=!1;function Tv(e,t){if(sa=oi,e=Qf(),lu(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,s=-1,a=-1,d=0,m=0,w=e,y=null;t:for(;;){for(var x;w!==n||l!==0&&w.nodeType!==3||(s=i+l),w!==o||r!==0&&w.nodeType!==3||(a=i+r),w.nodeType===3&&(i+=w.nodeValue.length),(x=w.firstChild)!==null;)y=w,w=x;for(;;){if(w===e)break t;if(y===n&&++d===l&&(s=i),y===o&&++m===r&&(a=i),(x=w.nextSibling)!==null)break;w=y,y=w.parentNode}w=x}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(aa={focusedElem:e,selectionRange:n},oi=!1,F=t;F!==null;)if(t=F,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,F=e;else for(;F!==null;){t=F;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var C=E.memoizedProps,R=E.memoizedState,v=t.stateNode,h=v.getSnapshotBeforeUpdate(t.elementType===t.type?C:kt(t.type,C),R);v.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(N){Se(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,F=e;break}F=t.return}return E=ad,ad=!1,E}function _l(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&&Ca(t,n,o)}l=l.next}while(l!==r)}}function $i(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 Na(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 Hp(e){var t=e.alternate;t!==null&&(e.alternate=null,Hp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Dt],delete t[zl],delete t[da],delete t[fv],delete t[pv])),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 Wp(e){return e.tag===5||e.tag===3||e.tag===4}function ud(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wp(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 _a(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=ai));else if(r!==4&&(e=e.child,e!==null))for(_a(e,t,n),e=e.sibling;e!==null;)_a(e,t,n),e=e.sibling}function Ra(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(Ra(e,t,n),e=e.sibling;e!==null;)Ra(e,t,n),e=e.sibling}var Ae=null,Et=!1;function cn(e,t,n){for(n=n.child;n!==null;)Vp(e,t,n),n=n.sibling}function Vp(e,t,n){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(Ri,n)}catch{}switch(n.tag){case 5:be||Mr(n,t);case 6:var r=Ae,l=Et;Ae=null,cn(e,t,n),Ae=r,Et=l,Ae!==null&&(Et?(e=Ae,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ae.removeChild(n.stateNode));break;case 18:Ae!==null&&(Et?(e=Ae,n=n.stateNode,e.nodeType===8?xs(e.parentNode,n):e.nodeType===1&&xs(e,n),Il(e)):xs(Ae,n.stateNode));break;case 4:r=Ae,l=Et,Ae=n.stateNode.containerInfo,Et=!0,cn(e,t,n),Ae=r,Et=l;break;case 0:case 11:case 14:case 15:if(!be&&(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)&&Ca(n,t,i),l=l.next}while(l!==r)}cn(e,t,n);break;case 1:if(!be&&(Mr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Se(n,t,s)}cn(e,t,n);break;case 21:cn(e,t,n);break;case 22:n.mode&1?(be=(r=be)||n.memoizedState!==null,cn(e,t,n),be=r):cn(e,t,n);break;default:cn(e,t,n)}}function cd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Lv),t.forEach(function(r){var l=zv.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function xt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=ke()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Mv(r/1960))-r,10e?16:e,gn===null)var r=!1;else{if(e=gn,gn=null,xi=0,Z&6)throw Error(j(331));var l=Z;for(Z|=4,F=e.current;F!==null;){var o=F,i=o.child;if(F.flags&16){var s=o.deletions;if(s!==null){for(var a=0;ake()-Cu?Vn(e,0):Eu|=n),nt(e,t)}function Zp(e,t){t===0&&(e.mode&1?(t=Eo,Eo<<=1,!(Eo&130023424)&&(Eo=4194304)):t=1);var n=Qe();e=en(e,t),e!==null&&(Yl(e,t,n),nt(e,n))}function Fv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zp(e,n)}function zv(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(j(314))}r!==null&&r.delete(t),Zp(e,n)}var eh;eh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||et.current)Ze=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ze=!1,_v(e,t,n);Ze=!!(e.flags&131072)}else Ze=!1,fe&&t.flags&1048576&&lp(t,fi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Qo(e,t),e=t.pendingProps;var l=Ur(t,Ue.current);Fr(t,n),l=vu(null,t,r,e,l,n);var o=yu();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,tt(r)?(o=!0,ci(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,fu(t),l.updater=Ii,t.stateNode=l,l._reactInternals=t,va(t,r,e,n),t=Sa(null,t,r,!0,o,n)):(t.tag=0,fe&&o&&ou(t),Ke(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Qo(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Uv(r),e=kt(r,e),l){case 0:t=wa(null,t,r,e,n);break e;case 1:t=od(null,t,r,e,n);break e;case 11:t=rd(null,t,r,e,n);break e;case 14:t=ld(null,t,r,kt(r.type,e),n);break e}throw Error(j(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kt(r,l),wa(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kt(r,l),od(e,t,r,l,n);case 3:e:{if(Dp(t),e===null)throw Error(j(387));r=t.pendingProps,o=t.memoizedState,l=o.element,cp(e,t),mi(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=Vr(Error(j(423)),t),t=id(e,t,r,n,l);break e}else if(r!==l){l=Vr(Error(j(424)),t),t=id(e,t,r,n,l);break e}else for(it=Sn(t.stateNode.containerInfo.firstChild),st=t,fe=!0,Ct=null,n=ap(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Br(),r===l){t=tn(e,t,n);break e}Ke(e,t,r,n)}t=t.child}return t;case 5:return dp(t),e===null&&ha(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,ua(r,l)?i=null:o!==null&&ua(r,o)&&(t.flags|=32),Op(e,t),Ke(e,t,i,n),t.child;case 6:return e===null&&ha(t),null;case 13:return Fp(e,t,n);case 4:return pu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Hr(t,null,r,n):Ke(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kt(r,l),rd(e,t,r,l,n);case 7:return Ke(e,t,t.pendingProps,n),t.child;case 8:return Ke(e,t,t.pendingProps.children,n),t.child;case 12:return Ke(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,ae(pi,r._currentValue),r._currentValue=i,o!==null)if(Rt(o.value,i)){if(o.children===l.children&&!et.current){t=tn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){i=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=Jt(-1,n&-n),a.tag=2;var d=o.updateQueue;if(d!==null){d=d.shared;var m=d.pending;m===null?a.next=a:(a.next=m.next,m.next=a),d.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ma(o.return,n,t),s.lanes|=n;break}a=a.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(j(341));i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ma(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}Ke(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Fr(t,n),l=gt(l),r=r(l),t.flags|=1,Ke(e,t,r,n),t.child;case 14:return r=t.type,l=kt(r,t.pendingProps),l=kt(r.type,l),ld(e,t,r,l,n);case 15:return Ip(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:kt(r,l),Qo(e,t),t.tag=1,tt(r)?(e=!0,ci(t)):e=!1,Fr(t,n),Pp(t,r,l),va(t,r,l,n),Sa(null,t,r,!0,e,n);case 19:return zp(e,t,n);case 22:return $p(e,t,n)}throw Error(j(156,t.tag))};function th(e,t){return jf(e,t)}function bv(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 ht(e,t,n,r){return new bv(e,t,n,r)}function ju(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Uv(e){if(typeof e=="function")return ju(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qa)return 11;if(e===Ga)return 14}return 2}function Cn(e,t){var n=e.alternate;return n===null?(n=ht(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 Jo(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")ju(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Er:return Kn(n.children,l,o,t);case Ka:i=8,l|=8;break;case Us:return e=ht(12,n,t,l|2),e.elementType=Us,e.lanes=o,e;case Bs:return e=ht(13,n,t,l),e.elementType=Bs,e.lanes=o,e;case Hs:return e=ht(19,n,t,l),e.elementType=Hs,e.lanes=o,e;case df:return Di(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case uf:i=10;break e;case cf:i=9;break e;case Qa:i=11;break e;case Ga:i=14;break e;case dn:i=16,r=null;break e}throw Error(j(130,e==null?e:typeof e,""))}return t=ht(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Kn(e,t,n,r){return e=ht(7,e,r,t),e.lanes=n,e}function Di(e,t,n,r){return e=ht(22,e,r,t),e.elementType=df,e.lanes=n,e.stateNode={isHidden:!1},e}function Ls(e,t,n){return e=ht(6,e,null,t),e.lanes=n,e}function Ts(e,t,n){return t=ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bv(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=cs(0),this.expirationTimes=cs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cs(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Lu(e,t,n,r,l,o,i,s,a){return e=new Bv(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ht(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fu(o),e}function Hv(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oh)}catch(e){console.error(e)}}oh(),lf.exports=ut;var ih=lf.exports,sh,yd=ih;sh=yd.createRoot,yd.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 wd="popstate";function Gv(e={}){function t(l,o){let{pathname:i="/",search:s="",hash:a=""}=er(l.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),Ma("",{pathname:i,search:s,hash:a},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(l,o){let i=l.document.querySelector("base"),s="";if(i&&i.getAttribute("href")){let a=l.location.href,d=a.indexOf("#");s=d===-1?a:a.slice(0,d)}return s+"#"+(typeof o=="string"?o:Kl(o))}function r(l,o){jt(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return Jv(t,n,r,e)}function ve(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function jt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Yv(){return Math.random().toString(36).substring(2,10)}function Sd(e,t){return{usr:e.state,key:e.key,idx:t}}function Ma(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?er(t):t,state:n,key:t&&t.key||r||Yv()}}function Kl({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 er(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 Jv(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,s="POP",a=null,d=m();d==null&&(d=0,i.replaceState({...i.state,idx:d},""));function m(){return(i.state||{idx:null}).idx}function w(){s="POP";let R=m(),v=R==null?null:R-d;d=R,a&&a({action:s,location:C.location,delta:v})}function y(R,v){s="PUSH";let h=Ma(C.location,R,v);n&&n(h,R),d=m()+1;let g=Sd(h,d),N=C.createHref(h);try{i.pushState(g,"",N)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;l.location.assign(N)}o&&a&&a({action:s,location:C.location,delta:1})}function x(R,v){s="REPLACE";let h=Ma(C.location,R,v);n&&n(h,R),d=m();let g=Sd(h,d),N=C.createHref(h);i.replaceState(g,"",N),o&&a&&a({action:s,location:C.location,delta:0})}function E(R){return Xv(R)}let C={get action(){return s},get location(){return e(l,i)},listen(R){if(a)throw new Error("A history only accepts one active listener");return l.addEventListener(wd,w),a=R,()=>{l.removeEventListener(wd,w),a=null}},createHref(R){return t(l,R)},createURL:E,encodeLocation(R){let v=E(R);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:y,replace:x,go(R){return i.go(R)}};return C}function Xv(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ve(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Kl(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function ah(e,t,n="/"){return qv(e,t,n,!1)}function qv(e,t,n,r){let l=typeof t=="string"?er(t):t,o=nn(l.pathname||"/",n);if(o==null)return null;let i=uh(e);Zv(i);let s=null;for(let a=0;s==null&&a{let m={relativePath:d===void 0?i.path||"":d,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&a)return;ve(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let w=Xt([r,m.relativePath]),y=n.concat(m);i.children&&i.children.length>0&&(ve(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${w}".`),uh(i.children,t,y,w,a)),!(i.path==null&&!i.index)&&t.push({path:w,score:iy(w,i.index),routesMeta:y})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let d of ch(i.path))o(i,s,!0,d)}),t}function ch(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=ch(r.join("/")),s=[];return s.push(...i.map(a=>a===""?o:[o,a].join("/"))),l&&s.push(...i),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function Zv(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:sy(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var ey=/^:[\w-]+$/,ty=3,ny=2,ry=1,ly=10,oy=-2,xd=e=>e==="*";function iy(e,t){let n=e.split("/"),r=n.length;return n.some(xd)&&(r+=oy),t&&(r+=ny),n.filter(l=>!xd(l)).reduce((l,o)=>l+(ey.test(o)?ty:o===""?ry:ly),r)}function sy(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 ay(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",i=[];for(let s=0;s{if(m==="*"){let E=s[y]||"";i=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const x=s[y];return w&&!x?d[m]=void 0:d[m]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:i,pattern:e}}function uy(e,t=!1,n=!0){jt(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,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)")).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 cy(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return jt(!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 nn(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 dy(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?er(e):e;return{pathname:n?n.startsWith("/")?n:fy(n,t):t,search:my(r),hash:gy(l)}}function fy(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 Ps(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 py(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function dh(e){let t=py(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function fh(e,t,n,r=!1){let l;typeof e=="string"?l=er(e):(l={...e},ve(!l.pathname||!l.pathname.includes("?"),Ps("?","pathname","search",l)),ve(!l.pathname||!l.pathname.includes("#"),Ps("#","pathname","hash",l)),ve(!l.search||!l.search.includes("#"),Ps("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,s;if(i==null)s=n;else{let w=t.length-1;if(!r&&i.startsWith("..")){let y=i.split("/");for(;y[0]==="..";)y.shift(),w-=1;l.pathname=y.join("/")}s=w>=0?t[w]:"/"}let a=dy(l,s),d=i&&i!=="/"&&i.endsWith("/"),m=(o||i===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(d||m)&&(a.pathname+="/"),a}var Xt=e=>e.join("/").replace(/\/\/+/g,"/"),hy=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),my=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gy=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function vy(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var ph=["POST","PUT","PATCH","DELETE"];new Set(ph);var yy=["GET",...ph];new Set(yy);var Jr=f.createContext(null);Jr.displayName="DataRouter";var Bi=f.createContext(null);Bi.displayName="DataRouterState";f.createContext(!1);var hh=f.createContext({isTransitioning:!1});hh.displayName="ViewTransition";var wy=f.createContext(new Map);wy.displayName="Fetchers";var Sy=f.createContext(null);Sy.displayName="Await";var bt=f.createContext(null);bt.displayName="Navigation";var Zl=f.createContext(null);Zl.displayName="Location";var ln=f.createContext({outlet:null,matches:[],isDataRoute:!1});ln.displayName="Route";var Au=f.createContext(null);Au.displayName="RouteError";function xy(e,{relative:t}={}){ve(eo(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=f.useContext(bt),{hash:l,pathname:o,search:i}=to(e,{relative:t}),s=o;return n!=="/"&&(s=o==="/"?n:Xt([n,o])),r.createHref({pathname:s,search:i,hash:l})}function eo(){return f.useContext(Zl)!=null}function tr(){return ve(eo(),"useLocation() may be used only in the context of a component."),f.useContext(Zl).location}var mh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function gh(e){f.useContext(bt).static||f.useLayoutEffect(e)}function ky(){let{isDataRoute:e}=f.useContext(ln);return e?$y():Ey()}function Ey(){ve(eo(),"useNavigate() may be used only in the context of a component.");let e=f.useContext(Jr),{basename:t,navigator:n}=f.useContext(bt),{matches:r}=f.useContext(ln),{pathname:l}=tr(),o=JSON.stringify(dh(r)),i=f.useRef(!1);return gh(()=>{i.current=!0}),f.useCallback((a,d={})=>{if(jt(i.current,mh),!i.current)return;if(typeof a=="number"){n.go(a);return}let m=fh(a,JSON.parse(o),l,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Xt([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,o,l,e])}f.createContext(null);function to(e,{relative:t}={}){let{matches:n}=f.useContext(ln),{pathname:r}=tr(),l=JSON.stringify(dh(n));return f.useMemo(()=>fh(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function Cy(e,t){return vh(e,t)}function vh(e,t,n,r,l){var h;ve(eo(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=f.useContext(bt),{matches:i}=f.useContext(ln),s=i[i.length-1],a=s?s.params:{},d=s?s.pathname:"/",m=s?s.pathnameBase:"/",w=s&&s.route;{let g=w&&w.path||"";yh(d,!w||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${d}" (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 y=tr(),x;if(t){let g=typeof t=="string"?er(t):t;ve(m==="/"||((h=g.pathname)==null?void 0:h.startsWith(m)),`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 "${m}" but pathname "${g.pathname}" was given in the \`location\` prop.`),x=g}else x=y;let E=x.pathname||"/",C=E;if(m!=="/"){let g=m.replace(/^\//,"").split("/");C="/"+E.replace(/^\//,"").split("/").slice(g.length).join("/")}let R=ah(e,{pathname:C});jt(w||R!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),jt(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.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 v=Ly(R&&R.map(g=>Object.assign({},g,{params:Object.assign({},a,g.params),pathname:Xt([m,o.encodeLocation?o.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?m:Xt([m,o.encodeLocation?o.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),i,n,r,l);return t&&v?f.createElement(Zl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},v):v}function Ny(){let e=Iy(),t=vy(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=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:o},"ErrorBoundary")," or"," ",f.createElement("code",{style:o},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:l},n):null,i)}var _y=f.createElement(Ny,null),Ry=class extends f.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?f.createElement(ln.Provider,{value:this.props.routeContext},f.createElement(Au.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function jy({routeContext:e,match:t,children:n}){let r=f.useContext(Jr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(ln.Provider,{value:e},n)}function Ly(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 d=o.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);ve(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,d+1))}let s=!1,a=-1;if(n)for(let d=0;d=0?o=o.slice(0,a+1):o=[o[0]];break}}}return o.reduceRight((d,m,w)=>{let y,x=!1,E=null,C=null;n&&(y=i&&m.route.id?i[m.route.id]:void 0,E=m.route.errorElement||_y,s&&(a<0&&w===0?(yh("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,C=null):a===w&&(x=!0,C=m.route.hydrateFallbackElement||null)));let R=t.concat(o.slice(0,w+1)),v=()=>{let h;return y?h=E:x?h=C:m.route.Component?h=f.createElement(m.route.Component,null):m.route.element?h=m.route.element:h=d,f.createElement(jy,{match:m,routeContext:{outlet:d,matches:R,isDataRoute:n!=null},children:h})};return n&&(m.route.ErrorBoundary||m.route.errorElement||w===0)?f.createElement(Ry,{location:n.location,revalidation:n.revalidation,component:E,error:y,children:v(),routeContext:{outlet:null,matches:R,isDataRoute:!0},unstable_onError:r}):v()},null)}function Iu(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ty(e){let t=f.useContext(Jr);return ve(t,Iu(e)),t}function Py(e){let t=f.useContext(Bi);return ve(t,Iu(e)),t}function My(e){let t=f.useContext(ln);return ve(t,Iu(e)),t}function $u(e){let t=My(e),n=t.matches[t.matches.length-1];return ve(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ay(){return $u("useRouteId")}function Iy(){var r;let e=f.useContext(Au),t=Py("useRouteError"),n=$u("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function $y(){let{router:e}=Ty("useNavigate"),t=$u("useNavigate"),n=f.useRef(!1);return gh(()=>{n.current=!0}),f.useCallback(async(l,o={})=>{jt(n.current,mh),n.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var kd={};function yh(e,t,n){!t&&!kd[e]&&(kd[e]=!0,jt(!1,n))}f.memo(Oy);function Oy({routes:e,future:t,state:n,unstable_onError:r}){return vh(e,void 0,n,r,t)}function wh(e){ve(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function Dy({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1}){ve(!eo(),"You cannot render a inside another . You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),s=f.useMemo(()=>({basename:i,navigator:l,static:o,future:{}}),[i,l,o]);typeof n=="string"&&(n=er(n));let{pathname:a="/",search:d="",hash:m="",state:w=null,key:y="default"}=n,x=f.useMemo(()=>{let E=nn(a,i);return E==null?null:{location:{pathname:E,search:d,hash:m,state:w,key:y},navigationType:r}},[i,a,d,m,w,y,r]);return jt(x!=null,` is not able to match the URL "${a}${d}${m}" because it does not start with the basename, so the won't render anything.`),x==null?null:f.createElement(bt.Provider,{value:s},f.createElement(Zl.Provider,{children:t,value:x}))}function Fy({children:e,location:t}){return Cy(Aa(e),t)}function Aa(e,t=[]){let n=[];return f.Children.forEach(e,(r,l)=>{if(!f.isValidElement(r))return;let o=[...t,l];if(r.type===f.Fragment){n.push.apply(n,Aa(r.props.children,o));return}ve(r.type===wh,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),ve(!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=Aa(r.props.children,o)),n.push(i)}),n}var Xo="get",qo="application/x-www-form-urlencoded";function Hi(e){return e!=null&&typeof e.tagName=="string"}function zy(e){return Hi(e)&&e.tagName.toLowerCase()==="button"}function by(e){return Hi(e)&&e.tagName.toLowerCase()==="form"}function Uy(e){return Hi(e)&&e.tagName.toLowerCase()==="input"}function By(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Hy(e,t){return e.button===0&&(!t||t==="_self")&&!By(e)}var $o=null;function Wy(){if($o===null)try{new FormData(document.createElement("form"),0),$o=!1}catch{$o=!0}return $o}var Vy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ms(e){return e!=null&&!Vy.has(e)?(jt(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${qo}"`),null):e}function Ky(e,t){let n,r,l,o,i;if(by(e)){let s=e.getAttribute("action");r=s?nn(s,t):null,n=e.getAttribute("method")||Xo,l=Ms(e.getAttribute("enctype"))||qo,o=new FormData(e)}else if(zy(e)||Uy(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a `,E=`
${y}
`;return`
${x}${E}
`}),i=i.replace(/
\s*(?=
]*>[\s\S]*?<\/div>)\s*
/g,"$1"),i}function ow(e){const t=e.split(/\r?\n/);let n=null;for(let r=0;r[\s\S]*?<\/think(?:ing)?>/gi,"").replace(/[*#]/g,"").replace(/\s+/g," ").trim()}function xr(e,t,n){return e.includes(t)?e:`${e} - -${n}`}function sw(e){const t=String(e||""),n=t.trim();if(!n)return t;const r=n.toLowerCase();return r.startsWith("error:")||r.startsWith("ollama error:")||r.includes("client error '")||r.includes("server error '")||r.includes("http")&&r.includes("error")||r.includes("unknown model architecture")||r.includes("out of memory")?r.includes("unknown model architecture")?xr(t,"[ERROR - Unsupported Model]",`[ERROR - Unsupported Model] -This Ollama version does not support the model. -Update Ollama.`):r.includes("out of memory")?xr(t,"[ERROR - Out of Memory]",`[ERROR - Out of Memory] -The model is too large for available memory. -Use a smaller or quantized model.`):r.includes("502")?xr(t,"[ERROR 502 - Bad Gateway]",`[ERROR 502 - Bad Gateway] -Ollama did not return a valid response. -Try restarting or updating Ollama.`):r.includes("500")?xr(t,"[ERROR 500 - Internal Server Error]",`[ERROR 500 - Internal Server Error] -Ollama crashed while processing the request. -Check 'ollama logs' and memory usage.`):r.includes("404")?xr(t,"[ERROR 404 - Not Found]",`[ERROR 404 - Not Found] -The model or endpoint was not found. -Check the model name or run 'ollama pull '.`):r.includes("400")?xr(t,"[ERROR 400 - Bad Request]",`[ERROR 400 - Bad Request] -The request sent to Ollama was invalid. -Check parameters or payload format.`):t:t}function Th(e){if(!e)return{think:null,answer:""};const t=//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 s=e.substring(l+o);const a=s.match(n);let d=null,m=i;return a?(d=s.substring(0,a.index).trim(),m+=s.substring(a.index+a[0].length)):d=s.trim(),{think:d||null,answer:m.trim()}}function aw({content:e,streamOutput:t,sources:n}){const r=sw(e||""),{think:l,answer:o}=Th(r),[i,s]=Ve.useState(!1),a=!!l;return c.jsxs("div",{className:"assistant-message",children:[a&&c.jsxs("div",{className:"assistant-thoughts",children:[c.jsxs("button",{className:"think-toggle",onClick:()=>s(d=>!d),"aria-expanded":i?"true":"false","aria-controls":"think-content",children:[c.jsx("span",{className:"think-toggle-icon","aria-hidden":"true",children:i?"▾":"▸"}),"Thoughts"]}),i&&c.jsx("div",{id:"think-content",className:"think-content",dangerouslySetInnerHTML:{__html:bd(l)}})]}),c.jsx("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:bd(o||r||"")}}),Array.isArray(n)&&n.length>0&&c.jsx("div",{className:"msg-sources chips",children:n.map((d,m)=>{let w=d,y=!1;try{const x=new URL(d);if(x.protocol==="file:"){y=!0;const E=x.pathname.split("/").filter(Boolean);w=decodeURIComponent(E[E.length-1]||d)}else w=(x.hostname||d).replace(/^www\./i,"")}catch{}return c.jsx("a",{className:"chip",href:d,target:"_blank",rel:"noreferrer",title:d,onClick:x=>{var E,C;if(y){x.preventDefault();try{const R=new URL(d);(C=(E=window.electronAPI)==null?void 0:E.openPath)==null||C.call(E,decodeURIComponent(R.pathname))}catch{}}},children:w},d+m)})})]})}function Ds({attachments:e,className:t="",removable:n=!1,onRemove:r}){return!Array.isArray(e)||e.length===0?null:c.jsx("div",{className:`image-attachment-strip ${t}`.trim(),children:e.map((l,o)=>{const i=l==null?void 0:l.data_url;if(!i)return null;const s=l.id||`${l.name||"image"}-${o}-${i.length}`;return c.jsxs("div",{className:"image-attachment-card",children:[n&&c.jsx("button",{type:"button",className:"image-attachment-remove",onClick:()=>r==null?void 0:r(l.id),"aria-label":`Remove ${l.name||"image"}`,title:"Remove image",children:"×"}),c.jsx("img",{className:"image-attachment-thumb",src:i,alt:l.name||`Attachment ${o+1}`,loading:"lazy"})]},s)})})}const Ud="websearch.searxUrl",Bd="websearch.engines",Hd="chat.libraryBySession",Wd="http://127.0.0.1:8888",Fs=6,zs=20*1024*1024,uw=5*60*1e3,cw=200;let Ph="http://127.0.0.1:8000";const dw=48,fw=24;function pw(e){return e.backendApiUrl||e.ollamaApiUrl||Ph}function hw(e){const t=typeof e=="string"?e.trim():"";return!t||t==="http://localhost:8888"?Wd:t}function Fo(e){var n;return Array.from(((n=e==null?void 0:e.dataTransfer)==null?void 0:n.types)||[]).includes("Files")}function Fa(e){return e?typeof e.type=="string"&&e.type.toLowerCase().startsWith("image/")?!0:/\.(png|jpe?g|gif|bmp|webp|tiff?|heic|avif)$/i.test(e.name||""):!1}function Vd(e){var r,l;const t=Array.from(((r=e==null?void 0:e.dataTransfer)==null?void 0:r.items)||[]);return t.length>0?t.some(o=>{var i;return o.kind==="file"&&Fa((i=o.getAsFile)==null?void 0:i.call(o))}):Array.from(((l=e==null?void 0:e.dataTransfer)==null?void 0:l.files)||[]).some(Fa)}function Kd(e){return new Promise((t,n)=>{const r=new FileReader;r.onerror=()=>n(r.error||new Error(`Failed to read ${(e==null?void 0:e.name)||"image"}`)),r.onload=()=>t(String(r.result||"")),r.readAsDataURL(e)})}function mw(e,t){const n=String(t||"").trim();if(!n)return e||"";const r=String(e||"");if(!r.trim())return n;const l=/[\s\n]$/.test(r)?"":` -`;return`${r}${l}${n}`}function gw(e){const t=Math.max(0,Math.floor(Number(e||0)/1e3)),n=Math.floor(t/60),r=t%60;return`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function vw(){var uc;const[e,t]=f.useState([]),[n,r]=f.useState(null),[l,o]=f.useState("chats"),i=f.useRef(l),[s,a]=f.useState("General"),[d,m]=f.useState(null),[w,y]=f.useState(null),[x,E]=f.useState([]),[C,R]=f.useState([]),[v,h]=f.useState(null),[g,N]=f.useState(()=>{try{const u=localStorage.getItem(Hd);return u?JSON.parse(u):{}}catch{return{}}}),[P,$]=f.useState(!1),[O,D]=f.useState(""),[H,U]=f.useState(""),[ie,_e]=f.useState(!1),[we,yt]=f.useState(""),[M,B]=f.useState(""),[J,I]=f.useState("base"),[b,W]=f.useState(!1),[te,ee]=f.useState(""),[pe,Be]=f.useState([]),[wt,Oe]=f.useState(!1),Re=f.useRef(null),Lt=f.useRef(null),Tn=f.useRef(null),no=f.useRef(null),dt=f.useRef(0),[nr,ro]=f.useState(!0),[Vi,Tt]=f.useState(""),[lo,rr]=f.useState(""),[Ut,lr]=f.useState(!0),[Xr,Pn]=f.useState(""),[he,rt]=f.useState(!1),[lt,Bt]=f.useState(!1),[or,Pt]=f.useState(0),ir=f.useRef(null),Mn=f.useRef(null),sr=f.useRef([]),qr=f.useRef(null),ar=f.useRef(""),ur=f.useRef(null),cr=f.useRef(null),Zr=f.useRef(0),dr=f.useRef(null),[K,oo]=f.useState(Ph),[el,Ki]=f.useState("Default"),[on,Qi]=f.useState(!1),[io,An]=f.useState(""),[In,fr]=f.useState(!1),[sn,so]=f.useState(()=>hw(localStorage.getItem(Ud))),[Mt,ao]=f.useState(()=>ew(localStorage.getItem(Bd)));f.useEffect(()=>{localStorage.setItem(Ud,sn||"")},[sn]),f.useEffect(()=>{try{localStorage.setItem(Bd,JSON.stringify(Ni(Mt)))}catch{}},[Mt]);const[_,T]=f.useState(!1),[X,Je]=f.useState(!1),[uo,Gi]=f.useState(!0),[Mh,pr]=f.useState([]),[co,zu]=f.useState({}),[bu,Ah]=f.useState(!1),Uu=f.useRef(!1),[Ih,Yi]=f.useState(null),[Ji,fo]=f.useState("");function $h(u){const p=u.content||"";if(u.role==="assistant")try{const{answer:S}=Th(p);return(S||p).trim()}catch{return p.trim()}return p}async function Bu(u){try{await navigator.clipboard.writeText($h(u))}catch(p){console.error("Failed to copy message:",p)}}function $n(u,p,S,k={}){const{removeIfEmpty:L=!1}=k;t(A=>A.map(z=>{if(z.session_id!==u)return z;const V=[];for(const q of z.messages||[]){if(q.id!==p){V.push(q);continue}L&&!S||V.push({...q,content:S})}return{...z,messages:V}}))}function At(u){return(u==null?void 0:u.name)==="AbortError"}function Oh(u){return Array.isArray(u==null?void 0:u.attachments)&&u.attachments.length>0}function Dh(u=[]){return Array.isArray(u)&&u.length>0&&M||we}function Ht(u){return u instanceof Error&&u.message?u.message:String(u)}async function po(u){const p=await u.text().catch(()=>"");if(p){try{const S=JSON.parse(p);if(typeof(S==null?void 0:S.detail)=="string"&&S.detail.trim())return S.detail.trim();if(typeof(S==null?void 0:S.message)=="string"&&S.message.trim())return S.message.trim()}catch{}return p.trim()}return`HTTP ${u.status}`}async function tl(u){const p=await u.json().catch(()=>null);if(u.ok)return p;const S=typeof(p==null?void 0:p.detail)=="string"?p.detail:typeof(p==null?void 0:p.message)=="string"?p.message:"";throw new Error(S||`HTTP ${u.status}`)}async function Fh(u,p){const S=await fetch(`${K}/models/capabilities?name=${encodeURIComponent(u)}`,{signal:p});return tl(S)}async function zh(){const u=await fetch(`${K}/ollama/startup-status`);return tl(u)}async function bh(){const u=await fetch(`${K}/startup/prepare-models`,{method:"POST"});return tl(u)}function Hu(u){if(!!(u!=null&&u.whisper_model_available)){lr(!0),Pn("");return}const S=(u==null?void 0:u.whisper_model)||"base",k=String((u==null?void 0:u.whisper_error)||"").trim();lr(!1),Pn(k||`Whisper ${S} is not available.`)}async function Wu(u,p,S){if(!u)return{contextBlock:null,sources:[]};const L=await(await fetch(`${K}/libraries/${u}/context`,{method:"POST",headers:{"Content-Type":"application/json"},signal:S,body:JSON.stringify({prompt:p,top_k:5})})).json();return{contextBlock:typeof(L==null?void 0:L.context_block)=="string"&&L.context_block.trim()?L.context_block.trim():null,sources:Array.isArray(L==null?void 0:L.sources)?L.sources:[]}}async function Vu(u){const p=Array.from(u||[]).filter(Fa);if(!p.length||!b)return;const S=Math.max(0,Fs-pe.length);if(S<=0){window.alert(`You can attach up to ${Fs} images per message.`);return}const k=p.slice(0,S),L=k.filter(z=>Number(z.size)>zs),A=k.filter(z=>Number(z.size)<=zs);if(L.length>0&&window.alert(`Images must be ${Math.round(zs/(1024*1024))} MB or smaller.`),!!A.length)try{const z=await Promise.all(A.map(async(V,q)=>({id:`attachment-${Date.now()}-${q}-${Math.random().toString(36).slice(2)}`,name:V.name||"image",mime_type:V.type||"image/*",data_url:await Kd(V)})));Be(V=>[...V,...z]),p.length>S&&window.alert(`Only the first ${Fs} images can be attached.`)}catch(z){console.error("Failed to load image attachments",z),window.alert(`Image import failed: ${Ht(z)}`)}}function Uh(u){Be(p=>p.filter(S=>S.id!==u))}function Bh(){var u;b&&((u=no.current)==null||u.click())}function Xi(){ur.current&&(window.clearInterval(ur.current),ur.current=null),cr.current&&(window.clearTimeout(cr.current),cr.current=null)}function qi(u=Mn.current){Xi(),$a(u),Mn.current===u&&(Mn.current=null),ir.current=null}async function Hh(u,p){if(!K)throw new Error("The Heimgeist backend is not configured.");const S=new AbortController;dr.current=S,Bt(!0);try{const k=await Kd(u),L=k.indexOf(",");if(L<=5)throw new Error("Recorded audio could not be encoded for upload.");const A=k.slice(0,L),z=k.slice(L+1);if(!/^data:[^,]+;base64$/i.test(A)||!z)throw new Error("Recorded audio could not be encoded for upload.");const V=A.slice(5).replace(/;base64$/i,"").trim(),q=await fetch(`${K}/audio/transcribe`,{method:"POST",headers:{"Content-Type":"application/json"},signal:S.signal,body:JSON.stringify({mime_type:p||V||"audio/webm",audio_base64:z,model:J||null,language:lo||null})}),Ee=await tl(q),ne=String((Ee==null?void 0:Ee.text)||"").trim();if(!ne){window.alert("No speech was detected. Try again and speak closer to the selected microphone.");return}ee(le=>mw(le,ne)),requestAnimationFrame(()=>{var le;return(le=Lt.current)==null?void 0:le.focus()})}catch(k){if(At(k))return;throw k}finally{dr.current===S&&(dr.current=null),Bt(!1)}}async function nl(u={}){const{shouldTranscribe:p=!0}=u,S=ir.current,k=qr.current,L=ar.current||(S==null?void 0:S.mimeType)||"audio/webm";if(!(!S||!k)){rt(!1),Xi();try{S.state!=="inactive"&&S.stop();const A=await k;if(!p)return;if(!A||A.size<=0)throw new Error("Recorded audio was empty.");await Hh(A,L)}catch(A){p&&(console.error("Failed to stop microphone recording",A),window.alert(`Microphone transcription failed: ${Ht(A)}`))}finally{qr.current=null,sr.current=[],ar.current="",Zr.current=0,Pt(0)}}}async function Wh(){if(!nr||!Ut||he||lt||X)return;if(!Wi()){window.alert("Microphone capture is not available in this environment.");return}let u=null;try{u=await navigator.mediaDevices.getUserMedia(D0(Vi))}catch(k){console.error("Failed to access microphone",k),window.alert(`Microphone access failed: ${Ht(k)}`);return}const p=z0();let S=null;try{S=p?new MediaRecorder(u,{mimeType:p}):new MediaRecorder(u)}catch(k){qi(u),console.error("Failed to create audio recorder",k),window.alert(`Microphone recording is not available: ${Ht(k)}`);return}Mn.current=u,ir.current=S,sr.current=[],ar.current=S.mimeType||p||"audio/webm",Zr.current=Date.now(),Pt(0),rt(!0),S.ondataavailable=k=>{k.data&&k.data.size>0&&sr.current.push(k.data)},qr.current=new Promise((k,L)=>{S.onstop=()=>{const A=new Blob(sr.current,{type:S.mimeType||ar.current||"audio/webm"});qi(u),k(A)},S.onerror=A=>{qi(u),L((A==null?void 0:A.error)||new Error("Audio recording failed."))}}),ur.current=window.setInterval(()=>{Pt(Date.now()-Zr.current)},cw),cr.current=window.setTimeout(()=>{nl()},uw),S.start()}async function Vh(){if(!lt){if(he){await nl();return}await Wh()}}async function Kh(u){var S;const p=(S=u.target)==null?void 0:S.files;try{await Vu(p)}finally{u.target&&(u.target.value="")}}function Qh(u,p){Yi(u),fo(p||"")}function ho(){Yi(null),fo("")}async function Gh(u){var A;const p=(((A=vr[u])==null?void 0:A.content)||"").trim(),k=(Ji??"").trim();if(k.length===0){ho();return}if(k===p){ho();return}const L=n;if(L){t(z=>z.map(V=>{if(V.session_id!==L)return V;const Ee=(V.messages||[]).slice(0,u+1).map((ne,le)=>le===u?{...ne,content:k}:ne);return{...V,messages:Ee}})),Yi(null),fo(""),requestAnimationFrame(()=>rs("auto",L));try{const z=await fetch(`${K}/sessions/${L}/messages/${u}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k})});if(!z.ok)throw new Error(`HTTP ${z.status}`)}catch(z){console.error("Failed to update message:",z),t(V=>V.map(q=>{if(q.session_id!==L)return q;const ne=(q.messages||[]).map((le,He)=>He===u?{...le,content:p}:le);return{...q,messages:ne}}));return}await Ku(u,k)}}async function Ku(u,p=null){var le,He,Xe,Fn,Q,xe;const S=n;if(X||!S||typeof u!="number")return;const k=((le=e.find(re=>re.session_id===S))==null?void 0:le.messages)||[];let L=u;for(let re=u;re>=0;re--)if(((He=k[re])==null?void 0:He.role)==="user"){L=re;break}t(re=>re.map(se=>se.session_id===S?{...se,messages:(se.messages||[]).slice(0,L+1)}:se));const A=k.slice(0,L+1).some(Oh),z=A&&M||we;if(A&&!b){window.alert("The selected vision model does not support image inputs.");return}const V=qu(S);let q=p??(((Xe=k[L])==null?void 0:Xe.content)||""),Ee=[];const ne=[];try{const re=rc(S),se=p??(((Fn=k[L])==null?void 0:Fn.content)||""),Me=!!(se||"").trim();if(Me&&((Q=re==null?void 0:re.states)!=null&&Q.is_indexed))try{const G=await Wu(re.slug,se,V.signal);G.contextBlock&&ne.push(G.contextBlock),Array.isArray(G.sources)&&Ee.push(...G.sources)}catch(G){if(At(G))throw G;console.warn("local library enrichment (regenerate) failed",G)}if(Me&&_)try{const G=k.slice(Math.max(0,L-7),L+1).map(Ce=>({role:Ce.role,content:Ce.content||""}));G.length>0&&(G[G.length-1]={role:"user",content:se});const ue=await(await fetch(`${K}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:V.signal,body:JSON.stringify({prompt:se,model:we,messages:G,history_limit:8,searx_url:sn||null,engines:Array.isArray(Mt)?Mt:null})})).json();ue&&typeof ue.context_block=="string"&&ue.context_block.trim()&&ne.push(ue.context_block.trim()),Array.isArray(ue==null?void 0:ue.sources)&&Ee.push(...ue.sources)}catch(G){if(At(G))throw G;console.warn("web search enrichment (regenerate) failed",G)}if(Ee=[...new Set(Ee)],Me&&ne.length>0?q=`${se} - -${ne.join(` - -`)}`:q=null,on){const G=`msg-${Date.now()}-${Math.random()}`;let Vt="";t(ue=>ue.map(Ce=>Ce.session_id===S?{...Ce,messages:[...Ce.messages||[],{id:G,role:"assistant",content:"",sources:Ee}]}:Ce));try{const ue=await fetch(`${K}/sessions/${S}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:V.signal,body:JSON.stringify({index:u,model:z,stream:!0,enriched_message:q,sources:Ee||[]})});if(!ue.ok)throw new Error(await po(ue));const Ce=(xe=ue.body)==null?void 0:xe.getReader();if(!Ce)throw new Error("Missing response body");const un=new TextDecoder;let It=!1;for(;;){const{value:zn,done:Sm}=await Ce.read();if(Sm)break;const xm=un.decode(zn,{stream:!0});Vt+=xm,$n(S,G,Vt),!It&&De.current!==S&&(It=!0,On(ls=>({...ls,[S]:G})),pr(ls=>[...new Set([...ls,S])]))}De.current!==S?(On(zn=>({...zn,[S]:G})),pr(zn=>[...new Set([...zn,S])])):hr.current[S]?mr(zn=>({...zn,[S]:G})):requestAnimationFrame(()=>yr(G,"smooth",S))}catch(ue){if(At(ue)){$n(S,G,Vt,{removeIfEmpty:!0});return}console.error(ue),$n(S,G,`Error: ${Ht(ue)}`,{removeIfEmpty:!0});return}}else{const G=await fetch(`${K}/sessions/${S}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:V.signal,body:JSON.stringify({index:u,model:z,stream:!1,enriched_message:q,sources:Ee||[]})});if(!G.ok)throw new Error(await po(G));const Vt=await G.json(),ue=`msg-${Date.now()}`;t(Ce=>Ce.map(un=>un.session_id===S?{...un,messages:[...un.messages||[],{role:"assistant",content:Vt.reply,id:ue,sources:Ee}]}:un)),De.current!==S?(On(Ce=>({...Ce,[S]:ue})),pr(Ce=>[...new Set([...Ce,S])])):hr.current[S]?mr(Ce=>({...Ce,[S]:ue})):requestAnimationFrame(()=>yr(ue,"smooth",S))}}catch(re){At(re)||console.error(re)}finally{Zi(V)}}const[Qu,Yh]=f.useState({}),hr=f.useRef({}),[Jh,On]=f.useState({}),Dn=f.useRef({}),Gu=f.useRef({}),[Yu,mr]=f.useState({}),[Xh,Ju]=f.useState({});f.useEffect(()=>{i.current=l},[l]);const Xu=(u,p,S)=>u!=null&&u.id?u.id:`${S}:${p}`;f.useEffect(()=>{var p;if(!n)return;const u=((p=e.find(S=>S.session_id===n))==null?void 0:p.messages)||[];Ju(S=>{const k={};return u.forEach((L,A)=>{if(L.role!=="user")return;const z=Xu(L,A,n),q=(L.content||"").split(/\r\n|\r|\n/).length>30;k[z]=q?S[z]??!0:!1}),k})},[e,n]);function qh(u){Ju(p=>({...p,[u]:!(p[u]??!0)}))}const rl=Ve.useCallback((u,p)=>{Yh(S=>{const k={...S,[u]:p};return hr.current=k,k})},[]),gr=f.useRef(null),Zh=f.useRef(!1),em=f.useRef(null),De=f.useRef(n);f.useEffect(()=>{De.current=n},[n]);const qu=Ve.useCallback(u=>{const p=new AbortController;return gr.current={controller:p,sessionId:u},Je(!0),p},[]),Zi=Ve.useCallback(u=>{var p;((p=gr.current)==null?void 0:p.controller)===u&&(gr.current=null,Je(!1))},[]),tm=Ve.useCallback(()=>{const u=gr.current;u&&(gr.current=null,u.controller.abort(),Je(!1))},[]);f.useEffect(()=>()=>{var u;(u=gr.current)==null||u.controller.abort()},[]);const an=f.useRef(null),[nm,rm]=f.useState(230),[mo,Zu]=f.useState(!1),lm=Ve.useCallback(u=>{Zu(!0)},[]),ll=Ve.useCallback(()=>{Zu(!1)},[]),es=Ve.useCallback(u=>{if(mo){const p=Math.max(230,Math.min(500,u.clientX));rm(p)}},[mo]);Ve.useEffect(()=>(window.addEventListener("mousemove",es),window.addEventListener("mouseup",ll),window.addEventListener("blur",ll),()=>{window.removeEventListener("mousemove",es),window.removeEventListener("mouseup",ll),window.removeEventListener("blur",ll)}),[es,ll]),Ve.useEffect(()=>(mo?document.body.classList.add("no-select"):document.body.classList.remove("no-select"),()=>{document.body.classList.remove("no-select")}),[mo]),Ve.useEffect(()=>{const u=async p=>{const S=p.target.closest(".codeblock__copy");if(!S)return;const k=S.closest(".codeblock"),L=k==null?void 0:k.querySelector("pre > code");if(L)try{await navigator.clipboard.writeText(L.textContent||""),S.classList.add("copied"),setTimeout(()=>S.classList.remove("copied"),800)}catch(A){console.error("Copy failed:",A)}};return document.addEventListener("click",u),()=>document.removeEventListener("click",u)},[]),f.useEffect(()=>{let u=!1;return window.electronAPI.getSettings().then(p=>{u||(oo(pw(p)),Ki(p.colorScheme||"Default"),yt(p.chatModel||""),B(p.visionModel||p.chatModel||""),I(p.transcriptionModel||"base"),Qi(p.streamOutput||!1),ro(!0),p.audioInputEnabled!==!0&&window.electronAPI.setSetting("audioInputEnabled",!0),Tt(typeof p.audioInputDeviceId=="string"?p.audioInputDeviceId:""),rr(typeof p.audioInputLanguage=="string"?p.audioInputLanguage:""),zu(p.scrollPositions||{}),Ql(p.colorScheme||"Default"))}).finally(()=>{u||Ah(!0)}),()=>{u=!0}},[]),f.useEffect(()=>{const u=()=>{var p;i.current==="chats"&&((p=Lt.current)==null||p.focus())};return window.electronAPI.onWindowFocus(u),()=>{window.electronAPI.offWindowFocus(u)}},[]),f.useEffect(()=>{let u=!1;const p=new AbortController;return!K||!M?(W(!1),()=>{p.abort()}):((async()=>{try{const S=await Fh(M,p.signal);u||W(!!(S!=null&&S.supports_vision))}catch(S){!u&&!At(S)&&(console.warn("Failed to load model capabilities",S),W(!1))}})(),()=>{u=!0,p.abort()})},[K,M]),f.useEffect(()=>{dt.current=0,Oe(!1)},[b,l]),f.useEffect(()=>{nr||!he||nl({shouldTranscribe:!1})},[nr,he]),f.useEffect(()=>{Ut||!he||nl({shouldTranscribe:!1})},[Ut,he]),f.useEffect(()=>{l==="chats"||!he||nl()},[l,he]),f.useEffect(()=>()=>{var p;(p=dr.current)==null||p.abort(),Xi();const u=ir.current;if(u){u.ondataavailable=null,u.onstop=null,u.onerror=null;try{u.state!=="inactive"&&u.stop()}catch{}}$a(Mn.current)},[]),f.useEffect(()=>{if(!bu||uo||!K||Uu.current)return;Uu.current=!0;let u=!1;const p=window.setTimeout(()=>{(async()=>{let S=!1;try{let k=await zh();if(u)return;if(Hu(k),!(k!=null&&k.ollama_running)&&(k!=null&&k.can_manage_locally)){const z=window.confirm(`Ollama is not running at ${k.ollama_url}. Start it in the background now with "ollama serve"?`);if(u)return;if(z){S=!0,fr(!0),An("Starting Ollama in the background...");const V=await fetch(`${K}/ollama/start`,{method:"POST"});if(k=await tl(V),u)return}}const L=!(k!=null&&k.whisper_model_available),A=!!(k!=null&&k.ollama_running&&(k!=null&&k.can_manage_locally)&&!(k!=null&&k.embedding_model_available));if(L||A){S=!0,fr(!0),An(L&&A?`Downloading Whisper ${(k==null?void 0:k.whisper_model)||"base"} and ${k.selected_embed_model}. This can take a while on first install.`:L?`Downloading Whisper ${(k==null?void 0:k.whisper_model)||"base"}. This can take a while on first install.`:`Downloading ${k.selected_embed_model} from Ollama. This can take a while on first install.`);const z=await bh();if(u)return;Hu((z==null?void 0:z.ollama)||k)}}catch(k){u||(console.warn("startup Ollama check failed",k),lr(!1),Pn(`Whisper availability could not be verified: ${Ht(k)}`),S&&window.alert(`Startup action failed: ${Ht(k)}`))}finally{u||(fr(!1),An(""))}})()},1200);return()=>{u=!0,window.clearTimeout(p)}},[K,uo,bu]),f.useEffect(()=>{Ql(el)},[el]);const om=u=>{!u||!K||fetch(`${K}/history?session_id=${encodeURIComponent(u)}`).then(p=>p.json()).then(p=>{t(S=>S.map(k=>k.session_id===u?{...k,messages:p.messages||[]}:k))}).catch(()=>{})};async function ol(){if(K)try{const p=await(await fetch(`${K}/libraries`)).json(),S=Array.isArray(p.libraries)?p.libraries:[];if(E(S),S.length===0){h(null);return}S.some(k=>k.slug===v)||h(S[0].slug)}catch(u){console.warn("Failed to load libraries",u)}}async function go(){if(K)try{const p=await(await fetch(`${K}/jobs`)).json();R(Array.isArray(p.jobs)?p.jobs:[])}catch(u){console.warn("Failed to load library jobs",u)}}async function ec(u=null){const S=(typeof u=="string"?u:O).trim();if(!S){U("Name is required.");return}try{U("");const k=await fetch(`${K}/libraries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S})});if(!k.ok){const A=await k.text();throw new Error(A||`HTTP ${k.status}`)}const L=await k.json();$(!1),D(""),await ol(),L!=null&&L.slug&&h(L.slug)}catch(k){console.error("Failed to create library",k),U(String((k==null?void 0:k.message)||k))}}async function tc(){E([]),R([]),h(null),y(null),_e(!1),N({}),await ol(),await go()}f.useEffect(()=>{K&&(Gi(!0),fetch(`${K}/sessions`).then(u=>u.json()).then(u=>{const p=u.sessions.map(S=>({...S,messages:[]}));t(p),p.length>0?r(p[0].session_id):r(null),Gi(!1)}).catch(()=>{Gi(!1)}))},[K]),f.useEffect(()=>{K&&(ol(),go())},[K]),f.useEffect(()=>{try{localStorage.setItem(Hd,JSON.stringify(g||{}))}catch{}},[g]),f.useEffect(()=>{if(!K)return;const u=setInterval(()=>{ol(),go()},3e3);return()=>clearInterval(u)},[K,l,v]),f.useEffect(()=>{om(n)},[n,K]),f.useEffect(()=>{const u=new Set(x.map(p=>p.slug));N(p=>{let S=!1;const k={};for(const[L,A]of Object.entries(p||{}))u.has(A)?k[L]=A:S=!0;return S?k:p})},[x]);const ts=u=>{o(u)},im=u=>{mm(u)},vr=f.useMemo(()=>{var u;return((u=e.find(p=>p.session_id===n))==null?void 0:u.messages)||[]},[n,e]),vo=f.useMemo(()=>x.find(u=>u.slug===v)||null,[v,x]),Wt=n&&g[n]||null,St=f.useMemo(()=>x.find(u=>u.slug===Wt)||null,[Wt,x]),nc=f.useMemo(()=>Wt?C.some(u=>u.slug===Wt&&(u.status==="queued"||u.status==="running")):!1,[Wt,C]),ns=f.useMemo(()=>{var u,p;return St?(u=St.files)!=null&&u.length?(p=St.states)!=null&&p.is_indexed?"":nc?" (syncing)":" (needs sync)":" (empty)":""},[St,nc]);function sm(u){return u&&g[u]||null}function rc(u){const p=sm(u);return p&&x.find(S=>S.slug===p)||null}function lc(u){return u?C.some(p=>p.slug===u&&(p.status==="queued"||p.status==="running")):!1}function oc(u,p){u&&N(S=>{const k={...S||{}};return p?k[u]=p:delete k[u],k})}function am(u){u&&N(p=>{let S=!1;const k={};for(const[L,A]of Object.entries(p||{})){if(A===u){S=!0;continue}k[L]=A}return S?k:p})}f.useEffect(()=>{if(!ie)return;const u=p=>{var S;(S=Tn.current)!=null&&S.contains(p.target)||_e(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[ie]),f.useEffect(()=>{_e(!1)},[n,l]),f.useEffect(()=>{const u=n,p=l;return()=>{if(p==="chats"&&u){const S=typeof Dn.current[u]=="number"?Dn.current[u]:Re.current?Re.current.scrollTop:0;zu(k=>{const L={...k,[u]:S};return window.electronAPI.updateSettings({scrollPositions:L}),L})}}},[n,l]),f.useEffect(()=>{const u=Re.current;if(!u)return;const p=()=>{const{scrollTop:S,scrollHeight:k,clientHeight:L}=u,A=k-S-L<=fw;if(n){const z=Gu.current[n],V=typeof z=="number"&&Su.removeEventListener("scroll",p)},[n,rl]),f.useEffect(()=>{const u=n;u&&Qu[u]===!1&&mr(p=>{if(!(u in p))return p;const S={...p};return delete S[u],S})},[n,Qu]),f.useLayoutEffect(()=>{if(l!=="chats"||!n)return;const u=Re.current;if(!u)return;an.current=null;const p=()=>{if(an.current===n)return;const z=typeof Dn.current[n]=="number"?Dn.current[n]:void 0,V=typeof z=="number"?z:co[n];if(typeof V=="number"){u.scrollTop=V,an.current=n;return}vr.length>0&&(u.scrollTop=u.scrollHeight,an.current=n)};p();const S=requestAnimationFrame(p),k=()=>{an.current!==n&&requestAnimationFrame(p)},L=new MutationObserver(k);L.observe(u,{childList:!0,subtree:!0});const A=new ResizeObserver(k);return A.observe(u),()=>{cancelAnimationFrame(S),L.disconnect(),A.disconnect()}},[n,l,vr.length,co]),f.useEffect(()=>{if(l!=="chats"||!n||an.current===n)return;const u=typeof Dn.current[n]=="number"?Dn.current[n]:void 0;typeof(typeof u=="number"?u:co[n])!="number"&&vr.length>0&&requestAnimationFrame(()=>{const S=Re.current;S&&(S.scrollTop=S.scrollHeight,an.current=n)})},[vr.length,n,l,co]);const rs=(u="smooth",p=null)=>{const S=Re.current;if(!S)return;const k=p??De.current;De.current===k&&(S.scrollTo({top:S.scrollHeight,behavior:u}),rl(k,!1))},yr=(u,p="auto",S=null)=>{const k=Re.current;if(!k)return;const L=S??De.current;if(De.current!==L)return;const A=document.getElementById(u);if(A){const z=Math.max(0,A.offsetTop-dw);k.scrollTo({top:z,behavior:p})}},um=()=>{const u=De.current,p=Yu[u];p&&(yr(p,"smooth",u),mr(S=>{const{[u]:k,...L}=S;return L}))},cm=u=>{l!=="chats"||!Fo(u)||(u.preventDefault(),dt.current+=1,b&&Vd(u)&&Oe(!0))},dm=u=>{l!=="chats"||!Fo(u)||(u.preventDefault(),u.dataTransfer.dropEffect=b?"copy":"none",b&&Vd(u)&&!wt&&Oe(!0))},fm=u=>{l!=="chats"||!Fo(u)||(dt.current=Math.max(0,dt.current-1),dt.current===0&&Oe(!1))},pm=async u=>{var p,S;l!=="chats"||!Fo(u)||(u.preventDefault(),dt.current=0,Oe(!1),b&&(await Vu((p=u.dataTransfer)==null?void 0:p.files),(S=Lt.current)==null||S.focus()))};async function ic(){var V,q,Ee;const u=te.trim();if(X||!u&&pe.length===0||!we)return;if(pe.length>0&&!b){window.alert("The selected vision model does not support image inputs.");return}let p=n,S=!1;if(p){const ne=e.find(le=>le.session_id===p);S=ne&&ne.name==="New Chat"&&ne.messages.length===0}else{const ne=await sc();await new Promise(le=>setTimeout(le,200)),p=ne.session_id,S=!0}const k=pe.map(({id:ne,...le})=>({...le})),L=Dh(k),A={role:"user",content:u,attachments:k,id:`msg-${Date.now()}-${Math.random()}`};Zh.current=!0,em.current=p,rl(p,!1),De.current===p&&(an.current=De.current),ih.flushSync(()=>{t(ne=>ne.map(le=>le.session_id===p?{...le,messages:[...le.messages||[],A]}:le)),ee(""),Be([])}),requestAnimationFrame(()=>rs("auto",p));const z=qu(p);try{let ne=[];if(A.content)try{ne=[...(((V=e.find(re=>re.session_id===p))==null?void 0:V.messages)||[]).slice(-8).map(re=>({role:re.role,content:re.content||""})),{role:"user",content:A.content}]}catch{}let le=A.content||null,He=[];const Xe=[],Fn=rc(p);if(A.content&&((q=Fn==null?void 0:Fn.states)!=null&&q.is_indexed))try{const Q=await Wu(Fn.slug,A.content,z.signal);Q.contextBlock&&Xe.push(Q.contextBlock),Array.isArray(Q.sources)&&He.push(...Q.sources)}catch(Q){if(At(Q))throw Q;console.warn("local library enrichment failed",Q)}if(A.content&&_)try{const xe=await(await fetch(`${K}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:z.signal,body:JSON.stringify({prompt:A.content,model:we,messages:ne,history_limit:8,searx_url:sn||null,engines:Array.isArray(Mt)?Mt:null})})).json();xe&&typeof xe.context_block=="string"&&xe.context_block.trim()&&Xe.push(xe.context_block.trim()),Array.isArray(xe==null?void 0:xe.sources)&&He.push(...xe.sources)}catch(Q){if(At(Q))throw Q;console.warn("web search enrichment failed",Q)}if(He=[...new Set(He)],A.content&&Xe.length>0&&(le=`${A.content} - -${Xe.join(` - -`)}`),on){const Q=`msg-${Date.now()}-${Math.random()}`;let xe="";const re={role:"assistant",content:"",id:Q,sources:He};t(se=>se.map(Me=>Me.session_id===p?{...Me,messages:[...Me.messages||[],re]}:Me));try{const se=await fetch(`${K}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:z.signal,body:JSON.stringify({session_id:p,model:L,message:A.content,enriched_message:A.content&&Xe.length>0?le:null,stream:!0,sources:He||[],attachments:k})});if(!se.ok)throw new Error(await po(se));const Me=(Ee=se.body)==null?void 0:Ee.getReader();if(!Me)throw new Error("Missing response body");const G=new TextDecoder;let Vt=!1;for(;;){const{value:ue,done:Ce}=await Me.read();if(Ce){$n(p,Q,xe),De.current===p?hr.current[p]?mr(It=>({...It,[p]:Q})):requestAnimationFrame(()=>yr(Q,"smooth",p)):(On(It=>({...It,[p]:Q})),pr(It=>[...new Set([...It,p])]));break}const un=G.decode(ue,{stream:!0});xe+=un,$n(p,Q,xe),De.current===p&&!hr.current[p]&&rs("auto",p),De.current!==p&&!Vt&&(On(It=>({...It,[p]:Q})),Vt=!0)}}catch(se){if(At(se)){$n(p,Q,xe,{removeIfEmpty:!0});return}console.error("Failed to send message:",se),$n(p,Q,"Error: "+Ht(se),{removeIfEmpty:!0});return}}else{const Q=await fetch(`${K}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:z.signal,body:JSON.stringify({session_id:p,model:L,message:A.content,enriched_message:A.content&&Xe.length>0?le:null,stream:!1,sources:He||[],attachments:k})});if(!Q.ok)throw new Error(await po(Q));const xe=await Q.json(),re=`msg-${Date.now()}`,se={role:"assistant",content:xe.reply,id:re,sources:He};t(Me=>Me.map(G=>G.session_id===p?{...G,messages:[...G.messages||[],se]}:G)),re&&(De.current===p?hr.current[p]?mr(Me=>({...Me,[p]:re})):requestAnimationFrame(()=>yr(re,"smooth",p)):On(Me=>({...Me,[p]:re})))}De.current!==p&&pr(Q=>[...new Set([...Q,p])]),S&&fetch(`${K}/generate-title`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:p,message:A.content||(k.length>0?"Image attachment":A.content),model:we})}).then(Q=>Q.json()).then(Q=>{const xe=iw(Q.title);t(re=>re.map(se=>se.session_id===p?{...se,name:xe}:se))})}catch(ne){if(At(ne)){Zi(z);return}console.error("Failed to send message:",ne);const le={role:"assistant",content:"Error: "+Ht(ne),id:`msg-${Date.now()}-${Math.random()}`};t(He=>He.map(Xe=>Xe.session_id===p?{...Xe,messages:[...Xe.messages,le]}:Xe))}finally{Zi(z)}}function hm(){T(u=>!u)}async function sc(){var L;const u="sess-"+Math.random().toString(36).slice(2)+Date.now().toString(36),S=await(await fetch(`${K}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:u})})).json(),k={...S,messages:[]};return t(A=>[k,...A]),r(S.session_id),(L=Lt.current)==null||L.focus(),S}function mm(u){r(u),pr(S=>S.filter(k=>k!==u));const p=Jh[u];p&&requestAnimationFrame(()=>{let S=12;const k=()=>{if(!Re.current)return;let A=document.getElementById(p);if(!A){const z=e.find(V=>V.session_id===u);if(z&&Array.isArray(z.messages))for(let V=z.messages.length-1;V>=0;V--){const q=z.messages[V];if(q.role==="assistant"&&q.id){A=document.getElementById(q.id);break}}}A?(yr(A.id,"smooth",u),On(z=>{const{[u]:V,...q}=z;return q})):S-- >0&&requestAnimationFrame(k)};requestAnimationFrame(k)})}function gm(u,p){fetch(`${K}/sessions/${u}/rename`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:p})}).then(()=>{t(S=>S.map(k=>k.session_id===u?{...k,name:p}:k)),m(null)})}function vm(u,p){const S=(p||"").trim(),k=x.find(L=>L.slug===u);if(!k){y(null);return}if(!S||S===k.name){y(null);return}fetch(`${K}/libraries/${u}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S})}).then(()=>{E(L=>L.map(A=>A.slug===u?{...A,name:S}:A)),y(null)})}function ac(u){fetch(`${K}/sessions/${u}`,{method:"DELETE"}).then(()=>{const p=e.filter(S=>S.session_id!==u);t(p),N(S=>{const k={...S||{}};return delete k[u],k}),n===u&&r(p.length>0?p[0].session_id:null)})}function ym(u){fetch(`${K}/libraries/${u}`,{method:"DELETE"}).then(async p=>{var k;if(!p.ok){const L=await p.text();throw new Error(L||`HTTP ${p.status}`)}const S=x.filter(L=>L.slug!==u);E(S),R(L=>L.filter(A=>A.slug!==u)),y(L=>L===u?null:L),v===u&&h(((k=S[0])==null?void 0:k.slug)||null),am(u)}).catch(p=>{console.error("Failed to delete library",p)})}f.useEffect(()=>{const u=e.filter(p=>p.name==="New Chat"&&p.session_id!==n&&p.messages.length===0);u.length>0&&u.forEach(p=>{ac(p.session_id)})},[n,e,K]);const wm=u=>{var S;window.getSelection().toString().length>0||document.activeElement!==Lt.current&&(u.target.closest(".msg")||(S=Lt.current)==null||S.focus())};return c.jsxs("div",{className:"app",style:{gridTemplateColumns:`${nm}px 1fr`},children:[c.jsxs("div",{className:"sidebar",children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsx("div",{className:`sidebar-tab ${l==="chats"?"active":""}`,onClick:()=>ts("chats"),children:"Chats"}),c.jsx("div",{className:`sidebar-tab ${l==="dbs"?"active":""}`,onClick:()=>ts("dbs"),children:"DBs"}),c.jsx("div",{className:`sidebar-tab ${l==="settings"?"active":""}`,onClick:()=>ts("settings"),children:"Settings"})]}),c.jsxs("div",{className:"sidebar-content",children:[l==="chats"&&c.jsx("div",{className:"chat-list",children:e.map(u=>c.jsx("div",{className:`chat-item ${u.session_id===n?"active":""}`,onClick:()=>im(u.session_id),children:d===u.session_id?c.jsx("input",{type:"text",className:"rename-input",defaultValue:u.name,onBlur:()=>m(null),onKeyDown:p=>{p.key==="Enter"?gm(u.session_id,p.target.value):p.key==="Escape"&&m(null)},autoFocus:!0}):c.jsxs(c.Fragment,{children:[c.jsx("span",{children:u.name}),c.jsxs("div",{className:"chat-item-buttons",children:[Mh.includes(u.session_id)&&c.jsx("div",{className:"unread-dot"}),c.jsx("button",{className:"icon-button",onClick:p=>{p.stopPropagation(),m(u.session_id)},children:c.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:c.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),c.jsx("button",{className:"icon-button",onClick:p=>{p.stopPropagation(),ac(u.session_id)},children:c.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:[c.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},u.session_id))}),l==="dbs"&&c.jsx("div",{className:"db-list",children:x.length===0?c.jsx("div",{className:"empty-list-message",children:"No databases yet."}):x.map(u=>c.jsx("div",{className:`chat-item ${u.slug===v?"active":""}`,onClick:()=>h(u.slug),children:w===u.slug?c.jsx("input",{type:"text",className:"rename-input",defaultValue:u.name,onBlur:()=>y(null),onKeyDown:p=>{p.key==="Enter"?vm(u.slug,p.target.value):p.key==="Escape"&&y(null)},autoFocus:!0}):c.jsxs(c.Fragment,{children:[c.jsx("span",{children:u.name}),c.jsxs("div",{className:"chat-item-buttons",children:[Wt===u.slug&&c.jsx("div",{className:"db-active-badge",children:"Chat"}),lc(u.slug)&&c.jsx("div",{className:"db-active-badge",children:"Syncing"}),c.jsx("button",{className:"icon-button",onClick:p=>{p.stopPropagation(),y(u.slug)},children:c.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:c.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),c.jsx("button",{className:"icon-button",onClick:p=>{p.stopPropagation(),ym(u.slug)},children:c.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:[c.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},u.slug))}),l==="settings"&&c.jsxs("div",{className:"settings-list",children:[c.jsx("div",{className:`settings-item ${s==="General"?"active":""}`,onClick:()=>a("General"),children:"General"}),c.jsx("div",{className:`settings-item ${s==="AI Models"?"active":""}`,onClick:()=>a("AI Models"),children:"AI Models"}),c.jsx("div",{className:`settings-item ${s==="Interface"?"active":""}`,onClick:()=>a("Interface"),children:"Interface"}),c.jsx("div",{className:`settings-item ${s==="Backend"?"active":""}`,onClick:()=>a("Backend"),children:"Backend"}),c.jsx("div",{className:`settings-item ${s==="Updates"?"active":""}`,onClick:()=>a("Updates"),children:"Updates"}),c.jsx("div",{className:`settings-item ${s==="Advanced"?"active":""}`,onClick:()=>a("Advanced"),children:"Advanced"})]})]}),l!=="settings"&&c.jsxs("div",{className:"sidebar-footer",children:[l==="chats"&&c.jsx("button",{className:"button new-chat-button",onClick:sc,children:"New Chat"}),l==="dbs"&&(P?c.jsxs("div",{className:"new-db-form",children:[c.jsx("input",{type:"text",className:"rename-input",value:O,onChange:u=>D(u.target.value),onKeyDown:u=>{u.key==="Enter"?ec():u.key==="Escape"&&($(!1),D(""),U(""))},placeholder:"Database name",autoFocus:!0}),H&&c.jsx("div",{className:"form-error",children:H}),c.jsxs("div",{className:"new-db-actions",children:[c.jsx("button",{className:"button new-db-button",onClick:()=>ec(),children:"Create"}),c.jsx("button",{className:"button ghost",onClick:()=>{$(!1),D(""),U("")},children:"Cancel"})]})]}):c.jsx("button",{className:"button new-db-button",onClick:()=>{$(!0),U("")},children:"New Database"}))]}),c.jsx("div",{className:"resizer",onMouseDown:lm})]}),c.jsxs("div",{className:`main-content${l==="chats"&&wt?" main-content--drag-active":""}`,onDragEnter:cm,onDragOver:dm,onDragLeave:fm,onDrop:pm,children:[io&&c.jsxs("div",{className:"startup-task-banner",role:"status","aria-live":"polite",children:[In&&c.jsx("div",{className:"spinner startup-task-banner__spinner"}),c.jsx("div",{className:"startup-task-banner__text",children:io})]}),l==="chats"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"header",children:[c.jsxs("strong",{children:["Chat - ",((uc=e.find(u=>u.session_id===n))==null?void 0:uc.name)||"New Chat"]}),St&&c.jsx("span",{className:"header-subtle",children:`DB: ${St.name}${ns}`})]}),c.jsx("div",{className:`chat${wt?" chat--drag-active":""}`,ref:Re,onClick:wm,children:vr.map((u,p)=>{const S=u.role==="user"&&Ih===p;return c.jsx("div",{id:u.id,className:"msg "+(u.role==="user"?"user":"assistant")+(S?" editing":""),children:u.role==="assistant"?c.jsxs("div",{className:"assistant-message-wrapper",children:[c.jsx(aw,{content:u.content,streamOutput:on,sources:u.sources}),!X&&c.jsxs("div",{className:"message-options-bar assistant-options",children:[c.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Bu(u),children:c.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:[c.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),c.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),c.jsx("button",{className:"icon-button",title:"Regenerate response",onClick:()=>Ku(p),children:c.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:c.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"})})})]})]}):c.jsxs("div",{className:"user-message-wrapper",children:[S?c.jsxs(c.Fragment,{children:[c.jsx(Ds,{attachments:u.attachments,className:"message-attachment-strip"}),c.jsxs("div",{className:"msg-content msg-content--user editing",children:[c.jsx("div",{className:"user-edit-shadow","aria-hidden":"true",children:Ji}),c.jsx(Ld,{className:"edit-message-input edit-overlay",value:Ji,onChange:k=>fo(k.target.value),onBlur:ho,onKeyDown:k=>{k.key==="Escape"&&(k.preventDefault(),ho()),k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),Gh(p))},autoFocus:!0,minRows:1})]})]}):(()=>{const k=u.content||"",L=Array.isArray(u.attachments)?u.attachments:[],A=k.split(/\r\n|\r|\n/),z=A.length>30,V=Xu(u,p,n),q=z?Xh[V]??!0:!1,Ee=q?A.slice(0,30).join(` -`)+` -…`:k,ne=!!k.trim();return c.jsxs(c.Fragment,{children:[c.jsx(Ds,{attachments:L,className:"message-attachment-strip"}),ne&&c.jsx("div",{className:"msg-content msg-content--user",children:Ee}),ne&&z&&c.jsx("button",{className:"user-msg-expand",onClick:()=>qh(V),"aria-expanded":q?"false":"true",children:q?"Show entire message":"Collapse"})]})})(),!X&&!S&&c.jsxs("div",{className:"message-options-bar user-options",children:[c.jsx("button",{className:"icon-button",title:"Edit message",onClick:()=>Qh(p,u.content),children:c.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:[c.jsx("path",{d:"M12 20h9"}),c.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),c.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Bu(u),children:c.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:[c.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),c.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},u.id||p)})},n),Yu[n]&&c.jsxs("button",{className:"new-msg-tip",onClick:um,title:"Jump to the new message","aria-label":"Jump to the new message",children:["New message",c.jsx("span",{style:{marginLeft:6},children:"↓"})]}),c.jsx("div",{className:"footer",children:c.jsxs("div",{className:`footer-inner${wt?" footer-inner--drag-active":""}`,children:[c.jsx("input",{ref:no,type:"file",accept:"image/*",multiple:!0,className:"composer-image-input",onChange:Kh,tabIndex:-1}),c.jsx(Ds,{attachments:pe,className:"composer-attachment-strip",removable:!0,onRemove:Uh}),(he||lt)&&c.jsxs("div",{className:"composer-audio-status"+(he?" composer-audio-status--recording":" composer-audio-status--transcribing"),role:"status","aria-live":"polite",children:[he?c.jsx("span",{className:"composer-audio-status__dot","aria-hidden":"true"}):c.jsx("div",{className:"spinner composer-audio-status__spinner","aria-hidden":"true"}),c.jsx("span",{children:he?`Listening ${gw(or)}`:"Transcribing audio…"})]}),c.jsxs("div",{className:"footer-content-wrapper",children:[c.jsx(Ld,{ref:Lt,className:"input",value:te,onChange:u=>ee(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&!he&&!lt&&(u.preventDefault(),ic())},placeholder:"Ask any question...",maxRows:13}),c.jsxs("div",{className:"footer-tool-group",ref:Tn,children:[c.jsx("button",{type:"button",className:"db-picker-toggle"+(St?" active":""),onClick:()=>{n&&_e(u=>!u)},title:St?`Database: ${St.name}${ns}`:"Select database for this chat","aria-haspopup":"menu","aria-expanded":ie,disabled:!n,children:c.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:[c.jsx("ellipse",{cx:"12",cy:"5",rx:"8",ry:"3"}),c.jsx("path",{d:"M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5"}),c.jsx("path",{d:"M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"})]})}),ie&&c.jsxs("div",{className:"db-picker-menu",role:"menu",children:[c.jsxs("button",{type:"button",className:"db-picker-option"+(Wt?"":" selected"),onClick:()=>{oc(n,null),_e(!1)},children:[c.jsx("span",{children:"No database"}),!Wt&&c.jsx("span",{className:"db-picker-status",children:"Selected"})]}),x.length===0?c.jsx("div",{className:"db-picker-empty",children:"No databases yet."}):x.map(u=>{var L,A,z;const p=Wt===u.slug,S=lc(u.slug),k=(L=u.files)!=null&&L.length?(A=u.states)!=null&&A.is_indexed?"Ready":S?"Syncing":"Needs sync":"Empty";return c.jsxs("button",{type:"button",className:"db-picker-option"+(p?" selected":""),disabled:!((z=u.files)!=null&&z.length),onClick:()=>{oc(n,u.slug),_e(!1)},children:[c.jsx("span",{children:u.name}),c.jsx("span",{className:"db-picker-status",children:p?"Selected":k})]},u.slug)})]})]}),b&&c.jsx("button",{type:"button",className:"image-attach-toggle"+(pe.length>0?" active":""),onClick:Bh,title:"Attach images","aria-label":"Attach images",children:c.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:[c.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),c.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),c.jsx("path",{d:"M21 15l-5-5L5 21"})]})}),nr&&c.jsx("button",{type:"button",className:"audio-input-toggle"+(he||lt?" active":"")+(he?" recording":"")+(lt?" transcribing":""),onClick:Vh,title:Ut?he?"Stop voice input":lt?"Transcribing audio":"Start voice input":Xr||"Whisper is not available for audio input.","aria-label":Ut?he?"Stop voice input":lt?"Transcribing audio":"Start voice input":Xr||"Whisper is not available for audio input.","aria-pressed":he,disabled:!Ut||lt||X,children:lt?c.jsx("div",{className:"spinner composer-audio-icon-spinner","aria-hidden":"true"}):c.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:[c.jsx("path",{d:"M12 3a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3z"}),c.jsx("path",{d:"M19 10a7 7 0 0 1-14 0"}),c.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),c.jsx("line",{x1:"8",y1:"22",x2:"16",y2:"22"})]})}),c.jsx("button",{type:"button",className:"websearch-toggle"+(_?" active":""),onClick:hm,title:"Toggle web search","aria-pressed":_,children:c.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:[c.jsx("circle",{cx:"12",cy:"12",r:"10"}),c.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),c.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"})]})}),c.jsx("button",{className:"button",onClick:X?tm:ic,title:X?"Cancel generation":"Send","aria-label":X?"Cancel generation":"Send",disabled:!X&&(he||lt),children:X?c.jsx("div",{className:"spinner"}):"Send"})]})]})})]}),l==="dbs"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"header",children:[c.jsx("strong",{children:(vo==null?void 0:vo.name)||"Databases"}),St&&c.jsx("span",{className:"header-subtle",children:`Current chat DB: ${St.name}${ns}`})]}),c.jsx(X0,{apiBase:K,library:vo,jobs:C,onRefresh:async()=>{await ol(),await go()}})]}),l==="settings"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"header",children:c.jsxs("strong",{children:[s," Settings"]})}),s==="General"&&c.jsx(Oo,{panel:"General",onAudioInputDeviceChange:Tt,onAudioInputLanguageChange:rr}),s==="AI Models"&&c.jsx(Oo,{panel:"AI Models",onModelChange:yt,onVisionModelChange:B,onTranscriptionModelChange:I,onLibrariesPurged:tc}),s==="Interface"&&c.jsx(Y0,{streamOutput:on,onStreamOutputChange:Qi}),s==="Backend"&&c.jsx(lw,{onBackendApiUrlChange:oo,searxUrl:sn,setSearxUrl:so,engines:Mt,setEngines:u=>ao(Ni(u))}),s==="Updates"&&c.jsx(Oo,{panel:"Updates"}),s==="Advanced"&&c.jsx(Oo,{panel:"Advanced",onLibrariesPurged:tc})]})]})]})}function yw(){return f.useEffect(()=>{window.electronAPI.getSettings().then(e=>{Ql(e.colorScheme||"Default")})},[]),c.jsx(Ve.StrictMode,{children:c.jsx(s0,{children:c.jsx(Fy,{children:c.jsx(wh,{path:"/",element:c.jsx(vw,{})})})})})}const ww=sh(document.getElementById("root"));ww.render(c.jsx(yw,{})); diff --git a/dist/index.html b/dist/index.html index b18e732..afcd6c1 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,7 +5,7 @@ LLM Desktop - +