From 2b49ec2cd0f05734af13549d466163be95e44166 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Tue, 1 Oct 2024 23:21:12 +0200 Subject: [PATCH] added uninstyalled apps selection --- endpoints/lollms_apps.py | 11 ++++ lollms_core | 2 +- .../{index-TXQPtYpQ.js => index-svgg6vOM.js} | 60 +++++++++---------- web/dist/index.html | 2 +- web/src/views/AppsZoo.vue | 20 ++++++- zoos/personalities_zoo | 2 +- 6 files changed, 62 insertions(+), 35 deletions(-) rename web/dist/assets/{index-TXQPtYpQ.js => index-svgg6vOM.js} (99%) diff --git a/endpoints/lollms_apps.py b/endpoints/lollms_apps.py index 1c27a6af..5e7c602f 100644 --- a/endpoints/lollms_apps.py +++ b/endpoints/lollms_apps.py @@ -225,6 +225,17 @@ async def get_app_file(app_name: str, file: str): raise HTTPException(status_code=404, detail="App file not found") return FileResponse(app_path) +@router.get("/apps/{app_name}/{subfolder}/{file}") +async def get_app_file(app_name: str, subfolder: str, file: str): + app_name=sanitize_path(app_name) + subfolder=sanitize_path(subfolder) + file=sanitize_path(file) + app_path = lollmsElfServer.lollms_paths.apps_zoo_path / app_name / subfolder / file + if not app_path.exists(): + raise HTTPException(status_code=404, detail="App file not found") + return FileResponse(app_path) + + class AppNameInput(BaseModel): client_id: str app_name: str diff --git a/lollms_core b/lollms_core index 295d4a9d..2fcdb883 160000 --- a/lollms_core +++ b/lollms_core @@ -1 +1 @@ -Subproject commit 295d4a9d00fc1b02d1359fc13794828bb56ee22d +Subproject commit 2fcdb883964218ab33e454b29be89084e47e1722 diff --git a/web/dist/assets/index-TXQPtYpQ.js b/web/dist/assets/index-svgg6vOM.js similarity index 99% rename from web/dist/assets/index-TXQPtYpQ.js rename to web/dist/assets/index-svgg6vOM.js index 2978a71d..9f61bc01 100644 --- a/web/dist/assets/index-TXQPtYpQ.js +++ b/web/dist/assets/index-svgg6vOM.js @@ -15,7 +15,7 @@ var tI=Object.defineProperty;var nI=(n,e,t)=>e in n?tI(n,e,{enumerable:!0,config * @vue/runtime-dom v3.5.10 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let zg;const gE=typeof window<"u"&&window.trustedTypes;if(gE)try{zg=gE.createPolicy("vue",{createHTML:n=>n})}catch{}const OR=zg?n=>zg.createHTML(n):n=>n,aD="http://www.w3.org/2000/svg",lD="http://www.w3.org/1998/Math/MathML",wi=typeof document<"u"?document:null,bE=wi&&wi.createElement("template"),cD={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,s)=>{const i=e==="svg"?wi.createElementNS(aD,n):e==="mathml"?wi.createElementNS(lD,n):t?wi.createElement(n,{is:t}):wi.createElement(n);return n==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:n=>wi.createTextNode(n),createComment:n=>wi.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>wi.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,s,i,r){const o=t?t.previousSibling:e.lastChild;if(i&&(i===r||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),t),!(i===r||!(i=i.nextSibling)););else{bE.innerHTML=OR(s==="svg"?`${n}`:s==="mathml"?`${n}`:n);const a=bE.content;if(s==="svg"||s==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},$i="transition",Za="animation",ca=Symbol("_vtc"),IR={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},kR=an({},eR,IR),dD=n=>(n.displayName="Transition",n.props=kR,n),Ii=dD((n,{slots:e})=>s0(lk,DR(n),e)),kr=(n,e=[])=>{rt(n)?n.forEach(t=>t(...e)):n&&n(...e)},yE=n=>n?rt(n)?n.some(e=>e.length>1):n.length>1:!1;function DR(n){const e={};for(const V in n)V in IR||(e[V]=n[V]);if(n.css===!1)return e;const{name:t="v",type:s,duration:i,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:c=r,appearActiveClass:d=o,appearToClass:u=a,leaveFromClass:_=`${t}-leave-from`,leaveActiveClass:m=`${t}-leave-active`,leaveToClass:h=`${t}-leave-to`}=n,f=uD(i),g=f&&f[0],b=f&&f[1],{onBeforeEnter:y,onEnter:E,onEnterCancelled:v,onLeave:S,onLeaveCancelled:R,onBeforeAppear:C=y,onAppear:A=E,onAppearCancelled:I=v}=e,x=(V,te,O)=>{tr(V,te?u:a),tr(V,te?d:o),O&&O()},N=(V,te)=>{V._isLeaving=!1,tr(V,_),tr(V,h),tr(V,m),te&&te()},G=V=>(te,O)=>{const H=V?A:E,q=()=>x(te,V,O);kr(H,[te,q]),EE(()=>{tr(te,V?c:r),xi(te,V?u:a),yE(H)||vE(te,s,g,q)})};return an(e,{onBeforeEnter(V){kr(y,[V]),xi(V,r),xi(V,o)},onBeforeAppear(V){kr(C,[V]),xi(V,c),xi(V,d)},onEnter:G(!1),onAppear:G(!0),onLeave(V,te){V._isLeaving=!0;const O=()=>N(V,te);xi(V,_),xi(V,m),PR(),EE(()=>{V._isLeaving&&(tr(V,_),xi(V,h),yE(S)||vE(V,s,b,O))}),kr(S,[V,O])},onEnterCancelled(V){x(V,!1),kr(v,[V])},onAppearCancelled(V){x(V,!0),kr(I,[V])},onLeaveCancelled(V){N(V),kr(R,[V])}})}function uD(n){if(n==null)return null;if(Vt(n))return[Vp(n.enter),Vp(n.leave)];{const e=Vp(n);return[e,e]}}function Vp(n){return cI(n)}function xi(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[ca]||(n[ca]=new Set)).add(e)}function tr(n,e){e.split(/\s+/).forEach(s=>s&&n.classList.remove(s));const t=n[ca];t&&(t.delete(e),t.size||(n[ca]=void 0))}function EE(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let pD=0;function vE(n,e,t,s){const i=n._endId=++pD,r=()=>{i===n._endId&&s()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:c}=LR(n,e);if(!o)return s();const d=o+"end";let u=0;const _=()=>{n.removeEventListener(d,m),r()},m=h=>{h.target===n&&++u>=c&&_()};setTimeout(()=>{u(t[f]||"").split(", "),i=s(`${$i}Delay`),r=s(`${$i}Duration`),o=SE(i,r),a=s(`${Za}Delay`),c=s(`${Za}Duration`),d=SE(a,c);let u=null,_=0,m=0;e===$i?o>0&&(u=$i,_=o,m=r.length):e===Za?d>0&&(u=Za,_=d,m=c.length):(_=Math.max(o,d),u=_>0?o>d?$i:Za:null,m=u?u===$i?r.length:c.length:0);const h=u===$i&&/\b(transform|all)(,|$)/.test(s(`${$i}Property`).toString());return{type:u,timeout:_,propCount:m,hasTransform:h}}function SE(n,e){for(;n.lengthTE(t)+TE(n[s])))}function TE(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function PR(){return document.body.offsetHeight}function fD(n,e,t){const s=n[ca];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const Qd=Symbol("_vod"),FR=Symbol("_vsh"),xt={beforeMount(n,{value:e},{transition:t}){n[Qd]=n.style.display==="none"?"":n.style.display,t&&e?t.beforeEnter(n):Ja(n,e)},mounted(n,{value:e},{transition:t}){t&&e&&t.enter(n)},updated(n,{value:e,oldValue:t},{transition:s}){!e!=!t&&(s?e?(s.beforeEnter(n),Ja(n,!0),s.enter(n)):s.leave(n,()=>{Ja(n,!1)}):Ja(n,e))},beforeUnmount(n,{value:e}){Ja(n,e)}};function Ja(n,e){n.style.display=e?n[Qd]:"none",n[FR]=!e}const _D=Symbol(""),mD=/(^|;)\s*display\s*:/;function hD(n,e,t){const s=n.style,i=Xt(t);let r=!1;if(t&&!i){if(e)if(Xt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&wd(s,a,"")}else for(const o in e)t[o]==null&&wd(s,o,"");for(const o in t)o==="display"&&(r=!0),wd(s,o,t[o])}else if(i){if(e!==t){const o=s[_D];o&&(t+=";"+o),s.cssText=t,r=mD.test(t)}}else e&&n.removeAttribute("style");Qd in n&&(n[Qd]=r?s.display:"",n[FR]&&(s.display="none"))}const xE=/\s*!important$/;function wd(n,e,t){if(rt(t))t.forEach(s=>wd(n,e,s));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const s=gD(n,e);xE.test(t)?n.setProperty(xr(s),t.replace(xE,""),"important"):n[s]=t}}const CE=["Webkit","Moz","ms"],zp={};function gD(n,e){const t=zp[e];if(t)return t;let s=xs(e);if(s!=="filter"&&s in n)return zp[e]=s;s=Nu(s);for(let i=0;iHp||(vD.then(()=>Hp=0),Hp=Date.now());function TD(n,e){const t=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=t.attached)return;Vs(xD(s,t.value),e,5,[s])};return t.value=n,t.attached=SD(),t}function xD(n,e){if(rt(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(s=>i=>!i._stopped&&s&&s(i))}else return e}const OE=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,CD=(n,e,t,s,i,r)=>{const o=i==="svg";e==="class"?fD(n,s,o):e==="style"?hD(n,t,s):Ru(e)?Bb(e)||yD(n,e,t,s,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):wD(n,e,s,o))?(AE(n,e,s),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&RE(n,e,s,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Xt(s))?AE(n,xs(e),s):(e==="true-value"?n._trueValue=s:e==="false-value"&&(n._falseValue=s),RE(n,e,s,o))};function wD(n,e,t,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in n&&OE(e)&&ft(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=n.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return OE(e)&&Xt(t)?!1:e in n}const UR=new WeakMap,BR=new WeakMap,Xd=Symbol("_moveCb"),IE=Symbol("_enterCb"),RD=n=>(delete n.props.mode,n),AD=RD({name:"TransitionGroup",props:an({},kR,{tag:String,moveClass:String}),setup(n,{slots:e}){const t=n0(),s=J2();let i,r;return sc(()=>{if(!i.length)return;const o=n.moveClass||`${n.name||"v"}-move`;if(!ID(i[0].el,t.vnode.el,o))return;i.forEach(ND),i.forEach(MD);const a=i.filter(OD);PR(),a.forEach(c=>{const d=c.el,u=d.style;xi(d,o),u.transform=u.webkitTransform=u.transitionDuration="";const _=d[Xd]=m=>{m&&m.target!==d||(!m||/transform$/.test(m.propertyName))&&(d.removeEventListener("transitionend",_),d[Xd]=null,tr(d,o))};d.addEventListener("transitionend",_)})}),()=>{const o=Ot(n),a=DR(o);let c=o.tag||Be;if(i=[],r)for(let d=0;d{a.split(/\s+/).forEach(c=>c&&s.classList.remove(c))}),t.split(/\s+/).forEach(a=>a&&s.classList.add(a)),s.style.display="none";const r=e.nodeType===1?e:e.parentNode;r.appendChild(s);const{hasTransform:o}=LR(s);return r.removeChild(s),o}const Tr=n=>{const e=n.props["onUpdate:modelValue"]||!1;return rt(e)?t=>Zo(e,t):e};function kD(n){n.target.composing=!0}function kE(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Ss=Symbol("_assign"),ue={created(n,{modifiers:{lazy:e,trim:t,number:s}},i){n[Ss]=Tr(i);const r=s||i.props&&i.props.type==="number";Ai(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),r&&(a=Vd(a)),n[Ss](a)}),t&&Ai(n,"change",()=>{n.value=n.value.trim()}),e||(Ai(n,"compositionstart",kD),Ai(n,"compositionend",kE),Ai(n,"change",kE))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:s,trim:i,number:r}},o){if(n[Ss]=Tr(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?Vd(n.value):n.value,c=e??"";a!==c&&(document.activeElement===n&&n.type!=="range"&&(s&&e===t||i&&n.value.trim()===c)||(n.value=c))}},Ye={deep:!0,created(n,e,t){n[Ss]=Tr(t),Ai(n,"change",()=>{const s=n._modelValue,i=da(n),r=n.checked,o=n[Ss];if(rt(s)){const a=zb(s,i),c=a!==-1;if(r&&!c)o(s.concat(i));else if(!r&&c){const d=[...s];d.splice(a,1),o(d)}}else if(ka(s)){const a=new Set(s);r?a.add(i):a.delete(i),o(a)}else o(GR(n,r))})},mounted:DE,beforeUpdate(n,e,t){n[Ss]=Tr(t),DE(n,e,t)}};function DE(n,{value:e},t){n._modelValue=e;let s;rt(e)?s=zb(e,t.props.value)>-1:ka(e)?s=e.has(t.props.value):s=oo(e,GR(n,!0)),n.checked!==s&&(n.checked=s)}const DD={created(n,{value:e},t){n.checked=oo(e,t.props.value),n[Ss]=Tr(t),Ai(n,"change",()=>{n[Ss](da(n))})},beforeUpdate(n,{value:e,oldValue:t},s){n[Ss]=Tr(s),e!==t&&(n.checked=oo(e,s.props.value))}},It={deep:!0,created(n,{value:e,modifiers:{number:t}},s){const i=ka(e);Ai(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?Vd(da(o)):da(o));n[Ss](n.multiple?i?new Set(r):r:r[0]),n._assigning=!0,Le(()=>{n._assigning=!1})}),n[Ss]=Tr(s)},mounted(n,{value:e}){LE(n,e)},beforeUpdate(n,e,t){n[Ss]=Tr(t)},updated(n,{value:e}){n._assigning||LE(n,e)}};function LE(n,e){const t=n.multiple,s=rt(e);if(!(t&&!s&&!ka(e))){for(let i=0,r=n.options.length;iString(d)===String(a)):o.selected=zb(e,a)>-1}else o.selected=e.has(a);else if(oo(da(o),e)){n.selectedIndex!==i&&(n.selectedIndex=i);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function da(n){return"_value"in n?n._value:n.value}function GR(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const LD=["ctrl","shift","alt","meta"],PD={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>LD.some(t=>n[`${t}Key`]&&!e.includes(t))},K=(n,e)=>{const t=n._withMods||(n._withMods={}),s=e.join(".");return t[s]||(t[s]=(i,...r)=>{for(let o=0;o{const t=n._withKeys||(n._withKeys={}),s=e.join(".");return t[s]||(t[s]=i=>{if(!("key"in i))return;const r=xr(i.key);if(e.some(o=>o===r||FD[o]===r))return n(i)})},UD=an({patchProp:CD},cD);let PE;function BD(){return PE||(PE=Lk(UD))}const GD=(...n)=>{const e=BD().createApp(...n),{mount:t}=e;return e.mount=s=>{const i=zD(s);if(!i)return;const r=e._component;!ft(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=t(i,!1,VD(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function VD(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function zD(n){return Xt(n)?document.querySelector(n):n}function HD(){return VR().__VUE_DEVTOOLS_GLOBAL_HOOK__}function VR(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const qD=typeof Proxy=="function",YD="devtools-plugin:setup",$D="plugin:settings:set";let To,Hg;function WD(){var n;return To!==void 0||(typeof window<"u"&&window.performance?(To=!0,Hg=window.performance):typeof globalThis<"u"&&(!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance)?(To=!0,Hg=globalThis.perf_hooks.performance):To=!1),To}function KD(){return WD()?Hg.now():Date.now()}class jD{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const s={};if(e.settings)for(const o in e.settings){const a=e.settings[o];s[o]=a.defaultValue}const i=`__vue-devtools-plugin-settings__${e.id}`;let r=Object.assign({},s);try{const o=localStorage.getItem(i),a=JSON.parse(o);Object.assign(r,a)}catch{}this.fallbacks={getSettings(){return r},setSettings(o){try{localStorage.setItem(i,JSON.stringify(o))}catch{}r=o},now(){return KD()}},t&&t.on($D,(o,a)=>{o===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(o,a)=>this.target?this.target.on[a]:(...c)=>{this.onQueue.push({method:a,args:c})}}),this.proxiedTarget=new Proxy({},{get:(o,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...c)=>(this.targetQueue.push({method:a,args:c,resolve:()=>{}}),this.fallbacks[a](...c)):(...c)=>new Promise(d=>{this.targetQueue.push({method:a,args:c,resolve:d})})})}async setRealTarget(e){this.target=e;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function QD(n,e){const t=n,s=VR(),i=HD(),r=qD&&t.enableEarlyProxy;if(i&&(s.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))i.emit(YD,n,e);else{const o=r?new jD(t,i):null;(s.__VUE_DEVTOOLS_PLUGINS__=s.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}/*! +**/let zg;const gE=typeof window<"u"&&window.trustedTypes;if(gE)try{zg=gE.createPolicy("vue",{createHTML:n=>n})}catch{}const OR=zg?n=>zg.createHTML(n):n=>n,aD="http://www.w3.org/2000/svg",lD="http://www.w3.org/1998/Math/MathML",wi=typeof document<"u"?document:null,bE=wi&&wi.createElement("template"),cD={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,s)=>{const i=e==="svg"?wi.createElementNS(aD,n):e==="mathml"?wi.createElementNS(lD,n):t?wi.createElement(n,{is:t}):wi.createElement(n);return n==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:n=>wi.createTextNode(n),createComment:n=>wi.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>wi.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,s,i,r){const o=t?t.previousSibling:e.lastChild;if(i&&(i===r||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),t),!(i===r||!(i=i.nextSibling)););else{bE.innerHTML=OR(s==="svg"?`${n}`:s==="mathml"?`${n}`:n);const a=bE.content;if(s==="svg"||s==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},$i="transition",Za="animation",ca=Symbol("_vtc"),IR={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},kR=an({},eR,IR),dD=n=>(n.displayName="Transition",n.props=kR,n),Ii=dD((n,{slots:e})=>s0(lk,DR(n),e)),kr=(n,e=[])=>{rt(n)?n.forEach(t=>t(...e)):n&&n(...e)},yE=n=>n?rt(n)?n.some(e=>e.length>1):n.length>1:!1;function DR(n){const e={};for(const V in n)V in IR||(e[V]=n[V]);if(n.css===!1)return e;const{name:t="v",type:s,duration:i,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:c=r,appearActiveClass:d=o,appearToClass:u=a,leaveFromClass:_=`${t}-leave-from`,leaveActiveClass:m=`${t}-leave-active`,leaveToClass:h=`${t}-leave-to`}=n,f=uD(i),g=f&&f[0],b=f&&f[1],{onBeforeEnter:y,onEnter:E,onEnterCancelled:v,onLeave:S,onLeaveCancelled:R,onBeforeAppear:C=y,onAppear:A=E,onAppearCancelled:I=v}=e,x=(V,te,O)=>{tr(V,te?u:a),tr(V,te?d:o),O&&O()},N=(V,te)=>{V._isLeaving=!1,tr(V,_),tr(V,h),tr(V,m),te&&te()},G=V=>(te,O)=>{const H=V?A:E,q=()=>x(te,V,O);kr(H,[te,q]),EE(()=>{tr(te,V?c:r),xi(te,V?u:a),yE(H)||vE(te,s,g,q)})};return an(e,{onBeforeEnter(V){kr(y,[V]),xi(V,r),xi(V,o)},onBeforeAppear(V){kr(C,[V]),xi(V,c),xi(V,d)},onEnter:G(!1),onAppear:G(!0),onLeave(V,te){V._isLeaving=!0;const O=()=>N(V,te);xi(V,_),xi(V,m),PR(),EE(()=>{V._isLeaving&&(tr(V,_),xi(V,h),yE(S)||vE(V,s,b,O))}),kr(S,[V,O])},onEnterCancelled(V){x(V,!1),kr(v,[V])},onAppearCancelled(V){x(V,!0),kr(I,[V])},onLeaveCancelled(V){N(V),kr(R,[V])}})}function uD(n){if(n==null)return null;if(Vt(n))return[Vp(n.enter),Vp(n.leave)];{const e=Vp(n);return[e,e]}}function Vp(n){return cI(n)}function xi(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[ca]||(n[ca]=new Set)).add(e)}function tr(n,e){e.split(/\s+/).forEach(s=>s&&n.classList.remove(s));const t=n[ca];t&&(t.delete(e),t.size||(n[ca]=void 0))}function EE(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let pD=0;function vE(n,e,t,s){const i=n._endId=++pD,r=()=>{i===n._endId&&s()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:c}=LR(n,e);if(!o)return s();const d=o+"end";let u=0;const _=()=>{n.removeEventListener(d,m),r()},m=h=>{h.target===n&&++u>=c&&_()};setTimeout(()=>{u(t[f]||"").split(", "),i=s(`${$i}Delay`),r=s(`${$i}Duration`),o=SE(i,r),a=s(`${Za}Delay`),c=s(`${Za}Duration`),d=SE(a,c);let u=null,_=0,m=0;e===$i?o>0&&(u=$i,_=o,m=r.length):e===Za?d>0&&(u=Za,_=d,m=c.length):(_=Math.max(o,d),u=_>0?o>d?$i:Za:null,m=u?u===$i?r.length:c.length:0);const h=u===$i&&/\b(transform|all)(,|$)/.test(s(`${$i}Property`).toString());return{type:u,timeout:_,propCount:m,hasTransform:h}}function SE(n,e){for(;n.lengthTE(t)+TE(n[s])))}function TE(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function PR(){return document.body.offsetHeight}function fD(n,e,t){const s=n[ca];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const Qd=Symbol("_vod"),FR=Symbol("_vsh"),xt={beforeMount(n,{value:e},{transition:t}){n[Qd]=n.style.display==="none"?"":n.style.display,t&&e?t.beforeEnter(n):Ja(n,e)},mounted(n,{value:e},{transition:t}){t&&e&&t.enter(n)},updated(n,{value:e,oldValue:t},{transition:s}){!e!=!t&&(s?e?(s.beforeEnter(n),Ja(n,!0),s.enter(n)):s.leave(n,()=>{Ja(n,!1)}):Ja(n,e))},beforeUnmount(n,{value:e}){Ja(n,e)}};function Ja(n,e){n.style.display=e?n[Qd]:"none",n[FR]=!e}const _D=Symbol(""),mD=/(^|;)\s*display\s*:/;function hD(n,e,t){const s=n.style,i=Xt(t);let r=!1;if(t&&!i){if(e)if(Xt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&wd(s,a,"")}else for(const o in e)t[o]==null&&wd(s,o,"");for(const o in t)o==="display"&&(r=!0),wd(s,o,t[o])}else if(i){if(e!==t){const o=s[_D];o&&(t+=";"+o),s.cssText=t,r=mD.test(t)}}else e&&n.removeAttribute("style");Qd in n&&(n[Qd]=r?s.display:"",n[FR]&&(s.display="none"))}const xE=/\s*!important$/;function wd(n,e,t){if(rt(t))t.forEach(s=>wd(n,e,s));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const s=gD(n,e);xE.test(t)?n.setProperty(xr(s),t.replace(xE,""),"important"):n[s]=t}}const CE=["Webkit","Moz","ms"],zp={};function gD(n,e){const t=zp[e];if(t)return t;let s=xs(e);if(s!=="filter"&&s in n)return zp[e]=s;s=Nu(s);for(let i=0;iHp||(vD.then(()=>Hp=0),Hp=Date.now());function TD(n,e){const t=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=t.attached)return;Vs(xD(s,t.value),e,5,[s])};return t.value=n,t.attached=SD(),t}function xD(n,e){if(rt(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(s=>i=>!i._stopped&&s&&s(i))}else return e}const OE=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,CD=(n,e,t,s,i,r)=>{const o=i==="svg";e==="class"?fD(n,s,o):e==="style"?hD(n,t,s):Ru(e)?Bb(e)||yD(n,e,t,s,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):wD(n,e,s,o))?(AE(n,e,s),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&RE(n,e,s,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Xt(s))?AE(n,xs(e),s):(e==="true-value"?n._trueValue=s:e==="false-value"&&(n._falseValue=s),RE(n,e,s,o))};function wD(n,e,t,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in n&&OE(e)&&ft(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=n.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return OE(e)&&Xt(t)?!1:e in n}const UR=new WeakMap,BR=new WeakMap,Xd=Symbol("_moveCb"),IE=Symbol("_enterCb"),RD=n=>(delete n.props.mode,n),AD=RD({name:"TransitionGroup",props:an({},kR,{tag:String,moveClass:String}),setup(n,{slots:e}){const t=n0(),s=J2();let i,r;return sc(()=>{if(!i.length)return;const o=n.moveClass||`${n.name||"v"}-move`;if(!ID(i[0].el,t.vnode.el,o))return;i.forEach(ND),i.forEach(MD);const a=i.filter(OD);PR(),a.forEach(c=>{const d=c.el,u=d.style;xi(d,o),u.transform=u.webkitTransform=u.transitionDuration="";const _=d[Xd]=m=>{m&&m.target!==d||(!m||/transform$/.test(m.propertyName))&&(d.removeEventListener("transitionend",_),d[Xd]=null,tr(d,o))};d.addEventListener("transitionend",_)})}),()=>{const o=Ot(n),a=DR(o);let c=o.tag||Be;if(i=[],r)for(let d=0;d{a.split(/\s+/).forEach(c=>c&&s.classList.remove(c))}),t.split(/\s+/).forEach(a=>a&&s.classList.add(a)),s.style.display="none";const r=e.nodeType===1?e:e.parentNode;r.appendChild(s);const{hasTransform:o}=LR(s);return r.removeChild(s),o}const Tr=n=>{const e=n.props["onUpdate:modelValue"]||!1;return rt(e)?t=>Zo(e,t):e};function kD(n){n.target.composing=!0}function kE(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Ss=Symbol("_assign"),ue={created(n,{modifiers:{lazy:e,trim:t,number:s}},i){n[Ss]=Tr(i);const r=s||i.props&&i.props.type==="number";Ai(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),r&&(a=Vd(a)),n[Ss](a)}),t&&Ai(n,"change",()=>{n.value=n.value.trim()}),e||(Ai(n,"compositionstart",kD),Ai(n,"compositionend",kE),Ai(n,"change",kE))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:s,trim:i,number:r}},o){if(n[Ss]=Tr(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?Vd(n.value):n.value,c=e??"";a!==c&&(document.activeElement===n&&n.type!=="range"&&(s&&e===t||i&&n.value.trim()===c)||(n.value=c))}},qe={deep:!0,created(n,e,t){n[Ss]=Tr(t),Ai(n,"change",()=>{const s=n._modelValue,i=da(n),r=n.checked,o=n[Ss];if(rt(s)){const a=zb(s,i),c=a!==-1;if(r&&!c)o(s.concat(i));else if(!r&&c){const d=[...s];d.splice(a,1),o(d)}}else if(ka(s)){const a=new Set(s);r?a.add(i):a.delete(i),o(a)}else o(GR(n,r))})},mounted:DE,beforeUpdate(n,e,t){n[Ss]=Tr(t),DE(n,e,t)}};function DE(n,{value:e},t){n._modelValue=e;let s;rt(e)?s=zb(e,t.props.value)>-1:ka(e)?s=e.has(t.props.value):s=oo(e,GR(n,!0)),n.checked!==s&&(n.checked=s)}const DD={created(n,{value:e},t){n.checked=oo(e,t.props.value),n[Ss]=Tr(t),Ai(n,"change",()=>{n[Ss](da(n))})},beforeUpdate(n,{value:e,oldValue:t},s){n[Ss]=Tr(s),e!==t&&(n.checked=oo(e,s.props.value))}},It={deep:!0,created(n,{value:e,modifiers:{number:t}},s){const i=ka(e);Ai(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?Vd(da(o)):da(o));n[Ss](n.multiple?i?new Set(r):r:r[0]),n._assigning=!0,Le(()=>{n._assigning=!1})}),n[Ss]=Tr(s)},mounted(n,{value:e}){LE(n,e)},beforeUpdate(n,e,t){n[Ss]=Tr(t)},updated(n,{value:e}){n._assigning||LE(n,e)}};function LE(n,e){const t=n.multiple,s=rt(e);if(!(t&&!s&&!ka(e))){for(let i=0,r=n.options.length;iString(d)===String(a)):o.selected=zb(e,a)>-1}else o.selected=e.has(a);else if(oo(da(o),e)){n.selectedIndex!==i&&(n.selectedIndex=i);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function da(n){return"_value"in n?n._value:n.value}function GR(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const LD=["ctrl","shift","alt","meta"],PD={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>LD.some(t=>n[`${t}Key`]&&!e.includes(t))},K=(n,e)=>{const t=n._withMods||(n._withMods={}),s=e.join(".");return t[s]||(t[s]=(i,...r)=>{for(let o=0;o{const t=n._withKeys||(n._withKeys={}),s=e.join(".");return t[s]||(t[s]=i=>{if(!("key"in i))return;const r=xr(i.key);if(e.some(o=>o===r||FD[o]===r))return n(i)})},UD=an({patchProp:CD},cD);let PE;function BD(){return PE||(PE=Lk(UD))}const GD=(...n)=>{const e=BD().createApp(...n),{mount:t}=e;return e.mount=s=>{const i=zD(s);if(!i)return;const r=e._component;!ft(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=t(i,!1,VD(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function VD(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function zD(n){return Xt(n)?document.querySelector(n):n}function HD(){return VR().__VUE_DEVTOOLS_GLOBAL_HOOK__}function VR(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const qD=typeof Proxy=="function",YD="devtools-plugin:setup",$D="plugin:settings:set";let To,Hg;function WD(){var n;return To!==void 0||(typeof window<"u"&&window.performance?(To=!0,Hg=window.performance):typeof globalThis<"u"&&(!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance)?(To=!0,Hg=globalThis.perf_hooks.performance):To=!1),To}function KD(){return WD()?Hg.now():Date.now()}class jD{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const s={};if(e.settings)for(const o in e.settings){const a=e.settings[o];s[o]=a.defaultValue}const i=`__vue-devtools-plugin-settings__${e.id}`;let r=Object.assign({},s);try{const o=localStorage.getItem(i),a=JSON.parse(o);Object.assign(r,a)}catch{}this.fallbacks={getSettings(){return r},setSettings(o){try{localStorage.setItem(i,JSON.stringify(o))}catch{}r=o},now(){return KD()}},t&&t.on($D,(o,a)=>{o===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(o,a)=>this.target?this.target.on[a]:(...c)=>{this.onQueue.push({method:a,args:c})}}),this.proxiedTarget=new Proxy({},{get:(o,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...c)=>(this.targetQueue.push({method:a,args:c,resolve:()=>{}}),this.fallbacks[a](...c)):(...c)=>new Promise(d=>{this.targetQueue.push({method:a,args:c,resolve:d})})})}async setRealTarget(e){this.target=e;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function QD(n,e){const t=n,s=VR(),i=HD(),r=qD&&t.enableEarlyProxy;if(i&&(s.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))i.emit(YD,n,e);else{const o=r?new jD(t,i):null;(s.__VUE_DEVTOOLS_PLUGINS__=s.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}/*! * vuex v4.1.0 * (c) 2022 Evan You * @license MIT @@ -69,7 +69,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ye=L,oe=Y),se===void 0 `)),l("div",{ref:"execution_output",class:"w-full h-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",innerHTML:i.executionOutput},null,8,NKe),e[18]||(e[18]=Ze(` `))]),e[20]||(e[20]=Ze(` `))])):B("",!0)])}const OKe=it(bKe,[["render",MKe]]);var EN={exports:{}};(function(n,e){(function(t,s){n.exports=s()})(PA,function(){function t(a,c){var d=a.pos;if(a.src.charCodeAt(d)!==92)return!1;var u=a.src.slice(++d).match(/^(?:\\\[|\\\(|begin\{([^}]*)\})/);if(!u)return!1;d+=u[0].length;var _,m,h;u[0]==="\\["?(_="display_math",m="\\\\]"):u[0]==="\\("?(_="inline_math",m="\\\\)"):u[1]&&(_="math",m="\\end{"+u[1]+"}",h=!0);var f=a.src.indexOf(m,d);if(f===-1)return!1;var g=f+m.length;if(!c){var b=a.push(_,"",0);b.content=h?a.src.slice(a.pos,g):a.src.slice(d,f)}return a.pos=g,!0}function s(a,c){var d=a.pos;if(a.src.charCodeAt(d)!==36)return!1;var u="$",_=a.src.charCodeAt(++d);if(_===36){if(u="$$",a.src.charCodeAt(++d)===36)return!1}else if(_===32||_===9||_===10)return!1;var m=a.src.indexOf(u,d);if(m===-1||a.src.charCodeAt(m-1)===92)return!1;var h=m+u.length;if(u.length===1){var f=a.src.charCodeAt(m-1);if(f===32||f===9||f===10)return!1;var g=a.src.charCodeAt(h);if(g>=48&&g<58)return!1}if(!c){var b=a.push(u.length===1?"inline_math":"display_math","",0);b.content=a.src.slice(d,m)}return a.pos=h,!0}function i(a){return a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const LKe={name:"MarkdownRenderer",props:{host:{type:String,required:!1,default:"http://localhost:9600"},client_id:{type:String,required:!0},markdownText:{type:String,required:!0},discussion_id:{type:[String,Number],default:"0",required:!1},message_id:{value:"0",type:[String,Number],required:!1}},components:{CodeBlock:OKe},setup(n){const e=new E0e({html:!0,highlight:(r,o)=>{const a=o&&uo.getLanguage(o)?o:"plaintext";return uo.highlight(a,r).value},renderInline:!0,breaks:!0}).use(xHe).use(Wo).use(OHe,{figcaption:!0}).use(YHe).use(NHe,{enableRowspan:!0,enableColspan:!0,enableGridTables:!0,enableGridTablesExtra:!0,enableTableIndentation:!0,tableCellPadding:" ",tableCellJoiner:"|",multilineCellStartMarker:"|>",multilineCellEndMarker:"<|",multilineCellPadding:" ",multilineCellJoiner:` -`}).use(kKe({inlineMath:[["$","$"],["\\(","\\)"]],blockMath:[["$$","$$"],["\\[","\\]"]]})),t=ot([]),s=()=>{if(n.markdownText){let r=e.parse(n.markdownText,{}),o=[];t.value=[];for(let a=0;a0&&(t.value.push({type:"html",html:e.renderer.render(o,e.options,{})}),o=[]),t.value.push({type:"code",language:DKe(r[a].info),code:r[a].content}));o.length>0&&(t.value.push({type:"html",html:e.renderer.render(o,e.options,{})}),o=[])}else t.value=[];Le(()=>{Ve.replace()})},i=(r,o)=>{t.value[r].code=o};return Tn(()=>n.markdownText,s),di(()=>{s(),Le(()=>{window.MathJax&&window.MathJax.typesetPromise()})}),{markdownItems:t,updateCode:i}}},PKe={class:"break-all container w-full"},FKe={ref:"mdRender",class:"markdown-content"},UKe=["innerHTML"];function BKe(n,e,t,s,i,r){const o=et("code-block");return T(),w("div",PKe,[l("div",FKe,[(T(!0),w(Be,null,Xe(s.markdownItems,(a,c)=>(T(),w("div",{key:c},[a.type==="code"?(T(),at(o,{key:0,host:t.host,language:a.language,code:a.code,discussion_id:t.discussion_id,message_id:t.message_id,client_id:t.client_id,onUpdateCode:d=>s.updateCode(c,d)},null,8,["host","language","code","discussion_id","message_id","client_id","onUpdateCode"])):(T(),w("div",{key:1,innerHTML:a.html},null,8,UKe))]))),128))],512)])}const lp=it(LKe,[["render",BKe]]),GKe={data(){return{show:!1,has_button:!0,message:""}},components:{MarkdownRenderer:lp},methods:{hide(){this.show=!1,this.$emit("ok")},showMessage(n){this.message=n,this.has_button=!0,this.show=!0},showBlockingMessage(n){this.message=n,this.has_button=!1,this.show=!0},updateMessage(n){this.message=n,this.show=!0},hideMessage(){this.show=!1}}},VKe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 z-50"},zKe={class:"pl-10 pr-10 bg-bg-light dark:bg-bg-dark p-8 rounded-lg shadow-lg"},HKe={class:"container max-h-500 overflow-y-auto"},qKe={class:"text-lg font-medium"},YKe={class:"mt-4 flex justify-center"},$Ke={key:1,"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function WKe(n,e,t,s,i,r){const o=et("MarkdownRenderer");return i.show?(T(),w("div",VKe,[l("div",zKe,[l("div",HKe,[l("div",qKe,[z(o,{ref:"mdRender",host:"","markdown-text":i.message,message_id:0,discussion_id:0},null,8,["markdown-text"])])]),l("div",YKe,[i.has_button?(T(),w("button",{key:0,onClick:e[0]||(e[0]=(...a)=>r.hide&&r.hide(...a)),class:"bg-primary hover:bg-primary-light active:scale-95 duration-150 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-secondary-dark"}," OK ")):B("",!0),i.has_button?B("",!0):(T(),w("svg",$Ke,e[1]||(e[1]=[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1)])))])])])):B("",!0)}const vN=it(GKe,[["render",WKe]]),KKe={props:{progress:{type:Number,required:!0}}},jKe={class:"progress-bar-container"};function QKe(n,e,t,s,i,r){return T(),w("div",jKe,[l("div",{class:"progress-bar",style:Wt({width:`${t.progress}%`})},null,4)])}const cp=it(KKe,[["render",QKe]]),XKe={setup(){return{}},name:"UniversalForm",data(){return{show:!1,resolve:null,controls_array:[],title:"Universal form",ConfirmButtonText:"Submit",DenyButtonText:"Cancel"}},mounted(){Le(()=>{Ve.replace()})},methods:{btn_clicked(n){console.log(n)},hide(n){this.show=!1,this.resolve&&n&&(this.resolve(this.controls_array),this.resolve=null)},showForm(n,e,t,s){this.ConfirmButtonText=t||this.ConfirmButtonText,this.DenyButtonText=s||this.DenyButtonText;for(let i=0;i{this.controls_array=n,this.show=!0,this.title=e||this.title,this.resolve=i,console.log("show form",this.controls_array)})}},watch:{controls_array:{deep:!0,handler(n){n.forEach(e=>{e.type==="int"?e.value=parseInt(e.value):e.type==="float"&&(e.value=parseFloat(e.value))})}},show(){Le(()=>{Ve.replace()})}}},ZKe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 p-4"},JKe={class:"relative w-full max-w-md"},eje={class:"flex flex-col rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel duration-150 shadow-lg max-h-screen"},tje={class:"flex flex-row flex-grow items-center m-2 p-1"},nje={class:"grow flex items-center"},sje={class:"text-lg font-semibold select-none mr-2"},ije={class:"items-end"},rje={class:"flex flex-col relative no-scrollbar overflow-y-scroll p-2"},oje={class:"px-2"},aje={key:0},lje={key:0},cje={class:"text-base font-semibold"},dje={key:0,class:"relative inline-flex"},uje=["onUpdate:modelValue"],pje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},fje=["onUpdate:modelValue"],_je={key:1},mje={class:"text-base font-semibold"},hje={key:0,class:"relative inline-flex"},gje=["onUpdate:modelValue"],bje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},yje=["onUpdate:modelValue"],Eje=["value","selected"],vje={key:1},Sje={class:"",onclick:"btn_clicked(item)"},Tje={key:2},xje={key:0},Cje={class:"text-base font-semibold"},wje={key:0,class:"relative inline-flex"},Rje=["onUpdate:modelValue"],Aje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},Nje=["onUpdate:modelValue"],Mje={key:1},Oje={class:"text-base font-semibold"},Ije={key:0,class:"relative inline-flex"},kje=["onUpdate:modelValue"],Dje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},Lje=["onUpdate:modelValue"],Pje=["value","selected"],Fje={key:3},Uje={class:"text-base font-semibold"},Bje={key:0,class:"relative inline-flex"},Gje=["onUpdate:modelValue"],Vje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},zje=["onUpdate:modelValue"],Hje=["onUpdate:modelValue","min","max"],qje={key:4},Yje={class:"text-base font-semibold"},$je={key:0,class:"relative inline-flex"},Wje=["onUpdate:modelValue"],Kje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},jje=["onUpdate:modelValue"],Qje=["onUpdate:modelValue","min","max"],Xje={key:5},Zje={class:"mb-2 relative flex items-center gap-2"},Jje={for:"default-checkbox",class:"text-base font-semibold"},eQe=["onUpdate:modelValue"],tQe={key:0,class:"relative inline-flex"},nQe=["onUpdate:modelValue"],sQe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},iQe={key:6},rQe={class:"text-base font-semibold"},oQe={key:0,class:"relative inline-flex"},aQe=["onUpdate:modelValue"],lQe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},cQe=["onUpdate:modelValue"],dQe={class:"flex flex-row flex-grow gap-3"},uQe={class:"p-2 text-center grow"};function pQe(n,e,t,s,i,r){return i.show?(T(),w("div",ZKe,[l("div",JKe,[l("div",eje,[l("div",tje,[l("div",nje,[e[3]||(e[3]=l("i",{"data-feather":"sliders",class:"mr-2 flex-shrink-0"},null,-1)),l("h3",sje,W(i.title),1)]),l("div",ije,[l("button",{type:"button",onClick:e[0]||(e[0]=K(o=>r.hide(!1),["stop"])),title:"Close",class:"bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[4]||(e[4]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),l("span",{class:"sr-only"},"Close form modal",-1)]))])]),l("div",rje,[(T(!0),w(Be,null,Xe(i.controls_array,(o,a)=>(T(),w("div",oje,[o.type=="str"||o.type=="string"?(T(),w("div",aje,[o.options?B("",!0):(T(),w("div",lje,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",cje,W(o.name)+": ",1),o.help?(T(),w("label",dje,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,uje),[[Ye,o.isHelp]]),e[5]||(e[5]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",pje,W(o.help),1)):B("",!0),D(l("input",{type:"text","onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter string"},null,8,fje),[[ue,o.value]])])),o.options?(T(),w("div",_je,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",mje,W(o.name)+": ",1),o.help?(T(),w("label",hje,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,gje),[[Ye,o.isHelp]]),e[6]||(e[6]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",bje,W(o.help),1)):B("",!0),D(l("select",{"onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(T(!0),w(Be,null,Xe(o.options,c=>(T(),w("option",{value:c,selected:o.value===c},W(c),9,Eje))),256))],8,yje),[[It,o.value]])])):B("",!0)])):B("",!0),o.type=="btn"?(T(),w("div",vje,[l("button",Sje,W(o.name),1)])):B("",!0),o.type=="text"?(T(),w("div",Tje,[o.options?B("",!0):(T(),w("div",xje,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Cje,W(o.name)+": ",1),o.help?(T(),w("label",wje,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Rje),[[Ye,o.isHelp]]),e[7]||(e[7]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",Aje,W(o.help),1)):B("",!0),D(l("textarea",{"onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter string"},null,8,Nje),[[ue,o.value]])])),o.options?(T(),w("div",Mje,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Oje,W(o.name)+": ",1),o.help?(T(),w("label",Ije,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,kje),[[Ye,o.isHelp]]),e[8]||(e[8]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",Dje,W(o.help),1)):B("",!0),D(l("select",{"onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(T(!0),w(Be,null,Xe(o.options,c=>(T(),w("option",{value:c,selected:o.value===c},W(c),9,Pje))),256))],8,Lje),[[It,o.value]])])):B("",!0)])):B("",!0),o.type=="int"?(T(),w("div",Fje,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Uje,W(o.name)+": ",1),o.help?(T(),w("label",Bje,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Gje),[[Ye,o.isHelp]]),e[9]||(e[9]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",Vje,W(o.help),1)):B("",!0),D(l("input",{type:"number","onUpdate:modelValue":c=>o.value=c,step:"1",class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,zje),[[ue,o.value]]),o.min!=null&&o.max!=null?D((T(),w("input",{key:1,type:"range","onUpdate:modelValue":c=>o.value=c,min:o.min,max:o.max,step:"1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,Hje)),[[ue,o.value]]):B("",!0)])):B("",!0),o.type=="float"?(T(),w("div",qje,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Yje,W(o.name)+": ",1),o.help?(T(),w("label",$je,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Wje),[[Ye,o.isHelp]]),e[10]||(e[10]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",Kje,W(o.help),1)):B("",!0),D(l("input",{type:"number","onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,jje),[[ue,o.value]]),o.min!=null&&o.max!=null?D((T(),w("input",{key:1,type:"range","onUpdate:modelValue":c=>o.value=c,min:o.min,max:o.max,step:"0.1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,Qje)),[[ue,o.value]]):B("",!0)])):B("",!0),o.type=="bool"?(T(),w("div",Xje,[l("div",Zje,[l("label",Jje,W(o.name)+": ",1),D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.value=c,class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"},null,8,eQe),[[Ye,o.value]]),o.help?(T(),w("label",tQe,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,nQe),[[Ye,o.isHelp]]),e[11]||(e[11]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)]),o.isHelp?(T(),w("p",sQe,W(o.help),1)):B("",!0)])):B("",!0),o.type=="list"?(T(),w("div",iQe,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",rQe,W(o.name)+": ",1),o.help?(T(),w("label",oQe,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,aQe),[[Ye,o.isHelp]]),e[12]||(e[12]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",lQe,W(o.help),1)):B("",!0),D(l("input",{type:"text","onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter comma separated values"},null,8,cQe),[[ue,o.value]])])):B("",!0),e[13]||(e[13]=l("hr",{class:"h-px my-4 bg-gray-200 border-0 dark:bg-gray-700"},null,-1))]))),256)),l("div",dQe,[l("div",uQe,[l("button",{onClick:e[1]||(e[1]=K(o=>r.hide(!0),["stop"])),type:"button",class:"mr-2 text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},W(i.ConfirmButtonText),1),l("button",{onClick:e[2]||(e[2]=K(o=>r.hide(!1),["stop"])),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-11 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},W(i.DenyButtonText),1)])])])])])])):B("",!0)}const uc=it(XKe,[["render",pQe]]),fQe={data(){return{show:!1,message:"",resolve:null,ConfirmButtonText:"Yes, I'm sure",DenyButtonText:"No, cancel"}},methods:{hide(n){this.show=!1,this.resolve&&(this.resolve(n),this.resolve=null)},askQuestion(n,e,t){return this.ConfirmButtonText=e||this.ConfirmButtonText,this.DenyButtonText=t||this.DenyButtonText,new Promise(s=>{this.message=n,this.show=!0,this.resolve=s})}}},_Qe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},mQe={class:"relative w-full max-w-md max-h-full"},hQe={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},gQe={class:"p-4 text-center"},bQe={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none break-all"};function yQe(n,e,t,s,i,r){return i.show?(T(),w("div",_Qe,[l("div",mQe,[l("div",hQe,[l("button",{type:"button",onClick:e[0]||(e[0]=o=>r.hide(!1)),class:"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[3]||(e[3]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),l("span",{class:"sr-only"},"Close modal",-1)])),l("div",gQe,[e[4]||(e[4]=l("svg",{"aria-hidden":"true",class:"mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),l("h3",bQe,W(i.message),1),l("button",{onClick:e[1]||(e[1]=o=>r.hide(!0)),type:"button",class:"text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"},W(i.ConfirmButtonText),1),l("button",{onClick:e[2]||(e[2]=o=>r.hide(!1)),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},W(i.DenyButtonText),1)])])])])):B("",!0)}const SN=it(fQe,[["render",yQe]]),EQe={props:{personality:{type:Object,required:!0},config:{type:Object,required:!0}},data(){return{show:!1,title:"Add AI Agent",iconUrl:"",file:null,tempConfig:{}}},methods:{showForm(){this.showDialog=!0},hideForm(){this.showDialog=!1},selectIcon(n){n.target.files&&(this.file=n.target.files[0],this.iconUrl=URL.createObjectURL(this.file))},showPanel(){this.show=!0},hide(){this.show=!1},submitForm(){Z.post("/set_personality_config",{client_id:this.$store.state.client_id,category:this.personality.category,name:this.personality.folder,config:this.config}).then(n=>{const e=n.data;console.log("Done"),e.status?(this.currentPersonConfig=e.config,this.showPersonalityEditor=!0):console.error(e.error)}).catch(n=>{console.error(n)})}}},vQe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 z-20"},SQe={class:"relative w-full max-h-full bg-bg-light dark:bg-bg-dark"},TQe={class:"w-full h-full relative items-center gap-2 rounded-lg border bg-bg-light dark:bg-bg-dark p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-900"},xQe={class:"justify-center text-center items-center w-full bg-bg-light dark:bg-bg-dark"},CQe={class:"w-full flex flex-row mt-4 text-center justify-center"},wQe={class:"w-full max-h-full container bg-bg-light dark:bg-bg-dark"},RQe={class:"mb-4 w-full"},AQe={class:"w-full bg-bg-light dark:bg-bg-dark"};function NQe(n,e,t,s,i,r){return i.show?(T(),w("div",vQe,[l("div",SQe,[l("div",TQe,[l("button",{type:"button",onClick:e[0]||(e[0]=o=>r.hide()),class:"absolute top-1 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[17]||(e[17]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),l("span",{class:"sr-only"},"Close modal",-1)])),l("div",xQe,[l("div",CQe,[l("button",{type:"submit",onClick:e[1]||(e[1]=K((...o)=>r.submitForm&&r.submitForm(...o),["prevent"])),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"}," Commit AI to Server "),l("button",{onClick:e[2]||(e[2]=K(o=>r.hide(),["prevent"])),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"}," Close ")]),l("div",wQe,[l("form",RQe,[l("table",AQe,[l("tr",null,[e[18]||(e[18]=l("td",null,[l("label",{for:"personalityConditioning"},"Personality Conditioning:")],-1)),l("td",null,[D(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"personalityConditioning","onUpdate:modelValue":e[3]||(e[3]=o=>t.config.personality_conditioning=o)},null,512),[[ue,t.config.personality_conditioning]])])]),l("tr",null,[e[19]||(e[19]=l("td",null,[l("label",{for:"userMessagePrefix"},"User Message Prefix:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"userMessagePrefix","onUpdate:modelValue":e[4]||(e[4]=o=>t.config.user_message_prefix=o)},null,512),[[ue,t.config.user_message_prefix]])])]),l("tr",null,[e[20]||(e[20]=l("td",null,[l("label",{for:"aiMessagePrefix"},"AI Message Prefix:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"aiMessagePrefix","onUpdate:modelValue":e[5]||(e[5]=o=>t.config.ai_message_prefix=o)},null,512),[[ue,t.config.ai_message_prefix]])])]),l("tr",null,[e[21]||(e[21]=l("td",null,[l("label",{for:"linkText"},"Link Text:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"linkText","onUpdate:modelValue":e[6]||(e[6]=o=>t.config.link_text=o)},null,512),[[ue,t.config.link_text]])])]),l("tr",null,[e[22]||(e[22]=l("td",null,[l("label",{for:"welcomeMessage"},"Welcome Message:")],-1)),l("td",null,[D(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"welcomeMessage","onUpdate:modelValue":e[7]||(e[7]=o=>t.config.welcome_message=o)},null,512),[[ue,t.config.welcome_message]])])]),l("tr",null,[e[23]||(e[23]=l("td",null,[l("label",{for:"modelTemperature"},"Model Temperature:")],-1)),l("td",null,[D(l("input",{type:"number",id:"modelTemperature","onUpdate:modelValue":e[8]||(e[8]=o=>t.config.model_temperature=o)},null,512),[[ue,t.config.model_temperature]])])]),l("tr",null,[e[24]||(e[24]=l("td",null,[l("label",{for:"modelTopK"},"Model Top K:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelTopK","onUpdate:modelValue":e[9]||(e[9]=o=>t.config.model_top_k=o)},null,512),[[ue,t.config.model_top_k]])])]),l("tr",null,[e[25]||(e[25]=l("td",null,[l("label",{for:"modelTopP"},"Model Top P:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelTopP","onUpdate:modelValue":e[10]||(e[10]=o=>t.config.model_top_p=o)},null,512),[[ue,t.config.model_top_p]])])]),l("tr",null,[e[26]||(e[26]=l("td",null,[l("label",{for:"modelRepeatPenalty"},"Model Repeat Penalty:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelRepeatPenalty","onUpdate:modelValue":e[11]||(e[11]=o=>t.config.model_repeat_penalty=o)},null,512),[[ue,t.config.model_repeat_penalty]])])]),l("tr",null,[e[27]||(e[27]=l("td",null,[l("label",{for:"modelRepeatLastN"},"Model Repeat Last N:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelRepeatLastN","onUpdate:modelValue":e[12]||(e[12]=o=>t.config.model_repeat_last_n=o)},null,512),[[ue,t.config.model_repeat_last_n]])])]),l("tr",null,[e[28]||(e[28]=l("td",null,[l("label",{for:"recommendedBinding"},"Recommended Binding:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"recommendedBinding","onUpdate:modelValue":e[13]||(e[13]=o=>t.config.recommended_binding=o)},null,512),[[ue,t.config.recommended_binding]])])]),l("tr",null,[e[29]||(e[29]=l("td",null,[l("label",{for:"recommendedModel"},"Recommended Model:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"recommendedModel","onUpdate:modelValue":e[14]||(e[14]=o=>t.config.recommended_model=o)},null,512),[[ue,t.config.recommended_model]])])]),l("tr",null,[e[30]||(e[30]=l("td",null,[l("label",{class:"dark:bg-black dark:text-primary w-full",for:"dependencies"},"Dependencies:")],-1)),l("td",null,[D(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"dependencies","onUpdate:modelValue":e[15]||(e[15]=o=>t.config.dependencies=o)},null,512),[[ue,t.config.dependencies]])])]),l("tr",null,[e[31]||(e[31]=l("td",null,[l("label",{for:"antiPrompts"},"Anti Prompts:")],-1)),l("td",null,[D(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"antiPrompts","onUpdate:modelValue":e[16]||(e[16]=o=>t.config.anti_prompts=o)},null,512),[[ue,t.config.anti_prompts]])])])])])])])])])])):B("",!0)}const TN=it(EQe,[["render",NQe]]),MQe={data(){return{showPopup:!1,webpageUrl:"https://lollms.com/"}},methods:{show(){this.showPopup=!0},hide(){this.showPopup=!1},save_configuration(){Z.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.$store.state.config}).then(n=>{this.isLoading=!1,n.data.status?(this.$store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1)})}}},OQe={key:0,class:"fixed inset-0 flex items-center justify-center z-50"},IQe={class:"popup-container"},kQe=["src"],DQe={class:"checkbox-container"};function LQe(n,e,t,s,i,r){return T(),at(Ii,{name:"fade"},{default:Ie(()=>[i.showPopup?(T(),w("div",OQe,[l("div",IQe,[l("button",{onClick:e[0]||(e[0]=(...o)=>r.hide&&r.hide(...o)),class:"close-button"}," X "),l("iframe",{src:i.webpageUrl,class:"iframe-content"},null,8,kQe),l("div",DQe,[D(l("input",{type:"checkbox",id:"startup",class:"styled-checkbox","onUpdate:modelValue":e[1]||(e[1]=o=>this.$store.state.config.show_news_panel=o),onChange:e[2]||(e[2]=(...o)=>r.save_configuration&&r.save_configuration(...o))},null,544),[[Ye,this.$store.state.config.show_news_panel]]),e[3]||(e[3]=l("label",{for:"startup",class:"checkbox-label"},"Show at startup",-1))])])])):B("",!0)]),_:1})}const xN=it(MQe,[["render",LQe],["__scopeId","data-v-d504dfc9"]]),PQe={props:{href:{type:String,default:"#"},icon:{type:String,required:!0},title:{type:String,default:""}},methods:{onClick(n){this.href==="#"&&(n.preventDefault(),this.$emit("click"))}}},FQe=["href","title"],UQe=["data-feather"];function BQe(n,e,t,s,i,r){return T(),w("a",{href:t.href,onClick:e[0]||(e[0]=(...o)=>r.onClick&&r.onClick(...o)),class:"text-2xl hover:text-primary transition duration-150 ease-in-out",title:t.title},[l("i",{"data-feather":t.icon},null,8,UQe)],8,FQe)}const Nd=it(PQe,[["render",BQe]]),GQe={props:{href:{type:String,required:!0},icon:{type:String,required:!0},title:{type:String,default:"Visit our social media"}}},VQe=["href","title"],zQe=["data-feather"],HQe={key:1,class:"w-6 h-6 fill-current",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},qQe={key:2,class:"w-6 h-6 fill-current",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function YQe(n,e,t,s,i,r){return T(),w("a",{href:t.href,target:"_blank",class:"text-2xl hover:text-primary transition duration-150 ease-in-out",title:t.title},[t.icon!=="x"&&t.icon!=="discord"?(T(),w("i",{key:0,"data-feather":t.icon},null,8,zQe)):t.icon==="x"?(T(),w("svg",HQe,e[0]||(e[0]=[l("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"},null,-1)]))):t.icon==="discord"?(T(),w("svg",qQe,e[1]||(e[1]=[l("path",{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},null,-1)]))):B("",!0)],8,VQe)}const hl=it(GQe,[["render",YQe]]),$Qe="/assets/fastapi-BQj-rjUJ.png",WQe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20127.14%2096.36'%3e%3cg%20id='图层_2'%20data-name='图层%202'%3e%3cg%20id='Discord_Logos'%20data-name='Discord%20Logos'%3e%3cg%20id='Discord_Logo_-_Large_-_White'%20data-name='Discord%20Logo%20-%20Large%20-%20White'%3e%3cpath%20d='M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",KQe={key:0,class:"navbar-container z-60"},jQe={class:"game-menu"},QQe={key:0,class:"feather-emoji"},XQe={name:"Navigation",computed:{filteredNavLinks(){return filteredNavLinks.value}}},CN=Object.assign(XQe,{setup(n){const e=K3(),t=ot(0),s=ot([]),i=[{active:!0,route:"discussions",text:"Discussions"},{active:!0,route:"playground",text:"Playground"},{active:!0,route:"PersonalitiesZoo",text:"Personalities Zoo"},{active:!0,route:"AppsZoo",text:"Apps Zoo"},{active:!1,route:"AutoSD",text:"Auto111-SD",condition:()=>Ds.state.config.enable_sd_service||Ds.state.config.active_tti_service==="autosd"},{active:!1,route:"ComfyUI",text:"ComfyUI",condition:()=>Ds.state.config.enable_comfyui_service||Ds.state.config.active_tti_service==="comfyui"},{active:!1,route:"interactive",text:"Interactive",condition:()=>Ds.state.config.active_tts_service!=="None"&&Ds.state.config.active_stt_service!=="None"},{active:!0,route:"settings",text:"Settings"},{active:!0,route:"help_view",text:"Help"}],r=Je(()=>Ds.state.ready?i.filter(d=>d.condition?d.condition():d.active):i.filter(d=>d.active));di(()=>{o()}),Tn(()=>e.name,o);function o(){const d=r.value.findIndex(u=>u.route===e.name);d!==-1&&(t.value=d)}function a(d){return e.name===d}function c(d){t.value=d}return(d,u)=>d.$store.state.ready?(T(),w("div",KQe,[l("nav",jQe,[(T(!0),w(Be,null,Xe(r.value,(_,m)=>(T(),at(Ct(m0),{key:m,to:{name:_.route},class:Ue(["menu-item",{"active-link":a(_.route)}]),onClick:h=>c(m),ref_for:!0,ref_key:"menuItems",ref:s},{default:Ie(()=>[Ze(W(_.text)+" ",1),a(_.route)?(T(),w("span",QQe,"🪶")):B("",!0)]),_:2},1032,["to","class","onClick"]))),128))])])):B("",!0)}}),ZQe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%3e%3ccircle%20cx='25'%20cy='25'%20r='20'%20fill='none'%20stroke='black'%20stroke-width='3'%3e%3c/circle%3e%3cline%20x1='25'%20y1='30'%20x2='25'%20y2='15'%20style='stroke:black;stroke-width:3'%3e%3c/line%3e%3ccircle%20cx='25'%20cy='35'%20r='3'%20fill='black'%3e%3c/circle%3e%3c/svg%3e",JQe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%3e%3ccircle%20cx='25'%20cy='25'%20r='20'%20fill='none'%20stroke='black'%20stroke-width='3'%3e%3c/circle%3e%3cline%20x1='25'%20y1='30'%20x2='25'%20y2='15'%20style='stroke:black;stroke-width:3'%3e%3canimate%20attributeName='y1'%20values='30;25;30'%20dur='1s'%20repeatCount='indefinite'%3e%3c/animate%3e%3canimate%20attributeName='y2'%20values='15;20;15'%20dur='1s'%20repeatCount='indefinite'%3e%3c/animate%3e%3c/line%3e%3ccircle%20cx='25'%20cy='35'%20r='3'%20fill='black'%3e%3canimate%20attributeName='cy'%20values='35;30;35'%20dur='1s'%20repeatCount='indefinite'%3e%3c/animate%3e%3c/circle%3e%3c/svg%3e",Us="/assets/logo-CA_sh1Fo.png",eXe="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20width='800px'%20height='800px'%20viewBox='0%200%2064%2064'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20data-name='Layer%205'%20id='Layer_5'%3e%3cpath%20d='M47,33H17a1,1,0,0,0-1,1c0,9.93,7.18,18,16,18s16-8.07,16-18A1,1,0,0,0,47,33ZM18,35H46a18,18,0,0,1-.67,4H18.71A18,18,0,0,1,18,35ZM26.7,48.8a6.42,6.42,0,0,1,10.6,0,12.3,12.3,0,0,1-10.6,0Zm12.34-1A8.81,8.81,0,0,0,32,44a8.81,8.81,0,0,0-7,3.81A15.56,15.56,0,0,1,19.43,41H44.57A15.56,15.56,0,0,1,39,47.81ZM36,22a1.1,1.1,0,0,1,0-.18,1.17,1.17,0,0,1,.06-.2s0-.05,0-.07a.28.28,0,0,1,.07-.09.71.71,0,0,1,.28-.28s.06-.06.09-.07l10-5a1,1,0,1,1,.9,1.78L39.24,22l8.21,4.11a1,1,0,0,1,.44,1.34A1,1,0,0,1,47,28a.93.93,0,0,1-.45-.11l-10-5h0a1.18,1.18,0,0,1-.28-.22l0-.06a.65.65,0,0,1-.1-.15s0-.05,0-.07a1.17,1.17,0,0,1-.06-.2A1.1,1.1,0,0,1,36,22ZM16.55,26.11,24.76,22l-8.21-4.11a1,1,0,1,1,.9-1.78l10,5s.06.05.09.07a.71.71,0,0,1,.28.28.28.28,0,0,1,.07.09s0,.05,0,.07a1.17,1.17,0,0,1,.06.2.82.82,0,0,1,0,.36,1.17,1.17,0,0,1-.06.2s0,.05,0,.07a.65.65,0,0,1-.1.15.21.21,0,0,0,0,.06,1.18,1.18,0,0,1-.28.22h0l-10,5A.93.93,0,0,1,17,28a1,1,0,0,1-.89-.55A1,1,0,0,1,16.55,26.11ZM60.66,36.45A29.69,29.69,0,0,0,61,32,29,29,0,0,0,3,32a29.69,29.69,0,0,0,.34,4.45,4.65,4.65,0,0,0,2.39,7.82,29,29,0,0,0,52.54,0,4.65,4.65,0,0,0,2.39-7.82ZM4.78,41.58a2.91,2.91,0,0,1-.24-.27A2.62,2.62,0,0,1,4,39.71a.61.61,0,0,1,0-.14,2.58,2.58,0,0,1,.77-1.73,4.38,4.38,0,0,1,.74-.55C7,36.38,10,34.9,12.69,33.67c-1.52,3.3-3.42,7.17-4.17,7.91a2.59,2.59,0,0,1-1.47.72A2.66,2.66,0,0,1,4.78,41.58ZM32,59A27,27,0,0,1,7.92,44.18a4.56,4.56,0,0,0,2-1.18c1.48-1.49,5-9.36,5.66-10.92a1,1,0,0,0-1.32-1.32c-.78.34-3.14,1.39-5.49,2.53-1.29.63-2.58,1.29-3.6,1.88A25.58,25.58,0,0,1,5,32a27,27,0,0,1,54,0,25.58,25.58,0,0,1-.19,3.17c-2.88-1.66-7.88-3.88-9.09-4.41a1,1,0,0,0-1.32,1.32c.69,1.56,4.18,9.43,5.66,10.92a4.56,4.56,0,0,0,2,1.18A27,27,0,0,1,32,59ZM59.46,41.31a2.91,2.91,0,0,1-.24.27A2.66,2.66,0,0,1,57,42.3a2.59,2.59,0,0,1-1.47-.72c-.75-.74-2.65-4.61-4.17-7.91,1.65.76,3.44,1.61,4.91,2.37.91.47,1.7.9,2.26,1.25a4.38,4.38,0,0,1,.74.55A2.58,2.58,0,0,1,60,39.57a.61.61,0,0,1,0,.14A2.62,2.62,0,0,1,59.46,41.31Z'/%3e%3c/g%3e%3c/svg%3e",tXe="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512.001%20512.001'%20xml:space='preserve'%3e%3cg%3e%3cg%3e%3cpath%20d='M256.001,0C114.841,0,0,114.841,0,256.001s114.841,256.001,256.001,256.001S512.001,397.16,512.001,256.001%20S397.16,0,256.001,0z%20M256.001,493.701c-131.069,0-237.702-106.631-237.702-237.7S124.932,18.299,256.001,18.299%20s237.702,106.632,237.702,237.702S387.068,493.701,256.001,493.701z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M371.284,296.658H138.275c-5.054,0-9.15,4.097-9.15,9.15s4.095,9.15,9.15,9.15h233.008c5.054,0,9.15-4.097,9.15-9.15%20C380.433,300.754,376.337,296.658,371.284,296.658z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M297.481,330.816h-85.403c-5.054,0-9.15,4.097-9.15,9.15s4.095,9.15,9.15,9.15h85.403c5.054,0,9.15-4.097,9.15-9.15%20S302.534,330.816,297.481,330.816z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M146.725,192.982c-18.666,0-33.852,15.186-33.852,33.852c0,18.666,15.186,33.852,33.852,33.852%20c18.666,0,33.852-15.186,33.852-33.852C180.577,208.168,165.391,192.982,146.725,192.982z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M365.275,192.982c-18.666,0-33.852,15.186-33.852,33.852c0,18.666,15.186,33.852,33.852,33.852%20s33.852-15.186,33.852-33.852C399.128,208.168,383.942,192.982,365.275,192.982z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cg%3e%3ccircle%20cx='155.969'%20cy='219.735'%20r='9.15'/%3e%3ccircle%20cx='374.338'%20cy='219.735'%20r='9.15'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",nXe={class:"top-0 shadow-lg navbar-container"},sXe={class:"container flex flex-col lg:flex-row items-center gap-2 pb-0"},iXe={class:"logo-container"},rXe=["src"],oXe={class:"flex gap-3 flex-1 items-center justify-end"},aXe={key:0,title:"Model is ok",class:"text-green-500 dark:text-green-400 cursor-pointer transition-transform hover:scale-110"},lXe={key:1,title:"Model is not ok",class:"text-red-500 dark:text-red-400 cursor-pointer transition-transform hover:scale-110"},cXe={key:2,title:"Text is not being generated. Ready to generate",class:"text-green-500 dark:text-green-400 cursor-pointer transition-transform hover:scale-110"},dXe={key:3,title:"Generation in progress...",class:"text-yellow-500 dark:text-yellow-400 cursor-pointer transition-transform hover:scale-110"},uXe={key:4,title:"Connection status: Connected",class:"text-green-500 dark:text-green-400 cursor-pointer transition-transform hover:scale-110"},pXe={key:5,title:"Connection status: Not connected",class:"text-red-500 dark:text-red-400 cursor-pointer transition-transform hover:scale-110"},fXe={class:"flex items-center space-x-4"},_Xe={class:"flex items-center space-x-4"},mXe={class:"relative group",title:"Lollms News"},hXe={class:"relative group"},gXe={class:"absolute hidden group-hover:block bg-gray-800 text-white text-xs rounded py-1 px-2 top-full left-1/2 transform -translate-x-1/2 mb-2 whitespace-nowrap"},bXe={class:"language-selector relative"},yXe={key:0,ref:"languageMenu",class:"container language-menu absolute left-0 mt-1 bg-white dark:bg-bg-dark-tone rounded shadow-lg z-10 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",style:{position:"absolute",top:"100%",width:"200px","max-height":"300px","overflow-y":"auto"}},EXe={style:{"list-style-type":"none","padding-left":"0","margin-left":"0"}},vXe=["onClick"],SXe=["onClick"],TXe={class:"cursor-pointer hover:text-white py-0 px-0 block whitespace-no-wrap"},xXe={role:"status",class:"fixed m-0 p-2 left-2 bottom-2 min-w-[24rem] max-w-[24rem] h-20 flex flex-col justify-center items-center pb-4 bg-blue-500 rounded-lg shadow-lg z-50 background-a"},CXe={class:"text-2xl animate-pulse mt-2 text-white"},wXe={id:"app"},RXe={name:"TopBar",computed:{storeLogo(){return this.$store.state.config?Us:this.$store.state.config.app_custom_logo!=""?"/user_infos/"+this.$store.state.config.app_custom_logo:Us},languages:{get(){return console.log("searching languages",this.$store.state.languages),this.$store.state.languages}},language:{get(){return console.log("searching language",this.$store.state.language),this.$store.state.language}},currentPersonConfig(){try{return this.$store.state.currentPersonConfig}catch{console.log("Error finding current personality configuration");return}},selectedPersonality(){try{return this.$store.state.selectedPersonality}catch{console.log("Error finding current personality configuration");return}},loading_infos(){return this.$store.state.loading_infos},is_fun_mode(){try{return this.$store.state.config?this.$store.state.config.fun_mode:!1}catch(n){return console.error("Oopsie! Looks like we hit a snag: ",n),!1}},isModelOK(){return this.$store.state.isModelOk},isGenerating(){return this.$store.state.isGenerating},isConnected(){return this.$store.state.isConnected}},components:{Toast:ac,MessageBox:vN,ProgressBar:cp,UniversalForm:uc,YesNoDialog:SN,Navigation:CN,PersonalityEditor:TN,PopupViewer:xN,ActionButton:Nd,SocialIcon:hl},watch:{"$store.state.config.fun_mode":function(n,e){console.log(`Fun mode changed from ${e} to ${n}! 🎉`)},"$store.state.isConnected":function(n,e){this.isConnected?(console.log("this.is_first_connection"),console.log(this.is_first_connection),this.is_first_connection||(this.$store.state.messageBox.hideMessage(),this.$store.state.messageBox.showMessage("Server connected."),this.$store.state.config.activate_audio_infos&&this.connection_recovered_audio.play())):(this.$store.state.messageBox.showBlockingMessage("Server suddenly disconnected. Please reboot the server to recover the connection"),this.is_first_connection=!1,console.log("this.is_first_connection set to false"),console.log(this.is_first_connection),this.$store.state.config.activate_audio_infos&&this.connection_lost_audio.play()),Le(()=>{Ve.replace()})}},data(){return{customLanguage:"",selectedLanguage:"",isLanguageMenuVisible:!1,static_info:ZQe,animated_info:JQe,normal_mode:tXe,fun_mode:eXe,is_first_connection:!0,discord:WQe,FastAPI:$Qe,rebooting_audio:new Audio("rebooting.wav"),connection_lost_audio:new Audio("connection_lost.wav"),connection_recovered_audio:new Audio("connection_recovered.wav"),database_selectorDialogVisible:!1,progress_visibility:!1,progress_value:0,codeBlockStylesheet:"",sunIcon:document.querySelector(".sun"),moonIcon:document.querySelector(".moon"),userTheme:localStorage.getItem("theme"),systemTheme:window.matchMedia("prefers-color-scheme: dark").matches,posts_headers:{accept:"application/json","Content-Type":"application/json"}}},async mounted(){this.$store.state.toast=this.$refs.toast,this.$store.state.news=this.$refs.news,this.$store.state.messageBox=this.$refs.messageBox,this.$store.state.universalForm=this.$refs.universalForm,this.$store.state.yesNoDialog=this.$refs.yesNoDialog,this.$store.state.personality_editor=this.$refs.personality_editor,this.sunIcon=document.querySelector(".sun"),this.moonIcon=document.querySelector(".moon"),this.userTheme=localStorage.getItem("theme"),this.systemTheme=window.matchMedia("prefers-color-scheme: dark").matches,this.themeCheck(),Le(()=>{Ve.replace()}),window.addEventListener("resize",this.adjustMenuPosition)},beforeUnmount(){window.removeEventListener("resize",this.adjustMenuPosition)},created(){this.sunIcon=document.querySelector(".sun"),this.moonIcon=document.querySelector(".moon"),this.userTheme=localStorage.getItem("theme"),this.systemTheme=window.matchMedia("prefers-color-scheme: dark").matches},methods:{adjustMenuPosition(){const n=this.$refs.languageMenu;if(n){const e=n.getBoundingClientRect(),t=window.innerWidth;e.right>t?(n.style.left="auto",n.style.right="0"):(n.style.left="0",n.style.right="auto")}},addCustomLanguage(){this.customLanguage.trim()!==""&&(this.selectLanguage(this.customLanguage),this.customLanguage="")},async selectLanguage(n){await this.$store.dispatch("changeLanguage",n),this.toggleLanguageMenu(),this.language=n},async deleteLanguage(n){await this.$store.dispatch("deleteLanguage",n),this.toggleLanguageMenu(),this.language=n},toggleLanguageMenu(){console.log("Toggling language ",this.isLanguageMenuVisible),this.isLanguageMenuVisible=!this.isLanguageMenuVisible},restartProgram(n){n.preventDefault(),this.$store.state.api_post_req("restart_program",this.$store.state.client_id),this.rebooting_audio.play(),this.$store.state.toast.showToast("Rebooting the app. Please wait...",410,!1),console.log("this.$store.state.api_get_req",this.$store.state.api_get_req),setTimeout(()=>{window.close()},2e3)},refreshPage(){window.location.href.split("/").length>4?window.location.href="/":window.location.reload(!0)},handleOk(n){console.log("Input text:",n)},applyConfiguration(){this.isLoading=!0,console.log(this.$store.state.config),Z.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.$store.state.config},{headers:this.posts_headers}).then(n=>{this.isLoading=!1,n.data.status?(this.$store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Le(()=>{Ve.replace()})})},fun_mode_on(){console.log("Turning on fun mode"),this.$store.state.config.fun_mode=!0,this.applyConfiguration()},fun_mode_off(){console.log("Turning off fun mode"),this.$store.state.config.fun_mode=!1,this.applyConfiguration()},showNews(){this.$store.state.news.show()},themeCheck(){if(this.userTheme=="dark"||!this.userTheme&&this.systemTheme){document.documentElement.classList.add("dark"),this.moonIcon.classList.add("display-none"),Le(()=>{Zp(()=>Promise.resolve({}),__vite__mapDeps([0]))});return}Le(()=>{Zp(()=>Promise.resolve({}),__vite__mapDeps([1]))}),this.sunIcon.classList.add("display-none")},themeSwitch(){if(document.documentElement.classList.contains("dark")){document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"),this.userTheme=="light",this.iconToggle();return}Zp(()=>Promise.resolve().then(()=>IHe),void 0),document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark"),this.userTheme=="dark",this.iconToggle(),window.dispatchEvent(new Event("themeChanged"))},iconToggle(){this.sunIcon.classList.toggle("display-none"),this.moonIcon.classList.toggle("display-none")}}},AXe=Object.assign(RXe,{setup(n){return(e,t)=>(T(),w("header",nXe,[l("nav",sXe,[z(Ct(m0),{to:{name:"discussions"},class:"flex items-center space-x-2"},{default:Ie(()=>[l("div",iXe,[l("img",{class:"w-12 h-12 rounded-full object-cover logo-image",src:e.$store.state.config==null?Ct(Us):e.$store.state.config.app_custom_logo!=""?"/user_infos/"+e.$store.state.config.app_custom_logo:Ct(Us),alt:"Logo",title:"LoLLMS WebUI"},null,8,rXe)]),t[8]||(t[8]=l("div",{class:"flex flex-col justify-center"},[l("div",{class:"text-6xl md:text-2xl font-bold text-amber-500 mb-2",style:{"text-shadow":"2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white"}}," L🪶LLMS "),l("p",{class:"text-gray-400 text-sm"},"One tool to rule them all")],-1))]),_:1}),l("div",oXe,[e.isModelOK?(T(),w("div",aXe,t[9]||(t[9]=[l("svg",{class:"w-8 h-8",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M9 12L11 14L15 10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))):(T(),w("div",lXe,t[10]||(t[10]=[l("svg",{class:"w-8 h-8",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M15 9L9 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M9 9L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))),e.isGenerating?(T(),w("div",dXe,t[12]||(t[12]=[l("svg",{class:"w-6 h-6 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)]))):(T(),w("div",cXe,t[11]||(t[11]=[l("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"})],-1)]))),e.isConnected?(T(),w("div",uXe,t[13]||(t[13]=[l("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1)]))):(T(),w("div",pXe,t[14]||(t[14]=[l("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})],-1)])))]),l("div",fXe,[z(Nd,{onClick:e.restartProgram,icon:"power",title:"restart program"},null,8,["onClick"]),z(Nd,{onClick:e.refreshPage,icon:"refresh-ccw",title:"refresh page"},null,8,["onClick"]),z(Nd,{href:"/docs",icon:"file-text",title:"Fast API doc"})]),l("div",_Xe,[z(hl,{href:"https://github.com/ParisNeo/lollms-webui",icon:"github"}),z(hl,{href:"https://www.youtube.com/channel/UCJzrg0cyQV2Z30SQ1v2FdSQ",icon:"youtube"}),z(hl,{href:"https://x.com/ParisNeo_AI",icon:"x"}),z(hl,{href:"https://discord.com/channels/1092918764925882418",icon:"discord"})]),l("div",mXe,[l("div",{onClick:t[0]||(t[0]=s=>e.showNews()),class:"text-2xl w-8 h-8 cursor-pointer transition-colors duration-300 text-gray-600 hover:text-primary dark:text-gray-300 dark:hover:text-primary"},t[15]||(t[15]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-full h-full"},[l("path",{d:"M19 20H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1m2 13a2 2 0 0 1-2-2V7m2 13a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})],-1)])),t[16]||(t[16]=l("span",{class:"absolute hidden group-hover:block bg-gray-800 text-white text-xs rounded py-1 px-2 top-full left-1/2 transform -translate-x-1/2 mt-2 whitespace-nowrap"}," Lollms News ",-1))]),l("div",hXe,[e.is_fun_mode?(T(),w("div",{key:0,title:"Fun mode is on, press to turn off",class:"w-8 h-8 cursor-pointer text-green-500 dark:text-green-400 hover:text-green-600 dark:hover:text-green-300 transition-colors duration-300",onClick:t[1]||(t[1]=s=>e.fun_mode_off())},t[17]||(t[17]=[Pi('',1)]))):(T(),w("div",{key:1,title:"Fun mode is off, press to turn on",class:"w-8 h-8 cursor-pointer text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-300",onClick:t[2]||(t[2]=s=>e.fun_mode_on())},t[18]||(t[18]=[Pi('',1)]))),l("span",gXe,W(e.is_fun_mode?"Turn off fun mode":"Turn on fun mode"),1)]),l("div",bXe,[l("button",{onClick:t[3]||(t[3]=(...s)=>e.toggleLanguageMenu&&e.toggleLanguageMenu(...s)),class:"bg-transparent text-black dark:text-white py-1 px-1 rounded font-bold uppercase transition-colors duration-300 hover:bg-blue-500"},W(e.$store.state.language.slice(0,2)),1),e.isLanguageMenuVisible?(T(),w("div",yXe,[l("ul",EXe,[(T(!0),w(Be,null,Xe(e.languages,s=>(T(),w("li",{key:s,class:"relative flex items-center",style:{"padding-left":"0","margin-left":"0"}},[l("button",{onClick:i=>e.deleteLanguage(s),class:"mr-2 text-red-500 hover:text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-opacity-50 rounded-full"},"✕",8,vXe),l("div",{onClick:i=>e.selectLanguage(s),class:Ue({"cursor-pointer hover:bg-blue-500 hover:text-white py-2 px-4 block whitespace-no-wrap":!0,"bg-blue-500 text-white":s===e.$store.state.language,"flex-grow":!0})},W(s),11,SXe)]))),128)),l("li",TXe,[D(l("input",{type:"text","onUpdate:modelValue":t[4]||(t[4]=s=>e.customLanguage=s),onKeyup:t[5]||(t[5]=zs(K((...s)=>e.addCustomLanguage&&e.addCustomLanguage(...s),["prevent"]),["enter"])),placeholder:"Enter language...",class:"bg-transparent border border-gray-300 rounded py-0 px-0 mx-0 my-1 w-full"},null,544),[[ue,e.customLanguage]])])])],512)):B("",!0)]),l("div",{class:"sun text-2xl w-6 hover:text-primary duration-150 cursor-pointer",title:"Switch to Light theme",onClick:t[6]||(t[6]=s=>e.themeSwitch())},t[19]||(t[19]=[l("i",{"data-feather":"sun"},null,-1)])),l("div",{class:"moon text-2xl w-6 hover:text-primary duration-150 cursor-pointer",title:"Switch to Dark theme",onClick:t[7]||(t[7]=s=>e.themeSwitch())},t[20]||(t[20]=[l("i",{"data-feather":"moon"},null,-1)]))]),z(CN),z(ac,{ref:"toast"},null,512),z(vN,{ref:"messageBox"},null,512),D(l("div",xXe,[z(cp,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),l("p",CXe,W(e.loading_infos)+" ...",1)],512),[[xt,e.progress_visibility]]),z(uc,{ref:"universalForm",class:"z-20"},null,512),z(SN,{ref:"yesNoDialog",class:"z-20"},null,512),z(TN,{ref:"personality_editor",config:e.currentPersonConfig,personality:e.selectedPersonality},null,8,["config","personality"]),l("div",wXe,[z(xN,{ref:"news"},null,512)])]))}}),NXe={class:"flex overflow-hidden flex-grow w-full"},MXe={__name:"App",setup(n){return(e,t)=>(T(),w("div",{class:Ue([e.currentTheme,"flex flex-col h-screen font-sans background-color text-slate-950 dark:bg-bg-dark dark:text-slate-50 w-full overflow-hidden"])},[z(AXe),l("div",NXe,[z(Ct(LA),null,{default:Ie(({Component:s})=>[(T(),at(dk,null,[(T(),at(Bu(s)))],1024))]),_:1})])],2))}},li=Object.create(null);li.open="0";li.close="1";li.ping="2";li.pong="3";li.message="4";li.upgrade="5";li.noop="6";const Md=Object.create(null);Object.keys(li).forEach(n=>{Md[li[n]]=n});const ob={type:"error",data:"parser error"},wN=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",RN=typeof ArrayBuffer=="function",AN=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,M0=({type:n,data:e},t,s)=>wN&&e instanceof Blob?t?s(e):Gx(e,s):RN&&(e instanceof ArrayBuffer||AN(e))?t?s(e):Gx(new Blob([e]),s):s(li[n]+(e||"")),Gx=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function Vx(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Yh;function OXe(n,e){if(wN&&n.data instanceof Blob)return n.data.arrayBuffer().then(Vx).then(e);if(RN&&(n.data instanceof ArrayBuffer||AN(n.data)))return e(Vx(n.data));M0(n,!1,t=>{Yh||(Yh=new TextEncoder),e(Yh.encode(t))})}const zx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n{let e=n.length*.75,t=n.length,s,i=0,r,o,a,c;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const d=new ArrayBuffer(e),u=new Uint8Array(d);for(s=0;s>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|c&63;return d},kXe=typeof ArrayBuffer=="function",O0=(n,e)=>{if(typeof n!="string")return{type:"message",data:NN(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:DXe(n.substring(1),e)}:Md[t]?n.length>1?{type:Md[t],data:n.substring(1)}:{type:Md[t]}:ob},DXe=(n,e)=>{if(kXe){const t=IXe(n);return NN(t,e)}else return{base64:!0,data:n}},NN=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},MN="",LXe=(n,e)=>{const t=n.length,s=new Array(t);let i=0;n.forEach((r,o)=>{M0(r,!1,a=>{s[o]=a,++i===t&&e(s.join(MN))})})},PXe=(n,e)=>{const t=n.split(MN),s=[];for(let i=0;i{const s=t.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const r=new DataView(i.buffer);r.setUint8(0,126),r.setUint16(1,s)}else{i=new Uint8Array(9);const r=new DataView(i.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let $h;function Fc(n){return n.reduce((e,t)=>e+t.length,0)}function Uc(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let i=0;iMath.pow(2,21)-1){a.enqueue(ob);break}i=u*Math.pow(2,32)+d.getUint32(4),s=3}else{if(Fc(t)n){a.enqueue(ob);break}}}})}const ON=4;function on(n){if(n)return BXe(n)}function BXe(n){for(var e in on.prototype)n[e]=on.prototype[e];return n}on.prototype.on=on.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};on.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};on.prototype.off=on.prototype.removeListener=on.prototype.removeAllListeners=on.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,i=0;iPromise.resolve().then(e):(e,t)=>t(e,0),_s=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),GXe="arraybuffer";function IN(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const VXe=_s.setTimeout,zXe=_s.clearTimeout;function up(n,e){e.useNativeTimers?(n.setTimeoutFn=VXe.bind(_s),n.clearTimeoutFn=zXe.bind(_s)):(n.setTimeoutFn=_s.setTimeout.bind(_s),n.clearTimeoutFn=_s.clearTimeout.bind(_s))}const HXe=1.33;function qXe(n){return typeof n=="string"?YXe(n):Math.ceil((n.byteLength||n.size)*HXe)}function YXe(n){let e=0,t=0;for(let s=0,i=n.length;s=57344?t+=3:(s++,t+=4);return t}function kN(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function $Xe(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function WXe(n){let e={},t=n.split("&");for(let s=0,i=t.length;s{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};PXe(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,LXe(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=kN()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let DN=!1;try{DN=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const QXe=DN;function XXe(){}class ZXe extends jXe{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,r)=>{this.onError("xhr post error",i,r)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}let ia=class Od extends on{constructor(e,t,s){super(),this.createRequest=e,up(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=IN(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Od.requestsCount++,Od.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=XXe,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Od.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};ia.requestsCount=0;ia.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Hx);else if(typeof addEventListener=="function"){const n="onpagehide"in _s?"pagehide":"unload";addEventListener(n,Hx,!1)}}function Hx(){for(let n in ia.requests)ia.requests.hasOwnProperty(n)&&ia.requests[n].abort()}const JXe=function(){const n=LN({xdomain:!1});return n&&n.responseType!==null}();class eZe extends ZXe{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=JXe&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new ia(LN,this.uri(),e)}}function LN(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||QXe))return new XMLHttpRequest}catch{}if(!e)try{return new _s[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const PN=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class tZe extends I0{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=PN?{}:IN(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.doWrite(s,r)}catch{}i&&dp(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=kN()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const Wh=_s.WebSocket||_s.MozWebSocket;class nZe extends tZe{createSocket(e,t,s){return PN?new Wh(e,t,s):t?new Wh(e,t):new Wh(e)}doWrite(e,t){this.ws.send(t)}}class sZe extends I0{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=UXe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=FXe();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const r=()=>{s.read().then(({done:a,value:c})=>{a||(this.onPacket(c),r())}).catch(a=>{})};r();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t{i&&dp(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const iZe={websocket:nZe,webtransport:sZe,polling:eZe},rZe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,oZe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ab(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let i=rZe.exec(n||""),r={},o=14;for(;o--;)r[oZe[o]]=i[o]||"";return t!=-1&&s!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=aZe(r,r.path),r.queryKey=lZe(r,r.query),r}function aZe(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function lZe(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,r){i&&(t[i]=r)}),t}const lb=typeof addEventListener=="function"&&typeof removeEventListener=="function",Id=[];lb&&addEventListener("offline",()=>{Id.forEach(n=>n())},!1);class hr extends on{constructor(e,t){if(super(),this.binaryType=GXe,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const s=ab(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=ab(t.host).host);up(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=WXe(this.opts.query)),lb&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Id.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=ON,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&hr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",hr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,dp(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,i){if(typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const r={type:e,data:t,options:s};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(hr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),lb&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Id.indexOf(this._offlineEventListener);s!==-1&&Id.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}hr.protocol=ON;class cZe extends hr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",_=>{if(!s)if(_.type==="pong"&&_.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;hr.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=t.name,this.emitReserved("upgradeError",m)}}))};function r(){s||(s=!0,u(),t.close(),t=null)}const o=_=>{const m=new Error("probe error: "+_);m.transport=t.name,r(),this.emitReserved("upgradeError",m)};function a(){o("transport closed")}function c(){o("socket closed")}function d(_){t&&_.name!==t.name&&r()}const u=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",a),this.off("close",c),this.off("upgrading",d)};t.once("open",i),t.once("error",o),t.once("close",a),this.once("close",c),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;siZe[i]).filter(i=>!!i)),super(e,s)}};function uZe(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=ab(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const r=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+r+":"+s.port+e,s.href=s.protocol+"://"+r+(t&&t.port===s.port?"":":"+s.port),s}const pZe=typeof ArrayBuffer=="function",fZe=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,FN=Object.prototype.toString,_Ze=typeof Blob=="function"||typeof Blob<"u"&&FN.call(Blob)==="[object BlobConstructor]",mZe=typeof File=="function"||typeof File<"u"&&FN.call(File)==="[object FileConstructor]";function k0(n){return pZe&&(n instanceof ArrayBuffer||fZe(n))||_Ze&&n instanceof Blob||mZe&&n instanceof File}function kd(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t=0&&n.num{delete this.acks[e];for(let a=0;a{this.io.clearTimeoutFn(r),t.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{const r=(o,a)=>o?i(o):s(a);r.withError=!0,t.push(r),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...r)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...r)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:At.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case At.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case At.EVENT:case At.BINARY_EVENT:this.onevent(e);break;case At.ACK:case At.BINARY_ACK:this.onack(e);break;case At.DISCONNECT:this.ondisconnect();break;case At.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...i){s||(s=!0,t.packet({type:At.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:At.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s0&&n.jitter<=1?n.jitter:0,this.attempts=0}za.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=Math.floor(e*10)&1?n+t:n-t}return Math.min(n,this.max)|0};za.prototype.reset=function(){this.attempts=0};za.prototype.setMin=function(n){this.ms=n};za.prototype.setMax=function(n){this.max=n};za.prototype.setJitter=function(n){this.jitter=n};class ub extends on{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,up(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new za({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||SZe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new dZe(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=ks(t,"open",function(){s.onopen(),e&&e()}),r=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=ks(t,"error",r);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{i(),r(new Error("timeout")),t.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(ks(e,"ping",this.onping.bind(this)),ks(e,"data",this.ondata.bind(this)),ks(e,"error",this.onerror.bind(this)),ks(e,"close",this.onclose.bind(this)),ks(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){dp(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new UN(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;se()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const nl={};function Dd(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=uZe(n,e.path||"/socket.io"),s=t.source,i=t.id,r=t.path,o=nl[i]&&r in nl[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let c;return a?c=new ub(s,e):(nl[i]||(nl[i]=new ub(s,e)),c=nl[i]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(Dd,{Manager:ub,Socket:UN,io:Dd,connect:Dd});const BN="/";console.log(BN);const qe=new Dd(BN,{reconnection:!0,reconnectionAttempts:10,reconnectionDelay:1e3}),xZe={props:{value:String,inputType:{type:String,default:"text",validator:n=>["text","email","password","file","path","integer","float"].includes(n)},fileAccept:String},data(){return{inputValue:this.value,placeholderText:this.getPlaceholderText()}},watch:{value(n){console.log("Changing value to ",n),this.inputValue=n}},mounted(){Le(()=>{Ve.replace()}),console.log("Changing value to ",this.value),this.inputValue=this.value},methods:{handleSliderInput(n){this.inputValue=n.target.value,this.$emit("input",n.target.value)},getPlaceholderText(){switch(this.inputType){case"text":return"Enter text here";case"email":return"Enter your email";case"password":return"Enter your password";case"file":case"path":return"Choose a file";case"integer":return"Enter an integer";case"float":return"Enter a float";default:return"Enter value here"}},handleInput(n){if(this.inputType==="integer"){const e=n.target.value.replace(/[^0-9]/g,"");this.inputValue=e}console.log("handling input : ",n.target.value),this.$emit("input",n.target.value)},async pasteFromClipboard(){try{const n=await navigator.clipboard.readText();this.handleClipboardData(n)}catch(n){console.error("Failed to read from clipboard:",n)}},handlePaste(n){const e=n.clipboardData.getData("text");this.handleClipboardData(e)},handleClipboardData(n){switch(this.inputType){case"email":this.inputValue=this.isValidEmail(n)?n:"";break;case"password":this.inputValue=n;break;case"file":case"path":this.inputValue="";break;case"integer":this.inputValue=this.parseInteger(n);break;case"float":this.inputValue=this.parseFloat(n);break;default:this.inputValue=n;break}},isValidEmail(n){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)},parseInteger(n){const e=parseInt(n);return isNaN(e)?"":e},parseFloat(n){const e=parseFloat(n);return isNaN(e)?"":e},openFileInput(){this.$refs.fileInput.click()},handleFileInputChange(n){const e=n.target.files[0];e&&(this.inputValue=e.name)}}},CZe={class:"flex items-center space-x-2"},wZe=["value","type","placeholder"],RZe=["value","min","max"],AZe=["accept"];function NZe(n,e,t,s,i,r){return T(),w("div",CZe,[n.useSlider?(T(),w("input",{key:1,type:"range",value:parseInt(i.inputValue),min:n.minSliderValue,max:n.maxSliderValue,onInput:e[2]||(e[2]=(...o)=>r.handleSliderInput&&r.handleSliderInput(...o)),class:"flex-1 px-4 py-2 text-lg border dark:bg-gray-600 border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,RZe)):(T(),w("input",{key:0,value:i.inputValue,type:t.inputType,placeholder:i.placeholderText,onInput:e[0]||(e[0]=(...o)=>r.handleInput&&r.handleInput(...o)),onPaste:e[1]||(e[1]=(...o)=>r.handlePaste&&r.handlePaste(...o)),class:"flex-1 px-4 py-2 text-lg dark:bg-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,wZe)),l("button",{onClick:e[3]||(e[3]=(...o)=>r.pasteFromClipboard&&r.pasteFromClipboard(...o)),class:"p-2 bg-blue-500 dark:bg-gray-600 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},e[6]||(e[6]=[l("i",{"data-feather":"clipboard"},null,-1)])),t.inputType==="file"?(T(),w("button",{key:2,onClick:e[4]||(e[4]=(...o)=>r.openFileInput&&r.openFileInput(...o)),class:"p-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},e[7]||(e[7]=[l("i",{"data-feather":"upload"},null,-1)]))):B("",!0),t.inputType==="file"?(T(),w("input",{key:3,ref:"fileInput",type:"file",style:{display:"none"},accept:t.fileAccept,onChange:e[5]||(e[5]=(...o)=>r.handleFileInputChange&&r.handleFileInputChange(...o))},null,40,AZe)):B("",!0)])}const L0=it(xZe,[["render",NZe]]),MZe={name:"TokensHighlighter",props:{namedTokens:{type:Object,required:!0}},data(){return{colors:["#FF6633","#FFB399","#FF33FF","#FFFF99","#00B3E6","#E6B333","#3366E6","#999966","#99FF99","#B34D4D","#80B300","#809900","#E6B3B3","#6680B3","#66991A","#FF99E6","#CCFF1A","#FF1A66","#E6331A","#33FFCC","#66994D","#B366CC","#4D8000","#B33300","#CC80CC","#66664D","#991AFF","#E666FF","#4DB3FF","#1AB399","#E666B3","#33991A","#CC9999","#B3B31A","#00E680","#4D8066","#809980","#E6FF80","#1AFF33","#999933","#FF3380","#CCCC00","#66E64D","#4D80CC","#9900B3","#E64D66","#4DB380","#FF4D4D","#99E6E6","#6666FF"]}}},OZe={class:"w-full"},IZe={class:"break-words"},kZe={class:"break-words mt-2"},DZe={class:"mt-4"};function LZe(n,e,t,s,i,r){return T(),w("div",OZe,[l("div",IZe,[(T(!0),w(Be,null,Xe(t.namedTokens,(o,a)=>(T(),w("span",{key:a},[l("span",{class:"inline-block whitespace-pre-wrap",style:Wt({backgroundColor:i.colors[a%i.colors.length]})},W(o[0]),5)]))),128))]),l("div",kZe,[(T(!0),w(Be,null,Xe(t.namedTokens,(o,a)=>(T(),w("span",{key:a},[l("span",{class:"inline-block px-1 whitespace-pre-wrap",style:Wt({backgroundColor:i.colors[a%i.colors.length]})},W(o[1]),5)]))),128))]),l("div",DZe,[l("strong",null,"Total Tokens: "+W(t.namedTokens.length),1)])])}const PZe=it(MZe,[["render",LZe]]),FZe={name:"ChatBarButton",props:{buttonClass:{type:String,default:"text-gray-600 dark:text-gray-300"}}};function UZe(n,e,t,s,i,r){return T(),w("button",AR({class:["p-2 rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",[t.buttonClass,"hover:bg-gray-200 dark:hover:bg-gray-700","active:bg-gray-300 dark:active:bg-gray-600"]]},n.$attrs,Ek(n.$listeners)),[un(n.$slots,"icon"),un(n.$slots,"default")],16)}const GN=it(FZe,[["render",UZe]]),BZe={props:{is_subcard:{type:Boolean,default:!1},is_shrunk:{type:Boolean,default:!1},title:{type:String,default:""},isHorizontal:{type:Boolean,default:!1},cardWidth:{type:String,default:"w-3/4"},disableHoverAnimation:{type:Boolean,default:!0},disableFocus:{type:Boolean,default:!1}},data(){return{shrink:this.is_shrunk,isHovered:!1,isActive:!1}},computed:{cardClass(){return["bg-gray-50","border","border-gray-300","text-gray-900","text-sm","rounded-lg","focus:ring-blue-500","focus:border-blue-500","w-full","p-2.5","dark:bg-gray-500","dark:border-gray-600","dark:placeholder-gray-400","dark:text-white","dark:focus:ring-blue-500","dark:focus:border-blue-500",{"cursor-pointer":!this.isActive&&!this.disableFocus,"w-auto":!this.isActive}]},cardWidthClass(){return this.isActive?this.cardWidth:""}},methods:{toggleCard(){this.disableFocus||(this.isActive=!this.isActive)}}},GZe={key:1,class:"flex flex-wrap"},VZe={key:2,class:"mb-2"};function zZe(n,e,t,s,i,r){return T(),w("div",null,[i.isActive?(T(),w("div",{key:0,class:"overlay",onClick:e[0]||(e[0]=(...o)=>r.toggleCard&&r.toggleCard(...o))})):B("",!0),D(l("div",{class:Ue(["border-blue-300 rounded-lg shadow-lg p-2",r.cardWidthClass,"m-2",{subcard:t.is_subcard},{"bg-white dark:bg-gray-900":!t.is_subcard},{hovered:!t.disableHoverAnimation&&i.isHovered,active:i.isActive}]),onMouseenter:e[2]||(e[2]=o=>i.isHovered=!0),onMouseleave:e[3]||(e[3]=o=>i.isHovered=!1),onClick:e[4]||(e[4]=K((...o)=>r.toggleCard&&r.toggleCard(...o),["self"])),style:Wt({cursor:this.disableFocus?"":"pointer"})},[t.title?(T(),w("div",{key:0,onClick:e[1]||(e[1]=o=>i.shrink=!0),class:Ue([{"text-center p-2 m-2 bg-gray-200":!t.is_subcard},"bg-gray-100 dark:bg-gray-500 rounded-lg pl-2 pr-2 mb-2 font-bold cursor-pointer"])},W(t.title),3)):B("",!0),t.isHorizontal?(T(),w("div",GZe,[un(n.$slots,"default")])):(T(),w("div",VZe,[un(n.$slots,"default")]))],38),[[xt,i.shrink===!1]]),t.is_subcard?D((T(),w("div",{key:1,onClick:e[5]||(e[5]=o=>i.shrink=!1),class:"bg-white text-center text-xl bold dark:bg-gray-500 border-blue-300 rounded-lg shadow-lg p-2 h-10 cursor-pointer m-2"},W(t.title),513)),[[xt,i.shrink===!0]]):D((T(),w("div",{key:2,onClick:e[6]||(e[6]=o=>i.shrink=!1),class:"bg-white text-center text-2xl dark:bg-gray-500 border-2 border-blue-300 rounded-lg shadow-lg p-0 h-7 cursor-pointer hover:h-8 hover:bg-blue-300"}," + ",512)),[[xt,i.shrink===!0]])])}const pp=it(BZe,[["render",zZe]]),VN="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M20%203H4c-1.103%200-2%20.897-2%202v14c0%201.103.897%202%202%202h16c1.103%200%202-.897%202-2V5c0-1.103-.897-2-2-2zM4%2019V7h16l.002%2012H4z'/%3e%3cpath%20d='M9.293%209.293%205.586%2013l3.707%203.707%201.414-1.414L8.414%2013l2.293-2.293zm5.414%200-1.414%201.414L15.586%2013l-2.293%202.293%201.414%201.414L18.414%2013z'/%3e%3c/svg%3e",zN="/assets/python_block-Bt12VGEE.png",HN="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2024.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20630%20630'%20style='enable-background:new%200%200%20630%20630;'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23EDBF4A;}%20.st1{fill:%230C0C0C;}%20%3c/style%3e%3crect%20class='st0'%20width='630'%20height='630'/%3e%3cpath%20class='st1'%20d='M423.2,492.2c12.7,20.7,29.2,36,58.4,36c24.5,0,40.2-12.3,40.2-29.2c0-20.3-16.1-27.5-43.1-39.3l-14.8-6.4%20c-42.7-18.2-71.1-41-71.1-89.2c0-44.4,33.8-78.2,86.7-78.2c37.6,0,64.7,13.1,84.2,47.4l-46.1,29.6c-10.1-18.2-21.1-25.4-38.1-25.4%20c-17.3,0-28.3,11-28.3,25.4c0,17.8,11,25,36.4,36l14.8,6.3c50.3,21.6,78.7,43.6,78.7,93c0,53.3-41.9,82.5-98.1,82.5%20c-55,0-90.5-26.2-107.9-60.5L423.2,492.2z%20M214.1,497.3c9.3,16.5,17.8,30.5,38.1,30.5c19.5,0,31.7-7.6,31.7-37.2V289.3h59.2v202.1%20c0,61.3-35.9,89.2-88.4,89.2c-47.4,0-74.9-24.5-88.8-54.1L214.1,497.3z'/%3e%3c/svg%3e",qN="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAOeSURBVGhD7ZhNaBNBGIZHW/EPbSioRSpi0FRpVdRSjQfxkFilB5UciuChIL0JLaKIhR5KIYKIiBSF0mLVS7AIavUgPQjiT4+KB0EP3gwS8VDBgj8d33d2ZrNJt2lCppKWfeBh5pvdncyXmZ3sZokQQsIFz1JdLni8M8L6QkSNf9HMSJBIpREkUmkEiVQaQSKVRpCIH8lkUtbW1sre3l7fB9FoNCrD4fC8PaSyYyudNzU1yZGRkYJ9dXV1yUQiYTMZNX6rM5LJZERHR0fBh0/MmJDSZh4OVhOZmprStf+P1UQmJyd1zaGvr09NuxM5VFVViYmJCR3Zw1oiPT09koP00tjYKNrb23XkEIlERHV1tY7sMuNbK5XR0VGJwcnBwcGi+uns7Cz7Mz24fVnpdGhoSDY0NBTbjxweHi77MzXu+N2KBebsh7PW0tJi6/OIGr/Vm72mpkbXssTj8ZxBp9NpUV9fryN7WE0kn1QqJcfHx3U0v1hNJBQKqXtFh2JsbEx0d3frKMv09LSu2UWtMadaHm1tberxQ+9Koq6uLqff1tZW2dzcLPXviy3c8bsVG/T398+6I8ViMTkwMGDtszRq/MEfdJVGkEilESRSaZSSyCa43anmsAPGII/7wWd7nnMEbmaDD2G41anmsA76tfui9mGnWpAPkOftVpEQuyDfkMz19Bv0cg56j9NP8AQ07IXm2Es2eHgK2b5RRf6Ya7OVOchP5D1kfA0m4GX4CxouQR7/A6/DC/CObqNRSA5A00Y7oeG/JMJBM65TUS7rIV/gefw4GzzchWx/rKJsIu90+REaik6knJv9hy5vw4NO1WU/XAG/w0ds8MABk326NLyGL+A2eJYNpVBOIhd1eRS+gs/hTjYAc4M+06WX+7rkt7zKqbrc0OV5WNIjUzmJDME9MKUiIQ5DvnyshOZfCL/+l+uSz/I/narLA8gvhLsb77miKScR8haegqfhb7gBcoa4M5G4Lr0069Kck88VXZ6B+TNWEHWzONWCpCHPM78lZhkZ3kAePwa36DpthQYulwxke5INwNzst1Tk8ASa66mVXYtLgFPOc7iVroUtOh6F3Gbv6fgLXAPJVWj65vU3IW9oxl+hWWJ+iRyC5lpqJZHP0JxjbnBO+UP4F5pjXNsnoRf+IJqZpNySmRSXoMEvEeL9Iqwkwm20Cfqt12UwAleraHZCcLbHEzLz75fiUeMP3hArjUWTiHdpLWgWyYwI8Q8rrSjH5vAr6AAAAABJRU5ErkJggg==",YN="/assets/cpp_block-kkmuBJ_E.png",$N="/assets/html5_block-beC_-Wtz.png",WN="/assets/LaTeX_block-BNFNi2yr.png",KN="/assets/bash_block-DZNRrwlz.png",HZe="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTAgNTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+DQogIDxjaXJjbGUgY3g9IjI1IiBjeT0iMjUiIHI9IjI1IiBmaWxsPSJkZWVwc2t5Ymx1ZSIvPg0KICA8dGV4dCB4PSIyNSIgeT0iMzciIGZvbnQtc2l6ZT0iMzYiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IndoaXRlIiBmb250LXdlaWdodD0iYm9sZCI+VDwvdGV4dD4NCjwvc3ZnPg0K",qZe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='red'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3ccircle%20cx='12'%20cy='12'%20r='10'%3e%3c/circle%3e%3cpath%20d='M16%2016s-1.5-2-4-2-4%202-4%202'%20stroke='currentColor'%3e%3c/path%3e%3cline%20x1='9'%20y1='9'%20x2='15'%20y2='15'%20stroke='currentColor'%3e%3c/line%3e%3c/svg%3e",YZe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3ccircle%20cx='12'%20cy='12'%20r='10'%3e%3c/circle%3e%3cpath%20d='M16%2016s-1.5-2-4-2-4%202-4%202'%3e%3c/path%3e%3cline%20x1='9'%20y1='9'%20x2='15'%20y2='15'%3e%3c/line%3e%3c/svg%3e",$Ze="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%3e%3ccircle%20cx='25'%20cy='25'%20r='24'%20fill='white'%20stroke='black'%20stroke-width='2'/%3e%3ccircle%20id='heartbeat'%20cx='25'%20cy='25'%20r='20'%20fill='red'%3e%3canimate%20attributeName='r'%20dur='1s'%20repeatCount='indefinite'%20keyTimes='0;0.25;0.5;0.75;1'%20values='20;24;20;22;20'/%3e%3c/circle%3e%3c/svg%3e",WZe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%3e%3ccircle%20cx='25'%20cy='25'%20r='24'%20fill='white'%20stroke='black'%20stroke-width='2'/%3e%3ccircle%20cx='25'%20cy='25'%20r='20'%20fill='red'/%3e%3c/svg%3e",jN="data:image/svg+xml,%3csvg%20viewBox='0%200%2050%2050'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20transform='translate(25,25)'%3e%3ccircle%20cx='0'%20cy='-15'%20r='3'%20fill='%23f00'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20from='0'%20to='360'%20dur='1s'%20repeatCount='indefinite'%20/%3e%3c/circle%3e%3ccircle%20cx='0'%20cy='-15'%20r='3'%20fill='%230f0'%20transform='rotate(90)'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20from='0'%20to='360'%20dur='1.2s'%20repeatCount='indefinite'%20/%3e%3c/circle%3e%3ccircle%20cx='0'%20cy='-15'%20r='3'%20fill='%2300f'%20transform='rotate(180)'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20from='0'%20to='360'%20dur='1.4s'%20repeatCount='indefinite'%20/%3e%3c/circle%3e%3ccircle%20cx='0'%20cy='-15'%20r='3'%20fill='%23ff0'%20transform='rotate(270)'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20from='0'%20to='360'%20dur='1.6s'%20repeatCount='indefinite'%20/%3e%3c/circle%3e%3c/g%3e%3c/svg%3e",KZe={props:{icon:{type:String,required:!0},title:{type:String,required:!0}},computed:{iconPath(){return this.getIconPath()}},methods:{getIconPath(){switch(this.icon){case"x":return'';case"check":return'';case"code":return'';case"python":return'';case"js":return'JS';case"typescript":return'TS';case"braces":return'';case"cplusplus":case"c++":return'C++';case"csharp":return'C#';case"go":return'Go';case"r-project":return'R';case"rust":return'';case"swift":return'';case"kotlin":return'';case"java":return'';case"html5":return'';case"css3":return'';case"vuejs":return'';case"react":return'';case"angular":return'';case"xml":return'';case"json":return'';case"yaml":return'';case"markdown":return'';case"latex":return'TEX';case"bash":return'';case"powershell":return'';case"perl":return'';case"mermaid":return'';case"graphviz":return'';case"plantuml":return'';case"sql":return'';case"mongodb":return'';case"mathFunction":return'';case"terminal":return'';case"edit":return'';case"copy":return'';case"send":return'';case"globe":return'';case"fastForward":return'';case"sendSimple":return'';default:return""}}}},jZe=["title"],QZe={class:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},XZe=["innerHTML"];function ZZe(n,e,t,s,i,r){return T(),w("button",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:t.title,onClick:e[0]||(e[0]=o=>n.$emit("click"))},[(T(),w("svg",QZe,[l("g",{innerHTML:r.iconPath},null,8,XZe)]))],8,jZe)}const P0=it(KZe,[["render",ZZe]]);var jn="top",ws="bottom",Rs="right",Qn="left",F0="auto",pc=[jn,ws,Rs,Qn],ma="start",jl="end",JZe="clippingParents",QN="viewport",sl="popper",eJe="reference",Yx=pc.reduce(function(n,e){return n.concat([e+"-"+ma,e+"-"+jl])},[]),XN=[].concat(pc,[F0]).reduce(function(n,e){return n.concat([e,e+"-"+ma,e+"-"+jl])},[]),tJe="beforeRead",nJe="read",sJe="afterRead",iJe="beforeMain",rJe="main",oJe="afterMain",aJe="beforeWrite",lJe="write",cJe="afterWrite",dJe=[tJe,nJe,sJe,iJe,rJe,oJe,aJe,lJe,cJe];function ci(n){return n?(n.nodeName||"").toLowerCase():null}function as(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function po(n){var e=as(n).Element;return n instanceof e||n instanceof Element}function Ts(n){var e=as(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function U0(n){if(typeof ShadowRoot>"u")return!1;var e=as(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function uJe(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];!Ts(r)||!ci(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(o){var a=i[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function pJe(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(s){var i=e.elements[s],r=e.attributes[s]||{},o=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),a=o.reduce(function(c,d){return c[d]="",c},{});!Ts(i)||!ci(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(c){i.removeAttribute(c)}))})}}const fJe={name:"applyStyles",enabled:!0,phase:"write",fn:uJe,effect:pJe,requires:["computeStyles"]};function oi(n){return n.split("-")[0]}var to=Math.max,ru=Math.min,ha=Math.round;function pb(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function ZN(){return!/^((?!chrome|android).)*safari/i.test(pb())}function ga(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=n.getBoundingClientRect(),i=1,r=1;e&&Ts(n)&&(i=n.offsetWidth>0&&ha(s.width)/n.offsetWidth||1,r=n.offsetHeight>0&&ha(s.height)/n.offsetHeight||1);var o=po(n)?as(n):window,a=o.visualViewport,c=!ZN()&&t,d=(s.left+(c&&a?a.offsetLeft:0))/i,u=(s.top+(c&&a?a.offsetTop:0))/r,_=s.width/i,m=s.height/r;return{width:_,height:m,top:u,right:d+_,bottom:u+m,left:d,x:d,y:u}}function B0(n){var e=ga(n),t=n.offsetWidth,s=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:s}}function JN(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&U0(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Fi(n){return as(n).getComputedStyle(n)}function _Je(n){return["table","td","th"].indexOf(ci(n))>=0}function Nr(n){return((po(n)?n.ownerDocument:n.document)||window.document).documentElement}function fp(n){return ci(n)==="html"?n:n.assignedSlot||n.parentNode||(U0(n)?n.host:null)||Nr(n)}function $x(n){return!Ts(n)||Fi(n).position==="fixed"?null:n.offsetParent}function mJe(n){var e=/firefox/i.test(pb()),t=/Trident/i.test(pb());if(t&&Ts(n)){var s=Fi(n);if(s.position==="fixed")return null}var i=fp(n);for(U0(i)&&(i=i.host);Ts(i)&&["html","body"].indexOf(ci(i))<0;){var r=Fi(i);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return i;i=i.parentNode}return null}function fc(n){for(var e=as(n),t=$x(n);t&&_Je(t)&&Fi(t).position==="static";)t=$x(t);return t&&(ci(t)==="html"||ci(t)==="body"&&Fi(t).position==="static")?e:t||mJe(n)||e}function G0(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Rl(n,e,t){return to(n,ru(e,t))}function hJe(n,e,t){var s=Rl(n,e,t);return s>t?t:s}function eM(){return{top:0,right:0,bottom:0,left:0}}function tM(n){return Object.assign({},eM(),n)}function nM(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var gJe=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,tM(typeof e!="number"?e:nM(e,pc))};function bJe(n){var e,t=n.state,s=n.name,i=n.options,r=t.elements.arrow,o=t.modifiersData.popperOffsets,a=oi(t.placement),c=G0(a),d=[Qn,Rs].indexOf(a)>=0,u=d?"height":"width";if(!(!r||!o)){var _=gJe(i.padding,t),m=B0(r),h=c==="y"?jn:Qn,f=c==="y"?ws:Rs,g=t.rects.reference[u]+t.rects.reference[c]-o[c]-t.rects.popper[u],b=o[c]-t.rects.reference[c],y=fc(r),E=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,v=g/2-b/2,S=_[h],R=E-m[u]-_[f],C=E/2-m[u]/2+v,A=Rl(S,C,R),I=c;t.modifiersData[s]=(e={},e[I]=A,e.centerOffset=A-C,e)}}function yJe(n){var e=n.state,t=n.options,s=t.element,i=s===void 0?"[data-popper-arrow]":s;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||JN(e.elements.popper,i)&&(e.elements.arrow=i))}const EJe={name:"arrow",enabled:!0,phase:"main",fn:bJe,effect:yJe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ba(n){return n.split("-")[1]}var vJe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function SJe(n,e){var t=n.x,s=n.y,i=e.devicePixelRatio||1;return{x:ha(t*i)/i||0,y:ha(s*i)/i||0}}function Wx(n){var e,t=n.popper,s=n.popperRect,i=n.placement,r=n.variation,o=n.offsets,a=n.position,c=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,_=n.isFixed,m=o.x,h=m===void 0?0:m,f=o.y,g=f===void 0?0:f,b=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=b.x,g=b.y;var y=o.hasOwnProperty("x"),E=o.hasOwnProperty("y"),v=Qn,S=jn,R=window;if(d){var C=fc(t),A="clientHeight",I="clientWidth";if(C===as(t)&&(C=Nr(t),Fi(C).position!=="static"&&a==="absolute"&&(A="scrollHeight",I="scrollWidth")),C=C,i===jn||(i===Qn||i===Rs)&&r===jl){S=ws;var x=_&&C===R&&R.visualViewport?R.visualViewport.height:C[A];g-=x-s.height,g*=c?1:-1}if(i===Qn||(i===jn||i===ws)&&r===jl){v=Rs;var N=_&&C===R&&R.visualViewport?R.visualViewport.width:C[I];h-=N-s.width,h*=c?1:-1}}var G=Object.assign({position:a},d&&vJe),V=u===!0?SJe({x:h,y:g},as(t)):{x:h,y:g};if(h=V.x,g=V.y,c){var te;return Object.assign({},G,(te={},te[S]=E?"0":"",te[v]=y?"0":"",te.transform=(R.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",te))}return Object.assign({},G,(e={},e[S]=E?g+"px":"",e[v]=y?h+"px":"",e.transform="",e))}function TJe(n){var e=n.state,t=n.options,s=t.gpuAcceleration,i=s===void 0?!0:s,r=t.adaptive,o=r===void 0?!0:r,a=t.roundOffsets,c=a===void 0?!0:a,d={placement:oi(e.placement),variation:ba(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Wx(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Wx(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const xJe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:TJe,data:{}};var Bc={passive:!0};function CJe(n){var e=n.state,t=n.instance,s=n.options,i=s.scroll,r=i===void 0?!0:i,o=s.resize,a=o===void 0?!0:o,c=as(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&d.forEach(function(u){u.addEventListener("scroll",t.update,Bc)}),a&&c.addEventListener("resize",t.update,Bc),function(){r&&d.forEach(function(u){u.removeEventListener("scroll",t.update,Bc)}),a&&c.removeEventListener("resize",t.update,Bc)}}const wJe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:CJe,data:{}};var RJe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ld(n){return n.replace(/left|right|bottom|top/g,function(e){return RJe[e]})}var AJe={start:"end",end:"start"};function Kx(n){return n.replace(/start|end/g,function(e){return AJe[e]})}function V0(n){var e=as(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function z0(n){return ga(Nr(n)).left+V0(n).scrollLeft}function NJe(n,e){var t=as(n),s=Nr(n),i=t.visualViewport,r=s.clientWidth,o=s.clientHeight,a=0,c=0;if(i){r=i.width,o=i.height;var d=ZN();(d||!d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:r,height:o,x:a+z0(n),y:c}}function MJe(n){var e,t=Nr(n),s=V0(n),i=(e=n.ownerDocument)==null?void 0:e.body,r=to(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=to(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-s.scrollLeft+z0(n),c=-s.scrollTop;return Fi(i||t).direction==="rtl"&&(a+=to(t.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:c}}function H0(n){var e=Fi(n),t=e.overflow,s=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+s)}function sM(n){return["html","body","#document"].indexOf(ci(n))>=0?n.ownerDocument.body:Ts(n)&&H0(n)?n:sM(fp(n))}function Al(n,e){var t;e===void 0&&(e=[]);var s=sM(n),i=s===((t=n.ownerDocument)==null?void 0:t.body),r=as(s),o=i?[r].concat(r.visualViewport||[],H0(s)?s:[]):s,a=e.concat(o);return i?a:a.concat(Al(fp(o)))}function fb(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function OJe(n,e){var t=ga(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function jx(n,e,t){return e===QN?fb(NJe(n,t)):po(e)?OJe(e,t):fb(MJe(Nr(n)))}function IJe(n){var e=Al(fp(n)),t=["absolute","fixed"].indexOf(Fi(n).position)>=0,s=t&&Ts(n)?fc(n):n;return po(s)?e.filter(function(i){return po(i)&&JN(i,s)&&ci(i)!=="body"}):[]}function kJe(n,e,t,s){var i=e==="clippingParents"?IJe(n):[].concat(e),r=[].concat(i,[t]),o=r[0],a=r.reduce(function(c,d){var u=jx(n,d,s);return c.top=to(u.top,c.top),c.right=ru(u.right,c.right),c.bottom=ru(u.bottom,c.bottom),c.left=to(u.left,c.left),c},jx(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function iM(n){var e=n.reference,t=n.element,s=n.placement,i=s?oi(s):null,r=s?ba(s):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(i){case jn:c={x:o,y:e.y-t.height};break;case ws:c={x:o,y:e.y+e.height};break;case Rs:c={x:e.x+e.width,y:a};break;case Qn:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var d=i?G0(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(r){case ma:c[d]=c[d]-(e[u]/2-t[u]/2);break;case jl:c[d]=c[d]+(e[u]/2-t[u]/2);break}}return c}function Ql(n,e){e===void 0&&(e={});var t=e,s=t.placement,i=s===void 0?n.placement:s,r=t.strategy,o=r===void 0?n.strategy:r,a=t.boundary,c=a===void 0?JZe:a,d=t.rootBoundary,u=d===void 0?QN:d,_=t.elementContext,m=_===void 0?sl:_,h=t.altBoundary,f=h===void 0?!1:h,g=t.padding,b=g===void 0?0:g,y=tM(typeof b!="number"?b:nM(b,pc)),E=m===sl?eJe:sl,v=n.rects.popper,S=n.elements[f?E:m],R=kJe(po(S)?S:S.contextElement||Nr(n.elements.popper),c,u,o),C=ga(n.elements.reference),A=iM({reference:C,element:v,strategy:"absolute",placement:i}),I=fb(Object.assign({},v,A)),x=m===sl?I:C,N={top:R.top-x.top+y.top,bottom:x.bottom-R.bottom+y.bottom,left:R.left-x.left+y.left,right:x.right-R.right+y.right},G=n.modifiersData.offset;if(m===sl&&G){var V=G[i];Object.keys(N).forEach(function(te){var O=[Rs,ws].indexOf(te)>=0?1:-1,H=[jn,ws].indexOf(te)>=0?"y":"x";N[te]+=V[H]*O})}return N}function DJe(n,e){e===void 0&&(e={});var t=e,s=t.placement,i=t.boundary,r=t.rootBoundary,o=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,d=c===void 0?XN:c,u=ba(s),_=u?a?Yx:Yx.filter(function(f){return ba(f)===u}):pc,m=_.filter(function(f){return d.indexOf(f)>=0});m.length===0&&(m=_);var h=m.reduce(function(f,g){return f[g]=Ql(n,{placement:g,boundary:i,rootBoundary:r,padding:o})[oi(g)],f},{});return Object.keys(h).sort(function(f,g){return h[f]-h[g]})}function LJe(n){if(oi(n)===F0)return[];var e=Ld(n);return[Kx(n),e,Kx(e)]}function PJe(n){var e=n.state,t=n.options,s=n.name;if(!e.modifiersData[s]._skip){for(var i=t.mainAxis,r=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!0:o,c=t.fallbackPlacements,d=t.padding,u=t.boundary,_=t.rootBoundary,m=t.altBoundary,h=t.flipVariations,f=h===void 0?!0:h,g=t.allowedAutoPlacements,b=e.options.placement,y=oi(b),E=y===b,v=c||(E||!f?[Ld(b)]:LJe(b)),S=[b].concat(v).reduce(function(ve,Oe){return ve.concat(oi(Oe)===F0?DJe(e,{placement:Oe,boundary:u,rootBoundary:_,padding:d,flipVariations:f,allowedAutoPlacements:g}):Oe)},[]),R=e.rects.reference,C=e.rects.popper,A=new Map,I=!0,x=S[0],N=0;N=0,H=O?"width":"height",q=Ql(e,{placement:G,boundary:u,rootBoundary:_,altBoundary:m,padding:d}),L=O?te?Rs:Qn:te?ws:jn;R[H]>C[H]&&(L=Ld(L));var Y=Ld(L),se=[];if(r&&se.push(q[V]<=0),a&&se.push(q[L]<=0,q[Y]<=0),se.every(function(ve){return ve})){x=G,I=!1;break}A.set(G,se)}if(I)for(var oe=f?3:1,ye=function(Oe){var De=S.find(function(Q){var fe=A.get(Q);if(fe)return fe.slice(0,Oe).every(function(_e){return _e})});if(De)return x=De,"break"},xe=oe;xe>0;xe--){var le=ye(xe);if(le==="break")break}e.placement!==x&&(e.modifiersData[s]._skip=!0,e.placement=x,e.reset=!0)}}const FJe={name:"flip",enabled:!0,phase:"main",fn:PJe,requiresIfExists:["offset"],data:{_skip:!1}};function Qx(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Xx(n){return[jn,Rs,ws,Qn].some(function(e){return n[e]>=0})}function UJe(n){var e=n.state,t=n.name,s=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,o=Ql(e,{elementContext:"reference"}),a=Ql(e,{altBoundary:!0}),c=Qx(o,s),d=Qx(a,i,r),u=Xx(c),_=Xx(d);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:_},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":_})}const BJe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:UJe};function GJe(n,e,t){var s=oi(n),i=[Qn,jn].indexOf(s)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=r[0],a=r[1];return o=o||0,a=(a||0)*i,[Qn,Rs].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function VJe(n){var e=n.state,t=n.options,s=n.name,i=t.offset,r=i===void 0?[0,0]:i,o=XN.reduce(function(u,_){return u[_]=GJe(_,e.rects,r),u},{}),a=o[e.placement],c=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[s]=o}const zJe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:VJe};function HJe(n){var e=n.state,t=n.name;e.modifiersData[t]=iM({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const qJe={name:"popperOffsets",enabled:!0,phase:"read",fn:HJe,data:{}};function YJe(n){return n==="x"?"y":"x"}function $Je(n){var e=n.state,t=n.options,s=n.name,i=t.mainAxis,r=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!1:o,c=t.boundary,d=t.rootBoundary,u=t.altBoundary,_=t.padding,m=t.tether,h=m===void 0?!0:m,f=t.tetherOffset,g=f===void 0?0:f,b=Ql(e,{boundary:c,rootBoundary:d,padding:_,altBoundary:u}),y=oi(e.placement),E=ba(e.placement),v=!E,S=G0(y),R=YJe(S),C=e.modifiersData.popperOffsets,A=e.rects.reference,I=e.rects.popper,x=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof x=="number"?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),G=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,V={x:0,y:0};if(C){if(r){var te,O=S==="y"?jn:Qn,H=S==="y"?ws:Rs,q=S==="y"?"height":"width",L=C[S],Y=L+b[O],se=L-b[H],oe=h?-I[q]/2:0,ye=E===ma?A[q]:I[q],xe=E===ma?-I[q]:-A[q],le=e.elements.arrow,ve=h&&le?B0(le):{width:0,height:0},Oe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:eM(),De=Oe[O],Q=Oe[H],fe=Rl(0,A[q],ve[q]),_e=v?A[q]/2-oe-fe-De-N.mainAxis:ye-fe-De-N.mainAxis,Ae=v?-A[q]/2+oe+fe+Q+N.mainAxis:xe+fe+Q+N.mainAxis,Fe=e.elements.arrow&&fc(e.elements.arrow),ne=Fe?S==="y"?Fe.clientTop||0:Fe.clientLeft||0:0,U=(te=G==null?void 0:G[S])!=null?te:0,P=L+_e-U-ne,J=L+Ae-U,ce=Rl(h?ru(Y,P):Y,L,h?to(se,J):se);C[S]=ce,V[S]=ce-L}if(a){var pe,he=S==="x"?jn:Qn,ae=S==="x"?ws:Rs,Ne=C[R],Re=R==="y"?"height":"width",ge=Ne+b[he],k=Ne-b[ae],M=[jn,Qn].indexOf(y)!==-1,$=(pe=G==null?void 0:G[R])!=null?pe:0,me=M?ge:Ne-A[Re]-I[Re]-$+N.altAxis,j=M?Ne+A[Re]+I[Re]-$-N.altAxis:k,ie=h&&M?hJe(me,Ne,j):Rl(h?me:ge,Ne,h?j:k);C[R]=ie,V[R]=ie-Ne}e.modifiersData[s]=V}}const WJe={name:"preventOverflow",enabled:!0,phase:"main",fn:$Je,requiresIfExists:["offset"]};function KJe(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function jJe(n){return n===as(n)||!Ts(n)?V0(n):KJe(n)}function QJe(n){var e=n.getBoundingClientRect(),t=ha(e.width)/n.offsetWidth||1,s=ha(e.height)/n.offsetHeight||1;return t!==1||s!==1}function XJe(n,e,t){t===void 0&&(t=!1);var s=Ts(e),i=Ts(e)&&QJe(e),r=Nr(e),o=ga(n,i,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!t)&&((ci(e)!=="body"||H0(r))&&(a=jJe(e)),Ts(e)?(c=ga(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):r&&(c.x=z0(r))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function ZJe(n){var e=new Map,t=new Set,s=[];n.forEach(function(r){e.set(r.name,r)});function i(r){t.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&i(c)}}),s.push(r)}return n.forEach(function(r){t.has(r.name)||i(r)}),s}function JJe(n){var e=ZJe(n);return dJe.reduce(function(t,s){return t.concat(e.filter(function(i){return i.phase===s}))},[])}function eet(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function tet(n){var e=n.reduce(function(t,s){var i=t[s.name];return t[s.name]=i?Object.assign({},i,s,{options:Object.assign({},i.options,s.options),data:Object.assign({},i.data,s.data)}):s,t},{});return Object.keys(e).map(function(t){return e[t]})}var Zx={placement:"bottom",modifiers:[],strategy:"absolute"};function Jx(){for(var n=arguments.length,e=new Array(n),t=0;t{this.createPopper()})},closeMenu(n){var e;!this.$el.contains(n.target)&&!((e=this.$refs.dropdown)!=null&&e.contains(n.target))&&(this.isOpen=!1)},createPopper(){const n=this.$el.querySelector("button"),e=this.$refs.dropdown;n&&e&&(this.popperInstance=_p(n,e,{placement:"bottom-end",modifiers:[{name:"flip",options:{fallbackPlacements:["top-end","bottom-start","top-start"]}},{name:"preventOverflow",options:{boundary:document.body}}]}))}}},ret={class:"relative inline-block text-left"},oet={key:0,ref:"dropdown",class:"z-50 w-56 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 dark:ring-white dark:ring-opacity-20 focus:outline-none dropdown-shadow text-gray-700 dark:text-white"},aet={class:"py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"};function cet(n,e,t,s,i,r){const o=et("ToolbarButton");return T(),w("div",ret,[l("div",null,[z(o,{onClick:K(r.toggleMenu,["stop"]),title:t.title,icon:"code"},null,8,["onClick","title"])]),(T(),at(ok,{to:"body"},[i.isOpen?(T(),w("div",oet,[l("div",aet,[un(n.$slots,"default",{},void 0,!0)])],512)):B("",!0)]))])}const rM=it(iet,[["render",cet],["__scopeId","data-v-6c3ea3a5"]]);async function eC(n,e="",t=[]){return new Promise((s,i)=>{const r=document.createElement("div");r.className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50",t.length===0?r.innerHTML=` +`}).use(kKe({inlineMath:[["$","$"],["\\(","\\)"]],blockMath:[["$$","$$"],["\\[","\\]"]]})),t=ot([]),s=()=>{if(n.markdownText){let r=e.parse(n.markdownText,{}),o=[];t.value=[];for(let a=0;a0&&(t.value.push({type:"html",html:e.renderer.render(o,e.options,{})}),o=[]),t.value.push({type:"code",language:DKe(r[a].info),code:r[a].content}));o.length>0&&(t.value.push({type:"html",html:e.renderer.render(o,e.options,{})}),o=[])}else t.value=[];Le(()=>{Ve.replace()})},i=(r,o)=>{t.value[r].code=o};return Tn(()=>n.markdownText,s),di(()=>{s(),Le(()=>{window.MathJax&&window.MathJax.typesetPromise()})}),{markdownItems:t,updateCode:i}}},PKe={class:"break-all container w-full"},FKe={ref:"mdRender",class:"markdown-content"},UKe=["innerHTML"];function BKe(n,e,t,s,i,r){const o=et("code-block");return T(),w("div",PKe,[l("div",FKe,[(T(!0),w(Be,null,Xe(s.markdownItems,(a,c)=>(T(),w("div",{key:c},[a.type==="code"?(T(),at(o,{key:0,host:t.host,language:a.language,code:a.code,discussion_id:t.discussion_id,message_id:t.message_id,client_id:t.client_id,onUpdateCode:d=>s.updateCode(c,d)},null,8,["host","language","code","discussion_id","message_id","client_id","onUpdateCode"])):(T(),w("div",{key:1,innerHTML:a.html},null,8,UKe))]))),128))],512)])}const lp=it(LKe,[["render",BKe]]),GKe={data(){return{show:!1,has_button:!0,message:""}},components:{MarkdownRenderer:lp},methods:{hide(){this.show=!1,this.$emit("ok")},showMessage(n){this.message=n,this.has_button=!0,this.show=!0},showBlockingMessage(n){this.message=n,this.has_button=!1,this.show=!0},updateMessage(n){this.message=n,this.show=!0},hideMessage(){this.show=!1}}},VKe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 z-50"},zKe={class:"pl-10 pr-10 bg-bg-light dark:bg-bg-dark p-8 rounded-lg shadow-lg"},HKe={class:"container max-h-500 overflow-y-auto"},qKe={class:"text-lg font-medium"},YKe={class:"mt-4 flex justify-center"},$Ke={key:1,"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function WKe(n,e,t,s,i,r){const o=et("MarkdownRenderer");return i.show?(T(),w("div",VKe,[l("div",zKe,[l("div",HKe,[l("div",qKe,[z(o,{ref:"mdRender",host:"","markdown-text":i.message,message_id:0,discussion_id:0},null,8,["markdown-text"])])]),l("div",YKe,[i.has_button?(T(),w("button",{key:0,onClick:e[0]||(e[0]=(...a)=>r.hide&&r.hide(...a)),class:"bg-primary hover:bg-primary-light active:scale-95 duration-150 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-secondary-dark"}," OK ")):B("",!0),i.has_button?B("",!0):(T(),w("svg",$Ke,e[1]||(e[1]=[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1)])))])])])):B("",!0)}const vN=it(GKe,[["render",WKe]]),KKe={props:{progress:{type:Number,required:!0}}},jKe={class:"progress-bar-container"};function QKe(n,e,t,s,i,r){return T(),w("div",jKe,[l("div",{class:"progress-bar",style:Wt({width:`${t.progress}%`})},null,4)])}const cp=it(KKe,[["render",QKe]]),XKe={setup(){return{}},name:"UniversalForm",data(){return{show:!1,resolve:null,controls_array:[],title:"Universal form",ConfirmButtonText:"Submit",DenyButtonText:"Cancel"}},mounted(){Le(()=>{Ve.replace()})},methods:{btn_clicked(n){console.log(n)},hide(n){this.show=!1,this.resolve&&n&&(this.resolve(this.controls_array),this.resolve=null)},showForm(n,e,t,s){this.ConfirmButtonText=t||this.ConfirmButtonText,this.DenyButtonText=s||this.DenyButtonText;for(let i=0;i{this.controls_array=n,this.show=!0,this.title=e||this.title,this.resolve=i,console.log("show form",this.controls_array)})}},watch:{controls_array:{deep:!0,handler(n){n.forEach(e=>{e.type==="int"?e.value=parseInt(e.value):e.type==="float"&&(e.value=parseFloat(e.value))})}},show(){Le(()=>{Ve.replace()})}}},ZKe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 p-4"},JKe={class:"relative w-full max-w-md"},eje={class:"flex flex-col rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel duration-150 shadow-lg max-h-screen"},tje={class:"flex flex-row flex-grow items-center m-2 p-1"},nje={class:"grow flex items-center"},sje={class:"text-lg font-semibold select-none mr-2"},ije={class:"items-end"},rje={class:"flex flex-col relative no-scrollbar overflow-y-scroll p-2"},oje={class:"px-2"},aje={key:0},lje={key:0},cje={class:"text-base font-semibold"},dje={key:0,class:"relative inline-flex"},uje=["onUpdate:modelValue"],pje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},fje=["onUpdate:modelValue"],_je={key:1},mje={class:"text-base font-semibold"},hje={key:0,class:"relative inline-flex"},gje=["onUpdate:modelValue"],bje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},yje=["onUpdate:modelValue"],Eje=["value","selected"],vje={key:1},Sje={class:"",onclick:"btn_clicked(item)"},Tje={key:2},xje={key:0},Cje={class:"text-base font-semibold"},wje={key:0,class:"relative inline-flex"},Rje=["onUpdate:modelValue"],Aje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},Nje=["onUpdate:modelValue"],Mje={key:1},Oje={class:"text-base font-semibold"},Ije={key:0,class:"relative inline-flex"},kje=["onUpdate:modelValue"],Dje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},Lje=["onUpdate:modelValue"],Pje=["value","selected"],Fje={key:3},Uje={class:"text-base font-semibold"},Bje={key:0,class:"relative inline-flex"},Gje=["onUpdate:modelValue"],Vje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},zje=["onUpdate:modelValue"],Hje=["onUpdate:modelValue","min","max"],qje={key:4},Yje={class:"text-base font-semibold"},$je={key:0,class:"relative inline-flex"},Wje=["onUpdate:modelValue"],Kje={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},jje=["onUpdate:modelValue"],Qje=["onUpdate:modelValue","min","max"],Xje={key:5},Zje={class:"mb-2 relative flex items-center gap-2"},Jje={for:"default-checkbox",class:"text-base font-semibold"},eQe=["onUpdate:modelValue"],tQe={key:0,class:"relative inline-flex"},nQe=["onUpdate:modelValue"],sQe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},iQe={key:6},rQe={class:"text-base font-semibold"},oQe={key:0,class:"relative inline-flex"},aQe=["onUpdate:modelValue"],lQe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},cQe=["onUpdate:modelValue"],dQe={class:"flex flex-row flex-grow gap-3"},uQe={class:"p-2 text-center grow"};function pQe(n,e,t,s,i,r){return i.show?(T(),w("div",ZKe,[l("div",JKe,[l("div",eje,[l("div",tje,[l("div",nje,[e[3]||(e[3]=l("i",{"data-feather":"sliders",class:"mr-2 flex-shrink-0"},null,-1)),l("h3",sje,W(i.title),1)]),l("div",ije,[l("button",{type:"button",onClick:e[0]||(e[0]=K(o=>r.hide(!1),["stop"])),title:"Close",class:"bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[4]||(e[4]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),l("span",{class:"sr-only"},"Close form modal",-1)]))])]),l("div",rje,[(T(!0),w(Be,null,Xe(i.controls_array,(o,a)=>(T(),w("div",oje,[o.type=="str"||o.type=="string"?(T(),w("div",aje,[o.options?B("",!0):(T(),w("div",lje,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",cje,W(o.name)+": ",1),o.help?(T(),w("label",dje,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,uje),[[qe,o.isHelp]]),e[5]||(e[5]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",pje,W(o.help),1)):B("",!0),D(l("input",{type:"text","onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter string"},null,8,fje),[[ue,o.value]])])),o.options?(T(),w("div",_je,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",mje,W(o.name)+": ",1),o.help?(T(),w("label",hje,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,gje),[[qe,o.isHelp]]),e[6]||(e[6]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",bje,W(o.help),1)):B("",!0),D(l("select",{"onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(T(!0),w(Be,null,Xe(o.options,c=>(T(),w("option",{value:c,selected:o.value===c},W(c),9,Eje))),256))],8,yje),[[It,o.value]])])):B("",!0)])):B("",!0),o.type=="btn"?(T(),w("div",vje,[l("button",Sje,W(o.name),1)])):B("",!0),o.type=="text"?(T(),w("div",Tje,[o.options?B("",!0):(T(),w("div",xje,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Cje,W(o.name)+": ",1),o.help?(T(),w("label",wje,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Rje),[[qe,o.isHelp]]),e[7]||(e[7]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",Aje,W(o.help),1)):B("",!0),D(l("textarea",{"onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter string"},null,8,Nje),[[ue,o.value]])])),o.options?(T(),w("div",Mje,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Oje,W(o.name)+": ",1),o.help?(T(),w("label",Ije,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,kje),[[qe,o.isHelp]]),e[8]||(e[8]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",Dje,W(o.help),1)):B("",!0),D(l("select",{"onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(T(!0),w(Be,null,Xe(o.options,c=>(T(),w("option",{value:c,selected:o.value===c},W(c),9,Pje))),256))],8,Lje),[[It,o.value]])])):B("",!0)])):B("",!0),o.type=="int"?(T(),w("div",Fje,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Uje,W(o.name)+": ",1),o.help?(T(),w("label",Bje,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Gje),[[qe,o.isHelp]]),e[9]||(e[9]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",Vje,W(o.help),1)):B("",!0),D(l("input",{type:"number","onUpdate:modelValue":c=>o.value=c,step:"1",class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,zje),[[ue,o.value]]),o.min!=null&&o.max!=null?D((T(),w("input",{key:1,type:"range","onUpdate:modelValue":c=>o.value=c,min:o.min,max:o.max,step:"1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,Hje)),[[ue,o.value]]):B("",!0)])):B("",!0),o.type=="float"?(T(),w("div",qje,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Yje,W(o.name)+": ",1),o.help?(T(),w("label",$je,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Wje),[[qe,o.isHelp]]),e[10]||(e[10]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",Kje,W(o.help),1)):B("",!0),D(l("input",{type:"number","onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,jje),[[ue,o.value]]),o.min!=null&&o.max!=null?D((T(),w("input",{key:1,type:"range","onUpdate:modelValue":c=>o.value=c,min:o.min,max:o.max,step:"0.1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,Qje)),[[ue,o.value]]):B("",!0)])):B("",!0),o.type=="bool"?(T(),w("div",Xje,[l("div",Zje,[l("label",Jje,W(o.name)+": ",1),D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.value=c,class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"},null,8,eQe),[[qe,o.value]]),o.help?(T(),w("label",tQe,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,nQe),[[qe,o.isHelp]]),e[11]||(e[11]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)]),o.isHelp?(T(),w("p",sQe,W(o.help),1)):B("",!0)])):B("",!0),o.type=="list"?(T(),w("div",iQe,[l("label",{class:Ue(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",rQe,W(o.name)+": ",1),o.help?(T(),w("label",oQe,[D(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,aQe),[[qe,o.isHelp]]),e[12]||(e[12]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),w("p",lQe,W(o.help),1)):B("",!0),D(l("input",{type:"text","onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter comma separated values"},null,8,cQe),[[ue,o.value]])])):B("",!0),e[13]||(e[13]=l("hr",{class:"h-px my-4 bg-gray-200 border-0 dark:bg-gray-700"},null,-1))]))),256)),l("div",dQe,[l("div",uQe,[l("button",{onClick:e[1]||(e[1]=K(o=>r.hide(!0),["stop"])),type:"button",class:"mr-2 text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},W(i.ConfirmButtonText),1),l("button",{onClick:e[2]||(e[2]=K(o=>r.hide(!1),["stop"])),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-11 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},W(i.DenyButtonText),1)])])])])])])):B("",!0)}const uc=it(XKe,[["render",pQe]]),fQe={data(){return{show:!1,message:"",resolve:null,ConfirmButtonText:"Yes, I'm sure",DenyButtonText:"No, cancel"}},methods:{hide(n){this.show=!1,this.resolve&&(this.resolve(n),this.resolve=null)},askQuestion(n,e,t){return this.ConfirmButtonText=e||this.ConfirmButtonText,this.DenyButtonText=t||this.DenyButtonText,new Promise(s=>{this.message=n,this.show=!0,this.resolve=s})}}},_Qe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},mQe={class:"relative w-full max-w-md max-h-full"},hQe={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},gQe={class:"p-4 text-center"},bQe={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none break-all"};function yQe(n,e,t,s,i,r){return i.show?(T(),w("div",_Qe,[l("div",mQe,[l("div",hQe,[l("button",{type:"button",onClick:e[0]||(e[0]=o=>r.hide(!1)),class:"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[3]||(e[3]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),l("span",{class:"sr-only"},"Close modal",-1)])),l("div",gQe,[e[4]||(e[4]=l("svg",{"aria-hidden":"true",class:"mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),l("h3",bQe,W(i.message),1),l("button",{onClick:e[1]||(e[1]=o=>r.hide(!0)),type:"button",class:"text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"},W(i.ConfirmButtonText),1),l("button",{onClick:e[2]||(e[2]=o=>r.hide(!1)),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},W(i.DenyButtonText),1)])])])])):B("",!0)}const SN=it(fQe,[["render",yQe]]),EQe={props:{personality:{type:Object,required:!0},config:{type:Object,required:!0}},data(){return{show:!1,title:"Add AI Agent",iconUrl:"",file:null,tempConfig:{}}},methods:{showForm(){this.showDialog=!0},hideForm(){this.showDialog=!1},selectIcon(n){n.target.files&&(this.file=n.target.files[0],this.iconUrl=URL.createObjectURL(this.file))},showPanel(){this.show=!0},hide(){this.show=!1},submitForm(){Z.post("/set_personality_config",{client_id:this.$store.state.client_id,category:this.personality.category,name:this.personality.folder,config:this.config}).then(n=>{const e=n.data;console.log("Done"),e.status?(this.currentPersonConfig=e.config,this.showPersonalityEditor=!0):console.error(e.error)}).catch(n=>{console.error(n)})}}},vQe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 z-20"},SQe={class:"relative w-full max-h-full bg-bg-light dark:bg-bg-dark"},TQe={class:"w-full h-full relative items-center gap-2 rounded-lg border bg-bg-light dark:bg-bg-dark p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-900"},xQe={class:"justify-center text-center items-center w-full bg-bg-light dark:bg-bg-dark"},CQe={class:"w-full flex flex-row mt-4 text-center justify-center"},wQe={class:"w-full max-h-full container bg-bg-light dark:bg-bg-dark"},RQe={class:"mb-4 w-full"},AQe={class:"w-full bg-bg-light dark:bg-bg-dark"};function NQe(n,e,t,s,i,r){return i.show?(T(),w("div",vQe,[l("div",SQe,[l("div",TQe,[l("button",{type:"button",onClick:e[0]||(e[0]=o=>r.hide()),class:"absolute top-1 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[17]||(e[17]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),l("span",{class:"sr-only"},"Close modal",-1)])),l("div",xQe,[l("div",CQe,[l("button",{type:"submit",onClick:e[1]||(e[1]=K((...o)=>r.submitForm&&r.submitForm(...o),["prevent"])),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"}," Commit AI to Server "),l("button",{onClick:e[2]||(e[2]=K(o=>r.hide(),["prevent"])),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"}," Close ")]),l("div",wQe,[l("form",RQe,[l("table",AQe,[l("tr",null,[e[18]||(e[18]=l("td",null,[l("label",{for:"personalityConditioning"},"Personality Conditioning:")],-1)),l("td",null,[D(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"personalityConditioning","onUpdate:modelValue":e[3]||(e[3]=o=>t.config.personality_conditioning=o)},null,512),[[ue,t.config.personality_conditioning]])])]),l("tr",null,[e[19]||(e[19]=l("td",null,[l("label",{for:"userMessagePrefix"},"User Message Prefix:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"userMessagePrefix","onUpdate:modelValue":e[4]||(e[4]=o=>t.config.user_message_prefix=o)},null,512),[[ue,t.config.user_message_prefix]])])]),l("tr",null,[e[20]||(e[20]=l("td",null,[l("label",{for:"aiMessagePrefix"},"AI Message Prefix:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"aiMessagePrefix","onUpdate:modelValue":e[5]||(e[5]=o=>t.config.ai_message_prefix=o)},null,512),[[ue,t.config.ai_message_prefix]])])]),l("tr",null,[e[21]||(e[21]=l("td",null,[l("label",{for:"linkText"},"Link Text:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"linkText","onUpdate:modelValue":e[6]||(e[6]=o=>t.config.link_text=o)},null,512),[[ue,t.config.link_text]])])]),l("tr",null,[e[22]||(e[22]=l("td",null,[l("label",{for:"welcomeMessage"},"Welcome Message:")],-1)),l("td",null,[D(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"welcomeMessage","onUpdate:modelValue":e[7]||(e[7]=o=>t.config.welcome_message=o)},null,512),[[ue,t.config.welcome_message]])])]),l("tr",null,[e[23]||(e[23]=l("td",null,[l("label",{for:"modelTemperature"},"Model Temperature:")],-1)),l("td",null,[D(l("input",{type:"number",id:"modelTemperature","onUpdate:modelValue":e[8]||(e[8]=o=>t.config.model_temperature=o)},null,512),[[ue,t.config.model_temperature]])])]),l("tr",null,[e[24]||(e[24]=l("td",null,[l("label",{for:"modelTopK"},"Model Top K:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelTopK","onUpdate:modelValue":e[9]||(e[9]=o=>t.config.model_top_k=o)},null,512),[[ue,t.config.model_top_k]])])]),l("tr",null,[e[25]||(e[25]=l("td",null,[l("label",{for:"modelTopP"},"Model Top P:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelTopP","onUpdate:modelValue":e[10]||(e[10]=o=>t.config.model_top_p=o)},null,512),[[ue,t.config.model_top_p]])])]),l("tr",null,[e[26]||(e[26]=l("td",null,[l("label",{for:"modelRepeatPenalty"},"Model Repeat Penalty:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelRepeatPenalty","onUpdate:modelValue":e[11]||(e[11]=o=>t.config.model_repeat_penalty=o)},null,512),[[ue,t.config.model_repeat_penalty]])])]),l("tr",null,[e[27]||(e[27]=l("td",null,[l("label",{for:"modelRepeatLastN"},"Model Repeat Last N:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelRepeatLastN","onUpdate:modelValue":e[12]||(e[12]=o=>t.config.model_repeat_last_n=o)},null,512),[[ue,t.config.model_repeat_last_n]])])]),l("tr",null,[e[28]||(e[28]=l("td",null,[l("label",{for:"recommendedBinding"},"Recommended Binding:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"recommendedBinding","onUpdate:modelValue":e[13]||(e[13]=o=>t.config.recommended_binding=o)},null,512),[[ue,t.config.recommended_binding]])])]),l("tr",null,[e[29]||(e[29]=l("td",null,[l("label",{for:"recommendedModel"},"Recommended Model:")],-1)),l("td",null,[D(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"recommendedModel","onUpdate:modelValue":e[14]||(e[14]=o=>t.config.recommended_model=o)},null,512),[[ue,t.config.recommended_model]])])]),l("tr",null,[e[30]||(e[30]=l("td",null,[l("label",{class:"dark:bg-black dark:text-primary w-full",for:"dependencies"},"Dependencies:")],-1)),l("td",null,[D(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"dependencies","onUpdate:modelValue":e[15]||(e[15]=o=>t.config.dependencies=o)},null,512),[[ue,t.config.dependencies]])])]),l("tr",null,[e[31]||(e[31]=l("td",null,[l("label",{for:"antiPrompts"},"Anti Prompts:")],-1)),l("td",null,[D(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"antiPrompts","onUpdate:modelValue":e[16]||(e[16]=o=>t.config.anti_prompts=o)},null,512),[[ue,t.config.anti_prompts]])])])])])])])])])])):B("",!0)}const TN=it(EQe,[["render",NQe]]),MQe={data(){return{showPopup:!1,webpageUrl:"https://lollms.com/"}},methods:{show(){this.showPopup=!0},hide(){this.showPopup=!1},save_configuration(){Z.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.$store.state.config}).then(n=>{this.isLoading=!1,n.data.status?(this.$store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1)})}}},OQe={key:0,class:"fixed inset-0 flex items-center justify-center z-50"},IQe={class:"popup-container"},kQe=["src"],DQe={class:"checkbox-container"};function LQe(n,e,t,s,i,r){return T(),at(Ii,{name:"fade"},{default:Ie(()=>[i.showPopup?(T(),w("div",OQe,[l("div",IQe,[l("button",{onClick:e[0]||(e[0]=(...o)=>r.hide&&r.hide(...o)),class:"close-button"}," X "),l("iframe",{src:i.webpageUrl,class:"iframe-content"},null,8,kQe),l("div",DQe,[D(l("input",{type:"checkbox",id:"startup",class:"styled-checkbox","onUpdate:modelValue":e[1]||(e[1]=o=>this.$store.state.config.show_news_panel=o),onChange:e[2]||(e[2]=(...o)=>r.save_configuration&&r.save_configuration(...o))},null,544),[[qe,this.$store.state.config.show_news_panel]]),e[3]||(e[3]=l("label",{for:"startup",class:"checkbox-label"},"Show at startup",-1))])])])):B("",!0)]),_:1})}const xN=it(MQe,[["render",LQe],["__scopeId","data-v-d504dfc9"]]),PQe={props:{href:{type:String,default:"#"},icon:{type:String,required:!0},title:{type:String,default:""}},methods:{onClick(n){this.href==="#"&&(n.preventDefault(),this.$emit("click"))}}},FQe=["href","title"],UQe=["data-feather"];function BQe(n,e,t,s,i,r){return T(),w("a",{href:t.href,onClick:e[0]||(e[0]=(...o)=>r.onClick&&r.onClick(...o)),class:"text-2xl hover:text-primary transition duration-150 ease-in-out",title:t.title},[l("i",{"data-feather":t.icon},null,8,UQe)],8,FQe)}const Nd=it(PQe,[["render",BQe]]),GQe={props:{href:{type:String,required:!0},icon:{type:String,required:!0},title:{type:String,default:"Visit our social media"}}},VQe=["href","title"],zQe=["data-feather"],HQe={key:1,class:"w-6 h-6 fill-current",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},qQe={key:2,class:"w-6 h-6 fill-current",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function YQe(n,e,t,s,i,r){return T(),w("a",{href:t.href,target:"_blank",class:"text-2xl hover:text-primary transition duration-150 ease-in-out",title:t.title},[t.icon!=="x"&&t.icon!=="discord"?(T(),w("i",{key:0,"data-feather":t.icon},null,8,zQe)):t.icon==="x"?(T(),w("svg",HQe,e[0]||(e[0]=[l("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"},null,-1)]))):t.icon==="discord"?(T(),w("svg",qQe,e[1]||(e[1]=[l("path",{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},null,-1)]))):B("",!0)],8,VQe)}const hl=it(GQe,[["render",YQe]]),$Qe="/assets/fastapi-BQj-rjUJ.png",WQe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20127.14%2096.36'%3e%3cg%20id='图层_2'%20data-name='图层%202'%3e%3cg%20id='Discord_Logos'%20data-name='Discord%20Logos'%3e%3cg%20id='Discord_Logo_-_Large_-_White'%20data-name='Discord%20Logo%20-%20Large%20-%20White'%3e%3cpath%20d='M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",KQe={key:0,class:"navbar-container z-60"},jQe={class:"game-menu"},QQe={key:0,class:"feather-emoji"},XQe={name:"Navigation",computed:{filteredNavLinks(){return filteredNavLinks.value}}},CN=Object.assign(XQe,{setup(n){const e=K3(),t=ot(0),s=ot([]),i=[{active:!0,route:"discussions",text:"Discussions"},{active:!0,route:"playground",text:"Playground"},{active:!0,route:"PersonalitiesZoo",text:"Personalities Zoo"},{active:!0,route:"AppsZoo",text:"Apps Zoo"},{active:!1,route:"AutoSD",text:"Auto111-SD",condition:()=>Ds.state.config.enable_sd_service||Ds.state.config.active_tti_service==="autosd"},{active:!1,route:"ComfyUI",text:"ComfyUI",condition:()=>Ds.state.config.enable_comfyui_service||Ds.state.config.active_tti_service==="comfyui"},{active:!1,route:"interactive",text:"Interactive",condition:()=>Ds.state.config.active_tts_service!=="None"&&Ds.state.config.active_stt_service!=="None"},{active:!0,route:"settings",text:"Settings"},{active:!0,route:"help_view",text:"Help"}],r=Je(()=>Ds.state.ready?i.filter(d=>d.condition?d.condition():d.active):i.filter(d=>d.active));di(()=>{o()}),Tn(()=>e.name,o);function o(){const d=r.value.findIndex(u=>u.route===e.name);d!==-1&&(t.value=d)}function a(d){return e.name===d}function c(d){t.value=d}return(d,u)=>d.$store.state.ready?(T(),w("div",KQe,[l("nav",jQe,[(T(!0),w(Be,null,Xe(r.value,(_,m)=>(T(),at(Ct(m0),{key:m,to:{name:_.route},class:Ue(["menu-item",{"active-link":a(_.route)}]),onClick:h=>c(m),ref_for:!0,ref_key:"menuItems",ref:s},{default:Ie(()=>[Ze(W(_.text)+" ",1),a(_.route)?(T(),w("span",QQe,"🪶")):B("",!0)]),_:2},1032,["to","class","onClick"]))),128))])])):B("",!0)}}),ZQe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%3e%3ccircle%20cx='25'%20cy='25'%20r='20'%20fill='none'%20stroke='black'%20stroke-width='3'%3e%3c/circle%3e%3cline%20x1='25'%20y1='30'%20x2='25'%20y2='15'%20style='stroke:black;stroke-width:3'%3e%3c/line%3e%3ccircle%20cx='25'%20cy='35'%20r='3'%20fill='black'%3e%3c/circle%3e%3c/svg%3e",JQe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%3e%3ccircle%20cx='25'%20cy='25'%20r='20'%20fill='none'%20stroke='black'%20stroke-width='3'%3e%3c/circle%3e%3cline%20x1='25'%20y1='30'%20x2='25'%20y2='15'%20style='stroke:black;stroke-width:3'%3e%3canimate%20attributeName='y1'%20values='30;25;30'%20dur='1s'%20repeatCount='indefinite'%3e%3c/animate%3e%3canimate%20attributeName='y2'%20values='15;20;15'%20dur='1s'%20repeatCount='indefinite'%3e%3c/animate%3e%3c/line%3e%3ccircle%20cx='25'%20cy='35'%20r='3'%20fill='black'%3e%3canimate%20attributeName='cy'%20values='35;30;35'%20dur='1s'%20repeatCount='indefinite'%3e%3c/animate%3e%3c/circle%3e%3c/svg%3e",Us="/assets/logo-CA_sh1Fo.png",eXe="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20width='800px'%20height='800px'%20viewBox='0%200%2064%2064'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20data-name='Layer%205'%20id='Layer_5'%3e%3cpath%20d='M47,33H17a1,1,0,0,0-1,1c0,9.93,7.18,18,16,18s16-8.07,16-18A1,1,0,0,0,47,33ZM18,35H46a18,18,0,0,1-.67,4H18.71A18,18,0,0,1,18,35ZM26.7,48.8a6.42,6.42,0,0,1,10.6,0,12.3,12.3,0,0,1-10.6,0Zm12.34-1A8.81,8.81,0,0,0,32,44a8.81,8.81,0,0,0-7,3.81A15.56,15.56,0,0,1,19.43,41H44.57A15.56,15.56,0,0,1,39,47.81ZM36,22a1.1,1.1,0,0,1,0-.18,1.17,1.17,0,0,1,.06-.2s0-.05,0-.07a.28.28,0,0,1,.07-.09.71.71,0,0,1,.28-.28s.06-.06.09-.07l10-5a1,1,0,1,1,.9,1.78L39.24,22l8.21,4.11a1,1,0,0,1,.44,1.34A1,1,0,0,1,47,28a.93.93,0,0,1-.45-.11l-10-5h0a1.18,1.18,0,0,1-.28-.22l0-.06a.65.65,0,0,1-.1-.15s0-.05,0-.07a1.17,1.17,0,0,1-.06-.2A1.1,1.1,0,0,1,36,22ZM16.55,26.11,24.76,22l-8.21-4.11a1,1,0,1,1,.9-1.78l10,5s.06.05.09.07a.71.71,0,0,1,.28.28.28.28,0,0,1,.07.09s0,.05,0,.07a1.17,1.17,0,0,1,.06.2.82.82,0,0,1,0,.36,1.17,1.17,0,0,1-.06.2s0,.05,0,.07a.65.65,0,0,1-.1.15.21.21,0,0,0,0,.06,1.18,1.18,0,0,1-.28.22h0l-10,5A.93.93,0,0,1,17,28a1,1,0,0,1-.89-.55A1,1,0,0,1,16.55,26.11ZM60.66,36.45A29.69,29.69,0,0,0,61,32,29,29,0,0,0,3,32a29.69,29.69,0,0,0,.34,4.45,4.65,4.65,0,0,0,2.39,7.82,29,29,0,0,0,52.54,0,4.65,4.65,0,0,0,2.39-7.82ZM4.78,41.58a2.91,2.91,0,0,1-.24-.27A2.62,2.62,0,0,1,4,39.71a.61.61,0,0,1,0-.14,2.58,2.58,0,0,1,.77-1.73,4.38,4.38,0,0,1,.74-.55C7,36.38,10,34.9,12.69,33.67c-1.52,3.3-3.42,7.17-4.17,7.91a2.59,2.59,0,0,1-1.47.72A2.66,2.66,0,0,1,4.78,41.58ZM32,59A27,27,0,0,1,7.92,44.18a4.56,4.56,0,0,0,2-1.18c1.48-1.49,5-9.36,5.66-10.92a1,1,0,0,0-1.32-1.32c-.78.34-3.14,1.39-5.49,2.53-1.29.63-2.58,1.29-3.6,1.88A25.58,25.58,0,0,1,5,32a27,27,0,0,1,54,0,25.58,25.58,0,0,1-.19,3.17c-2.88-1.66-7.88-3.88-9.09-4.41a1,1,0,0,0-1.32,1.32c.69,1.56,4.18,9.43,5.66,10.92a4.56,4.56,0,0,0,2,1.18A27,27,0,0,1,32,59ZM59.46,41.31a2.91,2.91,0,0,1-.24.27A2.66,2.66,0,0,1,57,42.3a2.59,2.59,0,0,1-1.47-.72c-.75-.74-2.65-4.61-4.17-7.91,1.65.76,3.44,1.61,4.91,2.37.91.47,1.7.9,2.26,1.25a4.38,4.38,0,0,1,.74.55A2.58,2.58,0,0,1,60,39.57a.61.61,0,0,1,0,.14A2.62,2.62,0,0,1,59.46,41.31Z'/%3e%3c/g%3e%3c/svg%3e",tXe="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512.001%20512.001'%20xml:space='preserve'%3e%3cg%3e%3cg%3e%3cpath%20d='M256.001,0C114.841,0,0,114.841,0,256.001s114.841,256.001,256.001,256.001S512.001,397.16,512.001,256.001%20S397.16,0,256.001,0z%20M256.001,493.701c-131.069,0-237.702-106.631-237.702-237.7S124.932,18.299,256.001,18.299%20s237.702,106.632,237.702,237.702S387.068,493.701,256.001,493.701z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M371.284,296.658H138.275c-5.054,0-9.15,4.097-9.15,9.15s4.095,9.15,9.15,9.15h233.008c5.054,0,9.15-4.097,9.15-9.15%20C380.433,300.754,376.337,296.658,371.284,296.658z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M297.481,330.816h-85.403c-5.054,0-9.15,4.097-9.15,9.15s4.095,9.15,9.15,9.15h85.403c5.054,0,9.15-4.097,9.15-9.15%20S302.534,330.816,297.481,330.816z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M146.725,192.982c-18.666,0-33.852,15.186-33.852,33.852c0,18.666,15.186,33.852,33.852,33.852%20c18.666,0,33.852-15.186,33.852-33.852C180.577,208.168,165.391,192.982,146.725,192.982z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M365.275,192.982c-18.666,0-33.852,15.186-33.852,33.852c0,18.666,15.186,33.852,33.852,33.852%20s33.852-15.186,33.852-33.852C399.128,208.168,383.942,192.982,365.275,192.982z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cg%3e%3ccircle%20cx='155.969'%20cy='219.735'%20r='9.15'/%3e%3ccircle%20cx='374.338'%20cy='219.735'%20r='9.15'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",nXe={class:"top-0 shadow-lg navbar-container"},sXe={class:"container flex flex-col lg:flex-row items-center gap-2 pb-0"},iXe={class:"logo-container"},rXe=["src"],oXe={class:"flex gap-3 flex-1 items-center justify-end"},aXe={key:0,title:"Model is ok",class:"text-green-500 dark:text-green-400 cursor-pointer transition-transform hover:scale-110"},lXe={key:1,title:"Model is not ok",class:"text-red-500 dark:text-red-400 cursor-pointer transition-transform hover:scale-110"},cXe={key:2,title:"Text is not being generated. Ready to generate",class:"text-green-500 dark:text-green-400 cursor-pointer transition-transform hover:scale-110"},dXe={key:3,title:"Generation in progress...",class:"text-yellow-500 dark:text-yellow-400 cursor-pointer transition-transform hover:scale-110"},uXe={key:4,title:"Connection status: Connected",class:"text-green-500 dark:text-green-400 cursor-pointer transition-transform hover:scale-110"},pXe={key:5,title:"Connection status: Not connected",class:"text-red-500 dark:text-red-400 cursor-pointer transition-transform hover:scale-110"},fXe={class:"flex items-center space-x-4"},_Xe={class:"flex items-center space-x-4"},mXe={class:"relative group",title:"Lollms News"},hXe={class:"relative group"},gXe={class:"absolute hidden group-hover:block bg-gray-800 text-white text-xs rounded py-1 px-2 top-full left-1/2 transform -translate-x-1/2 mb-2 whitespace-nowrap"},bXe={class:"language-selector relative"},yXe={key:0,ref:"languageMenu",class:"container language-menu absolute left-0 mt-1 bg-white dark:bg-bg-dark-tone rounded shadow-lg z-10 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",style:{position:"absolute",top:"100%",width:"200px","max-height":"300px","overflow-y":"auto"}},EXe={style:{"list-style-type":"none","padding-left":"0","margin-left":"0"}},vXe=["onClick"],SXe=["onClick"],TXe={class:"cursor-pointer hover:text-white py-0 px-0 block whitespace-no-wrap"},xXe={role:"status",class:"fixed m-0 p-2 left-2 bottom-2 min-w-[24rem] max-w-[24rem] h-20 flex flex-col justify-center items-center pb-4 bg-blue-500 rounded-lg shadow-lg z-50 background-a"},CXe={class:"text-2xl animate-pulse mt-2 text-white"},wXe={id:"app"},RXe={name:"TopBar",computed:{storeLogo(){return this.$store.state.config?Us:this.$store.state.config.app_custom_logo!=""?"/user_infos/"+this.$store.state.config.app_custom_logo:Us},languages:{get(){return console.log("searching languages",this.$store.state.languages),this.$store.state.languages}},language:{get(){return console.log("searching language",this.$store.state.language),this.$store.state.language}},currentPersonConfig(){try{return this.$store.state.currentPersonConfig}catch{console.log("Error finding current personality configuration");return}},selectedPersonality(){try{return this.$store.state.selectedPersonality}catch{console.log("Error finding current personality configuration");return}},loading_infos(){return this.$store.state.loading_infos},is_fun_mode(){try{return this.$store.state.config?this.$store.state.config.fun_mode:!1}catch(n){return console.error("Oopsie! Looks like we hit a snag: ",n),!1}},isModelOK(){return this.$store.state.isModelOk},isGenerating(){return this.$store.state.isGenerating},isConnected(){return this.$store.state.isConnected}},components:{Toast:ac,MessageBox:vN,ProgressBar:cp,UniversalForm:uc,YesNoDialog:SN,Navigation:CN,PersonalityEditor:TN,PopupViewer:xN,ActionButton:Nd,SocialIcon:hl},watch:{"$store.state.config.fun_mode":function(n,e){console.log(`Fun mode changed from ${e} to ${n}! 🎉`)},"$store.state.isConnected":function(n,e){this.isConnected?(console.log("this.is_first_connection"),console.log(this.is_first_connection),this.is_first_connection||(this.$store.state.messageBox.hideMessage(),this.$store.state.messageBox.showMessage("Server connected."),this.$store.state.config.activate_audio_infos&&this.connection_recovered_audio.play())):(this.$store.state.messageBox.showBlockingMessage("Server suddenly disconnected. Please reboot the server to recover the connection"),this.is_first_connection=!1,console.log("this.is_first_connection set to false"),console.log(this.is_first_connection),this.$store.state.config.activate_audio_infos&&this.connection_lost_audio.play()),Le(()=>{Ve.replace()})}},data(){return{customLanguage:"",selectedLanguage:"",isLanguageMenuVisible:!1,static_info:ZQe,animated_info:JQe,normal_mode:tXe,fun_mode:eXe,is_first_connection:!0,discord:WQe,FastAPI:$Qe,rebooting_audio:new Audio("rebooting.wav"),connection_lost_audio:new Audio("connection_lost.wav"),connection_recovered_audio:new Audio("connection_recovered.wav"),database_selectorDialogVisible:!1,progress_visibility:!1,progress_value:0,codeBlockStylesheet:"",sunIcon:document.querySelector(".sun"),moonIcon:document.querySelector(".moon"),userTheme:localStorage.getItem("theme"),systemTheme:window.matchMedia("prefers-color-scheme: dark").matches,posts_headers:{accept:"application/json","Content-Type":"application/json"}}},async mounted(){this.$store.state.toast=this.$refs.toast,this.$store.state.news=this.$refs.news,this.$store.state.messageBox=this.$refs.messageBox,this.$store.state.universalForm=this.$refs.universalForm,this.$store.state.yesNoDialog=this.$refs.yesNoDialog,this.$store.state.personality_editor=this.$refs.personality_editor,this.sunIcon=document.querySelector(".sun"),this.moonIcon=document.querySelector(".moon"),this.userTheme=localStorage.getItem("theme"),this.systemTheme=window.matchMedia("prefers-color-scheme: dark").matches,this.themeCheck(),Le(()=>{Ve.replace()}),window.addEventListener("resize",this.adjustMenuPosition)},beforeUnmount(){window.removeEventListener("resize",this.adjustMenuPosition)},created(){this.sunIcon=document.querySelector(".sun"),this.moonIcon=document.querySelector(".moon"),this.userTheme=localStorage.getItem("theme"),this.systemTheme=window.matchMedia("prefers-color-scheme: dark").matches},methods:{adjustMenuPosition(){const n=this.$refs.languageMenu;if(n){const e=n.getBoundingClientRect(),t=window.innerWidth;e.right>t?(n.style.left="auto",n.style.right="0"):(n.style.left="0",n.style.right="auto")}},addCustomLanguage(){this.customLanguage.trim()!==""&&(this.selectLanguage(this.customLanguage),this.customLanguage="")},async selectLanguage(n){await this.$store.dispatch("changeLanguage",n),this.toggleLanguageMenu(),this.language=n},async deleteLanguage(n){await this.$store.dispatch("deleteLanguage",n),this.toggleLanguageMenu(),this.language=n},toggleLanguageMenu(){console.log("Toggling language ",this.isLanguageMenuVisible),this.isLanguageMenuVisible=!this.isLanguageMenuVisible},restartProgram(n){n.preventDefault(),this.$store.state.api_post_req("restart_program",this.$store.state.client_id),this.rebooting_audio.play(),this.$store.state.toast.showToast("Rebooting the app. Please wait...",410,!1),console.log("this.$store.state.api_get_req",this.$store.state.api_get_req),setTimeout(()=>{window.close()},2e3)},refreshPage(){window.location.href.split("/").length>4?window.location.href="/":window.location.reload(!0)},handleOk(n){console.log("Input text:",n)},applyConfiguration(){this.isLoading=!0,console.log(this.$store.state.config),Z.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.$store.state.config},{headers:this.posts_headers}).then(n=>{this.isLoading=!1,n.data.status?(this.$store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Le(()=>{Ve.replace()})})},fun_mode_on(){console.log("Turning on fun mode"),this.$store.state.config.fun_mode=!0,this.applyConfiguration()},fun_mode_off(){console.log("Turning off fun mode"),this.$store.state.config.fun_mode=!1,this.applyConfiguration()},showNews(){this.$store.state.news.show()},themeCheck(){if(this.userTheme=="dark"||!this.userTheme&&this.systemTheme){document.documentElement.classList.add("dark"),this.moonIcon.classList.add("display-none"),Le(()=>{Zp(()=>Promise.resolve({}),__vite__mapDeps([0]))});return}Le(()=>{Zp(()=>Promise.resolve({}),__vite__mapDeps([1]))}),this.sunIcon.classList.add("display-none")},themeSwitch(){if(document.documentElement.classList.contains("dark")){document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"),this.userTheme=="light",this.iconToggle();return}Zp(()=>Promise.resolve().then(()=>IHe),void 0),document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark"),this.userTheme=="dark",this.iconToggle(),window.dispatchEvent(new Event("themeChanged"))},iconToggle(){this.sunIcon.classList.toggle("display-none"),this.moonIcon.classList.toggle("display-none")}}},AXe=Object.assign(RXe,{setup(n){return(e,t)=>(T(),w("header",nXe,[l("nav",sXe,[z(Ct(m0),{to:{name:"discussions"},class:"flex items-center space-x-2"},{default:Ie(()=>[l("div",iXe,[l("img",{class:"w-12 h-12 rounded-full object-cover logo-image",src:e.$store.state.config==null?Ct(Us):e.$store.state.config.app_custom_logo!=""?"/user_infos/"+e.$store.state.config.app_custom_logo:Ct(Us),alt:"Logo",title:"LoLLMS WebUI"},null,8,rXe)]),t[8]||(t[8]=l("div",{class:"flex flex-col justify-center"},[l("div",{class:"text-6xl md:text-2xl font-bold text-amber-500 mb-2",style:{"text-shadow":"2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white"}}," L🪶LLMS "),l("p",{class:"text-gray-400 text-sm"},"One tool to rule them all")],-1))]),_:1}),l("div",oXe,[e.isModelOK?(T(),w("div",aXe,t[9]||(t[9]=[l("svg",{class:"w-8 h-8",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M9 12L11 14L15 10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))):(T(),w("div",lXe,t[10]||(t[10]=[l("svg",{class:"w-8 h-8",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M15 9L9 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M9 9L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))),e.isGenerating?(T(),w("div",dXe,t[12]||(t[12]=[l("svg",{class:"w-6 h-6 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)]))):(T(),w("div",cXe,t[11]||(t[11]=[l("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"})],-1)]))),e.isConnected?(T(),w("div",uXe,t[13]||(t[13]=[l("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1)]))):(T(),w("div",pXe,t[14]||(t[14]=[l("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})],-1)])))]),l("div",fXe,[z(Nd,{onClick:e.restartProgram,icon:"power",title:"restart program"},null,8,["onClick"]),z(Nd,{onClick:e.refreshPage,icon:"refresh-ccw",title:"refresh page"},null,8,["onClick"]),z(Nd,{href:"/docs",icon:"file-text",title:"Fast API doc"})]),l("div",_Xe,[z(hl,{href:"https://github.com/ParisNeo/lollms-webui",icon:"github"}),z(hl,{href:"https://www.youtube.com/channel/UCJzrg0cyQV2Z30SQ1v2FdSQ",icon:"youtube"}),z(hl,{href:"https://x.com/ParisNeo_AI",icon:"x"}),z(hl,{href:"https://discord.com/channels/1092918764925882418",icon:"discord"})]),l("div",mXe,[l("div",{onClick:t[0]||(t[0]=s=>e.showNews()),class:"text-2xl w-8 h-8 cursor-pointer transition-colors duration-300 text-gray-600 hover:text-primary dark:text-gray-300 dark:hover:text-primary"},t[15]||(t[15]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-full h-full"},[l("path",{d:"M19 20H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1m2 13a2 2 0 0 1-2-2V7m2 13a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})],-1)])),t[16]||(t[16]=l("span",{class:"absolute hidden group-hover:block bg-gray-800 text-white text-xs rounded py-1 px-2 top-full left-1/2 transform -translate-x-1/2 mt-2 whitespace-nowrap"}," Lollms News ",-1))]),l("div",hXe,[e.is_fun_mode?(T(),w("div",{key:0,title:"Fun mode is on, press to turn off",class:"w-8 h-8 cursor-pointer text-green-500 dark:text-green-400 hover:text-green-600 dark:hover:text-green-300 transition-colors duration-300",onClick:t[1]||(t[1]=s=>e.fun_mode_off())},t[17]||(t[17]=[Pi('',1)]))):(T(),w("div",{key:1,title:"Fun mode is off, press to turn on",class:"w-8 h-8 cursor-pointer text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-300",onClick:t[2]||(t[2]=s=>e.fun_mode_on())},t[18]||(t[18]=[Pi('',1)]))),l("span",gXe,W(e.is_fun_mode?"Turn off fun mode":"Turn on fun mode"),1)]),l("div",bXe,[l("button",{onClick:t[3]||(t[3]=(...s)=>e.toggleLanguageMenu&&e.toggleLanguageMenu(...s)),class:"bg-transparent text-black dark:text-white py-1 px-1 rounded font-bold uppercase transition-colors duration-300 hover:bg-blue-500"},W(e.$store.state.language.slice(0,2)),1),e.isLanguageMenuVisible?(T(),w("div",yXe,[l("ul",EXe,[(T(!0),w(Be,null,Xe(e.languages,s=>(T(),w("li",{key:s,class:"relative flex items-center",style:{"padding-left":"0","margin-left":"0"}},[l("button",{onClick:i=>e.deleteLanguage(s),class:"mr-2 text-red-500 hover:text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-opacity-50 rounded-full"},"✕",8,vXe),l("div",{onClick:i=>e.selectLanguage(s),class:Ue({"cursor-pointer hover:bg-blue-500 hover:text-white py-2 px-4 block whitespace-no-wrap":!0,"bg-blue-500 text-white":s===e.$store.state.language,"flex-grow":!0})},W(s),11,SXe)]))),128)),l("li",TXe,[D(l("input",{type:"text","onUpdate:modelValue":t[4]||(t[4]=s=>e.customLanguage=s),onKeyup:t[5]||(t[5]=zs(K((...s)=>e.addCustomLanguage&&e.addCustomLanguage(...s),["prevent"]),["enter"])),placeholder:"Enter language...",class:"bg-transparent border border-gray-300 rounded py-0 px-0 mx-0 my-1 w-full"},null,544),[[ue,e.customLanguage]])])])],512)):B("",!0)]),l("div",{class:"sun text-2xl w-6 hover:text-primary duration-150 cursor-pointer",title:"Switch to Light theme",onClick:t[6]||(t[6]=s=>e.themeSwitch())},t[19]||(t[19]=[l("i",{"data-feather":"sun"},null,-1)])),l("div",{class:"moon text-2xl w-6 hover:text-primary duration-150 cursor-pointer",title:"Switch to Dark theme",onClick:t[7]||(t[7]=s=>e.themeSwitch())},t[20]||(t[20]=[l("i",{"data-feather":"moon"},null,-1)]))]),z(CN),z(ac,{ref:"toast"},null,512),z(vN,{ref:"messageBox"},null,512),D(l("div",xXe,[z(cp,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),l("p",CXe,W(e.loading_infos)+" ...",1)],512),[[xt,e.progress_visibility]]),z(uc,{ref:"universalForm",class:"z-20"},null,512),z(SN,{ref:"yesNoDialog",class:"z-20"},null,512),z(TN,{ref:"personality_editor",config:e.currentPersonConfig,personality:e.selectedPersonality},null,8,["config","personality"]),l("div",wXe,[z(xN,{ref:"news"},null,512)])]))}}),NXe={class:"flex overflow-hidden flex-grow w-full"},MXe={__name:"App",setup(n){return(e,t)=>(T(),w("div",{class:Ue([e.currentTheme,"flex flex-col h-screen font-sans background-color text-slate-950 dark:bg-bg-dark dark:text-slate-50 w-full overflow-hidden"])},[z(AXe),l("div",NXe,[z(Ct(LA),null,{default:Ie(({Component:s})=>[(T(),at(dk,null,[(T(),at(Bu(s)))],1024))]),_:1})])],2))}},li=Object.create(null);li.open="0";li.close="1";li.ping="2";li.pong="3";li.message="4";li.upgrade="5";li.noop="6";const Md=Object.create(null);Object.keys(li).forEach(n=>{Md[li[n]]=n});const ob={type:"error",data:"parser error"},wN=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",RN=typeof ArrayBuffer=="function",AN=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,M0=({type:n,data:e},t,s)=>wN&&e instanceof Blob?t?s(e):Gx(e,s):RN&&(e instanceof ArrayBuffer||AN(e))?t?s(e):Gx(new Blob([e]),s):s(li[n]+(e||"")),Gx=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function Vx(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Yh;function OXe(n,e){if(wN&&n.data instanceof Blob)return n.data.arrayBuffer().then(Vx).then(e);if(RN&&(n.data instanceof ArrayBuffer||AN(n.data)))return e(Vx(n.data));M0(n,!1,t=>{Yh||(Yh=new TextEncoder),e(Yh.encode(t))})}const zx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n{let e=n.length*.75,t=n.length,s,i=0,r,o,a,c;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const d=new ArrayBuffer(e),u=new Uint8Array(d);for(s=0;s>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|c&63;return d},kXe=typeof ArrayBuffer=="function",O0=(n,e)=>{if(typeof n!="string")return{type:"message",data:NN(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:DXe(n.substring(1),e)}:Md[t]?n.length>1?{type:Md[t],data:n.substring(1)}:{type:Md[t]}:ob},DXe=(n,e)=>{if(kXe){const t=IXe(n);return NN(t,e)}else return{base64:!0,data:n}},NN=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},MN="",LXe=(n,e)=>{const t=n.length,s=new Array(t);let i=0;n.forEach((r,o)=>{M0(r,!1,a=>{s[o]=a,++i===t&&e(s.join(MN))})})},PXe=(n,e)=>{const t=n.split(MN),s=[];for(let i=0;i{const s=t.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const r=new DataView(i.buffer);r.setUint8(0,126),r.setUint16(1,s)}else{i=new Uint8Array(9);const r=new DataView(i.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let $h;function Fc(n){return n.reduce((e,t)=>e+t.length,0)}function Uc(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let i=0;iMath.pow(2,21)-1){a.enqueue(ob);break}i=u*Math.pow(2,32)+d.getUint32(4),s=3}else{if(Fc(t)n){a.enqueue(ob);break}}}})}const ON=4;function on(n){if(n)return BXe(n)}function BXe(n){for(var e in on.prototype)n[e]=on.prototype[e];return n}on.prototype.on=on.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};on.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};on.prototype.off=on.prototype.removeListener=on.prototype.removeAllListeners=on.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,i=0;iPromise.resolve().then(e):(e,t)=>t(e,0),_s=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),GXe="arraybuffer";function IN(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const VXe=_s.setTimeout,zXe=_s.clearTimeout;function up(n,e){e.useNativeTimers?(n.setTimeoutFn=VXe.bind(_s),n.clearTimeoutFn=zXe.bind(_s)):(n.setTimeoutFn=_s.setTimeout.bind(_s),n.clearTimeoutFn=_s.clearTimeout.bind(_s))}const HXe=1.33;function qXe(n){return typeof n=="string"?YXe(n):Math.ceil((n.byteLength||n.size)*HXe)}function YXe(n){let e=0,t=0;for(let s=0,i=n.length;s=57344?t+=3:(s++,t+=4);return t}function kN(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function $Xe(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function WXe(n){let e={},t=n.split("&");for(let s=0,i=t.length;s{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};PXe(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,LXe(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=kN()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let DN=!1;try{DN=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const QXe=DN;function XXe(){}class ZXe extends jXe{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,r)=>{this.onError("xhr post error",i,r)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}let ia=class Od extends on{constructor(e,t,s){super(),this.createRequest=e,up(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=IN(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Od.requestsCount++,Od.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=XXe,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Od.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};ia.requestsCount=0;ia.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Hx);else if(typeof addEventListener=="function"){const n="onpagehide"in _s?"pagehide":"unload";addEventListener(n,Hx,!1)}}function Hx(){for(let n in ia.requests)ia.requests.hasOwnProperty(n)&&ia.requests[n].abort()}const JXe=function(){const n=LN({xdomain:!1});return n&&n.responseType!==null}();class eZe extends ZXe{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=JXe&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new ia(LN,this.uri(),e)}}function LN(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||QXe))return new XMLHttpRequest}catch{}if(!e)try{return new _s[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const PN=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class tZe extends I0{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=PN?{}:IN(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.doWrite(s,r)}catch{}i&&dp(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=kN()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const Wh=_s.WebSocket||_s.MozWebSocket;class nZe extends tZe{createSocket(e,t,s){return PN?new Wh(e,t,s):t?new Wh(e,t):new Wh(e)}doWrite(e,t){this.ws.send(t)}}class sZe extends I0{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=UXe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=FXe();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const r=()=>{s.read().then(({done:a,value:c})=>{a||(this.onPacket(c),r())}).catch(a=>{})};r();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t{i&&dp(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const iZe={websocket:nZe,webtransport:sZe,polling:eZe},rZe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,oZe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ab(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let i=rZe.exec(n||""),r={},o=14;for(;o--;)r[oZe[o]]=i[o]||"";return t!=-1&&s!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=aZe(r,r.path),r.queryKey=lZe(r,r.query),r}function aZe(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function lZe(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,r){i&&(t[i]=r)}),t}const lb=typeof addEventListener=="function"&&typeof removeEventListener=="function",Id=[];lb&&addEventListener("offline",()=>{Id.forEach(n=>n())},!1);class hr extends on{constructor(e,t){if(super(),this.binaryType=GXe,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const s=ab(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=ab(t.host).host);up(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=WXe(this.opts.query)),lb&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Id.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=ON,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&hr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",hr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,dp(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,i){if(typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const r={type:e,data:t,options:s};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(hr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),lb&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Id.indexOf(this._offlineEventListener);s!==-1&&Id.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}hr.protocol=ON;class cZe extends hr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",_=>{if(!s)if(_.type==="pong"&&_.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;hr.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=t.name,this.emitReserved("upgradeError",m)}}))};function r(){s||(s=!0,u(),t.close(),t=null)}const o=_=>{const m=new Error("probe error: "+_);m.transport=t.name,r(),this.emitReserved("upgradeError",m)};function a(){o("transport closed")}function c(){o("socket closed")}function d(_){t&&_.name!==t.name&&r()}const u=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",a),this.off("close",c),this.off("upgrading",d)};t.once("open",i),t.once("error",o),t.once("close",a),this.once("close",c),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;siZe[i]).filter(i=>!!i)),super(e,s)}};function uZe(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=ab(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const r=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+r+":"+s.port+e,s.href=s.protocol+"://"+r+(t&&t.port===s.port?"":":"+s.port),s}const pZe=typeof ArrayBuffer=="function",fZe=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,FN=Object.prototype.toString,_Ze=typeof Blob=="function"||typeof Blob<"u"&&FN.call(Blob)==="[object BlobConstructor]",mZe=typeof File=="function"||typeof File<"u"&&FN.call(File)==="[object FileConstructor]";function k0(n){return pZe&&(n instanceof ArrayBuffer||fZe(n))||_Ze&&n instanceof Blob||mZe&&n instanceof File}function kd(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t=0&&n.num{delete this.acks[e];for(let a=0;a{this.io.clearTimeoutFn(r),t.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{const r=(o,a)=>o?i(o):s(a);r.withError=!0,t.push(r),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...r)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...r)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:At.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case At.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case At.EVENT:case At.BINARY_EVENT:this.onevent(e);break;case At.ACK:case At.BINARY_ACK:this.onack(e);break;case At.DISCONNECT:this.ondisconnect();break;case At.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...i){s||(s=!0,t.packet({type:At.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:At.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s0&&n.jitter<=1?n.jitter:0,this.attempts=0}za.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=Math.floor(e*10)&1?n+t:n-t}return Math.min(n,this.max)|0};za.prototype.reset=function(){this.attempts=0};za.prototype.setMin=function(n){this.ms=n};za.prototype.setMax=function(n){this.max=n};za.prototype.setJitter=function(n){this.jitter=n};class ub extends on{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,up(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new za({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||SZe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new dZe(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=ks(t,"open",function(){s.onopen(),e&&e()}),r=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=ks(t,"error",r);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{i(),r(new Error("timeout")),t.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(ks(e,"ping",this.onping.bind(this)),ks(e,"data",this.ondata.bind(this)),ks(e,"error",this.onerror.bind(this)),ks(e,"close",this.onclose.bind(this)),ks(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){dp(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new UN(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;se()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const nl={};function Dd(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=uZe(n,e.path||"/socket.io"),s=t.source,i=t.id,r=t.path,o=nl[i]&&r in nl[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let c;return a?c=new ub(s,e):(nl[i]||(nl[i]=new ub(s,e)),c=nl[i]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(Dd,{Manager:ub,Socket:UN,io:Dd,connect:Dd});const BN="/";console.log(BN);const Ye=new Dd(BN,{reconnection:!0,reconnectionAttempts:10,reconnectionDelay:1e3}),xZe={props:{value:String,inputType:{type:String,default:"text",validator:n=>["text","email","password","file","path","integer","float"].includes(n)},fileAccept:String},data(){return{inputValue:this.value,placeholderText:this.getPlaceholderText()}},watch:{value(n){console.log("Changing value to ",n),this.inputValue=n}},mounted(){Le(()=>{Ve.replace()}),console.log("Changing value to ",this.value),this.inputValue=this.value},methods:{handleSliderInput(n){this.inputValue=n.target.value,this.$emit("input",n.target.value)},getPlaceholderText(){switch(this.inputType){case"text":return"Enter text here";case"email":return"Enter your email";case"password":return"Enter your password";case"file":case"path":return"Choose a file";case"integer":return"Enter an integer";case"float":return"Enter a float";default:return"Enter value here"}},handleInput(n){if(this.inputType==="integer"){const e=n.target.value.replace(/[^0-9]/g,"");this.inputValue=e}console.log("handling input : ",n.target.value),this.$emit("input",n.target.value)},async pasteFromClipboard(){try{const n=await navigator.clipboard.readText();this.handleClipboardData(n)}catch(n){console.error("Failed to read from clipboard:",n)}},handlePaste(n){const e=n.clipboardData.getData("text");this.handleClipboardData(e)},handleClipboardData(n){switch(this.inputType){case"email":this.inputValue=this.isValidEmail(n)?n:"";break;case"password":this.inputValue=n;break;case"file":case"path":this.inputValue="";break;case"integer":this.inputValue=this.parseInteger(n);break;case"float":this.inputValue=this.parseFloat(n);break;default:this.inputValue=n;break}},isValidEmail(n){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)},parseInteger(n){const e=parseInt(n);return isNaN(e)?"":e},parseFloat(n){const e=parseFloat(n);return isNaN(e)?"":e},openFileInput(){this.$refs.fileInput.click()},handleFileInputChange(n){const e=n.target.files[0];e&&(this.inputValue=e.name)}}},CZe={class:"flex items-center space-x-2"},wZe=["value","type","placeholder"],RZe=["value","min","max"],AZe=["accept"];function NZe(n,e,t,s,i,r){return T(),w("div",CZe,[n.useSlider?(T(),w("input",{key:1,type:"range",value:parseInt(i.inputValue),min:n.minSliderValue,max:n.maxSliderValue,onInput:e[2]||(e[2]=(...o)=>r.handleSliderInput&&r.handleSliderInput(...o)),class:"flex-1 px-4 py-2 text-lg border dark:bg-gray-600 border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,RZe)):(T(),w("input",{key:0,value:i.inputValue,type:t.inputType,placeholder:i.placeholderText,onInput:e[0]||(e[0]=(...o)=>r.handleInput&&r.handleInput(...o)),onPaste:e[1]||(e[1]=(...o)=>r.handlePaste&&r.handlePaste(...o)),class:"flex-1 px-4 py-2 text-lg dark:bg-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,wZe)),l("button",{onClick:e[3]||(e[3]=(...o)=>r.pasteFromClipboard&&r.pasteFromClipboard(...o)),class:"p-2 bg-blue-500 dark:bg-gray-600 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},e[6]||(e[6]=[l("i",{"data-feather":"clipboard"},null,-1)])),t.inputType==="file"?(T(),w("button",{key:2,onClick:e[4]||(e[4]=(...o)=>r.openFileInput&&r.openFileInput(...o)),class:"p-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},e[7]||(e[7]=[l("i",{"data-feather":"upload"},null,-1)]))):B("",!0),t.inputType==="file"?(T(),w("input",{key:3,ref:"fileInput",type:"file",style:{display:"none"},accept:t.fileAccept,onChange:e[5]||(e[5]=(...o)=>r.handleFileInputChange&&r.handleFileInputChange(...o))},null,40,AZe)):B("",!0)])}const L0=it(xZe,[["render",NZe]]),MZe={name:"TokensHighlighter",props:{namedTokens:{type:Object,required:!0}},data(){return{colors:["#FF6633","#FFB399","#FF33FF","#FFFF99","#00B3E6","#E6B333","#3366E6","#999966","#99FF99","#B34D4D","#80B300","#809900","#E6B3B3","#6680B3","#66991A","#FF99E6","#CCFF1A","#FF1A66","#E6331A","#33FFCC","#66994D","#B366CC","#4D8000","#B33300","#CC80CC","#66664D","#991AFF","#E666FF","#4DB3FF","#1AB399","#E666B3","#33991A","#CC9999","#B3B31A","#00E680","#4D8066","#809980","#E6FF80","#1AFF33","#999933","#FF3380","#CCCC00","#66E64D","#4D80CC","#9900B3","#E64D66","#4DB380","#FF4D4D","#99E6E6","#6666FF"]}}},OZe={class:"w-full"},IZe={class:"break-words"},kZe={class:"break-words mt-2"},DZe={class:"mt-4"};function LZe(n,e,t,s,i,r){return T(),w("div",OZe,[l("div",IZe,[(T(!0),w(Be,null,Xe(t.namedTokens,(o,a)=>(T(),w("span",{key:a},[l("span",{class:"inline-block whitespace-pre-wrap",style:Wt({backgroundColor:i.colors[a%i.colors.length]})},W(o[0]),5)]))),128))]),l("div",kZe,[(T(!0),w(Be,null,Xe(t.namedTokens,(o,a)=>(T(),w("span",{key:a},[l("span",{class:"inline-block px-1 whitespace-pre-wrap",style:Wt({backgroundColor:i.colors[a%i.colors.length]})},W(o[1]),5)]))),128))]),l("div",DZe,[l("strong",null,"Total Tokens: "+W(t.namedTokens.length),1)])])}const PZe=it(MZe,[["render",LZe]]),FZe={name:"ChatBarButton",props:{buttonClass:{type:String,default:"text-gray-600 dark:text-gray-300"}}};function UZe(n,e,t,s,i,r){return T(),w("button",AR({class:["p-2 rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",[t.buttonClass,"hover:bg-gray-200 dark:hover:bg-gray-700","active:bg-gray-300 dark:active:bg-gray-600"]]},n.$attrs,Ek(n.$listeners)),[un(n.$slots,"icon"),un(n.$slots,"default")],16)}const GN=it(FZe,[["render",UZe]]),BZe={props:{is_subcard:{type:Boolean,default:!1},is_shrunk:{type:Boolean,default:!1},title:{type:String,default:""},isHorizontal:{type:Boolean,default:!1},cardWidth:{type:String,default:"w-3/4"},disableHoverAnimation:{type:Boolean,default:!0},disableFocus:{type:Boolean,default:!1}},data(){return{shrink:this.is_shrunk,isHovered:!1,isActive:!1}},computed:{cardClass(){return["bg-gray-50","border","border-gray-300","text-gray-900","text-sm","rounded-lg","focus:ring-blue-500","focus:border-blue-500","w-full","p-2.5","dark:bg-gray-500","dark:border-gray-600","dark:placeholder-gray-400","dark:text-white","dark:focus:ring-blue-500","dark:focus:border-blue-500",{"cursor-pointer":!this.isActive&&!this.disableFocus,"w-auto":!this.isActive}]},cardWidthClass(){return this.isActive?this.cardWidth:""}},methods:{toggleCard(){this.disableFocus||(this.isActive=!this.isActive)}}},GZe={key:1,class:"flex flex-wrap"},VZe={key:2,class:"mb-2"};function zZe(n,e,t,s,i,r){return T(),w("div",null,[i.isActive?(T(),w("div",{key:0,class:"overlay",onClick:e[0]||(e[0]=(...o)=>r.toggleCard&&r.toggleCard(...o))})):B("",!0),D(l("div",{class:Ue(["border-blue-300 rounded-lg shadow-lg p-2",r.cardWidthClass,"m-2",{subcard:t.is_subcard},{"bg-white dark:bg-gray-900":!t.is_subcard},{hovered:!t.disableHoverAnimation&&i.isHovered,active:i.isActive}]),onMouseenter:e[2]||(e[2]=o=>i.isHovered=!0),onMouseleave:e[3]||(e[3]=o=>i.isHovered=!1),onClick:e[4]||(e[4]=K((...o)=>r.toggleCard&&r.toggleCard(...o),["self"])),style:Wt({cursor:this.disableFocus?"":"pointer"})},[t.title?(T(),w("div",{key:0,onClick:e[1]||(e[1]=o=>i.shrink=!0),class:Ue([{"text-center p-2 m-2 bg-gray-200":!t.is_subcard},"bg-gray-100 dark:bg-gray-500 rounded-lg pl-2 pr-2 mb-2 font-bold cursor-pointer"])},W(t.title),3)):B("",!0),t.isHorizontal?(T(),w("div",GZe,[un(n.$slots,"default")])):(T(),w("div",VZe,[un(n.$slots,"default")]))],38),[[xt,i.shrink===!1]]),t.is_subcard?D((T(),w("div",{key:1,onClick:e[5]||(e[5]=o=>i.shrink=!1),class:"bg-white text-center text-xl bold dark:bg-gray-500 border-blue-300 rounded-lg shadow-lg p-2 h-10 cursor-pointer m-2"},W(t.title),513)),[[xt,i.shrink===!0]]):D((T(),w("div",{key:2,onClick:e[6]||(e[6]=o=>i.shrink=!1),class:"bg-white text-center text-2xl dark:bg-gray-500 border-2 border-blue-300 rounded-lg shadow-lg p-0 h-7 cursor-pointer hover:h-8 hover:bg-blue-300"}," + ",512)),[[xt,i.shrink===!0]])])}const pp=it(BZe,[["render",zZe]]),VN="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M20%203H4c-1.103%200-2%20.897-2%202v14c0%201.103.897%202%202%202h16c1.103%200%202-.897%202-2V5c0-1.103-.897-2-2-2zM4%2019V7h16l.002%2012H4z'/%3e%3cpath%20d='M9.293%209.293%205.586%2013l3.707%203.707%201.414-1.414L8.414%2013l2.293-2.293zm5.414%200-1.414%201.414L15.586%2013l-2.293%202.293%201.414%201.414L18.414%2013z'/%3e%3c/svg%3e",zN="/assets/python_block-Bt12VGEE.png",HN="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2024.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20630%20630'%20style='enable-background:new%200%200%20630%20630;'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23EDBF4A;}%20.st1{fill:%230C0C0C;}%20%3c/style%3e%3crect%20class='st0'%20width='630'%20height='630'/%3e%3cpath%20class='st1'%20d='M423.2,492.2c12.7,20.7,29.2,36,58.4,36c24.5,0,40.2-12.3,40.2-29.2c0-20.3-16.1-27.5-43.1-39.3l-14.8-6.4%20c-42.7-18.2-71.1-41-71.1-89.2c0-44.4,33.8-78.2,86.7-78.2c37.6,0,64.7,13.1,84.2,47.4l-46.1,29.6c-10.1-18.2-21.1-25.4-38.1-25.4%20c-17.3,0-28.3,11-28.3,25.4c0,17.8,11,25,36.4,36l14.8,6.3c50.3,21.6,78.7,43.6,78.7,93c0,53.3-41.9,82.5-98.1,82.5%20c-55,0-90.5-26.2-107.9-60.5L423.2,492.2z%20M214.1,497.3c9.3,16.5,17.8,30.5,38.1,30.5c19.5,0,31.7-7.6,31.7-37.2V289.3h59.2v202.1%20c0,61.3-35.9,89.2-88.4,89.2c-47.4,0-74.9-24.5-88.8-54.1L214.1,497.3z'/%3e%3c/svg%3e",qN="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAOeSURBVGhD7ZhNaBNBGIZHW/EPbSioRSpi0FRpVdRSjQfxkFilB5UciuChIL0JLaKIhR5KIYKIiBSF0mLVS7AIavUgPQjiT4+KB0EP3gwS8VDBgj8d33d2ZrNJt2lCppKWfeBh5pvdncyXmZ3sZokQQsIFz1JdLni8M8L6QkSNf9HMSJBIpREkUmkEiVQaQSKVRpCIH8lkUtbW1sre3l7fB9FoNCrD4fC8PaSyYyudNzU1yZGRkYJ9dXV1yUQiYTMZNX6rM5LJZERHR0fBh0/MmJDSZh4OVhOZmprStf+P1UQmJyd1zaGvr09NuxM5VFVViYmJCR3Zw1oiPT09koP00tjYKNrb23XkEIlERHV1tY7sMuNbK5XR0VGJwcnBwcGi+uns7Cz7Mz24fVnpdGhoSDY0NBTbjxweHi77MzXu+N2KBebsh7PW0tJi6/OIGr/Vm72mpkbXssTj8ZxBp9NpUV9fryN7WE0kn1QqJcfHx3U0v1hNJBQKqXtFh2JsbEx0d3frKMv09LSu2UWtMadaHm1tberxQ+9Koq6uLqff1tZW2dzcLPXviy3c8bsVG/T398+6I8ViMTkwMGDtszRq/MEfdJVGkEilESRSaZSSyCa43anmsAPGII/7wWd7nnMEbmaDD2G41anmsA76tfui9mGnWpAPkOftVpEQuyDfkMz19Bv0cg56j9NP8AQ07IXm2Es2eHgK2b5RRf6Ya7OVOchP5D1kfA0m4GX4CxouQR7/A6/DC/CObqNRSA5A00Y7oeG/JMJBM65TUS7rIV/gefw4GzzchWx/rKJsIu90+REaik6knJv9hy5vw4NO1WU/XAG/w0ds8MABk326NLyGL+A2eJYNpVBOIhd1eRS+gs/hTjYAc4M+06WX+7rkt7zKqbrc0OV5WNIjUzmJDME9MKUiIQ5DvnyshOZfCL/+l+uSz/I/narLA8gvhLsb77miKScR8haegqfhb7gBcoa4M5G4Lr0069Kck88VXZ6B+TNWEHWzONWCpCHPM78lZhkZ3kAePwa36DpthQYulwxke5INwNzst1Tk8ASa66mVXYtLgFPOc7iVroUtOh6F3Gbv6fgLXAPJVWj65vU3IW9oxl+hWWJ+iRyC5lpqJZHP0JxjbnBO+UP4F5pjXNsnoRf+IJqZpNySmRSXoMEvEeL9Iqwkwm20Cfqt12UwAleraHZCcLbHEzLz75fiUeMP3hArjUWTiHdpLWgWyYwI8Q8rrSjH5vAr6AAAAABJRU5ErkJggg==",YN="/assets/cpp_block-kkmuBJ_E.png",$N="/assets/html5_block-beC_-Wtz.png",WN="/assets/LaTeX_block-BNFNi2yr.png",KN="/assets/bash_block-DZNRrwlz.png",HZe="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTAgNTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+DQogIDxjaXJjbGUgY3g9IjI1IiBjeT0iMjUiIHI9IjI1IiBmaWxsPSJkZWVwc2t5Ymx1ZSIvPg0KICA8dGV4dCB4PSIyNSIgeT0iMzciIGZvbnQtc2l6ZT0iMzYiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IndoaXRlIiBmb250LXdlaWdodD0iYm9sZCI+VDwvdGV4dD4NCjwvc3ZnPg0K",qZe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='red'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3ccircle%20cx='12'%20cy='12'%20r='10'%3e%3c/circle%3e%3cpath%20d='M16%2016s-1.5-2-4-2-4%202-4%202'%20stroke='currentColor'%3e%3c/path%3e%3cline%20x1='9'%20y1='9'%20x2='15'%20y2='15'%20stroke='currentColor'%3e%3c/line%3e%3c/svg%3e",YZe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3ccircle%20cx='12'%20cy='12'%20r='10'%3e%3c/circle%3e%3cpath%20d='M16%2016s-1.5-2-4-2-4%202-4%202'%3e%3c/path%3e%3cline%20x1='9'%20y1='9'%20x2='15'%20y2='15'%3e%3c/line%3e%3c/svg%3e",$Ze="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%3e%3ccircle%20cx='25'%20cy='25'%20r='24'%20fill='white'%20stroke='black'%20stroke-width='2'/%3e%3ccircle%20id='heartbeat'%20cx='25'%20cy='25'%20r='20'%20fill='red'%3e%3canimate%20attributeName='r'%20dur='1s'%20repeatCount='indefinite'%20keyTimes='0;0.25;0.5;0.75;1'%20values='20;24;20;22;20'/%3e%3c/circle%3e%3c/svg%3e",WZe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%3e%3ccircle%20cx='25'%20cy='25'%20r='24'%20fill='white'%20stroke='black'%20stroke-width='2'/%3e%3ccircle%20cx='25'%20cy='25'%20r='20'%20fill='red'/%3e%3c/svg%3e",jN="data:image/svg+xml,%3csvg%20viewBox='0%200%2050%2050'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20transform='translate(25,25)'%3e%3ccircle%20cx='0'%20cy='-15'%20r='3'%20fill='%23f00'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20from='0'%20to='360'%20dur='1s'%20repeatCount='indefinite'%20/%3e%3c/circle%3e%3ccircle%20cx='0'%20cy='-15'%20r='3'%20fill='%230f0'%20transform='rotate(90)'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20from='0'%20to='360'%20dur='1.2s'%20repeatCount='indefinite'%20/%3e%3c/circle%3e%3ccircle%20cx='0'%20cy='-15'%20r='3'%20fill='%2300f'%20transform='rotate(180)'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20from='0'%20to='360'%20dur='1.4s'%20repeatCount='indefinite'%20/%3e%3c/circle%3e%3ccircle%20cx='0'%20cy='-15'%20r='3'%20fill='%23ff0'%20transform='rotate(270)'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20from='0'%20to='360'%20dur='1.6s'%20repeatCount='indefinite'%20/%3e%3c/circle%3e%3c/g%3e%3c/svg%3e",KZe={props:{icon:{type:String,required:!0},title:{type:String,required:!0}},computed:{iconPath(){return this.getIconPath()}},methods:{getIconPath(){switch(this.icon){case"x":return'';case"check":return'';case"code":return'';case"python":return'';case"js":return'JS';case"typescript":return'TS';case"braces":return'';case"cplusplus":case"c++":return'C++';case"csharp":return'C#';case"go":return'Go';case"r-project":return'R';case"rust":return'';case"swift":return'';case"kotlin":return'';case"java":return'';case"html5":return'';case"css3":return'';case"vuejs":return'';case"react":return'';case"angular":return'';case"xml":return'';case"json":return'';case"yaml":return'';case"markdown":return'';case"latex":return'TEX';case"bash":return'';case"powershell":return'';case"perl":return'';case"mermaid":return'';case"graphviz":return'';case"plantuml":return'';case"sql":return'';case"mongodb":return'';case"mathFunction":return'';case"terminal":return'';case"edit":return'';case"copy":return'';case"send":return'';case"globe":return'';case"fastForward":return'';case"sendSimple":return'';default:return""}}}},jZe=["title"],QZe={class:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},XZe=["innerHTML"];function ZZe(n,e,t,s,i,r){return T(),w("button",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:t.title,onClick:e[0]||(e[0]=o=>n.$emit("click"))},[(T(),w("svg",QZe,[l("g",{innerHTML:r.iconPath},null,8,XZe)]))],8,jZe)}const P0=it(KZe,[["render",ZZe]]);var jn="top",ws="bottom",Rs="right",Qn="left",F0="auto",pc=[jn,ws,Rs,Qn],ma="start",jl="end",JZe="clippingParents",QN="viewport",sl="popper",eJe="reference",Yx=pc.reduce(function(n,e){return n.concat([e+"-"+ma,e+"-"+jl])},[]),XN=[].concat(pc,[F0]).reduce(function(n,e){return n.concat([e,e+"-"+ma,e+"-"+jl])},[]),tJe="beforeRead",nJe="read",sJe="afterRead",iJe="beforeMain",rJe="main",oJe="afterMain",aJe="beforeWrite",lJe="write",cJe="afterWrite",dJe=[tJe,nJe,sJe,iJe,rJe,oJe,aJe,lJe,cJe];function ci(n){return n?(n.nodeName||"").toLowerCase():null}function as(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function po(n){var e=as(n).Element;return n instanceof e||n instanceof Element}function Ts(n){var e=as(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function U0(n){if(typeof ShadowRoot>"u")return!1;var e=as(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function uJe(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];!Ts(r)||!ci(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(o){var a=i[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function pJe(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(s){var i=e.elements[s],r=e.attributes[s]||{},o=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),a=o.reduce(function(c,d){return c[d]="",c},{});!Ts(i)||!ci(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(c){i.removeAttribute(c)}))})}}const fJe={name:"applyStyles",enabled:!0,phase:"write",fn:uJe,effect:pJe,requires:["computeStyles"]};function oi(n){return n.split("-")[0]}var to=Math.max,ru=Math.min,ha=Math.round;function pb(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function ZN(){return!/^((?!chrome|android).)*safari/i.test(pb())}function ga(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=n.getBoundingClientRect(),i=1,r=1;e&&Ts(n)&&(i=n.offsetWidth>0&&ha(s.width)/n.offsetWidth||1,r=n.offsetHeight>0&&ha(s.height)/n.offsetHeight||1);var o=po(n)?as(n):window,a=o.visualViewport,c=!ZN()&&t,d=(s.left+(c&&a?a.offsetLeft:0))/i,u=(s.top+(c&&a?a.offsetTop:0))/r,_=s.width/i,m=s.height/r;return{width:_,height:m,top:u,right:d+_,bottom:u+m,left:d,x:d,y:u}}function B0(n){var e=ga(n),t=n.offsetWidth,s=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:s}}function JN(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&U0(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Fi(n){return as(n).getComputedStyle(n)}function _Je(n){return["table","td","th"].indexOf(ci(n))>=0}function Nr(n){return((po(n)?n.ownerDocument:n.document)||window.document).documentElement}function fp(n){return ci(n)==="html"?n:n.assignedSlot||n.parentNode||(U0(n)?n.host:null)||Nr(n)}function $x(n){return!Ts(n)||Fi(n).position==="fixed"?null:n.offsetParent}function mJe(n){var e=/firefox/i.test(pb()),t=/Trident/i.test(pb());if(t&&Ts(n)){var s=Fi(n);if(s.position==="fixed")return null}var i=fp(n);for(U0(i)&&(i=i.host);Ts(i)&&["html","body"].indexOf(ci(i))<0;){var r=Fi(i);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return i;i=i.parentNode}return null}function fc(n){for(var e=as(n),t=$x(n);t&&_Je(t)&&Fi(t).position==="static";)t=$x(t);return t&&(ci(t)==="html"||ci(t)==="body"&&Fi(t).position==="static")?e:t||mJe(n)||e}function G0(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Rl(n,e,t){return to(n,ru(e,t))}function hJe(n,e,t){var s=Rl(n,e,t);return s>t?t:s}function eM(){return{top:0,right:0,bottom:0,left:0}}function tM(n){return Object.assign({},eM(),n)}function nM(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var gJe=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,tM(typeof e!="number"?e:nM(e,pc))};function bJe(n){var e,t=n.state,s=n.name,i=n.options,r=t.elements.arrow,o=t.modifiersData.popperOffsets,a=oi(t.placement),c=G0(a),d=[Qn,Rs].indexOf(a)>=0,u=d?"height":"width";if(!(!r||!o)){var _=gJe(i.padding,t),m=B0(r),h=c==="y"?jn:Qn,f=c==="y"?ws:Rs,g=t.rects.reference[u]+t.rects.reference[c]-o[c]-t.rects.popper[u],b=o[c]-t.rects.reference[c],y=fc(r),E=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,v=g/2-b/2,S=_[h],R=E-m[u]-_[f],C=E/2-m[u]/2+v,A=Rl(S,C,R),I=c;t.modifiersData[s]=(e={},e[I]=A,e.centerOffset=A-C,e)}}function yJe(n){var e=n.state,t=n.options,s=t.element,i=s===void 0?"[data-popper-arrow]":s;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||JN(e.elements.popper,i)&&(e.elements.arrow=i))}const EJe={name:"arrow",enabled:!0,phase:"main",fn:bJe,effect:yJe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ba(n){return n.split("-")[1]}var vJe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function SJe(n,e){var t=n.x,s=n.y,i=e.devicePixelRatio||1;return{x:ha(t*i)/i||0,y:ha(s*i)/i||0}}function Wx(n){var e,t=n.popper,s=n.popperRect,i=n.placement,r=n.variation,o=n.offsets,a=n.position,c=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,_=n.isFixed,m=o.x,h=m===void 0?0:m,f=o.y,g=f===void 0?0:f,b=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=b.x,g=b.y;var y=o.hasOwnProperty("x"),E=o.hasOwnProperty("y"),v=Qn,S=jn,R=window;if(d){var C=fc(t),A="clientHeight",I="clientWidth";if(C===as(t)&&(C=Nr(t),Fi(C).position!=="static"&&a==="absolute"&&(A="scrollHeight",I="scrollWidth")),C=C,i===jn||(i===Qn||i===Rs)&&r===jl){S=ws;var x=_&&C===R&&R.visualViewport?R.visualViewport.height:C[A];g-=x-s.height,g*=c?1:-1}if(i===Qn||(i===jn||i===ws)&&r===jl){v=Rs;var N=_&&C===R&&R.visualViewport?R.visualViewport.width:C[I];h-=N-s.width,h*=c?1:-1}}var G=Object.assign({position:a},d&&vJe),V=u===!0?SJe({x:h,y:g},as(t)):{x:h,y:g};if(h=V.x,g=V.y,c){var te;return Object.assign({},G,(te={},te[S]=E?"0":"",te[v]=y?"0":"",te.transform=(R.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",te))}return Object.assign({},G,(e={},e[S]=E?g+"px":"",e[v]=y?h+"px":"",e.transform="",e))}function TJe(n){var e=n.state,t=n.options,s=t.gpuAcceleration,i=s===void 0?!0:s,r=t.adaptive,o=r===void 0?!0:r,a=t.roundOffsets,c=a===void 0?!0:a,d={placement:oi(e.placement),variation:ba(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Wx(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Wx(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const xJe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:TJe,data:{}};var Bc={passive:!0};function CJe(n){var e=n.state,t=n.instance,s=n.options,i=s.scroll,r=i===void 0?!0:i,o=s.resize,a=o===void 0?!0:o,c=as(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&d.forEach(function(u){u.addEventListener("scroll",t.update,Bc)}),a&&c.addEventListener("resize",t.update,Bc),function(){r&&d.forEach(function(u){u.removeEventListener("scroll",t.update,Bc)}),a&&c.removeEventListener("resize",t.update,Bc)}}const wJe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:CJe,data:{}};var RJe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ld(n){return n.replace(/left|right|bottom|top/g,function(e){return RJe[e]})}var AJe={start:"end",end:"start"};function Kx(n){return n.replace(/start|end/g,function(e){return AJe[e]})}function V0(n){var e=as(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function z0(n){return ga(Nr(n)).left+V0(n).scrollLeft}function NJe(n,e){var t=as(n),s=Nr(n),i=t.visualViewport,r=s.clientWidth,o=s.clientHeight,a=0,c=0;if(i){r=i.width,o=i.height;var d=ZN();(d||!d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:r,height:o,x:a+z0(n),y:c}}function MJe(n){var e,t=Nr(n),s=V0(n),i=(e=n.ownerDocument)==null?void 0:e.body,r=to(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=to(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-s.scrollLeft+z0(n),c=-s.scrollTop;return Fi(i||t).direction==="rtl"&&(a+=to(t.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:c}}function H0(n){var e=Fi(n),t=e.overflow,s=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+s)}function sM(n){return["html","body","#document"].indexOf(ci(n))>=0?n.ownerDocument.body:Ts(n)&&H0(n)?n:sM(fp(n))}function Al(n,e){var t;e===void 0&&(e=[]);var s=sM(n),i=s===((t=n.ownerDocument)==null?void 0:t.body),r=as(s),o=i?[r].concat(r.visualViewport||[],H0(s)?s:[]):s,a=e.concat(o);return i?a:a.concat(Al(fp(o)))}function fb(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function OJe(n,e){var t=ga(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function jx(n,e,t){return e===QN?fb(NJe(n,t)):po(e)?OJe(e,t):fb(MJe(Nr(n)))}function IJe(n){var e=Al(fp(n)),t=["absolute","fixed"].indexOf(Fi(n).position)>=0,s=t&&Ts(n)?fc(n):n;return po(s)?e.filter(function(i){return po(i)&&JN(i,s)&&ci(i)!=="body"}):[]}function kJe(n,e,t,s){var i=e==="clippingParents"?IJe(n):[].concat(e),r=[].concat(i,[t]),o=r[0],a=r.reduce(function(c,d){var u=jx(n,d,s);return c.top=to(u.top,c.top),c.right=ru(u.right,c.right),c.bottom=ru(u.bottom,c.bottom),c.left=to(u.left,c.left),c},jx(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function iM(n){var e=n.reference,t=n.element,s=n.placement,i=s?oi(s):null,r=s?ba(s):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(i){case jn:c={x:o,y:e.y-t.height};break;case ws:c={x:o,y:e.y+e.height};break;case Rs:c={x:e.x+e.width,y:a};break;case Qn:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var d=i?G0(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(r){case ma:c[d]=c[d]-(e[u]/2-t[u]/2);break;case jl:c[d]=c[d]+(e[u]/2-t[u]/2);break}}return c}function Ql(n,e){e===void 0&&(e={});var t=e,s=t.placement,i=s===void 0?n.placement:s,r=t.strategy,o=r===void 0?n.strategy:r,a=t.boundary,c=a===void 0?JZe:a,d=t.rootBoundary,u=d===void 0?QN:d,_=t.elementContext,m=_===void 0?sl:_,h=t.altBoundary,f=h===void 0?!1:h,g=t.padding,b=g===void 0?0:g,y=tM(typeof b!="number"?b:nM(b,pc)),E=m===sl?eJe:sl,v=n.rects.popper,S=n.elements[f?E:m],R=kJe(po(S)?S:S.contextElement||Nr(n.elements.popper),c,u,o),C=ga(n.elements.reference),A=iM({reference:C,element:v,strategy:"absolute",placement:i}),I=fb(Object.assign({},v,A)),x=m===sl?I:C,N={top:R.top-x.top+y.top,bottom:x.bottom-R.bottom+y.bottom,left:R.left-x.left+y.left,right:x.right-R.right+y.right},G=n.modifiersData.offset;if(m===sl&&G){var V=G[i];Object.keys(N).forEach(function(te){var O=[Rs,ws].indexOf(te)>=0?1:-1,H=[jn,ws].indexOf(te)>=0?"y":"x";N[te]+=V[H]*O})}return N}function DJe(n,e){e===void 0&&(e={});var t=e,s=t.placement,i=t.boundary,r=t.rootBoundary,o=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,d=c===void 0?XN:c,u=ba(s),_=u?a?Yx:Yx.filter(function(f){return ba(f)===u}):pc,m=_.filter(function(f){return d.indexOf(f)>=0});m.length===0&&(m=_);var h=m.reduce(function(f,g){return f[g]=Ql(n,{placement:g,boundary:i,rootBoundary:r,padding:o})[oi(g)],f},{});return Object.keys(h).sort(function(f,g){return h[f]-h[g]})}function LJe(n){if(oi(n)===F0)return[];var e=Ld(n);return[Kx(n),e,Kx(e)]}function PJe(n){var e=n.state,t=n.options,s=n.name;if(!e.modifiersData[s]._skip){for(var i=t.mainAxis,r=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!0:o,c=t.fallbackPlacements,d=t.padding,u=t.boundary,_=t.rootBoundary,m=t.altBoundary,h=t.flipVariations,f=h===void 0?!0:h,g=t.allowedAutoPlacements,b=e.options.placement,y=oi(b),E=y===b,v=c||(E||!f?[Ld(b)]:LJe(b)),S=[b].concat(v).reduce(function(ve,Oe){return ve.concat(oi(Oe)===F0?DJe(e,{placement:Oe,boundary:u,rootBoundary:_,padding:d,flipVariations:f,allowedAutoPlacements:g}):Oe)},[]),R=e.rects.reference,C=e.rects.popper,A=new Map,I=!0,x=S[0],N=0;N=0,H=O?"width":"height",q=Ql(e,{placement:G,boundary:u,rootBoundary:_,altBoundary:m,padding:d}),L=O?te?Rs:Qn:te?ws:jn;R[H]>C[H]&&(L=Ld(L));var Y=Ld(L),se=[];if(r&&se.push(q[V]<=0),a&&se.push(q[L]<=0,q[Y]<=0),se.every(function(ve){return ve})){x=G,I=!1;break}A.set(G,se)}if(I)for(var oe=f?3:1,ye=function(Oe){var De=S.find(function(Q){var fe=A.get(Q);if(fe)return fe.slice(0,Oe).every(function(_e){return _e})});if(De)return x=De,"break"},xe=oe;xe>0;xe--){var le=ye(xe);if(le==="break")break}e.placement!==x&&(e.modifiersData[s]._skip=!0,e.placement=x,e.reset=!0)}}const FJe={name:"flip",enabled:!0,phase:"main",fn:PJe,requiresIfExists:["offset"],data:{_skip:!1}};function Qx(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Xx(n){return[jn,Rs,ws,Qn].some(function(e){return n[e]>=0})}function UJe(n){var e=n.state,t=n.name,s=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,o=Ql(e,{elementContext:"reference"}),a=Ql(e,{altBoundary:!0}),c=Qx(o,s),d=Qx(a,i,r),u=Xx(c),_=Xx(d);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:_},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":_})}const BJe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:UJe};function GJe(n,e,t){var s=oi(n),i=[Qn,jn].indexOf(s)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=r[0],a=r[1];return o=o||0,a=(a||0)*i,[Qn,Rs].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function VJe(n){var e=n.state,t=n.options,s=n.name,i=t.offset,r=i===void 0?[0,0]:i,o=XN.reduce(function(u,_){return u[_]=GJe(_,e.rects,r),u},{}),a=o[e.placement],c=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[s]=o}const zJe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:VJe};function HJe(n){var e=n.state,t=n.name;e.modifiersData[t]=iM({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const qJe={name:"popperOffsets",enabled:!0,phase:"read",fn:HJe,data:{}};function YJe(n){return n==="x"?"y":"x"}function $Je(n){var e=n.state,t=n.options,s=n.name,i=t.mainAxis,r=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!1:o,c=t.boundary,d=t.rootBoundary,u=t.altBoundary,_=t.padding,m=t.tether,h=m===void 0?!0:m,f=t.tetherOffset,g=f===void 0?0:f,b=Ql(e,{boundary:c,rootBoundary:d,padding:_,altBoundary:u}),y=oi(e.placement),E=ba(e.placement),v=!E,S=G0(y),R=YJe(S),C=e.modifiersData.popperOffsets,A=e.rects.reference,I=e.rects.popper,x=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof x=="number"?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),G=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,V={x:0,y:0};if(C){if(r){var te,O=S==="y"?jn:Qn,H=S==="y"?ws:Rs,q=S==="y"?"height":"width",L=C[S],Y=L+b[O],se=L-b[H],oe=h?-I[q]/2:0,ye=E===ma?A[q]:I[q],xe=E===ma?-I[q]:-A[q],le=e.elements.arrow,ve=h&&le?B0(le):{width:0,height:0},Oe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:eM(),De=Oe[O],Q=Oe[H],fe=Rl(0,A[q],ve[q]),_e=v?A[q]/2-oe-fe-De-N.mainAxis:ye-fe-De-N.mainAxis,Ae=v?-A[q]/2+oe+fe+Q+N.mainAxis:xe+fe+Q+N.mainAxis,Fe=e.elements.arrow&&fc(e.elements.arrow),ne=Fe?S==="y"?Fe.clientTop||0:Fe.clientLeft||0:0,U=(te=G==null?void 0:G[S])!=null?te:0,P=L+_e-U-ne,J=L+Ae-U,ce=Rl(h?ru(Y,P):Y,L,h?to(se,J):se);C[S]=ce,V[S]=ce-L}if(a){var pe,he=S==="x"?jn:Qn,ae=S==="x"?ws:Rs,Ne=C[R],Re=R==="y"?"height":"width",ge=Ne+b[he],k=Ne-b[ae],M=[jn,Qn].indexOf(y)!==-1,$=(pe=G==null?void 0:G[R])!=null?pe:0,me=M?ge:Ne-A[Re]-I[Re]-$+N.altAxis,j=M?Ne+A[Re]+I[Re]-$-N.altAxis:k,ie=h&&M?hJe(me,Ne,j):Rl(h?me:ge,Ne,h?j:k);C[R]=ie,V[R]=ie-Ne}e.modifiersData[s]=V}}const WJe={name:"preventOverflow",enabled:!0,phase:"main",fn:$Je,requiresIfExists:["offset"]};function KJe(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function jJe(n){return n===as(n)||!Ts(n)?V0(n):KJe(n)}function QJe(n){var e=n.getBoundingClientRect(),t=ha(e.width)/n.offsetWidth||1,s=ha(e.height)/n.offsetHeight||1;return t!==1||s!==1}function XJe(n,e,t){t===void 0&&(t=!1);var s=Ts(e),i=Ts(e)&&QJe(e),r=Nr(e),o=ga(n,i,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!t)&&((ci(e)!=="body"||H0(r))&&(a=jJe(e)),Ts(e)?(c=ga(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):r&&(c.x=z0(r))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function ZJe(n){var e=new Map,t=new Set,s=[];n.forEach(function(r){e.set(r.name,r)});function i(r){t.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&i(c)}}),s.push(r)}return n.forEach(function(r){t.has(r.name)||i(r)}),s}function JJe(n){var e=ZJe(n);return dJe.reduce(function(t,s){return t.concat(e.filter(function(i){return i.phase===s}))},[])}function eet(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function tet(n){var e=n.reduce(function(t,s){var i=t[s.name];return t[s.name]=i?Object.assign({},i,s,{options:Object.assign({},i.options,s.options),data:Object.assign({},i.data,s.data)}):s,t},{});return Object.keys(e).map(function(t){return e[t]})}var Zx={placement:"bottom",modifiers:[],strategy:"absolute"};function Jx(){for(var n=arguments.length,e=new Array(n),t=0;t{this.createPopper()})},closeMenu(n){var e;!this.$el.contains(n.target)&&!((e=this.$refs.dropdown)!=null&&e.contains(n.target))&&(this.isOpen=!1)},createPopper(){const n=this.$el.querySelector("button"),e=this.$refs.dropdown;n&&e&&(this.popperInstance=_p(n,e,{placement:"bottom-end",modifiers:[{name:"flip",options:{fallbackPlacements:["top-end","bottom-start","top-start"]}},{name:"preventOverflow",options:{boundary:document.body}}]}))}}},ret={class:"relative inline-block text-left"},oet={key:0,ref:"dropdown",class:"z-50 w-56 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 dark:ring-white dark:ring-opacity-20 focus:outline-none dropdown-shadow text-gray-700 dark:text-white"},aet={class:"py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"};function cet(n,e,t,s,i,r){const o=et("ToolbarButton");return T(),w("div",ret,[l("div",null,[z(o,{onClick:K(r.toggleMenu,["stop"]),title:t.title,icon:"code"},null,8,["onClick","title"])]),(T(),at(ok,{to:"body"},[i.isOpen?(T(),w("div",oet,[l("div",aet,[un(n.$slots,"default",{},void 0,!0)])],512)):B("",!0)]))])}const rM=it(iet,[["render",cet],["__scopeId","data-v-6c3ea3a5"]]);async function eC(n,e="",t=[]){return new Promise((s,i)=>{const r=document.createElement("div");r.className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50",t.length===0?r.innerHTML=`

${n}

@@ -89,24 +89,24 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ye=L,oe=Y),se===void 0
- `,document.body.appendChild(r);const o=r.querySelector("#cancelButton"),a=r.querySelector("#okButton");o.addEventListener("click",()=>{document.body.removeChild(r),s(null)}),a.addEventListener("click",()=>{if(t.length===0){const d=r.querySelector("#replacementInput").value.trim();document.body.removeChild(r),s(d)}else{const d=r.querySelector("#options_selector").value.trim();document.body.removeChild(r),s(d)}})})}function det(n,e){console.log(n);let t={},s=/@<([^>]+)>@/g,i=[],r;for(;(r=s.exec(n))!==null;)i.push("@<"+r[1]+">@");console.log("matches"),console.log(i),i=[...new Set(i)];async function o(c){console.log(c);let d=c.toLowerCase().substring(2,c.length-2);if(d!=="generation_placeholder")if(d.includes(":")){Object.entries({all_language_options:"english:french:german:chinese:japanese:spanish:italian:russian:portuguese:swedish:danish:dutch:norwegian:slovak:czech:hungarian:polish:ukrainian:bulgarian:latvian:lithuanian:estonian:maltese:irish:galician:basque:welsh:breton:georgian:turkmen:kazakh:uzbek:tajik:afghan:sri-lankan:filipino:vietnamese:lao:cambodian:thai:burmese:kenyan:botswanan:zimbabwean:malawian:mozambican:angolan:namibian:south-african:madagascan:seychellois:mauritian:haitian:peruvian:ecuadorian:bolivian:paraguayan:chilean:argentinean:uruguayan:brazilian:colombian:venezuelan:puerto-rican:cuban:dominican:honduran:nicaraguan:salvadorean:guatemalan:el-salvadoran:belizean:panamanian:costa-rican:antiguan:barbudan:dominica's:grenada's:st-lucia's:st-vincent's:gibraltarian:faroe-islander:greenlandic:icelandic:jamaican:trinidadian:tobagonian:barbadian:anguillan:british-virgin-islander:us-virgin-islander:turkish:israeli:palestinian:lebanese:egyptian:libyan:tunisian:algerian:moroccan:bahraini:kuwaiti:saudi-arabian:yemeni:omani:irani:iraqi:afghanistan's:pakistani:indian:nepalese:sri-lankan:maldivan:burmese:thai:lao:vietnamese:kampuchean:malaysian:bruneian:indonesian:australian:new-zealanders:fijians:tongans:samoans:vanuatuans:wallisians:kiribatians:tuvaluans:solomon-islanders:marshallese:micronesians:hawaiians",all_programming_language_options:"python:c:c++:java:javascript:php:ruby:go:swift:kotlin:rust:haskell:erlang:lisp:scheme:prolog:cobol:fortran:pascal:delphi:d:eiffel:h:basic:visual_basic:smalltalk:objective-c:html5:node.js:vue.js:svelte:react:angular:ember:clipper:stex:arduino:brainfuck:r:assembly:mason:lepton:seacat:bbc_microbit:raspberry_pi_gpio:raspberry_pi_spi:raspberry_pi_i2c:raspberry_pi_uart:raspberry_pi_adc:raspberry_pi_ddio"}).forEach(([b,y])=>{console.log(`Key: ${b}, Value: ${y}`);function E(R){return R.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const v=E(b),S=new RegExp(v,"g");d=d.replace(S,y)});let _=d.split(":"),m=_[0],h=_[1]||"",f=[];_.length>2&&(f=_.slice(1));let g=await eC(m,h,f);g!==null&&(t[c]=g)}else{let u=await eC(d);u!==null&&(t[c]=u)}}let a=Promise.resolve();i.forEach(c=>{a=a.then(()=>o(c)).then(d=>{console.log(d)})}),a.then(()=>{Object.entries(t).forEach(([c,d])=>{console.log(`Key: ${c}, Value: ${d}`);function u(h){return h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const _=u(c),m=new RegExp(_,"g");n=n.replace(m,d)}),e(n)})}const uet={name:"PlayGroundView",data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},showSettings:!1,pending:!1,is_recording:!1,is_deaf_transcribing:!1,cpp_block:YN,html5_block:$N,LaTeX_block:WN,javascript_block:HN,json_block:qN,code_block:VN,python_block:zN,bash_block:KN,tokenize_icon:HZe,deaf_off:YZe,deaf_on:qZe,rec_off:WZe,rec_on:$Ze,loading_icon:jN,isSynthesizingVoice:!1,audio_url:null,mdRenderHeight:300,selecting_model:!1,tab_id:"source",generating:!1,isSpeaking:!1,voices:[],isLesteningToVoice:!1,presets:[],selectedPreset:"",cursorPosition:0,namedTokens:[],text:"",pre_text:"",post_text:"",temperature:.1,top_k:50,top_p:.9,repeat_penalty:1.3,repeat_last_n:50,n_crop:-1,n_predicts:2e3,seed:-1,silenceTimeout:5e3}},components:{Toast:ac,MarkdownRenderer:lp,ClipBoardTextInput:L0,TokensHilighter:PZe,ChatBarButton:GN,Card:pp,ToolbarButton:P0,DropdownMenu:rM},mounted(){Z.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)}),qe.on("text_chunk",n=>{this.appendToOutput(n.chunk)}),qe.on("text_generated",n=>{this.generating=!1}),qe.on("generation_error",n=>{console.log("generation_error:",n),this.$refs.toast.showToast(`Error: ${n}`,4,!1),this.generating=!1}),qe.on("connect",()=>{console.log("Connected to LoLLMs server"),this.$store.state.isConnected=!0,this.generating=!1}),qe.on("buzzy",n=>{console.error("Server is busy. Wait for your turn",n),this.$refs.toast.showToast(`Error: ${n.message}`,4,!1),this.generating=!1}),qe.on("generation_canceled",n=>{this.generating=!1,console.log("Generation canceled OK")}),this.$nextTick(()=>{Ve.replace()}),"speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0&&this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged)):console.error("Speech synthesis is not supported in this browser.")},created(){},watch:{audio_url(n){n&&(console.log("Audio changed url to :",n),this.$refs.audio_player.src=n)}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}},isTalking:{get(){return this.isSpeaking}}},methods:{triggerFileUpload(){this.$refs.fileInput.click()},handleFileUpload(n){this.file=this.$refs.fileInput.files[0],this.buttonText=this.file.name,this.uploadFile()},uploadFile(){console.log("sending file");const n=new FormData;n.append("file",this.file),Z.post("/upload_voice/",n,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{console.log(e),this.buttonText="Upload a voice"}).catch(e=>{console.error(e)})},addBlock(n){let e=this.$refs.mdTextarea.selectionStart,t=this.$refs.mdTextarea.selectionEnd;e==t?speechSynthesis==0||this.text[e-1]==` + `,document.body.appendChild(r);const o=r.querySelector("#cancelButton"),a=r.querySelector("#okButton");o.addEventListener("click",()=>{document.body.removeChild(r),s(null)}),a.addEventListener("click",()=>{if(t.length===0){const d=r.querySelector("#replacementInput").value.trim();document.body.removeChild(r),s(d)}else{const d=r.querySelector("#options_selector").value.trim();document.body.removeChild(r),s(d)}})})}function det(n,e){console.log(n);let t={},s=/@<([^>]+)>@/g,i=[],r;for(;(r=s.exec(n))!==null;)i.push("@<"+r[1]+">@");console.log("matches"),console.log(i),i=[...new Set(i)];async function o(c){console.log(c);let d=c.toLowerCase().substring(2,c.length-2);if(d!=="generation_placeholder")if(d.includes(":")){Object.entries({all_language_options:"english:french:german:chinese:japanese:spanish:italian:russian:portuguese:swedish:danish:dutch:norwegian:slovak:czech:hungarian:polish:ukrainian:bulgarian:latvian:lithuanian:estonian:maltese:irish:galician:basque:welsh:breton:georgian:turkmen:kazakh:uzbek:tajik:afghan:sri-lankan:filipino:vietnamese:lao:cambodian:thai:burmese:kenyan:botswanan:zimbabwean:malawian:mozambican:angolan:namibian:south-african:madagascan:seychellois:mauritian:haitian:peruvian:ecuadorian:bolivian:paraguayan:chilean:argentinean:uruguayan:brazilian:colombian:venezuelan:puerto-rican:cuban:dominican:honduran:nicaraguan:salvadorean:guatemalan:el-salvadoran:belizean:panamanian:costa-rican:antiguan:barbudan:dominica's:grenada's:st-lucia's:st-vincent's:gibraltarian:faroe-islander:greenlandic:icelandic:jamaican:trinidadian:tobagonian:barbadian:anguillan:british-virgin-islander:us-virgin-islander:turkish:israeli:palestinian:lebanese:egyptian:libyan:tunisian:algerian:moroccan:bahraini:kuwaiti:saudi-arabian:yemeni:omani:irani:iraqi:afghanistan's:pakistani:indian:nepalese:sri-lankan:maldivan:burmese:thai:lao:vietnamese:kampuchean:malaysian:bruneian:indonesian:australian:new-zealanders:fijians:tongans:samoans:vanuatuans:wallisians:kiribatians:tuvaluans:solomon-islanders:marshallese:micronesians:hawaiians",all_programming_language_options:"python:c:c++:java:javascript:php:ruby:go:swift:kotlin:rust:haskell:erlang:lisp:scheme:prolog:cobol:fortran:pascal:delphi:d:eiffel:h:basic:visual_basic:smalltalk:objective-c:html5:node.js:vue.js:svelte:react:angular:ember:clipper:stex:arduino:brainfuck:r:assembly:mason:lepton:seacat:bbc_microbit:raspberry_pi_gpio:raspberry_pi_spi:raspberry_pi_i2c:raspberry_pi_uart:raspberry_pi_adc:raspberry_pi_ddio"}).forEach(([b,y])=>{console.log(`Key: ${b}, Value: ${y}`);function E(R){return R.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const v=E(b),S=new RegExp(v,"g");d=d.replace(S,y)});let _=d.split(":"),m=_[0],h=_[1]||"",f=[];_.length>2&&(f=_.slice(1));let g=await eC(m,h,f);g!==null&&(t[c]=g)}else{let u=await eC(d);u!==null&&(t[c]=u)}}let a=Promise.resolve();i.forEach(c=>{a=a.then(()=>o(c)).then(d=>{console.log(d)})}),a.then(()=>{Object.entries(t).forEach(([c,d])=>{console.log(`Key: ${c}, Value: ${d}`);function u(h){return h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const _=u(c),m=new RegExp(_,"g");n=n.replace(m,d)}),e(n)})}const uet={name:"PlayGroundView",data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},showSettings:!1,pending:!1,is_recording:!1,is_deaf_transcribing:!1,cpp_block:YN,html5_block:$N,LaTeX_block:WN,javascript_block:HN,json_block:qN,code_block:VN,python_block:zN,bash_block:KN,tokenize_icon:HZe,deaf_off:YZe,deaf_on:qZe,rec_off:WZe,rec_on:$Ze,loading_icon:jN,isSynthesizingVoice:!1,audio_url:null,mdRenderHeight:300,selecting_model:!1,tab_id:"source",generating:!1,isSpeaking:!1,voices:[],isLesteningToVoice:!1,presets:[],selectedPreset:"",cursorPosition:0,namedTokens:[],text:"",pre_text:"",post_text:"",temperature:.1,top_k:50,top_p:.9,repeat_penalty:1.3,repeat_last_n:50,n_crop:-1,n_predicts:2e3,seed:-1,silenceTimeout:5e3}},components:{Toast:ac,MarkdownRenderer:lp,ClipBoardTextInput:L0,TokensHilighter:PZe,ChatBarButton:GN,Card:pp,ToolbarButton:P0,DropdownMenu:rM},mounted(){Z.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)}),Ye.on("text_chunk",n=>{this.appendToOutput(n.chunk)}),Ye.on("text_generated",n=>{this.generating=!1}),Ye.on("generation_error",n=>{console.log("generation_error:",n),this.$refs.toast.showToast(`Error: ${n}`,4,!1),this.generating=!1}),Ye.on("connect",()=>{console.log("Connected to LoLLMs server"),this.$store.state.isConnected=!0,this.generating=!1}),Ye.on("buzzy",n=>{console.error("Server is busy. Wait for your turn",n),this.$refs.toast.showToast(`Error: ${n.message}`,4,!1),this.generating=!1}),Ye.on("generation_canceled",n=>{this.generating=!1,console.log("Generation canceled OK")}),this.$nextTick(()=>{Ve.replace()}),"speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0&&this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged)):console.error("Speech synthesis is not supported in this browser.")},created(){},watch:{audio_url(n){n&&(console.log("Audio changed url to :",n),this.$refs.audio_player.src=n)}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}},isTalking:{get(){return this.isSpeaking}}},methods:{triggerFileUpload(){this.$refs.fileInput.click()},handleFileUpload(n){this.file=this.$refs.fileInput.files[0],this.buttonText=this.file.name,this.uploadFile()},uploadFile(){console.log("sending file");const n=new FormData;n.append("file",this.file),Z.post("/upload_voice/",n,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{console.log(e),this.buttonText="Upload a voice"}).catch(e=>{console.error(e)})},addBlock(n){let e=this.$refs.mdTextarea.selectionStart,t=this.$refs.mdTextarea.selectionEnd;e==t?speechSynthesis==0||this.text[e-1]==` `?(this.text=this.text.slice(0,e)+"```"+n+"\n\n```\n"+this.text.slice(e),e=e+4+n.length):(this.text=this.text.slice(0,e)+"\n```"+n+"\n\n```\n"+this.text.slice(e),e=e+3+n.length):speechSynthesis==0||this.text[e-1]==` `?(this.text=this.text.slice(0,e)+"```"+n+` `+this.text.slice(e,t)+"\n```\n"+this.text.slice(t),e=e+4+n.length):(this.text=this.text.slice(0,e)+"\n```"+n+` `+this.text.slice(e,t)+"\n```\n"+this.text.slice(t),e=e+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},insertTab(n){const e=n.target,t=e.selectionStart,s=e.selectionEnd,i=e.value.substring(0,t),r=e.value.substring(s),o=i+" "+r;this.text=o,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4}),n.preventDefault()},mdTextarea_changed(){console.log("mdTextarea_changed"),this.cursorPosition=this.$refs.mdTextarea.selectionStart},mdTextarea_clicked(){console.log(`mdTextarea_clicked: ${this.$refs.mdTextarea.selectionStart}`),this.cursorPosition=this.$refs.mdTextarea.selectionStart},setModel(){this.selecting_model=!0,Z.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"model_name",setting_value:this.selectedModel}).then(n=>{console.log(n),n.status&&this.$refs.toast.showToast(`Model changed to ${this.selectedModel}`,4,!0),this.selecting_model=!1}).catch(n=>{this.$refs.toast.showToast(`Error ${n}`,4,!0),this.selecting_model=!1})},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){console.log("READING..."),this.isSynthesizingVoice=!0;let n=this.$refs.mdTextarea.selectionStart,e=this.$refs.mdTextarea.selectionEnd,t=this.text;n!=e&&(t=t.slice(n,e)),Z.post("./text2Wave",{client_id:this.$store.state.client_id,text:t}).then(s=>{console.log(s.data.url);let i=s.data.url;this.audio_url=i,this.isSynthesizingVoice=!1,Le(()=>{Ve.replace()})}).catch(s=>{this.$refs.toast.showToast(`Error: ${s}`,4,!1),this.isSynthesizingVoice=!1,Le(()=>{Ve.replace()})})},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log("voice on"),this.isSpeaking=!0;const e=200;this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this.$store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(i=>i.name===this.$store.state.config.audio_out_voice)[0]);const t=i=>{let r=this.text.substring(i,i+e);const o=[".","!","?",` -`];let a=-1;return o.forEach(c=>{const d=r.lastIndexOf(c);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+i+1},s=()=>{const i=t(n),r=this.text.substring(n,i);this.msg.text=r,n=i+1,this.msg.onend=o=>{n{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",i))},this.speechSynthesis.speak(this.msg)};s()},getCursorPosition(){return this.$refs.mdTextarea.selectionStart},appendToOutput(n){this.pre_text+=n,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let n=this.text.indexOf("@@");if(n<0){this.$refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,n)+this.text.substring(n+26,this.text.length),this.pre_text=this.text.substring(0,n),this.post_text=this.text.substring(n,this.text.length);var e=this.text.substring(0,n);console.log(e),qe.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},async tokenize_text(){const n=await Z.post("/lollms_tokenize",{prompt:this.text},{headers:this.posts_headers});console.log(n.data.named_tokens),this.namedTokens=n.data.named_tokens},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var n=this.text.substring(0,this.getCursorPosition());console.log(this.text),console.log(`cursor position :${this.getCursorPosition()}`),console.log(`pretext:${this.pre_text}`),console.log(`post_text:${this.post_text}`),console.log(`prompt:${n}`),qe.emit("generate_text",{prompt:n,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){qe.emit("cancel_text_generation",{})},exportText(){const n=this.text,e=document.createElement("a"),t=new Blob([n],{type:"text/plain"});e.href=URL.createObjectURL(t),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const n=document.getElementById("import-input");n&&(n.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const t=new FileReader;t.onload=()=>{this.text=t.result},t.readAsText(e.target.files[0])}else alert("Please select a file.")}),n.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=det(this.selectedPreset.content,n=>{console.log("Done"),console.log(n),this.text=n})},addPreset(){let n=prompt("Enter the title of the preset:");this.presets[n]={client_id:this.$store.state.client_id,name:n,content:this.text},Z.post("./add_preset",this.presets[n]).then(e=>{console.log(e.data)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){Z.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startRecording(){this.pending=!0,this.is_recording?Z.post("/stop_recording",{client_id:this.$store.state.client_id}).then(n=>{this.is_recording=!1,this.pending=!1,console.log(n),this.text+=n.data,console.log("text"),console.log(this.text),console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)}):Z.post("/start_recording",{client_id:this.$store.state.client_id}).then(n=>{this.is_recording=!0,this.pending=!1,console.log(n.data)}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startRecordingAndTranscribing(){this.pending=!0,this.is_deaf_transcribing?Z.get("/stop_recording").then(n=>{this.is_deaf_transcribing=!1,this.pending=!1,this.text=n.data.text,this.read()}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)}):Z.get("/start_recording").then(n=>{this.is_deaf_transcribing=!0,this.pending=!1}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length),this.recognition.onresult=n=>{this.generated="";for(let e=n.resultIndex;e{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,this.pre_text=this.pre_text+this.generated,this.cursorPosition=this.pre_text.length,clearTimeout(this.silenceTimer)},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")}}},pet={class:"container w-full background-color shadow-lg overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},fet={class:"container flex flex-row m-2 w-full"},_et={class:"flex-grow w-full m-2"},met={class:"flex panels-color gap-3 flex-1 items-center flex-grow flex-row rounded-md border-2 border-blue-300 m-2 p-4"},het={class:"flex items-center space-x-2"},get=["src"],bet=["src"],yet=["src"],Eet=["src"],vet=["src"],Tet={key:1,class:"w-6 h-6"},xet={class:"flex gap-3 flex-1 items-center flex-grow justify-end"},Cet={key:0},wet=["src"],Ret={key:2},Aet={key:0,class:"settings scrollbar bg-white dark:bg-gray-800 rounded-lg shadow-md p-6"},Net=["value"],Met={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},Oet=["value"],Iet={class:"slider-container ml-2 mr-2"},ket={class:"slider-value text-gray-500"},Det={class:"slider-container ml-2 mr-2"},Let={class:"slider-value text-gray-500"},Pet={class:"slider-container ml-2 mr-2"},Fet={class:"slider-value text-gray-500"},Uet={class:"slider-container ml-2 mr-2"},Bet={class:"slider-value text-gray-500"},Get={class:"slider-container ml-2 mr-2"},Vet={class:"slider-value text-gray-500"},zet={class:"slider-container ml-2 mr-2"},Het={class:"slider-value text-gray-500"},qet={class:"slider-container ml-2 mr-2"},Yet={class:"slider-value text-gray-500"},$et={class:"slider-container ml-2 mr-2"},Wet={class:"slider-value text-gray-500"};function Ket(n,e,t,s,i,r){const o=et("ChatBarButton"),a=et("ToolbarButton"),c=et("DropdownSubmenu"),d=et("DropdownMenu"),u=et("tokens-hilighter"),_=et("MarkdownRenderer"),m=et("Card"),h=et("Toast");return T(),w(Be,null,[l("div",pet,[l("div",fet,[l("div",_et,[l("div",met,[l("div",het,[D(z(o,{onClick:r.generate,title:"Generate from the current cursor position"},{icon:Ie(()=>e[54]||(e[54]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})],-1)])),_:1},8,["onClick"]),[[xt,!i.generating]]),D(z(o,{onClick:r.generate_in_placeholder,title:"Generate from the next placeholder"},{icon:Ie(()=>e[55]||(e[55]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"})],-1)])),_:1},8,["onClick"]),[[xt,!i.generating]]),D(z(o,{onClick:r.tokenize_text,title:"Tokenize the text"},{icon:Ie(()=>[l("img",{src:i.tokenize_icon,alt:"Tokenize",class:"h-5 w-5"},null,8,get)]),_:1},8,["onClick"]),[[xt,!i.generating]]),e[65]||(e[65]=l("span",{class:"w-80"},null,-1)),D(z(o,{onClick:r.stopGeneration,title:"Stop generation"},{icon:Ie(()=>e[56]||(e[56]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])),_:1},8,["onClick"]),[[xt,i.generating]]),z(o,{onClick:r.startSpeechRecognition,class:Ue({"text-red-500":n.isListeningToVoice}),title:"Dictate (using your browser's transcription)"},{icon:Ie(()=>e[57]||(e[57]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})],-1)])),_:1},8,["onClick","class"]),z(o,{onClick:r.speak,class:Ue({"text-red-500":r.isTalking}),title:"Convert text to audio (not saved, uses your browser's TTS service)"},{icon:Ie(()=>e[58]||(e[58]=[Ze(" 🪶 ")])),_:1},8,["onClick","class"]),z(o,{onClick:r.triggerFileUpload,title:"Upload a voice"},{icon:Ie(()=>e[59]||(e[59]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})],-1)])),_:1},8,["onClick"]),z(o,{onClick:r.startRecordingAndTranscribing,class:Ue({"text-green-500":i.isLesteningToVoice}),title:"Start audio to audio"},{icon:Ie(()=>[i.pending?(T(),w("img",{key:1,src:i.loading_icon,alt:"Loading",class:"h-5 w-5"},null,8,yet)):(T(),w("img",{key:0,src:i.is_deaf_transcribing?i.deaf_on:i.deaf_off,alt:"Deaf",class:"h-5 w-5"},null,8,bet))]),_:1},8,["onClick","class"]),z(o,{onClick:r.startRecording,class:Ue({"text-green-500":i.isLesteningToVoice}),title:"Start audio recording"},{icon:Ie(()=>[i.pending?(T(),w("img",{key:1,src:i.loading_icon,alt:"Loading",class:"h-5 w-5"},null,8,vet)):(T(),w("img",{key:0,src:i.is_recording?i.rec_on:i.rec_off,alt:"Record",class:"h-5 w-5"},null,8,Eet))]),_:1},8,["onClick","class"]),i.isSynthesizingVoice?(T(),w("div",Tet,e[61]||(e[61]=[l("svg",{class:"animate-spin h-5 w-5 text-secondary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[l("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),l("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)]))):(T(),at(o,{key:0,onClick:r.read,title:"Generate audio from text"},{icon:Ie(()=>e[60]||(e[60]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})],-1)])),_:1},8,["onClick"])),D(z(o,{onClick:r.exportText,title:"Export text"},{icon:Ie(()=>e[62]||(e[62]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})],-1)])),_:1},8,["onClick"]),[[xt,!i.generating]]),D(z(o,{onClick:r.importText,title:"Import text"},{icon:Ie(()=>e[63]||(e[63]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)])),_:1},8,["onClick"]),[[xt,!i.generating]]),z(o,{onClick:e[0]||(e[0]=f=>i.showSettings=!i.showSettings),title:"Settings"},{icon:Ie(()=>e[64]||(e[64]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])),_:1})]),l("input",{type:"file",ref:"fileInput",onChange:e[1]||(e[1]=(...f)=>r.handleFileUpload&&r.handleFileUpload(...f)),style:{display:"none"},accept:".wav"},null,544),l("div",xet,[l("button",{class:Ue(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":i.tab_id=="source"}]),onClick:e[2]||(e[2]=f=>i.tab_id="source")}," Source ",2),l("button",{class:Ue(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":i.tab_id=="render"}]),onClick:e[3]||(e[3]=f=>i.tab_id="render")}," Render ",2)]),e[66]||(e[66]=l("input",{type:"file",id:"import-input",class:"hidden"},null,-1))]),l("div",{class:Ue(["flex-grow m-2 p-2 border panels-color border-blue-300 rounded-md",{"border-red-500":i.generating}])},[i.tab_id==="source"?(T(),w("div",Cet,[z(d,{title:"Add Block"},{default:Ie(()=>[z(c,{title:"Programming Languages",icon:"code"},{default:Ie(()=>[z(a,{onClick:e[4]||(e[4]=K(f=>r.addBlock("python"),["stop"])),title:"Python",icon:"python"}),z(a,{onClick:e[5]||(e[5]=K(f=>r.addBlock("javascript"),["stop"])),title:"JavaScript",icon:"js"}),z(a,{onClick:e[6]||(e[6]=K(f=>r.addBlock("typescript"),["stop"])),title:"TypeScript",icon:"typescript"}),z(a,{onClick:e[7]||(e[7]=K(f=>r.addBlock("java"),["stop"])),title:"Java",icon:"java"}),z(a,{onClick:e[8]||(e[8]=K(f=>r.addBlock("c++"),["stop"])),title:"C++",icon:"cplusplus"}),z(a,{onClick:e[9]||(e[9]=K(f=>r.addBlock("csharp"),["stop"])),title:"C#",icon:"csharp"}),z(a,{onClick:e[10]||(e[10]=K(f=>r.addBlock("go"),["stop"])),title:"Go",icon:"go"}),z(a,{onClick:e[11]||(e[11]=K(f=>r.addBlock("rust"),["stop"])),title:"Rust",icon:"rust"}),z(a,{onClick:e[12]||(e[12]=K(f=>r.addBlock("swift"),["stop"])),title:"Swift",icon:"swift"}),z(a,{onClick:e[13]||(e[13]=K(f=>r.addBlock("kotlin"),["stop"])),title:"Kotlin",icon:"kotlin"}),z(a,{onClick:e[14]||(e[14]=K(f=>r.addBlock("r"),["stop"])),title:"R",icon:"r-project"})]),_:1}),z(c,{title:"Web Technologies",icon:"web"},{default:Ie(()=>[z(a,{onClick:e[15]||(e[15]=K(f=>r.addBlock("html"),["stop"])),title:"HTML",icon:"html5"}),z(a,{onClick:e[16]||(e[16]=K(f=>r.addBlock("css"),["stop"])),title:"CSS",icon:"css3"}),z(a,{onClick:e[17]||(e[17]=K(f=>r.addBlock("vue"),["stop"])),title:"Vue.js",icon:"vuejs"}),z(a,{onClick:e[18]||(e[18]=K(f=>r.addBlock("react"),["stop"])),title:"React",icon:"react"}),z(a,{onClick:e[19]||(e[19]=K(f=>r.addBlock("angular"),["stop"])),title:"Angular",icon:"angular"})]),_:1}),z(c,{title:"Markup and Data",icon:"file-code"},{default:Ie(()=>[z(a,{onClick:e[20]||(e[20]=K(f=>r.addBlock("xml"),["stop"])),title:"XML",icon:"xml"}),z(a,{onClick:e[21]||(e[21]=K(f=>r.addBlock("json"),["stop"])),title:"JSON",icon:"json"}),z(a,{onClick:e[22]||(e[22]=K(f=>r.addBlock("yaml"),["stop"])),title:"YAML",icon:"yaml"}),z(a,{onClick:e[23]||(e[23]=K(f=>r.addBlock("markdown"),["stop"])),title:"Markdown",icon:"markdown"}),z(a,{onClick:e[24]||(e[24]=K(f=>r.addBlock("latex"),["stop"])),title:"LaTeX",icon:"latex"})]),_:1}),z(c,{title:"Scripting and Shell",icon:"terminal"},{default:Ie(()=>[z(a,{onClick:e[25]||(e[25]=K(f=>r.addBlock("bash"),["stop"])),title:"Bash",icon:"bash"}),z(a,{onClick:e[26]||(e[26]=K(f=>r.addBlock("powershell"),["stop"])),title:"PowerShell",icon:"powershell"}),z(a,{onClick:e[27]||(e[27]=K(f=>r.addBlock("perl"),["stop"])),title:"Perl",icon:"perl"})]),_:1}),z(c,{title:"Diagramming",icon:"sitemap"},{default:Ie(()=>[z(a,{onClick:e[28]||(e[28]=K(f=>r.addBlock("mermaid"),["stop"])),title:"Mermaid",icon:"mermaid"}),z(a,{onClick:e[29]||(e[29]=K(f=>r.addBlock("graphviz"),["stop"])),title:"Graphviz",icon:"graphviz"}),z(a,{onClick:e[30]||(e[30]=K(f=>r.addBlock("plantuml"),["stop"])),title:"PlantUML",icon:"plantuml"})]),_:1}),z(c,{title:"Database",icon:"database"},{default:Ie(()=>[z(a,{onClick:e[31]||(e[31]=K(f=>r.addBlock("sql"),["stop"])),title:"SQL",icon:"sql"}),z(a,{onClick:e[32]||(e[32]=K(f=>r.addBlock("mongodb"),["stop"])),title:"MongoDB",icon:"mongodb"})]),_:1}),z(a,{onClick:e[33]||(e[33]=K(f=>r.addBlock(""),["stop"])),title:"Generic Block",icon:"code"})]),_:1}),z(a,{onClick:e[34]||(e[34]=K(f=>n.copyContentToClipboard(),["stop"])),title:"Copy message to clipboard",icon:"copy"}),D(l("textarea",{ref:"mdTextarea",onKeydown:e[35]||(e[35]=zs(K((...f)=>r.insertTab&&r.insertTab(...f),["prevent"]),["tab"])),class:"block min-h-500 p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",rows:4,style:Wt({minHeight:i.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[36]||(e[36]=f=>i.text=f),onClick:e[37]||(e[37]=K((...f)=>r.mdTextarea_clicked&&r.mdTextarea_clicked(...f),["prevent"])),onChange:e[38]||(e[38]=K((...f)=>r.mdTextarea_changed&&r.mdTextarea_changed(...f),["prevent"]))}," ",36),[[ue,i.text]]),l("span",null,"Cursor position "+W(i.cursorPosition),1)])):B("",!0),i.audio_url!=null?(T(),w("audio",{controls:"",key:i.audio_url},[l("source",{src:i.audio_url,type:"audio/wav",ref:"audio_player"},null,8,wet),e[67]||(e[67]=Ze(" Your browser does not support the audio element. "))])):B("",!0),z(u,{namedTokens:i.namedTokens},null,8,["namedTokens"]),i.tab_id==="render"?(T(),w("div",Ret,[z(_,{ref:"mdRender",client_id:this.$store.state.client_id,message_id:0,discussion_id:0,"markdown-text":i.text,class:"mt-4 p-2 rounded shadow-lg dark:bg-bg-dark"},null,8,["client_id","markdown-text"])])):B("",!0)],2)]),i.showSettings?(T(),w("div",Aet,[e[82]||(e[82]=l("h2",{class:"text-2xl font-bold text-gray-900 dark:text-white mb-4"},"Settings",-1)),z(m,{title:"Model",class:"slider-container ml-0 mr-0",isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[D(l("select",{"onUpdate:modelValue":e[39]||(e[39]=f=>this.$store.state.selectedModel=f),onChange:e[40]||(e[40]=(...f)=>r.setModel&&r.setModel(...f)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(T(!0),w(Be,null,Xe(r.models,f=>(T(),w("option",{key:f,value:f},W(f),9,Net))),128))],544),[[It,this.$store.state.selectedModel]]),i.selecting_model?(T(),w("div",Met,e[68]||(e[68]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Selecting model...")],-1)]))):B("",!0)]),_:1}),z(m,{title:"Presets",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[D(l("select",{"onUpdate:modelValue":e[41]||(e[41]=f=>i.selectedPreset=f),class:"bg-white dark:bg-black mb-2 border-2 rounded-md shadow-sm w-full"},[(T(!0),w(Be,null,Xe(i.presets,f=>(T(),w("option",{key:f,value:f},W(f.name),9,Oet))),128))],512),[[It,i.selectedPreset]]),e[73]||(e[73]=l("br",null,null,-1)),l("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[42]||(e[42]=(...f)=>r.setPreset&&r.setPreset(...f)),title:"Use preset"},e[69]||(e[69]=[l("i",{"data-feather":"check"},null,-1)])),l("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[43]||(e[43]=(...f)=>r.addPreset&&r.addPreset(...f)),title:"Add this text as a preset"},e[70]||(e[70]=[l("i",{"data-feather":"plus"},null,-1)])),l("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[44]||(e[44]=(...f)=>r.removePreset&&r.removePreset(...f)),title:"Remove preset"},e[71]||(e[71]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[45]||(e[45]=(...f)=>r.reloadPresets&&r.reloadPresets(...f)),title:"Reload presets list"},e[72]||(e[72]=[l("i",{"data-feather":"refresh-ccw"},null,-1)]))]),_:1}),z(m,{title:"Generation params",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[l("div",Iet,[e[74]||(e[74]=l("h3",{class:"text-gray-600"},"Temperature",-1)),D(l("input",{type:"range","onUpdate:modelValue":e[46]||(e[46]=f=>i.temperature=f),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[ue,i.temperature]]),l("span",ket,"Current value: "+W(i.temperature),1)]),l("div",Det,[e[75]||(e[75]=l("h3",{class:"text-gray-600"},"Top K",-1)),D(l("input",{type:"range","onUpdate:modelValue":e[47]||(e[47]=f=>i.top_k=f),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[ue,i.top_k]]),l("span",Let,"Current value: "+W(i.top_k),1)]),l("div",Pet,[e[76]||(e[76]=l("h3",{class:"text-gray-600"},"Top P",-1)),D(l("input",{type:"range","onUpdate:modelValue":e[48]||(e[48]=f=>i.top_p=f),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[ue,i.top_p]]),l("span",Fet,"Current value: "+W(i.top_p),1)]),l("div",Uet,[e[77]||(e[77]=l("h3",{class:"text-gray-600"},"Repeat Penalty",-1)),D(l("input",{type:"range","onUpdate:modelValue":e[49]||(e[49]=f=>i.repeat_penalty=f),min:"0",max:"5",step:"0.1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[ue,i.repeat_penalty]]),l("span",Bet,"Current value: "+W(i.repeat_penalty),1)]),l("div",Get,[e[78]||(e[78]=l("h3",{class:"text-gray-600"},"Repeat Last N",-1)),D(l("input",{type:"range","onUpdate:modelValue":e[50]||(e[50]=f=>i.repeat_last_n=f),min:"0",max:"100",step:"1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[ue,i.repeat_last_n]]),l("span",Vet,"Current value: "+W(i.repeat_last_n),1)]),l("div",zet,[e[79]||(e[79]=l("h3",{class:"text-gray-600"},"Number of tokens to crop the text to",-1)),D(l("input",{type:"number","onUpdate:modelValue":e[51]||(e[51]=f=>i.n_crop=f),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[ue,i.n_crop]]),l("span",Het,"Current value: "+W(i.n_crop),1)]),l("div",qet,[e[80]||(e[80]=l("h3",{class:"text-gray-600"},"Number of tokens to generate",-1)),D(l("input",{type:"number","onUpdate:modelValue":e[52]||(e[52]=f=>i.n_predicts=f),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[ue,i.n_predicts]]),l("span",Yet,"Current value: "+W(i.n_predicts),1)]),l("div",$et,[e[81]||(e[81]=l("h3",{class:"text-gray-600"},"Seed",-1)),D(l("input",{type:"number","onUpdate:modelValue":e[53]||(e[53]=f=>i.seed=f),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[ue,i.seed]]),l("span",Wet,"Current value: "+W(i.seed),1)])]),_:1})])):B("",!0)])]),z(h,{ref:"toast"},null,512)],64)}const jet=it(uet,[["render",Ket]]),Qet={data(){return{activeExtension:null}},computed:{activeExtensions(){return console.log(this.$store.state.extensionsZoo),console.log(YO(this.$store.state.extensionsZoo)),this.$store.state.extensionsZoo}},methods:{showExtensionPage(n){this.activeExtension=n}}},Xet={class:"container overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},Zet={key:0},Jet=["onClick"],ett={key:0},ttt=["src"],ntt={key:1};function stt(n,e,t,s,i,r){return T(),w("div",Xet,[r.activeExtensions.length>0?(T(),w("div",Zet,[(T(!0),w(Be,null,Xe(r.activeExtensions,o=>(T(),w("div",{key:o.name,onClick:a=>r.showExtensionPage(o)},[l("div",{class:Ue({"active-tab":o===i.activeExtension})},W(o.name),3)],8,Jet))),128)),i.activeExtension?(T(),w("div",ett,[l("iframe",{src:i.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,ttt)])):B("",!0)])):(T(),w("div",ntt,e[0]||(e[0]=[l("p",null,"No extension is active. Please install and activate an extension.",-1)])))])}const itt=it(Qet,[["render",stt]]),rtt={name:"HelpView"},ott={class:"help-view"};function att(n,e,t,s,i,r){return T(),w("div",ott,e[0]||(e[0]=[Pi("

Bienvenue dans l'aide de Lollms

**Lollms** (**L**ord **o**f **L**arge **L**anguage and **M**ultimodal **S**ystems), prononcé "lahms", est un outil puissant qui vous permet d'interagir avec une variété de modèles de langage et multimodaux. Il a été créé par **ParisNeo**, un expert en IA et en robotique passionné de programmation depuis son enfance, dans le but de rendre les modèles d'IA accessibles à tous, gratuitement. Son slogan : **"Un outil pour tous les gouverner"**. [1, 2]

Composants clés de Lollms

  • Liaisons : Essentiellement du code Python, les liaisons sont des modules intermédiaires permettant à Lollms d'interagir avec différents modèles d'IA. Elles agissent comme des ponts entre l'interface utilisateur de Lollms et les bibliothèques logicielles qui exécutent ces modèles. [3-5]
  • Services : Lollms s'appuie sur des services supplémentaires créés par des développeurs tiers. Ces services, souvent open source, étendent les fonctionnalités de Lollms. Parmi eux, on trouve : [6]
    • **Services LLM :** tels qu'ollama et vllm, dédiés à la génération de texte.
    • **Génération d'images :** comme Stable Diffusion, pour créer des images à partir de descriptions textuelles.
    • **Synthèse vocale :** comme Xtts, permettant de convertir du texte en parole.
  • Modèles : Au cœur de Lollms se trouvent les modèles de langage. Ces modèles, formés sur d'énormes ensembles de données textuelles, sont capables de : [6-8]
    • Générer du texte cohérent et contextuel.
    • Traduire des langues avec une précision remarquable.
    • Produire différents types de contenu créatif, tels que des poèmes, du code et des scripts.
    • Fournir des réponses informatives à vos questions.
    La taille d'un modèle est un facteur déterminant de ses performances : plus le modèle est grand (c'est-à-dire plus il possède de paramètres), plus ses capacités sont généralement avancées. [8, 9]
  • Personnalités : Donnez vie à Lollms grâce aux personnalités. Ces agents virtuels, dotés de caractéristiques et de styles de communication uniques, sont créés par le biais de deux méthodes principales : [10, 11]
    • **Conditionnement de texte :** On fournit au modèle des exemples de conversations représentatifs de la personnalité souhaitée, l'entraînant à imiter ce style.
    • **Code Python personnalisé :** Des scripts Python permettent de définir des comportements plus complexes et d'intégrer des fonctionnalités spécifiques à une personnalité.
    Avec plus de 250 personnalités disponibles, couvrant des domaines allant de la science à la fiction, vous trouverez forcément celle qui correspond à vos besoins. [10, 12, 13]

Fonctionnalités de Lollms

Lollms offre un éventail impressionnant de fonctionnalités :

  • **Génération de texte :** Écrivez des histoires, des articles, des poèmes et plus encore.
  • **Traduction linguistique :** Brisez les barrières linguistiques en traduisant du texte dans différentes langues.
  • **Écriture créative :** Explorez votre côté artistique en générant des scripts, des poèmes et des paroles de chansons.
  • **Réponse aux questions :** Obtenez des réponses à vos questions en puisant dans les connaissances des modèles de langage.
  • **Génération d'images :** Créez des images uniques à partir de descriptions textuelles.
  • **Synthèse vocale :** Donnez une voix à vos textes grâce à la synthèse vocale.
  • **Exécution de code :** Générez et exécutez du code dans différents langages de programmation.
  • **Intégration Web :** Intégrez Lollms à vos projets web pour des fonctionnalités dynamiques.
  • **Et bien plus encore! :** Lollms est en constante évolution, avec de nouvelles fonctionnalités ajoutées régulièrement.
",7)]))}const ltt=it(rtt,[["render",att]]);function si(n,e=!0,t=1){const s=e?1e3:1024;if(Math.abs(n)=s&&r{Ve.replace()})},executeCommand(n){this.isMenuOpen=!1,console.log("Selected"),console.log(n.value),typeof n.value=="function"&&(console.log("Command detected",n),n.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(n))},positionMenu(){var n;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),t=window.innerHeight;n=e.bottom>t/2}else this.force_position==1?n=!0:n=!1;this.menuPosition.top=n?"auto":"calc(100% + 10px)",this.menuPosition.bottom=n?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),Le(()=>{Ve.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},dtt={class:"menu-container"},utt=["title"],ptt=["src"],ftt=["data-feather"],_tt={key:2,class:"w-5 h-5"},mtt={key:3,"data-feather":"menu"},htt={class:"flex-grow menu-ul"},gtt=["onClick"],btt={key:0,"data-feather":"check"},ytt=["src","alt"],Ett=["data-feather"],vtt={key:3,class:"menu-icon"};function Stt(n,e,t,s,i,r){return T(),w("div",dtt,[l("button",{onClick:e[0]||(e[0]=K((...o)=>r.toggleMenu&&r.toggleMenu(...o),["prevent"])),title:t.title,class:Ue([t.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[t.icon&&!t.icon.includes("#")&&!t.icon.includes("feather")?(T(),w("img",{key:0,src:t.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,ptt)):t.icon&&t.icon.includes("feather")?(T(),w("i",{key:1,"data-feather":t.icon.split(":")[1],class:"w-5 h-5"},null,8,ftt)):t.icon&&t.icon.includes("#")?(T(),w("p",_tt,W(t.icon.split("#")[1]),1)):(T(),w("i",mtt))],10,utt),z(Ii,{name:"slide"},{default:Ie(()=>[i.isMenuOpen?(T(),w("div",{key:0,class:"menu-list flex-grow",style:Wt(i.menuPosition),ref:"menu"},[l("ul",htt,[(T(!0),w(Be,null,Xe(t.commands,(o,a)=>(T(),w("li",{key:a,onClick:K(c=>r.executeCommand(o),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[t.selected_entry==o.name?(T(),w("i",btt)):o.icon&&!o.icon.includes("feather")&&!o.is_file?(T(),w("img",{key:1,src:o.icon,alt:o.name,class:"menu-icon"},null,8,ytt)):B("",!0),o.icon&&o.icon.includes("feather")&&!o.is_file?(T(),w("i",{key:2,"data-feather":o.icon.split(":")[1],class:"mr-2"},null,8,Ett)):(T(),w("span",vtt)),l("span",null,W(o.name),1)],8,gtt))),128))])],4)):B("",!0)]),_:1})])}const q0=it(ctt,[["render",Stt]]),Ttt={components:{InteractiveMenu:q0},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){Le(()=>{Ve.replace()})},methods:{formatFileSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(n){return si(n)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?Ls:this.model.icon},defaultImg(n){n.target.src=Ls},install(){this.onInstall(this)},uninstall(){this.isInstalled&&this.onUninstall(this)},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(n){if(console.log("event.target.tagName.toLowerCase()"),console.log(n.target.tagName.toLowerCase()),n.target.tagName.toLowerCase()==="button"||n.target.tagName.toLowerCase()==="svg"){n.stopPropagation();return}this.onSelected(this),this.model.selected=!0,Le(()=>{Ve.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this),this.installing=!1},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let n=[{name:this.model.isInstalled?"Install Extra":"Install",icon:"feather:settings",is_file:!1,value:this.install},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.model.isInstalled&&n.push({name:"UnInstall",icon:"feather:settings",is_file:!1,value:this.uninstall}),this.selected&&n.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),n},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const n=this.model.variants[0].size;return this.formatFileSize(n)}return null}},speed_computed(){return si(this.speed)},total_size_computed(){return si(this.total_size)},downloaded_size_computed(){return si(this.downloaded_size)}},watch:{linkNotValid(){Le(()=>{Ve.replace()})}}},xtt=["title"],Ctt={key:0,class:"flex flex-row"},wtt={class:"max-w-[300px] overflow-x-auto"},Rtt={class:"flex gap-3 items-center grow"},Att=["href"],Ntt=["src"],Mtt={class:"flex-1 overflow-hidden"},Ott={class:"font-bold font-large text-lg truncate"},Itt={key:1,class:"flex items-center flex-row gap-2 my-1"},ktt={class:"flex grow items-center"},Dtt={key:2,class:"absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center"},Ltt={class:"relative flex flex-col items-center justify-center flex-grow h-full"},Ptt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},Ftt={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},Utt={class:"flex justify-between mb-1"},Btt={class:"text-sm font-medium text-blue-700 dark:text-white"},Gtt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Vtt={class:"flex justify-between mb-1"},ztt={class:"text-base font-medium text-blue-700 dark:text-white"},Htt={class:"text-sm font-medium text-blue-700 dark:text-white"},qtt={class:"flex flex-grow"},Ytt={class:"flex flex-row flex-grow gap-3"},$tt={class:"p-2 text-center grow"},Wtt={key:3},Ktt={class:"flex flex-row items-center gap-3"},jtt=["src"],Qtt={class:"font-bold font-large text-lg truncate"},Xtt={class:"flex items-center flex-row-reverse gap-2 my-1"},Ztt={class:"flex flex-row items-center"},Jtt={key:0,class:"text-base text-red-600 flex items-center mt-1"},ent=["title"],tnt={class:""},nnt={class:"flex flex-row items-center"},snt=["href","title"],int={class:"flex items-center"},rnt={class:"flex items-center"},ont={key:0,class:"flex items-center"},ant=["href"],lnt={class:"flex items-center"},cnt=["href"],dnt={class:"flex items-center"},unt={class:"flex items-center"},pnt=["href"];function fnt(n,e,t,s,i,r){const o=et("InteractiveMenu");return T(),w("div",{class:Ue(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",r.computed_classes]),title:t.model.name,onClick:e[10]||(e[10]=K(a=>r.toggleSelected(a),["prevent"]))},[t.model.isCustomModel?(T(),w("div",Ctt,[l("div",wtt,[l("div",Rtt,[l("a",{href:t.model.model_creator_link,target:"_blank"},[l("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,Ntt)],8,Att),l("div",Mtt,[l("h3",Ott,W(t.model.name),1)])])])])):B("",!0),t.model.isCustomModel?(T(),w("div",Itt,[l("div",ktt,[l("button",{type:"button",title:"Custom model / local model",class:"font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=K(()=>{},["stop"]))},e[11]||(e[11]=[l("i",{"data-feather":"box",class:"w-5"},null,-1),l("span",{class:"sr-only"},"Custom model / local model",-1)])),e[12]||(e[12]=Ze(" Custom model "))]),l("div",null,[t.model.isInstalled?(T(),w("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=K((...a)=>r.uninstall&&r.uninstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},e[13]||(e[13]=[Ze(" Uninstall "),l("span",{class:"sr-only"},"Remove",-1)]))):B("",!0)])])):B("",!0),i.installing?(T(),w("div",Dtt,[l("div",Ltt,[e[15]||(e[15]=l("div",{role:"status",class:"justify-center"},[l("svg",{"aria-hidden":"true",class:"w-24 h-24 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)),l("div",Ptt,[l("div",Ftt,[l("div",Utt,[e[14]||(e[14]=l("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1)),l("span",Btt,W(Math.floor(i.progress))+"%",1)]),l("div",Gtt,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Wt({width:i.progress+"%"})},null,4)]),l("div",Vtt,[l("span",ztt,"Download speed: "+W(r.speed_computed)+"/s",1),l("span",Htt,W(r.downloaded_size_computed)+"/"+W(r.total_size_computed),1)])])]),l("div",qtt,[l("div",Ytt,[l("div",$tt,[l("button",{onClick:e[3]||(e[3]=K((...a)=>r.toggleCancelInstall&&r.toggleCancelInstall(...a),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])])):B("",!0),t.model.isCustomModel?B("",!0):(T(),w("div",Wtt,[l("div",Ktt,[l("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=a=>r.defaultImg(a)),class:Ue(["w-10 h-10 rounded-lg object-fill",i.linkNotValid?"grayscale":""])},null,42,jtt),l("h3",Qtt,W(t.model.name),1),e[16]||(e[16]=l("div",{class:"grow"},null,-1)),z(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),l("div",Xtt,[l("div",Ztt,[i.linkNotValid?(T(),w("div",Jtt,e[17]||(e[17]=[l("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),Ze(" Link is not valid ")]))):B("",!0)])]),l("div",{class:"",title:t.model.isInstalled?t.model.name:"Not installed"},[l("div",tnt,[l("div",nnt,[e[19]||(e[19]=l("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1)),e[20]||(e[20]=l("b",null,"Card: ",-1)),l("a",{href:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name,target:"_blank",onClick:e[5]||(e[5]=K(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:i.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,snt),e[21]||(e[21]=l("div",{class:"grow"},null,-1)),l("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[6]||(e[6]=K(a=>r.toggleCopyLink(),["stop"]))},e[18]||(e[18]=[l("i",{"data-feather":"clipboard",class:"w-5"},null,-1)]))]),l("div",int,[l("div",{class:Ue(["flex flex-shrink-0 items-center",i.linkNotValid?"text-red-600":""])},[e[22]||(e[22]=l("i",{"data-feather":"file",class:"w-5 m-1"},null,-1)),e[23]||(e[23]=l("b",null,"File size: ",-1)),Ze(" "+W(r.fileSize),1)],2)]),l("div",rnt,[e[24]||(e[24]=l("i",{"data-feather":"key",class:"w-5 m-1"},null,-1)),e[25]||(e[25]=l("b",null,"License: ",-1)),Ze(" "+W(t.model.license),1)]),t.model.quantizer!="None"&&t.model.type!="transformers"?(T(),w("div",ont,[e[26]||(e[26]=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1)),e[27]||(e[27]=l("b",null,"quantizer: ",-1)),l("a",{href:"https://huggingface.co/"+t.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=K(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(t.model.quantizer),9,ant)])):B("",!0),l("div",lnt,[e[28]||(e[28]=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1)),e[29]||(e[29]=l("b",null,"Model creator: ",-1)),l("a",{href:t.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=K(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(t.model.model_creator),9,cnt)]),l("div",dnt,[e[30]||(e[30]=l("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1)),e[31]||(e[31]=l("b",null,"Release date: ",-1)),Ze(" "+W(t.model.last_commit_time),1)]),l("div",unt,[e[32]||(e[32]=l("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1)),e[33]||(e[33]=l("b",null,"Category: ",-1)),l("a",{href:"https://huggingface.co/"+t.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=K(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(t.model.category),9,pnt)])])],8,ent)]))],10,xtt)}const _nt=it(Ttt,[["render",fnt]]),mnt={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",personalityCategory:"Category",disclaimer:"Disclaimer text",conditioningText:"Conditioning Text",aiPrefix:"AI Prefix",userPrefix:"User Prefix",antipromptsList:[{id:1,text:"Antiprompt 1"},{id:2,text:"Antiprompt 2"},{id:3,text:"Antiprompt 3"}]}},methods:{commitChanges(){console.log("Personality changes committed"),this.editMode=!1}}},hnt={class:"p-4"},gnt={class:"flex items-center mb-4"},bnt=["src"],ynt={class:"text-lg font-semibold"},Ent={key:0};function vnt(n,e,t,s,i,r){return T(),w("div",hnt,[l("div",gnt,[l("img",{src:i.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,bnt),l("h2",ynt,W(i.personalityName),1)]),l("p",null,[e[2]||(e[2]=l("strong",null,"Author:",-1)),Ze(" "+W(i.personalityAuthor),1)]),l("p",null,[e[3]||(e[3]=l("strong",null,"Description:",-1)),Ze(" "+W(i.personalityDescription),1)]),l("p",null,[e[4]||(e[4]=l("strong",null,"Category:",-1)),Ze(" "+W(i.personalityCategory),1)]),i.disclaimer?(T(),w("p",Ent,[e[5]||(e[5]=l("strong",null,"Disclaimer:",-1)),Ze(" "+W(i.disclaimer),1)])):B("",!0),l("p",null,[e[6]||(e[6]=l("strong",null,"Conditioning Text:",-1)),Ze(" "+W(i.conditioningText),1)]),l("p",null,[e[7]||(e[7]=l("strong",null,"AI Prefix:",-1)),Ze(" "+W(i.aiPrefix),1)]),l("p",null,[e[8]||(e[8]=l("strong",null,"User Prefix:",-1)),Ze(" "+W(i.userPrefix),1)]),l("div",null,[e[9]||(e[9]=l("strong",null,"Antiprompts:",-1)),l("ul",null,[(T(!0),w(Be,null,Xe(i.antipromptsList,o=>(T(),w("li",{key:o.id},W(o.text),1))),128))])]),l("button",{onClick:e[0]||(e[0]=o=>i.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),i.editMode?(T(),w("button",{key:1,onClick:e[1]||(e[1]=(...o)=>r.commitChanges&&r.commitChanges(...o)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):B("",!0)])}const Snt=it(mnt,[["render",vnt]]),mp="/assets/logo-CQZwS0X1.svg",Tnt="/",xnt={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onOpenFolder:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function,onToggleFavorite:Function},components:{InteractiveMenu:q0},data(){return{isMounted:!1,name:this.personality.name,thumbnailVisible:!1,thumbnailPosition:{x:0,y:0}}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return console.log("this.category",this.personality.category),this.personality.category=="custom_personalities"?n.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):n.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.personality.has_scripts&&n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,Le(()=>{Ve.replace()})},methods:{formatDate(n){const e={year:"numeric",month:"short",day:"numeric"};return new Date(n).toLocaleDateString(void 0,e)},showThumbnail(){this.thumbnailVisible=!0},hideThumbnail(){this.thumbnailVisible=!1},updateThumbnailPosition(n){this.thumbnailPosition={x:n.clientX+10,y:n.clientY+10}},getImgUrl(){return Tnt+this.personality.avatar},defaultImg(n){n.target.src=mp},toggleFavorite(){this.onToggleFavorite(this)},showFolder(){this.onOpenFolder(this)},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.isMounted=!1},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Le(()=>{Ve.replace()})}}},Cnt=["title"],wnt={class:"flex-grow"},Rnt={class:"flex items-center mb-4"},Ant=["src"],Nnt={class:"text-sm text-gray-600"},Mnt={class:"text-sm text-gray-600"},Ont={class:"text-sm text-gray-600"},Int={key:0,class:"text-sm text-gray-600"},knt={key:1,class:"text-sm text-gray-600"},Dnt={class:"mb-4"},Lnt=["innerHTML"],Pnt={class:"mt-auto pt-4 border-t"},Fnt={class:"flex justify-between items-center flex-wrap"},Unt=["title"],Bnt=["fill"],Gnt=["src"];function Vnt(n,e,t,s,i,r){const o=et("InteractiveMenu");return T(),w("div",{class:Ue(["personality-card bg-white border rounded-xl shadow-lg p-6 hover:shadow-xl transition duration-300 ease-in-out flex flex-col h-full",r.selected_computed?"border-primary-light":"border-transparent",i.isMounted?"bg-blue-200 dark:bg-blue-700":""]),title:t.personality.installed?"":"Not installed"},[l("div",wnt,[l("div",Rnt,[l("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),alt:"Personality Icon",class:"w-16 h-16 rounded-full border border-gray-300 mr-4 cursor-pointer",onClick:e[1]||(e[1]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),onMouseover:e[2]||(e[2]=(...a)=>r.showThumbnail&&r.showThumbnail(...a)),onMousemove:e[3]||(e[3]=(...a)=>r.updateThumbnailPosition&&r.updateThumbnailPosition(...a)),onMouseleave:e[4]||(e[4]=(...a)=>r.hideThumbnail&&r.hideThumbnail(...a))},null,40,Ant),l("div",null,[l("h3",{class:"font-bold text-xl text-gray-800 cursor-pointer",onClick:e[5]||(e[5]=(...a)=>r.toggleSelected&&r.toggleSelected(...a))},W(t.personality.name),1),l("p",Nnt,"Author: "+W(t.personality.author),1),l("p",Mnt,"Version: "+W(t.personality.version),1),l("p",Ont,"Category: "+W(t.personality.category),1),t.personality.creation_date?(T(),w("p",Int,"Creation Date: "+W(r.formatDate(t.personality.creation_date)),1)):B("",!0),t.personality.last_update_date?(T(),w("p",knt,"Last update Date: "+W(r.formatDate(t.personality.last_update_date)),1)):B("",!0)])]),l("div",Dnt,[e[10]||(e[10]=l("h4",{class:"font-semibold mb-1 text-gray-700"},"Description:",-1)),l("p",{class:"text-sm text-gray-600 h-20 overflow-y-auto",innerHTML:t.personality.description},null,8,Lnt)])]),l("div",Pnt,[l("div",Fnt,[l("button",{onClick:e[6]||(e[6]=(...a)=>r.toggleFavorite&&r.toggleFavorite(...a)),class:"text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out",title:n.isFavorite?"Remove from favorites":"Add to favorites"},[(T(),w("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:n.isFavorite?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor"},e[11]||(e[11]=[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),8,Bnt))],8,Unt),i.isMounted?(T(),w("button",{key:0,onClick:e[7]||(e[7]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"text-blue-500 hover:text-blue-600 transition duration-300 ease-in-out",title:"Select"},e[12]||(e[12]=[l("i",{"data-feather":"check",class:"h-6 w-6"},null,-1)]))):B("",!0),i.isMounted?(T(),w("button",{key:1,onClick:e[8]||(e[8]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),class:"text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Talk"},e[13]||(e[13]=[l("i",{"data-feather":"send",class:"h-6 w-6"},null,-1)]))):B("",!0),l("button",{onClick:e[9]||(e[9]=(...a)=>r.showFolder&&r.showFolder(...a)),class:"text-purple-500 hover:text-purple-600 transition duration-300 ease-in-out",title:"Show Folder"},e[14]||(e[14]=[l("i",{"data-feather":"folder",class:"h-6 w-6"},null,-1)])),z(o,{commands:r.commandsList,force_position:2,title:"Menu",class:"text-gray-500 hover:text-gray-600 transition duration-300 ease-in-out"},null,8,["commands"])])]),i.thumbnailVisible?(T(),w("div",{key:0,style:Wt({top:i.thumbnailPosition.y+"px",left:i.thumbnailPosition.x+"px"}),class:"fixed z-50 w-20 h-20 rounded-full overflow-hidden"},[l("img",{src:r.getImgUrl(),class:"w-full h-full object-fill"},null,8,Gnt)],4)):B("",!0)],10,Cnt)}const Y0=it(xnt,[["render",Vnt]]),znt={name:"DynamicUIRenderer",props:{ui:{type:String,required:!0},instanceId:{type:String,required:!0}},data(){return{containerId:`dynamic-ui-${this.instanceId}`}},watch:{ui:{immediate:!0,handler(n){console.log(`UI prop changed for instance ${this.instanceId}:`,n),this.$nextTick(()=>{this.renderContent()})}}},methods:{renderContent(){console.log(`Rendering content for instance ${this.instanceId}...`);const n=this.$refs.container,t=new DOMParser().parseFromString(this.ui,"text/html"),s=t.getElementsByTagName("style");Array.from(s).forEach(r=>{const o=document.createElement("style");o.textContent=this.scopeCSS(r.textContent),document.head.appendChild(o)}),n.innerHTML=t.body.innerHTML;const i=t.getElementsByTagName("script");Array.from(i).forEach(r=>{const o=document.createElement("script");o.textContent=r.textContent,n.appendChild(o)})},scopeCSS(n){return n.replace(/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,`#${this.containerId} $1$2`)}}},Hnt=["id"];function qnt(n,e,t,s,i,r){return T(),w("div",{id:i.containerId,ref:"container"},null,8,Hnt)}const oM=it(znt,[["render",qnt]]),Ynt="/",$nt={components:{DynamicUIRenderer:oM},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){Le(()=>{Ve.replace()})},methods:{copyToClipBoard(n){console.log("Copying to clipboard :",n),navigator.clipboard.writeText(n)},getImgUrl(){return Ynt+this.binding.icon},defaultImg(n){n.target.src=mp},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){Le(()=>{Ve.replace()})}}},Wnt=["title"],Knt={class:"flex flex-row items-center gap-3"},jnt=["src"],Qnt={class:"font-bold font-large text-lg truncate"},Xnt={class:"flex-none gap-1"},Znt={class:"flex items-center flex-row-reverse gap-2 my-1"},Jnt={class:""},est={class:""},tst={class:"flex items-center"},nst={class:"flex items-center"},sst={class:"flex items-center"},ist={class:"flex items-center"},rst=["href"],ost=["title","innerHTML"];function ast(n,e,t,s,i,r){const o=et("DynamicUIRenderer");return T(),w("div",{class:Ue(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",t.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[8]||(e[8]=K((...a)=>r.toggleSelected&&r.toggleSelected(...a),["stop"])),title:t.binding.installed?t.binding.name:"Not installed"},[l("div",null,[l("div",Knt,[l("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,jnt),l("h3",Qnt,W(t.binding.name),1),e[10]||(e[10]=l("div",{class:"grow"},null,-1)),l("div",Xnt,[t.selected?(T(),w("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>r.toggleReloadBinding&&r.toggleReloadBinding(...a)),e[2]||(e[2]=K(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},e[9]||(e[9]=[l("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),l("span",{class:"sr-only"},"Help",-1)]))):B("",!0)])]),l("div",Znt,[t.binding.installed?B("",!0):(T(),w("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=K((...a)=>r.toggleInstall&&r.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},e[11]||(e[11]=[Ze(" Install "),l("span",{class:"sr-only"},"Click to install",-1)]))),t.binding.installed?(T(),w("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=K((...a)=>r.toggleReinstall&&r.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},e[12]||(e[12]=[Ze(" Reinstall "),l("span",{class:"sr-only"},"Reinstall",-1)]))):B("",!0),t.binding.installed?(T(),w("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=K((...a)=>r.toggleUnInstall&&r.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},e[13]||(e[13]=[Ze(" Uninstall "),l("span",{class:"sr-only"},"UnInstall",-1)]))):B("",!0),t.selected?(T(),w("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=K((...a)=>r.toggleSettings&&r.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},e[14]||(e[14]=[Ze(" Settings "),l("span",{class:"sr-only"},"Settings",-1)]))):B("",!0)]),t.binding.ui?(T(),at(o,{key:0,class:"w-full h-full",code:t.binding.ui},null,8,["code"])):B("",!0),l("div",Jnt,[l("div",est,[l("div",tst,[e[15]||(e[15]=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1)),e[16]||(e[16]=l("b",null,"Author: ",-1)),Ze(" "+W(t.binding.author),1)]),l("div",nst,[e[18]||(e[18]=l("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1)),e[19]||(e[19]=l("b",null,"Folder: ",-1)),Ze(" "+W(t.binding.folder)+" ",1),e[20]||(e[20]=l("div",{class:"grow"},null,-1)),l("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[7]||(e[7]=K(a=>r.copyToClipBoard(this.binding.folder),["stop"]))},e[17]||(e[17]=[l("i",{"data-feather":"clipboard",class:"w-5"},null,-1)]))]),l("div",sst,[e[21]||(e[21]=l("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1)),e[22]||(e[22]=l("b",null,"Version: ",-1)),Ze(" "+W(t.binding.version),1)]),l("div",ist,[e[23]||(e[23]=l("i",{"data-feather":"github",class:"w-5 m-1"},null,-1)),e[24]||(e[24]=l("b",null,"Link: ",-1)),l("a",{href:t.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},W(t.binding.link),9,rst)])]),e[25]||(e[25]=l("div",{class:"flex items-center"},[l("i",{"data-feather":"info",class:"w-5 m-1"}),l("b",null,"Description: "),l("br")],-1)),l("p",{class:"mx-1 opacity-80 line-clamp-3",title:t.binding.description,innerHTML:t.binding.description},null,8,ost)])])],10,Wnt)}const lst=it($nt,[["render",ast]]),cst={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(n=>{this.resolve=n})},hide(n){this.show=!1,this.resolve&&(this.resolve(n),this.resolve=null)},showDialog(n){return new Promise(e=>{this.model_path=n,this.show=!0,this.resolve=e})}}},dst={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},ust={class:"relative w-full max-w-md max-h-full"},pst={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},fst={class:"p-4 text-center"},_st={class:"p-4 text-center mx-auto mb-4"};function mst(n,e,t,s,i,r){return i.show?(T(),w("div",dst,[l("div",ust,[l("div",pst,[l("button",{type:"button",onClick:e[0]||(e[0]=o=>r.hide(!1)),class:"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[4]||(e[4]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),l("span",{class:"sr-only"},"Close modal",-1)])),l("div",fst,[e[6]||(e[6]=l("svg",{"aria-hidden":"true",class:"mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),l("div",_st,[e[5]||(e[5]=l("label",{class:"mr-2"},"Model path",-1)),D(l("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>i.model_path=o),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[ue,i.model_path]])]),l("button",{onClick:e[2]||(e[2]=o=>r.hide(!0)),type:"button",class:"text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"}," Add "),l("button",{onClick:e[3]||(e[3]=o=>r.hide(!1)),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},"No, cancel")])])])])):B("",!0)}const hst=it(cst,[["render",mst]]),gst={props:{show:{type:Boolean,default:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(n){return typeof n=="string"?n:n&&n.name?n.name:""},selectChoice(n){this.selectedChoice=n,this.$emit("choice-selected",n)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(n){const e=["bytes","KB","MB","GB"];let t=0;for(;n>=1024&&t[t.show?(T(),w("div",bst,[l("div",yst,[l("h2",Est,[e[5]||(e[5]=l("svg",{class:"w-6 h-6 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})],-1)),Ze(" "+W(t.title),1)]),l("div",vst,[l("ul",null,[(T(!0),w(Be,null,Xe(t.choices,(o,a)=>(T(),w("li",{key:a,class:"py-2 px-4 hover:bg-gray-200 dark:hover:bg-gray-600 transition duration-150 ease-in-out"},[l("div",Sst,[l("div",Tst,[o.isEditing?D((T(),w("input",{key:1,"onUpdate:modelValue":c=>o.editName=c,onBlur:c=>r.finishEditing(o),onKeyup:zs(c=>r.finishEditing(o),["enter"]),class:"bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded px-2 py-1 text-sm",autofocus:""},null,40,Cst)),[[ue,o.editName]]):(T(),w("span",{key:0,onClick:c=>r.selectChoice(o),class:Ue([{"font-semibold":o===i.selectedChoice},"text-gray-800 dark:text-white cursor-pointer"])},W(r.displayName(o)),11,xst)),o.size?(T(),w("span",wst,W(r.formatSize(o.size)),1)):B("",!0)]),l("div",Rst,[l("button",{onClick:c=>r.editChoice(o),class:"text-blue-500 hover:text-blue-600 mr-2"},e[6]||(e[6]=[l("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})],-1)]),8,Ast),t.can_remove?(T(),w("button",{key:0,onClick:c=>r.removeChoice(o,a),class:"text-red-500 hover:text-red-600"},e[7]||(e[7]=[l("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,Nst)):B("",!0)])])]))),128))])]),i.showInput?(T(),w("div",Mst,[D(l("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>i.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 dark:border-gray-600 p-2 rounded-lg w-full mb-2 bg-white dark:bg-gray-700 text-gray-800 dark:text-white"},null,512),[[ue,i.newFilename]]),l("button",{onClick:e[1]||(e[1]=(...o)=>r.addNewFilename&&r.addNewFilename(...o)),class:"bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded-lg transition duration-300"}," Add ")])):B("",!0),l("div",Ost,[l("button",{onClick:e[2]||(e[2]=(...o)=>r.closeDialog&&r.closeDialog(...o)),class:"bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded-lg transition duration-300"}," Cancel "),l("button",{onClick:e[3]||(e[3]=(...o)=>r.validateChoice&&r.validateChoice(...o)),disabled:!i.selectedChoice,class:Ue([{"bg-blue-500 hover:bg-blue-600":i.selectedChoice,"bg-gray-400 cursor-not-allowed":!i.selectedChoice},"text-white font-bold py-2 px-4 rounded-lg transition duration-300"])}," Validate ",10,Ist),l("button",{onClick:e[4]||(e[4]=(...o)=>r.toggleInput&&r.toggleInput(...o)),class:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg transition duration-300"}," Add New ")])])])):B("",!0)]),_:1})}const $0=it(gst,[["render",kst],["__scopeId","data-v-f43216be"]]),Dst={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:"0"}},data(){return{selectedValue:this.defaultValue}},computed:{selectedLabel(){const n=this.radioOptions.find(e=>e.value===this.selectedValue);return n?n.label:""}},watch:{selectedValue(n,e){this.$emit("radio-selected",n)}},methods:{handleRadioChange(){}}},Lst={class:"flex space-x-4"},Pst=["value","aria-checked"],Fst={class:"text-gray-700"};function Ust(n,e,t,s,i,r){return T(),w("div",Lst,[(T(!0),w(Be,null,Xe(t.radioOptions,(o,a)=>(T(),w("label",{key:o.value,class:"flex items-center space-x-2"},[D(l("input",{type:"radio",value:o.value,"onUpdate:modelValue":e[0]||(e[0]=c=>i.selectedValue=c),onChange:e[1]||(e[1]=(...c)=>r.handleRadioChange&&r.handleRadioChange(...c)),class:"text-blue-500 focus:ring-2 focus:ring-blue-200","aria-checked":i.selectedValue===o.value.toString(),role:"radio"},null,40,Pst),[[DD,i.selectedValue]]),l("span",Fst,W(o.label),1)]))),128))])}const Bst=it(Dst,[["render",Ust]]),Gst="/assets/gpu-BWVOYg-D.svg",Vst={name:"StringListManager",props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:"Enter an item"}},emits:["update:modelValue","change"],data(){return{newItem:"",draggingIndex:null}},methods:{addItem(){if(this.newItem.trim()){const n=[...this.modelValue,this.newItem.trim()];this.$emit("update:modelValue",n),this.$emit("change"),this.newItem=""}},removeItem(n){const e=this.modelValue.filter((t,s)=>s!==n);this.$emit("update:modelValue",e),this.$emit("change")},removeAll(){this.$emit("update:modelValue",[]),this.$emit("change")},startDragging(n){this.draggingIndex=n},dragItem(n){if(this.draggingIndex!==null){const e=[...this.modelValue],t=e.splice(this.draggingIndex,1)[0];e.splice(n,0,t),this.$emit("update:modelValue",e),this.$emit("change")}},stopDragging(){this.draggingIndex=null},moveUp(n){if(n>0){const e=[...this.modelValue],t=e.splice(n,1)[0];e.splice(n-1,0,t),this.$emit("update:modelValue",e),this.$emit("change")}},moveDown(n){if(ni.newItem=o),placeholder:t.placeholder,onKeyup:e[1]||(e[1]=zs((...o)=>r.addItem&&r.addItem(...o),["enter"])),class:"flex-grow mr-4 px-4 py-2 border border-gray-300 rounded dark:bg-gray-600 text-lg"},null,40,Hst),[[ue,i.newItem]]),l("button",{onClick:e[2]||(e[2]=(...o)=>r.addItem&&r.addItem(...o)),class:"bg-blue-500 text-white px-6 py-2 rounded hover:bg-blue-600 text-lg"},"Add")]),t.modelValue.length>0?(T(),w("ul",qst,[(T(!0),w(Be,null,Xe(t.modelValue,(o,a)=>(T(),w("li",{key:a,class:Ue(["flex items-center mb-2 relative",{"bg-gray-200":i.draggingIndex===a}])},[l("span",Yst,W(o),1),l("div",$st,[l("button",{onClick:c=>r.removeItem(a),class:"text-red-500 hover:text-red-700 p-2"},e[5]||(e[5]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)]),8,Wst),a>0?(T(),w("button",{key:0,onClick:c=>r.moveUp(a),class:"bg-gray-300 hover:bg-gray-400 p-2 rounded mr-2"},e[6]||(e[6]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"})],-1)]),8,Kst)):B("",!0),ar.moveDown(a),class:"bg-gray-300 hover:bg-gray-400 p-2 rounded"},e[7]||(e[7]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)]),8,jst)):B("",!0)]),i.draggingIndex===a?(T(),w("div",{key:0,class:"absolute top-0 left-0 w-full h-full bg-gray-200 opacity-50 cursor-move",onMousedown:c=>r.startDragging(a),onMousemove:c=>r.dragItem(a),onMouseup:e[3]||(e[3]=(...c)=>r.stopDragging&&r.stopDragging(...c))},null,40,Qst)):B("",!0)],2))),128))])):B("",!0),t.modelValue.length>0?(T(),w("div",Xst,[l("button",{onClick:e[4]||(e[4]=(...o)=>r.removeAll&&r.removeAll(...o)),class:"bg-red-500 text-white px-6 py-2 rounded hover:bg-red-600 text-lg"},"Remove All")])):B("",!0)])}const Jst=it(Vst,[["render",Zst]]),eit="/";Z.defaults.baseURL="/";const tit={components:{AddModelDialog:hst,ModelEntry:_nt,PersonalityViewer:Snt,PersonalityEntry:Y0,BindingEntry:lst,ChoiceDialog:$0,Card:pp,StringListManager:Jst,RadioOptions:Bst},data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},defaultModelImgPlaceholder:Ls,snd_input_devices:[],snd_input_devices_indexes:[],snd_output_devices:[],snd_output_devices_indexes:[],voices:[],voice_languages:{Arabic:"ar","Brazilian Portuguese":"pt",Chinese:"zh-cn",Czech:"cs",Dutch:"nl",English:"en",French:"fr",German:"de",Italian:"it",Polish:"pl",Russian:"ru",Spanish:"es",Turkish:"tr",Japanese:"ja",Korean:"ko",Hungarian:"hu",Hindi:"hi"},storeLogo:Us,binding_changed:!1,SVGGPU:Gst,models_zoo:[],models_zoo_initialLoadCount:10,models_zoo_loadMoreCount:5,models_zoo_loadedEntries:[],models_zoo_scrollThreshold:200,sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],comfyui_models:[],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],collapsedArr:[],all_collapsed:!0,data_conf_collapsed:!0,internet_conf_collapsed:!0,servers_conf_collapsed:!0,mainconf_collapsed:!0,smartrouterconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,ezl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:eit,searchPersonality:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){try{this.$store.state.loading_infos="Getting Hardware usage",await this.refreshHardwareUsage(this.$store)}catch(n){console.log("Error cought:",n)}qe.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{fetchElevenLabsVoices(){fetch("https://api.elevenlabs.io/v1/voices").then(n=>n.json()).then(n=>{this.voices=n.voices}).catch(n=>console.error("Error fetching voices:",n))},async refreshHardwareUsage(n){await n.dispatch("refreshDiskUsage"),await n.dispatch("refreshRamUsage"),await n.dispatch("refreshVramUsage")},addDataSource(){this.$store.state.config.rag_databases.push(""),this.settingsChanged=!0},removeDataSource(n){this.$store.state.config.rag_databases.splice(n,1),this.settingsChanged=!0},async vectorize_folder(n){await Z.post("/vectorize_folder",{client_id:this.$store.state.client_id,db_path:this.$store.state.config.rag_databases[n]},this.posts_headers)},async select_folder(n){try{qe.on("rag_db_added",e=>{console.log(e),e?(this.$store.state.config.rag_databases[n]=`${e.database_name}::${e.database_path}`,this.settingsChanged=!0):this.$store.state.toast.showToast("Failed to select a folder",4,!1)}),await Z.post("/add_rag_database",{client_id:this.$store.state.client_id},this.posts_headers)}catch{this.$store.state.toast.showToast("Failed to select a folder",4,!1)}},handleTemplateSelection(n){console.log("handleTemplateSelection");const e=n.target.value;console.log("handleTemplateSelection: ",e),e==="lollms"?(console.log("Using lollms template"),this.configFile.start_header_id_template="!@>",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` +`];let a=-1;return o.forEach(c=>{const d=r.lastIndexOf(c);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+i+1},s=()=>{const i=t(n),r=this.text.substring(n,i);this.msg.text=r,n=i+1,this.msg.onend=o=>{n{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",i))},this.speechSynthesis.speak(this.msg)};s()},getCursorPosition(){return this.$refs.mdTextarea.selectionStart},appendToOutput(n){this.pre_text+=n,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let n=this.text.indexOf("@@");if(n<0){this.$refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,n)+this.text.substring(n+26,this.text.length),this.pre_text=this.text.substring(0,n),this.post_text=this.text.substring(n,this.text.length);var e=this.text.substring(0,n);console.log(e),Ye.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},async tokenize_text(){const n=await Z.post("/lollms_tokenize",{prompt:this.text},{headers:this.posts_headers});console.log(n.data.named_tokens),this.namedTokens=n.data.named_tokens},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var n=this.text.substring(0,this.getCursorPosition());console.log(this.text),console.log(`cursor position :${this.getCursorPosition()}`),console.log(`pretext:${this.pre_text}`),console.log(`post_text:${this.post_text}`),console.log(`prompt:${n}`),Ye.emit("generate_text",{prompt:n,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){Ye.emit("cancel_text_generation",{})},exportText(){const n=this.text,e=document.createElement("a"),t=new Blob([n],{type:"text/plain"});e.href=URL.createObjectURL(t),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const n=document.getElementById("import-input");n&&(n.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const t=new FileReader;t.onload=()=>{this.text=t.result},t.readAsText(e.target.files[0])}else alert("Please select a file.")}),n.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=det(this.selectedPreset.content,n=>{console.log("Done"),console.log(n),this.text=n})},addPreset(){let n=prompt("Enter the title of the preset:");this.presets[n]={client_id:this.$store.state.client_id,name:n,content:this.text},Z.post("./add_preset",this.presets[n]).then(e=>{console.log(e.data)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){Z.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startRecording(){this.pending=!0,this.is_recording?Z.post("/stop_recording",{client_id:this.$store.state.client_id}).then(n=>{this.is_recording=!1,this.pending=!1,console.log(n),this.text+=n.data,console.log("text"),console.log(this.text),console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)}):Z.post("/start_recording",{client_id:this.$store.state.client_id}).then(n=>{this.is_recording=!0,this.pending=!1,console.log(n.data)}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startRecordingAndTranscribing(){this.pending=!0,this.is_deaf_transcribing?Z.get("/stop_recording").then(n=>{this.is_deaf_transcribing=!1,this.pending=!1,this.text=n.data.text,this.read()}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)}):Z.get("/start_recording").then(n=>{this.is_deaf_transcribing=!0,this.pending=!1}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length),this.recognition.onresult=n=>{this.generated="";for(let e=n.resultIndex;e{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,this.pre_text=this.pre_text+this.generated,this.cursorPosition=this.pre_text.length,clearTimeout(this.silenceTimer)},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")}}},pet={class:"container w-full background-color shadow-lg overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},fet={class:"container flex flex-row m-2 w-full"},_et={class:"flex-grow w-full m-2"},met={class:"flex panels-color gap-3 flex-1 items-center flex-grow flex-row rounded-md border-2 border-blue-300 m-2 p-4"},het={class:"flex items-center space-x-2"},get=["src"],bet=["src"],yet=["src"],Eet=["src"],vet=["src"],Tet={key:1,class:"w-6 h-6"},xet={class:"flex gap-3 flex-1 items-center flex-grow justify-end"},Cet={key:0},wet=["src"],Ret={key:2},Aet={key:0,class:"settings scrollbar bg-white dark:bg-gray-800 rounded-lg shadow-md p-6"},Net=["value"],Met={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},Oet=["value"],Iet={class:"slider-container ml-2 mr-2"},ket={class:"slider-value text-gray-500"},Det={class:"slider-container ml-2 mr-2"},Let={class:"slider-value text-gray-500"},Pet={class:"slider-container ml-2 mr-2"},Fet={class:"slider-value text-gray-500"},Uet={class:"slider-container ml-2 mr-2"},Bet={class:"slider-value text-gray-500"},Get={class:"slider-container ml-2 mr-2"},Vet={class:"slider-value text-gray-500"},zet={class:"slider-container ml-2 mr-2"},Het={class:"slider-value text-gray-500"},qet={class:"slider-container ml-2 mr-2"},Yet={class:"slider-value text-gray-500"},$et={class:"slider-container ml-2 mr-2"},Wet={class:"slider-value text-gray-500"};function Ket(n,e,t,s,i,r){const o=et("ChatBarButton"),a=et("ToolbarButton"),c=et("DropdownSubmenu"),d=et("DropdownMenu"),u=et("tokens-hilighter"),_=et("MarkdownRenderer"),m=et("Card"),h=et("Toast");return T(),w(Be,null,[l("div",pet,[l("div",fet,[l("div",_et,[l("div",met,[l("div",het,[D(z(o,{onClick:r.generate,title:"Generate from the current cursor position"},{icon:Ie(()=>e[54]||(e[54]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})],-1)])),_:1},8,["onClick"]),[[xt,!i.generating]]),D(z(o,{onClick:r.generate_in_placeholder,title:"Generate from the next placeholder"},{icon:Ie(()=>e[55]||(e[55]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"})],-1)])),_:1},8,["onClick"]),[[xt,!i.generating]]),D(z(o,{onClick:r.tokenize_text,title:"Tokenize the text"},{icon:Ie(()=>[l("img",{src:i.tokenize_icon,alt:"Tokenize",class:"h-5 w-5"},null,8,get)]),_:1},8,["onClick"]),[[xt,!i.generating]]),e[65]||(e[65]=l("span",{class:"w-80"},null,-1)),D(z(o,{onClick:r.stopGeneration,title:"Stop generation"},{icon:Ie(()=>e[56]||(e[56]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])),_:1},8,["onClick"]),[[xt,i.generating]]),z(o,{onClick:r.startSpeechRecognition,class:Ue({"text-red-500":n.isListeningToVoice}),title:"Dictate (using your browser's transcription)"},{icon:Ie(()=>e[57]||(e[57]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})],-1)])),_:1},8,["onClick","class"]),z(o,{onClick:r.speak,class:Ue({"text-red-500":r.isTalking}),title:"Convert text to audio (not saved, uses your browser's TTS service)"},{icon:Ie(()=>e[58]||(e[58]=[Ze(" 🪶 ")])),_:1},8,["onClick","class"]),z(o,{onClick:r.triggerFileUpload,title:"Upload a voice"},{icon:Ie(()=>e[59]||(e[59]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})],-1)])),_:1},8,["onClick"]),z(o,{onClick:r.startRecordingAndTranscribing,class:Ue({"text-green-500":i.isLesteningToVoice}),title:"Start audio to audio"},{icon:Ie(()=>[i.pending?(T(),w("img",{key:1,src:i.loading_icon,alt:"Loading",class:"h-5 w-5"},null,8,yet)):(T(),w("img",{key:0,src:i.is_deaf_transcribing?i.deaf_on:i.deaf_off,alt:"Deaf",class:"h-5 w-5"},null,8,bet))]),_:1},8,["onClick","class"]),z(o,{onClick:r.startRecording,class:Ue({"text-green-500":i.isLesteningToVoice}),title:"Start audio recording"},{icon:Ie(()=>[i.pending?(T(),w("img",{key:1,src:i.loading_icon,alt:"Loading",class:"h-5 w-5"},null,8,vet)):(T(),w("img",{key:0,src:i.is_recording?i.rec_on:i.rec_off,alt:"Record",class:"h-5 w-5"},null,8,Eet))]),_:1},8,["onClick","class"]),i.isSynthesizingVoice?(T(),w("div",Tet,e[61]||(e[61]=[l("svg",{class:"animate-spin h-5 w-5 text-secondary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[l("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),l("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)]))):(T(),at(o,{key:0,onClick:r.read,title:"Generate audio from text"},{icon:Ie(()=>e[60]||(e[60]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})],-1)])),_:1},8,["onClick"])),D(z(o,{onClick:r.exportText,title:"Export text"},{icon:Ie(()=>e[62]||(e[62]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})],-1)])),_:1},8,["onClick"]),[[xt,!i.generating]]),D(z(o,{onClick:r.importText,title:"Import text"},{icon:Ie(()=>e[63]||(e[63]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)])),_:1},8,["onClick"]),[[xt,!i.generating]]),z(o,{onClick:e[0]||(e[0]=f=>i.showSettings=!i.showSettings),title:"Settings"},{icon:Ie(()=>e[64]||(e[64]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])),_:1})]),l("input",{type:"file",ref:"fileInput",onChange:e[1]||(e[1]=(...f)=>r.handleFileUpload&&r.handleFileUpload(...f)),style:{display:"none"},accept:".wav"},null,544),l("div",xet,[l("button",{class:Ue(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":i.tab_id=="source"}]),onClick:e[2]||(e[2]=f=>i.tab_id="source")}," Source ",2),l("button",{class:Ue(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":i.tab_id=="render"}]),onClick:e[3]||(e[3]=f=>i.tab_id="render")}," Render ",2)]),e[66]||(e[66]=l("input",{type:"file",id:"import-input",class:"hidden"},null,-1))]),l("div",{class:Ue(["flex-grow m-2 p-2 border panels-color border-blue-300 rounded-md",{"border-red-500":i.generating}])},[i.tab_id==="source"?(T(),w("div",Cet,[z(d,{title:"Add Block"},{default:Ie(()=>[z(c,{title:"Programming Languages",icon:"code"},{default:Ie(()=>[z(a,{onClick:e[4]||(e[4]=K(f=>r.addBlock("python"),["stop"])),title:"Python",icon:"python"}),z(a,{onClick:e[5]||(e[5]=K(f=>r.addBlock("javascript"),["stop"])),title:"JavaScript",icon:"js"}),z(a,{onClick:e[6]||(e[6]=K(f=>r.addBlock("typescript"),["stop"])),title:"TypeScript",icon:"typescript"}),z(a,{onClick:e[7]||(e[7]=K(f=>r.addBlock("java"),["stop"])),title:"Java",icon:"java"}),z(a,{onClick:e[8]||(e[8]=K(f=>r.addBlock("c++"),["stop"])),title:"C++",icon:"cplusplus"}),z(a,{onClick:e[9]||(e[9]=K(f=>r.addBlock("csharp"),["stop"])),title:"C#",icon:"csharp"}),z(a,{onClick:e[10]||(e[10]=K(f=>r.addBlock("go"),["stop"])),title:"Go",icon:"go"}),z(a,{onClick:e[11]||(e[11]=K(f=>r.addBlock("rust"),["stop"])),title:"Rust",icon:"rust"}),z(a,{onClick:e[12]||(e[12]=K(f=>r.addBlock("swift"),["stop"])),title:"Swift",icon:"swift"}),z(a,{onClick:e[13]||(e[13]=K(f=>r.addBlock("kotlin"),["stop"])),title:"Kotlin",icon:"kotlin"}),z(a,{onClick:e[14]||(e[14]=K(f=>r.addBlock("r"),["stop"])),title:"R",icon:"r-project"})]),_:1}),z(c,{title:"Web Technologies",icon:"web"},{default:Ie(()=>[z(a,{onClick:e[15]||(e[15]=K(f=>r.addBlock("html"),["stop"])),title:"HTML",icon:"html5"}),z(a,{onClick:e[16]||(e[16]=K(f=>r.addBlock("css"),["stop"])),title:"CSS",icon:"css3"}),z(a,{onClick:e[17]||(e[17]=K(f=>r.addBlock("vue"),["stop"])),title:"Vue.js",icon:"vuejs"}),z(a,{onClick:e[18]||(e[18]=K(f=>r.addBlock("react"),["stop"])),title:"React",icon:"react"}),z(a,{onClick:e[19]||(e[19]=K(f=>r.addBlock("angular"),["stop"])),title:"Angular",icon:"angular"})]),_:1}),z(c,{title:"Markup and Data",icon:"file-code"},{default:Ie(()=>[z(a,{onClick:e[20]||(e[20]=K(f=>r.addBlock("xml"),["stop"])),title:"XML",icon:"xml"}),z(a,{onClick:e[21]||(e[21]=K(f=>r.addBlock("json"),["stop"])),title:"JSON",icon:"json"}),z(a,{onClick:e[22]||(e[22]=K(f=>r.addBlock("yaml"),["stop"])),title:"YAML",icon:"yaml"}),z(a,{onClick:e[23]||(e[23]=K(f=>r.addBlock("markdown"),["stop"])),title:"Markdown",icon:"markdown"}),z(a,{onClick:e[24]||(e[24]=K(f=>r.addBlock("latex"),["stop"])),title:"LaTeX",icon:"latex"})]),_:1}),z(c,{title:"Scripting and Shell",icon:"terminal"},{default:Ie(()=>[z(a,{onClick:e[25]||(e[25]=K(f=>r.addBlock("bash"),["stop"])),title:"Bash",icon:"bash"}),z(a,{onClick:e[26]||(e[26]=K(f=>r.addBlock("powershell"),["stop"])),title:"PowerShell",icon:"powershell"}),z(a,{onClick:e[27]||(e[27]=K(f=>r.addBlock("perl"),["stop"])),title:"Perl",icon:"perl"})]),_:1}),z(c,{title:"Diagramming",icon:"sitemap"},{default:Ie(()=>[z(a,{onClick:e[28]||(e[28]=K(f=>r.addBlock("mermaid"),["stop"])),title:"Mermaid",icon:"mermaid"}),z(a,{onClick:e[29]||(e[29]=K(f=>r.addBlock("graphviz"),["stop"])),title:"Graphviz",icon:"graphviz"}),z(a,{onClick:e[30]||(e[30]=K(f=>r.addBlock("plantuml"),["stop"])),title:"PlantUML",icon:"plantuml"})]),_:1}),z(c,{title:"Database",icon:"database"},{default:Ie(()=>[z(a,{onClick:e[31]||(e[31]=K(f=>r.addBlock("sql"),["stop"])),title:"SQL",icon:"sql"}),z(a,{onClick:e[32]||(e[32]=K(f=>r.addBlock("mongodb"),["stop"])),title:"MongoDB",icon:"mongodb"})]),_:1}),z(a,{onClick:e[33]||(e[33]=K(f=>r.addBlock(""),["stop"])),title:"Generic Block",icon:"code"})]),_:1}),z(a,{onClick:e[34]||(e[34]=K(f=>n.copyContentToClipboard(),["stop"])),title:"Copy message to clipboard",icon:"copy"}),D(l("textarea",{ref:"mdTextarea",onKeydown:e[35]||(e[35]=zs(K((...f)=>r.insertTab&&r.insertTab(...f),["prevent"]),["tab"])),class:"block min-h-500 p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",rows:4,style:Wt({minHeight:i.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[36]||(e[36]=f=>i.text=f),onClick:e[37]||(e[37]=K((...f)=>r.mdTextarea_clicked&&r.mdTextarea_clicked(...f),["prevent"])),onChange:e[38]||(e[38]=K((...f)=>r.mdTextarea_changed&&r.mdTextarea_changed(...f),["prevent"]))}," ",36),[[ue,i.text]]),l("span",null,"Cursor position "+W(i.cursorPosition),1)])):B("",!0),i.audio_url!=null?(T(),w("audio",{controls:"",key:i.audio_url},[l("source",{src:i.audio_url,type:"audio/wav",ref:"audio_player"},null,8,wet),e[67]||(e[67]=Ze(" Your browser does not support the audio element. "))])):B("",!0),z(u,{namedTokens:i.namedTokens},null,8,["namedTokens"]),i.tab_id==="render"?(T(),w("div",Ret,[z(_,{ref:"mdRender",client_id:this.$store.state.client_id,message_id:0,discussion_id:0,"markdown-text":i.text,class:"mt-4 p-2 rounded shadow-lg dark:bg-bg-dark"},null,8,["client_id","markdown-text"])])):B("",!0)],2)]),i.showSettings?(T(),w("div",Aet,[e[82]||(e[82]=l("h2",{class:"text-2xl font-bold text-gray-900 dark:text-white mb-4"},"Settings",-1)),z(m,{title:"Model",class:"slider-container ml-0 mr-0",isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[D(l("select",{"onUpdate:modelValue":e[39]||(e[39]=f=>this.$store.state.selectedModel=f),onChange:e[40]||(e[40]=(...f)=>r.setModel&&r.setModel(...f)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(T(!0),w(Be,null,Xe(r.models,f=>(T(),w("option",{key:f,value:f},W(f),9,Net))),128))],544),[[It,this.$store.state.selectedModel]]),i.selecting_model?(T(),w("div",Met,e[68]||(e[68]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Selecting model...")],-1)]))):B("",!0)]),_:1}),z(m,{title:"Presets",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[D(l("select",{"onUpdate:modelValue":e[41]||(e[41]=f=>i.selectedPreset=f),class:"bg-white dark:bg-black mb-2 border-2 rounded-md shadow-sm w-full"},[(T(!0),w(Be,null,Xe(i.presets,f=>(T(),w("option",{key:f,value:f},W(f.name),9,Oet))),128))],512),[[It,i.selectedPreset]]),e[73]||(e[73]=l("br",null,null,-1)),l("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[42]||(e[42]=(...f)=>r.setPreset&&r.setPreset(...f)),title:"Use preset"},e[69]||(e[69]=[l("i",{"data-feather":"check"},null,-1)])),l("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[43]||(e[43]=(...f)=>r.addPreset&&r.addPreset(...f)),title:"Add this text as a preset"},e[70]||(e[70]=[l("i",{"data-feather":"plus"},null,-1)])),l("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[44]||(e[44]=(...f)=>r.removePreset&&r.removePreset(...f)),title:"Remove preset"},e[71]||(e[71]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[45]||(e[45]=(...f)=>r.reloadPresets&&r.reloadPresets(...f)),title:"Reload presets list"},e[72]||(e[72]=[l("i",{"data-feather":"refresh-ccw"},null,-1)]))]),_:1}),z(m,{title:"Generation params",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[l("div",Iet,[e[74]||(e[74]=l("h3",{class:"text-gray-600"},"Temperature",-1)),D(l("input",{type:"range","onUpdate:modelValue":e[46]||(e[46]=f=>i.temperature=f),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[ue,i.temperature]]),l("span",ket,"Current value: "+W(i.temperature),1)]),l("div",Det,[e[75]||(e[75]=l("h3",{class:"text-gray-600"},"Top K",-1)),D(l("input",{type:"range","onUpdate:modelValue":e[47]||(e[47]=f=>i.top_k=f),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[ue,i.top_k]]),l("span",Let,"Current value: "+W(i.top_k),1)]),l("div",Pet,[e[76]||(e[76]=l("h3",{class:"text-gray-600"},"Top P",-1)),D(l("input",{type:"range","onUpdate:modelValue":e[48]||(e[48]=f=>i.top_p=f),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[ue,i.top_p]]),l("span",Fet,"Current value: "+W(i.top_p),1)]),l("div",Uet,[e[77]||(e[77]=l("h3",{class:"text-gray-600"},"Repeat Penalty",-1)),D(l("input",{type:"range","onUpdate:modelValue":e[49]||(e[49]=f=>i.repeat_penalty=f),min:"0",max:"5",step:"0.1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[ue,i.repeat_penalty]]),l("span",Bet,"Current value: "+W(i.repeat_penalty),1)]),l("div",Get,[e[78]||(e[78]=l("h3",{class:"text-gray-600"},"Repeat Last N",-1)),D(l("input",{type:"range","onUpdate:modelValue":e[50]||(e[50]=f=>i.repeat_last_n=f),min:"0",max:"100",step:"1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[ue,i.repeat_last_n]]),l("span",Vet,"Current value: "+W(i.repeat_last_n),1)]),l("div",zet,[e[79]||(e[79]=l("h3",{class:"text-gray-600"},"Number of tokens to crop the text to",-1)),D(l("input",{type:"number","onUpdate:modelValue":e[51]||(e[51]=f=>i.n_crop=f),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[ue,i.n_crop]]),l("span",Het,"Current value: "+W(i.n_crop),1)]),l("div",qet,[e[80]||(e[80]=l("h3",{class:"text-gray-600"},"Number of tokens to generate",-1)),D(l("input",{type:"number","onUpdate:modelValue":e[52]||(e[52]=f=>i.n_predicts=f),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[ue,i.n_predicts]]),l("span",Yet,"Current value: "+W(i.n_predicts),1)]),l("div",$et,[e[81]||(e[81]=l("h3",{class:"text-gray-600"},"Seed",-1)),D(l("input",{type:"number","onUpdate:modelValue":e[53]||(e[53]=f=>i.seed=f),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[ue,i.seed]]),l("span",Wet,"Current value: "+W(i.seed),1)])]),_:1})])):B("",!0)])]),z(h,{ref:"toast"},null,512)],64)}const jet=it(uet,[["render",Ket]]),Qet={data(){return{activeExtension:null}},computed:{activeExtensions(){return console.log(this.$store.state.extensionsZoo),console.log(YO(this.$store.state.extensionsZoo)),this.$store.state.extensionsZoo}},methods:{showExtensionPage(n){this.activeExtension=n}}},Xet={class:"container overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},Zet={key:0},Jet=["onClick"],ett={key:0},ttt=["src"],ntt={key:1};function stt(n,e,t,s,i,r){return T(),w("div",Xet,[r.activeExtensions.length>0?(T(),w("div",Zet,[(T(!0),w(Be,null,Xe(r.activeExtensions,o=>(T(),w("div",{key:o.name,onClick:a=>r.showExtensionPage(o)},[l("div",{class:Ue({"active-tab":o===i.activeExtension})},W(o.name),3)],8,Jet))),128)),i.activeExtension?(T(),w("div",ett,[l("iframe",{src:i.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,ttt)])):B("",!0)])):(T(),w("div",ntt,e[0]||(e[0]=[l("p",null,"No extension is active. Please install and activate an extension.",-1)])))])}const itt=it(Qet,[["render",stt]]),rtt={name:"HelpView"},ott={class:"help-view"};function att(n,e,t,s,i,r){return T(),w("div",ott,e[0]||(e[0]=[Pi("

Bienvenue dans l'aide de Lollms

**Lollms** (**L**ord **o**f **L**arge **L**anguage and **M**ultimodal **S**ystems), prononcé "lahms", est un outil puissant qui vous permet d'interagir avec une variété de modèles de langage et multimodaux. Il a été créé par **ParisNeo**, un expert en IA et en robotique passionné de programmation depuis son enfance, dans le but de rendre les modèles d'IA accessibles à tous, gratuitement. Son slogan : **"Un outil pour tous les gouverner"**. [1, 2]

Composants clés de Lollms

  • Liaisons : Essentiellement du code Python, les liaisons sont des modules intermédiaires permettant à Lollms d'interagir avec différents modèles d'IA. Elles agissent comme des ponts entre l'interface utilisateur de Lollms et les bibliothèques logicielles qui exécutent ces modèles. [3-5]
  • Services : Lollms s'appuie sur des services supplémentaires créés par des développeurs tiers. Ces services, souvent open source, étendent les fonctionnalités de Lollms. Parmi eux, on trouve : [6]
    • **Services LLM :** tels qu'ollama et vllm, dédiés à la génération de texte.
    • **Génération d'images :** comme Stable Diffusion, pour créer des images à partir de descriptions textuelles.
    • **Synthèse vocale :** comme Xtts, permettant de convertir du texte en parole.
  • Modèles : Au cœur de Lollms se trouvent les modèles de langage. Ces modèles, formés sur d'énormes ensembles de données textuelles, sont capables de : [6-8]
    • Générer du texte cohérent et contextuel.
    • Traduire des langues avec une précision remarquable.
    • Produire différents types de contenu créatif, tels que des poèmes, du code et des scripts.
    • Fournir des réponses informatives à vos questions.
    La taille d'un modèle est un facteur déterminant de ses performances : plus le modèle est grand (c'est-à-dire plus il possède de paramètres), plus ses capacités sont généralement avancées. [8, 9]
  • Personnalités : Donnez vie à Lollms grâce aux personnalités. Ces agents virtuels, dotés de caractéristiques et de styles de communication uniques, sont créés par le biais de deux méthodes principales : [10, 11]
    • **Conditionnement de texte :** On fournit au modèle des exemples de conversations représentatifs de la personnalité souhaitée, l'entraînant à imiter ce style.
    • **Code Python personnalisé :** Des scripts Python permettent de définir des comportements plus complexes et d'intégrer des fonctionnalités spécifiques à une personnalité.
    Avec plus de 250 personnalités disponibles, couvrant des domaines allant de la science à la fiction, vous trouverez forcément celle qui correspond à vos besoins. [10, 12, 13]

Fonctionnalités de Lollms

Lollms offre un éventail impressionnant de fonctionnalités :

  • **Génération de texte :** Écrivez des histoires, des articles, des poèmes et plus encore.
  • **Traduction linguistique :** Brisez les barrières linguistiques en traduisant du texte dans différentes langues.
  • **Écriture créative :** Explorez votre côté artistique en générant des scripts, des poèmes et des paroles de chansons.
  • **Réponse aux questions :** Obtenez des réponses à vos questions en puisant dans les connaissances des modèles de langage.
  • **Génération d'images :** Créez des images uniques à partir de descriptions textuelles.
  • **Synthèse vocale :** Donnez une voix à vos textes grâce à la synthèse vocale.
  • **Exécution de code :** Générez et exécutez du code dans différents langages de programmation.
  • **Intégration Web :** Intégrez Lollms à vos projets web pour des fonctionnalités dynamiques.
  • **Et bien plus encore! :** Lollms est en constante évolution, avec de nouvelles fonctionnalités ajoutées régulièrement.
",7)]))}const ltt=it(rtt,[["render",att]]);function si(n,e=!0,t=1){const s=e?1e3:1024;if(Math.abs(n)=s&&r{Ve.replace()})},executeCommand(n){this.isMenuOpen=!1,console.log("Selected"),console.log(n.value),typeof n.value=="function"&&(console.log("Command detected",n),n.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(n))},positionMenu(){var n;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),t=window.innerHeight;n=e.bottom>t/2}else this.force_position==1?n=!0:n=!1;this.menuPosition.top=n?"auto":"calc(100% + 10px)",this.menuPosition.bottom=n?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),Le(()=>{Ve.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},dtt={class:"menu-container"},utt=["title"],ptt=["src"],ftt=["data-feather"],_tt={key:2,class:"w-5 h-5"},mtt={key:3,"data-feather":"menu"},htt={class:"flex-grow menu-ul"},gtt=["onClick"],btt={key:0,"data-feather":"check"},ytt=["src","alt"],Ett=["data-feather"],vtt={key:3,class:"menu-icon"};function Stt(n,e,t,s,i,r){return T(),w("div",dtt,[l("button",{onClick:e[0]||(e[0]=K((...o)=>r.toggleMenu&&r.toggleMenu(...o),["prevent"])),title:t.title,class:Ue([t.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[t.icon&&!t.icon.includes("#")&&!t.icon.includes("feather")?(T(),w("img",{key:0,src:t.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,ptt)):t.icon&&t.icon.includes("feather")?(T(),w("i",{key:1,"data-feather":t.icon.split(":")[1],class:"w-5 h-5"},null,8,ftt)):t.icon&&t.icon.includes("#")?(T(),w("p",_tt,W(t.icon.split("#")[1]),1)):(T(),w("i",mtt))],10,utt),z(Ii,{name:"slide"},{default:Ie(()=>[i.isMenuOpen?(T(),w("div",{key:0,class:"menu-list flex-grow",style:Wt(i.menuPosition),ref:"menu"},[l("ul",htt,[(T(!0),w(Be,null,Xe(t.commands,(o,a)=>(T(),w("li",{key:a,onClick:K(c=>r.executeCommand(o),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[t.selected_entry==o.name?(T(),w("i",btt)):o.icon&&!o.icon.includes("feather")&&!o.is_file?(T(),w("img",{key:1,src:o.icon,alt:o.name,class:"menu-icon"},null,8,ytt)):B("",!0),o.icon&&o.icon.includes("feather")&&!o.is_file?(T(),w("i",{key:2,"data-feather":o.icon.split(":")[1],class:"mr-2"},null,8,Ett)):(T(),w("span",vtt)),l("span",null,W(o.name),1)],8,gtt))),128))])],4)):B("",!0)]),_:1})])}const q0=it(ctt,[["render",Stt]]),Ttt={components:{InteractiveMenu:q0},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){Le(()=>{Ve.replace()})},methods:{formatFileSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(n){return si(n)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?Ls:this.model.icon},defaultImg(n){n.target.src=Ls},install(){this.onInstall(this)},uninstall(){this.isInstalled&&this.onUninstall(this)},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(n){if(console.log("event.target.tagName.toLowerCase()"),console.log(n.target.tagName.toLowerCase()),n.target.tagName.toLowerCase()==="button"||n.target.tagName.toLowerCase()==="svg"){n.stopPropagation();return}this.onSelected(this),this.model.selected=!0,Le(()=>{Ve.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this),this.installing=!1},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let n=[{name:this.model.isInstalled?"Install Extra":"Install",icon:"feather:settings",is_file:!1,value:this.install},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.model.isInstalled&&n.push({name:"UnInstall",icon:"feather:settings",is_file:!1,value:this.uninstall}),this.selected&&n.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),n},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const n=this.model.variants[0].size;return this.formatFileSize(n)}return null}},speed_computed(){return si(this.speed)},total_size_computed(){return si(this.total_size)},downloaded_size_computed(){return si(this.downloaded_size)}},watch:{linkNotValid(){Le(()=>{Ve.replace()})}}},xtt=["title"],Ctt={key:0,class:"flex flex-row"},wtt={class:"max-w-[300px] overflow-x-auto"},Rtt={class:"flex gap-3 items-center grow"},Att=["href"],Ntt=["src"],Mtt={class:"flex-1 overflow-hidden"},Ott={class:"font-bold font-large text-lg truncate"},Itt={key:1,class:"flex items-center flex-row gap-2 my-1"},ktt={class:"flex grow items-center"},Dtt={key:2,class:"absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center"},Ltt={class:"relative flex flex-col items-center justify-center flex-grow h-full"},Ptt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},Ftt={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},Utt={class:"flex justify-between mb-1"},Btt={class:"text-sm font-medium text-blue-700 dark:text-white"},Gtt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Vtt={class:"flex justify-between mb-1"},ztt={class:"text-base font-medium text-blue-700 dark:text-white"},Htt={class:"text-sm font-medium text-blue-700 dark:text-white"},qtt={class:"flex flex-grow"},Ytt={class:"flex flex-row flex-grow gap-3"},$tt={class:"p-2 text-center grow"},Wtt={key:3},Ktt={class:"flex flex-row items-center gap-3"},jtt=["src"],Qtt={class:"font-bold font-large text-lg truncate"},Xtt={class:"flex items-center flex-row-reverse gap-2 my-1"},Ztt={class:"flex flex-row items-center"},Jtt={key:0,class:"text-base text-red-600 flex items-center mt-1"},ent=["title"],tnt={class:""},nnt={class:"flex flex-row items-center"},snt=["href","title"],int={class:"flex items-center"},rnt={class:"flex items-center"},ont={key:0,class:"flex items-center"},ant=["href"],lnt={class:"flex items-center"},cnt=["href"],dnt={class:"flex items-center"},unt={class:"flex items-center"},pnt=["href"];function fnt(n,e,t,s,i,r){const o=et("InteractiveMenu");return T(),w("div",{class:Ue(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",r.computed_classes]),title:t.model.name,onClick:e[10]||(e[10]=K(a=>r.toggleSelected(a),["prevent"]))},[t.model.isCustomModel?(T(),w("div",Ctt,[l("div",wtt,[l("div",Rtt,[l("a",{href:t.model.model_creator_link,target:"_blank"},[l("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,Ntt)],8,Att),l("div",Mtt,[l("h3",Ott,W(t.model.name),1)])])])])):B("",!0),t.model.isCustomModel?(T(),w("div",Itt,[l("div",ktt,[l("button",{type:"button",title:"Custom model / local model",class:"font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=K(()=>{},["stop"]))},e[11]||(e[11]=[l("i",{"data-feather":"box",class:"w-5"},null,-1),l("span",{class:"sr-only"},"Custom model / local model",-1)])),e[12]||(e[12]=Ze(" Custom model "))]),l("div",null,[t.model.isInstalled?(T(),w("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=K((...a)=>r.uninstall&&r.uninstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},e[13]||(e[13]=[Ze(" Uninstall "),l("span",{class:"sr-only"},"Remove",-1)]))):B("",!0)])])):B("",!0),i.installing?(T(),w("div",Dtt,[l("div",Ltt,[e[15]||(e[15]=l("div",{role:"status",class:"justify-center"},[l("svg",{"aria-hidden":"true",class:"w-24 h-24 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)),l("div",Ptt,[l("div",Ftt,[l("div",Utt,[e[14]||(e[14]=l("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1)),l("span",Btt,W(Math.floor(i.progress))+"%",1)]),l("div",Gtt,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Wt({width:i.progress+"%"})},null,4)]),l("div",Vtt,[l("span",ztt,"Download speed: "+W(r.speed_computed)+"/s",1),l("span",Htt,W(r.downloaded_size_computed)+"/"+W(r.total_size_computed),1)])])]),l("div",qtt,[l("div",Ytt,[l("div",$tt,[l("button",{onClick:e[3]||(e[3]=K((...a)=>r.toggleCancelInstall&&r.toggleCancelInstall(...a),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])])):B("",!0),t.model.isCustomModel?B("",!0):(T(),w("div",Wtt,[l("div",Ktt,[l("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=a=>r.defaultImg(a)),class:Ue(["w-10 h-10 rounded-lg object-fill",i.linkNotValid?"grayscale":""])},null,42,jtt),l("h3",Qtt,W(t.model.name),1),e[16]||(e[16]=l("div",{class:"grow"},null,-1)),z(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),l("div",Xtt,[l("div",Ztt,[i.linkNotValid?(T(),w("div",Jtt,e[17]||(e[17]=[l("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),Ze(" Link is not valid ")]))):B("",!0)])]),l("div",{class:"",title:t.model.isInstalled?t.model.name:"Not installed"},[l("div",tnt,[l("div",nnt,[e[19]||(e[19]=l("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1)),e[20]||(e[20]=l("b",null,"Card: ",-1)),l("a",{href:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name,target:"_blank",onClick:e[5]||(e[5]=K(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:i.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,snt),e[21]||(e[21]=l("div",{class:"grow"},null,-1)),l("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[6]||(e[6]=K(a=>r.toggleCopyLink(),["stop"]))},e[18]||(e[18]=[l("i",{"data-feather":"clipboard",class:"w-5"},null,-1)]))]),l("div",int,[l("div",{class:Ue(["flex flex-shrink-0 items-center",i.linkNotValid?"text-red-600":""])},[e[22]||(e[22]=l("i",{"data-feather":"file",class:"w-5 m-1"},null,-1)),e[23]||(e[23]=l("b",null,"File size: ",-1)),Ze(" "+W(r.fileSize),1)],2)]),l("div",rnt,[e[24]||(e[24]=l("i",{"data-feather":"key",class:"w-5 m-1"},null,-1)),e[25]||(e[25]=l("b",null,"License: ",-1)),Ze(" "+W(t.model.license),1)]),t.model.quantizer!="None"&&t.model.type!="transformers"?(T(),w("div",ont,[e[26]||(e[26]=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1)),e[27]||(e[27]=l("b",null,"quantizer: ",-1)),l("a",{href:"https://huggingface.co/"+t.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=K(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(t.model.quantizer),9,ant)])):B("",!0),l("div",lnt,[e[28]||(e[28]=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1)),e[29]||(e[29]=l("b",null,"Model creator: ",-1)),l("a",{href:t.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=K(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(t.model.model_creator),9,cnt)]),l("div",dnt,[e[30]||(e[30]=l("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1)),e[31]||(e[31]=l("b",null,"Release date: ",-1)),Ze(" "+W(t.model.last_commit_time),1)]),l("div",unt,[e[32]||(e[32]=l("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1)),e[33]||(e[33]=l("b",null,"Category: ",-1)),l("a",{href:"https://huggingface.co/"+t.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=K(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(t.model.category),9,pnt)])])],8,ent)]))],10,xtt)}const _nt=it(Ttt,[["render",fnt]]),mnt={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",personalityCategory:"Category",disclaimer:"Disclaimer text",conditioningText:"Conditioning Text",aiPrefix:"AI Prefix",userPrefix:"User Prefix",antipromptsList:[{id:1,text:"Antiprompt 1"},{id:2,text:"Antiprompt 2"},{id:3,text:"Antiprompt 3"}]}},methods:{commitChanges(){console.log("Personality changes committed"),this.editMode=!1}}},hnt={class:"p-4"},gnt={class:"flex items-center mb-4"},bnt=["src"],ynt={class:"text-lg font-semibold"},Ent={key:0};function vnt(n,e,t,s,i,r){return T(),w("div",hnt,[l("div",gnt,[l("img",{src:i.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,bnt),l("h2",ynt,W(i.personalityName),1)]),l("p",null,[e[2]||(e[2]=l("strong",null,"Author:",-1)),Ze(" "+W(i.personalityAuthor),1)]),l("p",null,[e[3]||(e[3]=l("strong",null,"Description:",-1)),Ze(" "+W(i.personalityDescription),1)]),l("p",null,[e[4]||(e[4]=l("strong",null,"Category:",-1)),Ze(" "+W(i.personalityCategory),1)]),i.disclaimer?(T(),w("p",Ent,[e[5]||(e[5]=l("strong",null,"Disclaimer:",-1)),Ze(" "+W(i.disclaimer),1)])):B("",!0),l("p",null,[e[6]||(e[6]=l("strong",null,"Conditioning Text:",-1)),Ze(" "+W(i.conditioningText),1)]),l("p",null,[e[7]||(e[7]=l("strong",null,"AI Prefix:",-1)),Ze(" "+W(i.aiPrefix),1)]),l("p",null,[e[8]||(e[8]=l("strong",null,"User Prefix:",-1)),Ze(" "+W(i.userPrefix),1)]),l("div",null,[e[9]||(e[9]=l("strong",null,"Antiprompts:",-1)),l("ul",null,[(T(!0),w(Be,null,Xe(i.antipromptsList,o=>(T(),w("li",{key:o.id},W(o.text),1))),128))])]),l("button",{onClick:e[0]||(e[0]=o=>i.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),i.editMode?(T(),w("button",{key:1,onClick:e[1]||(e[1]=(...o)=>r.commitChanges&&r.commitChanges(...o)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):B("",!0)])}const Snt=it(mnt,[["render",vnt]]),mp="/assets/logo-CQZwS0X1.svg",Tnt="/",xnt={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onOpenFolder:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function,onToggleFavorite:Function},components:{InteractiveMenu:q0},data(){return{isMounted:!1,name:this.personality.name,thumbnailVisible:!1,thumbnailPosition:{x:0,y:0}}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return console.log("this.category",this.personality.category),this.personality.category=="custom_personalities"?n.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):n.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.personality.has_scripts&&n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,Le(()=>{Ve.replace()})},methods:{formatDate(n){const e={year:"numeric",month:"short",day:"numeric"};return new Date(n).toLocaleDateString(void 0,e)},showThumbnail(){this.thumbnailVisible=!0},hideThumbnail(){this.thumbnailVisible=!1},updateThumbnailPosition(n){this.thumbnailPosition={x:n.clientX+10,y:n.clientY+10}},getImgUrl(){return Tnt+this.personality.avatar},defaultImg(n){n.target.src=mp},toggleFavorite(){this.onToggleFavorite(this)},showFolder(){this.onOpenFolder(this)},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.isMounted=!1},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Le(()=>{Ve.replace()})}}},Cnt=["title"],wnt={class:"flex-grow"},Rnt={class:"flex items-center mb-4"},Ant=["src"],Nnt={class:"text-sm text-gray-600"},Mnt={class:"text-sm text-gray-600"},Ont={class:"text-sm text-gray-600"},Int={key:0,class:"text-sm text-gray-600"},knt={key:1,class:"text-sm text-gray-600"},Dnt={class:"mb-4"},Lnt=["innerHTML"],Pnt={class:"mt-auto pt-4 border-t"},Fnt={class:"flex justify-between items-center flex-wrap"},Unt=["title"],Bnt=["fill"],Gnt=["src"];function Vnt(n,e,t,s,i,r){const o=et("InteractiveMenu");return T(),w("div",{class:Ue(["personality-card bg-white border rounded-xl shadow-lg p-6 hover:shadow-xl transition duration-300 ease-in-out flex flex-col h-full",r.selected_computed?"border-primary-light":"border-transparent",i.isMounted?"bg-blue-200 dark:bg-blue-700":""]),title:t.personality.installed?"":"Not installed"},[l("div",wnt,[l("div",Rnt,[l("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),alt:"Personality Icon",class:"w-16 h-16 rounded-full border border-gray-300 mr-4 cursor-pointer",onClick:e[1]||(e[1]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),onMouseover:e[2]||(e[2]=(...a)=>r.showThumbnail&&r.showThumbnail(...a)),onMousemove:e[3]||(e[3]=(...a)=>r.updateThumbnailPosition&&r.updateThumbnailPosition(...a)),onMouseleave:e[4]||(e[4]=(...a)=>r.hideThumbnail&&r.hideThumbnail(...a))},null,40,Ant),l("div",null,[l("h3",{class:"font-bold text-xl text-gray-800 cursor-pointer",onClick:e[5]||(e[5]=(...a)=>r.toggleSelected&&r.toggleSelected(...a))},W(t.personality.name),1),l("p",Nnt,"Author: "+W(t.personality.author),1),l("p",Mnt,"Version: "+W(t.personality.version),1),l("p",Ont,"Category: "+W(t.personality.category),1),t.personality.creation_date?(T(),w("p",Int,"Creation Date: "+W(r.formatDate(t.personality.creation_date)),1)):B("",!0),t.personality.last_update_date?(T(),w("p",knt,"Last update Date: "+W(r.formatDate(t.personality.last_update_date)),1)):B("",!0)])]),l("div",Dnt,[e[10]||(e[10]=l("h4",{class:"font-semibold mb-1 text-gray-700"},"Description:",-1)),l("p",{class:"text-sm text-gray-600 h-20 overflow-y-auto",innerHTML:t.personality.description},null,8,Lnt)])]),l("div",Pnt,[l("div",Fnt,[l("button",{onClick:e[6]||(e[6]=(...a)=>r.toggleFavorite&&r.toggleFavorite(...a)),class:"text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out",title:n.isFavorite?"Remove from favorites":"Add to favorites"},[(T(),w("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:n.isFavorite?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor"},e[11]||(e[11]=[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),8,Bnt))],8,Unt),i.isMounted?(T(),w("button",{key:0,onClick:e[7]||(e[7]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"text-blue-500 hover:text-blue-600 transition duration-300 ease-in-out",title:"Select"},e[12]||(e[12]=[l("i",{"data-feather":"check",class:"h-6 w-6"},null,-1)]))):B("",!0),i.isMounted?(T(),w("button",{key:1,onClick:e[8]||(e[8]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),class:"text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Talk"},e[13]||(e[13]=[l("i",{"data-feather":"send",class:"h-6 w-6"},null,-1)]))):B("",!0),l("button",{onClick:e[9]||(e[9]=(...a)=>r.showFolder&&r.showFolder(...a)),class:"text-purple-500 hover:text-purple-600 transition duration-300 ease-in-out",title:"Show Folder"},e[14]||(e[14]=[l("i",{"data-feather":"folder",class:"h-6 w-6"},null,-1)])),z(o,{commands:r.commandsList,force_position:2,title:"Menu",class:"text-gray-500 hover:text-gray-600 transition duration-300 ease-in-out"},null,8,["commands"])])]),i.thumbnailVisible?(T(),w("div",{key:0,style:Wt({top:i.thumbnailPosition.y+"px",left:i.thumbnailPosition.x+"px"}),class:"fixed z-50 w-20 h-20 rounded-full overflow-hidden"},[l("img",{src:r.getImgUrl(),class:"w-full h-full object-fill"},null,8,Gnt)],4)):B("",!0)],10,Cnt)}const Y0=it(xnt,[["render",Vnt]]),znt={name:"DynamicUIRenderer",props:{ui:{type:String,required:!0},instanceId:{type:String,required:!0}},data(){return{containerId:`dynamic-ui-${this.instanceId}`}},watch:{ui:{immediate:!0,handler(n){console.log(`UI prop changed for instance ${this.instanceId}:`,n),this.$nextTick(()=>{this.renderContent()})}}},methods:{renderContent(){console.log(`Rendering content for instance ${this.instanceId}...`);const n=this.$refs.container,t=new DOMParser().parseFromString(this.ui,"text/html"),s=t.getElementsByTagName("style");Array.from(s).forEach(r=>{const o=document.createElement("style");o.textContent=this.scopeCSS(r.textContent),document.head.appendChild(o)}),n.innerHTML=t.body.innerHTML;const i=t.getElementsByTagName("script");Array.from(i).forEach(r=>{const o=document.createElement("script");o.textContent=r.textContent,n.appendChild(o)})},scopeCSS(n){return n.replace(/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,`#${this.containerId} $1$2`)}}},Hnt=["id"];function qnt(n,e,t,s,i,r){return T(),w("div",{id:i.containerId,ref:"container"},null,8,Hnt)}const oM=it(znt,[["render",qnt]]),Ynt="/",$nt={components:{DynamicUIRenderer:oM},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){Le(()=>{Ve.replace()})},methods:{copyToClipBoard(n){console.log("Copying to clipboard :",n),navigator.clipboard.writeText(n)},getImgUrl(){return Ynt+this.binding.icon},defaultImg(n){n.target.src=mp},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){Le(()=>{Ve.replace()})}}},Wnt=["title"],Knt={class:"flex flex-row items-center gap-3"},jnt=["src"],Qnt={class:"font-bold font-large text-lg truncate"},Xnt={class:"flex-none gap-1"},Znt={class:"flex items-center flex-row-reverse gap-2 my-1"},Jnt={class:""},est={class:""},tst={class:"flex items-center"},nst={class:"flex items-center"},sst={class:"flex items-center"},ist={class:"flex items-center"},rst=["href"],ost=["title","innerHTML"];function ast(n,e,t,s,i,r){const o=et("DynamicUIRenderer");return T(),w("div",{class:Ue(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",t.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[8]||(e[8]=K((...a)=>r.toggleSelected&&r.toggleSelected(...a),["stop"])),title:t.binding.installed?t.binding.name:"Not installed"},[l("div",null,[l("div",Knt,[l("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,jnt),l("h3",Qnt,W(t.binding.name),1),e[10]||(e[10]=l("div",{class:"grow"},null,-1)),l("div",Xnt,[t.selected?(T(),w("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>r.toggleReloadBinding&&r.toggleReloadBinding(...a)),e[2]||(e[2]=K(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},e[9]||(e[9]=[l("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),l("span",{class:"sr-only"},"Help",-1)]))):B("",!0)])]),l("div",Znt,[t.binding.installed?B("",!0):(T(),w("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=K((...a)=>r.toggleInstall&&r.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},e[11]||(e[11]=[Ze(" Install "),l("span",{class:"sr-only"},"Click to install",-1)]))),t.binding.installed?(T(),w("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=K((...a)=>r.toggleReinstall&&r.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},e[12]||(e[12]=[Ze(" Reinstall "),l("span",{class:"sr-only"},"Reinstall",-1)]))):B("",!0),t.binding.installed?(T(),w("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=K((...a)=>r.toggleUnInstall&&r.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},e[13]||(e[13]=[Ze(" Uninstall "),l("span",{class:"sr-only"},"UnInstall",-1)]))):B("",!0),t.selected?(T(),w("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=K((...a)=>r.toggleSettings&&r.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},e[14]||(e[14]=[Ze(" Settings "),l("span",{class:"sr-only"},"Settings",-1)]))):B("",!0)]),t.binding.ui?(T(),at(o,{key:0,class:"w-full h-full",code:t.binding.ui},null,8,["code"])):B("",!0),l("div",Jnt,[l("div",est,[l("div",tst,[e[15]||(e[15]=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1)),e[16]||(e[16]=l("b",null,"Author: ",-1)),Ze(" "+W(t.binding.author),1)]),l("div",nst,[e[18]||(e[18]=l("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1)),e[19]||(e[19]=l("b",null,"Folder: ",-1)),Ze(" "+W(t.binding.folder)+" ",1),e[20]||(e[20]=l("div",{class:"grow"},null,-1)),l("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[7]||(e[7]=K(a=>r.copyToClipBoard(this.binding.folder),["stop"]))},e[17]||(e[17]=[l("i",{"data-feather":"clipboard",class:"w-5"},null,-1)]))]),l("div",sst,[e[21]||(e[21]=l("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1)),e[22]||(e[22]=l("b",null,"Version: ",-1)),Ze(" "+W(t.binding.version),1)]),l("div",ist,[e[23]||(e[23]=l("i",{"data-feather":"github",class:"w-5 m-1"},null,-1)),e[24]||(e[24]=l("b",null,"Link: ",-1)),l("a",{href:t.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},W(t.binding.link),9,rst)])]),e[25]||(e[25]=l("div",{class:"flex items-center"},[l("i",{"data-feather":"info",class:"w-5 m-1"}),l("b",null,"Description: "),l("br")],-1)),l("p",{class:"mx-1 opacity-80 line-clamp-3",title:t.binding.description,innerHTML:t.binding.description},null,8,ost)])])],10,Wnt)}const lst=it($nt,[["render",ast]]),cst={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(n=>{this.resolve=n})},hide(n){this.show=!1,this.resolve&&(this.resolve(n),this.resolve=null)},showDialog(n){return new Promise(e=>{this.model_path=n,this.show=!0,this.resolve=e})}}},dst={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},ust={class:"relative w-full max-w-md max-h-full"},pst={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},fst={class:"p-4 text-center"},_st={class:"p-4 text-center mx-auto mb-4"};function mst(n,e,t,s,i,r){return i.show?(T(),w("div",dst,[l("div",ust,[l("div",pst,[l("button",{type:"button",onClick:e[0]||(e[0]=o=>r.hide(!1)),class:"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[4]||(e[4]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),l("span",{class:"sr-only"},"Close modal",-1)])),l("div",fst,[e[6]||(e[6]=l("svg",{"aria-hidden":"true",class:"mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),l("div",_st,[e[5]||(e[5]=l("label",{class:"mr-2"},"Model path",-1)),D(l("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>i.model_path=o),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[ue,i.model_path]])]),l("button",{onClick:e[2]||(e[2]=o=>r.hide(!0)),type:"button",class:"text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"}," Add "),l("button",{onClick:e[3]||(e[3]=o=>r.hide(!1)),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},"No, cancel")])])])])):B("",!0)}const hst=it(cst,[["render",mst]]),gst={props:{show:{type:Boolean,default:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(n){return typeof n=="string"?n:n&&n.name?n.name:""},selectChoice(n){this.selectedChoice=n,this.$emit("choice-selected",n)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(n){const e=["bytes","KB","MB","GB"];let t=0;for(;n>=1024&&t[t.show?(T(),w("div",bst,[l("div",yst,[l("h2",Est,[e[5]||(e[5]=l("svg",{class:"w-6 h-6 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})],-1)),Ze(" "+W(t.title),1)]),l("div",vst,[l("ul",null,[(T(!0),w(Be,null,Xe(t.choices,(o,a)=>(T(),w("li",{key:a,class:"py-2 px-4 hover:bg-gray-200 dark:hover:bg-gray-600 transition duration-150 ease-in-out"},[l("div",Sst,[l("div",Tst,[o.isEditing?D((T(),w("input",{key:1,"onUpdate:modelValue":c=>o.editName=c,onBlur:c=>r.finishEditing(o),onKeyup:zs(c=>r.finishEditing(o),["enter"]),class:"bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded px-2 py-1 text-sm",autofocus:""},null,40,Cst)),[[ue,o.editName]]):(T(),w("span",{key:0,onClick:c=>r.selectChoice(o),class:Ue([{"font-semibold":o===i.selectedChoice},"text-gray-800 dark:text-white cursor-pointer"])},W(r.displayName(o)),11,xst)),o.size?(T(),w("span",wst,W(r.formatSize(o.size)),1)):B("",!0)]),l("div",Rst,[l("button",{onClick:c=>r.editChoice(o),class:"text-blue-500 hover:text-blue-600 mr-2"},e[6]||(e[6]=[l("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})],-1)]),8,Ast),t.can_remove?(T(),w("button",{key:0,onClick:c=>r.removeChoice(o,a),class:"text-red-500 hover:text-red-600"},e[7]||(e[7]=[l("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,Nst)):B("",!0)])])]))),128))])]),i.showInput?(T(),w("div",Mst,[D(l("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>i.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 dark:border-gray-600 p-2 rounded-lg w-full mb-2 bg-white dark:bg-gray-700 text-gray-800 dark:text-white"},null,512),[[ue,i.newFilename]]),l("button",{onClick:e[1]||(e[1]=(...o)=>r.addNewFilename&&r.addNewFilename(...o)),class:"bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded-lg transition duration-300"}," Add ")])):B("",!0),l("div",Ost,[l("button",{onClick:e[2]||(e[2]=(...o)=>r.closeDialog&&r.closeDialog(...o)),class:"bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded-lg transition duration-300"}," Cancel "),l("button",{onClick:e[3]||(e[3]=(...o)=>r.validateChoice&&r.validateChoice(...o)),disabled:!i.selectedChoice,class:Ue([{"bg-blue-500 hover:bg-blue-600":i.selectedChoice,"bg-gray-400 cursor-not-allowed":!i.selectedChoice},"text-white font-bold py-2 px-4 rounded-lg transition duration-300"])}," Validate ",10,Ist),l("button",{onClick:e[4]||(e[4]=(...o)=>r.toggleInput&&r.toggleInput(...o)),class:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg transition duration-300"}," Add New ")])])])):B("",!0)]),_:1})}const $0=it(gst,[["render",kst],["__scopeId","data-v-f43216be"]]),Dst={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:"0"}},data(){return{selectedValue:this.defaultValue}},computed:{selectedLabel(){const n=this.radioOptions.find(e=>e.value===this.selectedValue);return n?n.label:""}},watch:{selectedValue(n,e){this.$emit("radio-selected",n)}},methods:{handleRadioChange(){}}},Lst={class:"flex space-x-4"},Pst=["value","aria-checked"],Fst={class:"text-gray-700"};function Ust(n,e,t,s,i,r){return T(),w("div",Lst,[(T(!0),w(Be,null,Xe(t.radioOptions,(o,a)=>(T(),w("label",{key:o.value,class:"flex items-center space-x-2"},[D(l("input",{type:"radio",value:o.value,"onUpdate:modelValue":e[0]||(e[0]=c=>i.selectedValue=c),onChange:e[1]||(e[1]=(...c)=>r.handleRadioChange&&r.handleRadioChange(...c)),class:"text-blue-500 focus:ring-2 focus:ring-blue-200","aria-checked":i.selectedValue===o.value.toString(),role:"radio"},null,40,Pst),[[DD,i.selectedValue]]),l("span",Fst,W(o.label),1)]))),128))])}const Bst=it(Dst,[["render",Ust]]),Gst="/assets/gpu-BWVOYg-D.svg",Vst={name:"StringListManager",props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:"Enter an item"}},emits:["update:modelValue","change"],data(){return{newItem:"",draggingIndex:null}},methods:{addItem(){if(this.newItem.trim()){const n=[...this.modelValue,this.newItem.trim()];this.$emit("update:modelValue",n),this.$emit("change"),this.newItem=""}},removeItem(n){const e=this.modelValue.filter((t,s)=>s!==n);this.$emit("update:modelValue",e),this.$emit("change")},removeAll(){this.$emit("update:modelValue",[]),this.$emit("change")},startDragging(n){this.draggingIndex=n},dragItem(n){if(this.draggingIndex!==null){const e=[...this.modelValue],t=e.splice(this.draggingIndex,1)[0];e.splice(n,0,t),this.$emit("update:modelValue",e),this.$emit("change")}},stopDragging(){this.draggingIndex=null},moveUp(n){if(n>0){const e=[...this.modelValue],t=e.splice(n,1)[0];e.splice(n-1,0,t),this.$emit("update:modelValue",e),this.$emit("change")}},moveDown(n){if(ni.newItem=o),placeholder:t.placeholder,onKeyup:e[1]||(e[1]=zs((...o)=>r.addItem&&r.addItem(...o),["enter"])),class:"flex-grow mr-4 px-4 py-2 border border-gray-300 rounded dark:bg-gray-600 text-lg"},null,40,Hst),[[ue,i.newItem]]),l("button",{onClick:e[2]||(e[2]=(...o)=>r.addItem&&r.addItem(...o)),class:"bg-blue-500 text-white px-6 py-2 rounded hover:bg-blue-600 text-lg"},"Add")]),t.modelValue.length>0?(T(),w("ul",qst,[(T(!0),w(Be,null,Xe(t.modelValue,(o,a)=>(T(),w("li",{key:a,class:Ue(["flex items-center mb-2 relative",{"bg-gray-200":i.draggingIndex===a}])},[l("span",Yst,W(o),1),l("div",$st,[l("button",{onClick:c=>r.removeItem(a),class:"text-red-500 hover:text-red-700 p-2"},e[5]||(e[5]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)]),8,Wst),a>0?(T(),w("button",{key:0,onClick:c=>r.moveUp(a),class:"bg-gray-300 hover:bg-gray-400 p-2 rounded mr-2"},e[6]||(e[6]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"})],-1)]),8,Kst)):B("",!0),ar.moveDown(a),class:"bg-gray-300 hover:bg-gray-400 p-2 rounded"},e[7]||(e[7]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)]),8,jst)):B("",!0)]),i.draggingIndex===a?(T(),w("div",{key:0,class:"absolute top-0 left-0 w-full h-full bg-gray-200 opacity-50 cursor-move",onMousedown:c=>r.startDragging(a),onMousemove:c=>r.dragItem(a),onMouseup:e[3]||(e[3]=(...c)=>r.stopDragging&&r.stopDragging(...c))},null,40,Qst)):B("",!0)],2))),128))])):B("",!0),t.modelValue.length>0?(T(),w("div",Xst,[l("button",{onClick:e[4]||(e[4]=(...o)=>r.removeAll&&r.removeAll(...o)),class:"bg-red-500 text-white px-6 py-2 rounded hover:bg-red-600 text-lg"},"Remove All")])):B("",!0)])}const Jst=it(Vst,[["render",Zst]]),eit="/";Z.defaults.baseURL="/";const tit={components:{AddModelDialog:hst,ModelEntry:_nt,PersonalityViewer:Snt,PersonalityEntry:Y0,BindingEntry:lst,ChoiceDialog:$0,Card:pp,StringListManager:Jst,RadioOptions:Bst},data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},defaultModelImgPlaceholder:Ls,snd_input_devices:[],snd_input_devices_indexes:[],snd_output_devices:[],snd_output_devices_indexes:[],voices:[],voice_languages:{Arabic:"ar","Brazilian Portuguese":"pt",Chinese:"zh-cn",Czech:"cs",Dutch:"nl",English:"en",French:"fr",German:"de",Italian:"it",Polish:"pl",Russian:"ru",Spanish:"es",Turkish:"tr",Japanese:"ja",Korean:"ko",Hungarian:"hu",Hindi:"hi"},storeLogo:Us,binding_changed:!1,SVGGPU:Gst,models_zoo:[],models_zoo_initialLoadCount:10,models_zoo_loadMoreCount:5,models_zoo_loadedEntries:[],models_zoo_scrollThreshold:200,sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],comfyui_models:[],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],collapsedArr:[],all_collapsed:!0,data_conf_collapsed:!0,internet_conf_collapsed:!0,servers_conf_collapsed:!0,mainconf_collapsed:!0,smartrouterconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,ezl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:eit,searchPersonality:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){try{this.$store.state.loading_infos="Getting Hardware usage",await this.refreshHardwareUsage(this.$store)}catch(n){console.log("Error cought:",n)}Ye.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{fetchElevenLabsVoices(){fetch("https://api.elevenlabs.io/v1/voices").then(n=>n.json()).then(n=>{this.voices=n.voices}).catch(n=>console.error("Error fetching voices:",n))},async refreshHardwareUsage(n){await n.dispatch("refreshDiskUsage"),await n.dispatch("refreshRamUsage"),await n.dispatch("refreshVramUsage")},addDataSource(){this.$store.state.config.rag_databases.push(""),this.settingsChanged=!0},removeDataSource(n){this.$store.state.config.rag_databases.splice(n,1),this.settingsChanged=!0},async vectorize_folder(n){await Z.post("/vectorize_folder",{client_id:this.$store.state.client_id,db_path:this.$store.state.config.rag_databases[n]},this.posts_headers)},async select_folder(n){try{Ye.on("rag_db_added",e=>{console.log(e),e?(this.$store.state.config.rag_databases[n]=`${e.database_name}::${e.database_path}`,this.settingsChanged=!0):this.$store.state.toast.showToast("Failed to select a folder",4,!1)}),await Z.post("/add_rag_database",{client_id:this.$store.state.client_id},this.posts_headers)}catch{this.$store.state.toast.showToast("Failed to select a folder",4,!1)}},handleTemplateSelection(n){console.log("handleTemplateSelection");const e=n.target.value;console.log("handleTemplateSelection: ",e),e==="lollms"?(console.log("Using lollms template"),this.configFile.start_header_id_template="!@>",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` `,this.configFile.start_user_header_id_template="!@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="!@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="lollms_simplified"?(console.log("Using lollms template"),this.configFile.start_header_id_template="@>",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` `,this.configFile.start_user_header_id_template="@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="bare"?(console.log("Using lollms template"),this.configFile.start_header_id_template="",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` `,this.configFile.start_user_header_id_template="",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="llama3"?(console.log("Using llama3 template"),this.configFile.start_header_id_template="<|start_header_id|>",this.configFile.system_message_template="system",this.configFile.end_header_id_template="<|end_header_id|>",this.configFile.separator_template="<|eot_id|>",this.configFile.start_user_header_id_template="<|start_header_id|>",this.configFile.end_user_header_id_template="<|end_header_id|>",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="<|start_header_id|>",this.configFile.end_ai_header_id_template="<|end_header_id|>",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="mistral"&&(console.log("Using mistral template"),this.configFile.start_header_id_template="[INST]",this.configFile.system_message_template=" Using this information",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` -`,this.configFile.start_user_header_id_template="[INST]",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="[/INST]",this.configFile.start_ai_header_id_template="[INST]",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="[/INST]",this.settingsChanged=!0)},install_model(){},reinstallDiffusersService(){Z.post("/install_diffusers",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},upgradeDiffusersService(){Z.post("install_diffusers",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallXTTSService(){Z.post("install_xtts",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallWhisperService(){Z.post("install_whisper",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallSDService(){Z.post("/install_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},upgradeSDService(){Z.post("upgrade_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},startSDService(){Z.post("start_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},showSD(){Z.post("show_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallComfyUIService(){Z.post("install_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},upgradeComfyUIService(){Z.post("upgrade_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startComfyUIService(){Z.post("start_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},showComfyui(){Z.post("show_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallvLLMService(){Z.post("install_vllm",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startvLLMService(){Z.post("start_vllm",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startollamaService(){Z.post("start_ollama",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallPetalsService(){Z.post("install_petals",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallOLLAMAService(){Z.post("install_ollama",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallElasticSearchService(){Z.post("install_vllm",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},getSeviceVoices(){Z.get("list_voices").then(n=>{this.voices=n.data.voices}).catch(n=>{console.error(n)})},load_more_models(){this.models_zoo_initialLoadCount+10{Ve.replace()}),this.binding_changed&&!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this.$store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo(),this.binding_changed=!1)},async selectSortOption(n){this.$store.state.sort_type=n,this.updateModelsZoo(),console.log(`Selected sorting:${n}`),console.log(`models:${this.models_zoo}`)},handleRadioSelected(n){this.isLoading=!0,this.selectSortOption(n).then(()=>{this.isLoading=!1})},filter_installed(n){return console.log("filtering"),n.filter(e=>e.isInstalled===!0)},getVoices(){"speechSynthesis"in window&&(console.log("voice synthesis"),this.audioVoices=speechSynthesis.getVoices(),console.log("Voices:"+this.audioVoices),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let n=await this.api_get_req("check_update");this.has_updates=n.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(n){this.selected_variant=n},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(n){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let e=this.currenModelToInstall;if(e.linkNotValid){e.installing=!1,this.$store.state.toast.showToast("Link is not valid, file does not exist",4,!1);return}let t="https://huggingface.co/"+e.model.quantizer+"/"+e.model.name+"/resolve/main/"+this.selected_variant.name;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t},console.log("installing...",this.addModel);const s=i=>{if(console.log("received something"),i.status&&i.progress<=100){if(this.addModel=i,console.log("Progress",i),e.progress=i.progress,e.speed=i.speed,e.total_size=i.total_size,e.downloaded_size=i.downloaded_size,e.start_time=i.start_time,e.installing=!0,e.progress==100){const r=this.models_zoo.findIndex(o=>o.name===e.model.name);this.models_zoo[r].isInstalled=!0,this.showProgress=!1,e.installing=!1,console.log("Received succeeded"),qe.off("install_progress",s),console.log("Installed successfully"),this.$store.state.toast.showToast(`Model: +`,this.configFile.start_user_header_id_template="[INST]",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="[/INST]",this.configFile.start_ai_header_id_template="[INST]",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="[/INST]",this.settingsChanged=!0)},install_model(){},reinstallDiffusersService(){Z.post("/install_diffusers",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},upgradeDiffusersService(){Z.post("install_diffusers",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallXTTSService(){Z.post("install_xtts",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallWhisperService(){Z.post("install_whisper",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallSDService(){Z.post("/install_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},upgradeSDService(){Z.post("upgrade_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},startSDService(){Z.post("start_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},showSD(){Z.post("show_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallComfyUIService(){Z.post("install_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},upgradeComfyUIService(){Z.post("upgrade_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startComfyUIService(){Z.post("start_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},showComfyui(){Z.post("show_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallvLLMService(){Z.post("install_vllm",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startvLLMService(){Z.post("start_vllm",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startollamaService(){Z.post("start_ollama",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallPetalsService(){Z.post("install_petals",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallOLLAMAService(){Z.post("install_ollama",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallElasticSearchService(){Z.post("install_vllm",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},getSeviceVoices(){Z.get("list_voices").then(n=>{this.voices=n.data.voices}).catch(n=>{console.error(n)})},load_more_models(){this.models_zoo_initialLoadCount+10{Ve.replace()}),this.binding_changed&&!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this.$store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo(),this.binding_changed=!1)},async selectSortOption(n){this.$store.state.sort_type=n,this.updateModelsZoo(),console.log(`Selected sorting:${n}`),console.log(`models:${this.models_zoo}`)},handleRadioSelected(n){this.isLoading=!0,this.selectSortOption(n).then(()=>{this.isLoading=!1})},filter_installed(n){return console.log("filtering"),n.filter(e=>e.isInstalled===!0)},getVoices(){"speechSynthesis"in window&&(console.log("voice synthesis"),this.audioVoices=speechSynthesis.getVoices(),console.log("Voices:"+this.audioVoices),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let n=await this.api_get_req("check_update");this.has_updates=n.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(n){this.selected_variant=n},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(n){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let e=this.currenModelToInstall;if(e.linkNotValid){e.installing=!1,this.$store.state.toast.showToast("Link is not valid, file does not exist",4,!1);return}let t="https://huggingface.co/"+e.model.quantizer+"/"+e.model.name+"/resolve/main/"+this.selected_variant.name;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t},console.log("installing...",this.addModel);const s=i=>{if(console.log("received something"),i.status&&i.progress<=100){if(this.addModel=i,console.log("Progress",i),e.progress=i.progress,e.speed=i.speed,e.total_size=i.total_size,e.downloaded_size=i.downloaded_size,e.start_time=i.start_time,e.installing=!0,e.progress==100){const r=this.models_zoo.findIndex(o=>o.name===e.model.name);this.models_zoo[r].isInstalled=!0,this.showProgress=!1,e.installing=!1,console.log("Received succeeded"),Ye.off("install_progress",s),console.log("Installed successfully"),this.$store.state.toast.showToast(`Model: `+e.model.name+` -installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else qe.off("install_progress",s),console.log("Install failed"),e.installing=!1,this.showProgress=!1,console.error("Installation failed:",i.error),this.$store.state.toast.showToast(`Model: +installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else Ye.off("install_progress",s),console.log("Install failed"),e.installing=!1,this.showProgress=!1,console.error("Installation failed:",i.error),this.$store.state.toast.showToast(`Model: `+e.model.name+` -failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage");console.log("Here")};qe.on("install_progress",s),qe.emit("install_model",{path:t,name:e.model.name,variant_name:this.selected_variant.name,type:e.model.type}),console.log("Started installation, please wait")},resetLogo(){this.configFile.app_custom_logo="",this.settingsChanged=!0},resetAvatar(){this.configFile.user_avatar="",this.settingsChanged=!0},uploadLogo(n){const e=n.target.files[0],t=new FormData;t.append("logo",e),console.log("Uploading logo"),Z.post("/upload_logo",t).then(s=>{console.log("Logo uploaded successfully"),this.$store.state.toast.showToast("Avatar uploaded successfully!",4,!0);const i=s.data.fileName;console.log("response",s),this.app_custom_logo=i,this.$store.state.config.app_custom_logo=i,this.settingsChanged=!0}).catch(s=>{console.error("Error uploading avatar:",s)})},uploadAvatar(n){const e=n.target.files[0],t=new FormData;t.append("avatar",e),console.log("Uploading avatar"),Z.post("/upload_avatar",t).then(s=>{console.log("Avatar uploaded successfully"),this.$store.state.toast.showToast("Avatar uploaded successfully!",4,!0);const i=s.data.fileName;console.log("response",s),this.user_avatar=i,this.$store.state.config.user_avatar=i,this.settingsChanged=!0}).catch(s=>{console.error("Error uploading avatar:",s)})},async update_software(){console.log("Posting");const n=await this.api_post_req("update_software");console.log("Posting done"),n.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Failure!",4,!1)},async restart_software(){console.log("Posting");const n=await this.api_post_req("restart_program");console.log("Posting done"),n.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Failure!",4,!1)},on_loading_text(n){console.log("Loading text",n),this.loading_text=n},async load_everything(){for(this.isLoading=!0,Le(()=>{Ve.replace()});this.isReady===!1;)await new Promise(n=>setTimeout(n,100));this.refresh(),console.log("Ready"),this.configFile.model_name&&(this.isModelSelected=!0),this.persCatgArr=await this.api_get_req("list_personalities_categories"),this.persArr=await this.api_get_req("list_personalities?category="+this.configFile.personality_category),console.log("category"),this.personality_category=this.configFile.personality_category,this.personalitiesFiltered=this.$store.state.personalities.filter(n=>n.category===this.configFile.personality_category),this.modelsFiltered=[],this.updateModelsZoo(),this.isLoading=!1,this.isMounted=!0,console.log("READY Stuff")},async open_mzl(){this.mzl_collapsed=!this.mzl_collapsed,console.log("Fetching models")},async getVramUsage(){await this.api_get_req("vram_usage")},async progressListener(n){if(console.log("received something"),n.status==="progress"){if(this.$refs.modelZoo){const e=this.$refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(console.log("model entry",t),t.installing=!0,t.progress=n.progress,console.log(`Progress = ${n.progress}`),n.progress>=100?(t.installing=!1,t.isInstalled=!0):(t.installing=!0,t.isInstalled=!0))}}else if(n.status==="succeeded"){if(console.log("Received succeeded"),this.$refs.modelZoo){const e=this.$refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];n.progress>=100&&(t.installing=!1,t.isInstalled=!0)}if(console.log("Installed successfully"),this.$refs.modelZoo){const e=this.$refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(t.installing=!1,t.isInstalled=!0)}this.$store.state.toast.showToast(`Model: +failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage");console.log("Here")};Ye.on("install_progress",s),Ye.emit("install_model",{path:t,name:e.model.name,variant_name:this.selected_variant.name,type:e.model.type}),console.log("Started installation, please wait")},resetLogo(){this.configFile.app_custom_logo="",this.settingsChanged=!0},resetAvatar(){this.configFile.user_avatar="",this.settingsChanged=!0},uploadLogo(n){const e=n.target.files[0],t=new FormData;t.append("logo",e),console.log("Uploading logo"),Z.post("/upload_logo",t).then(s=>{console.log("Logo uploaded successfully"),this.$store.state.toast.showToast("Avatar uploaded successfully!",4,!0);const i=s.data.fileName;console.log("response",s),this.app_custom_logo=i,this.$store.state.config.app_custom_logo=i,this.settingsChanged=!0}).catch(s=>{console.error("Error uploading avatar:",s)})},uploadAvatar(n){const e=n.target.files[0],t=new FormData;t.append("avatar",e),console.log("Uploading avatar"),Z.post("/upload_avatar",t).then(s=>{console.log("Avatar uploaded successfully"),this.$store.state.toast.showToast("Avatar uploaded successfully!",4,!0);const i=s.data.fileName;console.log("response",s),this.user_avatar=i,this.$store.state.config.user_avatar=i,this.settingsChanged=!0}).catch(s=>{console.error("Error uploading avatar:",s)})},async update_software(){console.log("Posting");const n=await this.api_post_req("update_software");console.log("Posting done"),n.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Failure!",4,!1)},async restart_software(){console.log("Posting");const n=await this.api_post_req("restart_program");console.log("Posting done"),n.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Failure!",4,!1)},on_loading_text(n){console.log("Loading text",n),this.loading_text=n},async load_everything(){for(this.isLoading=!0,Le(()=>{Ve.replace()});this.isReady===!1;)await new Promise(n=>setTimeout(n,100));this.refresh(),console.log("Ready"),this.configFile.model_name&&(this.isModelSelected=!0),this.persCatgArr=await this.api_get_req("list_personalities_categories"),this.persArr=await this.api_get_req("list_personalities?category="+this.configFile.personality_category),console.log("category"),this.personality_category=this.configFile.personality_category,this.personalitiesFiltered=this.$store.state.personalities.filter(n=>n.category===this.configFile.personality_category),this.modelsFiltered=[],this.updateModelsZoo(),this.isLoading=!1,this.isMounted=!0,console.log("READY Stuff")},async open_mzl(){this.mzl_collapsed=!this.mzl_collapsed,console.log("Fetching models")},async getVramUsage(){await this.api_get_req("vram_usage")},async progressListener(n){if(console.log("received something"),n.status==="progress"){if(this.$refs.modelZoo){const e=this.$refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(console.log("model entry",t),t.installing=!0,t.progress=n.progress,console.log(`Progress = ${n.progress}`),n.progress>=100?(t.installing=!1,t.isInstalled=!0):(t.installing=!0,t.isInstalled=!0))}}else if(n.status==="succeeded"){if(console.log("Received succeeded"),this.$refs.modelZoo){const e=this.$refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];n.progress>=100&&(t.installing=!1,t.isInstalled=!0)}if(console.log("Installed successfully"),this.$refs.modelZoo){const e=this.$refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(t.installing=!1,t.isInstalled=!0)}this.$store.state.toast.showToast(`Model: `+model_object.name+` installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}else if(n.status==="failed"&&(console.log("Install failed"),this.$refs.modelZoo)){const e=this.$refs.modelZoo.findIndex(s=>s.model.name==n.model_name&&this.configFile.binding_name==n.binding_folder),t=this.models_zoo[e];t&&(t.installing=!1,t.isInstalled=!1),console.error("Installation failed:",n.error),this.$store.state.toast.showToast(`Model: `+model_object.name+` -failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage")}},showAddModelDialog(){this.$refs.addmodeldialog.showDialog("").then(()=>{console.log(this.$refs.addmodeldialog.model_path);const n=this.$refs.addmodeldialog.model_path;qe.emit("install_model",{path:n,type:this.models_zoo[0].type},e=>{console.log("Model installation successful:",e)}),console.log(this.$refs.addmodeldialog.model_path)})},closeAddModelDialog(){this.addModelDialogVisibility=!1},collapseAll(n){this.servers_conf_collapsed=n,this.mainconf_collapsed=n,this.bec_collapsed=n,this.mzc_collapsed=n,this.pzc_collapsed=n,this.bzc_collapsed=n,this.pc_collapsed=n,this.mc_collapsed=n,this.sc_collapsed=n,this.mzdc_collapsed=n},fetchPersonalities(){this.api_get_req("list_personalities_categories").then(n=>{this.persCatgArr=n,this.persCatgArr.sort()}),this.api_get_req("list_personalities").then(n=>{this.persArr=n,this.persArr.sort(),console.log(`Listed personalities: +failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage")}},showAddModelDialog(){this.$refs.addmodeldialog.showDialog("").then(()=>{console.log(this.$refs.addmodeldialog.model_path);const n=this.$refs.addmodeldialog.model_path;Ye.emit("install_model",{path:n,type:this.models_zoo[0].type},e=>{console.log("Model installation successful:",e)}),console.log(this.$refs.addmodeldialog.model_path)})},closeAddModelDialog(){this.addModelDialogVisibility=!1},collapseAll(n){this.servers_conf_collapsed=n,this.mainconf_collapsed=n,this.bec_collapsed=n,this.mzc_collapsed=n,this.pzc_collapsed=n,this.bzc_collapsed=n,this.pc_collapsed=n,this.mc_collapsed=n,this.sc_collapsed=n,this.mzdc_collapsed=n},fetchPersonalities(){this.api_get_req("list_personalities_categories").then(n=>{this.persCatgArr=n,this.persCatgArr.sort()}),this.api_get_req("list_personalities").then(n=>{this.persArr=n,this.persArr.sort(),console.log(`Listed personalities: ${n}`)})},fetchHardwareInfos(){this.$store.dispatch("refreshDiskUsage"),this.$store.dispatch("refreshRamUsage")},async onPersonalitySelected(n){if(console.log("on pers",n),this.isLoading&&this.$store.state.toast.showToast("Loading... please wait",4,!1),this.isLoading=!0,console.log("selecting ",n),n){if(n.selected){this.$store.state.toast.showToast("Personality already selected",4,!0),this.isLoading=!1;return}let e=n.language==null?n.full_path:n.full_path+":"+n.language;if(console.log("pth",e),n.isMounted&&this.configFile.personalities.includes(e)){const t=await this.select_personality(n);console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this.$store.state.toast.showToast(`Selected personality: `+n.name,4,!0):this.$store.state.toast.showToast(`Error on select personality: `+n.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.mountPersonality(n);Le(()=>{Ve.replace()})}},onModelSelected(n){if(this.isLoading){this.$store.state.toast.showToast("Loading... please wait",4,!1);return}n&&(n.isInstalled?this.update_model(n.model.name).then(e=>{console.log("update_model",e),this.configFile.model_name=n.model.name,e.status?(this.$store.state.toast.showToast(`Selected model: @@ -121,20 +121,20 @@ Download: ${"https://huggingface.co/"+n.quantizer+"/"+n.name} License: ${n.license} Owner: ${n.quantizer} Website: ${"https://huggingface.co/"+n.quantizer} -Description: ${n.description}`,this.$store.state.toast.showToast("Copied model info to clipboard!",4,!0),navigator.clipboard.writeText(e.trim())},onCopyLink(n){this.$store.state.toast.showToast("Copied link to clipboard!",4,!0),navigator.clipboard.writeText(n.model.name)},onCopyPersonalityName(n){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},async onCopyToCustom(n){await Z.post("/copy_to_custom_personas",{client_id:this.$store.state.client_id,category:n.personality.category,name:n.personality.name})},async handleOpenFolder(n){await Z.post("/open_personality_folder",{client_id:this.$store.state.client_id,personality_folder:n.personality.category/n.personality.folder})},onCancelInstall(){const n=this.addModel;console.log("cancel install",n),this.modelDownlaodInProgress=!1,this.addModel={},qe.emit("cancel_install",{model_name:n.model_name,binding_folder:n.binding_folder,model_url:n.model_url,patreon:n.patreon?n.patreon:"None"}),this.$store.state.toast.showToast("Model installation aborted",4,!1)},onInstall(n){this.variant_choices=n.model.variants,this.currenModelToInstall=n,console.log("variant_choices"),console.log(this.variant_choices),console.log(n),this.variantSelectionDialogVisible=!0},onCreateReference(){Z.post("/add_reference_to_local_model",{path:this.reference_path}).then(n=>{n.status?(this.$store.state.toast.showToast("Reference created",4,!0),this.is_loading_zoo=!0,this.refreshModelsZoo().then(()=>{this.updateModelsZoo(),this.is_loading_zoofalse})):this.$store.state.toast.showToast("Couldn't create reference",4,!1)})},onInstallAddModel(){if(!this.addModel.url){this.$store.state.toast.showToast("Link is empty",4,!1);return}let n=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=t=>{console.log("received something"),t.status&&t.progress<=100?(console.log("Progress",t),this.addModel=t,this.addModel.url=n,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),qe.off("install_progress",e),console.log("Installed successfully"),this.addModel={},this.$store.state.toast.showToast(`Model: +Description: ${n.description}`,this.$store.state.toast.showToast("Copied model info to clipboard!",4,!0),navigator.clipboard.writeText(e.trim())},onCopyLink(n){this.$store.state.toast.showToast("Copied link to clipboard!",4,!0),navigator.clipboard.writeText(n.model.name)},onCopyPersonalityName(n){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},async onCopyToCustom(n){await Z.post("/copy_to_custom_personas",{client_id:this.$store.state.client_id,category:n.personality.category,name:n.personality.name})},async handleOpenFolder(n){await Z.post("/open_personality_folder",{client_id:this.$store.state.client_id,personality_folder:n.personality.category/n.personality.folder})},onCancelInstall(){const n=this.addModel;console.log("cancel install",n),this.modelDownlaodInProgress=!1,this.addModel={},Ye.emit("cancel_install",{model_name:n.model_name,binding_folder:n.binding_folder,model_url:n.model_url,patreon:n.patreon?n.patreon:"None"}),this.$store.state.toast.showToast("Model installation aborted",4,!1)},onInstall(n){this.variant_choices=n.model.variants,this.currenModelToInstall=n,console.log("variant_choices"),console.log(this.variant_choices),console.log(n),this.variantSelectionDialogVisible=!0},onCreateReference(){Z.post("/add_reference_to_local_model",{path:this.reference_path}).then(n=>{n.status?(this.$store.state.toast.showToast("Reference created",4,!0),this.is_loading_zoo=!0,this.refreshModelsZoo().then(()=>{this.updateModelsZoo(),this.is_loading_zoofalse})):this.$store.state.toast.showToast("Couldn't create reference",4,!1)})},onInstallAddModel(){if(!this.addModel.url){this.$store.state.toast.showToast("Link is empty",4,!1);return}let n=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=t=>{console.log("received something"),t.status&&t.progress<=100?(console.log("Progress",t),this.addModel=t,this.addModel.url=n,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),Ye.off("install_progress",e),console.log("Installed successfully"),this.addModel={},this.$store.state.toast.showToast(`Model: `+this.addModel.model_name+` -installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(qe.off("install_progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",t.error),this.$store.state.toast.showToast(`Model: +installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(Ye.off("install_progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",t.error),this.$store.state.toast.showToast(`Model: `+this.addModel.model_name+` -failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};qe.on("install_progress",e),qe.emit("install_model",{path:n,type:this.models_zoo[0].type}),console.log("Started installation, please wait")},uploadLocalModel(){if(this.uploadData.length==0){this.$store.state.toast.showToast("No files to upload",4,!1);return}let n=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=t=>{console.log("received something"),t.status&&t.progress<=100?(console.log("Progress",t),this.addModel=t,this.addModel.url=n,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),qe.off("progress",e),console.log("Installed successfully"),this.addModel={},this.$store.state.toast.showToast(`Model: +failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Ye.on("install_progress",e),Ye.emit("install_model",{path:n,type:this.models_zoo[0].type}),console.log("Started installation, please wait")},uploadLocalModel(){if(this.uploadData.length==0){this.$store.state.toast.showToast("No files to upload",4,!1);return}let n=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=t=>{console.log("received something"),t.status&&t.progress<=100?(console.log("Progress",t),this.addModel=t,this.addModel.url=n,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),Ye.off("progress",e),console.log("Installed successfully"),this.addModel={},this.$store.state.toast.showToast(`Model: `+this.addModel.model_name+` -installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(qe.off("progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",t.error),this.$store.state.toast.showToast(`Model: +installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(Ye.off("progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",t.error),this.$store.state.toast.showToast(`Model: `+this.addModel.model_name+` -failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};qe.on("progress",e),console.log("Started installation, please wait")},setFileList(n){this.uploadData=n.target.files,console.log("set file list",this.uploadData)},onUninstall(n){this.$store.state.yesNoDialog.askQuestion(`Are you sure you want to delete this model? - [`+n.name+"]","Yes","Cancel").then(e=>{if(e){console.log("uninstalling model...");const t=s=>{console.log("uninstalling res",s),s.status?(console.log("uninstalling success",s),n.uninstalling=!1,qe.off("install_progress",t),this.showProgress=!1,this.is_loading_zoo=!0,this.refreshModelsZoo().then(()=>{this.updateModelsZoo(),this.is_loading_zoo=!1}),this.modelsFiltered=this.models_zoo,this.$store.state.toast.showToast(`Model: +failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Ye.on("progress",e),console.log("Started installation, please wait")},setFileList(n){this.uploadData=n.target.files,console.log("set file list",this.uploadData)},onUninstall(n){this.$store.state.yesNoDialog.askQuestion(`Are you sure you want to delete this model? + [`+n.name+"]","Yes","Cancel").then(e=>{if(e){console.log("uninstalling model...");const t=s=>{console.log("uninstalling res",s),s.status?(console.log("uninstalling success",s),n.uninstalling=!1,Ye.off("install_progress",t),this.showProgress=!1,this.is_loading_zoo=!0,this.refreshModelsZoo().then(()=>{this.updateModelsZoo(),this.is_loading_zoo=!1}),this.modelsFiltered=this.models_zoo,this.$store.state.toast.showToast(`Model: `+n.model.name+` -was uninstalled!`,4,!0),this.$store.dispatch("refreshDiskUsage")):(console.log("uninstalling failed",s),n.uninstalling=!1,this.showProgress=!1,qe.off("uninstall_progress",t),console.error("Uninstallation failed:",s.error),this.$store.state.toast.showToast(`Model: +was uninstalled!`,4,!0),this.$store.dispatch("refreshDiskUsage")):(console.log("uninstalling failed",s),n.uninstalling=!1,this.showProgress=!1,Ye.off("uninstall_progress",t),console.error("Uninstallation failed:",s.error),this.$store.state.toast.showToast(`Model: `+n.model.name+` -failed to uninstall!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};qe.on("uninstall_progress",t),this.selected_variant!=null?qe.emit("uninstall_model",{path:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name+"/resolve/main/"+this.selected_variant.name,type:n.model.type}):qe.emit("uninstall_model",{path:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name,type:n.model.type})}})},onBindingSelected(n){if(console.log("Binding selected"),!n.binding.installed){this.$store.state.toast.showToast(`Binding is not installed: +failed to uninstall!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Ye.on("uninstall_progress",t),this.selected_variant!=null?Ye.emit("uninstall_model",{path:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name+"/resolve/main/"+this.selected_variant.name,type:n.model.type}):Ye.emit("uninstall_model",{path:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name,type:n.model.type})}})},onBindingSelected(n){if(console.log("Binding selected"),!n.binding.installed){this.$store.state.toast.showToast(`Binding is not installed: `+n.binding.name,4,!1);return}this.mzc_collapsed=!0,this.configFile.binding_name!=n.binding.folder&&(this.update_binding(n.binding.folder),this.binding_changed=!0),this.api_get_req("get_model_status").then(e=>{this.$store.commit("setIsModelOk",e)})},onInstallBinding(n){this.configFile.binding_name!=n.binding.folder?(this.isLoading=!0,n.disclaimer&&this.$store.state.yesNoDialog.askQuestion(n.disclaimer,"Proceed","Cancel"),Z.post("/install_binding",{name:n.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("install_binding",e),e.data.status?(this.$store.state.toast.showToast("Binding installed successfully!",4,!0),this.$store.state.messageBox.showMessage(`It is advised to reboot the application after installing a binding. Page will refresh in 5s.`),setTimeout(()=>{window.location.href="/"},5e3)):this.$store.state.toast.showToast("Could not reinstall binding",4,!1),this.isLoading=!1,e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$store.state.toast.showToast(`Could not reinstall binding `+e.message,4,!1),{status:!1}))):this.update_binding(n.binding.folder)},onUnInstallBinding(n){this.isLoading=!0,Z.post("/unInstall_binding",{name:n.binding.folder}).then(e=>{if(e){if(this.isLoading=!1,console.log("unInstall_binding",e),e.data.status){const t=this.bindingsZoo.findIndex(i=>i.folder==n.binding.folder),s=this.bindingsZoo[t];s?s.installed=!0:s.installed=!1,this.settingsChanged=!0,this.binding_changed=!0,this.$store.state.toast.showToast("Binding uninstalled successfully!",4,!0)}else this.$store.state.toast.showToast("Could not uninstall binding",4,!1);return e.data}this.isLoading=!1,n.isInstalled=False}).catch(e=>(this.isLoading=!1,this.$store.state.toast.showToast(`Could not uninstall binding @@ -161,22 +161,22 @@ The possibilities are endless, they are now yours to mold and customize as you s Verify that the personality is not already copied there.`,4,!1)}).catch(e=>{this.$store.state.toast.showToast(`Personality couldn't be copied to the custom personalities folder: `,4,!1),console.error(e)})},async remountPersonality(n){await this.unmountPersonality(n),await this.mountPersonality(n)},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log("Personality path:",n.personality.path),Z.post("/reinstall_personality",{client_id:this.$store.state.client_id,name:n.personality.path},{headers:this.posts_headers}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$store.state.toast.showToast("Personality reinstalled successfully!",4,!0):this.$store.state.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$store.state.toast.showToast(`Could not reinstall personality `+e.message,4,!1),{status:!1}))},personalityImgPlacehodler(n){n.target.src=Us},searchPersonality_func(){clearTimeout(this.searchPersonalityTimer),this.searchPersonality&&(this.searchPersonalityInProgress=!0,setTimeout(this.filterPersonalities,this.searchPersonalityTimerInterval))},searchModel_func(){this.filterModels()}},async mounted(){console.log("Getting voices"),this.getVoices(),console.log("Constructing"),this.load_everything(),this.getSeviceVoices();try{console.log("Loading input devices list");const n=await Z.get("/get_snd_input_devices");this.snd_input_devices=n.data.device_names,this.snd_input_devices_indexes=n.data.device_indexes}catch{console.log("Couldin't list input devices")}try{console.log("Loading output devices list");const n=await Z.get("/get_snd_output_devices");this.snd_output_devices=n.data.device_names,this.snd_output_devices_indexes=n.data.device_indexes}catch{console.log("Couldin't list output devices")}try{console.log("Getting comfyui models");const n=await Z.get("/list_comfyui_models");console.log("res is ",n),n.data.status&&(this.comfyui_models=n.data.models)}catch{console.log("Couldin't list output devices")}this.fetchElevenLabsVoices()},activated(){},computed:{full_template:{get(){return(this.configFile.start_header_id_template+this.configFile.system_message_template+this.configFile.end_header_id_template+" system message"+this.configFile.separator_template+this.configFile.start_user_header_id_template+"user name"+this.configFile.end_user_header_id_template+" User prompt"+this.configFile.separator_template+this.configFile.end_user_message_id_template+this.configFile.separator_template+this.configFile.start_ai_header_id_template+"ai personality"+this.configFile.end_ai_header_id_template+"ai response"+this.configFile.end_ai_message_id_template).replace(` -`,"
")}},rendered_models_zoo:{get(){return this.searchModel?this.show_only_installed_models?this.modelsFiltered.filter(n=>n.isInstalled===!0):this.modelsFiltered.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)):(console.log("this.models_zoo"),console.log(this.models_zoo),console.log(this.models_zoo_initialLoadCount),this.show_only_installed_models?this.models_zoo.filter(n=>n.isInstalled===!0):this.models_zoo.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)))}},imgBinding:{get(){if(!this.isMounted)return Ls;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Ls}}},imgModel:{get(){try{let n=this.$store.state.modelsZoo.findIndex(e=>e.name==this.$store.state.selectedModel);return n>=0?(console.log(`model avatar : ${this.$store.state.modelsZoo[n].icon}`),this.$store.state.modelsZoo[n].icon):Ls}catch{console.log("error")}if(!this.isMounted)return Ls;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Ls}}},isReady:{get(){return this.$store.state.ready}},audio_out_voice:{get(){return this.$store.state.config.audio_out_voice},set(n){this.$store.state.config.audio_out_voice=n}},openaiWhisperModels(){return["whisper-1"]},whisperModels(){return["tiny.en","tiny","base.en","base","small.en","small","medium.en","medium","large-v1","large-v2","large-v3","large"]},audioLanguages(){return[{code:"en-US",name:"English (US)"},{code:"en-GB",name:"English (UK)"},{code:"es-ES",name:"Spanish (Spain)"},{code:"es-MX",name:"Spanish (Mexico)"},{code:"fr-FR",name:"French (France)"},{code:"fr-CA",name:"French (Canada)"},{code:"de-DE",name:"German (Germany)"},{code:"it-IT",name:"Italian (Italy)"},{code:"pt-BR",name:"Portuguese (Brazil)"},{code:"pt-PT",name:"Portuguese (Portugal)"},{code:"ru-RU",name:"Russian (Russia)"},{code:"zh-CN",name:"Chinese (China)"},{code:"ja-JP",name:"Japanese (Japan)"},{code:"ar-SA",name:"Arabic (Saudi Arabia)"},{code:"tr-TR",name:"Turkish (Turkey)"},{code:"ms-MY",name:"Malay (Malaysia)"},{code:"ko-KR",name:"Korean (South Korea)"},{code:"nl-NL",name:"Dutch (Netherlands)"},{code:"sv-SE",name:"Swedish (Sweden)"},{code:"da-DK",name:"Danish (Denmark)"},{code:"fi-FI",name:"Finnish (Finland)"},{code:"no-NO",name:"Norwegian (Norway)"},{code:"pl-PL",name:"Polish (Poland)"},{code:"el-GR",name:"Greek (Greece)"},{code:"hu-HU",name:"Hungarian (Hungary)"},{code:"cs-CZ",name:"Czech (Czech Republic)"},{code:"th-TH",name:"Thai (Thailand)"},{code:"hi-IN",name:"Hindi (India)"},{code:"he-IL",name:"Hebrew (Israel)"},{code:"id-ID",name:"Indonesian (Indonesia)"},{code:"vi-VN",name:"Vietnamese (Vietnam)"},{code:"uk-UA",name:"Ukrainian (Ukraine)"},{code:"ro-RO",name:"Romanian (Romania)"},{code:"bg-BG",name:"Bulgarian (Bulgaria)"},{code:"hr-HR",name:"Croatian (Croatia)"},{code:"sr-RS",name:"Serbian (Serbia)"},{code:"sk-SK",name:"Slovak (Slovakia)"},{code:"sl-SI",name:"Slovenian (Slovenia)"},{code:"et-EE",name:"Estonian (Estonia)"},{code:"lv-LV",name:"Latvian (Latvia)"},{code:"lt-LT",name:"Lithuanian (Lithuania)"},{code:"ka-GE",name:"Georgian (Georgia)"},{code:"hy-AM",name:"Armenian (Armenia)"},{code:"az-AZ",name:"Azerbaijani (Azerbaijan)"},{code:"kk-KZ",name:"Kazakh (Kazakhstan)"},{code:"uz-UZ",name:"Uzbek (Uzbekistan)"},{code:"kkj-CM",name:"Kako (Cameroon)"},{code:"my-MM",name:"Burmese (Myanmar)"},{code:"ne-NP",name:"Nepali (Nepal)"},{code:"si-LK",name:"Sinhala (Sri Lanka)"}]},configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},userName:{get(){return this.$store.state.config.user_name},set(n){this.$store.state.config.user_name=n}},user_avatar:{get(){return this.$store.state.config.user_avatar!=""?"/user_infos/"+this.$store.state.config.user_avatar:Us},set(n){this.$store.state.config.user_avatar=n}},hardware_mode:{get(){return this.$store.state.config.hardware_mode},set(n){this.$store.state.config.hardware_mode=n}},auto_update:{get(){return this.$store.state.config.auto_update},set(n){this.$store.state.config.auto_update=n}},auto_speak:{get(){return this.$store.state.config.auto_speak},set(n){this.$store.state.config.auto_speak=n}},auto_read:{get(){return this.$store.state.config.auto_read},set(n){this.$store.state.config.auto_read=n}},xtts_current_language:{get(){return this.$store.state.config.xtts_current_language},set(n){console.log("Current xtts voice set to ",n),this.$store.state.config.xtts_current_language=n}},xtts_current_voice:{get(){return this.$store.state.config.xtts_current_voice===null||this.$store.state.config.xtts_current_voice===void 0?(console.log("current voice",this.$store.state.config.xtts_current_voice),"main_voice"):this.$store.state.config.xtts_current_voice},set(n){n=="main_voice"||n===void 0?(console.log("Current voice set to None"),this.$store.state.config.xtts_current_voice=null):(console.log("Current voice set to ",n),this.$store.state.config.xtts_current_voice=n)}},audio_pitch:{get(){return this.$store.state.config.audio_pitch},set(n){this.$store.state.config.audio_pitch=n}},audio_in_language:{get(){return this.$store.state.config.audio_in_language},set(n){this.$store.state.config.audio_in_language=n}},use_user_name_in_discussions:{get(){return this.$store.state.config.use_user_name_in_discussions},set(n){this.$store.state.config.use_user_name_in_discussions=n}},discussion_db_name:{get(){return this.$store.state.config.discussion_db_name},set(n){this.$store.state.config.discussion_db_name=n}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}},bindingsZoo:{get(){return this.$store.state.bindingsZoo},set(n){this.$store.commit("setbindingsZoo",n)}},modelsArr:{get(){return this.$store.state.modelsArr},set(n){this.$store.commit("setModelsArr",n)}},models:{get(){return this.models_zoo},set(n){this.$store.commit("setModelsZoo",n)}},installed_models:{get(){return this.models_zoo},set(n){this.$store.commit("setModelsZoo",n)}},diskUsage:{get(){return this.$store.state.diskUsage},set(n){this.$store.commit("setDiskUsage",n)}},ramUsage:{get(){return this.$store.state.ramUsage},set(n){this.$store.commit("setRamUsage",n)}},vramUsage:{get(){return this.$store.state.vramUsage},set(n){this.$store.commit("setVramUsage",n)}},disk_available_space(){return this.computedFileSize(this.diskUsage.available_space)},disk_binding_models_usage(){return console.log(`this.diskUsage : ${this.diskUsage}`),this.computedFileSize(this.diskUsage.binding_models_usage)},disk_percent_usage(){return this.diskUsage.percent_usage},disk_total_space(){return this.computedFileSize(this.diskUsage.total_space)},ram_available_space(){return this.computedFileSize(this.ramUsage.available_space)},ram_usage(){return this.computedFileSize(this.ramUsage.ram_usage)},ram_percent_usage(){return this.ramUsage.percent_usage},ram_total_space(){return this.computedFileSize(this.ramUsage.total_space)},model_name(){if(this.isMounted)return this.configFile.model_name},binding_name(){if(!this.isMounted)return null;const n=this.bindingsZoo.findIndex(e=>e.folder===this.configFile.binding_name);return n>-1?this.bindingsZoo[n].name:null},active_pesonality(){if(!this.isMounted)return null;const n=this.$store.state.personalities.findIndex(e=>e.full_path===this.configFile.personalities[this.configFile.active_personality_id]);return n>-1?this.$store.state.personalities[n].name:null},speed_computed(){return si(this.addModel.speed)},total_size_computed(){return si(this.addModel.total_size)},downloaded_size_computed(){return si(this.addModel.downloaded_size)}},watch:{bec_collapsed(){Le(()=>{Ve.replace()})},pc_collapsed(){Le(()=>{Ve.replace()})},mc_collapsed(){Le(()=>{Ve.replace()})},sc_collapsed(){Le(()=>{Ve.replace()})},showConfirmation(){Le(()=>{Ve.replace()})},mzl_collapsed(){Le(()=>{Ve.replace()})},pzl_collapsed(){Le(()=>{Ve.replace()})},ezl_collapsed(){Le(()=>{Ve.replace()})},bzl_collapsed(){Le(()=>{Ve.replace()})},all_collapsed(n){this.collapseAll(n),Le(()=>{Ve.replace()})},settingsChanged(n){this.$store.state.settingsChanged=n,Le(()=>{Ve.replace()})},isLoading(){Le(()=>{Ve.replace()})},searchPersonality(n){n==""&&this.filterPersonalities()},mzdc_collapsed(){Le(()=>{Ve.replace()})}},async beforeRouteLeave(n){await this.$router.isReady()}},nit={class:"container flex flex-row shadow-lg p-10 pt-0 overflow-y-scroll w-full background-color scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},sit={class:"sticky top-0 z-10 flex flex-row mb-2 p-3 gap-3 w-full rounded-b-lg panels-color shadow-lg"},iit={key:0,class:"flex gap-3 flex-1 items-center duration-75"},rit={key:1,class:"flex gap-3 flex-1 items-center"},oit={class:"flex gap-3 flex-1 items-center justify-end"},ait={class:"flex gap-3 items-center"},lit={key:0,class:"flex gap-3 items-center"},cit={key:1,role:"status"},dit={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},uit={class:"flex flex-row p-3"},pit={class:"text-base font-semibold cursor-pointer select-none items-center"},fit={class:"flex gap-2 items-center"},_it={key:0},mit=["src"],hit={class:"font-bold font-large text-lg"},git={key:1},bit={class:"flex gap-2 items-center"},yit=["src"],Eit={class:"font-bold font-large text-lg"},vit={class:"font-bold font-large text-lg"},Sit={class:"font-bold font-large text-lg"},Tit={class:"mb-2"},xit={class:"flex flex-col mx-2"},Cit={class:"p-2"},wit={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Rit={class:"mb-2"},Ait={class:"flex flex-col mx-2"},Nit={class:"p-2"},Mit={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Oit={class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Iit=["src"],kit={class:"flex flex-col mx-2"},Dit={class:"p-2"},Lit={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Pit={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Fit={class:"flex flex-row p-3"},Uit={class:"flex flex-col mb-2 px-3 pb-2"},Bit={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Git={style:{width:"100%"}},Vit={style:{width:"100%"}},zit={style:{width:"100%"}},Hit={style:{width:"100%"}},qit={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Yit={class:"flex flex-row p-3"},$it={class:"flex flex-col mb-2 px-3 pb-2"},Wit={class:"expand-to-fit bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Kit={for:"logo-upload"},jit=["src"],Qit={style:{width:"10%"}},Xit={class:"text-center items-center"},Zit={class:"flex flex-row"},Jit={style:{width:"100%"}},ert={class:"flex flex-row"},trt={class:"flex flex-row"},nrt={class:"flex flex-row"},srt={class:"flex flex-row"},irt={class:"flex flex-row"},rrt={class:"flex flex-row"},ort={class:"flex flex-row"},art={class:"flex flex-row"},lrt={class:"flex flex-row"},crt={class:"flex flex-row"},drt={class:"flex flex-row"},urt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},prt=["innerHTML"],frt={style:{width:"100%"}},_rt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},mrt={style:{width:"100%"}},hrt={style:{width:"100%"}},grt={style:{width:"100%"}},brt={style:{width:"100%"}},yrt={for:"avatar-upload"},Ert=["src"],vrt={style:{width:"10%"}},Srt={class:"flex flex-row"},Trt={style:{width:"100%"}},xrt={style:{width:"100%"}},Crt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},wrt={style:{width:"100%"}},Rrt={style:{width:"100%"}},Art={style:{width:"100%"}},Nrt={style:{width:"100%"}},Mrt={style:{width:"100%"}},Ort={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Irt={class:"flex flex-row"},krt={style:{width:"100%"}},Drt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Lrt={class:"flex flex-row"},Prt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Frt={class:"flex flex-row"},Urt={class:"flex flex-row"},Brt={class:"flex flex-row"},Grt={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Vrt={class:"flex flex-row p-3"},zrt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Hrt={style:{width:"100%"}},qrt=["onUpdate:modelValue"],Yrt=["onClick"],$rt=["onClick"],Wrt=["onClick"],Krt=["disabled"],jrt={key:0,value:"sentence-transformers/bert-base-nli-mean-tokens"},Qrt={key:1,value:"bert-base-uncased"},Xrt={key:2,value:"bert-base-multilingual-uncased"},Zrt={key:3,value:"bert-large-uncased"},Jrt={key:4,value:"bert-large-uncased-whole-word-masking-finetuned-squad"},eot={key:5,value:"distilbert-base-uncased"},tot={key:6,value:"roberta-base"},not={key:7,value:"roberta-large"},sot={key:8,value:"xlm-roberta-base"},iot={key:9,value:"xlm-roberta-large"},rot={key:10,value:"albert-base-v2"},oot={key:11,value:"albert-large-v2"},aot={key:12,value:"albert-xlarge-v2"},lot={key:13,value:"albert-xxlarge-v2"},cot={key:14,value:"sentence-transformers/all-MiniLM-L6-v2"},dot={key:15,value:"sentence-transformers/all-MiniLM-L12-v2"},uot={key:16,value:"sentence-transformers/all-distilroberta-v1"},pot={key:17,value:"sentence-transformers/all-mpnet-base-v2"},fot={key:18,value:"text-embedding-ada-002"},_ot={key:19,value:"text-embedding-babbage-001"},mot={key:20,value:"text-embedding-curie-001"},hot={key:21,value:"text-embedding-davinci-001"},got={key:22,disabled:""},bot={class:"flex flex-row"},yot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Eot={class:"flex flex-row"},vot={class:"flex flex-row"},Sot={class:"flex flex-row"},Tot={class:"flex flex-row"},xot={class:"flex flex-row"},Cot={style:{width:"100%"}},wot={class:"flex flex-row"},Rot={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Aot={class:"flex flex-row p-3"},Not={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Mot={class:"flex flex-row"},Oot={class:"flex flex-row"},Iot={class:"flex flex-row"},kot={class:"flex flex-row"},Dot={class:"flex flex-col"},Lot={class:"flex flex-col"},Pot={class:"flex flex-col"},Fot={class:"flex flex-col"},Uot={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Bot={class:"flex flex-row p-3"},Got={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Vot={style:{width:"100%"}},zot={style:{width:"100%"}},Hot={style:{width:"100%"}},qot={style:{width:"100%"}},Yot={style:{width:"100%"}},$ot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Wot={class:"flex flex-row"},Kot={class:"flex flex-row"},jot={class:"flex flex-row"},Qot={class:"flex flex-row"},Xot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Zot={style:{width:"100%"}},Jot={style:{width:"100%"}},eat={style:{width:"100%"}},tat={style:{width:"100%"}},nat={style:{width:"100%"}},sat={style:{width:"100%"}},iat={style:{width:"100%"}},rat={class:"flex flex-row"},oat={class:"flex flex-row"},aat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},lat={style:{width:"100%"}},cat=["value"],dat={style:{width:"100%"}},uat=["value"],pat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},fat={style:{width:"100%"}},_at={style:{width:"100%"}},mat={style:{width:"100%"}},hat={style:{width:"100%"}},gat={style:{width:"100%"}},bat={style:{width:"100%"}},yat={style:{width:"100%"}},Eat={style:{width:"100%"}},vat={style:{width:"100%"}},Sat={style:{width:"100%"}},Tat={style:{width:"100%"}},xat={style:{width:"100%"}},Cat={style:{width:"100%"}},wat={style:{width:"100%"}},Rat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Aat={class:"flex flex-row"},Nat={class:"flex flex-row"},Mat=["value"],Oat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Iat={class:"flex flex-row"},kat={class:"flex flex-row"},Dat=["value"],Lat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Pat={class:"flex flex-row"},Fat={class:"flex flex-row"},Uat=["value"],Bat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Gat={class:"flex flex-row"},Vat=["value"],zat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Hat={class:"flex flex-row"},qat=["value"],Yat={class:"flex flex-row"},$at=["value"],Wat={class:"flex flex-row"},Kat={class:"flex flex-row"},jat={class:"flex flex-row"},Qat={class:"flex flex-row"},Xat={class:"flex flex-row"},Zat={class:"flex flex-row"},Jat={class:"flex flex-row"},elt={class:"flex flex-row"},tlt={class:"flex flex-row"},nlt={class:"flex flex-row"},slt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},ilt={class:"flex flex-row"},rlt={class:"flex flex-row"},olt={class:"flex flex-row"},alt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},llt={class:"flex flex-row"},clt={class:"flex flex-row"},dlt={class:"flex flex-row"},ult={class:"flex flex-row"},plt={class:"flex flex-row"},flt=["value"],_lt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},mlt={class:"flex flex-row"},hlt={class:"flex flex-row"},glt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},blt={class:"flex flex-row"},ylt={class:"flex flex-row"},Elt={class:"flex flex-row"},vlt={class:"flex flex-row"},Slt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Tlt={class:"flex flex-row"},xlt={class:"flex flex-row"},Clt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},wlt={class:"flex flex-row"},Rlt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Alt={class:"flex flex-row"},Nlt={class:"flex flex-row"},Mlt={class:"flex flex-row"},Olt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Ilt={class:"flex flex-row"},klt={class:"flex flex-row"},Dlt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Llt={class:"flex flex-row"},Plt={class:"flex flex-row"},Flt=["value"],Ult={class:"flex flex-row"},Blt={class:"flex flex-row"},Glt={class:"flex flex-row"},Vlt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},zlt={class:"flex flex-row"},Hlt={class:"flex flex-row"},qlt={class:"flex flex-row"},Ylt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},$lt={class:"flex flex-row"},Wlt={class:"flex flex-row"},Klt={class:"flex flex-row"},jlt={class:"flex flex-col align-bottom"},Qlt={class:"relative"},Xlt={class:"absolute right-0"},Zlt={class:"flex flex-row"},Jlt={class:"flex flex-row"},ect={class:"flex flex-row"},tct={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},nct={class:"flex flex-row"},sct={class:"flex flex-row"},ict={class:"flex flex-row"},rct={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},oct={class:"flex flex-row"},act={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},lct={class:"flex flex-row"},cct={class:"flex flex-row"},dct={class:"flex flex-row"},uct={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},pct={class:"flex flex-row p-3"},fct={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},_ct={key:1,class:"mr-2"},mct={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},hct={class:"flex gap-1 items-center"},gct=["src"],bct={class:"font-bold font-large text-lg line-clamp-1"},yct={key:0,class:"mb-2"},Ect={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},vct={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Sct={class:"flex flex-row p-3"},Tct={class:"flex flex-row items-center"},xct={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Cct={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},wct={key:2,class:"mr-2"},Rct={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},Act={class:"flex gap-1 items-center"},Nct=["src"],Mct={class:"font-bold font-large text-lg line-clamp-1"},Oct={class:"mx-2 mb-4"},Ict={class:"relative"},kct={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Dct={key:0},Lct={key:1},Pct={key:0,role:"status",class:"text-center w-full display: flex;align-items: center;"},Fct={key:1,class:"mb-2"},Uct={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Bct={class:"mb-2"},Gct={class:"p-2"},Vct={class:"mb-3"},zct={key:0},Hct={class:"mb-3"},qct={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},Yct={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},$ct={class:"w-full p-2"},Wct={class:"flex justify-between mb-1"},Kct={class:"text-sm font-medium text-blue-700 dark:text-white"},jct=["title"],Qct={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Xct={class:"flex justify-between mb-1"},Zct={class:"text-base font-medium text-blue-700 dark:text-white"},Jct={class:"text-sm font-medium text-blue-700 dark:text-white"},edt={class:"flex flex-grow"},tdt={class:"flex flex-row flex-grow gap-3"},ndt={class:"p-2 text-center grow"},sdt={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},idt={class:"flex flex-row p-3 items-center"},rdt={key:0,class:"mr-2"},odt={class:"mr-2 font-bold font-large text-lg line-clamp-1"},adt={key:1,class:"mr-2"},ldt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},cdt={key:0,class:"flex -space-x-4 items-center"},ddt={class:"group items-center flex flex-row"},udt=["onClick"],pdt=["src","title"],fdt=["onClick"],_dt={class:"mx-2 mb-4"},mdt={class:"relative"},hdt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},gdt={key:0},bdt={key:1},ydt={key:0,class:"mx-2 mb-4"},Edt={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},vdt=["selected"],Sdt={key:0,class:"mb-2"},Tdt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},xdt={class:"flex flex-col mb-2 p-3 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Cdt={class:"flex flex-row"},wdt={class:"m-2"},Rdt={class:"flex flex-row gap-2 items-center"},Adt={class:"m-2"},Ndt={class:"m-2"},Mdt={class:"flex flex-col align-bottom"},Odt={class:"relative"},Idt={class:"absolute right-0"},kdt={class:"m-2"},Ddt={class:"flex flex-col align-bottom"},Ldt={class:"relative"},Pdt={class:"absolute right-0"},Fdt={class:"m-2"},Udt={class:"flex flex-col align-bottom"},Bdt={class:"relative"},Gdt={class:"absolute right-0"},Vdt={class:"m-2"},zdt={class:"flex flex-col align-bottom"},Hdt={class:"relative"},qdt={class:"absolute right-0"},Ydt={class:"m-2"},$dt={class:"flex flex-col align-bottom"},Wdt={class:"relative"},Kdt={class:"absolute right-0"},jdt={class:"m-2"},Qdt={class:"flex flex-col align-bottom"},Xdt={class:"relative"},Zdt={class:"absolute right-0"};function Jdt(n,e,t,s,i,r){const o=et("StringListManager"),a=et("Card"),c=et("BindingEntry"),d=et("RadioOptions"),u=et("model-entry"),_=et("personality-entry"),m=et("AddModelDialog"),h=et("ChoiceDialog");return T(),w(Be,null,[l("div",nit,[l("div",sit,[i.showConfirmation?(T(),w("div",iit,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=K(f=>i.showConfirmation=!1,["stop"]))},e[471]||(e[471]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=K(f=>r.save_configuration(),["stop"]))},e[472]||(e[472]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),i.showConfirmation?B("",!0):(T(),w("div",rit,[l("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=f=>r.reset_configuration())},e[473]||(e[473]=[l("i",{"data-feather":"refresh-ccw"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[3]||(e[3]=K(f=>i.all_collapsed=!i.all_collapsed,["stop"]))},e[474]||(e[474]=[l("i",{"data-feather":"list"},null,-1)]))])),l("div",oit,[l("button",{title:"Clear uploads",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[4]||(e[4]=f=>r.api_get_req("clear_uploads").then(g=>{g.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},e[475]||(e[475]=[l("i",{"data-feather":"trash-2"},null,-1)])),l("button",{title:"Restart program",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[5]||(e[5]=f=>r.api_post_req("restart_program").then(g=>{g.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},e[476]||(e[476]=[l("i",{"data-feather":"refresh-ccw"},null,-1)])),i.has_updates?(T(),w("button",{key:0,title:"Upgrade program ",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[6]||(e[6]=f=>r.api_post_req("update_software").then(g=>{g.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Success!",4,!0)}))},e[477]||(e[477]=[l("i",{"data-feather":"arrow-up-circle"},null,-1),l("i",{"data-feather":"alert-circle"},null,-1)]))):B("",!0),l("div",ait,[i.settingsChanged?(T(),w("div",lit,[i.isLoading?B("",!0):(T(),w("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[7]||(e[7]=K(f=>r.applyConfiguration(),["stop"]))},e[478]||(e[478]=[l("div",{class:"flex flex-row"},[l("p",{class:"text-green-600 font-bold hover:text-green-300 ml-4 pl-4 mr-4 pr-4"},"Apply changes:"),l("i",{"data-feather":"check"})],-1)]))),i.isLoading?B("",!0):(T(),w("button",{key:1,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Cancel changes",type:"button",onClick:e[8]||(e[8]=K(f=>r.cancelConfiguration(),["stop"]))},e[479]||(e[479]=[l("div",{class:"flex flex-row"},[l("p",{class:"text-red-600 font-bold hover:text-red-300 ml-4 pl-4 mr-4 pr-4"},"Cancel changes:"),l("i",{"data-feather":"x"})],-1)])))])):B("",!0),i.isLoading?(T(),w("div",cit,[l("p",null,W(i.loading_text),1),e[480]||(e[480]=l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),e[481]||(e[481]=l("span",{class:"sr-only"},"Loading...",-1))])):B("",!0)])])]),l("div",{class:Ue(i.isLoading?"pointer-events-none opacity-30 w-full":"w-full")},[l("div",dit,[l("div",uit,[l("button",{onClick:e[9]||(e[9]=K(f=>i.sc_collapsed=!i.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[482]||(e[482]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.sc_collapsed]]),D(l("div",null,e[483]||(e[483]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.sc_collapsed]]),e[486]||(e[486]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),e[487]||(e[487]=l("div",{class:"mr-2"},"|",-1)),l("div",pit,[l("div",fit,[l("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(T(),w("div",_it,[(T(!0),w(Be,null,Xe(r.vramUsage.gpus,f=>(T(),w("div",{class:"flex gap-2 items-center",key:f},[l("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,mit),l("p",hit,[l("div",null,W(r.computedFileSize(f.used_vram))+" / "+W(r.computedFileSize(f.total_vram))+" ("+W(f.percentage)+"%) ",1)])]))),128))])):B("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(T(),w("div",git,[l("div",bit,[l("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,yit),l("p",Eit,[l("div",null,W(r.vramUsage.gpus.length)+"x ",1)])])])):B("",!0)]),e[484]||(e[484]=l("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),l("p",vit,[l("div",null,W(r.ram_usage)+" / "+W(r.ram_total_space)+" ("+W(r.ram_percent_usage)+"%)",1)]),e[485]||(e[485]=l("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),l("p",Sit,[l("div",null,W(r.disk_binding_models_usage)+" / "+W(r.disk_total_space)+" ("+W(r.disk_percent_usage)+"%)",1)])])])])]),l("div",{class:Ue([{hidden:i.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[l("div",Tit,[e[490]||(e[490]=l("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M17 17H7V7h10m4 4V9h-2V7a2 2 0 0 0-2-2h-2V3h-2v2h-2V3H9v2H7c-1.11 0-2 .89-2 2v2H3v2h2v2H3v2h2v2a2 2 0 0 0 2 2h2v2h2v-2h2v2h2v-2h2a2 2 0 0 0 2-2v-2h2v-2h-2v-2m-6 2h-2v-2h2m2-2H9v6h6V9Z"})]),Ze(" CPU Ram usage: ")],-1)),l("div",xit,[l("div",null,[e[488]||(e[488]=l("b",null,"Avaliable ram: ",-1)),Ze(W(r.ram_available_space),1)]),l("div",null,[e[489]||(e[489]=l("b",null,"Ram usage: ",-1)),Ze(" "+W(r.ram_usage)+" / "+W(r.ram_total_space)+" ("+W(r.ram_percent_usage)+")% ",1)])]),l("div",Cit,[l("div",wit,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Wt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),l("div",Rit,[e[493]||(e[493]=l("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[l("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),Ze(" Disk usage: ")],-1)),l("div",Ait,[l("div",null,[e[491]||(e[491]=l("b",null,"Avaliable disk space: ",-1)),Ze(W(r.disk_available_space),1)]),l("div",null,[e[492]||(e[492]=l("b",null,"Disk usage: ",-1)),Ze(" "+W(r.disk_binding_models_usage)+" / "+W(r.disk_total_space)+" ("+W(r.disk_percent_usage)+"%)",1)])]),l("div",Nit,[l("div",Mit,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Wt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(T(!0),w(Be,null,Xe(r.vramUsage.gpus,f=>(T(),w("div",{class:"mb-2",key:f},[l("label",Oit,[l("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,Iit),e[494]||(e[494]=Ze(" GPU usage: "))]),l("div",kit,[l("div",null,[e[495]||(e[495]=l("b",null,"Model: ",-1)),Ze(W(f.gpu_model),1)]),l("div",null,[e[496]||(e[496]=l("b",null,"Avaliable vram: ",-1)),Ze(W(this.computedFileSize(f.available_space)),1)]),l("div",null,[e[497]||(e[497]=l("b",null,"GPU usage: ",-1)),Ze(" "+W(this.computedFileSize(f.used_vram))+" / "+W(this.computedFileSize(f.total_vram))+" ("+W(f.percentage)+"%)",1)])]),l("div",Dit,[l("div",Lit,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Wt("width: "+f.percentage+"%;")},null,4)])])]))),128))],2)]),l("div",Pit,[l("div",Fit,[l("button",{onClick:e[10]||(e[10]=K(f=>i.smartrouterconf_collapsed=!i.smartrouterconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[498]||(e[498]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.smartrouterconf_collapsed]]),D(l("div",null,e[499]||(e[499]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.smartrouterconf_collapsed]]),e[500]||(e[500]=l("div",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Smart routing configurations",-1))])]),l("div",{class:Ue([{hidden:i.smartrouterconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[l("div",Uit,[z(a,{title:"Smart Routing Settings",is_shrunk:!1,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Bit,[l("tr",null,[e[501]||(e[501]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_smart_routing",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use Smart Routing:")],-1)),l("td",Git,[D(l("input",{type:"checkbox",id:"use_smart_routing","onUpdate:modelValue":e[11]||(e[11]=f=>r.configFile.use_smart_routing=f),onChange:e[12]||(e[12]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.use_smart_routing]])])]),l("tr",null,[e[502]||(e[502]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"restore_model_after_smart_routing",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Restore model after smart routing:")],-1)),l("td",Vit,[D(l("input",{type:"checkbox",id:"restore_model_after_smart_routing","onUpdate:modelValue":e[13]||(e[13]=f=>r.configFile.restore_model_after_smart_routing=f),onChange:e[14]||(e[14]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.restore_model_after_smart_routing]])])]),l("tr",null,[e[503]||(e[503]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"smart_routing_router_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Router Model:")],-1)),l("td",zit,[D(l("input",{type:"text",id:"smart_routing_router_model","onUpdate:modelValue":e[15]||(e[15]=f=>r.configFile.smart_routing_router_model=f),onChange:e[16]||(e[16]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.smart_routing_router_model]])])]),l("tr",null,[e[504]||(e[504]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"smart_routing_models_by_power",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Models by Power:")],-1)),l("td",Hit,[z(o,{modelValue:r.configFile.smart_routing_models_by_power,"onUpdate:modelValue":e[17]||(e[17]=f=>r.configFile.smart_routing_models_by_power=f),onChange:e[18]||(e[18]=f=>i.settingsChanged=!0),placeholder:"Enter model name"},null,8,["modelValue"])])])])]),_:1})])],2)]),l("div",qit,[l("div",Yit,[l("button",{onClick:e[19]||(e[19]=K(f=>i.mainconf_collapsed=!i.mainconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[505]||(e[505]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.mainconf_collapsed]]),D(l("div",null,e[506]||(e[506]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.mainconf_collapsed]]),e[507]||(e[507]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1))])]),l("div",{class:Ue([{hidden:i.mainconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[l("div",$it,[z(a,{title:"General",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Wit,[l("tr",null,[e[509]||(e[509]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"app_custom_logo",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Application logo:")],-1)),l("td",null,[l("label",Kit,[l("img",{src:r.configFile.app_custom_logo!=null&&r.configFile.app_custom_logo!=""?"/user_infos/"+r.configFile.app_custom_logo:i.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,jit)]),l("input",{type:"file",id:"logo-upload",style:{display:"none"},onChange:e[20]||(e[20]=(...f)=>r.uploadLogo&&r.uploadLogo(...f))},null,32)]),l("td",Qit,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[21]||(e[21]=K(f=>r.resetLogo(),["stop"]))},e[508]||(e[508]=[l("i",{"data-feather":"x"},null,-1)]))])]),l("tr",null,[e[511]||(e[511]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"hardware_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Hardware mode:")],-1)),l("td",Xit,[l("div",Zit,[D(l("select",{id:"hardware_mode",required:"","onUpdate:modelValue":e[22]||(e[22]=f=>r.configFile.hardware_mode=f),onChange:e[23]||(e[23]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[510]||(e[510]=[l("option",{value:"cpu"},"CPU",-1),l("option",{value:"cpu-noavx"},"CPU (No AVX)",-1),l("option",{value:"nvidia-tensorcores"},"NVIDIA (Tensor Cores)",-1),l("option",{value:"nvidia"},"NVIDIA",-1),l("option",{value:"amd-noavx"},"AMD (No AVX)",-1),l("option",{value:"amd"},"AMD",-1),l("option",{value:"apple-intel"},"Apple Intel",-1),l("option",{value:"apple-silicon"},"Apple Silicon",-1)]),544),[[It,r.configFile.hardware_mode]])])])]),l("tr",null,[e[512]||(e[512]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),l("td",Jit,[D(l("input",{type:"text",id:"discussion_db_name",required:"","onUpdate:modelValue":e[24]||(e[24]=f=>r.configFile.discussion_db_name=f),onChange:e[25]||(e[25]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.discussion_db_name]])])]),l("tr",null,[e[513]||(e[513]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"copy_to_clipboard_add_all_details",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Add details to messages copied to clipboard:")],-1)),l("td",null,[l("div",ert,[D(l("input",{type:"checkbox",id:"copy_to_clipboard_add_all_details",required:"","onUpdate:modelValue":e[26]||(e[26]=f=>r.configFile.copy_to_clipboard_add_all_details=f),onChange:e[27]||(e[27]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.copy_to_clipboard_add_all_details]])])])]),l("tr",null,[e[514]||(e[514]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_show_browser",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto show browser:")],-1)),l("td",null,[l("div",trt,[D(l("input",{type:"checkbox",id:"auto_show_browser",required:"","onUpdate:modelValue":e[28]||(e[28]=f=>r.configFile.auto_show_browser=f),onChange:e[29]||(e[29]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.auto_show_browser]])])])]),l("tr",null,[e[515]||(e[515]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_debug",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate debug mode:")],-1)),l("td",null,[l("div",nrt,[D(l("input",{type:"checkbox",id:"activate_debug",required:"","onUpdate:modelValue":e[30]||(e[30]=f=>r.configFile.debug=f),onChange:e[31]||(e[31]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.debug]])])])]),l("tr",null,[e[516]||(e[516]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"debug_show_final_full_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate showing the full prompt in console (for debug):")],-1)),l("td",null,[l("div",srt,[D(l("input",{type:"checkbox",id:"debug_show_final_full_prompt",required:"","onUpdate:modelValue":e[32]||(e[32]=f=>r.configFile.debug_show_final_full_prompt=f),onChange:e[33]||(e[33]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.debug_show_final_full_prompt]])])])]),l("tr",null,[e[517]||(e[517]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"debug_show_final_full_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show final full prompt in console:")],-1)),l("td",null,[l("div",irt,[D(l("input",{type:"checkbox",id:"debug_show_final_full_prompt",required:"","onUpdate:modelValue":e[34]||(e[34]=f=>r.configFile.debug_show_final_full_prompt=f),onChange:e[35]||(e[35]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.debug_show_final_full_prompt]])])])]),l("tr",null,[e[518]||(e[518]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"debug_show_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show chunks in console:")],-1)),l("td",null,[l("div",rrt,[D(l("input",{type:"checkbox",id:"debug_show_chunks",required:"","onUpdate:modelValue":e[36]||(e[36]=f=>r.configFile.debug_show_chunks=f),onChange:e[37]||(e[37]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.debug_show_chunks]])])])]),l("tr",null,[e[519]||(e[519]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"debug_log_file_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Debug file path:")],-1)),l("td",null,[l("div",ort,[D(l("input",{type:"text",id:"debug_log_file_path",required:"","onUpdate:modelValue":e[38]||(e[38]=f=>r.configFile.debug_log_file_path=f),onChange:e[39]||(e[39]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.debug_log_file_path]])])])]),l("tr",null,[e[520]||(e[520]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"show_news_panel",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show news panel:")],-1)),l("td",null,[l("div",art,[D(l("input",{type:"checkbox",id:"show_news_panel",required:"","onUpdate:modelValue":e[40]||(e[40]=f=>r.configFile.show_news_panel=f),onChange:e[41]||(e[41]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.show_news_panel]])])])]),l("tr",null,[e[521]||(e[521]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),l("td",null,[l("div",lrt,[D(l("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[42]||(e[42]=f=>r.configFile.auto_save=f),onChange:e[43]||(e[43]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.auto_save]])])])]),l("tr",null,[e[522]||(e[522]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),l("td",null,[l("div",crt,[D(l("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[44]||(e[44]=f=>r.configFile.auto_update=f),onChange:e[45]||(e[45]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.auto_update]])])])]),l("tr",null,[e[523]||(e[523]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto title:")],-1)),l("td",null,[l("div",drt,[D(l("input",{type:"checkbox",id:"auto_title",required:"","onUpdate:modelValue":e[46]||(e[46]=f=>r.configFile.auto_title=f),onChange:e[47]||(e[47]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.auto_title]])])])])])]),_:1}),z(a,{title:"Model template",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",urt,[l("tr",null,[e[525]||(e[525]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"start_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start header id template:")],-1)),l("td",null,[l("select",{onChange:e[48]||(e[48]=(...f)=>r.handleTemplateSelection&&r.handleTemplateSelection(...f))},e[524]||(e[524]=[l("option",{value:"lollms"},"Lollms communication template",-1),l("option",{value:"lollms_simplified"},"Lollms simplified communication template",-1),l("option",{value:"bare"},"Bare, useful when in chat mode",-1),l("option",{value:"llama3"},"LLama3 communication template",-1),l("option",{value:"mistral"},"Mistral communication template",-1)]),32)])]),l("tr",null,[e[526]||(e[526]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"start_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"start_header_id_template",required:"","onUpdate:modelValue":e[49]||(e[49]=f=>r.configFile.start_header_id_template=f),onChange:e[50]||(e[50]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.start_header_id_template]])])]),l("tr",null,[e[527]||(e[527]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"end_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"end_header_id_template",required:"","onUpdate:modelValue":e[51]||(e[51]=f=>r.configFile.end_header_id_template=f),onChange:e[52]||(e[52]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.end_header_id_template]])])]),l("tr",null,[e[528]||(e[528]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"start_user_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start user header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"start_user_header_id_template",required:"","onUpdate:modelValue":e[53]||(e[53]=f=>r.configFile.start_user_header_id_template=f),onChange:e[54]||(e[54]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.start_user_header_id_template]])])]),l("tr",null,[e[529]||(e[529]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"end_user_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End user header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"end_user_header_id_template",required:"","onUpdate:modelValue":e[55]||(e[55]=f=>r.configFile.end_user_header_id_template=f),onChange:e[56]||(e[56]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.end_user_header_id_template]])])]),l("tr",null,[e[530]||(e[530]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"end_user_message_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End user message id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"end_user_message_id_template",required:"","onUpdate:modelValue":e[57]||(e[57]=f=>r.configFile.end_user_message_id_template=f),onChange:e[58]||(e[58]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.end_user_message_id_template]])])]),l("tr",null,[e[531]||(e[531]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"start_ai_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start ai header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"start_ai_header_id_template",required:"","onUpdate:modelValue":e[59]||(e[59]=f=>r.configFile.start_ai_header_id_template=f),onChange:e[60]||(e[60]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.start_ai_header_id_template]])])]),l("tr",null,[e[532]||(e[532]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"end_ai_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End ai header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"end_ai_header_id_template",required:"","onUpdate:modelValue":e[61]||(e[61]=f=>r.configFile.end_ai_header_id_template=f),onChange:e[62]||(e[62]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.end_ai_header_id_template]])])]),l("tr",null,[e[533]||(e[533]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"end_ai_message_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End ai message id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"end_ai_message_id_template",required:"","onUpdate:modelValue":e[63]||(e[63]=f=>r.configFile.end_ai_message_id_template=f),onChange:e[64]||(e[64]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.end_ai_message_id_template]])])]),l("tr",null,[e[534]||(e[534]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"separator_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Separator template:")],-1)),l("td",null,[D(l("textarea",{id:"separator_template",required:"","onUpdate:modelValue":e[65]||(e[65]=f=>r.configFile.separator_template=f),onChange:e[66]||(e[66]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.separator_template]])])]),l("tr",null,[e[535]||(e[535]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"system_message_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"System template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"system_message_template",required:"","onUpdate:modelValue":e[67]||(e[67]=f=>r.configFile.system_message_template=f),onChange:e[68]||(e[68]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.system_message_template]])])]),l("tr",null,[e[536]||(e[536]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"full_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Full template:")],-1)),l("td",null,[l("div",{innerHTML:r.full_template},null,8,prt)])]),l("tr",null,[e[537]||(e[537]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_continue_message",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"useful for chat models and repote models but can be less useful for instruct ones"},"Use continue message:")],-1)),l("td",frt,[D(l("input",{type:"checkbox",id:"use_continue_message",required:"","onUpdate:modelValue":e[69]||(e[69]=f=>r.configFile.use_continue_message=f),onChange:e[70]||(e[70]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.use_continue_message]])])])])]),_:1}),z(a,{title:"User",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",_rt,[l("tr",null,[e[538]||(e[538]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),l("td",mrt,[D(l("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[71]||(e[71]=f=>r.configFile.user_name=f),onChange:e[72]||(e[72]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.user_name]])])]),l("tr",null,[e[539]||(e[539]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),l("td",hrt,[D(l("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[73]||(e[73]=f=>r.configFile.user_description=f),onChange:e[74]||(e[74]=f=>i.settingsChanged=!0),class:"min-h-[500px] w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.user_description]])])]),l("tr",null,[e[540]||(e[540]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_user_informations_in_discussion",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use user description in discussion:")],-1)),l("td",grt,[D(l("input",{type:"checkbox",id:"use_user_informations_in_discussion",required:"","onUpdate:modelValue":e[75]||(e[75]=f=>r.configFile.use_user_informations_in_discussion=f),onChange:e[76]||(e[76]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.use_user_informations_in_discussion]])])]),l("tr",null,[e[541]||(e[541]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_model_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use model name in discussion:")],-1)),l("td",brt,[D(l("input",{type:"checkbox",id:"use_model_name_in_discussions",required:"","onUpdate:modelValue":e[77]||(e[77]=f=>r.configFile.use_model_name_in_discussions=f),onChange:e[78]||(e[78]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.use_model_name_in_discussions]])])]),l("tr",null,[e[543]||(e[543]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"user_avatar",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),l("td",null,[l("label",yrt,[l("img",{src:r.configFile.user_avatar!=null&&r.configFile.user_avatar!=""?"/user_infos/"+r.configFile.user_avatar:i.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,Ert)]),l("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[79]||(e[79]=(...f)=>r.uploadAvatar&&r.uploadAvatar(...f))},null,32)]),l("td",vrt,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[80]||(e[80]=K(f=>r.resetAvatar(),["stop"]))},e[542]||(e[542]=[l("i",{"data-feather":"x"},null,-1)]))])]),l("tr",null,[e[544]||(e[544]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),l("td",null,[l("div",Srt,[D(l("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[81]||(e[81]=f=>r.configFile.use_user_name_in_discussions=f),onChange:e[82]||(e[82]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.use_user_name_in_discussions]])])])]),l("tr",null,[e[545]||(e[545]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"max_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Maximum number of output tokens space (forces the model to have more space to speak):")],-1)),l("td",Trt,[D(l("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[83]||(e[83]=f=>r.configFile.max_n_predict=f),onChange:e[84]||(e[84]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.max_n_predict]])])]),l("tr",null,[e[546]||(e[546]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"max_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Minimum number of output tokens space (forces the model to have more space to speak):")],-1)),l("td",xrt,[D(l("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[85]||(e[85]=f=>r.configFile.max_n_predict=f),onChange:e[86]||(e[86]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.max_n_predict]])])])])]),_:1}),z(a,{title:"Security settings",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Crt,[l("tr",null,[e[547]||(e[547]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"turn_on_code_execution",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code execution:")],-1)),l("td",wrt,[D(l("input",{type:"checkbox",id:"turn_on_code_execution",required:"","onUpdate:modelValue":e[87]||(e[87]=f=>r.configFile.turn_on_code_execution=f),onChange:e[88]||(e[88]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.turn_on_code_execution]])])]),l("tr",null,[e[548]||(e[548]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"turn_on_code_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code validation (very recommended for security reasons):")],-1)),l("td",Rrt,[D(l("input",{type:"checkbox",id:"turn_on_code_validation",required:"","onUpdate:modelValue":e[89]||(e[89]=f=>r.configFile.turn_on_code_validation=f),onChange:e[90]||(e[90]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.turn_on_code_validation]])])]),l("tr",null,[e[549]||(e[549]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"turn_on_setting_update_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on apply settings validation (very recommended for security reasons):")],-1)),l("td",Art,[D(l("input",{type:"checkbox",id:"turn_on_setting_update_validation",required:"","onUpdate:modelValue":e[91]||(e[91]=f=>r.configFile.turn_on_setting_update_validation=f),onChange:e[92]||(e[92]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.turn_on_setting_update_validation]])])]),l("tr",null,[e[550]||(e[550]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"turn_on_open_file_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on open file/folder validation:")],-1)),l("td",Nrt,[D(l("input",{type:"checkbox",id:"turn_on_open_file_validation",required:"","onUpdate:modelValue":e[93]||(e[93]=f=>r.configFile.turn_on_open_file_validation=f),onChange:e[94]||(e[94]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.turn_on_open_file_validation]])])]),l("tr",null,[e[551]||(e[551]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"turn_on_send_file_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on send file validation:")],-1)),l("td",Mrt,[D(l("input",{type:"checkbox",id:"turn_on_send_file_validation",required:"","onUpdate:modelValue":e[95]||(e[95]=f=>r.configFile.turn_on_send_file_validation=f),onChange:e[96]||(e[96]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.turn_on_send_file_validation]])])])])]),_:1}),z(a,{title:"Knowledge database",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Ort,[l("tr",null,[e[552]||(e[552]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_skills_lib",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Skills library:")],-1)),l("td",null,[l("div",Irt,[D(l("input",{type:"checkbox",id:"activate_skills_lib",required:"","onUpdate:modelValue":e[97]||(e[97]=f=>r.configFile.activate_skills_lib=f),onChange:e[98]||(e[98]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_skills_lib]])])])]),l("tr",null,[e[553]||(e[553]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Skills library database name:")],-1)),l("td",krt,[D(l("input",{type:"text",id:"skills_lib_database_name",required:"","onUpdate:modelValue":e[99]||(e[99]=f=>r.configFile.skills_lib_database_name=f),onChange:e[100]||(e[100]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.skills_lib_database_name]])])])])]),_:1}),z(a,{title:"Latex",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Drt,[l("tr",null,[e[554]||(e[554]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"pdf_latex_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"PDF LaTeX path:")],-1)),l("td",null,[l("div",Lrt,[D(l("input",{type:"text",id:"pdf_latex_path",required:"","onUpdate:modelValue":e[101]||(e[101]=f=>r.configFile.pdf_latex_path=f),onChange:e[102]||(e[102]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.pdf_latex_path]])])])])])]),_:1}),z(a,{title:"Boost",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Prt,[l("tr",null,[e[555]||(e[555]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"positive_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Positive Boost:")],-1)),l("td",null,[l("div",Frt,[D(l("input",{type:"text",id:"positive_boost",required:"","onUpdate:modelValue":e[103]||(e[103]=f=>r.configFile.positive_boost=f),onChange:e[104]||(e[104]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.positive_boost]])])])]),l("tr",null,[e[556]||(e[556]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"negative_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative Boost:")],-1)),l("td",null,[l("div",Urt,[D(l("input",{type:"text",id:"negative_boost",required:"","onUpdate:modelValue":e[105]||(e[105]=f=>r.configFile.negative_boost=f),onChange:e[106]||(e[106]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.negative_boost]])])])]),l("tr",null,[e[557]||(e[557]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"fun_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fun mode:")],-1)),l("td",null,[l("div",Brt,[D(l("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[107]||(e[107]=f=>r.configFile.fun_mode=f),onChange:e[108]||(e[108]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.fun_mode]])])])])])]),_:1})])],2)]),l("div",Grt,[l("div",Vrt,[l("button",{onClick:e[109]||(e[109]=K(f=>i.data_conf_collapsed=!i.data_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[558]||(e[558]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.data_conf_collapsed]]),D(l("div",null,e[559]||(e[559]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.data_conf_collapsed]]),e[560]||(e[560]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Data management settings",-1))])]),l("div",{class:Ue([{hidden:i.data_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[z(a,{title:"Data Sources",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",zrt,[l("tr",null,[e[561]||(e[561]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_databases",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data Sources:")],-1)),l("td",Hrt,[(T(!0),w(Be,null,Xe(r.configFile.rag_databases,(f,g)=>(T(),w("div",{key:g,class:"flex items-center mb-2"},[D(l("input",{type:"text","onUpdate:modelValue":b=>r.configFile.rag_databases[g]=b,onChange:e[110]||(e[110]=b=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,40,qrt),[[ue,r.configFile.rag_databases[g]]]),l("button",{onClick:b=>r.vectorize_folder(g),class:"w-500 ml-2 px-2 py-1 bg-green-500 text-white hover:bg-green-300 rounded"},"(Re)Vectorize",8,Yrt),l("button",{onClick:b=>r.select_folder(g),class:"w-500 ml-2 px-2 py-1 bg-blue-500 text-white hover:bg-green-300 rounded"},"Select Folder",8,$rt),l("button",{onClick:b=>r.removeDataSource(g),class:"ml-2 px-2 py-1 bg-red-500 text-white hover:bg-green-300 rounded"},"Remove",8,Wrt)]))),128)),l("button",{onClick:e[111]||(e[111]=(...f)=>r.addDataSource&&r.addDataSource(...f)),class:"mt-2 px-2 py-1 bg-blue-500 text-white rounded"},"Add Data Source")])]),l("tr",null,[e[563]||(e[563]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG Vectorizer:")],-1)),l("td",null,[D(l("select",{id:"rag_vectorizer",required:"","onUpdate:modelValue":e[112]||(e[112]=f=>r.configFile.rag_vectorizer=f),onChange:e[113]||(e[113]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[562]||(e[562]=[l("option",{value:"semantic"},"Semantic Vectorizer",-1),l("option",{value:"tfidf"},"TFIDF Vectorizer",-1),l("option",{value:"openai"},"OpenAI Vectorizer",-1)]),544),[[It,r.configFile.rag_vectorizer]])])]),l("tr",null,[e[564]||(e[564]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_vectorizer_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG Vectorizer model:")],-1)),l("td",null,[D(l("select",{id:"rag_vectorizer_model",required:"","onUpdate:modelValue":e[114]||(e[114]=f=>r.configFile.rag_vectorizer_model=f),onChange:e[115]||(e[115]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:r.configFile.rag_vectorizer==="tfidf"},[r.configFile.rag_vectorizer==="semantic"?(T(),w("option",jrt,"sentence-transformers/bert-base-nli-mean-tokens")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",Qrt,"bert-base-uncased")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",Xrt,"bert-base-multilingual-uncased")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",Zrt,"bert-large-uncased")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",Jrt,"bert-large-uncased-whole-word-masking-finetuned-squad")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",eot,"distilbert-base-uncased")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",tot,"roberta-base")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",not,"roberta-large")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",sot,"xlm-roberta-base")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",iot,"xlm-roberta-large")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",rot,"albert-base-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",oot,"albert-large-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",aot,"albert-xlarge-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",lot,"albert-xxlarge-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",cot,"sentence-transformers/all-MiniLM-L6-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",dot,"sentence-transformers/all-MiniLM-L12-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",uot,"sentence-transformers/all-distilroberta-v1")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",pot,"sentence-transformers/all-mpnet-base-v2")):B("",!0),r.configFile.rag_vectorizer==="openai"?(T(),w("option",fot,"text-embedding-ada-002")):B("",!0),r.configFile.rag_vectorizer==="openai"?(T(),w("option",_ot,"text-embedding-babbage-001")):B("",!0),r.configFile.rag_vectorizer==="openai"?(T(),w("option",mot,"text-embedding-curie-001")):B("",!0),r.configFile.rag_vectorizer==="openai"?(T(),w("option",hot,"text-embedding-davinci-001")):B("",!0),r.configFile.rag_vectorizer==="tfidf"?(T(),w("option",got,"No models available for TFIDF")):B("",!0)],40,Krt),[[It,r.configFile.rag_vectorizer_model]])])]),l("tr",null,[e[565]||(e[565]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_vectorizer_openai_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Open AI key for open ai embedding method (if not provided I'll use OPENAI_API_KEY environment variable):")],-1)),l("td",null,[l("div",bot,[D(l("input",{type:"text",id:"rag_vectorizer_openai_key",required:"","onUpdate:modelValue":e[116]||(e[116]=f=>r.configFile.rag_vectorizer_openai_key=f),onChange:e[117]||(e[117]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.rag_vectorizer_openai_key]])])])]),l("tr",null,[e[566]||(e[566]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG chunk size:")],-1)),l("td",null,[D(l("input",{id:"rag_chunk_size","onUpdate:modelValue":e[118]||(e[118]=f=>r.configFile.rag_chunk_size=f),onChange:e[119]||(e[119]=f=>i.settingsChanged=!0),type:"range",min:"2",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.rag_chunk_size]]),D(l("input",{"onUpdate:modelValue":e[120]||(e[120]=f=>r.configFile.rag_chunk_size=f),type:"number",onChange:e[121]||(e[121]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.rag_chunk_size]])])]),l("tr",null,[e[567]||(e[567]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_overlap",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG overlap size:")],-1)),l("td",null,[D(l("input",{id:"rag_overlap","onUpdate:modelValue":e[122]||(e[122]=f=>r.configFile.rag_overlap=f),onChange:e[123]||(e[123]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.rag_overlap]]),D(l("input",{"onUpdate:modelValue":e[124]||(e[124]=f=>r.configFile.rag_overlap=f),type:"number",onChange:e[125]||(e[125]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.rag_overlap]])])]),l("tr",null,[e[568]||(e[568]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_n_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG number of chunks:")],-1)),l("td",null,[D(l("input",{id:"rag_n_chunks","onUpdate:modelValue":e[126]||(e[126]=f=>r.configFile.rag_n_chunks=f),onChange:e[127]||(e[127]=f=>i.settingsChanged=!0),type:"range",min:"2",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.rag_n_chunks]]),D(l("input",{"onUpdate:modelValue":e[128]||(e[128]=f=>r.configFile.rag_n_chunks=f),type:"number",onChange:e[129]||(e[129]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.rag_n_chunks]])])]),l("tr",null,[e[569]||(e[569]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_clean_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Clean chunks:")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[130]||(e[130]=f=>r.configFile.rag_clean_chunks=f),type:"checkbox",onChange:e[131]||(e[131]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.rag_clean_chunks]])])]),l("tr",null,[e[570]||(e[570]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_follow_subfolders",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Follow subfolders:")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[132]||(e[132]=f=>r.configFile.rag_follow_subfolders=f),type:"checkbox",onChange:e[133]||(e[133]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.rag_follow_subfolders]])])]),l("tr",null,[e[571]||(e[571]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_check_new_files_at_startup",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Check for new files at startup:")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[134]||(e[134]=f=>r.configFile.rag_check_new_files_at_startup=f),type:"checkbox",onChange:e[135]||(e[135]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.rag_check_new_files_at_startup]])])]),l("tr",null,[e[572]||(e[572]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_preprocess_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Preprocess chunks:")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[136]||(e[136]=f=>r.configFile.rag_preprocess_chunks=f),type:"checkbox",onChange:e[137]||(e[137]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.rag_preprocess_chunks]])])]),l("tr",null,[e[573]||(e[573]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_activate_multi_hops",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate multi hops RAG:")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[138]||(e[138]=f=>r.configFile.rag_activate_multi_hops=f),type:"checkbox",onChange:e[139]||(e[139]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.rag_activate_multi_hops]])])]),l("tr",null,[e[574]||(e[574]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"contextual_summary",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use contextual summary instead of rag (consumes alot of tokens and may be very slow but efficient, useful for summary and global questions that RAG can't do):")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[140]||(e[140]=f=>r.configFile.contextual_summary=f),type:"checkbox",onChange:e[141]||(e[141]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.contextual_summary]])])]),l("tr",null,[e[575]||(e[575]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_deactivate",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Useful for very big contexts and global tasks that require the whole document"},"Use all the document content (No split):")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[142]||(e[142]=f=>r.configFile.rag_deactivate=f),type:"checkbox",onChange:e[143]||(e[143]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.rag_deactivate]])])])])]),_:1}),z(a,{title:"Data Vectorization",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",yot,[l("tr",null,[e[576]||(e[576]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Save vectorized database:")],-1)),l("td",null,[l("div",Eot,[D(l("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[144]||(e[144]=f=>r.configFile.data_vectorization_save_db=f),onChange:e[145]||(e[145]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.data_vectorization_save_db]])])])]),l("tr",null,[e[577]||(e[577]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_visualize_on_vectorization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"show vectorized data:")],-1)),l("td",null,[l("div",vot,[D(l("input",{type:"checkbox",id:"data_vectorization_visualize_on_vectorization",required:"","onUpdate:modelValue":e[146]||(e[146]=f=>r.configFile.data_vectorization_visualize_on_vectorization=f),onChange:e[147]||(e[147]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.data_vectorization_visualize_on_vectorization]])])])]),l("tr",null,[e[578]||(e[578]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_build_keys_words",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reformulate prompt before querying database (advised):")],-1)),l("td",null,[l("div",Sot,[D(l("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[148]||(e[148]=f=>r.configFile.data_vectorization_build_keys_words=f),onChange:e[149]||(e[149]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.data_vectorization_build_keys_words]])])])]),l("tr",null,[e[579]||(e[579]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_force_first_chunk",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Force adding the first chunk of the file to the context:")],-1)),l("td",null,[l("div",Tot,[D(l("input",{type:"checkbox",id:"data_vectorization_force_first_chunk",required:"","onUpdate:modelValue":e[150]||(e[150]=f=>r.configFile.data_vectorization_force_first_chunk=f),onChange:e[151]||(e[151]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.data_vectorization_force_first_chunk]])])])]),l("tr",null,[e[580]||(e[580]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_put_chunk_informations_into_context",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Put Chunk Information Into Context:")],-1)),l("td",null,[l("div",xot,[D(l("input",{type:"checkbox",id:"data_vectorization_put_chunk_informations_into_context",required:"","onUpdate:modelValue":e[152]||(e[152]=f=>r.configFile.data_vectorization_put_chunk_informations_into_context=f),onChange:e[153]||(e[153]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.data_vectorization_put_chunk_informations_into_context]])])])]),l("tr",null,[e[582]||(e[582]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization method:")],-1)),l("td",null,[D(l("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[154]||(e[154]=f=>r.configFile.data_vectorization_method=f),onChange:e[155]||(e[155]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[581]||(e[581]=[l("option",{value:"tfidf_vectorizer"},"tfidf Vectorizer",-1),l("option",{value:"bm25_vectorizer"},"bm25 Vectorizer",-1),l("option",{value:"model_embedding"},"Model Embedding",-1),l("option",{value:"sentense_transformer"},"Sentense Transformer",-1)]),544),[[It,r.configFile.data_vectorization_method]])])]),l("tr",null,[e[583]||(e[583]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_sentense_transformer_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization model (for Sentense Transformer):")],-1)),l("td",Cot,[D(l("input",{type:"text",id:"data_vectorization_sentense_transformer_model",required:"","onUpdate:modelValue":e[156]||(e[156]=f=>r.configFile.data_vectorization_sentense_transformer_model=f),onChange:e[157]||(e[157]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.data_vectorization_sentense_transformer_model]])])]),l("tr",null,[e[585]||(e[585]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_visualization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data visualization method:")],-1)),l("td",null,[D(l("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[158]||(e[158]=f=>r.configFile.data_visualization_method=f),onChange:e[159]||(e[159]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[584]||(e[584]=[l("option",{value:"PCA"},"PCA",-1),l("option",{value:"TSNE"},"TSNE",-1)]),544),[[It,r.configFile.data_visualization_method]])])]),l("tr",null,[e[586]||(e[586]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Save the new files to the database (The database wil always grow and continue to be the same over many sessions):")],-1)),l("td",null,[l("div",wot,[D(l("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[160]||(e[160]=f=>r.configFile.data_vectorization_save_db=f),onChange:e[161]||(e[161]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.data_vectorization_save_db]])])])]),l("tr",null,[e[587]||(e[587]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization chunk size(tokens):")],-1)),l("td",null,[D(l("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[162]||(e[162]=f=>r.configFile.data_vectorization_chunk_size=f),onChange:e[163]||(e[163]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.data_vectorization_chunk_size]]),D(l("input",{"onUpdate:modelValue":e[164]||(e[164]=f=>r.configFile.data_vectorization_chunk_size=f),type:"number",onChange:e[165]||(e[165]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.data_vectorization_chunk_size]])])]),l("tr",null,[e[588]||(e[588]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization overlap size(tokens):")],-1)),l("td",null,[D(l("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[166]||(e[166]=f=>r.configFile.data_vectorization_overlap_size=f),onChange:e[167]||(e[167]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.data_vectorization_overlap_size]]),D(l("input",{"onUpdate:modelValue":e[168]||(e[168]=f=>r.configFile.data_vectorization_overlap_size=f),type:"number",onChange:e[169]||(e[169]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.data_vectorization_overlap_size]])])]),l("tr",null,[e[589]||(e[589]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Number of chunks to use for each message:")],-1)),l("td",null,[D(l("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[170]||(e[170]=f=>r.configFile.data_vectorization_nb_chunks=f),onChange:e[171]||(e[171]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"1000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.data_vectorization_nb_chunks]]),D(l("input",{"onUpdate:modelValue":e[172]||(e[172]=f=>r.configFile.data_vectorization_nb_chunks=f),type:"number",onChange:e[173]||(e[173]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1})],2)]),l("div",Rot,[l("div",Aot,[l("button",{onClick:e[174]||(e[174]=K(f=>i.internet_conf_collapsed=!i.internet_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[590]||(e[590]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.internet_conf_collapsed]]),D(l("div",null,e[591]||(e[591]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.internet_conf_collapsed]]),e[592]||(e[592]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Internet",-1))])]),l("div",{class:Ue([{hidden:i.internet_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[z(a,{title:"Internet search",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Not,[l("tr",null,[e[593]||(e[593]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_internet_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate internet search:")],-1)),l("td",null,[l("div",Mot,[D(l("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[175]||(e[175]=f=>r.configFile.activate_internet_search=f),onChange:e[176]||(e[176]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_internet_search]])])])]),l("tr",null,[e[594]||(e[594]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_internet_pages_judgement",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate internet pages judgement:")],-1)),l("td",null,[l("div",Oot,[D(l("input",{type:"checkbox",id:"activate_internet_pages_judgement",required:"","onUpdate:modelValue":e[177]||(e[177]=f=>r.configFile.activate_internet_pages_judgement=f),onChange:e[178]||(e[178]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_internet_pages_judgement]])])])]),l("tr",null,[e[595]||(e[595]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_quick_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate quick search:")],-1)),l("td",null,[l("div",Iot,[D(l("input",{type:"checkbox",id:"internet_quick_search",required:"","onUpdate:modelValue":e[179]||(e[179]=f=>r.configFile.internet_quick_search=f),onChange:e[180]||(e[180]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.internet_quick_search]])])])]),l("tr",null,[e[596]||(e[596]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_activate_search_decision",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate search decision:")],-1)),l("td",null,[l("div",kot,[D(l("input",{type:"checkbox",id:"internet_activate_search_decision",required:"","onUpdate:modelValue":e[181]||(e[181]=f=>r.configFile.internet_activate_search_decision=f),onChange:e[182]||(e[182]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.internet_activate_search_decision]])])])]),l("tr",null,[e[597]||(e[597]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization chunk size:")],-1)),l("td",null,[l("div",Dot,[D(l("input",{id:"internet_vectorization_chunk_size","onUpdate:modelValue":e[183]||(e[183]=f=>r.configFile.internet_vectorization_chunk_size=f),onChange:e[184]||(e[184]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.internet_vectorization_chunk_size]]),D(l("input",{"onUpdate:modelValue":e[185]||(e[185]=f=>r.configFile.internet_vectorization_chunk_size=f),type:"number",onChange:e[186]||(e[186]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.internet_vectorization_chunk_size]])])])]),l("tr",null,[e[598]||(e[598]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization overlap size:")],-1)),l("td",null,[l("div",Lot,[D(l("input",{id:"internet_vectorization_overlap_size","onUpdate:modelValue":e[187]||(e[187]=f=>r.configFile.internet_vectorization_overlap_size=f),onChange:e[188]||(e[188]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"1000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.internet_vectorization_overlap_size]]),D(l("input",{"onUpdate:modelValue":e[189]||(e[189]=f=>r.configFile.internet_vectorization_overlap_size=f),type:"number",onChange:e[190]||(e[190]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.internet_vectorization_overlap_size]])])])]),l("tr",null,[e[599]||(e[599]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_vectorization_nb_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization number of chunks:")],-1)),l("td",null,[l("div",Pot,[D(l("input",{id:"internet_vectorization_nb_chunks","onUpdate:modelValue":e[191]||(e[191]=f=>r.configFile.internet_vectorization_nb_chunks=f),onChange:e[192]||(e[192]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.internet_vectorization_nb_chunks]]),D(l("input",{"onUpdate:modelValue":e[193]||(e[193]=f=>r.configFile.internet_vectorization_nb_chunks=f),type:"number",onChange:e[194]||(e[194]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.internet_vectorization_nb_chunks]])])])]),l("tr",null,[e[600]||(e[600]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_nb_search_pages",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet number of search pages:")],-1)),l("td",null,[l("div",Fot,[D(l("input",{id:"internet_nb_search_pages","onUpdate:modelValue":e[195]||(e[195]=f=>r.configFile.internet_nb_search_pages=f),onChange:e[196]||(e[196]=f=>i.settingsChanged=!0),type:"range",min:"1",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.internet_nb_search_pages]]),D(l("input",{"onUpdate:modelValue":e[197]||(e[197]=f=>r.configFile.internet_nb_search_pages=f),type:"number",onChange:e[198]||(e[198]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.internet_nb_search_pages]])])])])])]),_:1})],2)]),l("div",Uot,[l("div",Bot,[l("button",{onClick:e[199]||(e[199]=K(f=>i.servers_conf_collapsed=!i.servers_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[601]||(e[601]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.servers_conf_collapsed]]),D(l("div",null,e[602]||(e[602]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.servers_conf_collapsed]]),e[603]||(e[603]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Services Zoo",-1))])]),l("div",{class:Ue([{hidden:i.servers_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[z(a,{title:"Default services selection",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Got,[l("tr",null,[e[605]||(e[605]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"active_tts_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to speach engine"},"Active TTS Service:")],-1)),l("td",Vot,[D(l("select",{id:"active_tts_service",required:"","onUpdate:modelValue":e[200]||(e[200]=f=>r.configFile.active_tts_service=f),onChange:e[201]||(e[201]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[604]||(e[604]=[l("option",{value:"None"},"None",-1),l("option",{value:"browser"},"Use Browser TTS (doesn't work in realtime mode)",-1),l("option",{value:"xtts"},"XTTS",-1),l("option",{value:"parler-tts"},"Parler-TTS",-1),l("option",{value:"openai_tts"},"Open AI TTS",-1),l("option",{value:"eleven_labs_tts"},"ElevenLabs TTS",-1),l("option",{value:"fish_tts"},"Fish TTS",-1)]),544),[[It,r.configFile.active_tts_service]])])]),l("tr",null,[e[607]||(e[607]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"active_stt_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Speach to Text engine"},"Active STT Service:")],-1)),l("td",zot,[D(l("select",{id:"active_stt_service",required:"","onUpdate:modelValue":e[202]||(e[202]=f=>r.configFile.active_stt_service=f),onChange:e[203]||(e[203]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[606]||(e[606]=[l("option",{value:"None"},"None",-1),l("option",{value:"whisper"},"Whisper",-1),l("option",{value:"openai_whisper"},"Open AI Whisper",-1)]),544),[[It,r.configFile.active_stt_service]])])]),e[614]||(e[614]=l("tr",null,null,-1)),l("tr",null,[e[609]||(e[609]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"active_tti_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to image engine"},"Active TTI Service:")],-1)),l("td",Hot,[D(l("select",{id:"active_tti_service",required:"","onUpdate:modelValue":e[204]||(e[204]=f=>r.configFile.active_tti_service=f),onChange:e[205]||(e[205]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[608]||(e[608]=[l("option",{value:"None"},"None",-1),l("option",{value:"diffusers"},"Diffusers",-1),l("option",{value:"diffusers_client"},"Diffusers Client",-1),l("option",{value:"autosd"},"AUTO1111's SD",-1),l("option",{value:"dall-e"},"Open AI DALL-E",-1),l("option",{value:"midjourney"},"Midjourney",-1),l("option",{value:"comfyui"},"Comfyui",-1),l("option",{value:"fooocus"},"Fooocus",-1)]),544),[[It,r.configFile.active_tti_service]])])]),l("tr",null,[e[611]||(e[611]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"active_ttm_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to Music engine"},"Active TTM Service:")],-1)),l("td",qot,[D(l("select",{id:"active_ttm_service",required:"","onUpdate:modelValue":e[206]||(e[206]=f=>r.configFile.active_ttm_service=f),onChange:e[207]||(e[207]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[610]||(e[610]=[l("option",{value:"None"},"None",-1),l("option",{value:"musicgen"},"Music Gen",-1)]),544),[[It,r.configFile.active_ttm_service]])])]),l("tr",null,[e[613]||(e[613]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"active_ttv_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to speach engine"},"Active TTV Service:")],-1)),l("td",Yot,[D(l("select",{id:"active_ttv_service",required:"","onUpdate:modelValue":e[208]||(e[208]=f=>r.configFile.active_ttv_service=f),onChange:e[209]||(e[209]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[612]||(e[612]=[l("option",{value:"None"},"None",-1),l("option",{value:"cog_video_x"},"Cog Video X",-1),l("option",{value:"diffusers"},"Diffusers",-1),l("option",{value:"lumalab"},"Lumalab",-1)]),544),[[It,r.configFile.active_ttv_service]])])])])]),_:1}),z(a,{title:"TTI settings",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",$ot,[l("tr",null,[e[615]||(e[615]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use negative prompt:")],-1)),l("td",null,[l("div",Wot,[D(l("input",{type:"checkbox",id:"use_negative_prompt",required:"","onUpdate:modelValue":e[210]||(e[210]=f=>r.configFile.use_negative_prompt=f),onChange:e[211]||(e[211]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.use_negative_prompt]])])])]),l("tr",null,[e[616]||(e[616]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_ai_generated_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use AI generated negative prompt:")],-1)),l("td",null,[l("div",Kot,[D(l("input",{type:"checkbox",id:"use_ai_generated_negative_prompt",required:"","onUpdate:modelValue":e[212]||(e[212]=f=>r.configFile.use_ai_generated_negative_prompt=f),onChange:e[213]||(e[213]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.use_ai_generated_negative_prompt]])])])]),l("tr",null,[e[617]||(e[617]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"negative_prompt_generation_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative prompt generation prompt:")],-1)),l("td",null,[l("div",jot,[D(l("input",{type:"text",id:"negative_prompt_generation_prompt",required:"","onUpdate:modelValue":e[214]||(e[214]=f=>r.configFile.negative_prompt_generation_prompt=f),onChange:e[215]||(e[215]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.negative_prompt_generation_prompt]])])])]),l("tr",null,[e[618]||(e[618]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"default_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Default negative prompt:")],-1)),l("td",null,[l("div",Qot,[D(l("input",{type:"text",id:"default_negative_prompt",required:"","onUpdate:modelValue":e[216]||(e[216]=f=>r.configFile.default_negative_prompt=f),onChange:e[217]||(e[217]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.default_negative_prompt]])])])])])]),_:1}),z(a,{title:"Full Audio settings",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Xot,[l("tr",null,[e[619]||(e[619]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_listening_threshold",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Listening threshold"},"Listening threshold:")],-1)),l("td",Zot,[D(l("input",{type:"number",step:"1",id:"stt_listening_threshold",required:"","onUpdate:modelValue":e[218]||(e[218]=f=>r.configFile.stt_listening_threshold=f),onChange:e[219]||(e[219]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_listening_threshold]])])]),l("tr",null,[e[620]||(e[620]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_silence_duration",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Scilence duration"},"Silence duration (s):")],-1)),l("td",Jot,[D(l("input",{type:"number",step:"1",id:"stt_silence_duration",required:"","onUpdate:modelValue":e[220]||(e[220]=f=>r.configFile.stt_silence_duration=f),onChange:e[221]||(e[221]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_silence_duration]])])]),l("tr",null,[e[621]||(e[621]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_sound_threshold_percentage",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"stt_sound_threshold_percentage"},"Minimum sound percentage in recorded segment:")],-1)),l("td",eat,[D(l("input",{type:"number",step:"1",id:"stt_sound_threshold_percentage",required:"","onUpdate:modelValue":e[222]||(e[222]=f=>r.configFile.stt_sound_threshold_percentage=f),onChange:e[223]||(e[223]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_sound_threshold_percentage]])])]),l("tr",null,[e[622]||(e[622]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_gain",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"STT Gain"},"Volume amplification:")],-1)),l("td",tat,[D(l("input",{type:"number",step:"1",id:"stt_gain",required:"","onUpdate:modelValue":e[224]||(e[224]=f=>r.configFile.stt_gain=f),onChange:e[225]||(e[225]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_gain]])])]),l("tr",null,[e[623]||(e[623]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_rate",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Audio Rate"},"audio rate:")],-1)),l("td",nat,[D(l("input",{type:"number",step:"1",id:"stt_rate",required:"","onUpdate:modelValue":e[226]||(e[226]=f=>r.configFile.stt_rate=f),onChange:e[227]||(e[227]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_rate]])])]),l("tr",null,[e[624]||(e[624]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_channels",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"number of channels"},"number of channels:")],-1)),l("td",sat,[D(l("input",{type:"number",step:"1",id:"stt_channels",required:"","onUpdate:modelValue":e[228]||(e[228]=f=>r.configFile.stt_channels=f),onChange:e[229]||(e[229]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_channels]])])]),l("tr",null,[e[625]||(e[625]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_buffer_size",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Buffer size"},"Buffer size:")],-1)),l("td",iat,[D(l("input",{type:"number",step:"1",id:"stt_buffer_size",required:"","onUpdate:modelValue":e[230]||(e[230]=f=>r.configFile.stt_buffer_size=f),onChange:e[231]||(e[231]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_buffer_size]])])]),l("tr",null,[e[626]||(e[626]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_activate_word_detection",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate word detection:")],-1)),l("td",null,[l("div",rat,[D(l("input",{type:"checkbox",id:"stt_activate_word_detection",required:"","onUpdate:modelValue":e[232]||(e[232]=f=>r.configFile.stt_activate_word_detection=f),onChange:e[233]||(e[233]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.stt_activate_word_detection]])])])]),l("tr",null,[e[627]||(e[627]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_word_detection_file",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Word detection wav file:")],-1)),l("td",null,[l("div",oat,[D(l("input",{type:"text",id:"stt_word_detection_file",required:"","onUpdate:modelValue":e[234]||(e[234]=f=>r.configFile.stt_word_detection_file=f),onChange:e[235]||(e[235]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_word_detection_file]])])])])])]),_:1}),z(a,{title:"Audio devices settings",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",aat,[l("tr",null,[e[628]||(e[628]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_input_device",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Input device"},"Audio Input device:")],-1)),l("td",lat,[D(l("select",{id:"stt_input_device",required:"","onUpdate:modelValue":e[236]||(e[236]=f=>r.configFile.stt_input_device=f),onChange:e[237]||(e[237]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(i.snd_input_devices,(f,g)=>(T(),w("option",{key:f,value:i.snd_input_devices_indexes[g]},W(f),9,cat))),128))],544),[[It,r.configFile.stt_input_device]])])]),l("tr",null,[e[629]||(e[629]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"tts_output_device",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Input device"},"Audio Output device:")],-1)),l("td",dat,[D(l("select",{id:"tts_output_device",required:"","onUpdate:modelValue":e[238]||(e[238]=f=>r.configFile.tts_output_device=f),onChange:e[239]||(e[239]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(i.snd_output_devices,(f,g)=>(T(),w("option",{key:f,value:i.snd_output_devices_indexes[g]},W(f),9,uat))),128))],544),[[It,r.configFile.tts_output_device]])])])])]),_:1}),z(a,{title:"Lollms service",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",pat,[l("tr",null,[e[630]||(e[630]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"host",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),l("td",fat,[D(l("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[240]||(e[240]=f=>r.configFile.host=f),onChange:e[241]||(e[241]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.host]])])]),l("tr",null,[e[631]||(e[631]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"lollms_access_keys",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Access keys:")],-1)),l("td",_at,[z(o,{modelValue:r.configFile.lollms_access_keys,"onUpdate:modelValue":e[242]||(e[242]=f=>r.configFile.lollms_access_keys=f),onChange:e[243]||(e[243]=f=>i.settingsChanged=!0),placeholder:"Enter access key"},null,8,["modelValue"])])]),l("tr",null,[e[632]||(e[632]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"port",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),l("td",mat,[D(l("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[244]||(e[244]=f=>r.configFile.port=f),onChange:e[245]||(e[245]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.port]])])]),l("tr",null,[e[633]||(e[633]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"headless_server_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate headless server mode:")],-1)),l("td",hat,[D(l("input",{type:"checkbox",id:"headless_server_mode",required:"","onUpdate:modelValue":e[246]||(e[246]=f=>r.configFile.headless_server_mode=f),onChange:e[247]||(e[247]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.headless_server_mode]])])]),l("tr",null,[e[634]||(e[634]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms server:")],-1)),l("td",gat,[D(l("input",{type:"checkbox",id:"activate_lollms_server",required:"","onUpdate:modelValue":e[248]||(e[248]=f=>r.configFile.activate_lollms_server=f),onChange:e[249]||(e[249]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_lollms_server]])])]),l("tr",null,[e[635]||(e[635]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_rag_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms RAG server:")],-1)),l("td",bat,[D(l("input",{type:"checkbox",id:"activate_lollms_rag_server",required:"","onUpdate:modelValue":e[250]||(e[250]=f=>r.configFile.activate_lollms_rag_server=f),onChange:e[251]||(e[251]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_lollms_rag_server]])])]),l("tr",null,[e[636]||(e[636]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_tts_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms TTS server:")],-1)),l("td",yat,[D(l("input",{type:"checkbox",id:"activate_lollms_tts_server",required:"","onUpdate:modelValue":e[252]||(e[252]=f=>r.configFile.activate_lollms_tts_server=f),onChange:e[253]||(e[253]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_lollms_tts_server]])])]),l("tr",null,[e[637]||(e[637]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_stt_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms STT server:")],-1)),l("td",Eat,[D(l("input",{type:"checkbox",id:"activate_lollms_stt_server",required:"","onUpdate:modelValue":e[254]||(e[254]=f=>r.configFile.activate_lollms_stt_server=f),onChange:e[255]||(e[255]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_lollms_stt_server]])])]),l("tr",null,[e[638]||(e[638]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_tti_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms TTI server:")],-1)),l("td",vat,[D(l("input",{type:"checkbox",id:"activate_lollms_tti_server",required:"","onUpdate:modelValue":e[256]||(e[256]=f=>r.configFile.activate_lollms_tti_server=f),onChange:e[257]||(e[257]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_lollms_tti_server]])])]),l("tr",null,[e[639]||(e[639]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_itt_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms ITT server:")],-1)),l("td",Sat,[D(l("input",{type:"checkbox",id:"activate_lollms_itt_server",required:"","onUpdate:modelValue":e[258]||(e[258]=f=>r.configFile.activate_lollms_itt_server=f),onChange:e[259]||(e[259]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_lollms_itt_server]])])]),l("tr",null,[e[640]||(e[640]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_ttm_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms TTM server:")],-1)),l("td",Tat,[D(l("input",{type:"checkbox",id:"activate_lollms_ttm_server",required:"","onUpdate:modelValue":e[260]||(e[260]=f=>r.configFile.activate_lollms_ttm_server=f),onChange:e[261]||(e[261]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_lollms_ttm_server]])])]),l("tr",null,[e[641]||(e[641]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_ollama_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate ollama server emulator:")],-1)),l("td",xat,[D(l("input",{type:"checkbox",id:"activate_ollama_emulator",required:"","onUpdate:modelValue":e[262]||(e[262]=f=>r.configFile.activate_ollama_emulator=f),onChange:e[263]||(e[263]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_ollama_emulator]])])]),l("tr",null,[e[642]||(e[642]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_openai_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate openai server emulator:")],-1)),l("td",Cat,[D(l("input",{type:"checkbox",id:"activate_openai_emulator",required:"","onUpdate:modelValue":e[264]||(e[264]=f=>r.configFile.activate_openai_emulator=f),onChange:e[265]||(e[265]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_openai_emulator]])])]),l("tr",null,[e[643]||(e[643]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_mistralai_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate mistral ai server emulator:")],-1)),l("td",wat,[D(l("input",{type:"checkbox",id:"activate_mistralai_emulator",required:"","onUpdate:modelValue":e[266]||(e[266]=f=>r.configFile.activate_mistralai_emulator=f),onChange:e[267]||(e[267]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_mistralai_emulator]])])])])]),_:1}),z(a,{title:"STT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[z(a,{title:"Browser Audio STT",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Rat,[l("tr",null,[e[644]||(e[644]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_audio_infos",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate audio infos:")],-1)),l("td",null,[l("div",Aat,[D(l("input",{type:"checkbox",id:"activate_audio_infos",required:"","onUpdate:modelValue":e[268]||(e[268]=f=>r.configFile.activate_audio_infos=f),onChange:e[269]||(e[269]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.activate_audio_infos]])])])]),l("tr",null,[e[645]||(e[645]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"audio_auto_send_input",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Send audio input automatically:")],-1)),l("td",null,[l("div",Nat,[D(l("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[270]||(e[270]=f=>r.configFile.audio_auto_send_input=f),onChange:e[271]||(e[271]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.audio_auto_send_input]])])])]),l("tr",null,[e[646]||(e[646]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"audio_silenceTimer",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio in silence timer (ms):")],-1)),l("td",null,[D(l("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[272]||(e[272]=f=>r.configFile.audio_silenceTimer=f),onChange:e[273]||(e[273]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"10000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.audio_silenceTimer]]),D(l("input",{"onUpdate:modelValue":e[274]||(e[274]=f=>r.configFile.audio_silenceTimer=f),onChange:e[275]||(e[275]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.audio_silenceTimer]])])]),l("tr",null,[e[647]||(e[647]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),l("td",null,[D(l("select",{id:"audio_in_language","onUpdate:modelValue":e[276]||(e[276]=f=>r.configFile.audio_in_language=f),onChange:e[277]||(e[277]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(r.audioLanguages,f=>(T(),w("option",{key:f.code,value:f.code},W(f.name),9,Mat))),128))],544),[[It,r.configFile.audio_in_language]])])])])]),_:1}),z(a,{title:"Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Oat,[l("tr",null,[e[648]||(e[648]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"whisper_activate",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Whisper at startup:")],-1)),l("td",null,[l("div",Iat,[D(l("input",{type:"checkbox",id:"whisper_activate",required:"","onUpdate:modelValue":e[278]||(e[278]=f=>r.configFile.whisper_activate=f),onChange:e[279]||(e[279]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.whisper_activate]])])])]),l("tr",null,[e[649]||(e[649]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}})],-1)),l("td",null,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[280]||(e[280]=(...f)=>r.reinstallWhisperService&&r.reinstallWhisperService(...f))},"install whisper")])]),l("tr",null,[e[650]||(e[650]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Whisper model:")],-1)),l("td",null,[l("div",kat,[D(l("select",{id:"whisper_model","onUpdate:modelValue":e[281]||(e[281]=f=>r.configFile.whisper_model=f),onChange:e[282]||(e[282]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(r.whisperModels,f=>(T(),w("option",{key:f,value:f},W(f),9,Dat))),128))],544),[[It,r.configFile.whisper_model]])])])])])]),_:1}),z(a,{title:"Open AI Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Lat,[l("tr",null,[e[651]||(e[651]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"openai_whisper_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai whisper key:")],-1)),l("td",null,[l("div",Pat,[D(l("input",{type:"text",id:"openai_whisper_key",required:"","onUpdate:modelValue":e[283]||(e[283]=f=>r.configFile.openai_whisper_key=f),onChange:e[284]||(e[284]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.openai_whisper_key]])])])]),l("tr",null,[e[652]||(e[652]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"openai_whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Open Ai Whisper model:")],-1)),l("td",null,[l("div",Fat,[D(l("select",{id:"openai_whisper_model","onUpdate:modelValue":e[285]||(e[285]=f=>r.configFile.openai_whisper_model=f),onChange:e[286]||(e[286]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(r.openaiWhisperModels,f=>(T(),w("option",{key:f,value:f},W(f),9,Uat))),128))],544),[[It,r.configFile.openai_whisper_model]])])])])])]),_:1})]),_:1}),z(a,{title:"TTS services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[z(a,{title:"Browser Audio TTS",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Bat,[l("tr",null,[e[653]||(e[653]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),l("td",null,[l("div",Gat,[D(l("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[287]||(e[287]=f=>r.configFile.auto_speak=f),onChange:e[288]||(e[288]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.auto_speak]])])])]),l("tr",null,[e[654]||(e[654]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),l("td",null,[D(l("input",{id:"audio_pitch","onUpdate:modelValue":e[289]||(e[289]=f=>r.configFile.audio_pitch=f),onChange:e[290]||(e[290]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"10",step:"0.1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.audio_pitch]]),D(l("input",{"onUpdate:modelValue":e[291]||(e[291]=f=>r.configFile.audio_pitch=f),onChange:e[292]||(e[292]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.audio_pitch]])])]),l("tr",null,[e[655]||(e[655]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),l("td",null,[D(l("select",{id:"audio_out_voice","onUpdate:modelValue":e[293]||(e[293]=f=>r.configFile.audio_out_voice=f),onChange:e[294]||(e[294]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(i.audioVoices,f=>(T(),w("option",{key:f.name,value:f.name},W(f.name),9,Vat))),128))],544),[[It,r.configFile.audio_out_voice]])])])])]),_:1}),z(a,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",zat,[l("tr",null,[e[656]||(e[656]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),l("td",null,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[295]||(e[295]=(...f)=>r.reinstallXTTSService&&r.reinstallXTTSService(...f))},"install xtts service")])]),l("tr",null,[e[657]||(e[657]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),l("td",null,[l("div",Hat,[D(l("select",{"onUpdate:modelValue":e[296]||(e[296]=f=>r.xtts_current_language=f),onChange:e[297]||(e[297]=f=>i.settingsChanged=!0)},[(T(!0),w(Be,null,Xe(i.voice_languages,(f,g)=>(T(),w("option",{key:g,value:f},W(g),9,qat))),128))],544),[[It,r.xtts_current_language]])])])]),l("tr",null,[e[658]||(e[658]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_current_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current voice:")],-1)),l("td",null,[l("div",Yat,[D(l("select",{"onUpdate:modelValue":e[298]||(e[298]=f=>r.xtts_current_voice=f),onChange:e[299]||(e[299]=f=>i.settingsChanged=!0)},[(T(!0),w(Be,null,Xe(i.voices,f=>(T(),w("option",{key:f,value:f},W(f),9,$at))),128))],544),[[It,r.xtts_current_voice]])])])]),l("tr",null,[e[659]||(e[659]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_freq",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Frequency (controls the tone):")],-1)),l("td",null,[l("div",Wat,[D(l("input",{type:"number",id:"xtts_freq",required:"","onUpdate:modelValue":e[300]||(e[300]=f=>r.configFile.xtts_freq=f),onChange:e[301]||(e[301]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.01"},null,544),[[ue,r.configFile.xtts_freq,void 0,{number:!0}]])])])]),l("tr",null,[e[660]||(e[660]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_read",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto read:")],-1)),l("td",null,[l("div",Kat,[D(l("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[302]||(e[302]=f=>r.configFile.auto_read=f),onChange:e[303]||(e[303]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.auto_read]])])])]),l("tr",null,[e[661]||(e[661]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_stream_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xtts stream chunk size:")],-1)),l("td",null,[l("div",jat,[D(l("input",{type:"text",id:"xtts_stream_chunk_size",required:"","onUpdate:modelValue":e[304]||(e[304]=f=>r.configFile.xtts_stream_chunk_size=f),onChange:e[305]||(e[305]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.xtts_stream_chunk_size]])])])]),l("tr",null,[e[662]||(e[662]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_temperature",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Temperature:")],-1)),l("td",null,[l("div",Qat,[D(l("input",{type:"number",id:"xtts_temperature",required:"","onUpdate:modelValue":e[306]||(e[306]=f=>r.configFile.xtts_temperature=f),onChange:e[307]||(e[307]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.01"},null,544),[[ue,r.configFile.xtts_temperature,void 0,{number:!0}]])])])]),l("tr",null,[e[663]||(e[663]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_length_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Length Penalty:")],-1)),l("td",null,[l("div",Xat,[D(l("input",{type:"number",id:"xtts_length_penalty",required:"","onUpdate:modelValue":e[308]||(e[308]=f=>r.configFile.xtts_length_penalty=f),onChange:e[309]||(e[309]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[ue,r.configFile.xtts_length_penalty,void 0,{number:!0}]])])])]),l("tr",null,[e[664]||(e[664]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_repetition_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Repetition Penalty:")],-1)),l("td",null,[l("div",Zat,[D(l("input",{type:"number",id:"xtts_repetition_penalty",required:"","onUpdate:modelValue":e[310]||(e[310]=f=>r.configFile.xtts_repetition_penalty=f),onChange:e[311]||(e[311]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[ue,r.configFile.xtts_repetition_penalty,void 0,{number:!0}]])])])]),l("tr",null,[e[665]||(e[665]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_top_k",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top K:")],-1)),l("td",null,[l("div",Jat,[D(l("input",{type:"number",id:"xtts_top_k",required:"","onUpdate:modelValue":e[312]||(e[312]=f=>r.configFile.xtts_top_k=f),onChange:e[313]||(e[313]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.xtts_top_k,void 0,{number:!0}]])])])]),l("tr",null,[e[666]||(e[666]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_top_p",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top P:")],-1)),l("td",null,[l("div",elt,[D(l("input",{type:"number",id:"xtts_top_p",required:"","onUpdate:modelValue":e[314]||(e[314]=f=>r.configFile.xtts_top_p=f),onChange:e[315]||(e[315]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.xtts_top_p,void 0,{number:!0}]])])])]),l("tr",null,[e[667]||(e[667]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_speed",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Speed:")],-1)),l("td",null,[l("div",tlt,[D(l("input",{type:"number",id:"xtts_speed",required:"","onUpdate:modelValue":e[316]||(e[316]=f=>r.configFile.xtts_speed=f),onChange:e[317]||(e[317]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[ue,r.configFile.xtts_speed,void 0,{number:!0}]])])])]),l("tr",null,[e[668]||(e[668]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_text_splitting",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable Text Splitting:")],-1)),l("td",null,[l("div",nlt,[D(l("input",{type:"checkbox",id:"enable_text_splitting","onUpdate:modelValue":e[318]||(e[318]=f=>r.configFile.enable_text_splitting=f),onChange:e[319]||(e[319]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.enable_text_splitting]])])])])])]),_:1}),z(a,{title:"Open AI TTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",slt,[l("tr",null,[e[669]||(e[669]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"openai_tts_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Open AI key:")],-1)),l("td",null,[l("div",ilt,[D(l("input",{type:"text",id:"openai_tts_key",required:"","onUpdate:modelValue":e[320]||(e[320]=f=>r.configFile.openai_tts_key=f),onChange:e[321]||(e[321]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.openai_tts_key]])])])]),l("tr",null,[e[671]||(e[671]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"openai_tts_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai tts model:")],-1)),l("td",null,[l("div",rlt,[D(l("select",{"onUpdate:modelValue":e[322]||(e[322]=f=>r.configFile.openai_tts_model=f),onChange:e[323]||(e[323]=f=>i.settingsChanged=!0)},e[670]||(e[670]=[l("option",null," tts-1 ",-1),l("option",null," tts-2 ",-1)]),544),[[It,r.configFile.openai_tts_model]])])])]),l("tr",null,[e[673]||(e[673]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"openai_tts_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai tts voice:")],-1)),l("td",null,[l("div",olt,[D(l("select",{"onUpdate:modelValue":e[324]||(e[324]=f=>r.configFile.openai_tts_voice=f),onChange:e[325]||(e[325]=f=>i.settingsChanged=!0)},e[672]||(e[672]=[l("option",null," alloy ",-1),l("option",null," echo ",-1),l("option",null," fable ",-1),l("option",null," nova ",-1),l("option",null," shimmer ",-1)]),544),[[It,r.configFile.openai_tts_voice]])])])])])]),_:1}),z(a,{title:"Eleven Labs TTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",alt,[l("tr",null,[e[674]||(e[674]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elevenlabs_tts_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Eleven Labs key:")],-1)),l("td",null,[l("div",llt,[D(l("input",{type:"text",id:"elevenlabs_tts_key",required:"","onUpdate:modelValue":e[326]||(e[326]=f=>r.configFile.elevenlabs_tts_key=f),onChange:e[327]||(e[327]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.elevenlabs_tts_key]])])])]),l("tr",null,[e[675]||(e[675]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elevenlabs_tts_model_id",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Eleven Labs TTS model ID:")],-1)),l("td",null,[l("div",clt,[D(l("input",{type:"text",id:"elevenlabs_tts_model_id",required:"","onUpdate:modelValue":e[328]||(e[328]=f=>r.configFile.elevenlabs_tts_model_id=f),onChange:e[329]||(e[329]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.elevenlabs_tts_model_id]])])])]),l("tr",null,[e[676]||(e[676]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elevenlabs_tts_voice_stability",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Voice Stability:")],-1)),l("td",null,[l("div",dlt,[D(l("input",{type:"number",id:"elevenlabs_tts_voice_stability",required:"","onUpdate:modelValue":e[330]||(e[330]=f=>r.configFile.elevenlabs_tts_voice_stability=f),onChange:e[331]||(e[331]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1",min:"0",max:"1"},null,544),[[ue,r.configFile.elevenlabs_tts_voice_stability]])])])]),l("tr",null,[e[677]||(e[677]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elevenlabs_tts_voice_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Voice Boost:")],-1)),l("td",null,[l("div",ult,[D(l("input",{type:"number",id:"elevenlabs_tts_voice_boost",required:"","onUpdate:modelValue":e[332]||(e[332]=f=>r.configFile.elevenlabs_tts_voice_boost=f),onChange:e[333]||(e[333]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1",min:"0",max:"1"},null,544),[[ue,r.configFile.elevenlabs_tts_voice_boost]])])])]),l("tr",null,[e[678]||(e[678]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elevenlabs_tts_voice_id",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Voice ID:")],-1)),l("td",null,[l("div",plt,[D(l("select",{"onUpdate:modelValue":e[334]||(e[334]=f=>r.configFile.elevenlabs_tts_voice_id=f),onChange:e[335]||(e[335]=f=>i.settingsChanged=!0)},[(T(!0),w(Be,null,Xe(i.voices,f=>(T(),w("option",{key:f.voice_id,value:f.voice_id},W(f.name),9,flt))),128))],544),[[It,r.configFile.elevenlabs_tts_voice_id]])])])])])]),_:1}),z(a,{title:"Fish TTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",_lt,[l("tr",null,[e[679]||(e[679]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"fish_tts_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fish TTS key:")],-1)),l("td",null,[l("div",mlt,[D(l("input",{type:"text",id:"fish_tts_key",required:"","onUpdate:modelValue":e[336]||(e[336]=f=>r.configFile.fish_tts_key=f),onChange:e[337]||(e[337]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.fish_tts_key]])])])]),l("tr",null,[e[680]||(e[680]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"fish_tts_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fish TTS voice:")],-1)),l("td",null,[l("div",hlt,[D(l("input",{type:"text",id:"fish_tts_voice",required:"","onUpdate:modelValue":e[338]||(e[338]=f=>r.configFile.fish_tts_voice=f),onChange:e[339]||(e[339]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.fish_tts_voice]])])])])])]),_:1})]),_:1}),z(a,{title:"TTI services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[z(a,{title:"Stable diffusion service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",glt,[l("tr",null,[e[682]||(e[682]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable sd service:")],-1)),l("td",null,[l("div",blt,[D(l("input",{type:"checkbox",id:"enable_sd_service",required:"","onUpdate:modelValue":e[340]||(e[340]=f=>r.configFile.enable_sd_service=f),onChange:e[341]||(e[341]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.enable_sd_service]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[342]||(e[342]=f=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},e[681]||(e[681]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[684]||(e[684]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install SD service:")],-1)),l("td",null,[l("div",ylt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[343]||(e[343]=(...f)=>r.reinstallSDService&&r.reinstallSDService(...f))},"install sd service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[344]||(e[344]=(...f)=>r.upgradeSDService&&r.upgradeSDService(...f))},"upgrade sd service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[345]||(e[345]=(...f)=>r.startSDService&&r.startSDService(...f))},"start sd service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[346]||(e[346]=(...f)=>r.showSD&&r.showSD(...f))},"show sd ui"),e[683]||(e[683]=l("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/ParisNeo/stable-diffusion-webui/blob/master/LICENSE.txt",target:"_blank"},"automatic1111's sd licence",-1))])]),l("td",null,[l("div",Elt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[347]||(e[347]=(...f)=>r.reinstallSDService&&r.reinstallSDService(...f))},"install sd service")])])]),l("tr",null,[e[685]||(e[685]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),l("td",null,[l("div",vlt,[D(l("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[348]||(e[348]=f=>r.configFile.sd_base_url=f),onChange:e[349]||(e[349]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.sd_base_url]])])])])])]),_:1}),z(a,{title:"Diffusers service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Slt,[l("tr",null,[e[687]||(e[687]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"install_diffusers_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Diffusers service:")],-1)),l("td",null,[l("div",Tlt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[350]||(e[350]=(...f)=>r.reinstallDiffusersService&&r.reinstallDiffusersService(...f))},"install diffusers service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[351]||(e[351]=(...f)=>r.upgradeDiffusersService&&r.upgradeDiffusersService(...f))},"upgrade diffusers service"),e[686]||(e[686]=l("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/huggingface/diffusers?tab=Apache-2.0-1-ov-file#readme",target:"_blank"},"Diffusers licence",-1))])])]),l("tr",null,[e[688]||(e[688]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"diffusers_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Diffusers model:")],-1)),l("td",null,[l("div",xlt,[D(l("input",{type:"text",id:"diffusers_model",required:"","onUpdate:modelValue":e[352]||(e[352]=f=>r.configFile.diffusers_model=f),onChange:e[353]||(e[353]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.diffusers_model]])])]),e[689]||(e[689]=l("td",null,null,-1))])])]),_:1}),z(a,{title:"Diffusers client service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Clt,[l("tr",null,[e[690]||(e[690]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"diffusers_client_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Diffusers client base url:")],-1)),l("td",null,[l("div",wlt,[D(l("input",{type:"text",id:"diffusers_client_base_url",required:"","onUpdate:modelValue":e[354]||(e[354]=f=>r.configFile.diffusers_client_base_url=f),onChange:e[355]||(e[355]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.diffusers_client_base_url]])])]),e[691]||(e[691]=l("td",null,null,-1))])])]),_:1}),z(a,{title:"Midjourney",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Rlt,[l("tr",null,[e[692]||(e[692]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"midjourney_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"midjourney key:")],-1)),l("td",null,[l("div",Alt,[D(l("input",{type:"text",id:"midjourney_key",required:"","onUpdate:modelValue":e[356]||(e[356]=f=>r.configFile.midjourney_key=f),onChange:e[357]||(e[357]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.midjourney_key]])])])]),l("tr",null,[e[693]||(e[693]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"midjourney_timeout",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"request timeout(s):")],-1)),l("td",null,[l("div",Nlt,[D(l("input",{type:"number",min:"10",max:"2048",id:"midjourney_timeout",required:"","onUpdate:modelValue":e[358]||(e[358]=f=>r.configFile.midjourney_timeout=f),onChange:e[359]||(e[359]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.midjourney_timeout]])])])]),l("tr",null,[e[694]||(e[694]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"midjourney_retries",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"number of retries:")],-1)),l("td",null,[l("div",Mlt,[D(l("input",{type:"number",min:"0",max:"2048",id:"midjourney_retries",required:"","onUpdate:modelValue":e[360]||(e[360]=f=>r.configFile.midjourney_retries=f),onChange:e[361]||(e[361]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.midjourney_retries]])])])])])]),_:1}),z(a,{title:"Dall-E",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Olt,[l("tr",null,[e[695]||(e[695]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"dall_e_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"dall e key:")],-1)),l("td",null,[l("div",Ilt,[D(l("input",{type:"text",id:"dall_e_key",required:"","onUpdate:modelValue":e[362]||(e[362]=f=>r.configFile.dall_e_key=f),onChange:e[363]||(e[363]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.dall_e_key]])])])]),l("tr",null,[e[697]||(e[697]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"dall_e_generation_engine",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"dall e generation engine:")],-1)),l("td",null,[l("div",klt,[D(l("select",{"onUpdate:modelValue":e[364]||(e[364]=f=>r.configFile.dall_e_generation_engine=f),onChange:e[365]||(e[365]=f=>i.settingsChanged=!0)},e[696]||(e[696]=[l("option",null," dall-e-2 ",-1),l("option",null," dall-e-3 ",-1)]),544),[[It,r.configFile.dall_e_generation_engine]])])])])])]),_:1}),z(a,{title:"ComfyUI service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Dlt,[l("tr",null,[e[699]||(e[699]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_comfyui_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui service:")],-1)),l("td",null,[l("div",Llt,[D(l("input",{type:"checkbox",id:"enable_comfyui_service",required:"","onUpdate:modelValue":e[366]||(e[366]=f=>r.configFile.enable_comfyui_service=f),onChange:e[367]||(e[367]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.enable_comfyui_service]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[368]||(e[368]=f=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},e[698]||(e[698]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[700]||(e[700]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"comfyui_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Available models (only if local):")],-1)),l("td",null,[l("div",Plt,[D(l("select",{id:"comfyui_model",required:"","onUpdate:modelValue":e[369]||(e[369]=f=>r.configFile.comfyui_model=f),onChange:e[370]||(e[370]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(i.comfyui_models,(f,g)=>(T(),w("option",{key:f,value:f},W(f),9,Flt))),128))],544),[[It,r.configFile.comfyui_model]])])])]),l("tr",null,[e[702]||(e[702]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"comfyui_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui model:")],-1)),l("td",null,[l("div",Ult,[D(l("input",{type:"text",id:"comfyui_model",required:"","onUpdate:modelValue":e[371]||(e[371]=f=>r.configFile.comfyui_model=f),onChange:e[372]||(e[372]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.comfyui_model]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[373]||(e[373]=f=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},e[701]||(e[701]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[704]||(e[704]=l("td",{style:{"min-width":"200px"}},null,-1)),l("td",null,[l("div",Blt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[374]||(e[374]=(...f)=>r.reinstallComfyUIService&&r.reinstallComfyUIService(...f))},"install comfyui service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[375]||(e[375]=(...f)=>r.upgradeComfyUIService&&r.upgradeComfyUIService(...f))},"upgrade comfyui service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[376]||(e[376]=(...f)=>r.startComfyUIService&&r.startComfyUIService(...f))},"start comfyui service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[377]||(e[377]=(...f)=>r.showComfyui&&r.showComfyui(...f))},"show comfyui"),e[703]||(e[703]=l("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/ParisNeo/ComfyUI/blob/master/LICENSE",target:"_blank"},"comfyui licence",-1))])])]),l("tr",null,[e[705]||(e[705]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"comfyui_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"comfyui base url:")],-1)),l("td",null,[l("div",Glt,[D(l("input",{type:"text",id:"comfyui_base_url",required:"","onUpdate:modelValue":e[378]||(e[378]=f=>r.configFile.comfyui_base_url=f),onChange:e[379]||(e[379]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.comfyui_base_url]])])])])])]),_:1})]),_:1}),z(a,{title:"TTT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[z(a,{title:"Ollama service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Vlt,[l("tr",null,[e[707]||(e[707]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_ollama_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable ollama service:")],-1)),l("td",null,[l("div",zlt,[D(l("input",{type:"checkbox",id:"enable_ollama_service",required:"","onUpdate:modelValue":e[380]||(e[380]=f=>r.configFile.enable_ollama_service=f),onChange:e[381]||(e[381]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.enable_ollama_service]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[382]||(e[382]=f=>this.$store.state.messageBox.showMessage(`Activates ollama service. The service will be automatically loaded at startup alowing you to use the ollama binding. +`,"
")}},rendered_models_zoo:{get(){return this.searchModel?this.show_only_installed_models?this.modelsFiltered.filter(n=>n.isInstalled===!0):this.modelsFiltered.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)):(console.log("this.models_zoo"),console.log(this.models_zoo),console.log(this.models_zoo_initialLoadCount),this.show_only_installed_models?this.models_zoo.filter(n=>n.isInstalled===!0):this.models_zoo.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)))}},imgBinding:{get(){if(!this.isMounted)return Ls;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Ls}}},imgModel:{get(){try{let n=this.$store.state.modelsZoo.findIndex(e=>e.name==this.$store.state.selectedModel);return n>=0?(console.log(`model avatar : ${this.$store.state.modelsZoo[n].icon}`),this.$store.state.modelsZoo[n].icon):Ls}catch{console.log("error")}if(!this.isMounted)return Ls;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Ls}}},isReady:{get(){return this.$store.state.ready}},audio_out_voice:{get(){return this.$store.state.config.audio_out_voice},set(n){this.$store.state.config.audio_out_voice=n}},openaiWhisperModels(){return["whisper-1"]},whisperModels(){return["tiny.en","tiny","base.en","base","small.en","small","medium.en","medium","large-v1","large-v2","large-v3","large"]},audioLanguages(){return[{code:"en-US",name:"English (US)"},{code:"en-GB",name:"English (UK)"},{code:"es-ES",name:"Spanish (Spain)"},{code:"es-MX",name:"Spanish (Mexico)"},{code:"fr-FR",name:"French (France)"},{code:"fr-CA",name:"French (Canada)"},{code:"de-DE",name:"German (Germany)"},{code:"it-IT",name:"Italian (Italy)"},{code:"pt-BR",name:"Portuguese (Brazil)"},{code:"pt-PT",name:"Portuguese (Portugal)"},{code:"ru-RU",name:"Russian (Russia)"},{code:"zh-CN",name:"Chinese (China)"},{code:"ja-JP",name:"Japanese (Japan)"},{code:"ar-SA",name:"Arabic (Saudi Arabia)"},{code:"tr-TR",name:"Turkish (Turkey)"},{code:"ms-MY",name:"Malay (Malaysia)"},{code:"ko-KR",name:"Korean (South Korea)"},{code:"nl-NL",name:"Dutch (Netherlands)"},{code:"sv-SE",name:"Swedish (Sweden)"},{code:"da-DK",name:"Danish (Denmark)"},{code:"fi-FI",name:"Finnish (Finland)"},{code:"no-NO",name:"Norwegian (Norway)"},{code:"pl-PL",name:"Polish (Poland)"},{code:"el-GR",name:"Greek (Greece)"},{code:"hu-HU",name:"Hungarian (Hungary)"},{code:"cs-CZ",name:"Czech (Czech Republic)"},{code:"th-TH",name:"Thai (Thailand)"},{code:"hi-IN",name:"Hindi (India)"},{code:"he-IL",name:"Hebrew (Israel)"},{code:"id-ID",name:"Indonesian (Indonesia)"},{code:"vi-VN",name:"Vietnamese (Vietnam)"},{code:"uk-UA",name:"Ukrainian (Ukraine)"},{code:"ro-RO",name:"Romanian (Romania)"},{code:"bg-BG",name:"Bulgarian (Bulgaria)"},{code:"hr-HR",name:"Croatian (Croatia)"},{code:"sr-RS",name:"Serbian (Serbia)"},{code:"sk-SK",name:"Slovak (Slovakia)"},{code:"sl-SI",name:"Slovenian (Slovenia)"},{code:"et-EE",name:"Estonian (Estonia)"},{code:"lv-LV",name:"Latvian (Latvia)"},{code:"lt-LT",name:"Lithuanian (Lithuania)"},{code:"ka-GE",name:"Georgian (Georgia)"},{code:"hy-AM",name:"Armenian (Armenia)"},{code:"az-AZ",name:"Azerbaijani (Azerbaijan)"},{code:"kk-KZ",name:"Kazakh (Kazakhstan)"},{code:"uz-UZ",name:"Uzbek (Uzbekistan)"},{code:"kkj-CM",name:"Kako (Cameroon)"},{code:"my-MM",name:"Burmese (Myanmar)"},{code:"ne-NP",name:"Nepali (Nepal)"},{code:"si-LK",name:"Sinhala (Sri Lanka)"}]},configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},userName:{get(){return this.$store.state.config.user_name},set(n){this.$store.state.config.user_name=n}},user_avatar:{get(){return this.$store.state.config.user_avatar!=""?"/user_infos/"+this.$store.state.config.user_avatar:Us},set(n){this.$store.state.config.user_avatar=n}},hardware_mode:{get(){return this.$store.state.config.hardware_mode},set(n){this.$store.state.config.hardware_mode=n}},auto_update:{get(){return this.$store.state.config.auto_update},set(n){this.$store.state.config.auto_update=n}},auto_speak:{get(){return this.$store.state.config.auto_speak},set(n){this.$store.state.config.auto_speak=n}},auto_read:{get(){return this.$store.state.config.auto_read},set(n){this.$store.state.config.auto_read=n}},xtts_current_language:{get(){return this.$store.state.config.xtts_current_language},set(n){console.log("Current xtts voice set to ",n),this.$store.state.config.xtts_current_language=n}},xtts_current_voice:{get(){return this.$store.state.config.xtts_current_voice===null||this.$store.state.config.xtts_current_voice===void 0?(console.log("current voice",this.$store.state.config.xtts_current_voice),"main_voice"):this.$store.state.config.xtts_current_voice},set(n){n=="main_voice"||n===void 0?(console.log("Current voice set to None"),this.$store.state.config.xtts_current_voice=null):(console.log("Current voice set to ",n),this.$store.state.config.xtts_current_voice=n)}},audio_pitch:{get(){return this.$store.state.config.audio_pitch},set(n){this.$store.state.config.audio_pitch=n}},audio_in_language:{get(){return this.$store.state.config.audio_in_language},set(n){this.$store.state.config.audio_in_language=n}},use_user_name_in_discussions:{get(){return this.$store.state.config.use_user_name_in_discussions},set(n){this.$store.state.config.use_user_name_in_discussions=n}},discussion_db_name:{get(){return this.$store.state.config.discussion_db_name},set(n){this.$store.state.config.discussion_db_name=n}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}},bindingsZoo:{get(){return this.$store.state.bindingsZoo},set(n){this.$store.commit("setbindingsZoo",n)}},modelsArr:{get(){return this.$store.state.modelsArr},set(n){this.$store.commit("setModelsArr",n)}},models:{get(){return this.models_zoo},set(n){this.$store.commit("setModelsZoo",n)}},installed_models:{get(){return this.models_zoo},set(n){this.$store.commit("setModelsZoo",n)}},diskUsage:{get(){return this.$store.state.diskUsage},set(n){this.$store.commit("setDiskUsage",n)}},ramUsage:{get(){return this.$store.state.ramUsage},set(n){this.$store.commit("setRamUsage",n)}},vramUsage:{get(){return this.$store.state.vramUsage},set(n){this.$store.commit("setVramUsage",n)}},disk_available_space(){return this.computedFileSize(this.diskUsage.available_space)},disk_binding_models_usage(){return console.log(`this.diskUsage : ${this.diskUsage}`),this.computedFileSize(this.diskUsage.binding_models_usage)},disk_percent_usage(){return this.diskUsage.percent_usage},disk_total_space(){return this.computedFileSize(this.diskUsage.total_space)},ram_available_space(){return this.computedFileSize(this.ramUsage.available_space)},ram_usage(){return this.computedFileSize(this.ramUsage.ram_usage)},ram_percent_usage(){return this.ramUsage.percent_usage},ram_total_space(){return this.computedFileSize(this.ramUsage.total_space)},model_name(){if(this.isMounted)return this.configFile.model_name},binding_name(){if(!this.isMounted)return null;const n=this.bindingsZoo.findIndex(e=>e.folder===this.configFile.binding_name);return n>-1?this.bindingsZoo[n].name:null},active_pesonality(){if(!this.isMounted)return null;const n=this.$store.state.personalities.findIndex(e=>e.full_path===this.configFile.personalities[this.configFile.active_personality_id]);return n>-1?this.$store.state.personalities[n].name:null},speed_computed(){return si(this.addModel.speed)},total_size_computed(){return si(this.addModel.total_size)},downloaded_size_computed(){return si(this.addModel.downloaded_size)}},watch:{bec_collapsed(){Le(()=>{Ve.replace()})},pc_collapsed(){Le(()=>{Ve.replace()})},mc_collapsed(){Le(()=>{Ve.replace()})},sc_collapsed(){Le(()=>{Ve.replace()})},showConfirmation(){Le(()=>{Ve.replace()})},mzl_collapsed(){Le(()=>{Ve.replace()})},pzl_collapsed(){Le(()=>{Ve.replace()})},ezl_collapsed(){Le(()=>{Ve.replace()})},bzl_collapsed(){Le(()=>{Ve.replace()})},all_collapsed(n){this.collapseAll(n),Le(()=>{Ve.replace()})},settingsChanged(n){this.$store.state.settingsChanged=n,Le(()=>{Ve.replace()})},isLoading(){Le(()=>{Ve.replace()})},searchPersonality(n){n==""&&this.filterPersonalities()},mzdc_collapsed(){Le(()=>{Ve.replace()})}},async beforeRouteLeave(n){await this.$router.isReady()}},nit={class:"container flex flex-row shadow-lg p-10 pt-0 overflow-y-scroll w-full background-color scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},sit={class:"sticky top-0 z-10 flex flex-row mb-2 p-3 gap-3 w-full rounded-b-lg panels-color shadow-lg"},iit={key:0,class:"flex gap-3 flex-1 items-center duration-75"},rit={key:1,class:"flex gap-3 flex-1 items-center"},oit={class:"flex gap-3 flex-1 items-center justify-end"},ait={class:"flex gap-3 items-center"},lit={key:0,class:"flex gap-3 items-center"},cit={key:1,role:"status"},dit={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},uit={class:"flex flex-row p-3"},pit={class:"text-base font-semibold cursor-pointer select-none items-center"},fit={class:"flex gap-2 items-center"},_it={key:0},mit=["src"],hit={class:"font-bold font-large text-lg"},git={key:1},bit={class:"flex gap-2 items-center"},yit=["src"],Eit={class:"font-bold font-large text-lg"},vit={class:"font-bold font-large text-lg"},Sit={class:"font-bold font-large text-lg"},Tit={class:"mb-2"},xit={class:"flex flex-col mx-2"},Cit={class:"p-2"},wit={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Rit={class:"mb-2"},Ait={class:"flex flex-col mx-2"},Nit={class:"p-2"},Mit={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Oit={class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Iit=["src"],kit={class:"flex flex-col mx-2"},Dit={class:"p-2"},Lit={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Pit={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Fit={class:"flex flex-row p-3"},Uit={class:"flex flex-col mb-2 px-3 pb-2"},Bit={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Git={style:{width:"100%"}},Vit={style:{width:"100%"}},zit={style:{width:"100%"}},Hit={style:{width:"100%"}},qit={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Yit={class:"flex flex-row p-3"},$it={class:"flex flex-col mb-2 px-3 pb-2"},Wit={class:"expand-to-fit bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Kit={for:"logo-upload"},jit=["src"],Qit={style:{width:"10%"}},Xit={class:"text-center items-center"},Zit={class:"flex flex-row"},Jit={style:{width:"100%"}},ert={class:"flex flex-row"},trt={class:"flex flex-row"},nrt={class:"flex flex-row"},srt={class:"flex flex-row"},irt={class:"flex flex-row"},rrt={class:"flex flex-row"},ort={class:"flex flex-row"},art={class:"flex flex-row"},lrt={class:"flex flex-row"},crt={class:"flex flex-row"},drt={class:"flex flex-row"},urt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},prt=["innerHTML"],frt={style:{width:"100%"}},_rt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},mrt={style:{width:"100%"}},hrt={style:{width:"100%"}},grt={style:{width:"100%"}},brt={style:{width:"100%"}},yrt={for:"avatar-upload"},Ert=["src"],vrt={style:{width:"10%"}},Srt={class:"flex flex-row"},Trt={style:{width:"100%"}},xrt={style:{width:"100%"}},Crt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},wrt={style:{width:"100%"}},Rrt={style:{width:"100%"}},Art={style:{width:"100%"}},Nrt={style:{width:"100%"}},Mrt={style:{width:"100%"}},Ort={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Irt={class:"flex flex-row"},krt={style:{width:"100%"}},Drt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Lrt={class:"flex flex-row"},Prt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Frt={class:"flex flex-row"},Urt={class:"flex flex-row"},Brt={class:"flex flex-row"},Grt={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Vrt={class:"flex flex-row p-3"},zrt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Hrt={style:{width:"100%"}},qrt=["onUpdate:modelValue"],Yrt=["onClick"],$rt=["onClick"],Wrt=["onClick"],Krt=["disabled"],jrt={key:0,value:"sentence-transformers/bert-base-nli-mean-tokens"},Qrt={key:1,value:"bert-base-uncased"},Xrt={key:2,value:"bert-base-multilingual-uncased"},Zrt={key:3,value:"bert-large-uncased"},Jrt={key:4,value:"bert-large-uncased-whole-word-masking-finetuned-squad"},eot={key:5,value:"distilbert-base-uncased"},tot={key:6,value:"roberta-base"},not={key:7,value:"roberta-large"},sot={key:8,value:"xlm-roberta-base"},iot={key:9,value:"xlm-roberta-large"},rot={key:10,value:"albert-base-v2"},oot={key:11,value:"albert-large-v2"},aot={key:12,value:"albert-xlarge-v2"},lot={key:13,value:"albert-xxlarge-v2"},cot={key:14,value:"sentence-transformers/all-MiniLM-L6-v2"},dot={key:15,value:"sentence-transformers/all-MiniLM-L12-v2"},uot={key:16,value:"sentence-transformers/all-distilroberta-v1"},pot={key:17,value:"sentence-transformers/all-mpnet-base-v2"},fot={key:18,value:"text-embedding-ada-002"},_ot={key:19,value:"text-embedding-babbage-001"},mot={key:20,value:"text-embedding-curie-001"},hot={key:21,value:"text-embedding-davinci-001"},got={key:22,disabled:""},bot={class:"flex flex-row"},yot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Eot={class:"flex flex-row"},vot={class:"flex flex-row"},Sot={class:"flex flex-row"},Tot={class:"flex flex-row"},xot={class:"flex flex-row"},Cot={style:{width:"100%"}},wot={class:"flex flex-row"},Rot={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Aot={class:"flex flex-row p-3"},Not={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Mot={class:"flex flex-row"},Oot={class:"flex flex-row"},Iot={class:"flex flex-row"},kot={class:"flex flex-row"},Dot={class:"flex flex-col"},Lot={class:"flex flex-col"},Pot={class:"flex flex-col"},Fot={class:"flex flex-col"},Uot={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Bot={class:"flex flex-row p-3"},Got={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Vot={style:{width:"100%"}},zot={style:{width:"100%"}},Hot={style:{width:"100%"}},qot={style:{width:"100%"}},Yot={style:{width:"100%"}},$ot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Wot={class:"flex flex-row"},Kot={class:"flex flex-row"},jot={class:"flex flex-row"},Qot={class:"flex flex-row"},Xot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Zot={style:{width:"100%"}},Jot={style:{width:"100%"}},eat={style:{width:"100%"}},tat={style:{width:"100%"}},nat={style:{width:"100%"}},sat={style:{width:"100%"}},iat={style:{width:"100%"}},rat={class:"flex flex-row"},oat={class:"flex flex-row"},aat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},lat={style:{width:"100%"}},cat=["value"],dat={style:{width:"100%"}},uat=["value"],pat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},fat={style:{width:"100%"}},_at={style:{width:"100%"}},mat={style:{width:"100%"}},hat={style:{width:"100%"}},gat={style:{width:"100%"}},bat={style:{width:"100%"}},yat={style:{width:"100%"}},Eat={style:{width:"100%"}},vat={style:{width:"100%"}},Sat={style:{width:"100%"}},Tat={style:{width:"100%"}},xat={style:{width:"100%"}},Cat={style:{width:"100%"}},wat={style:{width:"100%"}},Rat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Aat={class:"flex flex-row"},Nat={class:"flex flex-row"},Mat=["value"],Oat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Iat={class:"flex flex-row"},kat={class:"flex flex-row"},Dat=["value"],Lat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Pat={class:"flex flex-row"},Fat={class:"flex flex-row"},Uat=["value"],Bat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Gat={class:"flex flex-row"},Vat=["value"],zat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Hat={class:"flex flex-row"},qat=["value"],Yat={class:"flex flex-row"},$at=["value"],Wat={class:"flex flex-row"},Kat={class:"flex flex-row"},jat={class:"flex flex-row"},Qat={class:"flex flex-row"},Xat={class:"flex flex-row"},Zat={class:"flex flex-row"},Jat={class:"flex flex-row"},elt={class:"flex flex-row"},tlt={class:"flex flex-row"},nlt={class:"flex flex-row"},slt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},ilt={class:"flex flex-row"},rlt={class:"flex flex-row"},olt={class:"flex flex-row"},alt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},llt={class:"flex flex-row"},clt={class:"flex flex-row"},dlt={class:"flex flex-row"},ult={class:"flex flex-row"},plt={class:"flex flex-row"},flt=["value"],_lt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},mlt={class:"flex flex-row"},hlt={class:"flex flex-row"},glt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},blt={class:"flex flex-row"},ylt={class:"flex flex-row"},Elt={class:"flex flex-row"},vlt={class:"flex flex-row"},Slt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Tlt={class:"flex flex-row"},xlt={class:"flex flex-row"},Clt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},wlt={class:"flex flex-row"},Rlt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Alt={class:"flex flex-row"},Nlt={class:"flex flex-row"},Mlt={class:"flex flex-row"},Olt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Ilt={class:"flex flex-row"},klt={class:"flex flex-row"},Dlt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Llt={class:"flex flex-row"},Plt={class:"flex flex-row"},Flt=["value"],Ult={class:"flex flex-row"},Blt={class:"flex flex-row"},Glt={class:"flex flex-row"},Vlt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},zlt={class:"flex flex-row"},Hlt={class:"flex flex-row"},qlt={class:"flex flex-row"},Ylt={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},$lt={class:"flex flex-row"},Wlt={class:"flex flex-row"},Klt={class:"flex flex-row"},jlt={class:"flex flex-col align-bottom"},Qlt={class:"relative"},Xlt={class:"absolute right-0"},Zlt={class:"flex flex-row"},Jlt={class:"flex flex-row"},ect={class:"flex flex-row"},tct={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},nct={class:"flex flex-row"},sct={class:"flex flex-row"},ict={class:"flex flex-row"},rct={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},oct={class:"flex flex-row"},act={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},lct={class:"flex flex-row"},cct={class:"flex flex-row"},dct={class:"flex flex-row"},uct={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},pct={class:"flex flex-row p-3"},fct={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},_ct={key:1,class:"mr-2"},mct={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},hct={class:"flex gap-1 items-center"},gct=["src"],bct={class:"font-bold font-large text-lg line-clamp-1"},yct={key:0,class:"mb-2"},Ect={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},vct={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Sct={class:"flex flex-row p-3"},Tct={class:"flex flex-row items-center"},xct={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Cct={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},wct={key:2,class:"mr-2"},Rct={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},Act={class:"flex gap-1 items-center"},Nct=["src"],Mct={class:"font-bold font-large text-lg line-clamp-1"},Oct={class:"mx-2 mb-4"},Ict={class:"relative"},kct={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Dct={key:0},Lct={key:1},Pct={key:0,role:"status",class:"text-center w-full display: flex;align-items: center;"},Fct={key:1,class:"mb-2"},Uct={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Bct={class:"mb-2"},Gct={class:"p-2"},Vct={class:"mb-3"},zct={key:0},Hct={class:"mb-3"},qct={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},Yct={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},$ct={class:"w-full p-2"},Wct={class:"flex justify-between mb-1"},Kct={class:"text-sm font-medium text-blue-700 dark:text-white"},jct=["title"],Qct={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Xct={class:"flex justify-between mb-1"},Zct={class:"text-base font-medium text-blue-700 dark:text-white"},Jct={class:"text-sm font-medium text-blue-700 dark:text-white"},edt={class:"flex flex-grow"},tdt={class:"flex flex-row flex-grow gap-3"},ndt={class:"p-2 text-center grow"},sdt={class:"flex flex-col mb-2 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},idt={class:"flex flex-row p-3 items-center"},rdt={key:0,class:"mr-2"},odt={class:"mr-2 font-bold font-large text-lg line-clamp-1"},adt={key:1,class:"mr-2"},ldt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},cdt={key:0,class:"flex -space-x-4 items-center"},ddt={class:"group items-center flex flex-row"},udt=["onClick"],pdt=["src","title"],fdt=["onClick"],_dt={class:"mx-2 mb-4"},mdt={class:"relative"},hdt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},gdt={key:0},bdt={key:1},ydt={key:0,class:"mx-2 mb-4"},Edt={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},vdt=["selected"],Sdt={key:0,class:"mb-2"},Tdt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},xdt={class:"flex flex-col mb-2 p-3 rounded-lg panels-color hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Cdt={class:"flex flex-row"},wdt={class:"m-2"},Rdt={class:"flex flex-row gap-2 items-center"},Adt={class:"m-2"},Ndt={class:"m-2"},Mdt={class:"flex flex-col align-bottom"},Odt={class:"relative"},Idt={class:"absolute right-0"},kdt={class:"m-2"},Ddt={class:"flex flex-col align-bottom"},Ldt={class:"relative"},Pdt={class:"absolute right-0"},Fdt={class:"m-2"},Udt={class:"flex flex-col align-bottom"},Bdt={class:"relative"},Gdt={class:"absolute right-0"},Vdt={class:"m-2"},zdt={class:"flex flex-col align-bottom"},Hdt={class:"relative"},qdt={class:"absolute right-0"},Ydt={class:"m-2"},$dt={class:"flex flex-col align-bottom"},Wdt={class:"relative"},Kdt={class:"absolute right-0"},jdt={class:"m-2"},Qdt={class:"flex flex-col align-bottom"},Xdt={class:"relative"},Zdt={class:"absolute right-0"};function Jdt(n,e,t,s,i,r){const o=et("StringListManager"),a=et("Card"),c=et("BindingEntry"),d=et("RadioOptions"),u=et("model-entry"),_=et("personality-entry"),m=et("AddModelDialog"),h=et("ChoiceDialog");return T(),w(Be,null,[l("div",nit,[l("div",sit,[i.showConfirmation?(T(),w("div",iit,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=K(f=>i.showConfirmation=!1,["stop"]))},e[471]||(e[471]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=K(f=>r.save_configuration(),["stop"]))},e[472]||(e[472]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),i.showConfirmation?B("",!0):(T(),w("div",rit,[l("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=f=>r.reset_configuration())},e[473]||(e[473]=[l("i",{"data-feather":"refresh-ccw"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[3]||(e[3]=K(f=>i.all_collapsed=!i.all_collapsed,["stop"]))},e[474]||(e[474]=[l("i",{"data-feather":"list"},null,-1)]))])),l("div",oit,[l("button",{title:"Clear uploads",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[4]||(e[4]=f=>r.api_get_req("clear_uploads").then(g=>{g.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},e[475]||(e[475]=[l("i",{"data-feather":"trash-2"},null,-1)])),l("button",{title:"Restart program",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[5]||(e[5]=f=>r.api_post_req("restart_program").then(g=>{g.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},e[476]||(e[476]=[l("i",{"data-feather":"refresh-ccw"},null,-1)])),i.has_updates?(T(),w("button",{key:0,title:"Upgrade program ",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[6]||(e[6]=f=>r.api_post_req("update_software").then(g=>{g.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Success!",4,!0)}))},e[477]||(e[477]=[l("i",{"data-feather":"arrow-up-circle"},null,-1),l("i",{"data-feather":"alert-circle"},null,-1)]))):B("",!0),l("div",ait,[i.settingsChanged?(T(),w("div",lit,[i.isLoading?B("",!0):(T(),w("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[7]||(e[7]=K(f=>r.applyConfiguration(),["stop"]))},e[478]||(e[478]=[l("div",{class:"flex flex-row"},[l("p",{class:"text-green-600 font-bold hover:text-green-300 ml-4 pl-4 mr-4 pr-4"},"Apply changes:"),l("i",{"data-feather":"check"})],-1)]))),i.isLoading?B("",!0):(T(),w("button",{key:1,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Cancel changes",type:"button",onClick:e[8]||(e[8]=K(f=>r.cancelConfiguration(),["stop"]))},e[479]||(e[479]=[l("div",{class:"flex flex-row"},[l("p",{class:"text-red-600 font-bold hover:text-red-300 ml-4 pl-4 mr-4 pr-4"},"Cancel changes:"),l("i",{"data-feather":"x"})],-1)])))])):B("",!0),i.isLoading?(T(),w("div",cit,[l("p",null,W(i.loading_text),1),e[480]||(e[480]=l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),e[481]||(e[481]=l("span",{class:"sr-only"},"Loading...",-1))])):B("",!0)])])]),l("div",{class:Ue(i.isLoading?"pointer-events-none opacity-30 w-full":"w-full")},[l("div",dit,[l("div",uit,[l("button",{onClick:e[9]||(e[9]=K(f=>i.sc_collapsed=!i.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[482]||(e[482]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.sc_collapsed]]),D(l("div",null,e[483]||(e[483]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.sc_collapsed]]),e[486]||(e[486]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),e[487]||(e[487]=l("div",{class:"mr-2"},"|",-1)),l("div",pit,[l("div",fit,[l("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(T(),w("div",_it,[(T(!0),w(Be,null,Xe(r.vramUsage.gpus,f=>(T(),w("div",{class:"flex gap-2 items-center",key:f},[l("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,mit),l("p",hit,[l("div",null,W(r.computedFileSize(f.used_vram))+" / "+W(r.computedFileSize(f.total_vram))+" ("+W(f.percentage)+"%) ",1)])]))),128))])):B("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(T(),w("div",git,[l("div",bit,[l("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,yit),l("p",Eit,[l("div",null,W(r.vramUsage.gpus.length)+"x ",1)])])])):B("",!0)]),e[484]||(e[484]=l("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),l("p",vit,[l("div",null,W(r.ram_usage)+" / "+W(r.ram_total_space)+" ("+W(r.ram_percent_usage)+"%)",1)]),e[485]||(e[485]=l("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),l("p",Sit,[l("div",null,W(r.disk_binding_models_usage)+" / "+W(r.disk_total_space)+" ("+W(r.disk_percent_usage)+"%)",1)])])])])]),l("div",{class:Ue([{hidden:i.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[l("div",Tit,[e[490]||(e[490]=l("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[l("path",{fill:"currentColor",d:"M17 17H7V7h10m4 4V9h-2V7a2 2 0 0 0-2-2h-2V3h-2v2h-2V3H9v2H7c-1.11 0-2 .89-2 2v2H3v2h2v2H3v2h2v2a2 2 0 0 0 2 2h2v2h2v-2h2v2h2v-2h2a2 2 0 0 0 2-2v-2h2v-2h-2v-2m-6 2h-2v-2h2m2-2H9v6h6V9Z"})]),Ze(" CPU Ram usage: ")],-1)),l("div",xit,[l("div",null,[e[488]||(e[488]=l("b",null,"Avaliable ram: ",-1)),Ze(W(r.ram_available_space),1)]),l("div",null,[e[489]||(e[489]=l("b",null,"Ram usage: ",-1)),Ze(" "+W(r.ram_usage)+" / "+W(r.ram_total_space)+" ("+W(r.ram_percent_usage)+")% ",1)])]),l("div",Cit,[l("div",wit,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Wt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),l("div",Rit,[e[493]||(e[493]=l("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[l("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),Ze(" Disk usage: ")],-1)),l("div",Ait,[l("div",null,[e[491]||(e[491]=l("b",null,"Avaliable disk space: ",-1)),Ze(W(r.disk_available_space),1)]),l("div",null,[e[492]||(e[492]=l("b",null,"Disk usage: ",-1)),Ze(" "+W(r.disk_binding_models_usage)+" / "+W(r.disk_total_space)+" ("+W(r.disk_percent_usage)+"%)",1)])]),l("div",Nit,[l("div",Mit,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Wt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(T(!0),w(Be,null,Xe(r.vramUsage.gpus,f=>(T(),w("div",{class:"mb-2",key:f},[l("label",Oit,[l("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,Iit),e[494]||(e[494]=Ze(" GPU usage: "))]),l("div",kit,[l("div",null,[e[495]||(e[495]=l("b",null,"Model: ",-1)),Ze(W(f.gpu_model),1)]),l("div",null,[e[496]||(e[496]=l("b",null,"Avaliable vram: ",-1)),Ze(W(this.computedFileSize(f.available_space)),1)]),l("div",null,[e[497]||(e[497]=l("b",null,"GPU usage: ",-1)),Ze(" "+W(this.computedFileSize(f.used_vram))+" / "+W(this.computedFileSize(f.total_vram))+" ("+W(f.percentage)+"%)",1)])]),l("div",Dit,[l("div",Lit,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Wt("width: "+f.percentage+"%;")},null,4)])])]))),128))],2)]),l("div",Pit,[l("div",Fit,[l("button",{onClick:e[10]||(e[10]=K(f=>i.smartrouterconf_collapsed=!i.smartrouterconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[498]||(e[498]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.smartrouterconf_collapsed]]),D(l("div",null,e[499]||(e[499]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.smartrouterconf_collapsed]]),e[500]||(e[500]=l("div",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Smart routing configurations",-1))])]),l("div",{class:Ue([{hidden:i.smartrouterconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[l("div",Uit,[z(a,{title:"Smart Routing Settings",is_shrunk:!1,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Bit,[l("tr",null,[e[501]||(e[501]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_smart_routing",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use Smart Routing:")],-1)),l("td",Git,[D(l("input",{type:"checkbox",id:"use_smart_routing","onUpdate:modelValue":e[11]||(e[11]=f=>r.configFile.use_smart_routing=f),onChange:e[12]||(e[12]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.use_smart_routing]])])]),l("tr",null,[e[502]||(e[502]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"restore_model_after_smart_routing",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Restore model after smart routing:")],-1)),l("td",Vit,[D(l("input",{type:"checkbox",id:"restore_model_after_smart_routing","onUpdate:modelValue":e[13]||(e[13]=f=>r.configFile.restore_model_after_smart_routing=f),onChange:e[14]||(e[14]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.restore_model_after_smart_routing]])])]),l("tr",null,[e[503]||(e[503]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"smart_routing_router_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Router Model:")],-1)),l("td",zit,[D(l("input",{type:"text",id:"smart_routing_router_model","onUpdate:modelValue":e[15]||(e[15]=f=>r.configFile.smart_routing_router_model=f),onChange:e[16]||(e[16]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.smart_routing_router_model]])])]),l("tr",null,[e[504]||(e[504]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"smart_routing_models_by_power",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Models by Power:")],-1)),l("td",Hit,[z(o,{modelValue:r.configFile.smart_routing_models_by_power,"onUpdate:modelValue":e[17]||(e[17]=f=>r.configFile.smart_routing_models_by_power=f),onChange:e[18]||(e[18]=f=>i.settingsChanged=!0),placeholder:"Enter model name"},null,8,["modelValue"])])])])]),_:1})])],2)]),l("div",qit,[l("div",Yit,[l("button",{onClick:e[19]||(e[19]=K(f=>i.mainconf_collapsed=!i.mainconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[505]||(e[505]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.mainconf_collapsed]]),D(l("div",null,e[506]||(e[506]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.mainconf_collapsed]]),e[507]||(e[507]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1))])]),l("div",{class:Ue([{hidden:i.mainconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[l("div",$it,[z(a,{title:"General",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Wit,[l("tr",null,[e[509]||(e[509]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"app_custom_logo",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Application logo:")],-1)),l("td",null,[l("label",Kit,[l("img",{src:r.configFile.app_custom_logo!=null&&r.configFile.app_custom_logo!=""?"/user_infos/"+r.configFile.app_custom_logo:i.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,jit)]),l("input",{type:"file",id:"logo-upload",style:{display:"none"},onChange:e[20]||(e[20]=(...f)=>r.uploadLogo&&r.uploadLogo(...f))},null,32)]),l("td",Qit,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[21]||(e[21]=K(f=>r.resetLogo(),["stop"]))},e[508]||(e[508]=[l("i",{"data-feather":"x"},null,-1)]))])]),l("tr",null,[e[511]||(e[511]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"hardware_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Hardware mode:")],-1)),l("td",Xit,[l("div",Zit,[D(l("select",{id:"hardware_mode",required:"","onUpdate:modelValue":e[22]||(e[22]=f=>r.configFile.hardware_mode=f),onChange:e[23]||(e[23]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[510]||(e[510]=[l("option",{value:"cpu"},"CPU",-1),l("option",{value:"cpu-noavx"},"CPU (No AVX)",-1),l("option",{value:"nvidia-tensorcores"},"NVIDIA (Tensor Cores)",-1),l("option",{value:"nvidia"},"NVIDIA",-1),l("option",{value:"amd-noavx"},"AMD (No AVX)",-1),l("option",{value:"amd"},"AMD",-1),l("option",{value:"apple-intel"},"Apple Intel",-1),l("option",{value:"apple-silicon"},"Apple Silicon",-1)]),544),[[It,r.configFile.hardware_mode]])])])]),l("tr",null,[e[512]||(e[512]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),l("td",Jit,[D(l("input",{type:"text",id:"discussion_db_name",required:"","onUpdate:modelValue":e[24]||(e[24]=f=>r.configFile.discussion_db_name=f),onChange:e[25]||(e[25]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.discussion_db_name]])])]),l("tr",null,[e[513]||(e[513]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"copy_to_clipboard_add_all_details",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Add details to messages copied to clipboard:")],-1)),l("td",null,[l("div",ert,[D(l("input",{type:"checkbox",id:"copy_to_clipboard_add_all_details",required:"","onUpdate:modelValue":e[26]||(e[26]=f=>r.configFile.copy_to_clipboard_add_all_details=f),onChange:e[27]||(e[27]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.copy_to_clipboard_add_all_details]])])])]),l("tr",null,[e[514]||(e[514]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_show_browser",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto show browser:")],-1)),l("td",null,[l("div",trt,[D(l("input",{type:"checkbox",id:"auto_show_browser",required:"","onUpdate:modelValue":e[28]||(e[28]=f=>r.configFile.auto_show_browser=f),onChange:e[29]||(e[29]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.auto_show_browser]])])])]),l("tr",null,[e[515]||(e[515]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_debug",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate debug mode:")],-1)),l("td",null,[l("div",nrt,[D(l("input",{type:"checkbox",id:"activate_debug",required:"","onUpdate:modelValue":e[30]||(e[30]=f=>r.configFile.debug=f),onChange:e[31]||(e[31]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.debug]])])])]),l("tr",null,[e[516]||(e[516]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"debug_show_final_full_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate showing the full prompt in console (for debug):")],-1)),l("td",null,[l("div",srt,[D(l("input",{type:"checkbox",id:"debug_show_final_full_prompt",required:"","onUpdate:modelValue":e[32]||(e[32]=f=>r.configFile.debug_show_final_full_prompt=f),onChange:e[33]||(e[33]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.debug_show_final_full_prompt]])])])]),l("tr",null,[e[517]||(e[517]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"debug_show_final_full_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show final full prompt in console:")],-1)),l("td",null,[l("div",irt,[D(l("input",{type:"checkbox",id:"debug_show_final_full_prompt",required:"","onUpdate:modelValue":e[34]||(e[34]=f=>r.configFile.debug_show_final_full_prompt=f),onChange:e[35]||(e[35]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.debug_show_final_full_prompt]])])])]),l("tr",null,[e[518]||(e[518]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"debug_show_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show chunks in console:")],-1)),l("td",null,[l("div",rrt,[D(l("input",{type:"checkbox",id:"debug_show_chunks",required:"","onUpdate:modelValue":e[36]||(e[36]=f=>r.configFile.debug_show_chunks=f),onChange:e[37]||(e[37]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.debug_show_chunks]])])])]),l("tr",null,[e[519]||(e[519]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"debug_log_file_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Debug file path:")],-1)),l("td",null,[l("div",ort,[D(l("input",{type:"text",id:"debug_log_file_path",required:"","onUpdate:modelValue":e[38]||(e[38]=f=>r.configFile.debug_log_file_path=f),onChange:e[39]||(e[39]=f=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.debug_log_file_path]])])])]),l("tr",null,[e[520]||(e[520]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"show_news_panel",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show news panel:")],-1)),l("td",null,[l("div",art,[D(l("input",{type:"checkbox",id:"show_news_panel",required:"","onUpdate:modelValue":e[40]||(e[40]=f=>r.configFile.show_news_panel=f),onChange:e[41]||(e[41]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.show_news_panel]])])])]),l("tr",null,[e[521]||(e[521]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),l("td",null,[l("div",lrt,[D(l("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[42]||(e[42]=f=>r.configFile.auto_save=f),onChange:e[43]||(e[43]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.auto_save]])])])]),l("tr",null,[e[522]||(e[522]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),l("td",null,[l("div",crt,[D(l("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[44]||(e[44]=f=>r.configFile.auto_update=f),onChange:e[45]||(e[45]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.auto_update]])])])]),l("tr",null,[e[523]||(e[523]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto title:")],-1)),l("td",null,[l("div",drt,[D(l("input",{type:"checkbox",id:"auto_title",required:"","onUpdate:modelValue":e[46]||(e[46]=f=>r.configFile.auto_title=f),onChange:e[47]||(e[47]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.auto_title]])])])])])]),_:1}),z(a,{title:"Model template",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",urt,[l("tr",null,[e[525]||(e[525]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"start_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start header id template:")],-1)),l("td",null,[l("select",{onChange:e[48]||(e[48]=(...f)=>r.handleTemplateSelection&&r.handleTemplateSelection(...f))},e[524]||(e[524]=[l("option",{value:"lollms"},"Lollms communication template",-1),l("option",{value:"lollms_simplified"},"Lollms simplified communication template",-1),l("option",{value:"bare"},"Bare, useful when in chat mode",-1),l("option",{value:"llama3"},"LLama3 communication template",-1),l("option",{value:"mistral"},"Mistral communication template",-1)]),32)])]),l("tr",null,[e[526]||(e[526]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"start_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"start_header_id_template",required:"","onUpdate:modelValue":e[49]||(e[49]=f=>r.configFile.start_header_id_template=f),onChange:e[50]||(e[50]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.start_header_id_template]])])]),l("tr",null,[e[527]||(e[527]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"end_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"end_header_id_template",required:"","onUpdate:modelValue":e[51]||(e[51]=f=>r.configFile.end_header_id_template=f),onChange:e[52]||(e[52]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.end_header_id_template]])])]),l("tr",null,[e[528]||(e[528]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"start_user_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start user header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"start_user_header_id_template",required:"","onUpdate:modelValue":e[53]||(e[53]=f=>r.configFile.start_user_header_id_template=f),onChange:e[54]||(e[54]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.start_user_header_id_template]])])]),l("tr",null,[e[529]||(e[529]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"end_user_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End user header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"end_user_header_id_template",required:"","onUpdate:modelValue":e[55]||(e[55]=f=>r.configFile.end_user_header_id_template=f),onChange:e[56]||(e[56]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.end_user_header_id_template]])])]),l("tr",null,[e[530]||(e[530]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"end_user_message_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End user message id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"end_user_message_id_template",required:"","onUpdate:modelValue":e[57]||(e[57]=f=>r.configFile.end_user_message_id_template=f),onChange:e[58]||(e[58]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.end_user_message_id_template]])])]),l("tr",null,[e[531]||(e[531]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"start_ai_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start ai header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"start_ai_header_id_template",required:"","onUpdate:modelValue":e[59]||(e[59]=f=>r.configFile.start_ai_header_id_template=f),onChange:e[60]||(e[60]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.start_ai_header_id_template]])])]),l("tr",null,[e[532]||(e[532]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"end_ai_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End ai header id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"end_ai_header_id_template",required:"","onUpdate:modelValue":e[61]||(e[61]=f=>r.configFile.end_ai_header_id_template=f),onChange:e[62]||(e[62]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.end_ai_header_id_template]])])]),l("tr",null,[e[533]||(e[533]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"end_ai_message_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End ai message id template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"end_ai_message_id_template",required:"","onUpdate:modelValue":e[63]||(e[63]=f=>r.configFile.end_ai_message_id_template=f),onChange:e[64]||(e[64]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.end_ai_message_id_template]])])]),l("tr",null,[e[534]||(e[534]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"separator_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Separator template:")],-1)),l("td",null,[D(l("textarea",{id:"separator_template",required:"","onUpdate:modelValue":e[65]||(e[65]=f=>r.configFile.separator_template=f),onChange:e[66]||(e[66]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.separator_template]])])]),l("tr",null,[e[535]||(e[535]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"system_message_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"System template:")],-1)),l("td",null,[D(l("input",{type:"text",id:"system_message_template",required:"","onUpdate:modelValue":e[67]||(e[67]=f=>r.configFile.system_message_template=f),onChange:e[68]||(e[68]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.system_message_template]])])]),l("tr",null,[e[536]||(e[536]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"full_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Full template:")],-1)),l("td",null,[l("div",{innerHTML:r.full_template},null,8,prt)])]),l("tr",null,[e[537]||(e[537]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_continue_message",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"useful for chat models and repote models but can be less useful for instruct ones"},"Use continue message:")],-1)),l("td",frt,[D(l("input",{type:"checkbox",id:"use_continue_message",required:"","onUpdate:modelValue":e[69]||(e[69]=f=>r.configFile.use_continue_message=f),onChange:e[70]||(e[70]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.use_continue_message]])])])])]),_:1}),z(a,{title:"User",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",_rt,[l("tr",null,[e[538]||(e[538]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),l("td",mrt,[D(l("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[71]||(e[71]=f=>r.configFile.user_name=f),onChange:e[72]||(e[72]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.user_name]])])]),l("tr",null,[e[539]||(e[539]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),l("td",hrt,[D(l("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[73]||(e[73]=f=>r.configFile.user_description=f),onChange:e[74]||(e[74]=f=>i.settingsChanged=!0),class:"min-h-[500px] w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.user_description]])])]),l("tr",null,[e[540]||(e[540]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_user_informations_in_discussion",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use user description in discussion:")],-1)),l("td",grt,[D(l("input",{type:"checkbox",id:"use_user_informations_in_discussion",required:"","onUpdate:modelValue":e[75]||(e[75]=f=>r.configFile.use_user_informations_in_discussion=f),onChange:e[76]||(e[76]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.use_user_informations_in_discussion]])])]),l("tr",null,[e[541]||(e[541]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_model_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use model name in discussion:")],-1)),l("td",brt,[D(l("input",{type:"checkbox",id:"use_model_name_in_discussions",required:"","onUpdate:modelValue":e[77]||(e[77]=f=>r.configFile.use_model_name_in_discussions=f),onChange:e[78]||(e[78]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.use_model_name_in_discussions]])])]),l("tr",null,[e[543]||(e[543]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"user_avatar",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),l("td",null,[l("label",yrt,[l("img",{src:r.configFile.user_avatar!=null&&r.configFile.user_avatar!=""?"/user_infos/"+r.configFile.user_avatar:i.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,Ert)]),l("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[79]||(e[79]=(...f)=>r.uploadAvatar&&r.uploadAvatar(...f))},null,32)]),l("td",vrt,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[80]||(e[80]=K(f=>r.resetAvatar(),["stop"]))},e[542]||(e[542]=[l("i",{"data-feather":"x"},null,-1)]))])]),l("tr",null,[e[544]||(e[544]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),l("td",null,[l("div",Srt,[D(l("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[81]||(e[81]=f=>r.configFile.use_user_name_in_discussions=f),onChange:e[82]||(e[82]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.use_user_name_in_discussions]])])])]),l("tr",null,[e[545]||(e[545]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"max_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Maximum number of output tokens space (forces the model to have more space to speak):")],-1)),l("td",Trt,[D(l("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[83]||(e[83]=f=>r.configFile.max_n_predict=f),onChange:e[84]||(e[84]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.max_n_predict]])])]),l("tr",null,[e[546]||(e[546]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"max_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Minimum number of output tokens space (forces the model to have more space to speak):")],-1)),l("td",xrt,[D(l("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[85]||(e[85]=f=>r.configFile.max_n_predict=f),onChange:e[86]||(e[86]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.max_n_predict]])])])])]),_:1}),z(a,{title:"Security settings",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Crt,[l("tr",null,[e[547]||(e[547]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"turn_on_code_execution",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code execution:")],-1)),l("td",wrt,[D(l("input",{type:"checkbox",id:"turn_on_code_execution",required:"","onUpdate:modelValue":e[87]||(e[87]=f=>r.configFile.turn_on_code_execution=f),onChange:e[88]||(e[88]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.turn_on_code_execution]])])]),l("tr",null,[e[548]||(e[548]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"turn_on_code_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code validation (very recommended for security reasons):")],-1)),l("td",Rrt,[D(l("input",{type:"checkbox",id:"turn_on_code_validation",required:"","onUpdate:modelValue":e[89]||(e[89]=f=>r.configFile.turn_on_code_validation=f),onChange:e[90]||(e[90]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.turn_on_code_validation]])])]),l("tr",null,[e[549]||(e[549]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"turn_on_setting_update_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on apply settings validation (very recommended for security reasons):")],-1)),l("td",Art,[D(l("input",{type:"checkbox",id:"turn_on_setting_update_validation",required:"","onUpdate:modelValue":e[91]||(e[91]=f=>r.configFile.turn_on_setting_update_validation=f),onChange:e[92]||(e[92]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.turn_on_setting_update_validation]])])]),l("tr",null,[e[550]||(e[550]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"turn_on_open_file_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on open file/folder validation:")],-1)),l("td",Nrt,[D(l("input",{type:"checkbox",id:"turn_on_open_file_validation",required:"","onUpdate:modelValue":e[93]||(e[93]=f=>r.configFile.turn_on_open_file_validation=f),onChange:e[94]||(e[94]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.turn_on_open_file_validation]])])]),l("tr",null,[e[551]||(e[551]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"turn_on_send_file_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on send file validation:")],-1)),l("td",Mrt,[D(l("input",{type:"checkbox",id:"turn_on_send_file_validation",required:"","onUpdate:modelValue":e[95]||(e[95]=f=>r.configFile.turn_on_send_file_validation=f),onChange:e[96]||(e[96]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.turn_on_send_file_validation]])])])])]),_:1}),z(a,{title:"Knowledge database",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Ort,[l("tr",null,[e[552]||(e[552]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_skills_lib",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Skills library:")],-1)),l("td",null,[l("div",Irt,[D(l("input",{type:"checkbox",id:"activate_skills_lib",required:"","onUpdate:modelValue":e[97]||(e[97]=f=>r.configFile.activate_skills_lib=f),onChange:e[98]||(e[98]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_skills_lib]])])])]),l("tr",null,[e[553]||(e[553]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Skills library database name:")],-1)),l("td",krt,[D(l("input",{type:"text",id:"skills_lib_database_name",required:"","onUpdate:modelValue":e[99]||(e[99]=f=>r.configFile.skills_lib_database_name=f),onChange:e[100]||(e[100]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.skills_lib_database_name]])])])])]),_:1}),z(a,{title:"Latex",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Drt,[l("tr",null,[e[554]||(e[554]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"pdf_latex_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"PDF LaTeX path:")],-1)),l("td",null,[l("div",Lrt,[D(l("input",{type:"text",id:"pdf_latex_path",required:"","onUpdate:modelValue":e[101]||(e[101]=f=>r.configFile.pdf_latex_path=f),onChange:e[102]||(e[102]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.pdf_latex_path]])])])])])]),_:1}),z(a,{title:"Boost",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Prt,[l("tr",null,[e[555]||(e[555]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"positive_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Positive Boost:")],-1)),l("td",null,[l("div",Frt,[D(l("input",{type:"text",id:"positive_boost",required:"","onUpdate:modelValue":e[103]||(e[103]=f=>r.configFile.positive_boost=f),onChange:e[104]||(e[104]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.positive_boost]])])])]),l("tr",null,[e[556]||(e[556]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"negative_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative Boost:")],-1)),l("td",null,[l("div",Urt,[D(l("input",{type:"text",id:"negative_boost",required:"","onUpdate:modelValue":e[105]||(e[105]=f=>r.configFile.negative_boost=f),onChange:e[106]||(e[106]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.negative_boost]])])])]),l("tr",null,[e[557]||(e[557]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"fun_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fun mode:")],-1)),l("td",null,[l("div",Brt,[D(l("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[107]||(e[107]=f=>r.configFile.fun_mode=f),onChange:e[108]||(e[108]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.fun_mode]])])])])])]),_:1})])],2)]),l("div",Grt,[l("div",Vrt,[l("button",{onClick:e[109]||(e[109]=K(f=>i.data_conf_collapsed=!i.data_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[558]||(e[558]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.data_conf_collapsed]]),D(l("div",null,e[559]||(e[559]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.data_conf_collapsed]]),e[560]||(e[560]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Data management settings",-1))])]),l("div",{class:Ue([{hidden:i.data_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[z(a,{title:"Data Sources",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",zrt,[l("tr",null,[e[561]||(e[561]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_databases",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data Sources:")],-1)),l("td",Hrt,[(T(!0),w(Be,null,Xe(r.configFile.rag_databases,(f,g)=>(T(),w("div",{key:g,class:"flex items-center mb-2"},[D(l("input",{type:"text","onUpdate:modelValue":b=>r.configFile.rag_databases[g]=b,onChange:e[110]||(e[110]=b=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,40,qrt),[[ue,r.configFile.rag_databases[g]]]),l("button",{onClick:b=>r.vectorize_folder(g),class:"w-500 ml-2 px-2 py-1 bg-green-500 text-white hover:bg-green-300 rounded"},"(Re)Vectorize",8,Yrt),l("button",{onClick:b=>r.select_folder(g),class:"w-500 ml-2 px-2 py-1 bg-blue-500 text-white hover:bg-green-300 rounded"},"Select Folder",8,$rt),l("button",{onClick:b=>r.removeDataSource(g),class:"ml-2 px-2 py-1 bg-red-500 text-white hover:bg-green-300 rounded"},"Remove",8,Wrt)]))),128)),l("button",{onClick:e[111]||(e[111]=(...f)=>r.addDataSource&&r.addDataSource(...f)),class:"mt-2 px-2 py-1 bg-blue-500 text-white rounded"},"Add Data Source")])]),l("tr",null,[e[563]||(e[563]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG Vectorizer:")],-1)),l("td",null,[D(l("select",{id:"rag_vectorizer",required:"","onUpdate:modelValue":e[112]||(e[112]=f=>r.configFile.rag_vectorizer=f),onChange:e[113]||(e[113]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[562]||(e[562]=[l("option",{value:"semantic"},"Semantic Vectorizer",-1),l("option",{value:"tfidf"},"TFIDF Vectorizer",-1),l("option",{value:"openai"},"OpenAI Vectorizer",-1)]),544),[[It,r.configFile.rag_vectorizer]])])]),l("tr",null,[e[564]||(e[564]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_vectorizer_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG Vectorizer model:")],-1)),l("td",null,[D(l("select",{id:"rag_vectorizer_model",required:"","onUpdate:modelValue":e[114]||(e[114]=f=>r.configFile.rag_vectorizer_model=f),onChange:e[115]||(e[115]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:r.configFile.rag_vectorizer==="tfidf"},[r.configFile.rag_vectorizer==="semantic"?(T(),w("option",jrt,"sentence-transformers/bert-base-nli-mean-tokens")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",Qrt,"bert-base-uncased")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",Xrt,"bert-base-multilingual-uncased")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",Zrt,"bert-large-uncased")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",Jrt,"bert-large-uncased-whole-word-masking-finetuned-squad")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",eot,"distilbert-base-uncased")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",tot,"roberta-base")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",not,"roberta-large")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",sot,"xlm-roberta-base")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",iot,"xlm-roberta-large")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",rot,"albert-base-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",oot,"albert-large-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",aot,"albert-xlarge-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",lot,"albert-xxlarge-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",cot,"sentence-transformers/all-MiniLM-L6-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",dot,"sentence-transformers/all-MiniLM-L12-v2")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",uot,"sentence-transformers/all-distilroberta-v1")):B("",!0),r.configFile.rag_vectorizer==="semantic"?(T(),w("option",pot,"sentence-transformers/all-mpnet-base-v2")):B("",!0),r.configFile.rag_vectorizer==="openai"?(T(),w("option",fot,"text-embedding-ada-002")):B("",!0),r.configFile.rag_vectorizer==="openai"?(T(),w("option",_ot,"text-embedding-babbage-001")):B("",!0),r.configFile.rag_vectorizer==="openai"?(T(),w("option",mot,"text-embedding-curie-001")):B("",!0),r.configFile.rag_vectorizer==="openai"?(T(),w("option",hot,"text-embedding-davinci-001")):B("",!0),r.configFile.rag_vectorizer==="tfidf"?(T(),w("option",got,"No models available for TFIDF")):B("",!0)],40,Krt),[[It,r.configFile.rag_vectorizer_model]])])]),l("tr",null,[e[565]||(e[565]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_vectorizer_openai_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Open AI key for open ai embedding method (if not provided I'll use OPENAI_API_KEY environment variable):")],-1)),l("td",null,[l("div",bot,[D(l("input",{type:"text",id:"rag_vectorizer_openai_key",required:"","onUpdate:modelValue":e[116]||(e[116]=f=>r.configFile.rag_vectorizer_openai_key=f),onChange:e[117]||(e[117]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.rag_vectorizer_openai_key]])])])]),l("tr",null,[e[566]||(e[566]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG chunk size:")],-1)),l("td",null,[D(l("input",{id:"rag_chunk_size","onUpdate:modelValue":e[118]||(e[118]=f=>r.configFile.rag_chunk_size=f),onChange:e[119]||(e[119]=f=>i.settingsChanged=!0),type:"range",min:"2",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.rag_chunk_size]]),D(l("input",{"onUpdate:modelValue":e[120]||(e[120]=f=>r.configFile.rag_chunk_size=f),type:"number",onChange:e[121]||(e[121]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.rag_chunk_size]])])]),l("tr",null,[e[567]||(e[567]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_overlap",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG overlap size:")],-1)),l("td",null,[D(l("input",{id:"rag_overlap","onUpdate:modelValue":e[122]||(e[122]=f=>r.configFile.rag_overlap=f),onChange:e[123]||(e[123]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.rag_overlap]]),D(l("input",{"onUpdate:modelValue":e[124]||(e[124]=f=>r.configFile.rag_overlap=f),type:"number",onChange:e[125]||(e[125]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.rag_overlap]])])]),l("tr",null,[e[568]||(e[568]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_n_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG number of chunks:")],-1)),l("td",null,[D(l("input",{id:"rag_n_chunks","onUpdate:modelValue":e[126]||(e[126]=f=>r.configFile.rag_n_chunks=f),onChange:e[127]||(e[127]=f=>i.settingsChanged=!0),type:"range",min:"2",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.rag_n_chunks]]),D(l("input",{"onUpdate:modelValue":e[128]||(e[128]=f=>r.configFile.rag_n_chunks=f),type:"number",onChange:e[129]||(e[129]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.rag_n_chunks]])])]),l("tr",null,[e[569]||(e[569]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_clean_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Clean chunks:")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[130]||(e[130]=f=>r.configFile.rag_clean_chunks=f),type:"checkbox",onChange:e[131]||(e[131]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.rag_clean_chunks]])])]),l("tr",null,[e[570]||(e[570]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_follow_subfolders",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Follow subfolders:")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[132]||(e[132]=f=>r.configFile.rag_follow_subfolders=f),type:"checkbox",onChange:e[133]||(e[133]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.rag_follow_subfolders]])])]),l("tr",null,[e[571]||(e[571]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_check_new_files_at_startup",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Check for new files at startup:")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[134]||(e[134]=f=>r.configFile.rag_check_new_files_at_startup=f),type:"checkbox",onChange:e[135]||(e[135]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.rag_check_new_files_at_startup]])])]),l("tr",null,[e[572]||(e[572]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_preprocess_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Preprocess chunks:")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[136]||(e[136]=f=>r.configFile.rag_preprocess_chunks=f),type:"checkbox",onChange:e[137]||(e[137]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.rag_preprocess_chunks]])])]),l("tr",null,[e[573]||(e[573]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_activate_multi_hops",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate multi hops RAG:")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[138]||(e[138]=f=>r.configFile.rag_activate_multi_hops=f),type:"checkbox",onChange:e[139]||(e[139]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.rag_activate_multi_hops]])])]),l("tr",null,[e[574]||(e[574]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"contextual_summary",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use contextual summary instead of rag (consumes alot of tokens and may be very slow but efficient, useful for summary and global questions that RAG can't do):")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[140]||(e[140]=f=>r.configFile.contextual_summary=f),type:"checkbox",onChange:e[141]||(e[141]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.contextual_summary]])])]),l("tr",null,[e[575]||(e[575]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"rag_deactivate",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Useful for very big contexts and global tasks that require the whole document"},"Use all the document content (No split):")],-1)),l("td",null,[D(l("input",{"onUpdate:modelValue":e[142]||(e[142]=f=>r.configFile.rag_deactivate=f),type:"checkbox",onChange:e[143]||(e[143]=f=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.rag_deactivate]])])])])]),_:1}),z(a,{title:"Data Vectorization",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",yot,[l("tr",null,[e[576]||(e[576]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Save vectorized database:")],-1)),l("td",null,[l("div",Eot,[D(l("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[144]||(e[144]=f=>r.configFile.data_vectorization_save_db=f),onChange:e[145]||(e[145]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.data_vectorization_save_db]])])])]),l("tr",null,[e[577]||(e[577]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_visualize_on_vectorization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"show vectorized data:")],-1)),l("td",null,[l("div",vot,[D(l("input",{type:"checkbox",id:"data_vectorization_visualize_on_vectorization",required:"","onUpdate:modelValue":e[146]||(e[146]=f=>r.configFile.data_vectorization_visualize_on_vectorization=f),onChange:e[147]||(e[147]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.data_vectorization_visualize_on_vectorization]])])])]),l("tr",null,[e[578]||(e[578]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_build_keys_words",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reformulate prompt before querying database (advised):")],-1)),l("td",null,[l("div",Sot,[D(l("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[148]||(e[148]=f=>r.configFile.data_vectorization_build_keys_words=f),onChange:e[149]||(e[149]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.data_vectorization_build_keys_words]])])])]),l("tr",null,[e[579]||(e[579]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_force_first_chunk",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Force adding the first chunk of the file to the context:")],-1)),l("td",null,[l("div",Tot,[D(l("input",{type:"checkbox",id:"data_vectorization_force_first_chunk",required:"","onUpdate:modelValue":e[150]||(e[150]=f=>r.configFile.data_vectorization_force_first_chunk=f),onChange:e[151]||(e[151]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.data_vectorization_force_first_chunk]])])])]),l("tr",null,[e[580]||(e[580]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_put_chunk_informations_into_context",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Put Chunk Information Into Context:")],-1)),l("td",null,[l("div",xot,[D(l("input",{type:"checkbox",id:"data_vectorization_put_chunk_informations_into_context",required:"","onUpdate:modelValue":e[152]||(e[152]=f=>r.configFile.data_vectorization_put_chunk_informations_into_context=f),onChange:e[153]||(e[153]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.data_vectorization_put_chunk_informations_into_context]])])])]),l("tr",null,[e[582]||(e[582]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization method:")],-1)),l("td",null,[D(l("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[154]||(e[154]=f=>r.configFile.data_vectorization_method=f),onChange:e[155]||(e[155]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[581]||(e[581]=[l("option",{value:"tfidf_vectorizer"},"tfidf Vectorizer",-1),l("option",{value:"bm25_vectorizer"},"bm25 Vectorizer",-1),l("option",{value:"model_embedding"},"Model Embedding",-1),l("option",{value:"sentense_transformer"},"Sentense Transformer",-1)]),544),[[It,r.configFile.data_vectorization_method]])])]),l("tr",null,[e[583]||(e[583]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_sentense_transformer_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization model (for Sentense Transformer):")],-1)),l("td",Cot,[D(l("input",{type:"text",id:"data_vectorization_sentense_transformer_model",required:"","onUpdate:modelValue":e[156]||(e[156]=f=>r.configFile.data_vectorization_sentense_transformer_model=f),onChange:e[157]||(e[157]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.data_vectorization_sentense_transformer_model]])])]),l("tr",null,[e[585]||(e[585]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_visualization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data visualization method:")],-1)),l("td",null,[D(l("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[158]||(e[158]=f=>r.configFile.data_visualization_method=f),onChange:e[159]||(e[159]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[584]||(e[584]=[l("option",{value:"PCA"},"PCA",-1),l("option",{value:"TSNE"},"TSNE",-1)]),544),[[It,r.configFile.data_visualization_method]])])]),l("tr",null,[e[586]||(e[586]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Save the new files to the database (The database wil always grow and continue to be the same over many sessions):")],-1)),l("td",null,[l("div",wot,[D(l("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[160]||(e[160]=f=>r.configFile.data_vectorization_save_db=f),onChange:e[161]||(e[161]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.data_vectorization_save_db]])])])]),l("tr",null,[e[587]||(e[587]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization chunk size(tokens):")],-1)),l("td",null,[D(l("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[162]||(e[162]=f=>r.configFile.data_vectorization_chunk_size=f),onChange:e[163]||(e[163]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.data_vectorization_chunk_size]]),D(l("input",{"onUpdate:modelValue":e[164]||(e[164]=f=>r.configFile.data_vectorization_chunk_size=f),type:"number",onChange:e[165]||(e[165]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.data_vectorization_chunk_size]])])]),l("tr",null,[e[588]||(e[588]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization overlap size(tokens):")],-1)),l("td",null,[D(l("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[166]||(e[166]=f=>r.configFile.data_vectorization_overlap_size=f),onChange:e[167]||(e[167]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.data_vectorization_overlap_size]]),D(l("input",{"onUpdate:modelValue":e[168]||(e[168]=f=>r.configFile.data_vectorization_overlap_size=f),type:"number",onChange:e[169]||(e[169]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.data_vectorization_overlap_size]])])]),l("tr",null,[e[589]||(e[589]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Number of chunks to use for each message:")],-1)),l("td",null,[D(l("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[170]||(e[170]=f=>r.configFile.data_vectorization_nb_chunks=f),onChange:e[171]||(e[171]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"1000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.data_vectorization_nb_chunks]]),D(l("input",{"onUpdate:modelValue":e[172]||(e[172]=f=>r.configFile.data_vectorization_nb_chunks=f),type:"number",onChange:e[173]||(e[173]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1})],2)]),l("div",Rot,[l("div",Aot,[l("button",{onClick:e[174]||(e[174]=K(f=>i.internet_conf_collapsed=!i.internet_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[590]||(e[590]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.internet_conf_collapsed]]),D(l("div",null,e[591]||(e[591]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.internet_conf_collapsed]]),e[592]||(e[592]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Internet",-1))])]),l("div",{class:Ue([{hidden:i.internet_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[z(a,{title:"Internet search",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Not,[l("tr",null,[e[593]||(e[593]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_internet_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate internet search:")],-1)),l("td",null,[l("div",Mot,[D(l("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[175]||(e[175]=f=>r.configFile.activate_internet_search=f),onChange:e[176]||(e[176]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_internet_search]])])])]),l("tr",null,[e[594]||(e[594]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_internet_pages_judgement",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate internet pages judgement:")],-1)),l("td",null,[l("div",Oot,[D(l("input",{type:"checkbox",id:"activate_internet_pages_judgement",required:"","onUpdate:modelValue":e[177]||(e[177]=f=>r.configFile.activate_internet_pages_judgement=f),onChange:e[178]||(e[178]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_internet_pages_judgement]])])])]),l("tr",null,[e[595]||(e[595]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_quick_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate quick search:")],-1)),l("td",null,[l("div",Iot,[D(l("input",{type:"checkbox",id:"internet_quick_search",required:"","onUpdate:modelValue":e[179]||(e[179]=f=>r.configFile.internet_quick_search=f),onChange:e[180]||(e[180]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.internet_quick_search]])])])]),l("tr",null,[e[596]||(e[596]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_activate_search_decision",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate search decision:")],-1)),l("td",null,[l("div",kot,[D(l("input",{type:"checkbox",id:"internet_activate_search_decision",required:"","onUpdate:modelValue":e[181]||(e[181]=f=>r.configFile.internet_activate_search_decision=f),onChange:e[182]||(e[182]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.internet_activate_search_decision]])])])]),l("tr",null,[e[597]||(e[597]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization chunk size:")],-1)),l("td",null,[l("div",Dot,[D(l("input",{id:"internet_vectorization_chunk_size","onUpdate:modelValue":e[183]||(e[183]=f=>r.configFile.internet_vectorization_chunk_size=f),onChange:e[184]||(e[184]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.internet_vectorization_chunk_size]]),D(l("input",{"onUpdate:modelValue":e[185]||(e[185]=f=>r.configFile.internet_vectorization_chunk_size=f),type:"number",onChange:e[186]||(e[186]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.internet_vectorization_chunk_size]])])])]),l("tr",null,[e[598]||(e[598]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization overlap size:")],-1)),l("td",null,[l("div",Lot,[D(l("input",{id:"internet_vectorization_overlap_size","onUpdate:modelValue":e[187]||(e[187]=f=>r.configFile.internet_vectorization_overlap_size=f),onChange:e[188]||(e[188]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"1000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.internet_vectorization_overlap_size]]),D(l("input",{"onUpdate:modelValue":e[189]||(e[189]=f=>r.configFile.internet_vectorization_overlap_size=f),type:"number",onChange:e[190]||(e[190]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.internet_vectorization_overlap_size]])])])]),l("tr",null,[e[599]||(e[599]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_vectorization_nb_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization number of chunks:")],-1)),l("td",null,[l("div",Pot,[D(l("input",{id:"internet_vectorization_nb_chunks","onUpdate:modelValue":e[191]||(e[191]=f=>r.configFile.internet_vectorization_nb_chunks=f),onChange:e[192]||(e[192]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.internet_vectorization_nb_chunks]]),D(l("input",{"onUpdate:modelValue":e[193]||(e[193]=f=>r.configFile.internet_vectorization_nb_chunks=f),type:"number",onChange:e[194]||(e[194]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.internet_vectorization_nb_chunks]])])])]),l("tr",null,[e[600]||(e[600]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"internet_nb_search_pages",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet number of search pages:")],-1)),l("td",null,[l("div",Fot,[D(l("input",{id:"internet_nb_search_pages","onUpdate:modelValue":e[195]||(e[195]=f=>r.configFile.internet_nb_search_pages=f),onChange:e[196]||(e[196]=f=>i.settingsChanged=!0),type:"range",min:"1",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.internet_nb_search_pages]]),D(l("input",{"onUpdate:modelValue":e[197]||(e[197]=f=>r.configFile.internet_nb_search_pages=f),type:"number",onChange:e[198]||(e[198]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.internet_nb_search_pages]])])])])])]),_:1})],2)]),l("div",Uot,[l("div",Bot,[l("button",{onClick:e[199]||(e[199]=K(f=>i.servers_conf_collapsed=!i.servers_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[601]||(e[601]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.servers_conf_collapsed]]),D(l("div",null,e[602]||(e[602]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.servers_conf_collapsed]]),e[603]||(e[603]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Services Zoo",-1))])]),l("div",{class:Ue([{hidden:i.servers_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[z(a,{title:"Default services selection",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Got,[l("tr",null,[e[605]||(e[605]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"active_tts_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to speach engine"},"Active TTS Service:")],-1)),l("td",Vot,[D(l("select",{id:"active_tts_service",required:"","onUpdate:modelValue":e[200]||(e[200]=f=>r.configFile.active_tts_service=f),onChange:e[201]||(e[201]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[604]||(e[604]=[l("option",{value:"None"},"None",-1),l("option",{value:"browser"},"Use Browser TTS (doesn't work in realtime mode)",-1),l("option",{value:"xtts"},"XTTS",-1),l("option",{value:"parler-tts"},"Parler-TTS",-1),l("option",{value:"openai_tts"},"Open AI TTS",-1),l("option",{value:"eleven_labs_tts"},"ElevenLabs TTS",-1),l("option",{value:"fish_tts"},"Fish TTS",-1)]),544),[[It,r.configFile.active_tts_service]])])]),l("tr",null,[e[607]||(e[607]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"active_stt_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Speach to Text engine"},"Active STT Service:")],-1)),l("td",zot,[D(l("select",{id:"active_stt_service",required:"","onUpdate:modelValue":e[202]||(e[202]=f=>r.configFile.active_stt_service=f),onChange:e[203]||(e[203]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[606]||(e[606]=[l("option",{value:"None"},"None",-1),l("option",{value:"whisper"},"Whisper",-1),l("option",{value:"openai_whisper"},"Open AI Whisper",-1)]),544),[[It,r.configFile.active_stt_service]])])]),e[614]||(e[614]=l("tr",null,null,-1)),l("tr",null,[e[609]||(e[609]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"active_tti_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to image engine"},"Active TTI Service:")],-1)),l("td",Hot,[D(l("select",{id:"active_tti_service",required:"","onUpdate:modelValue":e[204]||(e[204]=f=>r.configFile.active_tti_service=f),onChange:e[205]||(e[205]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[608]||(e[608]=[l("option",{value:"None"},"None",-1),l("option",{value:"diffusers"},"Diffusers",-1),l("option",{value:"diffusers_client"},"Diffusers Client",-1),l("option",{value:"autosd"},"AUTO1111's SD",-1),l("option",{value:"dall-e"},"Open AI DALL-E",-1),l("option",{value:"midjourney"},"Midjourney",-1),l("option",{value:"comfyui"},"Comfyui",-1),l("option",{value:"fooocus"},"Fooocus",-1)]),544),[[It,r.configFile.active_tti_service]])])]),l("tr",null,[e[611]||(e[611]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"active_ttm_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to Music engine"},"Active TTM Service:")],-1)),l("td",qot,[D(l("select",{id:"active_ttm_service",required:"","onUpdate:modelValue":e[206]||(e[206]=f=>r.configFile.active_ttm_service=f),onChange:e[207]||(e[207]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[610]||(e[610]=[l("option",{value:"None"},"None",-1),l("option",{value:"musicgen"},"Music Gen",-1)]),544),[[It,r.configFile.active_ttm_service]])])]),l("tr",null,[e[613]||(e[613]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"active_ttv_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to speach engine"},"Active TTV Service:")],-1)),l("td",Yot,[D(l("select",{id:"active_ttv_service",required:"","onUpdate:modelValue":e[208]||(e[208]=f=>r.configFile.active_ttv_service=f),onChange:e[209]||(e[209]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},e[612]||(e[612]=[l("option",{value:"None"},"None",-1),l("option",{value:"cog_video_x"},"Cog Video X",-1),l("option",{value:"diffusers"},"Diffusers",-1),l("option",{value:"lumalab"},"Lumalab",-1)]),544),[[It,r.configFile.active_ttv_service]])])])])]),_:1}),z(a,{title:"TTI settings",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",$ot,[l("tr",null,[e[615]||(e[615]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use negative prompt:")],-1)),l("td",null,[l("div",Wot,[D(l("input",{type:"checkbox",id:"use_negative_prompt",required:"","onUpdate:modelValue":e[210]||(e[210]=f=>r.configFile.use_negative_prompt=f),onChange:e[211]||(e[211]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.use_negative_prompt]])])])]),l("tr",null,[e[616]||(e[616]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"use_ai_generated_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use AI generated negative prompt:")],-1)),l("td",null,[l("div",Kot,[D(l("input",{type:"checkbox",id:"use_ai_generated_negative_prompt",required:"","onUpdate:modelValue":e[212]||(e[212]=f=>r.configFile.use_ai_generated_negative_prompt=f),onChange:e[213]||(e[213]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.use_ai_generated_negative_prompt]])])])]),l("tr",null,[e[617]||(e[617]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"negative_prompt_generation_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative prompt generation prompt:")],-1)),l("td",null,[l("div",jot,[D(l("input",{type:"text",id:"negative_prompt_generation_prompt",required:"","onUpdate:modelValue":e[214]||(e[214]=f=>r.configFile.negative_prompt_generation_prompt=f),onChange:e[215]||(e[215]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.negative_prompt_generation_prompt]])])])]),l("tr",null,[e[618]||(e[618]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"default_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Default negative prompt:")],-1)),l("td",null,[l("div",Qot,[D(l("input",{type:"text",id:"default_negative_prompt",required:"","onUpdate:modelValue":e[216]||(e[216]=f=>r.configFile.default_negative_prompt=f),onChange:e[217]||(e[217]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.default_negative_prompt]])])])])])]),_:1}),z(a,{title:"Full Audio settings",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Xot,[l("tr",null,[e[619]||(e[619]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_listening_threshold",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Listening threshold"},"Listening threshold:")],-1)),l("td",Zot,[D(l("input",{type:"number",step:"1",id:"stt_listening_threshold",required:"","onUpdate:modelValue":e[218]||(e[218]=f=>r.configFile.stt_listening_threshold=f),onChange:e[219]||(e[219]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_listening_threshold]])])]),l("tr",null,[e[620]||(e[620]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_silence_duration",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Scilence duration"},"Silence duration (s):")],-1)),l("td",Jot,[D(l("input",{type:"number",step:"1",id:"stt_silence_duration",required:"","onUpdate:modelValue":e[220]||(e[220]=f=>r.configFile.stt_silence_duration=f),onChange:e[221]||(e[221]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_silence_duration]])])]),l("tr",null,[e[621]||(e[621]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_sound_threshold_percentage",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"stt_sound_threshold_percentage"},"Minimum sound percentage in recorded segment:")],-1)),l("td",eat,[D(l("input",{type:"number",step:"1",id:"stt_sound_threshold_percentage",required:"","onUpdate:modelValue":e[222]||(e[222]=f=>r.configFile.stt_sound_threshold_percentage=f),onChange:e[223]||(e[223]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_sound_threshold_percentage]])])]),l("tr",null,[e[622]||(e[622]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_gain",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"STT Gain"},"Volume amplification:")],-1)),l("td",tat,[D(l("input",{type:"number",step:"1",id:"stt_gain",required:"","onUpdate:modelValue":e[224]||(e[224]=f=>r.configFile.stt_gain=f),onChange:e[225]||(e[225]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_gain]])])]),l("tr",null,[e[623]||(e[623]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_rate",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Audio Rate"},"audio rate:")],-1)),l("td",nat,[D(l("input",{type:"number",step:"1",id:"stt_rate",required:"","onUpdate:modelValue":e[226]||(e[226]=f=>r.configFile.stt_rate=f),onChange:e[227]||(e[227]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_rate]])])]),l("tr",null,[e[624]||(e[624]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_channels",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"number of channels"},"number of channels:")],-1)),l("td",sat,[D(l("input",{type:"number",step:"1",id:"stt_channels",required:"","onUpdate:modelValue":e[228]||(e[228]=f=>r.configFile.stt_channels=f),onChange:e[229]||(e[229]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_channels]])])]),l("tr",null,[e[625]||(e[625]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_buffer_size",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Buffer size"},"Buffer size:")],-1)),l("td",iat,[D(l("input",{type:"number",step:"1",id:"stt_buffer_size",required:"","onUpdate:modelValue":e[230]||(e[230]=f=>r.configFile.stt_buffer_size=f),onChange:e[231]||(e[231]=f=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_buffer_size]])])]),l("tr",null,[e[626]||(e[626]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_activate_word_detection",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate word detection:")],-1)),l("td",null,[l("div",rat,[D(l("input",{type:"checkbox",id:"stt_activate_word_detection",required:"","onUpdate:modelValue":e[232]||(e[232]=f=>r.configFile.stt_activate_word_detection=f),onChange:e[233]||(e[233]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.stt_activate_word_detection]])])])]),l("tr",null,[e[627]||(e[627]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_word_detection_file",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Word detection wav file:")],-1)),l("td",null,[l("div",oat,[D(l("input",{type:"text",id:"stt_word_detection_file",required:"","onUpdate:modelValue":e[234]||(e[234]=f=>r.configFile.stt_word_detection_file=f),onChange:e[235]||(e[235]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.stt_word_detection_file]])])])])])]),_:1}),z(a,{title:"Audio devices settings",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",aat,[l("tr",null,[e[628]||(e[628]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"stt_input_device",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Input device"},"Audio Input device:")],-1)),l("td",lat,[D(l("select",{id:"stt_input_device",required:"","onUpdate:modelValue":e[236]||(e[236]=f=>r.configFile.stt_input_device=f),onChange:e[237]||(e[237]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(i.snd_input_devices,(f,g)=>(T(),w("option",{key:f,value:i.snd_input_devices_indexes[g]},W(f),9,cat))),128))],544),[[It,r.configFile.stt_input_device]])])]),l("tr",null,[e[629]||(e[629]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"tts_output_device",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Input device"},"Audio Output device:")],-1)),l("td",dat,[D(l("select",{id:"tts_output_device",required:"","onUpdate:modelValue":e[238]||(e[238]=f=>r.configFile.tts_output_device=f),onChange:e[239]||(e[239]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(i.snd_output_devices,(f,g)=>(T(),w("option",{key:f,value:i.snd_output_devices_indexes[g]},W(f),9,uat))),128))],544),[[It,r.configFile.tts_output_device]])])])])]),_:1}),z(a,{title:"Lollms service",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",pat,[l("tr",null,[e[630]||(e[630]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"host",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),l("td",fat,[D(l("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[240]||(e[240]=f=>r.configFile.host=f),onChange:e[241]||(e[241]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.host]])])]),l("tr",null,[e[631]||(e[631]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"lollms_access_keys",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Access keys:")],-1)),l("td",_at,[z(o,{modelValue:r.configFile.lollms_access_keys,"onUpdate:modelValue":e[242]||(e[242]=f=>r.configFile.lollms_access_keys=f),onChange:e[243]||(e[243]=f=>i.settingsChanged=!0),placeholder:"Enter access key"},null,8,["modelValue"])])]),l("tr",null,[e[632]||(e[632]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"port",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),l("td",mat,[D(l("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[244]||(e[244]=f=>r.configFile.port=f),onChange:e[245]||(e[245]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.port]])])]),l("tr",null,[e[633]||(e[633]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"headless_server_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate headless server mode:")],-1)),l("td",hat,[D(l("input",{type:"checkbox",id:"headless_server_mode",required:"","onUpdate:modelValue":e[246]||(e[246]=f=>r.configFile.headless_server_mode=f),onChange:e[247]||(e[247]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.headless_server_mode]])])]),l("tr",null,[e[634]||(e[634]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms server:")],-1)),l("td",gat,[D(l("input",{type:"checkbox",id:"activate_lollms_server",required:"","onUpdate:modelValue":e[248]||(e[248]=f=>r.configFile.activate_lollms_server=f),onChange:e[249]||(e[249]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_lollms_server]])])]),l("tr",null,[e[635]||(e[635]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_rag_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms RAG server:")],-1)),l("td",bat,[D(l("input",{type:"checkbox",id:"activate_lollms_rag_server",required:"","onUpdate:modelValue":e[250]||(e[250]=f=>r.configFile.activate_lollms_rag_server=f),onChange:e[251]||(e[251]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_lollms_rag_server]])])]),l("tr",null,[e[636]||(e[636]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_tts_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms TTS server:")],-1)),l("td",yat,[D(l("input",{type:"checkbox",id:"activate_lollms_tts_server",required:"","onUpdate:modelValue":e[252]||(e[252]=f=>r.configFile.activate_lollms_tts_server=f),onChange:e[253]||(e[253]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_lollms_tts_server]])])]),l("tr",null,[e[637]||(e[637]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_stt_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms STT server:")],-1)),l("td",Eat,[D(l("input",{type:"checkbox",id:"activate_lollms_stt_server",required:"","onUpdate:modelValue":e[254]||(e[254]=f=>r.configFile.activate_lollms_stt_server=f),onChange:e[255]||(e[255]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_lollms_stt_server]])])]),l("tr",null,[e[638]||(e[638]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_tti_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms TTI server:")],-1)),l("td",vat,[D(l("input",{type:"checkbox",id:"activate_lollms_tti_server",required:"","onUpdate:modelValue":e[256]||(e[256]=f=>r.configFile.activate_lollms_tti_server=f),onChange:e[257]||(e[257]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_lollms_tti_server]])])]),l("tr",null,[e[639]||(e[639]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_itt_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms ITT server:")],-1)),l("td",Sat,[D(l("input",{type:"checkbox",id:"activate_lollms_itt_server",required:"","onUpdate:modelValue":e[258]||(e[258]=f=>r.configFile.activate_lollms_itt_server=f),onChange:e[259]||(e[259]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_lollms_itt_server]])])]),l("tr",null,[e[640]||(e[640]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_lollms_ttm_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms TTM server:")],-1)),l("td",Tat,[D(l("input",{type:"checkbox",id:"activate_lollms_ttm_server",required:"","onUpdate:modelValue":e[260]||(e[260]=f=>r.configFile.activate_lollms_ttm_server=f),onChange:e[261]||(e[261]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_lollms_ttm_server]])])]),l("tr",null,[e[641]||(e[641]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_ollama_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate ollama server emulator:")],-1)),l("td",xat,[D(l("input",{type:"checkbox",id:"activate_ollama_emulator",required:"","onUpdate:modelValue":e[262]||(e[262]=f=>r.configFile.activate_ollama_emulator=f),onChange:e[263]||(e[263]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_ollama_emulator]])])]),l("tr",null,[e[642]||(e[642]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_openai_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate openai server emulator:")],-1)),l("td",Cat,[D(l("input",{type:"checkbox",id:"activate_openai_emulator",required:"","onUpdate:modelValue":e[264]||(e[264]=f=>r.configFile.activate_openai_emulator=f),onChange:e[265]||(e[265]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_openai_emulator]])])]),l("tr",null,[e[643]||(e[643]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_mistralai_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate mistral ai server emulator:")],-1)),l("td",wat,[D(l("input",{type:"checkbox",id:"activate_mistralai_emulator",required:"","onUpdate:modelValue":e[266]||(e[266]=f=>r.configFile.activate_mistralai_emulator=f),onChange:e[267]||(e[267]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_mistralai_emulator]])])])])]),_:1}),z(a,{title:"STT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[z(a,{title:"Browser Audio STT",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Rat,[l("tr",null,[e[644]||(e[644]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"activate_audio_infos",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate audio infos:")],-1)),l("td",null,[l("div",Aat,[D(l("input",{type:"checkbox",id:"activate_audio_infos",required:"","onUpdate:modelValue":e[268]||(e[268]=f=>r.configFile.activate_audio_infos=f),onChange:e[269]||(e[269]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.activate_audio_infos]])])])]),l("tr",null,[e[645]||(e[645]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"audio_auto_send_input",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Send audio input automatically:")],-1)),l("td",null,[l("div",Nat,[D(l("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[270]||(e[270]=f=>r.configFile.audio_auto_send_input=f),onChange:e[271]||(e[271]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.audio_auto_send_input]])])])]),l("tr",null,[e[646]||(e[646]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"audio_silenceTimer",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio in silence timer (ms):")],-1)),l("td",null,[D(l("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[272]||(e[272]=f=>r.configFile.audio_silenceTimer=f),onChange:e[273]||(e[273]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"10000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.audio_silenceTimer]]),D(l("input",{"onUpdate:modelValue":e[274]||(e[274]=f=>r.configFile.audio_silenceTimer=f),onChange:e[275]||(e[275]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.audio_silenceTimer]])])]),l("tr",null,[e[647]||(e[647]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),l("td",null,[D(l("select",{id:"audio_in_language","onUpdate:modelValue":e[276]||(e[276]=f=>r.configFile.audio_in_language=f),onChange:e[277]||(e[277]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(r.audioLanguages,f=>(T(),w("option",{key:f.code,value:f.code},W(f.name),9,Mat))),128))],544),[[It,r.configFile.audio_in_language]])])])])]),_:1}),z(a,{title:"Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Oat,[l("tr",null,[e[648]||(e[648]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"whisper_activate",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Whisper at startup:")],-1)),l("td",null,[l("div",Iat,[D(l("input",{type:"checkbox",id:"whisper_activate",required:"","onUpdate:modelValue":e[278]||(e[278]=f=>r.configFile.whisper_activate=f),onChange:e[279]||(e[279]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.whisper_activate]])])])]),l("tr",null,[e[649]||(e[649]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}})],-1)),l("td",null,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[280]||(e[280]=(...f)=>r.reinstallWhisperService&&r.reinstallWhisperService(...f))},"install whisper")])]),l("tr",null,[e[650]||(e[650]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Whisper model:")],-1)),l("td",null,[l("div",kat,[D(l("select",{id:"whisper_model","onUpdate:modelValue":e[281]||(e[281]=f=>r.configFile.whisper_model=f),onChange:e[282]||(e[282]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(r.whisperModels,f=>(T(),w("option",{key:f,value:f},W(f),9,Dat))),128))],544),[[It,r.configFile.whisper_model]])])])])])]),_:1}),z(a,{title:"Open AI Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Lat,[l("tr",null,[e[651]||(e[651]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"openai_whisper_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai whisper key:")],-1)),l("td",null,[l("div",Pat,[D(l("input",{type:"text",id:"openai_whisper_key",required:"","onUpdate:modelValue":e[283]||(e[283]=f=>r.configFile.openai_whisper_key=f),onChange:e[284]||(e[284]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.openai_whisper_key]])])])]),l("tr",null,[e[652]||(e[652]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"openai_whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Open Ai Whisper model:")],-1)),l("td",null,[l("div",Fat,[D(l("select",{id:"openai_whisper_model","onUpdate:modelValue":e[285]||(e[285]=f=>r.configFile.openai_whisper_model=f),onChange:e[286]||(e[286]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(r.openaiWhisperModels,f=>(T(),w("option",{key:f,value:f},W(f),9,Uat))),128))],544),[[It,r.configFile.openai_whisper_model]])])])])])]),_:1})]),_:1}),z(a,{title:"TTS services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[z(a,{title:"Browser Audio TTS",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Bat,[l("tr",null,[e[653]||(e[653]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),l("td",null,[l("div",Gat,[D(l("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[287]||(e[287]=f=>r.configFile.auto_speak=f),onChange:e[288]||(e[288]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.auto_speak]])])])]),l("tr",null,[e[654]||(e[654]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),l("td",null,[D(l("input",{id:"audio_pitch","onUpdate:modelValue":e[289]||(e[289]=f=>r.configFile.audio_pitch=f),onChange:e[290]||(e[290]=f=>i.settingsChanged=!0),type:"range",min:"0",max:"10",step:"0.1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.audio_pitch]]),D(l("input",{"onUpdate:modelValue":e[291]||(e[291]=f=>r.configFile.audio_pitch=f),onChange:e[292]||(e[292]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.audio_pitch]])])]),l("tr",null,[e[655]||(e[655]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),l("td",null,[D(l("select",{id:"audio_out_voice","onUpdate:modelValue":e[293]||(e[293]=f=>r.configFile.audio_out_voice=f),onChange:e[294]||(e[294]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(i.audioVoices,f=>(T(),w("option",{key:f.name,value:f.name},W(f.name),9,Vat))),128))],544),[[It,r.configFile.audio_out_voice]])])])])]),_:1}),z(a,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",zat,[l("tr",null,[e[656]||(e[656]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),l("td",null,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[295]||(e[295]=(...f)=>r.reinstallXTTSService&&r.reinstallXTTSService(...f))},"install xtts service")])]),l("tr",null,[e[657]||(e[657]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),l("td",null,[l("div",Hat,[D(l("select",{"onUpdate:modelValue":e[296]||(e[296]=f=>r.xtts_current_language=f),onChange:e[297]||(e[297]=f=>i.settingsChanged=!0)},[(T(!0),w(Be,null,Xe(i.voice_languages,(f,g)=>(T(),w("option",{key:g,value:f},W(g),9,qat))),128))],544),[[It,r.xtts_current_language]])])])]),l("tr",null,[e[658]||(e[658]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_current_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current voice:")],-1)),l("td",null,[l("div",Yat,[D(l("select",{"onUpdate:modelValue":e[298]||(e[298]=f=>r.xtts_current_voice=f),onChange:e[299]||(e[299]=f=>i.settingsChanged=!0)},[(T(!0),w(Be,null,Xe(i.voices,f=>(T(),w("option",{key:f,value:f},W(f),9,$at))),128))],544),[[It,r.xtts_current_voice]])])])]),l("tr",null,[e[659]||(e[659]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_freq",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Frequency (controls the tone):")],-1)),l("td",null,[l("div",Wat,[D(l("input",{type:"number",id:"xtts_freq",required:"","onUpdate:modelValue":e[300]||(e[300]=f=>r.configFile.xtts_freq=f),onChange:e[301]||(e[301]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.01"},null,544),[[ue,r.configFile.xtts_freq,void 0,{number:!0}]])])])]),l("tr",null,[e[660]||(e[660]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"auto_read",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto read:")],-1)),l("td",null,[l("div",Kat,[D(l("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[302]||(e[302]=f=>r.configFile.auto_read=f),onChange:e[303]||(e[303]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.auto_read]])])])]),l("tr",null,[e[661]||(e[661]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_stream_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xtts stream chunk size:")],-1)),l("td",null,[l("div",jat,[D(l("input",{type:"text",id:"xtts_stream_chunk_size",required:"","onUpdate:modelValue":e[304]||(e[304]=f=>r.configFile.xtts_stream_chunk_size=f),onChange:e[305]||(e[305]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.xtts_stream_chunk_size]])])])]),l("tr",null,[e[662]||(e[662]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_temperature",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Temperature:")],-1)),l("td",null,[l("div",Qat,[D(l("input",{type:"number",id:"xtts_temperature",required:"","onUpdate:modelValue":e[306]||(e[306]=f=>r.configFile.xtts_temperature=f),onChange:e[307]||(e[307]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.01"},null,544),[[ue,r.configFile.xtts_temperature,void 0,{number:!0}]])])])]),l("tr",null,[e[663]||(e[663]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_length_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Length Penalty:")],-1)),l("td",null,[l("div",Xat,[D(l("input",{type:"number",id:"xtts_length_penalty",required:"","onUpdate:modelValue":e[308]||(e[308]=f=>r.configFile.xtts_length_penalty=f),onChange:e[309]||(e[309]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[ue,r.configFile.xtts_length_penalty,void 0,{number:!0}]])])])]),l("tr",null,[e[664]||(e[664]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_repetition_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Repetition Penalty:")],-1)),l("td",null,[l("div",Zat,[D(l("input",{type:"number",id:"xtts_repetition_penalty",required:"","onUpdate:modelValue":e[310]||(e[310]=f=>r.configFile.xtts_repetition_penalty=f),onChange:e[311]||(e[311]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[ue,r.configFile.xtts_repetition_penalty,void 0,{number:!0}]])])])]),l("tr",null,[e[665]||(e[665]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_top_k",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top K:")],-1)),l("td",null,[l("div",Jat,[D(l("input",{type:"number",id:"xtts_top_k",required:"","onUpdate:modelValue":e[312]||(e[312]=f=>r.configFile.xtts_top_k=f),onChange:e[313]||(e[313]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.xtts_top_k,void 0,{number:!0}]])])])]),l("tr",null,[e[666]||(e[666]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_top_p",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top P:")],-1)),l("td",null,[l("div",elt,[D(l("input",{type:"number",id:"xtts_top_p",required:"","onUpdate:modelValue":e[314]||(e[314]=f=>r.configFile.xtts_top_p=f),onChange:e[315]||(e[315]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.xtts_top_p,void 0,{number:!0}]])])])]),l("tr",null,[e[667]||(e[667]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"xtts_speed",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Speed:")],-1)),l("td",null,[l("div",tlt,[D(l("input",{type:"number",id:"xtts_speed",required:"","onUpdate:modelValue":e[316]||(e[316]=f=>r.configFile.xtts_speed=f),onChange:e[317]||(e[317]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[ue,r.configFile.xtts_speed,void 0,{number:!0}]])])])]),l("tr",null,[e[668]||(e[668]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_text_splitting",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable Text Splitting:")],-1)),l("td",null,[l("div",nlt,[D(l("input",{type:"checkbox",id:"enable_text_splitting","onUpdate:modelValue":e[318]||(e[318]=f=>r.configFile.enable_text_splitting=f),onChange:e[319]||(e[319]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.enable_text_splitting]])])])])])]),_:1}),z(a,{title:"Open AI TTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",slt,[l("tr",null,[e[669]||(e[669]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"openai_tts_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Open AI key:")],-1)),l("td",null,[l("div",ilt,[D(l("input",{type:"text",id:"openai_tts_key",required:"","onUpdate:modelValue":e[320]||(e[320]=f=>r.configFile.openai_tts_key=f),onChange:e[321]||(e[321]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.openai_tts_key]])])])]),l("tr",null,[e[671]||(e[671]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"openai_tts_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai tts model:")],-1)),l("td",null,[l("div",rlt,[D(l("select",{"onUpdate:modelValue":e[322]||(e[322]=f=>r.configFile.openai_tts_model=f),onChange:e[323]||(e[323]=f=>i.settingsChanged=!0)},e[670]||(e[670]=[l("option",null," tts-1 ",-1),l("option",null," tts-2 ",-1)]),544),[[It,r.configFile.openai_tts_model]])])])]),l("tr",null,[e[673]||(e[673]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"openai_tts_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai tts voice:")],-1)),l("td",null,[l("div",olt,[D(l("select",{"onUpdate:modelValue":e[324]||(e[324]=f=>r.configFile.openai_tts_voice=f),onChange:e[325]||(e[325]=f=>i.settingsChanged=!0)},e[672]||(e[672]=[l("option",null," alloy ",-1),l("option",null," echo ",-1),l("option",null," fable ",-1),l("option",null," nova ",-1),l("option",null," shimmer ",-1)]),544),[[It,r.configFile.openai_tts_voice]])])])])])]),_:1}),z(a,{title:"Eleven Labs TTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",alt,[l("tr",null,[e[674]||(e[674]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elevenlabs_tts_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Eleven Labs key:")],-1)),l("td",null,[l("div",llt,[D(l("input",{type:"text",id:"elevenlabs_tts_key",required:"","onUpdate:modelValue":e[326]||(e[326]=f=>r.configFile.elevenlabs_tts_key=f),onChange:e[327]||(e[327]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.elevenlabs_tts_key]])])])]),l("tr",null,[e[675]||(e[675]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elevenlabs_tts_model_id",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Eleven Labs TTS model ID:")],-1)),l("td",null,[l("div",clt,[D(l("input",{type:"text",id:"elevenlabs_tts_model_id",required:"","onUpdate:modelValue":e[328]||(e[328]=f=>r.configFile.elevenlabs_tts_model_id=f),onChange:e[329]||(e[329]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.elevenlabs_tts_model_id]])])])]),l("tr",null,[e[676]||(e[676]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elevenlabs_tts_voice_stability",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Voice Stability:")],-1)),l("td",null,[l("div",dlt,[D(l("input",{type:"number",id:"elevenlabs_tts_voice_stability",required:"","onUpdate:modelValue":e[330]||(e[330]=f=>r.configFile.elevenlabs_tts_voice_stability=f),onChange:e[331]||(e[331]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1",min:"0",max:"1"},null,544),[[ue,r.configFile.elevenlabs_tts_voice_stability]])])])]),l("tr",null,[e[677]||(e[677]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elevenlabs_tts_voice_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Voice Boost:")],-1)),l("td",null,[l("div",ult,[D(l("input",{type:"number",id:"elevenlabs_tts_voice_boost",required:"","onUpdate:modelValue":e[332]||(e[332]=f=>r.configFile.elevenlabs_tts_voice_boost=f),onChange:e[333]||(e[333]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1",min:"0",max:"1"},null,544),[[ue,r.configFile.elevenlabs_tts_voice_boost]])])])]),l("tr",null,[e[678]||(e[678]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elevenlabs_tts_voice_id",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Voice ID:")],-1)),l("td",null,[l("div",plt,[D(l("select",{"onUpdate:modelValue":e[334]||(e[334]=f=>r.configFile.elevenlabs_tts_voice_id=f),onChange:e[335]||(e[335]=f=>i.settingsChanged=!0)},[(T(!0),w(Be,null,Xe(i.voices,f=>(T(),w("option",{key:f.voice_id,value:f.voice_id},W(f.name),9,flt))),128))],544),[[It,r.configFile.elevenlabs_tts_voice_id]])])])])])]),_:1}),z(a,{title:"Fish TTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",_lt,[l("tr",null,[e[679]||(e[679]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"fish_tts_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fish TTS key:")],-1)),l("td",null,[l("div",mlt,[D(l("input",{type:"text",id:"fish_tts_key",required:"","onUpdate:modelValue":e[336]||(e[336]=f=>r.configFile.fish_tts_key=f),onChange:e[337]||(e[337]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.fish_tts_key]])])])]),l("tr",null,[e[680]||(e[680]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"fish_tts_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fish TTS voice:")],-1)),l("td",null,[l("div",hlt,[D(l("input",{type:"text",id:"fish_tts_voice",required:"","onUpdate:modelValue":e[338]||(e[338]=f=>r.configFile.fish_tts_voice=f),onChange:e[339]||(e[339]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.fish_tts_voice]])])])])])]),_:1})]),_:1}),z(a,{title:"TTI services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[z(a,{title:"Stable diffusion service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",glt,[l("tr",null,[e[682]||(e[682]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable sd service:")],-1)),l("td",null,[l("div",blt,[D(l("input",{type:"checkbox",id:"enable_sd_service",required:"","onUpdate:modelValue":e[340]||(e[340]=f=>r.configFile.enable_sd_service=f),onChange:e[341]||(e[341]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.enable_sd_service]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[342]||(e[342]=f=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},e[681]||(e[681]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[684]||(e[684]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install SD service:")],-1)),l("td",null,[l("div",ylt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[343]||(e[343]=(...f)=>r.reinstallSDService&&r.reinstallSDService(...f))},"install sd service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[344]||(e[344]=(...f)=>r.upgradeSDService&&r.upgradeSDService(...f))},"upgrade sd service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[345]||(e[345]=(...f)=>r.startSDService&&r.startSDService(...f))},"start sd service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[346]||(e[346]=(...f)=>r.showSD&&r.showSD(...f))},"show sd ui"),e[683]||(e[683]=l("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/ParisNeo/stable-diffusion-webui/blob/master/LICENSE.txt",target:"_blank"},"automatic1111's sd licence",-1))])]),l("td",null,[l("div",Elt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[347]||(e[347]=(...f)=>r.reinstallSDService&&r.reinstallSDService(...f))},"install sd service")])])]),l("tr",null,[e[685]||(e[685]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),l("td",null,[l("div",vlt,[D(l("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[348]||(e[348]=f=>r.configFile.sd_base_url=f),onChange:e[349]||(e[349]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.sd_base_url]])])])])])]),_:1}),z(a,{title:"Diffusers service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Slt,[l("tr",null,[e[687]||(e[687]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"install_diffusers_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Diffusers service:")],-1)),l("td",null,[l("div",Tlt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[350]||(e[350]=(...f)=>r.reinstallDiffusersService&&r.reinstallDiffusersService(...f))},"install diffusers service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[351]||(e[351]=(...f)=>r.upgradeDiffusersService&&r.upgradeDiffusersService(...f))},"upgrade diffusers service"),e[686]||(e[686]=l("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/huggingface/diffusers?tab=Apache-2.0-1-ov-file#readme",target:"_blank"},"Diffusers licence",-1))])])]),l("tr",null,[e[688]||(e[688]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"diffusers_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Diffusers model:")],-1)),l("td",null,[l("div",xlt,[D(l("input",{type:"text",id:"diffusers_model",required:"","onUpdate:modelValue":e[352]||(e[352]=f=>r.configFile.diffusers_model=f),onChange:e[353]||(e[353]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.diffusers_model]])])]),e[689]||(e[689]=l("td",null,null,-1))])])]),_:1}),z(a,{title:"Diffusers client service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Clt,[l("tr",null,[e[690]||(e[690]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"diffusers_client_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Diffusers client base url:")],-1)),l("td",null,[l("div",wlt,[D(l("input",{type:"text",id:"diffusers_client_base_url",required:"","onUpdate:modelValue":e[354]||(e[354]=f=>r.configFile.diffusers_client_base_url=f),onChange:e[355]||(e[355]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.diffusers_client_base_url]])])]),e[691]||(e[691]=l("td",null,null,-1))])])]),_:1}),z(a,{title:"Midjourney",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Rlt,[l("tr",null,[e[692]||(e[692]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"midjourney_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"midjourney key:")],-1)),l("td",null,[l("div",Alt,[D(l("input",{type:"text",id:"midjourney_key",required:"","onUpdate:modelValue":e[356]||(e[356]=f=>r.configFile.midjourney_key=f),onChange:e[357]||(e[357]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.midjourney_key]])])])]),l("tr",null,[e[693]||(e[693]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"midjourney_timeout",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"request timeout(s):")],-1)),l("td",null,[l("div",Nlt,[D(l("input",{type:"number",min:"10",max:"2048",id:"midjourney_timeout",required:"","onUpdate:modelValue":e[358]||(e[358]=f=>r.configFile.midjourney_timeout=f),onChange:e[359]||(e[359]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.midjourney_timeout]])])])]),l("tr",null,[e[694]||(e[694]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"midjourney_retries",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"number of retries:")],-1)),l("td",null,[l("div",Mlt,[D(l("input",{type:"number",min:"0",max:"2048",id:"midjourney_retries",required:"","onUpdate:modelValue":e[360]||(e[360]=f=>r.configFile.midjourney_retries=f),onChange:e[361]||(e[361]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.midjourney_retries]])])])])])]),_:1}),z(a,{title:"Dall-E",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Olt,[l("tr",null,[e[695]||(e[695]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"dall_e_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"dall e key:")],-1)),l("td",null,[l("div",Ilt,[D(l("input",{type:"text",id:"dall_e_key",required:"","onUpdate:modelValue":e[362]||(e[362]=f=>r.configFile.dall_e_key=f),onChange:e[363]||(e[363]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.dall_e_key]])])])]),l("tr",null,[e[697]||(e[697]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"dall_e_generation_engine",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"dall e generation engine:")],-1)),l("td",null,[l("div",klt,[D(l("select",{"onUpdate:modelValue":e[364]||(e[364]=f=>r.configFile.dall_e_generation_engine=f),onChange:e[365]||(e[365]=f=>i.settingsChanged=!0)},e[696]||(e[696]=[l("option",null," dall-e-2 ",-1),l("option",null," dall-e-3 ",-1)]),544),[[It,r.configFile.dall_e_generation_engine]])])])])])]),_:1}),z(a,{title:"ComfyUI service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Dlt,[l("tr",null,[e[699]||(e[699]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_comfyui_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui service:")],-1)),l("td",null,[l("div",Llt,[D(l("input",{type:"checkbox",id:"enable_comfyui_service",required:"","onUpdate:modelValue":e[366]||(e[366]=f=>r.configFile.enable_comfyui_service=f),onChange:e[367]||(e[367]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.enable_comfyui_service]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[368]||(e[368]=f=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},e[698]||(e[698]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[700]||(e[700]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"comfyui_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Available models (only if local):")],-1)),l("td",null,[l("div",Plt,[D(l("select",{id:"comfyui_model",required:"","onUpdate:modelValue":e[369]||(e[369]=f=>r.configFile.comfyui_model=f),onChange:e[370]||(e[370]=f=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(T(!0),w(Be,null,Xe(i.comfyui_models,(f,g)=>(T(),w("option",{key:f,value:f},W(f),9,Flt))),128))],544),[[It,r.configFile.comfyui_model]])])])]),l("tr",null,[e[702]||(e[702]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"comfyui_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui model:")],-1)),l("td",null,[l("div",Ult,[D(l("input",{type:"text",id:"comfyui_model",required:"","onUpdate:modelValue":e[371]||(e[371]=f=>r.configFile.comfyui_model=f),onChange:e[372]||(e[372]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.comfyui_model]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[373]||(e[373]=f=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},e[701]||(e[701]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[704]||(e[704]=l("td",{style:{"min-width":"200px"}},null,-1)),l("td",null,[l("div",Blt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[374]||(e[374]=(...f)=>r.reinstallComfyUIService&&r.reinstallComfyUIService(...f))},"install comfyui service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[375]||(e[375]=(...f)=>r.upgradeComfyUIService&&r.upgradeComfyUIService(...f))},"upgrade comfyui service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[376]||(e[376]=(...f)=>r.startComfyUIService&&r.startComfyUIService(...f))},"start comfyui service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[377]||(e[377]=(...f)=>r.showComfyui&&r.showComfyui(...f))},"show comfyui"),e[703]||(e[703]=l("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/ParisNeo/ComfyUI/blob/master/LICENSE",target:"_blank"},"comfyui licence",-1))])])]),l("tr",null,[e[705]||(e[705]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"comfyui_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"comfyui base url:")],-1)),l("td",null,[l("div",Glt,[D(l("input",{type:"text",id:"comfyui_base_url",required:"","onUpdate:modelValue":e[378]||(e[378]=f=>r.configFile.comfyui_base_url=f),onChange:e[379]||(e[379]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.comfyui_base_url]])])])])])]),_:1})]),_:1}),z(a,{title:"TTT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[z(a,{title:"Ollama service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Vlt,[l("tr",null,[e[707]||(e[707]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_ollama_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable ollama service:")],-1)),l("td",null,[l("div",zlt,[D(l("input",{type:"checkbox",id:"enable_ollama_service",required:"","onUpdate:modelValue":e[380]||(e[380]=f=>r.configFile.enable_ollama_service=f),onChange:e[381]||(e[381]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.enable_ollama_service]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[382]||(e[382]=f=>this.$store.state.messageBox.showMessage(`Activates ollama service. The service will be automatically loaded at startup alowing you to use the ollama binding. If you are using windows, this uses wsl which requires you to have it installed or at least activated. If You are using windows, this will install wsl so you need to activate it. -Here is how you can do that`))},e[706]||(e[706]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[708]||(e[708]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Ollama service:")],-1)),l("td",null,[l("div",Hlt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[383]||(e[383]=(...f)=>r.reinstallOLLAMAService&&r.reinstallOLLAMAService(...f))},"install ollama service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[384]||(e[384]=(...f)=>r.startollamaService&&r.startollamaService(...f))},"start ollama service")])])]),l("tr",null,[e[709]||(e[709]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"ollama base url:")],-1)),l("td",null,[l("div",qlt,[D(l("input",{type:"text",id:"ollama_base_url",required:"","onUpdate:modelValue":e[385]||(e[385]=f=>r.configFile.ollama_base_url=f),onChange:e[386]||(e[386]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.ollama_base_url]])])])])])]),_:1}),z(a,{title:"vLLM service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Ylt,[l("tr",null,[e[711]||(e[711]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_vllm_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable vLLM service:")],-1)),l("td",null,[l("div",$lt,[D(l("input",{type:"checkbox",id:"enable_vllm_service",required:"","onUpdate:modelValue":e[387]||(e[387]=f=>r.configFile.enable_vllm_service=f),onChange:e[388]||(e[388]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.enable_vllm_service]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[389]||(e[389]=f=>this.$store.state.messageBox.showMessage(`Activates vllm service. The service will be automatically loaded at startup alowing you to use the elf binding. +Here is how you can do that`))},e[706]||(e[706]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[708]||(e[708]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Ollama service:")],-1)),l("td",null,[l("div",Hlt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[383]||(e[383]=(...f)=>r.reinstallOLLAMAService&&r.reinstallOLLAMAService(...f))},"install ollama service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[384]||(e[384]=(...f)=>r.startollamaService&&r.startollamaService(...f))},"start ollama service")])])]),l("tr",null,[e[709]||(e[709]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"ollama base url:")],-1)),l("td",null,[l("div",qlt,[D(l("input",{type:"text",id:"ollama_base_url",required:"","onUpdate:modelValue":e[385]||(e[385]=f=>r.configFile.ollama_base_url=f),onChange:e[386]||(e[386]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.ollama_base_url]])])])])])]),_:1}),z(a,{title:"vLLM service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",Ylt,[l("tr",null,[e[711]||(e[711]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_vllm_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable vLLM service:")],-1)),l("td",null,[l("div",$lt,[D(l("input",{type:"checkbox",id:"enable_vllm_service",required:"","onUpdate:modelValue":e[387]||(e[387]=f=>r.configFile.enable_vllm_service=f),onChange:e[388]||(e[388]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.enable_vllm_service]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[389]||(e[389]=f=>this.$store.state.messageBox.showMessage(`Activates vllm service. The service will be automatically loaded at startup alowing you to use the elf binding. If you are using windows, this uses wsl which requires you to have it installed or at least activated. If You are using windows, this will install wsl so you need to activate it. -Here is how you can do that`))},e[710]||(e[710]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[712]||(e[712]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install vLLM service:")],-1)),l("td",null,[l("div",Wlt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[390]||(e[390]=(...f)=>r.reinstallvLLMService&&r.reinstallvLLMService(...f))},"install vLLM service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[391]||(e[391]=(...f)=>r.startvLLMService&&r.startvLLMService(...f))},"start vllm service")])])]),l("tr",null,[e[713]||(e[713]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm base url:")],-1)),l("td",null,[l("div",Klt,[D(l("input",{type:"text",id:"vllm_url",required:"","onUpdate:modelValue":e[392]||(e[392]=f=>r.configFile.vllm_url=f),onChange:e[393]||(e[393]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.vllm_url]])])])]),l("tr",null,[e[715]||(e[715]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"gpu memory utilization:")],-1)),l("td",null,[l("div",jlt,[l("div",Qlt,[e[714]||(e[714]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-medium"}," vllm gpu memory utilization: ")],-1)),l("p",Xlt,[D(l("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[394]||(e[394]=f=>r.configFile.vllm_gpu_memory_utilization=f),onChange:e[395]||(e[395]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.vllm_gpu_memory_utilization]])])]),D(l("input",{id:"vllm_gpu_memory_utilization",onChange:e[396]||(e[396]=f=>i.settingsChanged=!0),type:"range","onUpdate:modelValue":e[397]||(e[397]=f=>r.configFile.vllm_gpu_memory_utilization=f),min:"0.10",max:"1",step:"0.01",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.vllm_gpu_memory_utilization]])])])]),l("tr",null,[e[716]||(e[716]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_max_num_seqs",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm max num seqs:")],-1)),l("td",null,[l("div",Zlt,[D(l("input",{type:"number",id:"vllm_max_num_seqs",min:"64",max:"2048",required:"","onUpdate:modelValue":e[398]||(e[398]=f=>r.configFile.vllm_max_num_seqs=f),onChange:e[399]||(e[399]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.vllm_max_num_seqs]])])])]),l("tr",null,[e[717]||(e[717]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_max_model_len",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"max model len:")],-1)),l("td",null,[l("div",Jlt,[D(l("input",{type:"number",id:"vllm_max_model_len",min:"2048",max:"1000000",required:"","onUpdate:modelValue":e[400]||(e[400]=f=>r.configFile.vllm_max_model_len=f),onChange:e[401]||(e[401]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.vllm_max_model_len]])])])]),l("tr",null,[e[718]||(e[718]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_model_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm model path:")],-1)),l("td",null,[l("div",ect,[D(l("input",{type:"text",id:"vllm_model_path",required:"","onUpdate:modelValue":e[402]||(e[402]=f=>r.configFile.vllm_model_path=f),onChange:e[403]||(e[403]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.vllm_model_path]])])])])])]),_:1}),z(a,{title:"Petals service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",tct,[l("tr",null,[e[720]||(e[720]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_petals_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable petals service:")],-1)),l("td",null,[l("div",nct,[D(l("input",{type:"checkbox",id:"enable_petals_service",required:"","onUpdate:modelValue":e[404]||(e[404]=f=>r.configFile.enable_petals_service=f),onChange:e[405]||(e[405]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.enable_petals_service]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[406]||(e[406]=f=>this.$store.state.messageBox.showMessage(`Activates Petals service. The service will be automatically loaded at startup alowing you to use the petals endpoint to generate text in a distributed network. +Here is how you can do that`))},e[710]||(e[710]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[712]||(e[712]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install vLLM service:")],-1)),l("td",null,[l("div",Wlt,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[390]||(e[390]=(...f)=>r.reinstallvLLMService&&r.reinstallvLLMService(...f))},"install vLLM service"),l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[391]||(e[391]=(...f)=>r.startvLLMService&&r.startvLLMService(...f))},"start vllm service")])])]),l("tr",null,[e[713]||(e[713]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm base url:")],-1)),l("td",null,[l("div",Klt,[D(l("input",{type:"text",id:"vllm_url",required:"","onUpdate:modelValue":e[392]||(e[392]=f=>r.configFile.vllm_url=f),onChange:e[393]||(e[393]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.vllm_url]])])])]),l("tr",null,[e[715]||(e[715]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"gpu memory utilization:")],-1)),l("td",null,[l("div",jlt,[l("div",Qlt,[e[714]||(e[714]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-medium"}," vllm gpu memory utilization: ")],-1)),l("p",Xlt,[D(l("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[394]||(e[394]=f=>r.configFile.vllm_gpu_memory_utilization=f),onChange:e[395]||(e[395]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.vllm_gpu_memory_utilization]])])]),D(l("input",{id:"vllm_gpu_memory_utilization",onChange:e[396]||(e[396]=f=>i.settingsChanged=!0),type:"range","onUpdate:modelValue":e[397]||(e[397]=f=>r.configFile.vllm_gpu_memory_utilization=f),min:"0.10",max:"1",step:"0.01",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.vllm_gpu_memory_utilization]])])])]),l("tr",null,[e[716]||(e[716]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_max_num_seqs",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm max num seqs:")],-1)),l("td",null,[l("div",Zlt,[D(l("input",{type:"number",id:"vllm_max_num_seqs",min:"64",max:"2048",required:"","onUpdate:modelValue":e[398]||(e[398]=f=>r.configFile.vllm_max_num_seqs=f),onChange:e[399]||(e[399]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.vllm_max_num_seqs]])])])]),l("tr",null,[e[717]||(e[717]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_max_model_len",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"max model len:")],-1)),l("td",null,[l("div",Jlt,[D(l("input",{type:"number",id:"vllm_max_model_len",min:"2048",max:"1000000",required:"","onUpdate:modelValue":e[400]||(e[400]=f=>r.configFile.vllm_max_model_len=f),onChange:e[401]||(e[401]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.vllm_max_model_len]])])])]),l("tr",null,[e[718]||(e[718]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"vllm_model_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm model path:")],-1)),l("td",null,[l("div",ect,[D(l("input",{type:"text",id:"vllm_model_path",required:"","onUpdate:modelValue":e[402]||(e[402]=f=>r.configFile.vllm_model_path=f),onChange:e[403]||(e[403]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.vllm_model_path]])])])])])]),_:1}),z(a,{title:"Petals service",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",tct,[l("tr",null,[e[720]||(e[720]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"enable_petals_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable petals service:")],-1)),l("td",null,[l("div",nct,[D(l("input",{type:"checkbox",id:"enable_petals_service",required:"","onUpdate:modelValue":e[404]||(e[404]=f=>r.configFile.enable_petals_service=f),onChange:e[405]||(e[405]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.enable_petals_service]])])]),l("td",null,[l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[406]||(e[406]=f=>this.$store.state.messageBox.showMessage(`Activates Petals service. The service will be automatically loaded at startup alowing you to use the petals endpoint to generate text in a distributed network. If You are using windows, this will install wsl so you need to activate it. -Here is how you can do that`))},e[719]||(e[719]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[721]||(e[721]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Petals service:")],-1)),l("td",null,[l("div",sct,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[407]||(e[407]=(...f)=>r.reinstallPetalsService&&r.reinstallPetalsService(...f))},"install petals service")])])]),l("tr",null,[e[722]||(e[722]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"petals base url:")],-1)),l("td",null,[l("div",ict,[D(l("input",{type:"text",id:"petals_base_url",required:"","onUpdate:modelValue":e[408]||(e[408]=f=>r.configFile.petals_base_url=f),onChange:e[409]||(e[409]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.petals_base_url]])])])])])]),_:1})]),_:1}),z(a,{title:"TTV settings",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",rct,[l("tr",null,[e[723]||(e[723]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"lumalabs_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Lumalabs key:")],-1)),l("td",null,[l("div",oct,[D(l("input",{type:"text",id:"lumalabs_key",required:"","onUpdate:modelValue":e[410]||(e[410]=f=>r.configFile.lumalabs_key=f),onChange:e[411]||(e[411]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.lumalabs_key]])])])])])]),_:1}),z(a,{title:"Misc",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[z(a,{title:"Elastic search Service (under construction)",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",act,[l("tr",null,[e[724]||(e[724]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elastic_search_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable elastic search service:")],-1)),l("td",null,[l("div",lct,[D(l("input",{type:"checkbox",id:"elastic_search_service",required:"","onUpdate:modelValue":e[412]||(e[412]=f=>r.configFile.elastic_search_service=f),onChange:e[413]||(e[413]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ye,r.configFile.elastic_search_service]])])])]),l("tr",null,[e[725]||(e[725]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"install_elastic_search_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reinstall Elastic Search service:")],-1)),l("td",null,[l("div",cct,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[414]||(e[414]=(...f)=>r.reinstallElasticSearchService&&r.reinstallElasticSearchService(...f))},"install ElasticSearch service")])])]),l("tr",null,[e[726]||(e[726]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elastic_search_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"elastic search base url:")],-1)),l("td",null,[l("div",dct,[D(l("input",{type:"text",id:"elastic_search_url",required:"","onUpdate:modelValue":e[415]||(e[415]=f=>r.configFile.elastic_search_url=f),onChange:e[416]||(e[416]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.elastic_search_url]])])])])])]),_:1})]),_:1})],2)]),l("div",uct,[l("div",pct,[l("button",{onClick:e[417]||(e[417]=K(f=>i.bzc_collapsed=!i.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[727]||(e[727]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.bzc_collapsed]]),D(l("div",null,e[728]||(e[728]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.bzc_collapsed]]),e[730]||(e[730]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),r.configFile.binding_name?B("",!0):(T(),w("div",fct,e[729]||(e[729]=[l("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1),Ze(" No binding selected! ")]))),r.configFile.binding_name?(T(),w("div",_ct,"|")):B("",!0),r.configFile.binding_name?(T(),w("div",mct,[l("div",hct,[l("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,gct),l("p",bct,W(r.binding_name),1)])])):B("",!0)])]),l("div",{class:Ue([{hidden:i.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(T(),w("div",yct,[l("label",Ect," Bindings: ("+W(r.bindingsZoo.length)+") ",1),l("div",{class:Ue(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",i.bzl_collapsed?"":"max-h-96"])},[z(ri,{name:"list"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(r.bindingsZoo,(f,g)=>(T(),at(c,{ref_for:!0,ref:"bindingZoo",key:"index-"+g+"-"+f.folder,binding:f,"on-selected":r.onBindingSelected,"on-reinstall":r.onReinstallBinding,"on-unInstall":r.onUnInstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:f.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-unInstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):B("",!0),i.bzl_collapsed?(T(),w("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[418]||(e[418]=f=>i.bzl_collapsed=!i.bzl_collapsed)},e[731]||(e[731]=[l("i",{"data-feather":"chevron-up"},null,-1)]))):(T(),w("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[419]||(e[419]=f=>i.bzl_collapsed=!i.bzl_collapsed)},e[732]||(e[732]=[l("i",{"data-feather":"chevron-down"},null,-1)])))],2)]),l("div",vct,[l("div",Sct,[l("button",{onClick:e[420]||(e[420]=K(f=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[D(l("div",null,e[733]||(e[733]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.mzc_collapsed]]),D(l("div",null,e[734]||(e[734]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.mzc_collapsed]]),e[737]||(e[737]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),l("div",Tct,[r.configFile.binding_name?B("",!0):(T(),w("div",xct,e[735]||(e[735]=[l("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1),Ze(" Select binding first! ")]))),!r.configFile.model_name&&r.configFile.binding_name?(T(),w("div",Cct,e[736]||(e[736]=[l("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1),Ze(" No model selected! ")]))):B("",!0),r.configFile.model_name?(T(),w("div",wct,"|")):B("",!0),r.configFile.model_name?(T(),w("div",Rct,[l("div",Act,[l("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,Nct),l("p",Mct,W(r.configFile.model_name),1)])])):B("",!0)])])]),l("div",{class:Ue([{hidden:i.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[l("div",Oct,[l("div",Ict,[l("div",kct,[i.searchModelInProgress?(T(),w("div",Dct,e[738]||(e[738]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):B("",!0),i.searchModelInProgress?B("",!0):(T(),w("div",Lct,e[739]||(e[739]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])))]),D(l("input",{type:"search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search models...",required:"","onUpdate:modelValue":e[421]||(e[421]=f=>i.searchModel=f),onKeyup:e[422]||(e[422]=zs((...f)=>r.searchModel_func&&r.searchModel_func(...f),["enter"]))},null,544),[[ue,i.searchModel]]),i.searchModel?(T(),w("button",{key:0,onClick:e[423]||(e[423]=K(f=>i.searchModel="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):B("",!0)])]),l("div",null,[D(l("input",{"onUpdate:modelValue":e[424]||(e[424]=f=>i.show_only_installed_models=f),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[Ye,i.show_only_installed_models]]),e[740]||(e[740]=l("label",{for:"only_installed"},"Show only installed models",-1))]),l("div",null,[z(d,{radioOptions:i.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),e[748]||(e[748]=l("a",{href:"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard",target:"_blank",class:"mb-4 font-bold underline text-blue-500 pb-4"},"Hugging face Leaderboard",-1)),i.is_loading_zoo?(T(),w("div",Pct,e[741]||(e[741]=[l("svg",{"aria-hidden":"true",class:"text-center w-full display: flex;align-items: center; h-20 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),l("p",{class:"heartbeat-text"},"Loading models Zoo",-1)]))):B("",!0),i.models_zoo&&i.models_zoo.length>0?(T(),w("div",Fct,[l("label",Uct," Models: ("+W(i.models_zoo.length)+") ",1),l("div",{class:Ue(["overflow-y-auto p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",i.mzl_collapsed?"":"max-h-96"])},[z(ri,{name:"list"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(r.rendered_models_zoo,(f,g)=>(T(),at(u,{ref_for:!0,ref:"modelZoo",key:"index-"+g+"-"+f.name,model:f,"is-installed":f.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onModelSelected,selected:f.name===r.configFile.model_name,model_type:f.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["model","is-installed","on-install","on-uninstall","on-selected","selected","model_type","on-copy","on-copy-link","on-cancel-install"]))),128)),l("button",{ref:"load_more_models",class:"relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",onClick:e[425]||(e[425]=(...f)=>r.load_more_models&&r.load_more_models(...f))},"Load more models",512)]),_:1})],2)])):B("",!0),i.mzl_collapsed?(T(),w("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[426]||(e[426]=(...f)=>r.open_mzl&&r.open_mzl(...f))},e[742]||(e[742]=[l("i",{"data-feather":"chevron-up"},null,-1)]))):(T(),w("button",{key:3,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[427]||(e[427]=(...f)=>r.open_mzl&&r.open_mzl(...f))},e[743]||(e[743]=[l("i",{"data-feather":"chevron-down"},null,-1)]))),l("div",Bct,[l("div",Gct,[l("div",null,[l("div",Vct,[e[744]||(e[744]=l("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),D(l("input",{type:"text","onUpdate:modelValue":e[428]||(e[428]=f=>i.reference_path=f),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter Path ...",required:""},null,512),[[ue,i.reference_path]])]),l("button",{type:"button",onClick:e[429]||(e[429]=K(f=>r.onCreateReference(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Add reference")]),i.modelDownlaodInProgress?B("",!0):(T(),w("div",zct,[l("div",Hct,[e[745]||(e[745]=l("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),D(l("input",{type:"text","onUpdate:modelValue":e[430]||(e[430]=f=>i.addModel.url=f),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter URL ...",required:""},null,512),[[ue,i.addModel.url]])]),l("button",{type:"button",onClick:e[431]||(e[431]=K(f=>r.onInstallAddModel(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Download")])),i.modelDownlaodInProgress?(T(),w("div",qct,[e[747]||(e[747]=l("div",{role:"status",class:"justify-center"},null,-1)),l("div",Yct,[l("div",$ct,[l("div",Wct,[e[746]||(e[746]=Pi(' Downloading Loading...',1)),l("span",Kct,W(Math.floor(i.addModel.progress))+"%",1)]),l("div",{class:"mx-1 opacity-80 line-clamp-1",title:i.addModel.url},W(i.addModel.url),9,jct),l("div",Qct,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Wt({width:i.addModel.progress+"%"})},null,4)]),l("div",Xct,[l("span",Zct,"Download speed: "+W(r.speed_computed)+"/s",1),l("span",Jct,W(r.downloaded_size_computed)+"/"+W(r.total_size_computed),1)])])]),l("div",edt,[l("div",tdt,[l("div",ndt,[l("button",{onClick:e[432]||(e[432]=K((...f)=>r.onCancelInstall&&r.onCancelInstall(...f),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])):B("",!0)])])],2)]),l("div",sdt,[l("div",idt,[l("button",{onClick:e[435]||(e[435]=K(f=>i.pzc_collapsed=!i.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[D(l("div",null,e[749]||(e[749]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.pzc_collapsed]]),D(l("div",null,e[750]||(e[750]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.pzc_collapsed]]),e[753]||(e[753]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),r.configFile.personalities?(T(),w("div",rdt,"|")):B("",!0),l("div",odt,W(r.active_pesonality),1),r.configFile.personalities?(T(),w("div",adt,"|")):B("",!0),r.configFile.personalities?(T(),w("div",ldt,[r.mountedPersArr.length>0?(T(),w("div",cdt,[(T(!0),w(Be,null,Xe(r.mountedPersArr,(f,g)=>(T(),w("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:g+"-"+f.name,ref_for:!0,ref:"mountedPersonalities"},[l("div",ddt,[l("button",{onClick:K(b=>r.onPersonalitySelected(f),["stop"])},[l("img",{src:i.bUrl+f.avatar,onError:e[433]||(e[433]=(...b)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...b)),class:Ue(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary",r.configFile.active_personality_id==r.configFile.personalities.indexOf(f.full_path)?"border-secondary":"border-transparent z-0"]),title:f.name},null,42,pdt)],8,udt),l("button",{onClick:K(b=>r.unmountPersonality(f),["stop"])},e[751]||(e[751]=[l("span",{class:"hidden group-hover:block -top-2 -right-1 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[l("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1)]),8,fdt)])]))),128))])):B("",!0)])):B("",!0),l("button",{onClick:e[434]||(e[434]=K(f=>r.unmountAll(),["stop"])),class:"bg-bg-light hover:border-green-200 ml-5 dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount All"},e[752]||(e[752]=[l("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)]))])]),l("div",{class:Ue([{hidden:i.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[l("div",_dt,[e[756]||(e[756]=l("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),l("div",mdt,[l("div",hdt,[i.searchPersonalityInProgress?(T(),w("div",gdt,e[754]||(e[754]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):B("",!0),i.searchPersonalityInProgress?B("",!0):(T(),w("div",bdt,e[755]||(e[755]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])))]),D(l("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search personality...",required:"","onUpdate:modelValue":e[436]||(e[436]=f=>i.searchPersonality=f),onKeyup:e[437]||(e[437]=K((...f)=>r.searchPersonality_func&&r.searchPersonality_func(...f),["stop"]))},null,544),[[ue,i.searchPersonality]]),i.searchPersonality?(T(),w("button",{key:0,onClick:e[438]||(e[438]=K(f=>i.searchPersonality="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):B("",!0)])]),i.searchPersonality?B("",!0):(T(),w("div",ydt,[l("label",Edt," Personalities Category: ("+W(i.persCatgArr.length)+") ",1),l("select",{id:"persCat",onChange:e[439]||(e[439]=f=>r.update_personality_category(f.target.value,r.refresh)),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(T(!0),w(Be,null,Xe(i.persCatgArr,(f,g)=>(T(),w("option",{key:g,selected:f==this.configFile.personality_category},W(f),9,vdt))),128))],32)])),l("div",null,[i.personalitiesFiltered.length>0?(T(),w("div",Sdt,[l("label",Tdt,W(i.searchPersonality?"Search results":"Personalities")+": ("+W(i.personalitiesFiltered.length)+") ",1),l("div",{class:Ue(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",i.pzl_collapsed?"":"max-h-96"])},[z(ri,{name:"bounce"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(i.personalitiesFiltered,(f,g)=>(T(),at(_,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+g+"-"+f.name,personality:f,select_language:!0,full_path:f.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(b=>b===f.full_path||b===f.full_path+":"+f.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality,"on-copy-personality-name":r.onCopyPersonalityName,"on-copy-to_custom":r.onCopyToCustom,"on-open-folder":r.handleOpenFolder},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder"]))),128))]),_:1})],2)])):B("",!0)]),i.pzl_collapsed?(T(),w("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[440]||(e[440]=f=>i.pzl_collapsed=!i.pzl_collapsed)},e[757]||(e[757]=[l("i",{"data-feather":"chevron-up"},null,-1)]))):(T(),w("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[441]||(e[441]=f=>i.pzl_collapsed=!i.pzl_collapsed)},e[758]||(e[758]=[l("i",{"data-feather":"chevron-down"},null,-1)])))],2)]),l("div",xdt,[l("div",Cdt,[l("button",{onClick:e[442]||(e[442]=K(f=>i.mc_collapsed=!i.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[D(l("div",null,e[759]||(e[759]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.mc_collapsed]]),D(l("div",null,e[760]||(e[760]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.mc_collapsed]]),e[761]||(e[761]=l("p",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1))])]),l("div",{class:Ue([{hidden:i.mc_collapsed},"flex flex-col mb-2 p-2"])},[l("div",wdt,[l("div",Rdt,[D(l("input",{id:"override-model-parameters",type:"checkbox",class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[443]||(e[443]=K(()=>{},["stop"])),"onUpdate:modelValue":e[444]||(e[444]=f=>r.configFile.override_personality_model_parameters=f),onChange:e[445]||(e[445]=f=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[Ye,r.configFile.override_personality_model_parameters]]),e[762]||(e[762]=l("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1))])]),l("div",{class:Ue(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[l("div",Adt,[e[763]||(e[763]=l("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),D(l("input",{type:"text",id:"seed","onUpdate:modelValue":e[446]||(e[446]=f=>r.configFile.seed=f),class:"bg-gray-50 border border-gray-300 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,512),[[ue,r.configFile.seed]])]),l("div",Ndt,[l("div",Mdt,[l("div",Odt,[e[764]||(e[764]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),l("p",Idt,[D(l("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[447]||(e[447]=f=>r.configFile.temperature=f),onChange:e[448]||(e[448]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.temperature]])])]),D(l("input",{id:"temperature",onChange:e[449]||(e[449]=f=>i.settingsChanged=!0),type:"range","onUpdate:modelValue":e[450]||(e[450]=f=>r.configFile.temperature=f),min:"0",max:"5",step:"0.1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.temperature]])])]),l("div",kdt,[l("div",Ddt,[l("div",Ldt,[e[765]||(e[765]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),l("p",Pdt,[D(l("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[451]||(e[451]=f=>r.configFile.n_predict=f),onChange:e[452]||(e[452]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.n_predict]])])]),D(l("input",{id:"predict",type:"range",onChange:e[453]||(e[453]=f=>i.settingsChanged=!0),"onUpdate:modelValue":e[454]||(e[454]=f=>r.configFile.n_predict=f),min:"0",max:"2048",step:"32",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.n_predict]])])]),l("div",Fdt,[l("div",Udt,[l("div",Bdt,[e[766]||(e[766]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),l("p",Gdt,[D(l("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[455]||(e[455]=f=>r.configFile.top_k=f),onChange:e[456]||(e[456]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.top_k]])])]),D(l("input",{id:"top_k",type:"range",onChange:e[457]||(e[457]=f=>i.settingsChanged=!0),"onUpdate:modelValue":e[458]||(e[458]=f=>r.configFile.top_k=f),min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.top_k]])])]),l("div",Vdt,[l("div",zdt,[l("div",Hdt,[e[767]||(e[767]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),l("p",qdt,[D(l("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[459]||(e[459]=f=>r.configFile.top_p=f),onChange:e[460]||(e[460]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.top_p]])])]),D(l("input",{id:"top_p",type:"range","onUpdate:modelValue":e[461]||(e[461]=f=>r.configFile.top_p=f),min:"0",max:"1",step:"0.01",onChange:e[462]||(e[462]=f=>i.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.top_p]])])]),l("div",Ydt,[l("div",$dt,[l("div",Wdt,[e[768]||(e[768]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),l("p",Kdt,[D(l("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[463]||(e[463]=f=>r.configFile.repeat_penalty=f),onChange:e[464]||(e[464]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.repeat_penalty]])])]),D(l("input",{id:"repeat_penalty",onChange:e[465]||(e[465]=f=>i.settingsChanged=!0),type:"range","onUpdate:modelValue":e[466]||(e[466]=f=>r.configFile.repeat_penalty=f),min:"0",max:"2",step:"0.01",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.repeat_penalty]])])]),l("div",jdt,[l("div",Qdt,[l("div",Xdt,[e[769]||(e[769]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),l("p",Zdt,[D(l("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[467]||(e[467]=f=>r.configFile.repeat_last_n=f),onChange:e[468]||(e[468]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.repeat_last_n]])])]),D(l("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[469]||(e[469]=f=>r.configFile.repeat_last_n=f),min:"0",max:"100",step:"1",onChange:e[470]||(e[470]=f=>i.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),z(m,{ref:"addmodeldialog"},null,512),z(h,{class:"z-20",show:i.variantSelectionDialogVisible,choices:i.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const eut=it(tit,[["render",Jdt],["__scopeId","data-v-ebfd9309"]]),tut={components:{ClipBoardTextInput:L0,Card:pp},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const n={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};Z.post("/start_training",n).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(n){const e=n.target.files;e.length>0&&(this.selectedDataset=e[0])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(n){console.log("watching model_name",n),this.$refs.clipboardInput.inputValue=n}}},nut={key:0,class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},sut={class:"mb-4"},iut=["value"],rut={class:"mb-4"},out={class:"mb-4"},aut={class:"mb-4"},lut={class:"mb-4"},cut={class:"mb-4"},dut={class:"mb-4"},uut={key:1};function put(n,e,t,s,i,r){const o=et("Card"),a=et("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(T(),w("div",nut,[l("form",{onSubmit:e[2]||(e[2]=K((...c)=>r.submitForm&&r.submitForm(...c),["prevent"])),class:""},[z(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[z(o,{title:"Model",class:"",isHorizontal:!1},{default:Ie(()=>[l("div",sut,[e[3]||(e[3]=l("label",{for:"model_name",class:"text-sm"},"Model Name:",-1)),D(l("select",{"onUpdate:modelValue":e[0]||(e[0]=c=>r.selectedModel=c),onChange:e[1]||(e[1]=(...c)=>n.setModel&&n.setModel(...c)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(T(!0),w(Be,null,Xe(r.models,c=>(T(),w("option",{key:c,value:c},W(c),9,iut))),128))],544),[[It,r.selectedModel]])])]),_:1}),z(o,{title:"Data",isHorizontal:!1},{default:Ie(()=>[l("div",rut,[e[4]||(e[4]=l("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1)),z(a,{id:"model_path",inputType:"file",value:i.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),z(o,{title:"Training",isHorizontal:!1},{default:Ie(()=>[l("div",out,[e[5]||(e[5]=l("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1)),z(a,{id:"model_path",inputType:"integer",value:i.lr},null,8,["value"])]),l("div",aut,[e[6]||(e[6]=l("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1)),z(a,{id:"model_path",inputType:"integer",value:i.num_epochs},null,8,["value"])]),l("div",lut,[e[7]||(e[7]=l("label",{for:"max_length",class:"text-sm"},"Max Length:",-1)),z(a,{id:"model_path",inputType:"integer",value:i.max_length},null,8,["value"])]),l("div",cut,[e[8]||(e[8]=l("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1)),z(a,{id:"model_path",inputType:"integer",value:i.batch_size},null,8,["value"])])]),_:1}),z(o,{title:"Output",isHorizontal:!1},{default:Ie(()=>[l("div",dut,[e[9]||(e[9]=l("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1)),z(a,{id:"model_path",inputType:"text",value:n.output_dir},null,8,["value"])])]),_:1})]),_:1}),z(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>e[10]||(e[10]=[l("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1)])),_:1})],32)])):(T(),w("div",uut,[z(o,{title:"Info",class:"",isHorizontal:!1},{default:Ie(()=>e[11]||(e[11]=[Ze(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")])),_:1})]))}const fut=it(tut,[["render",put]]),_ut={components:{ClipBoardTextInput:L0,Card:pp},data(){return{model_name:"jondurbin/airoboros-7b-gpt4",tokenizer_name:"jondurbin/airoboros-7b-gpt4",dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDatasetPath:""}},methods:{submitForm(){this.model_name,this.tokenizer_name,this.selectedDatasetPath,this.max_length,this.batch_size,this.lr,this.num_epochs,this.selectedFolder},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(n){const e=n.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},mut={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},hut={class:"mb-4"},gut={class:"mb-4"};function but(n,e,t,s,i,r){const o=et("ClipBoardTextInput"),a=et("Card");return T(),w("div",mut,[l("form",{onSubmit:e[0]||(e[0]=K((...c)=>r.submitForm&&r.submitForm(...c),["prevent"])),class:"max-w-md mx-auto"},[z(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[z(a,{title:"Model",class:"",isHorizontal:!1},{default:Ie(()=>[l("div",hut,[e[1]||(e[1]=l("label",{for:"model_name",class:"text-sm"},"Model Name:",-1)),z(o,{id:"model_path",inputType:"text",value:i.model_name},null,8,["value"])]),l("div",gut,[e[2]||(e[2]=l("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1)),z(o,{id:"model_path",inputType:"text",value:i.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),z(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>e[3]||(e[3]=[l("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1)])),_:1})],32)])}const yut=it(_ut,[["render",but]]),Eut={name:"Discussion",emits:["delete","select","openFolder","editTitle","makeTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,makeTitleMode:!1,deleteMode:!1,openFolder:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{cancel(){this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1},deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},openFolderEvent(){this.$emit("openFolder",{id:this.id})},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},makeTitleEvent(){this.$emit("makeTitle",{id:this.id}),this.showConfirmation=!1},chnageTitle(n){this.newTitle=n},checkedChangeEvent(n,e){this.$emit("checked",n,e)}},mounted(){this.newTitle=this.title,Le(()=>{Ve.replace()})},watch:{showConfirmation(){Le(()=>{Ve.replace()})},editTitleMode(n){this.showConfirmation=n,this.editTitle=n,n&&Le(()=>{try{this.$refs.titleBox.focus()}catch{}})},deleteMode(n){this.showConfirmation=n,n&&Le(()=>{this.$refs.titleBox.focus()})},makeTitleMode(n){this.showConfirmation=n},checkBoxValue(n,e){this.checkBoxValue_local=n}}},vut=["id"],Sut={class:"flex flex-row items-center gap-2"},Tut={key:0},xut={class:"flex flex-row items-center w-full"},Cut=["title"],wut=["value"],Rut={class:"flex items-center flex-1 max-h-6"},Aut={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Nut={key:1,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"};function Mut(n,e,t,s,i,r){return T(),w("div",{class:Ue([t.selected?"discussion-hilighted shadow-md min-w-[23rem] max-w-[23rem]":"discussion min-w-[23rem] max-w-[23rem]","m-1 py-2 flex flex-row sm:flex-row flex-wrap flex-shrink: 0 item-center shadow-sm hover:shadow-md rounded-md duration-75 group cursor-pointer"]),id:"dis-"+t.id,onClick:e[13]||(e[13]=K(o=>r.selectEvent(),["stop"]))},[l("div",Sut,[t.isCheckbox?(T(),w("div",Tut,[D(l("input",{type:"checkbox",class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[0]||(e[0]=K(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>i.checkBoxValue_local=o),onInput:e[2]||(e[2]=o=>r.checkedChangeEvent(o,t.id))},null,544),[[Ye,i.checkBoxValue_local]])])):B("",!0),t.selected?(T(),w("div",{key:1,class:Ue(["min-h-full w-2 rounded-xl self-stretch",t.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):B("",!0),t.selected?B("",!0):(T(),w("div",{key:2,class:Ue(["w-2",t.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),l("div",xut,[i.editTitle?B("",!0):(T(),w("p",{key:0,title:t.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},W(t.title?t.title==="untitled"?"New discussion":t.title:"New discussion"),9,Cut)),i.editTitle?(T(),w("input",{key:1,type:"text",id:"title-box",ref:"titleBox",class:"bg-bg-light dark:bg-bg-dark rounded-md border-0 w-full -m-1 p-1",value:t.title,required:"",onKeydown:[e[3]||(e[3]=zs(K(o=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=zs(K(o=>i.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>r.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=K(()=>{},["stop"]))},null,40,wut)):B("",!0),l("div",Rut,[i.showConfirmation?(T(),w("div",Aut,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[7]||(e[7]=K(o=>r.cancel(),["stop"]))},e[14]||(e[14]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[8]||(e[8]=K(o=>i.editTitleMode?r.editTitleEvent():i.deleteMode?r.deleteEvent():r.makeTitleEvent(),["stop"]))},e[15]||(e[15]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),i.showConfirmation?B("",!0):(T(),w("div",Nut,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Open folder",type:"button",onClick:e[9]||(e[9]=K(o=>r.openFolderEvent(),["stop"]))},e[16]||(e[16]=[l("i",{"data-feather":"folder"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Make a title",type:"button",onClick:e[10]||(e[10]=K(o=>i.makeTitleMode=!0,["stop"]))},e[17]||(e[17]=[l("i",{"data-feather":"type"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[11]||(e[11]=K(o=>i.editTitleMode=!0,["stop"]))},e[18]||(e[18]=[l("i",{"data-feather":"edit-2"},null,-1)])),l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[12]||(e[12]=K(o=>i.deleteMode=!0,["stop"]))},e[19]||(e[19]=[l("i",{"data-feather":"trash"},null,-1)]))]))])])],10,vut)}const W0=it(Eut,[["render",Mut]]),Out={data(){return{show:!1,prompt:"",inputText:""}},methods:{showPanel(){this.show=!0},ok(){this.show=!1,this.$emit("ok",this.inputText)},cancel(){this.show=!1,this.inputText=""}},props:{promptText:{type:String,required:!0}},watch:{promptText(n){this.prompt=n}}},Iut={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},kut={class:"bg-white p-8 rounded"},Dut={class:"text-xl font-bold mb-4"};function Lut(n,e,t,s,i,r){return T(),w("div",null,[i.show?(T(),w("div",Iut,[l("div",kut,[l("h2",Dut,W(t.promptText),1),D(l("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>i.inputText=o),class:"border border-gray-300 px-4 py-2 rounded mb-4"},null,512),[[ue,i.inputText]]),l("button",{onClick:e[1]||(e[1]=(...o)=>r.ok&&r.ok(...o)),class:"bg-blue-500 text-white px-4 py-2 rounded mr-2"},"OK"),l("button",{onClick:e[2]||(e[2]=(...o)=>r.cancel&&r.cancel(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"Cancel")])])):B("",!0)])}const aM=it(Out,[["render",Lut]]),Put={data(){return{id:0,loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:W0,MarkdownRenderer:lp},props:{host:{type:String,required:!1,default:"http://localhost:9600"}},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchTitles()},closeComponent(){this.isVisible=!1},fetchCategories(){Z.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(n=>{this.categories=n.data.categories}).catch(n=>{console.error("Error fetching categories:",n)})},fetchTitles(){console.log("Fetching categories"),Z.post("/get_skills_library_titles",{client_id:this.$store.state.client_id}).then(n=>{this.titles=n.data.titles,console.log("titles recovered")}).catch(n=>{console.error("Error fetching titles:",n)})},fetchContent(n){Z.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:n}).then(e=>{const t=e.data.contents[0];this.id=t.id,this.content=t.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(n){console.log("Delete category")},editCategory(n){console.log("Edit category")},checkUncheckCategory(n){console.log("Unchecked category")},deleteSkill(n){console.log("Delete skill ",n),Z.post("/delete_skill",{client_id:this.$store.state.client_id,skill_id:n}).then(()=>{this.fetchTitles()})},editTitle(n){Z.post("/edit_skill_title",{client_id:this.$store.state.client_id,skill_id:n,title:n}).then(()=>{this.fetchTitles()}),console.log("Edit title")},makeTitle(n){console.log("Make title")},checkUncheckTitle(n){},searchSkills(){}}},Fut={id:"leftPanel",class:"flex flex-row h-full flex-grow shadow-lg rounded"},Uut={class:"min-w-[23rem] max-w-[23rem] z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md overflow-y-scroll no-scrollbar"},But={class:"search p-4"},Gut={classclass:"absolute flex flex-col no-scrollbar shadow-lg min-w-[24rem] max-w-[24rem] bg-bg-light-tone dark:bg-bg-dark-tone top-20 left-20 bottom-20 right-20 bg-bg-light shadow-lg rounded"},Vut={class:"z-0 flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"};function zut(n,e,t,s,i,r){const o=et("Discussion"),a=et("MarkdownRenderer");return T(),w("div",{class:Ue([{hidden:!i.isVisible},"absolute flex flex-col no-scrollbar shadow-lg bg-bg-light dark:bg-bg-dark top-20 left-20 bottom-20 right-20 shadow-lg rounded"])},[l("div",Fut,[l("div",Uut,[l("div",But,[D(l("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=c=>i.searchQuery=c),placeholder:"Search skills",class:"border border-gray-300 rounded px-2 py-1 mr-2"},null,512),[[ue,i.searchQuery]]),l("button",{onClick:e[1]||(e[1]=(...c)=>r.searchSkills&&r.searchSkills(...c)),class:"bg-blue-500 text-white rounded px-4 py-1"},"Search")]),l("div",Gut,[e[3]||(e[3]=l("h2",{class:"text-xl font-bold m-4"},"Titles",-1)),i.titles.length>0?(T(),at(ri,{key:0,name:"list"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(i.titles,c=>(T(),at(o,{key:c.id,id:c.id,title:c.title,selected:r.fetchContent(c.id),loading:i.loading,isCheckbox:i.isCheckbox,checkBoxValue:!1,onSelect:d=>r.fetchContent(c.id),onDelete:d=>r.deleteSkill(c.id),onEditTitle:r.editTitle,onMakeTitle:r.makeTitle,onChecked:r.checkUncheckTitle},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):B("",!0)])]),l("div",Vut,[e[4]||(e[4]=l("h2",{class:"text-xl font-bold m-4"},"Content",-1)),z(a,{host:t.host,"markdown-text":i.content,message_id:i.id,discussion_id:i.id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])])]),l("button",{onClick:e[2]||(e[2]=(...c)=>r.closeComponent&&r.closeComponent(...c)),class:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1 hover:bg-red-300"},"Close")],2)}const lM=it(Put,[["render",zut]]),Hut={props:{htmlContent:{type:String,required:!0}}},qut=["innerHTML"];function Yut(n,e,t,s,i,r){return T(),w("div",{class:"w-full h-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",innerHTML:t.htmlContent},null,8,qut)}const $ut=it(Hut,[["render",Yut]]),Wut={name:"JsonTreeView",props:{data:{type:[Object,Array],required:!0},depth:{type:Number,default:0}},data(){return{collapsedKeys:new Set}},methods:{isObject(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)},isArray(n){return Array.isArray(n)},toggleCollapse(n){this.collapsedKeys.has(n)?this.collapsedKeys.delete(n):this.collapsedKeys.add(n)},isCollapsed(n){return this.collapsedKeys.has(n)},getValueType(n){return typeof n=="string"?"string":typeof n=="number"?"number":typeof n=="boolean"?"boolean":n===null?"null":""},formatValue(n){return typeof n=="string"?`"${n}"`:String(n)}}},Kut={class:"json-tree-view"},jut=["onClick"],Qut={key:0,class:"toggle-icon"},Xut={class:"key"},Zut={key:0,class:"json-nested"};function Jut(n,e,t,s,i,r){const o=et("json-tree-view",!0);return T(),w("div",Kut,[(T(!0),w(Be,null,Xe(t.data,(a,c)=>(T(),w("div",{key:c,class:"json-item"},[l("div",{class:"json-key",onClick:d=>r.toggleCollapse(c)},[r.isObject(a)||r.isArray(a)?(T(),w("span",Qut,[l("i",{class:Ue(r.isCollapsed(c)?"fas fa-chevron-right":"fas fa-chevron-down")},null,2)])):B("",!0),l("span",Xut,W(c)+":",1),!r.isObject(a)&&!r.isArray(a)?(T(),w("span",{key:1,class:Ue(["value",r.getValueType(a)])},W(r.formatValue(a)),3)):B("",!0)],8,jut),(r.isObject(a)||r.isArray(a))&&!r.isCollapsed(c)?(T(),w("div",Zut,[z(o,{data:a,depth:t.depth+1},null,8,["data","depth"])])):B("",!0)]))),128))])}const ept=it(Wut,[["render",Jut],["__scopeId","data-v-40406ec6"]]),tpt={components:{JsonTreeView:ept},props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Viewer"}},data(){return{collapsed:!0}},computed:{isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")},parsedJsonData(){if(typeof this.jsonData=="string")try{return JSON.parse(this.jsonData)}catch(n){return console.error("Error parsing JSON string:",n),{error:"Invalid JSON string"}}return this.jsonData}},methods:{toggleCollapsible(){this.collapsed=!this.collapsed}}},npt={key:0,class:"json-viewer"},spt={class:"toggle-icon"},ipt={class:"json-content panels-color"};function rpt(n,e,t,s,i,r){const o=et("json-tree-view");return r.isContentPresent?(T(),w("div",npt,[l("div",{class:"collapsible-section",onClick:e[0]||(e[0]=(...a)=>r.toggleCollapsible&&r.toggleCollapsible(...a))},[l("span",spt,[l("i",{class:Ue(i.collapsed?"fas fa-chevron-right":"fas fa-chevron-down")},null,2)]),Ze(" "+W(t.jsonFormText),1)]),D(l("div",ipt,[z(o,{data:r.parsedJsonData,depth:0},null,8,["data"])],512),[[xt,!i.collapsed]])])):B("",!0)}const opt=it(tpt,[["render",rpt],["__scopeId","data-v-83fc9727"]]),apt={props:{done:{type:Boolean,default:!1},text:{type:String,default:""},status:{type:Boolean,default:!1},step_type:{type:String,default:"start_end"},description:{type:String,default:""}},mounted(){this.amounted()},methods:{amounted(){console.log("Component mounted with the following properties:"),console.log("done:",this.done),console.log("text:",this.text),console.log("status:",this.status),console.log("step_type:",this.step_type),console.log("description:",this.description)}},watch:{done(n){typeof n!="boolean"&&console.error("Invalid type for done. Expected Boolean.")},status(n){typeof n!="boolean"&&console.error("Invalid type for status. Expected Boolean."),this.done&&!n&&console.error("Task completed with errors.")}}},lpt={class:"step-container"},cpt={class:"step-icon"},dpt={key:0},upt={key:0},ppt={key:1},fpt={key:2},_pt={key:1},mpt={class:"step-content"},hpt={key:0,class:"step-description"};function gpt(n,e,t,s,i,r){return T(),w("div",lpt,[l("div",{class:Ue(["step-wrapper transition-all duration-300 ease-in-out",{"bg-green-100 dark:bg-green-900":t.done&&t.status,"bg-red-100 dark:bg-red-900":t.done&&!t.status,"bg-gray-100 dark:bg-gray-800":!t.done}])},[l("div",cpt,[t.step_type==="start_end"?(T(),w("div",dpt,[t.done?t.done&&t.status?(T(),w("div",ppt,e[1]||(e[1]=[l("i",{"data-feather":"check-circle",class:"feather-icon text-green-600 dark:text-green-400"},null,-1)]))):(T(),w("div",fpt,e[2]||(e[2]=[l("i",{"data-feather":"x-circle",class:"feather-icon text-red-600 dark:text-red-400"},null,-1)]))):(T(),w("div",upt,e[0]||(e[0]=[l("i",{"data-feather":"circle",class:"feather-icon text-gray-600 dark:text-gray-300"},null,-1)])))])):B("",!0),t.done?B("",!0):(T(),w("div",_pt,e[3]||(e[3]=[l("div",{class:"spinner"},null,-1)])))]),l("div",mpt,[l("h3",{class:Ue(["step-text",{"text-green-600 dark:text-green-400":t.done&&t.status,"text-red-600 dark:text-red-400":t.done&&!t.status,"text-gray-800 dark:text-gray-200":!t.done}])},W(t.text||"No text provided"),3),t.description?(T(),w("p",hpt,W(t.description||"No description provided"),1)):B("",!0)])],2)])}const bpt=it(apt,[["render",gpt],["__scopeId","data-v-78f415f6"]]),ypt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20480%20480'%20xml:space='preserve'%3e%3cg%3e%3cg%3e%3cg%3e%3cpath%20d='M240,0C107.664,0,0,107.664,0,240s107.664,240,240,240s240-107.664,240-240S372.336,0,240,0z%20M240,460%20c-121.309,0-220-98.691-220-220S118.691,20,240,20s220,98.691,220,220S361.309,460,240,460z'/%3e%3cpath%20d='M410,194.999h-27.058c-2.643-8.44-6-16.56-10.03-24.271l19.158-19.158c3.776-3.775,5.854-8.79,5.854-14.121%20c0-5.332-2.08-10.347-5.854-14.121l-35.399-35.399c-3.775-3.775-8.79-5.854-14.122-5.854c-5.331,0-10.346,2.079-14.121,5.854%20l-19.158,19.158c-7.711-4.03-15.832-7.386-24.271-10.03V70c0-11.028-8.972-20-20-20h-50c-11.028,0-20,8.972-20,20v27.058%20c-8.44,2.643-16.56,6-24.271,10.03L151.57,87.93c-3.775-3.776-8.79-5.854-14.121-5.854c-5.332,0-10.347,2.08-14.121,5.854%20l-35.399,35.399c-3.775,3.775-5.854,8.79-5.854,14.122c0,5.331,2.079,10.346,5.854,14.121l19.158,19.158%20c-4.03,7.711-7.386,15.832-10.03,24.271H70c-11.028,0-20,8.972-20,20v50c0,11.028,8.972,20,20,20h27.057%20c2.643,8.44,6,16.56,10.03,24.271L87.929,328.43c-3.776,3.775-5.854,8.79-5.854,14.121c0,5.332,2.08,10.347,5.854,14.121%20l35.399,35.399c3.775,3.775,8.79,5.854,14.122,5.854c5.331,0,10.346-2.079,14.121-5.854l19.158-19.158%20c7.711,4.03,15.832,7.386,24.271,10.03V410c0,11.028,8.972,20,20,20h50c11.028,0,20-8.972,20.001-20v-27.058%20c8.44-2.643,16.56-6,24.271-10.03l19.158,19.158c3.775,3.776,8.79,5.854,14.121,5.854c5.332,0,10.347-2.08,14.121-5.854%20l35.399-35.399c3.775-3.775,5.854-8.79,5.854-14.122c0-5.331-2.079-10.346-5.854-14.121l-19.158-19.158%20c4.03-7.711,7.386-15.832,10.03-24.271H410c11.028,0,20-8.972,20-20v-50C430,203.971,421.028,194.999,410,194.999z%20M410,264.998%20h-34.598c-4.562,0-8.544,3.086-9.684,7.503c-3.069,11.901-7.716,23.133-13.813,33.387c-2.337,3.931-1.71,8.948,1.524,12.182%20l24.5,24.457l-35.357,35.4l-24.5-24.5c-3.236-3.235-8.253-3.86-12.182-1.524c-10.254,6.097-21.487,10.745-33.387,13.813%20c-4.417,1.14-7.503,5.122-7.503,9.684V410h-50v-34.599c0-4.562-3.086-8.544-7.503-9.684%20c-11.901-3.069-23.133-7.716-33.387-13.813c-1.587-0.944-3.353-1.404-5.107-1.404c-2.586,0-5.147,1.002-7.073,2.931l-24.457,24.5%20l-35.4-35.357l24.5-24.5c3.234-3.235,3.861-8.251,1.524-12.182c-6.097-10.254-10.745-21.487-13.813-33.387%20c-1.14-4.417-5.122-7.503-9.684-7.503H70v-50h34.596c4.562,0,8.544-3.086,9.684-7.503c3.069-11.901,7.716-23.133,13.813-33.387%20c2.337-3.931,1.71-8.948-1.524-12.182l-24.5-24.457l35.357-35.4l24.5,24.5c3.236,3.235,8.253,3.861,12.182,1.524%20c10.254-6.097,21.487-10.745,33.387-13.813c4.417-1.14,7.503-5.122,7.503-9.684V70h50v34.596c0,4.562,3.086,8.544,7.503,9.684%20c11.901,3.069,23.133,7.716,33.387,13.813c3.929,2.337,8.947,1.709,12.182-1.524l24.457-24.5l35.4,35.357l-24.5,24.5%20c-3.234,3.235-3.861,8.251-1.524,12.182c6.097,10.254,10.745,21.487,13.813,33.387c1.14,4.417,5.122,7.503,9.684,7.503H410%20V264.998z'/%3e%3cpath%20d='M331.585,292.475l-40-35l-13.17,15.051L298.386,290H240c-27.57,0-50-22.43-50-50h-20c0,38.598,31.402,70,70,70h58.386%20l-19.971,17.475l13.17,15.051l40-35c2.17-1.898,3.415-4.642,3.415-7.525S333.755,294.373,331.585,292.475z'/%3e%3cpath%20d='M201.585,207.473L181.614,190H240c27.57,0,50,22.43,50,50h20c0-38.598-31.402-70-70-70h-58.386l19.971-17.475%20l-13.17-15.051l-40,35c-2.17,1.898-3.415,4.642-3.415,7.525s1.245,5.627,3.415,7.525l40,35L201.585,207.473z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3canimateTransform%20attributeName='transform'%20attributeType='XML'%20type='rotate'%20from='0%20240%20240'%20to='360%20240%20240'%20dur='10s'%20repeatCount='indefinite'%20/%3e%3c/svg%3e",Ept="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2050%2050'%3e%3cpath%20d='M25%200C11.6%200%200%2011.6%200%2025s11.6%2025%2025%2025%2025-11.6%2025-25S40.4%200%2025%200zm0%2048C12.8%2048%202%2039.2%202%2025S12.8%202%2025%202s24%2010.8%2024%2024-10.8%2024-24%2024zm-4-33l-8%208%2018%2018%2030-30-8-8-22%2022L22%2016'%20fill='green'/%3e%3c/svg%3e",vpt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012%2019%206.41z'%20fill='red'/%3e%3c/svg%3e",cM="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20version='1.1'%20width='256'%20height='256'%20viewBox='0%200%20256%20256'%20xml:space='preserve'%3e%3cdefs%3e%3c/defs%3e%3cg%20style='stroke:%20white;%20stroke-width:%202px;%20stroke-dasharray:%20none;%20stroke-linecap:%20butt;%20stroke-linejoin:%20miter;%20stroke-miterlimit:%2010;%20fill:%20none;%20fill-rule:%20nonzero;%20opacity:%201;'%20transform='translate(1.4065934065934016%201.4065934065934016)%20scale(2.81%202.81)'%20%3e%3cpath%20d='M%2089.999%203.075%20C%2090%203.02%2090%202.967%2089.999%202.912%20c%20-0.004%20-0.134%20-0.017%20-0.266%20-0.038%20-0.398%20c%20-0.007%20-0.041%20-0.009%20-0.081%20-0.018%20-0.122%20c%20-0.034%20-0.165%20-0.082%20-0.327%20-0.144%20-0.484%20c%20-0.018%20-0.046%20-0.041%20-0.089%20-0.061%20-0.134%20c%20-0.053%20-0.119%20-0.113%20-0.234%20-0.182%20-0.346%20C%2089.528%201.382%2089.5%201.336%2089.469%201.29%20c%20-0.102%20-0.147%20-0.212%20-0.288%20-0.341%20-0.417%20c%20-0.13%20-0.13%20-0.273%20-0.241%20-0.421%20-0.344%20c%20-0.042%20-0.029%20-0.085%20-0.056%20-0.129%20-0.082%20c%20-0.118%20-0.073%20-0.239%20-0.136%20-0.364%20-0.191%20c%20-0.039%20-0.017%20-0.076%20-0.037%20-0.116%20-0.053%20c%20-0.161%20-0.063%20-0.327%20-0.113%20-0.497%20-0.147%20c%20-0.031%20-0.006%20-0.063%20-0.008%20-0.094%20-0.014%20c%20-0.142%20-0.024%20-0.285%20-0.038%20-0.429%20-0.041%20C%2087.03%200%2086.983%200%2086.936%200.001%20c%20-0.141%200.003%20-0.282%200.017%20-0.423%200.041%20c%20-0.035%200.006%20-0.069%200.008%20-0.104%200.015%20c%20-0.154%200.031%20-0.306%200.073%20-0.456%200.129%20L%201.946%2031.709%20c%20-1.124%200.422%20-1.888%201.473%20-1.943%202.673%20c%20-0.054%201.199%200.612%202.316%201.693%202.838%20l%2034.455%2016.628%20l%2016.627%2034.455%20C%2053.281%2089.344%2054.334%2090%2055.481%2090%20c%200.046%200%200.091%20-0.001%200.137%20-0.003%20c%201.199%20-0.055%202.251%20-0.819%202.673%20-1.943%20L%2089.815%204.048%20c%200.056%20-0.149%200.097%20-0.3%200.128%20-0.453%20c%200.008%20-0.041%200.011%20-0.081%200.017%20-0.122%20C%2089.982%203.341%2089.995%203.208%2089.999%203.075%20z%20M%2075.086%2010.672%20L%2037.785%2047.973%20L%2010.619%2034.864%20L%2075.086%2010.672%20z%20M%2055.136%2079.381%20L%2042.027%2052.216%20l%2037.302%20-37.302%20L%2055.136%2079.381%20z'%20style='stroke:%20none;%20stroke-width:%201;%20stroke-dasharray:%20none;%20stroke-linecap:%20butt;%20stroke-linejoin:%20miter;%20stroke-miterlimit:%2010;%20fill:%20rgb(0,0,0);%20fill-rule:%20nonzero;%20opacity:%201;'%20transform='%20matrix(1%200%200%201%200%200)%20'%20stroke-linecap='round'%20/%3e%3ccircle%20cx='75'%20cy='75'%20r='15'%20fill='%23008000'/%3e%3cpath%20d='M75,60%20A15,15%200%200,1%2090,75%20A15,15%200%200,1%2075,90%20A15,15%200%200,1%2060,75%20A15,15%200%200,1%2075,60%20Z'%20stroke='%23FFFFFF'%20stroke-width='2'%20fill='none'/%3e%3cpath%20d='M81,75%20A6,6%200%200,1%2075,81%20A6,6%200%200,1%2069,75%20A6,6%200%200,1%2075,69%20A6,6%200%200,1%2081,75%20Z'%20fill='%23FFFFFF'/%3e%3c/g%3e%3c/svg%3e",Spt="/",Tpt={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:lp,Step:bpt,RenderHTMLJS:$ut,JsonViewer:opt,DynamicUIRenderer:oM,ToolbarButton:P0,DropdownMenu:rM},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{ui_componentKey:0,isSynthesizingVoice:!1,cpp_block:YN,html5_block:$N,LaTeX_block:WN,json_block:qN,javascript_block:HN,process_svg:ypt,ok_svg:Ept,failed_svg:vpt,loading_svg:jN,sendGlobe:cM,code_block:VN,python_block:zN,bash_block:KN,audio_url:null,audio:null,msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode_:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){if("speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0?this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged):console.log("No voices found")):console.error("Speech synthesis is not supported in this browser."),Le(()=>{Ve.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight}),console.log("Checking metadata"),console.log(this.message),Object.prototype.hasOwnProperty.call(this.message,"metadata")&&this.message.metadata!=null){console.log("Metadata found!"),Array.isArray(this.message.metadata)||(this.message.metadata=[]),console.log(typeof this.message.metadata),console.log(this.message.metadata);for(let n of this.message.metadata)Object.prototype.hasOwnProperty.call(n,"audio_url")&&n.audio_url!=null&&(this.audio_url=n.audio_url,console.log("Audio URL:",this.audio_url))}},methods:{computeTimeDiff(n,e){let t=e.getTime()-n.getTime();const s=Math.floor(t/(1e3*60*60));t-=s*(1e3*60*60);const i=Math.floor(t/(1e3*60));t-=i*(1e3*60);const r=Math.floor(t/1e3);return t-=r*1e3,[s,i,r]},insertTab(n){const e=n.target,t=e.selectionStart,s=e.selectionEnd,i=n.shiftKey;if(t===s)if(i){if(e.value.substring(t-4,t)==" "){const r=e.value.substring(0,t-4),o=e.value.substring(s),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t-4})}}else{const r=e.value.substring(0,t),o=e.value.substring(s),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4})}else{const o=e.value.substring(t,s).split(` +Here is how you can do that`))},e[719]||(e[719]=[l("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)]))])]),l("tr",null,[e[721]||(e[721]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Petals service:")],-1)),l("td",null,[l("div",sct,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[407]||(e[407]=(...f)=>r.reinstallPetalsService&&r.reinstallPetalsService(...f))},"install petals service")])])]),l("tr",null,[e[722]||(e[722]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"petals base url:")],-1)),l("td",null,[l("div",ict,[D(l("input",{type:"text",id:"petals_base_url",required:"","onUpdate:modelValue":e[408]||(e[408]=f=>r.configFile.petals_base_url=f),onChange:e[409]||(e[409]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.petals_base_url]])])])])])]),_:1})]),_:1}),z(a,{title:"TTV settings",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",rct,[l("tr",null,[e[723]||(e[723]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"lumalabs_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Lumalabs key:")],-1)),l("td",null,[l("div",oct,[D(l("input",{type:"text",id:"lumalabs_key",required:"","onUpdate:modelValue":e[410]||(e[410]=f=>r.configFile.lumalabs_key=f),onChange:e[411]||(e[411]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.lumalabs_key]])])])])])]),_:1}),z(a,{title:"Misc",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[z(a,{title:"Elastic search Service (under construction)",is_subcard:!0,class:"pb-2 m-2"},{default:Ie(()=>[l("table",act,[l("tr",null,[e[724]||(e[724]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elastic_search_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable elastic search service:")],-1)),l("td",null,[l("div",lct,[D(l("input",{type:"checkbox",id:"elastic_search_service",required:"","onUpdate:modelValue":e[412]||(e[412]=f=>r.configFile.elastic_search_service=f),onChange:e[413]||(e[413]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[qe,r.configFile.elastic_search_service]])])])]),l("tr",null,[e[725]||(e[725]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"install_elastic_search_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reinstall Elastic Search service:")],-1)),l("td",null,[l("div",cct,[l("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[414]||(e[414]=(...f)=>r.reinstallElasticSearchService&&r.reinstallElasticSearchService(...f))},"install ElasticSearch service")])])]),l("tr",null,[e[726]||(e[726]=l("td",{style:{"min-width":"200px"}},[l("label",{for:"elastic_search_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"elastic search base url:")],-1)),l("td",null,[l("div",dct,[D(l("input",{type:"text",id:"elastic_search_url",required:"","onUpdate:modelValue":e[415]||(e[415]=f=>r.configFile.elastic_search_url=f),onChange:e[416]||(e[416]=f=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[ue,r.configFile.elastic_search_url]])])])])])]),_:1})]),_:1})],2)]),l("div",uct,[l("div",pct,[l("button",{onClick:e[417]||(e[417]=K(f=>i.bzc_collapsed=!i.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[D(l("div",null,e[727]||(e[727]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.bzc_collapsed]]),D(l("div",null,e[728]||(e[728]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.bzc_collapsed]]),e[730]||(e[730]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),r.configFile.binding_name?B("",!0):(T(),w("div",fct,e[729]||(e[729]=[l("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1),Ze(" No binding selected! ")]))),r.configFile.binding_name?(T(),w("div",_ct,"|")):B("",!0),r.configFile.binding_name?(T(),w("div",mct,[l("div",hct,[l("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,gct),l("p",bct,W(r.binding_name),1)])])):B("",!0)])]),l("div",{class:Ue([{hidden:i.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(T(),w("div",yct,[l("label",Ect," Bindings: ("+W(r.bindingsZoo.length)+") ",1),l("div",{class:Ue(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",i.bzl_collapsed?"":"max-h-96"])},[z(ri,{name:"list"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(r.bindingsZoo,(f,g)=>(T(),at(c,{ref_for:!0,ref:"bindingZoo",key:"index-"+g+"-"+f.folder,binding:f,"on-selected":r.onBindingSelected,"on-reinstall":r.onReinstallBinding,"on-unInstall":r.onUnInstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:f.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-unInstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):B("",!0),i.bzl_collapsed?(T(),w("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[418]||(e[418]=f=>i.bzl_collapsed=!i.bzl_collapsed)},e[731]||(e[731]=[l("i",{"data-feather":"chevron-up"},null,-1)]))):(T(),w("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[419]||(e[419]=f=>i.bzl_collapsed=!i.bzl_collapsed)},e[732]||(e[732]=[l("i",{"data-feather":"chevron-down"},null,-1)])))],2)]),l("div",vct,[l("div",Sct,[l("button",{onClick:e[420]||(e[420]=K(f=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[D(l("div",null,e[733]||(e[733]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.mzc_collapsed]]),D(l("div",null,e[734]||(e[734]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.mzc_collapsed]]),e[737]||(e[737]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),l("div",Tct,[r.configFile.binding_name?B("",!0):(T(),w("div",xct,e[735]||(e[735]=[l("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1),Ze(" Select binding first! ")]))),!r.configFile.model_name&&r.configFile.binding_name?(T(),w("div",Cct,e[736]||(e[736]=[l("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1),Ze(" No model selected! ")]))):B("",!0),r.configFile.model_name?(T(),w("div",wct,"|")):B("",!0),r.configFile.model_name?(T(),w("div",Rct,[l("div",Act,[l("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,Nct),l("p",Mct,W(r.configFile.model_name),1)])])):B("",!0)])])]),l("div",{class:Ue([{hidden:i.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[l("div",Oct,[l("div",Ict,[l("div",kct,[i.searchModelInProgress?(T(),w("div",Dct,e[738]||(e[738]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):B("",!0),i.searchModelInProgress?B("",!0):(T(),w("div",Lct,e[739]||(e[739]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])))]),D(l("input",{type:"search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search models...",required:"","onUpdate:modelValue":e[421]||(e[421]=f=>i.searchModel=f),onKeyup:e[422]||(e[422]=zs((...f)=>r.searchModel_func&&r.searchModel_func(...f),["enter"]))},null,544),[[ue,i.searchModel]]),i.searchModel?(T(),w("button",{key:0,onClick:e[423]||(e[423]=K(f=>i.searchModel="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):B("",!0)])]),l("div",null,[D(l("input",{"onUpdate:modelValue":e[424]||(e[424]=f=>i.show_only_installed_models=f),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[qe,i.show_only_installed_models]]),e[740]||(e[740]=l("label",{for:"only_installed"},"Show only installed models",-1))]),l("div",null,[z(d,{radioOptions:i.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),e[748]||(e[748]=l("a",{href:"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard",target:"_blank",class:"mb-4 font-bold underline text-blue-500 pb-4"},"Hugging face Leaderboard",-1)),i.is_loading_zoo?(T(),w("div",Pct,e[741]||(e[741]=[l("svg",{"aria-hidden":"true",class:"text-center w-full display: flex;align-items: center; h-20 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),l("p",{class:"heartbeat-text"},"Loading models Zoo",-1)]))):B("",!0),i.models_zoo&&i.models_zoo.length>0?(T(),w("div",Fct,[l("label",Uct," Models: ("+W(i.models_zoo.length)+") ",1),l("div",{class:Ue(["overflow-y-auto p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",i.mzl_collapsed?"":"max-h-96"])},[z(ri,{name:"list"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(r.rendered_models_zoo,(f,g)=>(T(),at(u,{ref_for:!0,ref:"modelZoo",key:"index-"+g+"-"+f.name,model:f,"is-installed":f.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onModelSelected,selected:f.name===r.configFile.model_name,model_type:f.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["model","is-installed","on-install","on-uninstall","on-selected","selected","model_type","on-copy","on-copy-link","on-cancel-install"]))),128)),l("button",{ref:"load_more_models",class:"relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",onClick:e[425]||(e[425]=(...f)=>r.load_more_models&&r.load_more_models(...f))},"Load more models",512)]),_:1})],2)])):B("",!0),i.mzl_collapsed?(T(),w("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[426]||(e[426]=(...f)=>r.open_mzl&&r.open_mzl(...f))},e[742]||(e[742]=[l("i",{"data-feather":"chevron-up"},null,-1)]))):(T(),w("button",{key:3,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[427]||(e[427]=(...f)=>r.open_mzl&&r.open_mzl(...f))},e[743]||(e[743]=[l("i",{"data-feather":"chevron-down"},null,-1)]))),l("div",Bct,[l("div",Gct,[l("div",null,[l("div",Vct,[e[744]||(e[744]=l("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),D(l("input",{type:"text","onUpdate:modelValue":e[428]||(e[428]=f=>i.reference_path=f),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter Path ...",required:""},null,512),[[ue,i.reference_path]])]),l("button",{type:"button",onClick:e[429]||(e[429]=K(f=>r.onCreateReference(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Add reference")]),i.modelDownlaodInProgress?B("",!0):(T(),w("div",zct,[l("div",Hct,[e[745]||(e[745]=l("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),D(l("input",{type:"text","onUpdate:modelValue":e[430]||(e[430]=f=>i.addModel.url=f),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter URL ...",required:""},null,512),[[ue,i.addModel.url]])]),l("button",{type:"button",onClick:e[431]||(e[431]=K(f=>r.onInstallAddModel(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Download")])),i.modelDownlaodInProgress?(T(),w("div",qct,[e[747]||(e[747]=l("div",{role:"status",class:"justify-center"},null,-1)),l("div",Yct,[l("div",$ct,[l("div",Wct,[e[746]||(e[746]=Pi(' Downloading Loading...',1)),l("span",Kct,W(Math.floor(i.addModel.progress))+"%",1)]),l("div",{class:"mx-1 opacity-80 line-clamp-1",title:i.addModel.url},W(i.addModel.url),9,jct),l("div",Qct,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Wt({width:i.addModel.progress+"%"})},null,4)]),l("div",Xct,[l("span",Zct,"Download speed: "+W(r.speed_computed)+"/s",1),l("span",Jct,W(r.downloaded_size_computed)+"/"+W(r.total_size_computed),1)])])]),l("div",edt,[l("div",tdt,[l("div",ndt,[l("button",{onClick:e[432]||(e[432]=K((...f)=>r.onCancelInstall&&r.onCancelInstall(...f),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])):B("",!0)])])],2)]),l("div",sdt,[l("div",idt,[l("button",{onClick:e[435]||(e[435]=K(f=>i.pzc_collapsed=!i.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[D(l("div",null,e[749]||(e[749]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.pzc_collapsed]]),D(l("div",null,e[750]||(e[750]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.pzc_collapsed]]),e[753]||(e[753]=l("p",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),r.configFile.personalities?(T(),w("div",rdt,"|")):B("",!0),l("div",odt,W(r.active_pesonality),1),r.configFile.personalities?(T(),w("div",adt,"|")):B("",!0),r.configFile.personalities?(T(),w("div",ldt,[r.mountedPersArr.length>0?(T(),w("div",cdt,[(T(!0),w(Be,null,Xe(r.mountedPersArr,(f,g)=>(T(),w("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:g+"-"+f.name,ref_for:!0,ref:"mountedPersonalities"},[l("div",ddt,[l("button",{onClick:K(b=>r.onPersonalitySelected(f),["stop"])},[l("img",{src:i.bUrl+f.avatar,onError:e[433]||(e[433]=(...b)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...b)),class:Ue(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary",r.configFile.active_personality_id==r.configFile.personalities.indexOf(f.full_path)?"border-secondary":"border-transparent z-0"]),title:f.name},null,42,pdt)],8,udt),l("button",{onClick:K(b=>r.unmountPersonality(f),["stop"])},e[751]||(e[751]=[l("span",{class:"hidden group-hover:block -top-2 -right-1 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[l("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1)]),8,fdt)])]))),128))])):B("",!0)])):B("",!0),l("button",{onClick:e[434]||(e[434]=K(f=>r.unmountAll(),["stop"])),class:"bg-bg-light hover:border-green-200 ml-5 dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount All"},e[752]||(e[752]=[l("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)]))])]),l("div",{class:Ue([{hidden:i.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[l("div",_dt,[e[756]||(e[756]=l("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),l("div",mdt,[l("div",hdt,[i.searchPersonalityInProgress?(T(),w("div",gdt,e[754]||(e[754]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):B("",!0),i.searchPersonalityInProgress?B("",!0):(T(),w("div",bdt,e[755]||(e[755]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])))]),D(l("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search personality...",required:"","onUpdate:modelValue":e[436]||(e[436]=f=>i.searchPersonality=f),onKeyup:e[437]||(e[437]=K((...f)=>r.searchPersonality_func&&r.searchPersonality_func(...f),["stop"]))},null,544),[[ue,i.searchPersonality]]),i.searchPersonality?(T(),w("button",{key:0,onClick:e[438]||(e[438]=K(f=>i.searchPersonality="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):B("",!0)])]),i.searchPersonality?B("",!0):(T(),w("div",ydt,[l("label",Edt," Personalities Category: ("+W(i.persCatgArr.length)+") ",1),l("select",{id:"persCat",onChange:e[439]||(e[439]=f=>r.update_personality_category(f.target.value,r.refresh)),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(T(!0),w(Be,null,Xe(i.persCatgArr,(f,g)=>(T(),w("option",{key:g,selected:f==this.configFile.personality_category},W(f),9,vdt))),128))],32)])),l("div",null,[i.personalitiesFiltered.length>0?(T(),w("div",Sdt,[l("label",Tdt,W(i.searchPersonality?"Search results":"Personalities")+": ("+W(i.personalitiesFiltered.length)+") ",1),l("div",{class:Ue(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",i.pzl_collapsed?"":"max-h-96"])},[z(ri,{name:"bounce"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(i.personalitiesFiltered,(f,g)=>(T(),at(_,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+g+"-"+f.name,personality:f,select_language:!0,full_path:f.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(b=>b===f.full_path||b===f.full_path+":"+f.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality,"on-copy-personality-name":r.onCopyPersonalityName,"on-copy-to_custom":r.onCopyToCustom,"on-open-folder":r.handleOpenFolder},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder"]))),128))]),_:1})],2)])):B("",!0)]),i.pzl_collapsed?(T(),w("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[440]||(e[440]=f=>i.pzl_collapsed=!i.pzl_collapsed)},e[757]||(e[757]=[l("i",{"data-feather":"chevron-up"},null,-1)]))):(T(),w("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[441]||(e[441]=f=>i.pzl_collapsed=!i.pzl_collapsed)},e[758]||(e[758]=[l("i",{"data-feather":"chevron-down"},null,-1)])))],2)]),l("div",xdt,[l("div",Cdt,[l("button",{onClick:e[442]||(e[442]=K(f=>i.mc_collapsed=!i.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[D(l("div",null,e[759]||(e[759]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,i.mc_collapsed]]),D(l("div",null,e[760]||(e[760]=[l("i",{"data-feather":"chevron-down"},null,-1)]),512),[[xt,!i.mc_collapsed]]),e[761]||(e[761]=l("p",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1))])]),l("div",{class:Ue([{hidden:i.mc_collapsed},"flex flex-col mb-2 p-2"])},[l("div",wdt,[l("div",Rdt,[D(l("input",{id:"override-model-parameters",type:"checkbox",class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[443]||(e[443]=K(()=>{},["stop"])),"onUpdate:modelValue":e[444]||(e[444]=f=>r.configFile.override_personality_model_parameters=f),onChange:e[445]||(e[445]=f=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[qe,r.configFile.override_personality_model_parameters]]),e[762]||(e[762]=l("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1))])]),l("div",{class:Ue(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[l("div",Adt,[e[763]||(e[763]=l("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),D(l("input",{type:"text",id:"seed","onUpdate:modelValue":e[446]||(e[446]=f=>r.configFile.seed=f),class:"bg-gray-50 border border-gray-300 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,512),[[ue,r.configFile.seed]])]),l("div",Ndt,[l("div",Mdt,[l("div",Odt,[e[764]||(e[764]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),l("p",Idt,[D(l("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[447]||(e[447]=f=>r.configFile.temperature=f),onChange:e[448]||(e[448]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.temperature]])])]),D(l("input",{id:"temperature",onChange:e[449]||(e[449]=f=>i.settingsChanged=!0),type:"range","onUpdate:modelValue":e[450]||(e[450]=f=>r.configFile.temperature=f),min:"0",max:"5",step:"0.1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.temperature]])])]),l("div",kdt,[l("div",Ddt,[l("div",Ldt,[e[765]||(e[765]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),l("p",Pdt,[D(l("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[451]||(e[451]=f=>r.configFile.n_predict=f),onChange:e[452]||(e[452]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.n_predict]])])]),D(l("input",{id:"predict",type:"range",onChange:e[453]||(e[453]=f=>i.settingsChanged=!0),"onUpdate:modelValue":e[454]||(e[454]=f=>r.configFile.n_predict=f),min:"0",max:"2048",step:"32",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.n_predict]])])]),l("div",Fdt,[l("div",Udt,[l("div",Bdt,[e[766]||(e[766]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),l("p",Gdt,[D(l("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[455]||(e[455]=f=>r.configFile.top_k=f),onChange:e[456]||(e[456]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.top_k]])])]),D(l("input",{id:"top_k",type:"range",onChange:e[457]||(e[457]=f=>i.settingsChanged=!0),"onUpdate:modelValue":e[458]||(e[458]=f=>r.configFile.top_k=f),min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.top_k]])])]),l("div",Vdt,[l("div",zdt,[l("div",Hdt,[e[767]||(e[767]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),l("p",qdt,[D(l("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[459]||(e[459]=f=>r.configFile.top_p=f),onChange:e[460]||(e[460]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.top_p]])])]),D(l("input",{id:"top_p",type:"range","onUpdate:modelValue":e[461]||(e[461]=f=>r.configFile.top_p=f),min:"0",max:"1",step:"0.01",onChange:e[462]||(e[462]=f=>i.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.top_p]])])]),l("div",Ydt,[l("div",$dt,[l("div",Wdt,[e[768]||(e[768]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),l("p",Kdt,[D(l("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[463]||(e[463]=f=>r.configFile.repeat_penalty=f),onChange:e[464]||(e[464]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.repeat_penalty]])])]),D(l("input",{id:"repeat_penalty",onChange:e[465]||(e[465]=f=>i.settingsChanged=!0),type:"range","onUpdate:modelValue":e[466]||(e[466]=f=>r.configFile.repeat_penalty=f),min:"0",max:"2",step:"0.01",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.repeat_penalty]])])]),l("div",jdt,[l("div",Qdt,[l("div",Xdt,[e[769]||(e[769]=l("p",{class:"absolute left-0 mt-6"},[l("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),l("p",Zdt,[D(l("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[467]||(e[467]=f=>r.configFile.repeat_last_n=f),onChange:e[468]||(e[468]=f=>i.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.repeat_last_n]])])]),D(l("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[469]||(e[469]=f=>r.configFile.repeat_last_n=f),min:"0",max:"100",step:"1",onChange:e[470]||(e[470]=f=>i.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[ue,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),z(m,{ref:"addmodeldialog"},null,512),z(h,{class:"z-20",show:i.variantSelectionDialogVisible,choices:i.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const eut=it(tit,[["render",Jdt],["__scopeId","data-v-ebfd9309"]]),tut={components:{ClipBoardTextInput:L0,Card:pp},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const n={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};Z.post("/start_training",n).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(n){const e=n.target.files;e.length>0&&(this.selectedDataset=e[0])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(n){console.log("watching model_name",n),this.$refs.clipboardInput.inputValue=n}}},nut={key:0,class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},sut={class:"mb-4"},iut=["value"],rut={class:"mb-4"},out={class:"mb-4"},aut={class:"mb-4"},lut={class:"mb-4"},cut={class:"mb-4"},dut={class:"mb-4"},uut={key:1};function put(n,e,t,s,i,r){const o=et("Card"),a=et("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(T(),w("div",nut,[l("form",{onSubmit:e[2]||(e[2]=K((...c)=>r.submitForm&&r.submitForm(...c),["prevent"])),class:""},[z(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[z(o,{title:"Model",class:"",isHorizontal:!1},{default:Ie(()=>[l("div",sut,[e[3]||(e[3]=l("label",{for:"model_name",class:"text-sm"},"Model Name:",-1)),D(l("select",{"onUpdate:modelValue":e[0]||(e[0]=c=>r.selectedModel=c),onChange:e[1]||(e[1]=(...c)=>n.setModel&&n.setModel(...c)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(T(!0),w(Be,null,Xe(r.models,c=>(T(),w("option",{key:c,value:c},W(c),9,iut))),128))],544),[[It,r.selectedModel]])])]),_:1}),z(o,{title:"Data",isHorizontal:!1},{default:Ie(()=>[l("div",rut,[e[4]||(e[4]=l("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1)),z(a,{id:"model_path",inputType:"file",value:i.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),z(o,{title:"Training",isHorizontal:!1},{default:Ie(()=>[l("div",out,[e[5]||(e[5]=l("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1)),z(a,{id:"model_path",inputType:"integer",value:i.lr},null,8,["value"])]),l("div",aut,[e[6]||(e[6]=l("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1)),z(a,{id:"model_path",inputType:"integer",value:i.num_epochs},null,8,["value"])]),l("div",lut,[e[7]||(e[7]=l("label",{for:"max_length",class:"text-sm"},"Max Length:",-1)),z(a,{id:"model_path",inputType:"integer",value:i.max_length},null,8,["value"])]),l("div",cut,[e[8]||(e[8]=l("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1)),z(a,{id:"model_path",inputType:"integer",value:i.batch_size},null,8,["value"])])]),_:1}),z(o,{title:"Output",isHorizontal:!1},{default:Ie(()=>[l("div",dut,[e[9]||(e[9]=l("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1)),z(a,{id:"model_path",inputType:"text",value:n.output_dir},null,8,["value"])])]),_:1})]),_:1}),z(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>e[10]||(e[10]=[l("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1)])),_:1})],32)])):(T(),w("div",uut,[z(o,{title:"Info",class:"",isHorizontal:!1},{default:Ie(()=>e[11]||(e[11]=[Ze(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")])),_:1})]))}const fut=it(tut,[["render",put]]),_ut={components:{ClipBoardTextInput:L0,Card:pp},data(){return{model_name:"jondurbin/airoboros-7b-gpt4",tokenizer_name:"jondurbin/airoboros-7b-gpt4",dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDatasetPath:""}},methods:{submitForm(){this.model_name,this.tokenizer_name,this.selectedDatasetPath,this.max_length,this.batch_size,this.lr,this.num_epochs,this.selectedFolder},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(n){const e=n.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},mut={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},hut={class:"mb-4"},gut={class:"mb-4"};function but(n,e,t,s,i,r){const o=et("ClipBoardTextInput"),a=et("Card");return T(),w("div",mut,[l("form",{onSubmit:e[0]||(e[0]=K((...c)=>r.submitForm&&r.submitForm(...c),["prevent"])),class:"max-w-md mx-auto"},[z(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[z(a,{title:"Model",class:"",isHorizontal:!1},{default:Ie(()=>[l("div",hut,[e[1]||(e[1]=l("label",{for:"model_name",class:"text-sm"},"Model Name:",-1)),z(o,{id:"model_path",inputType:"text",value:i.model_name},null,8,["value"])]),l("div",gut,[e[2]||(e[2]=l("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1)),z(o,{id:"model_path",inputType:"text",value:i.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),z(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>e[3]||(e[3]=[l("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1)])),_:1})],32)])}const yut=it(_ut,[["render",but]]),Eut={name:"Discussion",emits:["delete","select","openFolder","editTitle","makeTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,makeTitleMode:!1,deleteMode:!1,openFolder:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{cancel(){this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1},deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},openFolderEvent(){this.$emit("openFolder",{id:this.id})},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},makeTitleEvent(){this.$emit("makeTitle",{id:this.id}),this.showConfirmation=!1},chnageTitle(n){this.newTitle=n},checkedChangeEvent(n,e){this.$emit("checked",n,e)}},mounted(){this.newTitle=this.title,Le(()=>{Ve.replace()})},watch:{showConfirmation(){Le(()=>{Ve.replace()})},editTitleMode(n){this.showConfirmation=n,this.editTitle=n,n&&Le(()=>{try{this.$refs.titleBox.focus()}catch{}})},deleteMode(n){this.showConfirmation=n,n&&Le(()=>{this.$refs.titleBox.focus()})},makeTitleMode(n){this.showConfirmation=n},checkBoxValue(n,e){this.checkBoxValue_local=n}}},vut=["id"],Sut={class:"flex flex-row items-center gap-2"},Tut={key:0},xut={class:"flex flex-row items-center w-full"},Cut=["title"],wut=["value"],Rut={class:"flex items-center flex-1 max-h-6"},Aut={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Nut={key:1,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"};function Mut(n,e,t,s,i,r){return T(),w("div",{class:Ue([t.selected?"discussion-hilighted shadow-md min-w-[23rem] max-w-[23rem]":"discussion min-w-[23rem] max-w-[23rem]","m-1 py-2 flex flex-row sm:flex-row flex-wrap flex-shrink: 0 item-center shadow-sm hover:shadow-md rounded-md duration-75 group cursor-pointer"]),id:"dis-"+t.id,onClick:e[13]||(e[13]=K(o=>r.selectEvent(),["stop"]))},[l("div",Sut,[t.isCheckbox?(T(),w("div",Tut,[D(l("input",{type:"checkbox",class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[0]||(e[0]=K(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>i.checkBoxValue_local=o),onInput:e[2]||(e[2]=o=>r.checkedChangeEvent(o,t.id))},null,544),[[qe,i.checkBoxValue_local]])])):B("",!0),t.selected?(T(),w("div",{key:1,class:Ue(["min-h-full w-2 rounded-xl self-stretch",t.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):B("",!0),t.selected?B("",!0):(T(),w("div",{key:2,class:Ue(["w-2",t.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),l("div",xut,[i.editTitle?B("",!0):(T(),w("p",{key:0,title:t.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},W(t.title?t.title==="untitled"?"New discussion":t.title:"New discussion"),9,Cut)),i.editTitle?(T(),w("input",{key:1,type:"text",id:"title-box",ref:"titleBox",class:"bg-bg-light dark:bg-bg-dark rounded-md border-0 w-full -m-1 p-1",value:t.title,required:"",onKeydown:[e[3]||(e[3]=zs(K(o=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=zs(K(o=>i.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>r.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=K(()=>{},["stop"]))},null,40,wut)):B("",!0),l("div",Rut,[i.showConfirmation?(T(),w("div",Aut,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[7]||(e[7]=K(o=>r.cancel(),["stop"]))},e[14]||(e[14]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[8]||(e[8]=K(o=>i.editTitleMode?r.editTitleEvent():i.deleteMode?r.deleteEvent():r.makeTitleEvent(),["stop"]))},e[15]||(e[15]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),i.showConfirmation?B("",!0):(T(),w("div",Nut,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Open folder",type:"button",onClick:e[9]||(e[9]=K(o=>r.openFolderEvent(),["stop"]))},e[16]||(e[16]=[l("i",{"data-feather":"folder"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Make a title",type:"button",onClick:e[10]||(e[10]=K(o=>i.makeTitleMode=!0,["stop"]))},e[17]||(e[17]=[l("i",{"data-feather":"type"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[11]||(e[11]=K(o=>i.editTitleMode=!0,["stop"]))},e[18]||(e[18]=[l("i",{"data-feather":"edit-2"},null,-1)])),l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[12]||(e[12]=K(o=>i.deleteMode=!0,["stop"]))},e[19]||(e[19]=[l("i",{"data-feather":"trash"},null,-1)]))]))])])],10,vut)}const W0=it(Eut,[["render",Mut]]),Out={data(){return{show:!1,prompt:"",inputText:""}},methods:{showPanel(){this.show=!0},ok(){this.show=!1,this.$emit("ok",this.inputText)},cancel(){this.show=!1,this.inputText=""}},props:{promptText:{type:String,required:!0}},watch:{promptText(n){this.prompt=n}}},Iut={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},kut={class:"bg-white p-8 rounded"},Dut={class:"text-xl font-bold mb-4"};function Lut(n,e,t,s,i,r){return T(),w("div",null,[i.show?(T(),w("div",Iut,[l("div",kut,[l("h2",Dut,W(t.promptText),1),D(l("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>i.inputText=o),class:"border border-gray-300 px-4 py-2 rounded mb-4"},null,512),[[ue,i.inputText]]),l("button",{onClick:e[1]||(e[1]=(...o)=>r.ok&&r.ok(...o)),class:"bg-blue-500 text-white px-4 py-2 rounded mr-2"},"OK"),l("button",{onClick:e[2]||(e[2]=(...o)=>r.cancel&&r.cancel(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"Cancel")])])):B("",!0)])}const aM=it(Out,[["render",Lut]]),Put={data(){return{id:0,loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:W0,MarkdownRenderer:lp},props:{host:{type:String,required:!1,default:"http://localhost:9600"}},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchTitles()},closeComponent(){this.isVisible=!1},fetchCategories(){Z.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(n=>{this.categories=n.data.categories}).catch(n=>{console.error("Error fetching categories:",n)})},fetchTitles(){console.log("Fetching categories"),Z.post("/get_skills_library_titles",{client_id:this.$store.state.client_id}).then(n=>{this.titles=n.data.titles,console.log("titles recovered")}).catch(n=>{console.error("Error fetching titles:",n)})},fetchContent(n){Z.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:n}).then(e=>{const t=e.data.contents[0];this.id=t.id,this.content=t.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(n){console.log("Delete category")},editCategory(n){console.log("Edit category")},checkUncheckCategory(n){console.log("Unchecked category")},deleteSkill(n){console.log("Delete skill ",n),Z.post("/delete_skill",{client_id:this.$store.state.client_id,skill_id:n}).then(()=>{this.fetchTitles()})},editTitle(n){Z.post("/edit_skill_title",{client_id:this.$store.state.client_id,skill_id:n,title:n}).then(()=>{this.fetchTitles()}),console.log("Edit title")},makeTitle(n){console.log("Make title")},checkUncheckTitle(n){},searchSkills(){}}},Fut={id:"leftPanel",class:"flex flex-row h-full flex-grow shadow-lg rounded"},Uut={class:"min-w-[23rem] max-w-[23rem] z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md overflow-y-scroll no-scrollbar"},But={class:"search p-4"},Gut={classclass:"absolute flex flex-col no-scrollbar shadow-lg min-w-[24rem] max-w-[24rem] bg-bg-light-tone dark:bg-bg-dark-tone top-20 left-20 bottom-20 right-20 bg-bg-light shadow-lg rounded"},Vut={class:"z-0 flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"};function zut(n,e,t,s,i,r){const o=et("Discussion"),a=et("MarkdownRenderer");return T(),w("div",{class:Ue([{hidden:!i.isVisible},"absolute flex flex-col no-scrollbar shadow-lg bg-bg-light dark:bg-bg-dark top-20 left-20 bottom-20 right-20 shadow-lg rounded"])},[l("div",Fut,[l("div",Uut,[l("div",But,[D(l("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=c=>i.searchQuery=c),placeholder:"Search skills",class:"border border-gray-300 rounded px-2 py-1 mr-2"},null,512),[[ue,i.searchQuery]]),l("button",{onClick:e[1]||(e[1]=(...c)=>r.searchSkills&&r.searchSkills(...c)),class:"bg-blue-500 text-white rounded px-4 py-1"},"Search")]),l("div",Gut,[e[3]||(e[3]=l("h2",{class:"text-xl font-bold m-4"},"Titles",-1)),i.titles.length>0?(T(),at(ri,{key:0,name:"list"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(i.titles,c=>(T(),at(o,{key:c.id,id:c.id,title:c.title,selected:r.fetchContent(c.id),loading:i.loading,isCheckbox:i.isCheckbox,checkBoxValue:!1,onSelect:d=>r.fetchContent(c.id),onDelete:d=>r.deleteSkill(c.id),onEditTitle:r.editTitle,onMakeTitle:r.makeTitle,onChecked:r.checkUncheckTitle},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):B("",!0)])]),l("div",Vut,[e[4]||(e[4]=l("h2",{class:"text-xl font-bold m-4"},"Content",-1)),z(a,{host:t.host,"markdown-text":i.content,message_id:i.id,discussion_id:i.id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])])]),l("button",{onClick:e[2]||(e[2]=(...c)=>r.closeComponent&&r.closeComponent(...c)),class:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1 hover:bg-red-300"},"Close")],2)}const lM=it(Put,[["render",zut]]),Hut={props:{htmlContent:{type:String,required:!0}}},qut=["innerHTML"];function Yut(n,e,t,s,i,r){return T(),w("div",{class:"w-full h-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",innerHTML:t.htmlContent},null,8,qut)}const $ut=it(Hut,[["render",Yut]]),Wut={name:"JsonTreeView",props:{data:{type:[Object,Array],required:!0},depth:{type:Number,default:0}},data(){return{collapsedKeys:new Set}},methods:{isObject(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)},isArray(n){return Array.isArray(n)},toggleCollapse(n){this.collapsedKeys.has(n)?this.collapsedKeys.delete(n):this.collapsedKeys.add(n)},isCollapsed(n){return this.collapsedKeys.has(n)},getValueType(n){return typeof n=="string"?"string":typeof n=="number"?"number":typeof n=="boolean"?"boolean":n===null?"null":""},formatValue(n){return typeof n=="string"?`"${n}"`:String(n)}}},Kut={class:"json-tree-view"},jut=["onClick"],Qut={key:0,class:"toggle-icon"},Xut={class:"key"},Zut={key:0,class:"json-nested"};function Jut(n,e,t,s,i,r){const o=et("json-tree-view",!0);return T(),w("div",Kut,[(T(!0),w(Be,null,Xe(t.data,(a,c)=>(T(),w("div",{key:c,class:"json-item"},[l("div",{class:"json-key",onClick:d=>r.toggleCollapse(c)},[r.isObject(a)||r.isArray(a)?(T(),w("span",Qut,[l("i",{class:Ue(r.isCollapsed(c)?"fas fa-chevron-right":"fas fa-chevron-down")},null,2)])):B("",!0),l("span",Xut,W(c)+":",1),!r.isObject(a)&&!r.isArray(a)?(T(),w("span",{key:1,class:Ue(["value",r.getValueType(a)])},W(r.formatValue(a)),3)):B("",!0)],8,jut),(r.isObject(a)||r.isArray(a))&&!r.isCollapsed(c)?(T(),w("div",Zut,[z(o,{data:a,depth:t.depth+1},null,8,["data","depth"])])):B("",!0)]))),128))])}const ept=it(Wut,[["render",Jut],["__scopeId","data-v-40406ec6"]]),tpt={components:{JsonTreeView:ept},props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Viewer"}},data(){return{collapsed:!0}},computed:{isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")},parsedJsonData(){if(typeof this.jsonData=="string")try{return JSON.parse(this.jsonData)}catch(n){return console.error("Error parsing JSON string:",n),{error:"Invalid JSON string"}}return this.jsonData}},methods:{toggleCollapsible(){this.collapsed=!this.collapsed}}},npt={key:0,class:"json-viewer"},spt={class:"toggle-icon"},ipt={class:"json-content panels-color"};function rpt(n,e,t,s,i,r){const o=et("json-tree-view");return r.isContentPresent?(T(),w("div",npt,[l("div",{class:"collapsible-section",onClick:e[0]||(e[0]=(...a)=>r.toggleCollapsible&&r.toggleCollapsible(...a))},[l("span",spt,[l("i",{class:Ue(i.collapsed?"fas fa-chevron-right":"fas fa-chevron-down")},null,2)]),Ze(" "+W(t.jsonFormText),1)]),D(l("div",ipt,[z(o,{data:r.parsedJsonData,depth:0},null,8,["data"])],512),[[xt,!i.collapsed]])])):B("",!0)}const opt=it(tpt,[["render",rpt],["__scopeId","data-v-83fc9727"]]),apt={props:{done:{type:Boolean,default:!1},text:{type:String,default:""},status:{type:Boolean,default:!1},step_type:{type:String,default:"start_end"},description:{type:String,default:""}},mounted(){this.amounted()},methods:{amounted(){console.log("Component mounted with the following properties:"),console.log("done:",this.done),console.log("text:",this.text),console.log("status:",this.status),console.log("step_type:",this.step_type),console.log("description:",this.description)}},watch:{done(n){typeof n!="boolean"&&console.error("Invalid type for done. Expected Boolean.")},status(n){typeof n!="boolean"&&console.error("Invalid type for status. Expected Boolean."),this.done&&!n&&console.error("Task completed with errors.")}}},lpt={class:"step-container"},cpt={class:"step-icon"},dpt={key:0},upt={key:0},ppt={key:1},fpt={key:2},_pt={key:1},mpt={class:"step-content"},hpt={key:0,class:"step-description"};function gpt(n,e,t,s,i,r){return T(),w("div",lpt,[l("div",{class:Ue(["step-wrapper transition-all duration-300 ease-in-out",{"bg-green-100 dark:bg-green-900":t.done&&t.status,"bg-red-100 dark:bg-red-900":t.done&&!t.status,"bg-gray-100 dark:bg-gray-800":!t.done}])},[l("div",cpt,[t.step_type==="start_end"?(T(),w("div",dpt,[t.done?t.done&&t.status?(T(),w("div",ppt,e[1]||(e[1]=[l("i",{"data-feather":"check-circle",class:"feather-icon text-green-600 dark:text-green-400"},null,-1)]))):(T(),w("div",fpt,e[2]||(e[2]=[l("i",{"data-feather":"x-circle",class:"feather-icon text-red-600 dark:text-red-400"},null,-1)]))):(T(),w("div",upt,e[0]||(e[0]=[l("i",{"data-feather":"circle",class:"feather-icon text-gray-600 dark:text-gray-300"},null,-1)])))])):B("",!0),t.done?B("",!0):(T(),w("div",_pt,e[3]||(e[3]=[l("div",{class:"spinner"},null,-1)])))]),l("div",mpt,[l("h3",{class:Ue(["step-text",{"text-green-600 dark:text-green-400":t.done&&t.status,"text-red-600 dark:text-red-400":t.done&&!t.status,"text-gray-800 dark:text-gray-200":!t.done}])},W(t.text||"No text provided"),3),t.description?(T(),w("p",hpt,W(t.description||"No description provided"),1)):B("",!0)])],2)])}const bpt=it(apt,[["render",gpt],["__scopeId","data-v-78f415f6"]]),ypt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20480%20480'%20xml:space='preserve'%3e%3cg%3e%3cg%3e%3cg%3e%3cpath%20d='M240,0C107.664,0,0,107.664,0,240s107.664,240,240,240s240-107.664,240-240S372.336,0,240,0z%20M240,460%20c-121.309,0-220-98.691-220-220S118.691,20,240,20s220,98.691,220,220S361.309,460,240,460z'/%3e%3cpath%20d='M410,194.999h-27.058c-2.643-8.44-6-16.56-10.03-24.271l19.158-19.158c3.776-3.775,5.854-8.79,5.854-14.121%20c0-5.332-2.08-10.347-5.854-14.121l-35.399-35.399c-3.775-3.775-8.79-5.854-14.122-5.854c-5.331,0-10.346,2.079-14.121,5.854%20l-19.158,19.158c-7.711-4.03-15.832-7.386-24.271-10.03V70c0-11.028-8.972-20-20-20h-50c-11.028,0-20,8.972-20,20v27.058%20c-8.44,2.643-16.56,6-24.271,10.03L151.57,87.93c-3.775-3.776-8.79-5.854-14.121-5.854c-5.332,0-10.347,2.08-14.121,5.854%20l-35.399,35.399c-3.775,3.775-5.854,8.79-5.854,14.122c0,5.331,2.079,10.346,5.854,14.121l19.158,19.158%20c-4.03,7.711-7.386,15.832-10.03,24.271H70c-11.028,0-20,8.972-20,20v50c0,11.028,8.972,20,20,20h27.057%20c2.643,8.44,6,16.56,10.03,24.271L87.929,328.43c-3.776,3.775-5.854,8.79-5.854,14.121c0,5.332,2.08,10.347,5.854,14.121%20l35.399,35.399c3.775,3.775,8.79,5.854,14.122,5.854c5.331,0,10.346-2.079,14.121-5.854l19.158-19.158%20c7.711,4.03,15.832,7.386,24.271,10.03V410c0,11.028,8.972,20,20,20h50c11.028,0,20-8.972,20.001-20v-27.058%20c8.44-2.643,16.56-6,24.271-10.03l19.158,19.158c3.775,3.776,8.79,5.854,14.121,5.854c5.332,0,10.347-2.08,14.121-5.854%20l35.399-35.399c3.775-3.775,5.854-8.79,5.854-14.122c0-5.331-2.079-10.346-5.854-14.121l-19.158-19.158%20c4.03-7.711,7.386-15.832,10.03-24.271H410c11.028,0,20-8.972,20-20v-50C430,203.971,421.028,194.999,410,194.999z%20M410,264.998%20h-34.598c-4.562,0-8.544,3.086-9.684,7.503c-3.069,11.901-7.716,23.133-13.813,33.387c-2.337,3.931-1.71,8.948,1.524,12.182%20l24.5,24.457l-35.357,35.4l-24.5-24.5c-3.236-3.235-8.253-3.86-12.182-1.524c-10.254,6.097-21.487,10.745-33.387,13.813%20c-4.417,1.14-7.503,5.122-7.503,9.684V410h-50v-34.599c0-4.562-3.086-8.544-7.503-9.684%20c-11.901-3.069-23.133-7.716-33.387-13.813c-1.587-0.944-3.353-1.404-5.107-1.404c-2.586,0-5.147,1.002-7.073,2.931l-24.457,24.5%20l-35.4-35.357l24.5-24.5c3.234-3.235,3.861-8.251,1.524-12.182c-6.097-10.254-10.745-21.487-13.813-33.387%20c-1.14-4.417-5.122-7.503-9.684-7.503H70v-50h34.596c4.562,0,8.544-3.086,9.684-7.503c3.069-11.901,7.716-23.133,13.813-33.387%20c2.337-3.931,1.71-8.948-1.524-12.182l-24.5-24.457l35.357-35.4l24.5,24.5c3.236,3.235,8.253,3.861,12.182,1.524%20c10.254-6.097,21.487-10.745,33.387-13.813c4.417-1.14,7.503-5.122,7.503-9.684V70h50v34.596c0,4.562,3.086,8.544,7.503,9.684%20c11.901,3.069,23.133,7.716,33.387,13.813c3.929,2.337,8.947,1.709,12.182-1.524l24.457-24.5l35.4,35.357l-24.5,24.5%20c-3.234,3.235-3.861,8.251-1.524,12.182c6.097,10.254,10.745,21.487,13.813,33.387c1.14,4.417,5.122,7.503,9.684,7.503H410%20V264.998z'/%3e%3cpath%20d='M331.585,292.475l-40-35l-13.17,15.051L298.386,290H240c-27.57,0-50-22.43-50-50h-20c0,38.598,31.402,70,70,70h58.386%20l-19.971,17.475l13.17,15.051l40-35c2.17-1.898,3.415-4.642,3.415-7.525S333.755,294.373,331.585,292.475z'/%3e%3cpath%20d='M201.585,207.473L181.614,190H240c27.57,0,50,22.43,50,50h20c0-38.598-31.402-70-70-70h-58.386l19.971-17.475%20l-13.17-15.051l-40,35c-2.17,1.898-3.415,4.642-3.415,7.525s1.245,5.627,3.415,7.525l40,35L201.585,207.473z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3canimateTransform%20attributeName='transform'%20attributeType='XML'%20type='rotate'%20from='0%20240%20240'%20to='360%20240%20240'%20dur='10s'%20repeatCount='indefinite'%20/%3e%3c/svg%3e",Ept="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2050%2050'%3e%3cpath%20d='M25%200C11.6%200%200%2011.6%200%2025s11.6%2025%2025%2025%2025-11.6%2025-25S40.4%200%2025%200zm0%2048C12.8%2048%202%2039.2%202%2025S12.8%202%2025%202s24%2010.8%2024%2024-10.8%2024-24%2024zm-4-33l-8%208%2018%2018%2030-30-8-8-22%2022L22%2016'%20fill='green'/%3e%3c/svg%3e",vpt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M0%200h24v24H0z'%20fill='none'/%3e%3cpath%20d='M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012%2019%206.41z'%20fill='red'/%3e%3c/svg%3e",cM="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20version='1.1'%20width='256'%20height='256'%20viewBox='0%200%20256%20256'%20xml:space='preserve'%3e%3cdefs%3e%3c/defs%3e%3cg%20style='stroke:%20white;%20stroke-width:%202px;%20stroke-dasharray:%20none;%20stroke-linecap:%20butt;%20stroke-linejoin:%20miter;%20stroke-miterlimit:%2010;%20fill:%20none;%20fill-rule:%20nonzero;%20opacity:%201;'%20transform='translate(1.4065934065934016%201.4065934065934016)%20scale(2.81%202.81)'%20%3e%3cpath%20d='M%2089.999%203.075%20C%2090%203.02%2090%202.967%2089.999%202.912%20c%20-0.004%20-0.134%20-0.017%20-0.266%20-0.038%20-0.398%20c%20-0.007%20-0.041%20-0.009%20-0.081%20-0.018%20-0.122%20c%20-0.034%20-0.165%20-0.082%20-0.327%20-0.144%20-0.484%20c%20-0.018%20-0.046%20-0.041%20-0.089%20-0.061%20-0.134%20c%20-0.053%20-0.119%20-0.113%20-0.234%20-0.182%20-0.346%20C%2089.528%201.382%2089.5%201.336%2089.469%201.29%20c%20-0.102%20-0.147%20-0.212%20-0.288%20-0.341%20-0.417%20c%20-0.13%20-0.13%20-0.273%20-0.241%20-0.421%20-0.344%20c%20-0.042%20-0.029%20-0.085%20-0.056%20-0.129%20-0.082%20c%20-0.118%20-0.073%20-0.239%20-0.136%20-0.364%20-0.191%20c%20-0.039%20-0.017%20-0.076%20-0.037%20-0.116%20-0.053%20c%20-0.161%20-0.063%20-0.327%20-0.113%20-0.497%20-0.147%20c%20-0.031%20-0.006%20-0.063%20-0.008%20-0.094%20-0.014%20c%20-0.142%20-0.024%20-0.285%20-0.038%20-0.429%20-0.041%20C%2087.03%200%2086.983%200%2086.936%200.001%20c%20-0.141%200.003%20-0.282%200.017%20-0.423%200.041%20c%20-0.035%200.006%20-0.069%200.008%20-0.104%200.015%20c%20-0.154%200.031%20-0.306%200.073%20-0.456%200.129%20L%201.946%2031.709%20c%20-1.124%200.422%20-1.888%201.473%20-1.943%202.673%20c%20-0.054%201.199%200.612%202.316%201.693%202.838%20l%2034.455%2016.628%20l%2016.627%2034.455%20C%2053.281%2089.344%2054.334%2090%2055.481%2090%20c%200.046%200%200.091%20-0.001%200.137%20-0.003%20c%201.199%20-0.055%202.251%20-0.819%202.673%20-1.943%20L%2089.815%204.048%20c%200.056%20-0.149%200.097%20-0.3%200.128%20-0.453%20c%200.008%20-0.041%200.011%20-0.081%200.017%20-0.122%20C%2089.982%203.341%2089.995%203.208%2089.999%203.075%20z%20M%2075.086%2010.672%20L%2037.785%2047.973%20L%2010.619%2034.864%20L%2075.086%2010.672%20z%20M%2055.136%2079.381%20L%2042.027%2052.216%20l%2037.302%20-37.302%20L%2055.136%2079.381%20z'%20style='stroke:%20none;%20stroke-width:%201;%20stroke-dasharray:%20none;%20stroke-linecap:%20butt;%20stroke-linejoin:%20miter;%20stroke-miterlimit:%2010;%20fill:%20rgb(0,0,0);%20fill-rule:%20nonzero;%20opacity:%201;'%20transform='%20matrix(1%200%200%201%200%200)%20'%20stroke-linecap='round'%20/%3e%3ccircle%20cx='75'%20cy='75'%20r='15'%20fill='%23008000'/%3e%3cpath%20d='M75,60%20A15,15%200%200,1%2090,75%20A15,15%200%200,1%2075,90%20A15,15%200%200,1%2060,75%20A15,15%200%200,1%2075,60%20Z'%20stroke='%23FFFFFF'%20stroke-width='2'%20fill='none'/%3e%3cpath%20d='M81,75%20A6,6%200%200,1%2075,81%20A6,6%200%200,1%2069,75%20A6,6%200%200,1%2075,69%20A6,6%200%200,1%2081,75%20Z'%20fill='%23FFFFFF'/%3e%3c/g%3e%3c/svg%3e",Spt="/",Tpt={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:lp,Step:bpt,RenderHTMLJS:$ut,JsonViewer:opt,DynamicUIRenderer:oM,ToolbarButton:P0,DropdownMenu:rM},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{ui_componentKey:0,isSynthesizingVoice:!1,cpp_block:YN,html5_block:$N,LaTeX_block:WN,json_block:qN,javascript_block:HN,process_svg:ypt,ok_svg:Ept,failed_svg:vpt,loading_svg:jN,sendGlobe:cM,code_block:VN,python_block:zN,bash_block:KN,audio_url:null,audio:null,msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode_:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){if("speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0?this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged):console.log("No voices found")):console.error("Speech synthesis is not supported in this browser."),Le(()=>{Ve.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight}),console.log("Checking metadata"),console.log(this.message),Object.prototype.hasOwnProperty.call(this.message,"metadata")&&this.message.metadata!=null){console.log("Metadata found!"),Array.isArray(this.message.metadata)||(this.message.metadata=[]),console.log(typeof this.message.metadata),console.log(this.message.metadata);for(let n of this.message.metadata)Object.prototype.hasOwnProperty.call(n,"audio_url")&&n.audio_url!=null&&(this.audio_url=n.audio_url,console.log("Audio URL:",this.audio_url))}},methods:{computeTimeDiff(n,e){let t=e.getTime()-n.getTime();const s=Math.floor(t/(1e3*60*60));t-=s*(1e3*60*60);const i=Math.floor(t/(1e3*60));t-=i*(1e3*60);const r=Math.floor(t/1e3);return t-=r*1e3,[s,i,r]},insertTab(n){const e=n.target,t=e.selectionStart,s=e.selectionEnd,i=n.shiftKey;if(t===s)if(i){if(e.value.substring(t-4,t)==" "){const r=e.value.substring(0,t-4),o=e.value.substring(s),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t-4})}}else{const r=e.value.substring(0,t),o=e.value.substring(s),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4})}else{const o=e.value.substring(t,s).split(` `).map(u=>u.trim()===""?u:i?u.startsWith(" ")?u.substring(4):u:" "+u),a=e.value.substring(0,t),c=e.value.substring(s),d=a+o.join(` `)+c;this.message.content=d,this.$nextTick(()=>{e.selectionStart=t,e.selectionEnd=s+o.length*4})}n.preventDefault()},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){this.isSynthesizingVoice?(this.isSynthesizingVoice=!1,this.$refs.audio_player.pause()):(this.isSynthesizingVoice=!0,Z.post("./text2wav",{text:this.message.content}).then(n=>{this.isSynthesizingVoice=!1;let e=n.data.url;console.log(e),this.audio_url=e,this.message.metadata||(this.message.metadata=[]);let t=!1;for(let s of this.message.metadata)Object.prototype.hasOwnProperty.call(s,"audio_url")&&(s.audio_url=this.audio_url,t=!0);t||this.message.metadata.push({audio_url:this.audio_url}),this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url)}).catch(n=>{this.$store.state.toast.showToast(`Error: ${n}`,4,!1),this.isSynthesizingVoice=!1}))},async speak(){if(this.$store.state.config.active_tts_service!="browser"&&this.$store.state.config.active_tts_service!="None")this.isSpeaking?(this.isSpeaking=!0,Z.post("./stop",{text:this.message.content}).then(n=>{this.isSpeaking=!1}).catch(n=>{this.$store.state.toast.showToast(`Error: ${n}`,4,!1),this.isSpeaking=!1})):(this.isSpeaking=!0,Z.post("./text2Audio",{client_id:this.$store.state.client_id,text:this.message.content}).then(n=>{this.isSpeaking=!1}).catch(n=>{this.$store.state.toast.showToast(`Error: ${n}`,4,!1),this.isSpeaking=!1}));else{if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log("voice on"),this.isSpeaking=!0;const e=200;this.message.content,this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this.$store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(i=>i.name===this.$store.state.config.audio_out_voice)[0]);const t=i=>{let r=this.message.content.substring(i,i+e);const o=[".","!","?",` `];let a=-1;return o.forEach(c=>{const d=r.lastIndexOf(c);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+i+1},s=()=>{if(this.message.status_message=="Done"||this.message.content.includes(".")||this.message.content.includes("?")||this.message.content.includes("!")){const i=t(n),r=this.message.content.substring(n,i);this.msg.text=r,n=i+1,this.msg.onend=o=>{n{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",i))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{s()},1)};console.log("Speaking chunk"),s()}},toggleModel(){this.expanded=!this.expanded},addBlock(n){let e=this.$refs.mdTextarea.selectionStart,t=this.$refs.mdTextarea.selectionEnd;e==t?speechSynthesis==0||this.message.content[e-1]==` `?(this.message.content=this.message.content.slice(0,e)+"```"+n+"\n\n```\n"+this.message.content.slice(e),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+n+"\n\n```\n"+this.message.content.slice(e),e=e+3+n.length):speechSynthesis==0||this.message.content[e-1]==` `?(this.message.content=this.message.content.slice(0,e)+"```"+n+` `+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+n+` -`+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},copyContentToClipboard(){this.$emit("copy",this)},deleteMsg(){this.$emit("delete",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit("rankUp",this.message.id)},rankDown(){this.$emit("rankDown",this.message.id)},updateMessage(){this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url),this.editMsgMode=!1},resendMessage(n){this.$emit("resendMessage",this.message.id,this.message.content,n)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?Spt+this.avatar:(console.log("No avatar found"),Us)},defaultImg(n){n.target.src=Us},parseDate(n){let e=new Date(Date.parse(n)),s=Math.floor((new Date-e)/1e3);return s<=1?"just now":s<20?s+" seconds ago":s<40?"half a minute ago":s<60?"less than a minute ago":s<=90?"one minute ago":s<=3540?Math.round(s/60)+" minutes ago":s<=5400?"1 hour ago":s<=86400?Math.round(s/3600)+" hours ago":s<=129600?"1 day ago":s<604800?Math.round(s/86400)+" days ago":s<=777600?"1 week ago":n},prettyDate(n){let e=new Date((n||"").replace(/-/g,"/").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(t/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(t<60&&"just now"||t<120&&"1 minute ago"||t<3600&&Math.floor(t/60)+" minutes ago"||t<7200&&"1 hour ago"||t<86400&&Math.floor(t/3600)+" hours ago")||s==1&&"Yesterday"||s<7&&s+" days ago"||s<31&&Math.ceil(s/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{audio_url(n){n&&(this.$refs.audio_player.src=n)},"message.content":function(n){this.$store.state.config.auto_speak&&(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode||this.isSpeaking||this.checkForFullSentence())},"message.ui":function(n){console.log("ui changed to",n),this.ui_componentKey++},showConfirmation(){Le(()=>{Ve.replace()})},deleteMsgMode(){Le(()=>{Ve.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty("open")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(n){this.message.open=n,this.editMsgMode_=n,Le(()=>{Ve.replace()})}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!n.getTime()||!e.getTime())return;let[s,i,r]=this.computeTimeDiff(n,e);function o(c){return c<10&&(c="0"+c),c}return o(s)+"h:"+o(i)+"m:"+o(r)+"s"},warmup_duration(){const n=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.started_generating_at));if(console.log("Computing the warmup duration, ",n," -> ",e),e.getTime()===n.getTime())return 0;if(!n.getTime()||!e.getTime())return;let s,i,r;[s,i,r]=this.computeTimeDiff(n,e);function o(c){return c<10&&(c="0"+c),c}return o(s)+"h:"+o(i)+"m:"+o(r)+"s"},generation_rate(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at)),t=this.message.nb_tokens;if(e.getTime()===n.getTime()||!t||!n.getTime()||!e.getTime())return;let i=e.getTime()-n.getTime();const r=Math.floor(i/1e3),o=t/r;return Math.round(o)+" t/s"}}},xpt={class:"relative w-full group rounded-lg m-2 shadow-lg message hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},Cpt={class:"flex flex-row gap-2"},wpt={class:"flex-shrink-0"},Rpt={class:"group/avatar"},Apt=["src","data-popover-target"],Npt={class:"flex flex-col w-full flex-grow-0"},Mpt={class:"flex flex-row flex-grow items-start"},Opt={class:"flex flex-col mb-2"},Ipt={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},kpt=["title"],Dpt={class:"overflow-x-auto w-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},Lpt={class:"flex w-full cursor-pointer rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900 mb-3.5 max-w-full"},Ppt={class:"grid min-w-80 select-none grid-cols-[50px,1fr] items-center gap-3 p-3 bg-gray-50 dark:bg-gray-800 rounded-lg shadow-sm hover:shadow-md transition-all duration-300"},Fpt={class:"relative grid aspect-square place-content-center overflow-hidden rounded-full bg-gradient-to-br from-blue-400 to-purple-500"},Upt={key:0,class:"w-8 h-8 text-white animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Bpt={key:1,class:"w-8 h-8 text-red-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Gpt={key:2,class:"w-8 h-8 text-green-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Vpt={class:"leading-5"},zpt={class:"flex items-center gap-1 truncate whitespace-nowrap text-sm text-gray-500 dark:text-gray-400"},Hpt={class:"content px-5 pb-5 pt-4"},qpt={class:"list-none"},Ypt={class:"flex flex-col items-start w-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},$pt={key:1},Wpt=["src"],Kpt={class:"flex-row justify-end mx-2"},jpt={class:"invisible group-hover:visible flex flex-row"},Qpt={key:0},Xpt={key:1},Zpt={key:2},Jpt={key:3},eft={key:4,class:"flex items-center duration-75"},tft={class:"flex flex-row items-center"},nft={class:"flex flex-row items-center"},sft={key:6,class:"flex flex-row items-center"},ift=["src"],rft={class:"text-sm text-gray-400 mt-2"},oft={class:"flex flex-row items-center gap-2"},aft={key:0},lft={class:"font-thin"},cft={key:1},dft={class:"font-thin"},uft={key:2},pft={class:"font-thin"},fft={key:3},_ft=["title"],mft={key:4},hft=["title"],gft={key:5},bft=["title"],yft={key:6},Eft=["title"];function vft(n,e,t,s,i,r){var f;const o=et("Step"),a=et("RenderHTMLJS"),c=et("MarkdownRenderer"),d=et("JsonViewer"),u=et("DynamicUIRenderer"),_=et("ToolbarButton"),m=et("DropdownSubmenu"),h=et("DropdownMenu");return T(),w("div",xpt,[l("div",Cpt,[l("div",wpt,[l("div",Rpt,[l("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=g=>r.defaultImg(g)),"data-popover-target":"avatar"+t.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,Apt)])]),l("div",Npt,[l("div",Mpt,[l("div",Opt,[l("div",Ipt,W(t.message.sender),1),t.message.created_at?(T(),w("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},W(r.created_at),9,kpt)):B("",!0)]),e[45]||(e[45]=l("div",{class:"flex-grow"},null,-1))]),l("div",Dpt,[D(l("details",Lpt,[l("summary",Ppt,[l("div",Fpt,[t.message.status_message!=="Done"&&t.message.status_message!=="Generation canceled"?(T(),w("svg",Upt,e[46]||(e[46]=[l("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),l("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))):B("",!0),t.message.status_message==="Generation canceled"?(T(),w("svg",Bpt,e[47]||(e[47]=[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):B("",!0),t.message.status_message==="Done"?(T(),w("svg",Gpt,e[48]||(e[48]=[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):B("",!0)]),l("dl",Vpt,[e[49]||(e[49]=l("dd",{class:"text-lg font-semibold text-gray-800 dark:text-gray-200"},"Processing Info",-1)),l("dt",zpt,[l("span",{class:Ue(["inline-block w-2 h-2 rounded-full",{"bg-blue-500 animate-pulse":t.message.status_message!=="Done"&&t.message.status_message!=="Generation canceled","bg-red-500":t.message.status_message==="Generation canceled","bg-green-500":t.message.status_message==="Done"}])},null,2),Ze(" "+W(t.message===void 0?"":t.message.status_message),1)])])]),l("div",Hpt,[l("ol",qpt,[(T(!0),w(Be,null,Xe(t.message.steps,(g,b)=>(T(),w("div",{key:"step-"+t.message.id+"-"+b,class:"group border-l pb-6 last:!border-transparent last:pb-0 dark:border-gray-800",style:Wt({backgroundColor:g.done?"transparent":"inherit"})},[z(o,{done:g.done,text:g.text,status:g.status,step_type:g.step_type},null,8,["done","text","status","step_type"])],4))),128))])])],512),[[xt,t.message!=null&&t.message.steps!=null&&t.message.steps.length>0]]),e[51]||(e[51]=l("div",{class:"flex flex-col items-start w-full"},null,-1)),l("div",Ypt,[(T(!0),w(Be,null,Xe(t.message.html_js_s,(g,b)=>(T(),w("div",{key:"htmljs-"+t.message.id+"-"+b,class:"htmljs font-bold",style:Wt({backgroundColor:n.step.done?"transparent":"inherit"})},[z(a,{htmlContent:g},null,8,["htmlContent"])],4))),128))]),r.editMsgMode?B("",!0):(T(),at(c,{key:0,ref:"mdRender",host:t.host,"markdown-text":t.message.content,message_id:t.message.id,discussion_id:t.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])),l("div",null,[t.message.open?D((T(),w("textarea",{key:0,ref:"mdTextarea",onKeydown:e[1]||(e[1]=zs(K((...g)=>r.insertTab&&r.insertTab(...g),["prevent"]),["tab"])),class:"block min-h-[500px] p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",rows:4,placeholder:"Enter message here...","onUpdate:modelValue":e[2]||(e[2]=g=>t.message.content=g)}," ",544)),[[ue,t.message.content]]):B("",!0)]),t.message.metadata!==null?(T(),w("div",$pt,[(T(!0),w(Be,null,Xe(((f=t.message.metadata)==null?void 0:f.filter(g=>g!=null&&g.hasOwnProperty("title")&&g.hasOwnProperty("content")))||[],(g,b)=>(T(),w("div",{key:"json-"+t.message.id+"-"+b,class:"json font-bold"},[(T(),at(d,{jsonFormText:g.title,jsonData:g.content,key:"msgjson-"+t.message.id},null,8,["jsonFormText","jsonData"]))]))),128))])):B("",!0),t.message.ui?(T(),at(u,{ref:"ui",class:"w-full",ui:t.message.ui,key:"msgui-"+t.message.id},null,8,["ui"])):B("",!0),i.audio_url!=null?(T(),w("audio",{controls:"",key:i.audio_url},[l("source",{src:i.audio_url,type:"audio/wav",ref:"audio_player"},null,8,Wpt),e[50]||(e[50]=Ze(" Your browser does not support the audio element. "))])):B("",!0)]),l("div",Kpt,[l("div",jpt,[r.editMsgMode?(T(),w("div",Qpt,[z(_,{onClick:e[3]||(e[3]=K(g=>r.editMsgMode=!1,["stop"])),title:"Cancel edit",icon:"x"}),z(_,{onClick:K(r.updateMessage,["stop"]),title:"Update message",icon:"check"},null,8,["onClick"]),z(h,{title:"Add Block"},{default:Ie(()=>[z(m,{title:"Programming Languages",icon:"code"},{default:Ie(()=>[z(_,{onClick:e[4]||(e[4]=K(g=>r.addBlock("python"),["stop"])),title:"Python",icon:"python"}),z(_,{onClick:e[5]||(e[5]=K(g=>r.addBlock("javascript"),["stop"])),title:"JavaScript",icon:"js"}),z(_,{onClick:e[6]||(e[6]=K(g=>r.addBlock("typescript"),["stop"])),title:"TypeScript",icon:"typescript"}),z(_,{onClick:e[7]||(e[7]=K(g=>r.addBlock("java"),["stop"])),title:"Java",icon:"java"}),z(_,{onClick:e[8]||(e[8]=K(g=>r.addBlock("c++"),["stop"])),title:"C++",icon:"cplusplus"}),z(_,{onClick:e[9]||(e[9]=K(g=>r.addBlock("csharp"),["stop"])),title:"C#",icon:"csharp"}),z(_,{onClick:e[10]||(e[10]=K(g=>r.addBlock("go"),["stop"])),title:"Go",icon:"go"}),z(_,{onClick:e[11]||(e[11]=K(g=>r.addBlock("rust"),["stop"])),title:"Rust",icon:"rust"}),z(_,{onClick:e[12]||(e[12]=K(g=>r.addBlock("swift"),["stop"])),title:"Swift",icon:"swift"}),z(_,{onClick:e[13]||(e[13]=K(g=>r.addBlock("kotlin"),["stop"])),title:"Kotlin",icon:"kotlin"}),z(_,{onClick:e[14]||(e[14]=K(g=>r.addBlock("r"),["stop"])),title:"R",icon:"r-project"})]),_:1}),z(m,{title:"Web Technologies",icon:"web"},{default:Ie(()=>[z(_,{onClick:e[15]||(e[15]=K(g=>r.addBlock("html"),["stop"])),title:"HTML",icon:"html5"}),z(_,{onClick:e[16]||(e[16]=K(g=>r.addBlock("css"),["stop"])),title:"CSS",icon:"css3"}),z(_,{onClick:e[17]||(e[17]=K(g=>r.addBlock("vue"),["stop"])),title:"Vue.js",icon:"vuejs"}),z(_,{onClick:e[18]||(e[18]=K(g=>r.addBlock("react"),["stop"])),title:"React",icon:"react"}),z(_,{onClick:e[19]||(e[19]=K(g=>r.addBlock("angular"),["stop"])),title:"Angular",icon:"angular"})]),_:1}),z(m,{title:"Markup and Data",icon:"file-code"},{default:Ie(()=>[z(_,{onClick:e[20]||(e[20]=K(g=>r.addBlock("xml"),["stop"])),title:"XML",icon:"xml"}),z(_,{onClick:e[21]||(e[21]=K(g=>r.addBlock("json"),["stop"])),title:"JSON",icon:"json"}),z(_,{onClick:e[22]||(e[22]=K(g=>r.addBlock("yaml"),["stop"])),title:"YAML",icon:"yaml"}),z(_,{onClick:e[23]||(e[23]=K(g=>r.addBlock("markdown"),["stop"])),title:"Markdown",icon:"markdown"}),z(_,{onClick:e[24]||(e[24]=K(g=>r.addBlock("latex"),["stop"])),title:"LaTeX",icon:"latex"})]),_:1}),z(m,{title:"Scripting and Shell",icon:"terminal"},{default:Ie(()=>[z(_,{onClick:e[25]||(e[25]=K(g=>r.addBlock("bash"),["stop"])),title:"Bash",icon:"bash"}),z(_,{onClick:e[26]||(e[26]=K(g=>r.addBlock("powershell"),["stop"])),title:"PowerShell",icon:"powershell"}),z(_,{onClick:e[27]||(e[27]=K(g=>r.addBlock("perl"),["stop"])),title:"Perl",icon:"perl"})]),_:1}),z(m,{title:"Diagramming",icon:"sitemap"},{default:Ie(()=>[z(_,{onClick:e[28]||(e[28]=K(g=>r.addBlock("mermaid"),["stop"])),title:"Mermaid",icon:"mermaid"}),z(_,{onClick:e[29]||(e[29]=K(g=>r.addBlock("graphviz"),["stop"])),title:"Graphviz",icon:"graphviz"}),z(_,{onClick:e[30]||(e[30]=K(g=>r.addBlock("plantuml"),["stop"])),title:"PlantUML",icon:"plantuml"})]),_:1}),z(m,{title:"Database",icon:"database"},{default:Ie(()=>[z(_,{onClick:e[31]||(e[31]=K(g=>r.addBlock("sql"),["stop"])),title:"SQL",icon:"sql"}),z(_,{onClick:e[32]||(e[32]=K(g=>r.addBlock("mongodb"),["stop"])),title:"MongoDB",icon:"mongodb"})]),_:1}),z(_,{onClick:e[33]||(e[33]=K(g=>r.addBlock(""),["stop"])),title:"Generic Block",icon:"code"})]),_:1})])):(T(),w("div",Xpt,[z(_,{onClick:e[34]||(e[34]=K(g=>r.editMsgMode=!0,["stop"])),title:"Edit message",icon:"edit"})])),z(_,{onClick:r.copyContentToClipboard,title:"Copy message to clipboard",icon:"copy"},null,8,["onClick"]),!r.editMsgMode&&t.message.sender!==n.$store.state.mountedPers.name?(T(),w("div",Zpt,[z(_,{onClick:e[35]||(e[35]=K(g=>r.resendMessage("full_context"),["stop"])),title:"Resend message with full context",icon:"send"}),z(_,{onClick:e[36]||(e[36]=K(g=>r.resendMessage("full_context_with_internet"),["stop"])),title:"Resend message with internet search",icon:"globe"}),z(_,{onClick:e[37]||(e[37]=K(g=>r.resendMessage("simple_question"),["stop"])),title:"Resend message without context",icon:"sendSimple"})])):B("",!0),!r.editMsgMode&&t.message.sender===n.$store.state.mountedPers.name?(T(),w("div",Jpt,[z(_,{onClick:r.continueMessage,title:"Continue message",icon:"fastForward"},null,8,["onClick"])])):B("",!0),i.deleteMsgMode?(T(),w("div",eft,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Cancel removal",type:"button",onClick:e[38]||(e[38]=K(g=>i.deleteMsgMode=!1,["stop"]))},e[52]||(e[52]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[39]||(e[39]=K(g=>r.deleteMsg(),["stop"]))},e[53]||(e[53]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),!r.editMsgMode&&!i.deleteMsgMode?(T(),w("div",{key:5,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[40]||(e[40]=g=>i.deleteMsgMode=!0)},e[54]||(e[54]=[l("i",{"data-feather":"trash"},null,-1)]))):B("",!0),l("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[41]||(e[41]=K(g=>r.rankUp(),["stop"]))},e[55]||(e[55]=[l("i",{"data-feather":"thumbs-up"},null,-1)])),l("div",tft,[l("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[42]||(e[42]=K(g=>r.rankDown(),["stop"]))},e[56]||(e[56]=[l("i",{"data-feather":"thumbs-down"},null,-1)])),t.message.rank!=0?(T(),w("div",{key:0,class:Ue(["rounded-full px-2 text-sm flex items-center justify-center font-bold cursor-pointer",t.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},W(t.message.rank),3)):B("",!0)]),l("div",nft,[this.$store.state.config.active_tts_service!="None"?(T(),w("div",{key:0,class:Ue(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[43]||(e[43]=K(g=>r.speak(),["stop"]))},e[57]||(e[57]=[l("i",{"data-feather":"volume-2"},null,-1)]),2)):B("",!0)]),this.$store.state.config.xtts_enable&&!this.$store.state.config.xtts_use_streaming_mode?(T(),w("div",sft,[i.isSynthesizingVoice?(T(),w("img",{key:1,src:i.loading_svg},null,8,ift)):(T(),w("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"generate_audio",onClick:e[44]||(e[44]=K(g=>r.read(),["stop"]))},e[58]||(e[58]=[l("i",{"data-feather":"voicemail"},null,-1)])))])):B("",!0)])]),l("div",rft,[l("div",oft,[t.message.binding?(T(),w("p",aft,[e[59]||(e[59]=Ze("Binding: ")),l("span",lft,W(t.message.binding),1)])):B("",!0),t.message.model?(T(),w("p",cft,[e[60]||(e[60]=Ze("Model: ")),l("span",dft,W(t.message.model),1)])):B("",!0),t.message.seed?(T(),w("p",uft,[e[61]||(e[61]=Ze("Seed: ")),l("span",pft,W(t.message.seed),1)])):B("",!0),t.message.nb_tokens?(T(),w("p",fft,[e[62]||(e[62]=Ze("Number of tokens: ")),l("span",{class:"font-thin",title:"Number of Tokens: "+t.message.nb_tokens},W(t.message.nb_tokens),9,_ft)])):B("",!0),r.warmup_duration?(T(),w("p",mft,[e[63]||(e[63]=Ze("Warmup duration: ")),l("span",{class:"font-thin",title:"Warmup duration: "+r.warmup_duration},W(r.warmup_duration),9,hft)])):B("",!0),r.time_spent?(T(),w("p",gft,[e[64]||(e[64]=Ze("Generation duration: ")),l("span",{class:"font-thin",title:"Finished generating: "+r.time_spent},W(r.time_spent),9,bft)])):B("",!0),r.generation_rate?(T(),w("p",yft,[e[65]||(e[65]=Ze("Rate: ")),l("span",{class:"font-thin",title:"Generation rate: "+r.generation_rate},W(r.generation_rate),9,Eft)])):B("",!0)])])])])])}const dM=it(Tpt,[["render",vft]]),Sft="/";Z.defaults.baseURL="/";const Tft={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:ac,UniversalForm:uc},data(){return{bUrl:Sft,isMounted:!1,show:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},mountedPers:{get(){return this.$store.state.mountedPers},set(n){this.$store.commit("setMountedPers",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{async handleOnTalk(){const n=this.mountedPers;console.log("pers:",n),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating);let e=await Z.get("/get_generation_status",{});if(e)if(e.data.status)console.log("Already generating");else{const t=this.$store.state.config.personalities.findIndex(i=>i===n.full_path),s={client_id:this.$store.state.client_id,id:t};e=await Z.post("/select_personality",s),console.log("Generating message from ",e.data.status),qe.emit("generate_msg_from",{id:-1})}},async remount_personality(){const n=this.mountedPers;if(console.log("Remounting personality ",n),!n)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this.$store.state.client_id,category:n.category,folder:n.folder,language:n.language};console.log("after");const t=await Z.post("/remount_personality",e);if(console.log("Remounting personality executed:",t),t)return console.log("Remounting personality res"),this.$store.state.toast.showToast("Personality remounted",4,!0),t.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},onSettingsPersonality(n){try{Z.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+n.name,"Save changes","Cancel").then(t=>{try{Z.post("/set_active_personality_settings",t).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. +`+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},copyContentToClipboard(){this.$emit("copy",this)},deleteMsg(){this.$emit("delete",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit("rankUp",this.message.id)},rankDown(){this.$emit("rankDown",this.message.id)},updateMessage(){this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url),this.editMsgMode=!1},resendMessage(n){this.$emit("resendMessage",this.message.id,this.message.content,n)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?Spt+this.avatar:(console.log("No avatar found"),Us)},defaultImg(n){n.target.src=Us},parseDate(n){let e=new Date(Date.parse(n)),s=Math.floor((new Date-e)/1e3);return s<=1?"just now":s<20?s+" seconds ago":s<40?"half a minute ago":s<60?"less than a minute ago":s<=90?"one minute ago":s<=3540?Math.round(s/60)+" minutes ago":s<=5400?"1 hour ago":s<=86400?Math.round(s/3600)+" hours ago":s<=129600?"1 day ago":s<604800?Math.round(s/86400)+" days ago":s<=777600?"1 week ago":n},prettyDate(n){let e=new Date((n||"").replace(/-/g,"/").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(t/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(t<60&&"just now"||t<120&&"1 minute ago"||t<3600&&Math.floor(t/60)+" minutes ago"||t<7200&&"1 hour ago"||t<86400&&Math.floor(t/3600)+" hours ago")||s==1&&"Yesterday"||s<7&&s+" days ago"||s<31&&Math.ceil(s/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{audio_url(n){n&&(this.$refs.audio_player.src=n)},"message.content":function(n){this.$store.state.config.auto_speak&&(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode||this.isSpeaking||this.checkForFullSentence())},"message.ui":function(n){console.log("ui changed to",n),this.ui_componentKey++},showConfirmation(){Le(()=>{Ve.replace()})},deleteMsgMode(){Le(()=>{Ve.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty("open")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(n){this.message.open=n,this.editMsgMode_=n,Le(()=>{Ve.replace()})}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!n.getTime()||!e.getTime())return;let[s,i,r]=this.computeTimeDiff(n,e);function o(c){return c<10&&(c="0"+c),c}return o(s)+"h:"+o(i)+"m:"+o(r)+"s"},warmup_duration(){const n=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.started_generating_at));if(console.log("Computing the warmup duration, ",n," -> ",e),e.getTime()===n.getTime())return 0;if(!n.getTime()||!e.getTime())return;let s,i,r;[s,i,r]=this.computeTimeDiff(n,e);function o(c){return c<10&&(c="0"+c),c}return o(s)+"h:"+o(i)+"m:"+o(r)+"s"},generation_rate(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at)),t=this.message.nb_tokens;if(e.getTime()===n.getTime()||!t||!n.getTime()||!e.getTime())return;let i=e.getTime()-n.getTime();const r=Math.floor(i/1e3),o=t/r;return Math.round(o)+" t/s"}}},xpt={class:"relative w-full group rounded-lg m-2 shadow-lg message hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},Cpt={class:"flex flex-row gap-2"},wpt={class:"flex-shrink-0"},Rpt={class:"group/avatar"},Apt=["src","data-popover-target"],Npt={class:"flex flex-col w-full flex-grow-0"},Mpt={class:"flex flex-row flex-grow items-start"},Opt={class:"flex flex-col mb-2"},Ipt={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},kpt=["title"],Dpt={class:"overflow-x-auto w-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},Lpt={class:"flex w-full cursor-pointer rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900 mb-3.5 max-w-full"},Ppt={class:"grid min-w-80 select-none grid-cols-[50px,1fr] items-center gap-3 p-3 bg-gray-50 dark:bg-gray-800 rounded-lg shadow-sm hover:shadow-md transition-all duration-300"},Fpt={class:"relative grid aspect-square place-content-center overflow-hidden rounded-full bg-gradient-to-br from-blue-400 to-purple-500"},Upt={key:0,class:"w-8 h-8 text-white animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Bpt={key:1,class:"w-8 h-8 text-red-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Gpt={key:2,class:"w-8 h-8 text-green-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Vpt={class:"leading-5"},zpt={class:"flex items-center gap-1 truncate whitespace-nowrap text-sm text-gray-500 dark:text-gray-400"},Hpt={class:"content px-5 pb-5 pt-4"},qpt={class:"list-none"},Ypt={class:"flex flex-col items-start w-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},$pt={key:1},Wpt=["src"],Kpt={class:"flex-row justify-end mx-2"},jpt={class:"invisible group-hover:visible flex flex-row"},Qpt={key:0},Xpt={key:1},Zpt={key:2},Jpt={key:3},eft={key:4,class:"flex items-center duration-75"},tft={class:"flex flex-row items-center"},nft={class:"flex flex-row items-center"},sft={key:6,class:"flex flex-row items-center"},ift=["src"],rft={class:"text-sm text-gray-400 mt-2"},oft={class:"flex flex-row items-center gap-2"},aft={key:0},lft={class:"font-thin"},cft={key:1},dft={class:"font-thin"},uft={key:2},pft={class:"font-thin"},fft={key:3},_ft=["title"],mft={key:4},hft=["title"],gft={key:5},bft=["title"],yft={key:6},Eft=["title"];function vft(n,e,t,s,i,r){var f;const o=et("Step"),a=et("RenderHTMLJS"),c=et("MarkdownRenderer"),d=et("JsonViewer"),u=et("DynamicUIRenderer"),_=et("ToolbarButton"),m=et("DropdownSubmenu"),h=et("DropdownMenu");return T(),w("div",xpt,[l("div",Cpt,[l("div",wpt,[l("div",Rpt,[l("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=g=>r.defaultImg(g)),"data-popover-target":"avatar"+t.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,Apt)])]),l("div",Npt,[l("div",Mpt,[l("div",Opt,[l("div",Ipt,W(t.message.sender),1),t.message.created_at?(T(),w("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},W(r.created_at),9,kpt)):B("",!0)]),e[45]||(e[45]=l("div",{class:"flex-grow"},null,-1))]),l("div",Dpt,[D(l("details",Lpt,[l("summary",Ppt,[l("div",Fpt,[t.message.status_message!=="Done"&&t.message.status_message!=="Generation canceled"?(T(),w("svg",Upt,e[46]||(e[46]=[l("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),l("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))):B("",!0),t.message.status_message==="Generation canceled"?(T(),w("svg",Bpt,e[47]||(e[47]=[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):B("",!0),t.message.status_message==="Done"?(T(),w("svg",Gpt,e[48]||(e[48]=[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):B("",!0)]),l("dl",Vpt,[e[49]||(e[49]=l("dd",{class:"text-lg font-semibold text-gray-800 dark:text-gray-200"},"Processing Info",-1)),l("dt",zpt,[l("span",{class:Ue(["inline-block w-2 h-2 rounded-full",{"bg-blue-500 animate-pulse":t.message.status_message!=="Done"&&t.message.status_message!=="Generation canceled","bg-red-500":t.message.status_message==="Generation canceled","bg-green-500":t.message.status_message==="Done"}])},null,2),Ze(" "+W(t.message===void 0?"":t.message.status_message),1)])])]),l("div",Hpt,[l("ol",qpt,[(T(!0),w(Be,null,Xe(t.message.steps,(g,b)=>(T(),w("div",{key:"step-"+t.message.id+"-"+b,class:"group border-l pb-6 last:!border-transparent last:pb-0 dark:border-gray-800",style:Wt({backgroundColor:g.done?"transparent":"inherit"})},[z(o,{done:g.done,text:g.text,status:g.status,step_type:g.step_type},null,8,["done","text","status","step_type"])],4))),128))])])],512),[[xt,t.message!=null&&t.message.steps!=null&&t.message.steps.length>0]]),e[51]||(e[51]=l("div",{class:"flex flex-col items-start w-full"},null,-1)),l("div",Ypt,[(T(!0),w(Be,null,Xe(t.message.html_js_s,(g,b)=>(T(),w("div",{key:"htmljs-"+t.message.id+"-"+b,class:"htmljs font-bold",style:Wt({backgroundColor:n.step.done?"transparent":"inherit"})},[z(a,{htmlContent:g},null,8,["htmlContent"])],4))),128))]),r.editMsgMode?B("",!0):(T(),at(c,{key:0,ref:"mdRender",host:t.host,"markdown-text":t.message.content,message_id:t.message.id,discussion_id:t.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])),l("div",null,[t.message.open?D((T(),w("textarea",{key:0,ref:"mdTextarea",onKeydown:e[1]||(e[1]=zs(K((...g)=>r.insertTab&&r.insertTab(...g),["prevent"]),["tab"])),class:"block min-h-[500px] p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",rows:4,placeholder:"Enter message here...","onUpdate:modelValue":e[2]||(e[2]=g=>t.message.content=g)}," ",544)),[[ue,t.message.content]]):B("",!0)]),t.message.metadata!==null?(T(),w("div",$pt,[(T(!0),w(Be,null,Xe(((f=t.message.metadata)==null?void 0:f.filter(g=>g!=null&&g.hasOwnProperty("title")&&g.hasOwnProperty("content")))||[],(g,b)=>(T(),w("div",{key:"json-"+t.message.id+"-"+b,class:"json font-bold"},[(T(),at(d,{jsonFormText:g.title,jsonData:g.content,key:"msgjson-"+t.message.id},null,8,["jsonFormText","jsonData"]))]))),128))])):B("",!0),t.message.ui?(T(),at(u,{ref:"ui",class:"w-full",ui:t.message.ui,key:"msgui-"+t.message.id},null,8,["ui"])):B("",!0),i.audio_url!=null?(T(),w("audio",{controls:"",key:i.audio_url},[l("source",{src:i.audio_url,type:"audio/wav",ref:"audio_player"},null,8,Wpt),e[50]||(e[50]=Ze(" Your browser does not support the audio element. "))])):B("",!0)]),l("div",Kpt,[l("div",jpt,[r.editMsgMode?(T(),w("div",Qpt,[z(_,{onClick:e[3]||(e[3]=K(g=>r.editMsgMode=!1,["stop"])),title:"Cancel edit",icon:"x"}),z(_,{onClick:K(r.updateMessage,["stop"]),title:"Update message",icon:"check"},null,8,["onClick"]),z(h,{title:"Add Block"},{default:Ie(()=>[z(m,{title:"Programming Languages",icon:"code"},{default:Ie(()=>[z(_,{onClick:e[4]||(e[4]=K(g=>r.addBlock("python"),["stop"])),title:"Python",icon:"python"}),z(_,{onClick:e[5]||(e[5]=K(g=>r.addBlock("javascript"),["stop"])),title:"JavaScript",icon:"js"}),z(_,{onClick:e[6]||(e[6]=K(g=>r.addBlock("typescript"),["stop"])),title:"TypeScript",icon:"typescript"}),z(_,{onClick:e[7]||(e[7]=K(g=>r.addBlock("java"),["stop"])),title:"Java",icon:"java"}),z(_,{onClick:e[8]||(e[8]=K(g=>r.addBlock("c++"),["stop"])),title:"C++",icon:"cplusplus"}),z(_,{onClick:e[9]||(e[9]=K(g=>r.addBlock("csharp"),["stop"])),title:"C#",icon:"csharp"}),z(_,{onClick:e[10]||(e[10]=K(g=>r.addBlock("go"),["stop"])),title:"Go",icon:"go"}),z(_,{onClick:e[11]||(e[11]=K(g=>r.addBlock("rust"),["stop"])),title:"Rust",icon:"rust"}),z(_,{onClick:e[12]||(e[12]=K(g=>r.addBlock("swift"),["stop"])),title:"Swift",icon:"swift"}),z(_,{onClick:e[13]||(e[13]=K(g=>r.addBlock("kotlin"),["stop"])),title:"Kotlin",icon:"kotlin"}),z(_,{onClick:e[14]||(e[14]=K(g=>r.addBlock("r"),["stop"])),title:"R",icon:"r-project"})]),_:1}),z(m,{title:"Web Technologies",icon:"web"},{default:Ie(()=>[z(_,{onClick:e[15]||(e[15]=K(g=>r.addBlock("html"),["stop"])),title:"HTML",icon:"html5"}),z(_,{onClick:e[16]||(e[16]=K(g=>r.addBlock("css"),["stop"])),title:"CSS",icon:"css3"}),z(_,{onClick:e[17]||(e[17]=K(g=>r.addBlock("vue"),["stop"])),title:"Vue.js",icon:"vuejs"}),z(_,{onClick:e[18]||(e[18]=K(g=>r.addBlock("react"),["stop"])),title:"React",icon:"react"}),z(_,{onClick:e[19]||(e[19]=K(g=>r.addBlock("angular"),["stop"])),title:"Angular",icon:"angular"})]),_:1}),z(m,{title:"Markup and Data",icon:"file-code"},{default:Ie(()=>[z(_,{onClick:e[20]||(e[20]=K(g=>r.addBlock("xml"),["stop"])),title:"XML",icon:"xml"}),z(_,{onClick:e[21]||(e[21]=K(g=>r.addBlock("json"),["stop"])),title:"JSON",icon:"json"}),z(_,{onClick:e[22]||(e[22]=K(g=>r.addBlock("yaml"),["stop"])),title:"YAML",icon:"yaml"}),z(_,{onClick:e[23]||(e[23]=K(g=>r.addBlock("markdown"),["stop"])),title:"Markdown",icon:"markdown"}),z(_,{onClick:e[24]||(e[24]=K(g=>r.addBlock("latex"),["stop"])),title:"LaTeX",icon:"latex"})]),_:1}),z(m,{title:"Scripting and Shell",icon:"terminal"},{default:Ie(()=>[z(_,{onClick:e[25]||(e[25]=K(g=>r.addBlock("bash"),["stop"])),title:"Bash",icon:"bash"}),z(_,{onClick:e[26]||(e[26]=K(g=>r.addBlock("powershell"),["stop"])),title:"PowerShell",icon:"powershell"}),z(_,{onClick:e[27]||(e[27]=K(g=>r.addBlock("perl"),["stop"])),title:"Perl",icon:"perl"})]),_:1}),z(m,{title:"Diagramming",icon:"sitemap"},{default:Ie(()=>[z(_,{onClick:e[28]||(e[28]=K(g=>r.addBlock("mermaid"),["stop"])),title:"Mermaid",icon:"mermaid"}),z(_,{onClick:e[29]||(e[29]=K(g=>r.addBlock("graphviz"),["stop"])),title:"Graphviz",icon:"graphviz"}),z(_,{onClick:e[30]||(e[30]=K(g=>r.addBlock("plantuml"),["stop"])),title:"PlantUML",icon:"plantuml"})]),_:1}),z(m,{title:"Database",icon:"database"},{default:Ie(()=>[z(_,{onClick:e[31]||(e[31]=K(g=>r.addBlock("sql"),["stop"])),title:"SQL",icon:"sql"}),z(_,{onClick:e[32]||(e[32]=K(g=>r.addBlock("mongodb"),["stop"])),title:"MongoDB",icon:"mongodb"})]),_:1}),z(_,{onClick:e[33]||(e[33]=K(g=>r.addBlock(""),["stop"])),title:"Generic Block",icon:"code"})]),_:1})])):(T(),w("div",Xpt,[z(_,{onClick:e[34]||(e[34]=K(g=>r.editMsgMode=!0,["stop"])),title:"Edit message",icon:"edit"})])),z(_,{onClick:r.copyContentToClipboard,title:"Copy message to clipboard",icon:"copy"},null,8,["onClick"]),!r.editMsgMode&&t.message.sender!==n.$store.state.mountedPers.name?(T(),w("div",Zpt,[z(_,{onClick:e[35]||(e[35]=K(g=>r.resendMessage("full_context"),["stop"])),title:"Resend message with full context",icon:"send"}),z(_,{onClick:e[36]||(e[36]=K(g=>r.resendMessage("full_context_with_internet"),["stop"])),title:"Resend message with internet search",icon:"globe"}),z(_,{onClick:e[37]||(e[37]=K(g=>r.resendMessage("simple_question"),["stop"])),title:"Resend message without context",icon:"sendSimple"})])):B("",!0),!r.editMsgMode&&t.message.sender===n.$store.state.mountedPers.name?(T(),w("div",Jpt,[z(_,{onClick:r.continueMessage,title:"Continue message",icon:"fastForward"},null,8,["onClick"])])):B("",!0),i.deleteMsgMode?(T(),w("div",eft,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Cancel removal",type:"button",onClick:e[38]||(e[38]=K(g=>i.deleteMsgMode=!1,["stop"]))},e[52]||(e[52]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[39]||(e[39]=K(g=>r.deleteMsg(),["stop"]))},e[53]||(e[53]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),!r.editMsgMode&&!i.deleteMsgMode?(T(),w("div",{key:5,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[40]||(e[40]=g=>i.deleteMsgMode=!0)},e[54]||(e[54]=[l("i",{"data-feather":"trash"},null,-1)]))):B("",!0),l("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[41]||(e[41]=K(g=>r.rankUp(),["stop"]))},e[55]||(e[55]=[l("i",{"data-feather":"thumbs-up"},null,-1)])),l("div",tft,[l("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[42]||(e[42]=K(g=>r.rankDown(),["stop"]))},e[56]||(e[56]=[l("i",{"data-feather":"thumbs-down"},null,-1)])),t.message.rank!=0?(T(),w("div",{key:0,class:Ue(["rounded-full px-2 text-sm flex items-center justify-center font-bold cursor-pointer",t.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},W(t.message.rank),3)):B("",!0)]),l("div",nft,[this.$store.state.config.active_tts_service!="None"?(T(),w("div",{key:0,class:Ue(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[43]||(e[43]=K(g=>r.speak(),["stop"]))},e[57]||(e[57]=[l("i",{"data-feather":"volume-2"},null,-1)]),2)):B("",!0)]),this.$store.state.config.xtts_enable&&!this.$store.state.config.xtts_use_streaming_mode?(T(),w("div",sft,[i.isSynthesizingVoice?(T(),w("img",{key:1,src:i.loading_svg},null,8,ift)):(T(),w("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"generate_audio",onClick:e[44]||(e[44]=K(g=>r.read(),["stop"]))},e[58]||(e[58]=[l("i",{"data-feather":"voicemail"},null,-1)])))])):B("",!0)])]),l("div",rft,[l("div",oft,[t.message.binding?(T(),w("p",aft,[e[59]||(e[59]=Ze("Binding: ")),l("span",lft,W(t.message.binding),1)])):B("",!0),t.message.model?(T(),w("p",cft,[e[60]||(e[60]=Ze("Model: ")),l("span",dft,W(t.message.model),1)])):B("",!0),t.message.seed?(T(),w("p",uft,[e[61]||(e[61]=Ze("Seed: ")),l("span",pft,W(t.message.seed),1)])):B("",!0),t.message.nb_tokens?(T(),w("p",fft,[e[62]||(e[62]=Ze("Number of tokens: ")),l("span",{class:"font-thin",title:"Number of Tokens: "+t.message.nb_tokens},W(t.message.nb_tokens),9,_ft)])):B("",!0),r.warmup_duration?(T(),w("p",mft,[e[63]||(e[63]=Ze("Warmup duration: ")),l("span",{class:"font-thin",title:"Warmup duration: "+r.warmup_duration},W(r.warmup_duration),9,hft)])):B("",!0),r.time_spent?(T(),w("p",gft,[e[64]||(e[64]=Ze("Generation duration: ")),l("span",{class:"font-thin",title:"Finished generating: "+r.time_spent},W(r.time_spent),9,bft)])):B("",!0),r.generation_rate?(T(),w("p",yft,[e[65]||(e[65]=Ze("Rate: ")),l("span",{class:"font-thin",title:"Generation rate: "+r.generation_rate},W(r.generation_rate),9,Eft)])):B("",!0)])])])])])}const dM=it(Tpt,[["render",vft]]),Sft="/";Z.defaults.baseURL="/";const Tft={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:ac,UniversalForm:uc},data(){return{bUrl:Sft,isMounted:!1,show:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},mountedPers:{get(){return this.$store.state.mountedPers},set(n){this.$store.commit("setMountedPers",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{async handleOnTalk(){const n=this.mountedPers;console.log("pers:",n),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating);let e=await Z.get("/get_generation_status",{});if(e)if(e.data.status)console.log("Already generating");else{const t=this.$store.state.config.personalities.findIndex(i=>i===n.full_path),s={client_id:this.$store.state.client_id,id:t};e=await Z.post("/select_personality",s),console.log("Generating message from ",e.data.status),Ye.emit("generate_msg_from",{id:-1})}},async remount_personality(){const n=this.mountedPers;if(console.log("Remounting personality ",n),!n)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this.$store.state.client_id,category:n.category,folder:n.folder,language:n.language};console.log("after");const t=await Z.post("/remount_personality",e);if(console.log("Remounting personality executed:",t),t)return console.log("Remounting personality res"),this.$store.state.toast.showToast("Personality remounted",4,!0),t.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},onSettingsPersonality(n){try{Z.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+n.name,"Save changes","Cancel").then(t=>{try{Z.post("/set_active_personality_settings",t).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. `+s,4,!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses. Endpoint error: `+s.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},toggleShowPersList(){this.onShowPersList()},async constructor(){for(Le(()=>{Ve.replace()});this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await Z.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=mp}}},xft={class:"w-fit flex select-none"},Cft={class:"w-fit flex select-none"},wft={class:"w-8 h-8 group relative"},Rft=["src","title"],Aft={class:"opacity-0 group-hover:opacity-100"};function Nft(n,e,t,s,i,r){const o=et("UniversalForm");return T(),w(Be,null,[l("div",xft,[l("div",Cft,[l("div",wft,[l("img",{src:i.bUrl+r.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 hover:scale-150 active:scale-90 hover:z-50 hover:-translate-y-2 duration-150 border-secondary cursor-pointer",title:"Active personality: "+r.mountedPers.name,onClick:e[1]||(e[1]=a=>r.onSettingsPersonality(r.mountedPers))},null,40,Rft),l("div",Aft,[n.personalityHoveredIndex===n.index?(T(),w("button",{key:0,class:"z-50 -top-1 group-hover:translate-x-5 border-gray-500 absolute active:scale-90 w-7 h-7 hover:scale-150 transition bg-bg-light dark:bg-bg-dark rounded-full border-2",onClick:e[2]||(e[2]=K(a=>r.remount_personality(),["prevent"]))},e[5]||(e[5]=[l("span",{title:"Remount"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-0 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 30 30",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[l("g",{id:"surface1"},[l("path",{style:{},d:"M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z "})])])],-1)]))):B("",!0),n.personalityHoveredIndex===n.index?(T(),w("button",{key:1,class:"-top-1 group-hover:-translate-x-12 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",onClick:e[3]||(e[3]=K(a=>r.handleOnTalk(),["prevent"]))},e[6]||(e[6]=[l("span",{title:"Talk"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 24 24",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[l("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),l("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})])],-1)]))):B("",!0),l("div",{class:"top-0 group-hover:-translate-x-8 group-hover:-translate-y-8 left-0 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-500 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",onClick:e[4]||(e[4]=K((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+W(r.mountedPersArr.length-1),1)])])])]),z(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const Mft=it(Tft,[["render",Nft]]),Oft="/";Z.defaults.baseURL="/";const Ift={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:Y0,Toast:ac,UniversalForm:uc},name:"MountedPersonalitiesList",data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},bUrl:Oft,isMounted:!1,isLoading:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{async onCopyToCustom(n){await Z.post("/copy_to_custom_personas",{client_id:this.$store.state.client_id,category:n.personality.category,name:n.personality.name})},onCopyPersonalityName(n){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},toggleShowPersList(){this.onShowPersList()},async constructor(){},async api_get_req(n){try{const e=await Z.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=mp},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,Z.post("/reinstall_personality",{name:n.personality.full_path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$refs.toast.showToast("Personality reinstalled successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall personality `+e.message,4,!1),{status:!1}))},editPersonality(n){n=n.personality,Z.post("/get_personality_config",{client_id:this.$store.state.client_id,category:n.category,name:n.folder}).then(e=>{const t=e.data;console.log("Done"),t.status?(this.$store.state.currentPersonConfig=t.config,this.$store.state.showPersonalityEditor=!0,this.$store.state.personality_editor.showPanel(),this.$store.state.selectedPersonality=n):console.error(t.error)}).catch(e=>{console.error(e)})},onPersonalityMounted(n){this.mountPersonality(n)},onPersonalityUnMounted(n){this.unmountPersonality(n)},onPersonalityRemount(n){this.reMountPersonality(n)},async handleOpenFolder(n){const e={client_id:this.$store.state.client_id,personality_folder:n.personality.category+"/"+n.personality.folder};console.log(e),await Z.post("/open_personality_folder",e)},async handleOnTalk(n){if(Ve.replace(),console.log("ppa",n),n){if(n.isMounted){const e=await this.select_personality(n);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: @@ -188,14 +188,14 @@ If You are using windows, this will install wsl so you need to activate it. Error: `+e.error,4,!1))},async reMountPersonality(n){if(console.log("remount pers",n),!n)return;if(!this.configFile.personalities.includes(n.personality.full_path)){this.$refs.toast.showToast("Personality not mounted",4,!1);return}const e=await this.remount_personality(n.personality);console.log("remount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality remounted",4,!0),n.isMounted=!0,this.onMounted(this),(await this.select_personality(n.personality)).status&&this.$refs.toast.showToast(`Selected personality: `+n.personality.name,4,!0),this.getMountedPersonalities()):(n.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality Error: `+e.error,4,!1))},async unmountPersonality(n){if(!n)return;console.log(`Unmounting ${JSON.stringify(n.personality)}`);const e=await this.unmount_personality(n.personality);if(e.status){console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities;const t=this.configFile.personalities[this.configFile.active_personality_id],s=this.personalities.findIndex(a=>a.full_path==t),i=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path),r=this.personalities[s];r.isMounted=!1,r.selected=!0,this.$refs.personalitiesZoo[i].isMounted=!1,this.getMountedPersonalities(),(await this.select_personality(r)).status&&Ve.replace(),this.$refs.toast.showToast("Personality unmounted",4,!0),this.onUnMounted(this)}else this.$refs.toast.showToast(`Could not unmount personality -Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let n=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==t),i=this.personalities[s];if(i)console.log("adding from config"),n.push(i);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];n.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=n,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;ei.full_path==t);if(console.log("discussionPersonalities -includes",s),console.log("discussionPersonalities -mounted list",this.mountedPersArr),s==-1){const i=this.personalities.findIndex(o=>o.full_path==t),r=this.personalities[i];console.log("adding discucc121",r,t),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},kft={class:"text-left overflow-visible text-base font-semibold cursor-pointer select-none items-center flex flex-col flex-grow w-full overflow-x-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},Dft={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},Lft={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},Pft={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function Fft(n,e,t,s,i,r){const o=et("personality-entry"),a=et("Toast"),c=et("UniversalForm");return T(),w("div",kft,[i.isLoading?(T(),w("div",Dft,e[1]||(e[1]=[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),l("span",{class:"sr-only"},"Loading...",-1)]))):B("",!0),l("div",null,[r.mountedPersArr.length>0?(T(),w("div",{key:0,class:Ue(i.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[l("button",{class:"mt-0 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Close personality list",type:"button",onClick:e[0]||(e[0]=K((...d)=>r.toggleShowPersList&&r.toggleShowPersList(...d),["stop"]))},e[2]||(e[2]=[l("i",{"data-feather":"chevron-down"},null,-1)])),l("label",Lft," Mounted Personalities: ("+W(r.mountedPersArr.length)+") ",1),l("div",Pft,[z(ri,{name:"bounce"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(this.$store.state.mountedPersArr,(d,u)=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+u+"-"+d.name,personality:d,full_path:d.full_path,select_language:!1,selected:r.configFile.personalities[r.configFile.active_personality_id]===d.full_path||r.configFile.personalities[r.configFile.active_personality_id]===d.full_path+":"+d.language,"on-selected":r.onPersonalitySelected,"on-mount":r.onPersonalityMounted,"on-edit":r.editPersonality,"on-un-mount":r.onPersonalityUnMounted,"on-remount":r.onPersonalityRemount,"on-settings":r.onSettingsPersonality,"on-reinstall":r.onPersonalityReinstall,"on-talk":r.handleOnTalk,"on-copy-personality-name":r.onCopyPersonalityName,"on-copy-to_custom":r.onCopyToCustom,"on-open-folder":r.handleOpenFolder},null,8,["personality","full_path","selected","on-selected","on-mount","on-edit","on-un-mount","on-remount","on-settings","on-reinstall","on-talk","on-copy-personality-name","on-copy-to_custom","on-open-folder"]))),128))]),_:1})])],2)):B("",!0)]),z(a,{ref:"toast"},null,512),z(c,{ref:"universalForm",class:"z-20"},null,512)])}const Uft=it(Ift,[["render",Fft],["__scopeId","data-v-f44002af"]]),Bft={components:{InteractiveMenu:q0},props:{commandsList:{type:Array,required:!0},sendCommand:Function,onShowToastMessage:Function},data(){return{loading:!1,selectedFile:null,showMenu:!1,showHelpText:!1,helpText:"",commands:[]}},async mounted(){this.commands=this.commandsList,console.log("Commands",this.commands),document.addEventListener("click",this.handleClickOutside),Le(()=>{Ve.replace()})},methods:{isHTML(n){const t=new DOMParser().parseFromString(n,"text/html");return Array.from(t.body.childNodes).some(s=>s.nodeType===Node.ELEMENT_NODE)},selectFile(n,e){const t=document.createElement("input");t.type="file",t.accept=n,t.onchange=s=>{this.selectedFile=s.target.files[0],console.log("File selected"),e()},t.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const t={filename:this.selectedFile.name,fileData:e.result};qe.on("file_received",s=>{s.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file -`+s.error,4,!1),this.loading=!1,qe.off("file_received")}),qe.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){Le(()=>{Ve.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(n){this.showMenu=!this.showMenu,n.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(n.hasOwnProperty("file_types")?n.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(n.value)},handleClickOutside(n){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(n.target)&&(this.showMenu=!1)}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},Gft={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"};function Vft(n,e,t,s,i,r){const o=et("InteractiveMenu");return i.loading?(T(),w("div",Gft,e[0]||(e[0]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):(T(),at(o,{key:1,commands:t.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const zft=it(Bft,[["render",Vft],["__scopeId","data-v-1a32c141"]]),Hft="data:image/svg+xml,%3csvg%20aria-hidden='true'%20class='w-6%20h-6%20animate-spin%20fill-secondary'%20viewBox='0%200%20100%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M100%2050.5908C100%2078.2051%2077.6142%20100.591%2050%20100.591C22.3858%20100.591%200%2078.2051%200%2050.5908C0%2022.9766%2022.3858%200.59082%2050%200.59082C77.6142%200.59082%20100%2022.9766%20100%2050.5908ZM9.08144%2050.5908C9.08144%2073.1895%2027.4013%2091.5094%2050%2091.5094C72.5987%2091.5094%2090.9186%2073.1895%2090.9186%2050.5908C90.9186%2027.9921%2072.5987%209.67226%2050%209.67226C27.4013%209.67226%209.08144%2027.9921%209.08144%2050.5908Z'%20fill='currentColor'%20/%3e%3cpath%20d='M93.9676%2039.0409C96.393%2038.4038%2097.8624%2035.9116%2097.0079%2033.5539C95.2932%2028.8227%2092.871%2024.3692%2089.8167%2020.348C85.8452%2015.1192%2080.8826%2010.7238%2075.2124%207.41289C69.5422%204.10194%2063.2754%201.94025%2056.7698%201.05124C51.7666%200.367541%2046.6976%200.446843%2041.7345%201.27873C39.2613%201.69328%2037.813%204.19778%2038.4501%206.62326C39.0873%209.04874%2041.5694%2010.4717%2044.0505%2010.1071C47.8511%209.54855%2051.7191%209.52689%2055.5402%2010.0491C60.8642%2010.7766%2065.9928%2012.5457%2070.6331%2015.2552C75.2735%2017.9648%2079.3347%2021.5619%2082.5849%2025.841C84.9175%2028.9121%2086.7997%2032.2913%2088.1811%2035.8758C89.083%2038.2158%2091.5421%2039.6781%2093.9676%2039.0409Z'%20fill='currentFill'%20/%3e%3c/svg%3e";console.log("modelImgPlaceholder:",Ls);const qft="/",Yft={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{UniversalForm:uc,MountedPersonalities:Mft,MountedPersonalitiesList:Uft,PersonalitiesCommands:zft,ChatBarButton:GN},setup(){},data(){return{is_rt:!1,bindingHoveredIndex:null,modelHoveredIndex:null,personalityHoveredIndex:null,loader_v0:Hft,sendGlobe:cM,modelImgPlaceholder:Ls,bUrl:qft,message:"",selecting_binding:!1,selecting_model:!1,selectedModel:"",isListeningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,showPersonalities:!1,personalities_ready:!1,models_menu_icon:"",posts_headers:{accept:"application/json","Content-Type":"application/json"}}},computed:{isDataSourceNamesValid(){return console.log("dataSourceNames:",this.dataSourceNames),console.log("Type of dataSourceNames:",typeof this.dataSourceNames),Array.isArray(this.dataSourceNames)&&this.dataSourceNames.length>0},dataSourceNames(){console.log("dataSourceNames",this.$store.state.config.rag_databases);const n=this.$store.state.config.rag_databases.map(e=>{console.log("entry",e);const t=e.split("::");console.log("extracted",t[0]);const i=e.endsWith("mounted")?"feather:check":"";return console.log("icon decision",i),{name:t[0],value:t[0]||"default_value",icon:i,help:"mounts the database"}});return console.log("formatted data sources",n),n},currentBindingIcon(){return this.currentBinding.icon||this.modelImgPlaceholder},currentBinding(){return this.$store.state.currentBinding||{}},currentModel(){return this.$store.state.currentModel||{}},currentModelIcon(){return this.currentModel.icon||this.modelImgPlaceholder},installedBindings(){return this.$store.state.installedBindings},installedModels(){return this.$store.state.installedModels},mountedPersonalities(){return this.$store.state.mountedPersArr},binding_name(){return this.$store.state.config.binding_name},model_name(){return this.$store.state.config.model_name},personality_name(){return this.$store.state.config.active_personality_id},config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let n=[];for(let e=0;e0&&this.addFiles(t)},toggleSwitch(){this.$store.state.config.activate_internet_search=!this.$store.state.config.activate_internet_search,this.isLoading=!0,Z.post("/apply_settings",{config:this.$store.state.config}).then(n=>{this.isLoading=!1,n.data.status?(this.$store.state.config.activate_internet_search?this.$store.state.toast.showToast("Websearch activated.",4,!0):this.$store.state.toast.showToast("Websearch deactivated.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Le(()=>{Ve.replace()})})},copyModelName(){navigator.clipboard.writeText(this.binding_name+"::"+this.model_name),this.$store.state.toast.showToast("Model name copyed to clipboard: "+this.binding_name+"::"+this.model_name,4,!0)},copyModelNameFrom(n){navigator.clipboard.writeText(this.binding_name+"::"+n),this.$store.state.toast.showToast("Model name copyed to clipboard: "+this.binding_name+"::"+this.model_name,4,!0)},showModelConfig(){try{this.isLoading=!0,Z.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(console.log("binding sett",n),n.data&&Object.keys(n.data).length>0?this.$refs.universalForm.showForm(n.data,"Binding settings ","Save changes","Cancel").then(e=>{try{Z.post("/set_active_binding_settings",{client_id:this.$store.state.client_id,settings:e}).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. +Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let n=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==t),i=this.personalities[s];if(i)console.log("adding from config"),n.push(i);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];n.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=n,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;ei.full_path==t);if(console.log("discussionPersonalities -includes",s),console.log("discussionPersonalities -mounted list",this.mountedPersArr),s==-1){const i=this.personalities.findIndex(o=>o.full_path==t),r=this.personalities[i];console.log("adding discucc121",r,t),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},kft={class:"text-left overflow-visible text-base font-semibold cursor-pointer select-none items-center flex flex-col flex-grow w-full overflow-x-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},Dft={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},Lft={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},Pft={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function Fft(n,e,t,s,i,r){const o=et("personality-entry"),a=et("Toast"),c=et("UniversalForm");return T(),w("div",kft,[i.isLoading?(T(),w("div",Dft,e[1]||(e[1]=[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),l("span",{class:"sr-only"},"Loading...",-1)]))):B("",!0),l("div",null,[r.mountedPersArr.length>0?(T(),w("div",{key:0,class:Ue(i.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[l("button",{class:"mt-0 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Close personality list",type:"button",onClick:e[0]||(e[0]=K((...d)=>r.toggleShowPersList&&r.toggleShowPersList(...d),["stop"]))},e[2]||(e[2]=[l("i",{"data-feather":"chevron-down"},null,-1)])),l("label",Lft," Mounted Personalities: ("+W(r.mountedPersArr.length)+") ",1),l("div",Pft,[z(ri,{name:"bounce"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(this.$store.state.mountedPersArr,(d,u)=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+u+"-"+d.name,personality:d,full_path:d.full_path,select_language:!1,selected:r.configFile.personalities[r.configFile.active_personality_id]===d.full_path||r.configFile.personalities[r.configFile.active_personality_id]===d.full_path+":"+d.language,"on-selected":r.onPersonalitySelected,"on-mount":r.onPersonalityMounted,"on-edit":r.editPersonality,"on-un-mount":r.onPersonalityUnMounted,"on-remount":r.onPersonalityRemount,"on-settings":r.onSettingsPersonality,"on-reinstall":r.onPersonalityReinstall,"on-talk":r.handleOnTalk,"on-copy-personality-name":r.onCopyPersonalityName,"on-copy-to_custom":r.onCopyToCustom,"on-open-folder":r.handleOpenFolder},null,8,["personality","full_path","selected","on-selected","on-mount","on-edit","on-un-mount","on-remount","on-settings","on-reinstall","on-talk","on-copy-personality-name","on-copy-to_custom","on-open-folder"]))),128))]),_:1})])],2)):B("",!0)]),z(a,{ref:"toast"},null,512),z(c,{ref:"universalForm",class:"z-20"},null,512)])}const Uft=it(Ift,[["render",Fft],["__scopeId","data-v-f44002af"]]),Bft={components:{InteractiveMenu:q0},props:{commandsList:{type:Array,required:!0},sendCommand:Function,onShowToastMessage:Function},data(){return{loading:!1,selectedFile:null,showMenu:!1,showHelpText:!1,helpText:"",commands:[]}},async mounted(){this.commands=this.commandsList,console.log("Commands",this.commands),document.addEventListener("click",this.handleClickOutside),Le(()=>{Ve.replace()})},methods:{isHTML(n){const t=new DOMParser().parseFromString(n,"text/html");return Array.from(t.body.childNodes).some(s=>s.nodeType===Node.ELEMENT_NODE)},selectFile(n,e){const t=document.createElement("input");t.type="file",t.accept=n,t.onchange=s=>{this.selectedFile=s.target.files[0],console.log("File selected"),e()},t.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const t={filename:this.selectedFile.name,fileData:e.result};Ye.on("file_received",s=>{s.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file +`+s.error,4,!1),this.loading=!1,Ye.off("file_received")}),Ye.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){Le(()=>{Ve.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(n){this.showMenu=!this.showMenu,n.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(n.hasOwnProperty("file_types")?n.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(n.value)},handleClickOutside(n){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(n.target)&&(this.showMenu=!1)}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},Gft={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"};function Vft(n,e,t,s,i,r){const o=et("InteractiveMenu");return i.loading?(T(),w("div",Gft,e[0]||(e[0]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):(T(),at(o,{key:1,commands:t.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const zft=it(Bft,[["render",Vft],["__scopeId","data-v-1a32c141"]]),Hft="data:image/svg+xml,%3csvg%20aria-hidden='true'%20class='w-6%20h-6%20animate-spin%20fill-secondary'%20viewBox='0%200%20100%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M100%2050.5908C100%2078.2051%2077.6142%20100.591%2050%20100.591C22.3858%20100.591%200%2078.2051%200%2050.5908C0%2022.9766%2022.3858%200.59082%2050%200.59082C77.6142%200.59082%20100%2022.9766%20100%2050.5908ZM9.08144%2050.5908C9.08144%2073.1895%2027.4013%2091.5094%2050%2091.5094C72.5987%2091.5094%2090.9186%2073.1895%2090.9186%2050.5908C90.9186%2027.9921%2072.5987%209.67226%2050%209.67226C27.4013%209.67226%209.08144%2027.9921%209.08144%2050.5908Z'%20fill='currentColor'%20/%3e%3cpath%20d='M93.9676%2039.0409C96.393%2038.4038%2097.8624%2035.9116%2097.0079%2033.5539C95.2932%2028.8227%2092.871%2024.3692%2089.8167%2020.348C85.8452%2015.1192%2080.8826%2010.7238%2075.2124%207.41289C69.5422%204.10194%2063.2754%201.94025%2056.7698%201.05124C51.7666%200.367541%2046.6976%200.446843%2041.7345%201.27873C39.2613%201.69328%2037.813%204.19778%2038.4501%206.62326C39.0873%209.04874%2041.5694%2010.4717%2044.0505%2010.1071C47.8511%209.54855%2051.7191%209.52689%2055.5402%2010.0491C60.8642%2010.7766%2065.9928%2012.5457%2070.6331%2015.2552C75.2735%2017.9648%2079.3347%2021.5619%2082.5849%2025.841C84.9175%2028.9121%2086.7997%2032.2913%2088.1811%2035.8758C89.083%2038.2158%2091.5421%2039.6781%2093.9676%2039.0409Z'%20fill='currentFill'%20/%3e%3c/svg%3e";console.log("modelImgPlaceholder:",Ls);const qft="/",Yft={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{UniversalForm:uc,MountedPersonalities:Mft,MountedPersonalitiesList:Uft,PersonalitiesCommands:zft,ChatBarButton:GN},setup(){},data(){return{is_rt:!1,bindingHoveredIndex:null,modelHoveredIndex:null,personalityHoveredIndex:null,loader_v0:Hft,sendGlobe:cM,modelImgPlaceholder:Ls,bUrl:qft,message:"",selecting_binding:!1,selecting_model:!1,selectedModel:"",isListeningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,showPersonalities:!1,personalities_ready:!1,models_menu_icon:"",posts_headers:{accept:"application/json","Content-Type":"application/json"}}},computed:{isDataSourceNamesValid(){return console.log("dataSourceNames:",this.dataSourceNames),console.log("Type of dataSourceNames:",typeof this.dataSourceNames),Array.isArray(this.dataSourceNames)&&this.dataSourceNames.length>0},dataSourceNames(){console.log("dataSourceNames",this.$store.state.config.rag_databases);const n=this.$store.state.config.rag_databases.map(e=>{console.log("entry",e);const t=e.split("::");console.log("extracted",t[0]);const i=e.endsWith("mounted")?"feather:check":"";return console.log("icon decision",i),{name:t[0],value:t[0]||"default_value",icon:i,help:"mounts the database"}});return console.log("formatted data sources",n),n},currentBindingIcon(){return this.currentBinding.icon||this.modelImgPlaceholder},currentBinding(){return this.$store.state.currentBinding||{}},currentModel(){return this.$store.state.currentModel||{}},currentModelIcon(){return this.currentModel.icon||this.modelImgPlaceholder},installedBindings(){return this.$store.state.installedBindings},installedModels(){return this.$store.state.installedModels},mountedPersonalities(){return this.$store.state.mountedPersArr},binding_name(){return this.$store.state.config.binding_name},model_name(){return this.$store.state.config.model_name},personality_name(){return this.$store.state.config.active_personality_id},config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let n=[];for(let e=0;e0&&this.addFiles(t)},toggleSwitch(){this.$store.state.config.activate_internet_search=!this.$store.state.config.activate_internet_search,this.isLoading=!0,Z.post("/apply_settings",{config:this.$store.state.config}).then(n=>{this.isLoading=!1,n.data.status?(this.$store.state.config.activate_internet_search?this.$store.state.toast.showToast("Websearch activated.",4,!0):this.$store.state.toast.showToast("Websearch deactivated.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Le(()=>{Ve.replace()})})},copyModelName(){navigator.clipboard.writeText(this.binding_name+"::"+this.model_name),this.$store.state.toast.showToast("Model name copyed to clipboard: "+this.binding_name+"::"+this.model_name,4,!0)},copyModelNameFrom(n){navigator.clipboard.writeText(this.binding_name+"::"+n),this.$store.state.toast.showToast("Model name copyed to clipboard: "+this.binding_name+"::"+this.model_name,4,!0)},showModelConfig(){try{this.isLoading=!0,Z.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(console.log("binding sett",n),n.data&&Object.keys(n.data).length>0?this.$refs.universalForm.showForm(n.data,"Binding settings ","Save changes","Cancel").then(e=>{try{Z.post("/set_active_binding_settings",{client_id:this.$store.state.client_id,settings:e}).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. `+t,4,!1),this.isLoading=!1)})}catch(t){this.$store.state.toast.showToast(`Did not get binding settings responses. Endpoint error: `+t.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(n){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},async remount_personality(n){if(console.log("Remounting personality ",n),!n)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this.$store.state.client_id,category:n.category,folder:n.folder,language:n.language};console.log("after");const t=await Z.post("/remount_personality",e);if(console.log("Remounting personality executed:",t),t)return console.log("Remounting personality res"),this.$store.state.toast.showToast("Personality remounted",4,!0),t.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},async unmountPersonality(n){if(console.log("Unmounting personality:",n),!n)return;const e=await this.unmount_personality(n.personality||n);if(console.log(e),e.status){this.$store.state.config.personalities=e.personalities,this.$store.state.toast.showToast("Personality unmounted",4,!0),this.$store.dispatch("refreshMountedPersonalities");const t=this.$store.state.mountedPersArr[this.$store.state.mountedPersArr.length-1];console.log(t,this.$store.state.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this.$store.state.toast.showToast(`Selected personality: `+t.name,4,!0)}else this.$store.state.toast.showToast(`Could not unmount personality Error: `+e.error,4,!1)},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={client_id:this.$store.state.client_id,language:n.language,category:n.category,folder:n.folder};try{const t=await Z.post("/unmount_personality",e);if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async showBindingHoveredIn(n){this.bindingHoveredIndex=n},async showBindingHoveredOut(){this.bindingHoveredIndex=null},async showModelHoveredIn(n){this.modelHoveredIndex=n},async showModelHoveredOut(){this.modelHoveredIndex=null},async showPersonalityHoveredIn(n){this.personalityHoveredIndex=n},async showPersonalityHoveredOut(){this.personalityHoveredIndex=null},async onPersonalitySelected(n){if(n){if(n.selected){this.$store.state.toast.showToast("Personality already selected",4,!0);return}const e=n.language===null?n.full_path:n.full_path+":"+n.language;if(console.log("pers_path",e),console.log("this.$store.state.config.personalities",this.$store.state.config.personalities),this.$store.state.config.personalities.includes(e)){const t=await this.select_personality(n);await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshBindings"),await this.$store.dispatch("refreshModelsZoo"),await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshMountedPersonalities"),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("fetchLanguages"),await this.$store.dispatch("fetchLanguage"),await this.$store.dispatch("fetchisRTOn"),console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this.$store.state.toast.showToast(`Selected personality: `+n.name,4,!0):this.$store.state.toast.showToast(`Error on select personality: -`+n.name,4,!1)}else console.log("mounting pers");this.$emit("personalitySelected"),Le(()=>{Ve.replace()})}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};const e=n.language===null?n.full_path:n.full_path+":"+n.language;console.log("Selecting personality ",e);const t=this.$store.state.config.personalities.findIndex(i=>i===e),s={client_id:this.$store.state.client_id,id:t};try{const i=await Z.post("/select_personality",s);if(i)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),i.data}catch(i){console.log(i.message,"select_personality - settings");return}},emitloaded(){this.$emit("loaded")},showModels(n){n.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const t=new MouseEvent("click");e.dispatchEvent(t)},setBinding(n){console.log("Setting binding to "+n.name),this.selecting_binding=!0,this.selectedBinding=n,this.$store.state.messageBox.showBlockingMessage("Loading binding"),Z.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"binding_name",setting_value:n.name}).then(async e=>{this.$store.state.messageBox.hideMessage(),console.log("UPDATED"),console.log(e),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshBindings"),await this.$store.dispatch("refreshModelsZoo"),await this.$store.dispatch("refreshModels"),this.$store.state.toast.showToast(`Binding changed to ${this.currentBinding.name}`,4,!0),this.selecting_binding=!1}).catch(e=>{this.$store.state.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_binding=!1})},setModel(n){console.log("Setting model to "+n.name),this.selecting_model=!0,this.selectedModel=n,this.$store.state.messageBox.showBlockingMessage("Loading model"),Z.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"model_name",setting_value:n.name}).then(async e=>{this.$store.state.messageBox.hideMessage(),console.log("UPDATED"),console.log(e),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshModels"),this.$store.state.toast.showToast(`Model changed to ${this.currentModel.name}`,4,!0),this.selecting_model=!1}).catch(e=>{this.$store.state.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_model=!1})},download_files(){Z.get("/download_files")},remove_file(n){Z.get("/remove_discussion_file",{client_id:this.$store.state.client_id,name:n}).then(e=>{console.log(e)})},clear_files(){Z.post("/clear_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{console.log(n),n.data.state?(this.$store.state.toast.showToast("File removed successfully",4,!0),this.filesList.length=0,this.isFileSentList.length=0,this.totalSize=0):this.$store.state.toast.showToast("Files couldn't be removed",4,!1)})},send_file(n,e){console.log("Send file triggered");const t=new FileReader,s=24*1024;let i=0,r=0;t.onloadend=()=>{if(t.error){console.error("Error reading file:",t.error);return}const a=t.result,c=i+a.byteLength>=n.size;qe.emit("send_file_chunk",{filename:n.name,chunk:a,offset:i,isLastChunk:c,chunkIndex:r}),i+=a.byteLength,r++,c?(console.log("File sent successfully"),this.isFileSentList[this.filesList.length-1]=!0,console.log(this.isFileSentList),this.$store.state.toast.showToast("File uploaded successfully",4,!0),e()):o()};function o(){const a=n.slice(i,i+s);t.readAsArrayBuffer(a)}console.log("Uploading file"),o()},makeAnEmptyUserMessage(){this.$emit("createEmptyUserMessage",this.message),this.message=""},makeAnEmptyAIMessage(){this.$emit("createEmptyAIMessage")},startRTCom(){this.is_rt=!0,console.log("is_rt:",this.is_rt),qe.emit("start_bidirectional_audio_stream"),Le(()=>{Ve.replace()})},stopRTCom(){this.is_rt=!1,console.log("is_rt:",this.is_rt),qe.emit("stop_bidirectional_audio_stream"),Le(()=>{Ve.replace()})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isListeningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onresult=n=>{let e="";for(let t=n.resultIndex;t{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer),this.submit()},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")},onPersonalitiesReadyFun(){this.personalities_ready=!0},onShowPersListFun(n){this.showPersonalities=!this.showPersonalities},handleOnTalk(n){console.log("talking"),this.showPersonalities=!1,this.$store.state.toast.showToast(`Personality ${n.name} is Talking`,4,!0),this.onTalk(n)},onMountFun(n){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(n){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(n){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(n){return Le(()=>{Ve.replace()}),si(n)},removeItem(n){console.log("Removing ",n.name),Z.post("/remove_discussion_file",{client_id:this.$store.state.client_id,name:n.name},{headers:this.posts_headers}).then(()=>{this.filesList=this.filesList.filter(e=>e!=n)}),console.log(this.filesList)},sendMessageEvent(n,e="no_internet"){this.$emit("messageSentEvent",n,e)},sendCMDEvent(n){this.$emit("sendCMDEvent",n)},async mountDB(n){await Z.post("/toggle_mount_rag_database",{client_id:this.$store.state.client_id,database_name:n}),await this.$store.dispatch("refreshConfig"),console.log("Refreshed")},addWebLink(){console.log("Emitting addWebLink"),this.$emit("addWebLink")},add_file(){const n=document.createElement("input");n.type="file",n.style.display="none",n.multiple=!0,document.body.appendChild(n),n.addEventListener("change",()=>{console.log("Calling Add file..."),this.addFiles(n.files),document.body.removeChild(n)}),n.click()},takePicture(){qe.emit("take_picture"),qe.on("picture_taken",()=>{Z.post("/get_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{this.filesList=n.data.files,this.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})})},submitOnEnter(n){this.loading||n.which===13&&(n.preventDefault(),n.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},submitWithInternetSearch(){this.message&&(this.sendMessageEvent(this.message,"internet"),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(n){console.log("Adding files");const e=[...n];let t=0;const s=()=>{if(t>=e.length){console.log(`Files_list: ${this.filesList}`);return}const i=e[t];this.filesList.push(i),this.isFileSentList.push(!1),this.send_file(i,()=>{t++,s()})};s()}},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},model_name:{immediate:!0,handler(n){this.$nextTick(()=>{this.model_name=n})}},showfilesList(){Le(()=>{Ve.replace()})},loading(n,e){Le(()=>{Ve.replace()})},filesList:{handler(n,e){let t=0;if(n.length>0)for(let s=0;s{Ve.replace()}),console.log("Chatbar mounted"),qe.on("rtcom_status_changed",n=>{this.$store.dispatch("fetchisRTOn"),console.log("rtcom_status_changed: ",n.status),console.log("active_tts_service: ",this.$store.state.config.active_tts_service),console.log("is_rt_on: ",this.$store.state.is_rt_on)}),this.$store.dispatch("fetchisRTOn")},activated(){Le(()=>{Ve.replace()})}},$ft={class:"absolute bottom-0 left-0 w-fit min-w-96 w-full justify-center text-center"},Wft={key:0,class:"items-center gap-2 panels-color shadow-sm hover:shadow-none dark:border-gray-800 w-fit"},Kft={class:"flex"},jft=["title"],Qft={key:0},Xft={class:"flex flex-col max-h-64"},Zft=["title"],Jft={class:"flex flex-row items-center gap-1 text-left p-2 text-sm font-medium items-center gap-2 rounded-lg border bg-gray-100 p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-700 hover:bg-primary dark:hover:bg-primary"},e_t={key:0,filesList:"",role:"status"},t_t={class:"flex flex-row items-center"},n_t={class:"whitespace-nowrap"},s_t=["onClick"],i_t={key:1,class:"flex mx-1 w-500"},r_t={class:"whitespace-nowrap flex flex-row gap-2"},o_t={key:2,class:"mx-1"},a_t={key:1,title:"Selecting model",class:"flex flex-row flex-grow justify-end panels-color"},l_t={role:"status"},c_t=["src"],d_t={class:"flex w-fit relative grow w-full"},u_t={class:"relative text-light-text-panel dark:text-dark-text-panel grow flex h-12.5 cursor-pointer select-none items-center gap-2 chatbox-color p-1 shadow-sm hover:shadow-none dark:border-gray-800",tabindex:"0"},p_t={key:0,title:"Waiting for reply"},f_t=["src"],__t={key:1,class:"w-fit group relative"},m_t={class:"hide top-50 hide opacity-0 group-hover:bottom-0 opacity-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},h_t={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},g_t=["onMouseover"],b_t={class:"relative"},y_t=["onClick"],E_t=["src","title"],v_t={class:"group items-center flex flex-row"},S_t=["src","title"],T_t={key:2,class:"w-fit group relative"},x_t={class:"hide top-50 hide opacity-0 group-hover:bottom-0 opacity-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},C_t={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},w_t=["onMouseover"],R_t={class:"relative flex items-center"},A_t={class:"relative group"},N_t=["onClick"],M_t=["src","title"],O_t=["onClick"],I_t={class:"group items-center flex flex-row"},k_t=["src","title"],D_t={key:3,class:"w-fit group relative"},L_t={class:"top-50 hide opacity-0 group-hover:bottom-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},P_t={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},F_t=["onMouseover"],U_t={class:"relative"},B_t=["onClick"],G_t=["src","title"],V_t=["onClick"],z_t=["onClick"],H_t=["onClick"],q_t={class:"w-fit"},Y_t={class:"w-fit"},$_t={class:"relative grow"},W_t={class:"flex items-center space-x-3"};function K_t(n,e,t,s,i,r){const o=et("MountedPersonalitiesList"),a=et("MountedPersonalities"),c=et("PersonalitiesCommands"),d=et("ChatBarButton"),u=et("UniversalForm");return T(),w(Be,null,[l("div",$ft,[i.filesList.length>0||i.showPersonalities?(T(),w("div",Wft,[l("div",Kft,[l("button",{class:"mx-1 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:i.showfilesList?"Hide file list":"Show file list",type:"button",onClick:e[0]||(e[0]=K(_=>i.showfilesList=!i.showfilesList,["stop"]))},e[16]||(e[16]=[l("i",{"data-feather":"list"},null,-1)]),8,jft)]),i.filesList.length>0&&i.showfilesList==!0?(T(),w("div",Qft,[l("div",Xft,[z(ri,{name:"list",tag:"div",class:"flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(i.filesList,(_,m)=>(T(),w("div",{key:m+"-"+_.name},[l("div",{class:"m-1",title:_.name},[l("div",Jft,[i.isFileSentList[m]?B("",!0):(T(),w("div",e_t,e[17]||(e[17]=[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),l("span",{class:"sr-only"},"Loading...",-1)]))),e[19]||(e[19]=l("div",null,[l("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),l("div",{class:Ue(["line-clamp-1 w-3/5",i.isFileSentList[m]?"text-green-500":"text-red-200"])},W(_.name),3),e[20]||(e[20]=l("div",{class:"grow"},null,-1)),l("div",t_t,[l("p",n_t,W(r.computedFileSize(_.size)),1),l("button",{type:"button",title:"Remove item",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:h=>r.removeItem(_)},e[18]||(e[18]=[l("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)]),8,s_t)])])],8,Zft)]))),128))]),_:1})])])):B("",!0),i.filesList.length>0?(T(),w("div",i_t,[l("div",r_t,[e[21]||(e[21]=l("p",{class:"font-bold"}," Total size: ",-1)),Ze(" "+W(i.totalSize)+" ("+W(i.filesList.length)+") ",1)]),e[24]||(e[24]=l("div",{class:"grow"},null,-1)),l("button",{type:"button",title:"Clear all",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:e[1]||(e[1]=(..._)=>r.clear_files&&r.clear_files(..._))},e[22]||(e[22]=[l("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)])),l("button",{type:"button",title:"Download database",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:e[2]||(e[2]=(..._)=>r.download_files&&r.download_files(..._))},e[23]||(e[23]=[l("i",{"data-feather":"download-cloud",class:"w-5 h-5"},null,-1)]))])):B("",!0),i.showPersonalities?(T(),w("div",o_t,[z(o,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mounted":r.onMountFun,"on-un-mounted":r.onUnmountFun,"on-remounted":n.onRemountFun,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mounted","on-un-mounted","on-remounted","on-talk","discussionPersonalities"])])):B("",!0)])):B("",!0),i.selecting_model||i.selecting_binding?(T(),w("div",a_t,[l("div",l_t,[l("img",{src:i.loader_v0,class:"w-50 h-50"},null,8,c_t),e[25]||(e[25]=l("span",{class:"sr-only"},"Selecting model...",-1))])])):B("",!0),l("div",d_t,[l("div",u_t,[t.loading?(T(),w("div",p_t,[l("img",{src:i.loader_v0},null,8,f_t),e[26]||(e[26]=l("div",{role:"status"},[l("span",{class:"sr-only"},"Loading...")],-1))])):B("",!0),t.loading?B("",!0):(T(),w("div",__t,[l("div",m_t,[l("div",h_t,[(T(!0),w(Be,null,Xe(r.installedBindings,(_,m)=>(T(),w("div",{class:"w-fit h-fit inset-0 opacity-100",key:m+"-"+_.name,ref_for:!0,ref:"installedBindings",onMouseover:h=>r.showBindingHoveredIn(m),onMouseleave:e[4]||(e[4]=h=>r.showBindingHoveredOut())},[m!=r.binding_name?(T(),w("div",{key:0,class:Ue(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.bindingHoveredIndex===m?"scale-150":""])},[l("div",b_t,[l("button",{onClick:K(h=>r.setBinding(_),["prevent"]),class:"w-10 h-10 relative"},[l("img",{src:_.icon?_.icon:i.modelImgPlaceholder,onError:e[3]||(e[3]=(...h)=>i.modelImgPlaceholder&&i.modelImgPlaceholder(...h)),class:Ue(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.bindingHoveredIndex===m?"scale-150 ":""+_.name==r.binding_name?"border-secondary":"border-transparent z-0"]),title:_.name},null,42,E_t)],8,y_t)])],2)):B("",!0)],40,g_t))),128))])]),l("div",v_t,[l("button",{onClick:e[5]||(e[5]=K(_=>r.showModelConfig(),["prevent"])),class:"w-8 h-8"},[l("img",{src:r.currentBindingIcon,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-200",title:r.currentBinding?r.currentBinding.name:"unknown"},null,8,S_t)])])])),t.loading?B("",!0):(T(),w("div",T_t,[l("div",x_t,[l("div",C_t,[(T(!0),w(Be,null,Xe(r.installedModels,(_,m)=>(T(),w("div",{class:"w-fit h-fit",key:m+"-"+_.name,ref_for:!0,ref:"installedModels",onMouseover:h=>r.showModelHoveredIn(m),onMouseleave:e[7]||(e[7]=h=>r.showModelHoveredOut())},[m!=r.model_name?(T(),w("div",{key:0,class:Ue(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.modelHoveredIndex===m?"scale-150":""])},[l("div",R_t,[l("div",A_t,[l("button",{onClick:K(h=>r.setModel(_),["prevent"]),class:"w-10 h-10 relative"},[l("img",{src:_.icon?_.icon:i.modelImgPlaceholder,onError:e[6]||(e[6]=(...h)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...h)),class:Ue(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.modelHoveredIndex===m?"scale-150":""+_.name==r.model_name?"border-secondary":"border-transparent z-0"]),title:_.name},null,42,M_t)],8,N_t),i.modelHoveredIndex===m?(T(),w("button",{key:0,onClick:K(h=>r.copyModelNameFrom(_.name),["prevent"]),class:"absolute -top-2 -right-2 bg-blue-500 text-white p-1 rounded-full hover:bg-blue-700 transition duration-300"},e[27]||(e[27]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3 w-3",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),l("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})],-1)]),8,O_t)):B("",!0)])])],2)):B("",!0)],40,w_t))),128))])]),l("div",I_t,[l("button",{onClick:e[8]||(e[8]=K(_=>r.copyModelName(),["prevent"])),class:"w-8 h-8"},[l("img",{src:r.currentModelIcon,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-400",title:r.currentModel?r.currentModel.name:"unknown"},null,8,k_t)])])])),t.loading?B("",!0):(T(),w("div",D_t,[l("div",L_t,[l("div",P_t,[(T(!0),w(Be,null,Xe(r.mountedPersonalities,(_,m)=>(T(),w("div",{class:"w-fit h-fit inset-0 opacity-100",key:m+"-"+_.name,ref_for:!0,ref:"mountedPersonalities",onMouseover:h=>r.showPersonalityHoveredIn(m),onMouseleave:e[10]||(e[10]=h=>r.showPersonalityHoveredOut())},[m!=r.personality_name?(T(),w("div",{key:0,class:Ue(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.personalityHoveredIndex===m?"scale-150":""])},[l("div",U_t,[l("button",{onClick:K(h=>r.onPersonalitySelected(_),["prevent"]),class:"w-10 h-10 relative"},[l("img",{src:i.bUrl+_.avatar,onError:e[9]||(e[9]=(...h)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...h)),class:Ue(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.personalityHoveredIndex===m?"scale-150 ":""+this.$store.state.active_personality_id==this.$store.state.personalities.indexOf(_.full_path)?"border-secondary":"border-transparent z-0"]),title:_.name},null,42,G_t)],8,B_t),i.personalityHoveredIndex===m?(T(),w("button",{key:0,onClick:K(h=>r.unmountPersonality(_),["prevent"])},e[28]||(e[28]=[l("span",{class:"-top-6 -right-6 border-gray-500 absolute active:scale-90 w-7 h-7 hover:scale-150 transition bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Unmount personality"},[l("svg",{"aria-hidden":"true",class:"top-1 left-1 relative w-5 h-5 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20","stroke-width":"1",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1)]),8,V_t)):B("",!0),i.personalityHoveredIndex===m?(T(),w("button",{key:1,onClick:K(h=>r.remount_personality(_),["prevent"])},e[29]||(e[29]=[l("span",{class:"-top-9 left-2 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Remount"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-1 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 30 30",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[l("g",{id:"surface1"},[l("path",{style:{},d:"M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z "})])])],-1)]),8,z_t)):B("",!0),i.personalityHoveredIndex===m?(T(),w("button",{key:2,onClick:K(h=>r.handleOnTalk(_),["prevent"])},e[30]||(e[30]=[l("span",{class:"-top-6 -left-6 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Talk"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-1 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 24 24",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[l("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),l("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})])],-1)]),8,H_t)):B("",!0)])],2)):B("",!0)],40,F_t))),128))])]),z(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])])),l("div",q_t,[i.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(T(),at(c,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendCMDEvent,"on-show-toast-message":t.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):B("",!0)]),l("div",Y_t,[r.isDataSourceNamesValid?(T(),at(c,{key:0,icon:"feather:book",commandsList:r.dataSourceNames,sendCommand:r.mountDB,"on-show-toast-message":t.onShowToastMessage,ref:"databasesList"},null,8,["commandsList","sendCommand","on-show-toast-message"])):B("",!0)]),l("div",$_t,[l("form",null,[D(l("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[11]||(e[11]=_=>i.message=_),onPaste:e[12]||(e[12]=(..._)=>r.handlePaste&&r.handlePaste(..._)),onKeydown:e[13]||(e[13]=zs(K(_=>r.submitOnEnter(_),["exact"]),["enter"])),class:"w-full p-3 text-sm text-gray-900 dark:text-white bg-gray-100 dark:bg-gray-700 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Send message..."},null,544),[[ue,i.message]])])]),l("div",W_t,[t.loading?(T(),at(d,{key:0,onClick:r.stopGenerating,class:"bg-red-500 dark:bg-red-600 hover:bg-red-600 dark:hover:bg-red-700"},{icon:Ie(()=>e[31]||(e[31]=[l("svg",{class:"animate-spin h-5 w-5",viewBox:"0 0 24 24"},[l("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),l("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])),default:Ie(()=>[e[32]||(e[32]=l("span",null,"Stop",-1))]),_:1},8,["onClick"])):(T(),at(d,{key:1,onClick:r.submit,title:"Send"},{icon:Ie(()=>e[33]||(e[33]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1)])),_:1},8,["onClick"])),z(d,{onClick:r.submitWithInternetSearch,title:"Send with internet search"},{icon:Ie(()=>e[34]||(e[34]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})],-1)])),_:1},8,["onClick"]),z(d,{onClick:r.startSpeechRecognition,class:Ue({"text-red-500":i.isListeningToVoice}),title:"Voice input"},{icon:Ie(()=>e[35]||(e[35]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})],-1)])),_:1},8,["onClick","class"]),n.$store.state.config.active_tts_service!="None"&&n.$store.state.config.active_tts_service!=null&&this.$store.state.config.active_stt_service!="None"&&this.$store.state.config.active_stt_service!=null?(T(),at(d,{key:2,onClick:e[14]||(e[14]=_=>i.is_rt?r.stopRTCom:r.startRTCom),class:Ue(i.is_rt?"bg-red-500 dark:bg-red-600":"bg-green-500 dark:bg-green-600"),title:"Real-time audio mode"},{icon:Ie(()=>e[36]||(e[36]=[Ze(" 🪶 ")])),_:1},8,["class"])):B("",!0),z(d,{onClick:r.add_file,title:"Send file"},{icon:Ie(()=>e[37]||(e[37]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])),_:1},8,["onClick"]),z(d,{onClick:r.takePicture,title:"Take picture"},{icon:Ie(()=>e[38]||(e[38]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])),_:1},8,["onClick"]),z(d,{onClick:r.addWebLink,title:"Add web link"},{icon:Ie(()=>e[39]||(e[39]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})],-1)])),_:1},8,["onClick"]),z(d,{onClick:r.makeAnEmptyUserMessage,title:"New user message",class:"text-gray-600 dark:text-gray-300"},{icon:Ie(()=>e[40]||(e[40]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1)])),_:1},8,["onClick"]),z(d,{onClick:r.makeAnEmptyAIMessage,title:"New AI message",class:"text-red-400 dark:text-red-300"},{icon:Ie(()=>e[41]||(e[41]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})],-1)])),_:1},8,["onClick"])]),l("input",{type:"file",ref:"fileDialog",onChange:e[15]||(e[15]=(..._)=>r.addFiles&&r.addFiles(..._)),multiple:"",style:{display:"none"}},null,544)]),e[42]||(e[42]=l("div",{class:"ml-auto gap-2"},null,-1))])]),z(u,{ref:"universalForm",class:"z-20"},null,512)],64)}const uM=it(Yft,[["render",K_t],["__scopeId","data-v-fc5a462f"]]),j_t={name:"WelcomeComponent",setup(){const n=XD();return{logoSrc:Je(()=>n.state.config&&n.state.config.app_custom_logo?`/user_infos/${n.state.config.app_custom_logo}`:Us)}}},Q_t={class:"flex flex-col items-center justify-center w-full h-full min-h-screen bg-gradient-to-br from-indigo-100 to-purple-100 dark:from-indigo-900 dark:to-purple-900 p-8"},X_t={class:"text-center max-w-4xl"},Z_t={class:"flex items-center justify-center gap-8 mb-12"},J_t={class:"relative w-24 h-24"},emt=["src"];function tmt(n,e,t,s,i,r){return T(),w("div",Q_t,[l("div",X_t,[l("div",Z_t,[l("div",J_t,[l("img",{src:s.logoSrc,alt:"LoLLMS Logo",class:"w-24 h-24 rounded-full absolute animate-rolling-ball"},null,8,emt)]),e[0]||(e[0]=l("div",{class:"flex flex-col items-start"},[l("h1",{class:"text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 to-purple-600 dark:from-indigo-400 dark:to-purple-400"}," L🪶LLMS "),l("p",{class:"text-2xl text-gray-600 dark:text-gray-300 italic mt-2"}," Lord of Large Language And Multimodal Systems ")],-1))]),e[1]||(e[1]=Pi('

Welcome to L🪶LLMS WebUI

Embark on a journey through the realm of advanced AI with L🪶LLMS, your ultimate companion for intelligent conversations and multimodal interactions. Unleash the power of large language models and explore new frontiers in artificial intelligence.

Discover the capabilities of L🪶LLMS:

  • Engage in natural language conversations
  • Generate creative content and ideas
  • Analyze complex data and provide insights
  • Assist with coding and technical tasks
  • Process and understand multimodal inputs
',1))])])}const pM=it(j_t,[["render",tmt],["__scopeId","data-v-7d44caaa"]]);var nmt=function(){function n(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return n.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},n}(),ou=function(){return ou=Object.assign||function(n){for(var e,t=1,s=arguments.length;t{Ve.replace()})}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};const e=n.language===null?n.full_path:n.full_path+":"+n.language;console.log("Selecting personality ",e);const t=this.$store.state.config.personalities.findIndex(i=>i===e),s={client_id:this.$store.state.client_id,id:t};try{const i=await Z.post("/select_personality",s);if(i)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),i.data}catch(i){console.log(i.message,"select_personality - settings");return}},emitloaded(){this.$emit("loaded")},showModels(n){n.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const t=new MouseEvent("click");e.dispatchEvent(t)},setBinding(n){console.log("Setting binding to "+n.name),this.selecting_binding=!0,this.selectedBinding=n,this.$store.state.messageBox.showBlockingMessage("Loading binding"),Z.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"binding_name",setting_value:n.name}).then(async e=>{this.$store.state.messageBox.hideMessage(),console.log("UPDATED"),console.log(e),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshBindings"),await this.$store.dispatch("refreshModelsZoo"),await this.$store.dispatch("refreshModels"),this.$store.state.toast.showToast(`Binding changed to ${this.currentBinding.name}`,4,!0),this.selecting_binding=!1}).catch(e=>{this.$store.state.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_binding=!1})},setModel(n){console.log("Setting model to "+n.name),this.selecting_model=!0,this.selectedModel=n,this.$store.state.messageBox.showBlockingMessage("Loading model"),Z.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"model_name",setting_value:n.name}).then(async e=>{this.$store.state.messageBox.hideMessage(),console.log("UPDATED"),console.log(e),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshModels"),this.$store.state.toast.showToast(`Model changed to ${this.currentModel.name}`,4,!0),this.selecting_model=!1}).catch(e=>{this.$store.state.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_model=!1})},download_files(){Z.get("/download_files")},remove_file(n){Z.get("/remove_discussion_file",{client_id:this.$store.state.client_id,name:n}).then(e=>{console.log(e)})},clear_files(){Z.post("/clear_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{console.log(n),n.data.state?(this.$store.state.toast.showToast("File removed successfully",4,!0),this.filesList.length=0,this.isFileSentList.length=0,this.totalSize=0):this.$store.state.toast.showToast("Files couldn't be removed",4,!1)})},send_file(n,e){console.log("Send file triggered");const t=new FileReader,s=24*1024;let i=0,r=0;t.onloadend=()=>{if(t.error){console.error("Error reading file:",t.error);return}const a=t.result,c=i+a.byteLength>=n.size;Ye.emit("send_file_chunk",{filename:n.name,chunk:a,offset:i,isLastChunk:c,chunkIndex:r}),i+=a.byteLength,r++,c?(console.log("File sent successfully"),this.isFileSentList[this.filesList.length-1]=!0,console.log(this.isFileSentList),this.$store.state.toast.showToast("File uploaded successfully",4,!0),e()):o()};function o(){const a=n.slice(i,i+s);t.readAsArrayBuffer(a)}console.log("Uploading file"),o()},makeAnEmptyUserMessage(){this.$emit("createEmptyUserMessage",this.message),this.message=""},makeAnEmptyAIMessage(){this.$emit("createEmptyAIMessage")},startRTCom(){this.is_rt=!0,console.log("is_rt:",this.is_rt),Ye.emit("start_bidirectional_audio_stream"),Le(()=>{Ve.replace()})},stopRTCom(){this.is_rt=!1,console.log("is_rt:",this.is_rt),Ye.emit("stop_bidirectional_audio_stream"),Le(()=>{Ve.replace()})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isListeningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onresult=n=>{let e="";for(let t=n.resultIndex;t{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer),this.submit()},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")},onPersonalitiesReadyFun(){this.personalities_ready=!0},onShowPersListFun(n){this.showPersonalities=!this.showPersonalities},handleOnTalk(n){console.log("talking"),this.showPersonalities=!1,this.$store.state.toast.showToast(`Personality ${n.name} is Talking`,4,!0),this.onTalk(n)},onMountFun(n){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(n){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(n){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(n){return Le(()=>{Ve.replace()}),si(n)},removeItem(n){console.log("Removing ",n.name),Z.post("/remove_discussion_file",{client_id:this.$store.state.client_id,name:n.name},{headers:this.posts_headers}).then(()=>{this.filesList=this.filesList.filter(e=>e!=n)}),console.log(this.filesList)},sendMessageEvent(n,e="no_internet"){this.$emit("messageSentEvent",n,e)},sendCMDEvent(n){this.$emit("sendCMDEvent",n)},async mountDB(n){await Z.post("/toggle_mount_rag_database",{client_id:this.$store.state.client_id,database_name:n}),await this.$store.dispatch("refreshConfig"),console.log("Refreshed")},addWebLink(){console.log("Emitting addWebLink"),this.$emit("addWebLink")},add_file(){const n=document.createElement("input");n.type="file",n.style.display="none",n.multiple=!0,document.body.appendChild(n),n.addEventListener("change",()=>{console.log("Calling Add file..."),this.addFiles(n.files),document.body.removeChild(n)}),n.click()},takePicture(){Ye.emit("take_picture"),Ye.on("picture_taken",()=>{Z.post("/get_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{this.filesList=n.data.files,this.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})})},submitOnEnter(n){this.loading||n.which===13&&(n.preventDefault(),n.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},submitWithInternetSearch(){this.message&&(this.sendMessageEvent(this.message,"internet"),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(n){console.log("Adding files");const e=[...n];let t=0;const s=()=>{if(t>=e.length){console.log(`Files_list: ${this.filesList}`);return}const i=e[t];this.filesList.push(i),this.isFileSentList.push(!1),this.send_file(i,()=>{t++,s()})};s()}},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},model_name:{immediate:!0,handler(n){this.$nextTick(()=>{this.model_name=n})}},showfilesList(){Le(()=>{Ve.replace()})},loading(n,e){Le(()=>{Ve.replace()})},filesList:{handler(n,e){let t=0;if(n.length>0)for(let s=0;s{Ve.replace()}),console.log("Chatbar mounted"),Ye.on("rtcom_status_changed",n=>{this.$store.dispatch("fetchisRTOn"),console.log("rtcom_status_changed: ",n.status),console.log("active_tts_service: ",this.$store.state.config.active_tts_service),console.log("is_rt_on: ",this.$store.state.is_rt_on)}),this.$store.dispatch("fetchisRTOn")},activated(){Le(()=>{Ve.replace()})}},$ft={class:"absolute bottom-0 left-0 w-fit min-w-96 w-full justify-center text-center"},Wft={key:0,class:"items-center gap-2 panels-color shadow-sm hover:shadow-none dark:border-gray-800 w-fit"},Kft={class:"flex"},jft=["title"],Qft={key:0},Xft={class:"flex flex-col max-h-64"},Zft=["title"],Jft={class:"flex flex-row items-center gap-1 text-left p-2 text-sm font-medium items-center gap-2 rounded-lg border bg-gray-100 p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-700 hover:bg-primary dark:hover:bg-primary"},e_t={key:0,filesList:"",role:"status"},t_t={class:"flex flex-row items-center"},n_t={class:"whitespace-nowrap"},s_t=["onClick"],i_t={key:1,class:"flex mx-1 w-500"},r_t={class:"whitespace-nowrap flex flex-row gap-2"},o_t={key:2,class:"mx-1"},a_t={key:1,title:"Selecting model",class:"flex flex-row flex-grow justify-end panels-color"},l_t={role:"status"},c_t=["src"],d_t={class:"flex w-fit relative grow w-full"},u_t={class:"relative text-light-text-panel dark:text-dark-text-panel grow flex h-12.5 cursor-pointer select-none items-center gap-2 chatbox-color p-1 shadow-sm hover:shadow-none dark:border-gray-800",tabindex:"0"},p_t={key:0,title:"Waiting for reply"},f_t=["src"],__t={key:1,class:"w-fit group relative"},m_t={class:"hide top-50 hide opacity-0 group-hover:bottom-0 opacity-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},h_t={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},g_t=["onMouseover"],b_t={class:"relative"},y_t=["onClick"],E_t=["src","title"],v_t={class:"group items-center flex flex-row"},S_t=["src","title"],T_t={key:2,class:"w-fit group relative"},x_t={class:"hide top-50 hide opacity-0 group-hover:bottom-0 opacity-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},C_t={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},w_t=["onMouseover"],R_t={class:"relative flex items-center"},A_t={class:"relative group"},N_t=["onClick"],M_t=["src","title"],O_t=["onClick"],I_t={class:"group items-center flex flex-row"},k_t=["src","title"],D_t={key:3,class:"w-fit group relative"},L_t={class:"top-50 hide opacity-0 group-hover:bottom-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},P_t={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},F_t=["onMouseover"],U_t={class:"relative"},B_t=["onClick"],G_t=["src","title"],V_t=["onClick"],z_t=["onClick"],H_t=["onClick"],q_t={class:"w-fit"},Y_t={class:"w-fit"},$_t={class:"relative grow"},W_t={class:"flex items-center space-x-3"};function K_t(n,e,t,s,i,r){const o=et("MountedPersonalitiesList"),a=et("MountedPersonalities"),c=et("PersonalitiesCommands"),d=et("ChatBarButton"),u=et("UniversalForm");return T(),w(Be,null,[l("div",$ft,[i.filesList.length>0||i.showPersonalities?(T(),w("div",Wft,[l("div",Kft,[l("button",{class:"mx-1 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:i.showfilesList?"Hide file list":"Show file list",type:"button",onClick:e[0]||(e[0]=K(_=>i.showfilesList=!i.showfilesList,["stop"]))},e[16]||(e[16]=[l("i",{"data-feather":"list"},null,-1)]),8,jft)]),i.filesList.length>0&&i.showfilesList==!0?(T(),w("div",Qft,[l("div",Xft,[z(ri,{name:"list",tag:"div",class:"flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(i.filesList,(_,m)=>(T(),w("div",{key:m+"-"+_.name},[l("div",{class:"m-1",title:_.name},[l("div",Jft,[i.isFileSentList[m]?B("",!0):(T(),w("div",e_t,e[17]||(e[17]=[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),l("span",{class:"sr-only"},"Loading...",-1)]))),e[19]||(e[19]=l("div",null,[l("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),l("div",{class:Ue(["line-clamp-1 w-3/5",i.isFileSentList[m]?"text-green-500":"text-red-200"])},W(_.name),3),e[20]||(e[20]=l("div",{class:"grow"},null,-1)),l("div",t_t,[l("p",n_t,W(r.computedFileSize(_.size)),1),l("button",{type:"button",title:"Remove item",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:h=>r.removeItem(_)},e[18]||(e[18]=[l("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)]),8,s_t)])])],8,Zft)]))),128))]),_:1})])])):B("",!0),i.filesList.length>0?(T(),w("div",i_t,[l("div",r_t,[e[21]||(e[21]=l("p",{class:"font-bold"}," Total size: ",-1)),Ze(" "+W(i.totalSize)+" ("+W(i.filesList.length)+") ",1)]),e[24]||(e[24]=l("div",{class:"grow"},null,-1)),l("button",{type:"button",title:"Clear all",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:e[1]||(e[1]=(..._)=>r.clear_files&&r.clear_files(..._))},e[22]||(e[22]=[l("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)])),l("button",{type:"button",title:"Download database",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:e[2]||(e[2]=(..._)=>r.download_files&&r.download_files(..._))},e[23]||(e[23]=[l("i",{"data-feather":"download-cloud",class:"w-5 h-5"},null,-1)]))])):B("",!0),i.showPersonalities?(T(),w("div",o_t,[z(o,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mounted":r.onMountFun,"on-un-mounted":r.onUnmountFun,"on-remounted":n.onRemountFun,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mounted","on-un-mounted","on-remounted","on-talk","discussionPersonalities"])])):B("",!0)])):B("",!0),i.selecting_model||i.selecting_binding?(T(),w("div",a_t,[l("div",l_t,[l("img",{src:i.loader_v0,class:"w-50 h-50"},null,8,c_t),e[25]||(e[25]=l("span",{class:"sr-only"},"Selecting model...",-1))])])):B("",!0),l("div",d_t,[l("div",u_t,[t.loading?(T(),w("div",p_t,[l("img",{src:i.loader_v0},null,8,f_t),e[26]||(e[26]=l("div",{role:"status"},[l("span",{class:"sr-only"},"Loading...")],-1))])):B("",!0),t.loading?B("",!0):(T(),w("div",__t,[l("div",m_t,[l("div",h_t,[(T(!0),w(Be,null,Xe(r.installedBindings,(_,m)=>(T(),w("div",{class:"w-fit h-fit inset-0 opacity-100",key:m+"-"+_.name,ref_for:!0,ref:"installedBindings",onMouseover:h=>r.showBindingHoveredIn(m),onMouseleave:e[4]||(e[4]=h=>r.showBindingHoveredOut())},[m!=r.binding_name?(T(),w("div",{key:0,class:Ue(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.bindingHoveredIndex===m?"scale-150":""])},[l("div",b_t,[l("button",{onClick:K(h=>r.setBinding(_),["prevent"]),class:"w-10 h-10 relative"},[l("img",{src:_.icon?_.icon:i.modelImgPlaceholder,onError:e[3]||(e[3]=(...h)=>i.modelImgPlaceholder&&i.modelImgPlaceholder(...h)),class:Ue(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.bindingHoveredIndex===m?"scale-150 ":""+_.name==r.binding_name?"border-secondary":"border-transparent z-0"]),title:_.name},null,42,E_t)],8,y_t)])],2)):B("",!0)],40,g_t))),128))])]),l("div",v_t,[l("button",{onClick:e[5]||(e[5]=K(_=>r.showModelConfig(),["prevent"])),class:"w-8 h-8"},[l("img",{src:r.currentBindingIcon,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-200",title:r.currentBinding?r.currentBinding.name:"unknown"},null,8,S_t)])])])),t.loading?B("",!0):(T(),w("div",T_t,[l("div",x_t,[l("div",C_t,[(T(!0),w(Be,null,Xe(r.installedModels,(_,m)=>(T(),w("div",{class:"w-fit h-fit",key:m+"-"+_.name,ref_for:!0,ref:"installedModels",onMouseover:h=>r.showModelHoveredIn(m),onMouseleave:e[7]||(e[7]=h=>r.showModelHoveredOut())},[m!=r.model_name?(T(),w("div",{key:0,class:Ue(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.modelHoveredIndex===m?"scale-150":""])},[l("div",R_t,[l("div",A_t,[l("button",{onClick:K(h=>r.setModel(_),["prevent"]),class:"w-10 h-10 relative"},[l("img",{src:_.icon?_.icon:i.modelImgPlaceholder,onError:e[6]||(e[6]=(...h)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...h)),class:Ue(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.modelHoveredIndex===m?"scale-150":""+_.name==r.model_name?"border-secondary":"border-transparent z-0"]),title:_.name},null,42,M_t)],8,N_t),i.modelHoveredIndex===m?(T(),w("button",{key:0,onClick:K(h=>r.copyModelNameFrom(_.name),["prevent"]),class:"absolute -top-2 -right-2 bg-blue-500 text-white p-1 rounded-full hover:bg-blue-700 transition duration-300"},e[27]||(e[27]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3 w-3",viewBox:"0 0 20 20",fill:"currentColor"},[l("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),l("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})],-1)]),8,O_t)):B("",!0)])])],2)):B("",!0)],40,w_t))),128))])]),l("div",I_t,[l("button",{onClick:e[8]||(e[8]=K(_=>r.copyModelName(),["prevent"])),class:"w-8 h-8"},[l("img",{src:r.currentModelIcon,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-400",title:r.currentModel?r.currentModel.name:"unknown"},null,8,k_t)])])])),t.loading?B("",!0):(T(),w("div",D_t,[l("div",L_t,[l("div",P_t,[(T(!0),w(Be,null,Xe(r.mountedPersonalities,(_,m)=>(T(),w("div",{class:"w-fit h-fit inset-0 opacity-100",key:m+"-"+_.name,ref_for:!0,ref:"mountedPersonalities",onMouseover:h=>r.showPersonalityHoveredIn(m),onMouseleave:e[10]||(e[10]=h=>r.showPersonalityHoveredOut())},[m!=r.personality_name?(T(),w("div",{key:0,class:Ue(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.personalityHoveredIndex===m?"scale-150":""])},[l("div",U_t,[l("button",{onClick:K(h=>r.onPersonalitySelected(_),["prevent"]),class:"w-10 h-10 relative"},[l("img",{src:i.bUrl+_.avatar,onError:e[9]||(e[9]=(...h)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...h)),class:Ue(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.personalityHoveredIndex===m?"scale-150 ":""+this.$store.state.active_personality_id==this.$store.state.personalities.indexOf(_.full_path)?"border-secondary":"border-transparent z-0"]),title:_.name},null,42,G_t)],8,B_t),i.personalityHoveredIndex===m?(T(),w("button",{key:0,onClick:K(h=>r.unmountPersonality(_),["prevent"])},e[28]||(e[28]=[l("span",{class:"-top-6 -right-6 border-gray-500 absolute active:scale-90 w-7 h-7 hover:scale-150 transition bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Unmount personality"},[l("svg",{"aria-hidden":"true",class:"top-1 left-1 relative w-5 h-5 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20","stroke-width":"1",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1)]),8,V_t)):B("",!0),i.personalityHoveredIndex===m?(T(),w("button",{key:1,onClick:K(h=>r.remount_personality(_),["prevent"])},e[29]||(e[29]=[l("span",{class:"-top-9 left-2 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Remount"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-1 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 30 30",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[l("g",{id:"surface1"},[l("path",{style:{},d:"M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z "})])])],-1)]),8,z_t)):B("",!0),i.personalityHoveredIndex===m?(T(),w("button",{key:2,onClick:K(h=>r.handleOnTalk(_),["prevent"])},e[30]||(e[30]=[l("span",{class:"-top-6 -left-6 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Talk"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-1 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 24 24",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[l("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),l("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})])],-1)]),8,H_t)):B("",!0)])],2)):B("",!0)],40,F_t))),128))])]),z(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])])),l("div",q_t,[i.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(T(),at(c,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendCMDEvent,"on-show-toast-message":t.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):B("",!0)]),l("div",Y_t,[r.isDataSourceNamesValid?(T(),at(c,{key:0,icon:"feather:book",commandsList:r.dataSourceNames,sendCommand:r.mountDB,"on-show-toast-message":t.onShowToastMessage,ref:"databasesList"},null,8,["commandsList","sendCommand","on-show-toast-message"])):B("",!0)]),l("div",$_t,[l("form",null,[D(l("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[11]||(e[11]=_=>i.message=_),onPaste:e[12]||(e[12]=(..._)=>r.handlePaste&&r.handlePaste(..._)),onKeydown:e[13]||(e[13]=zs(K(_=>r.submitOnEnter(_),["exact"]),["enter"])),class:"w-full p-3 text-sm text-gray-900 dark:text-white bg-gray-100 dark:bg-gray-700 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Send message..."},null,544),[[ue,i.message]])])]),l("div",W_t,[t.loading?(T(),at(d,{key:0,onClick:r.stopGenerating,class:"bg-red-500 dark:bg-red-600 hover:bg-red-600 dark:hover:bg-red-700"},{icon:Ie(()=>e[31]||(e[31]=[l("svg",{class:"animate-spin h-5 w-5",viewBox:"0 0 24 24"},[l("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),l("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])),default:Ie(()=>[e[32]||(e[32]=l("span",null,"Stop",-1))]),_:1},8,["onClick"])):(T(),at(d,{key:1,onClick:r.submit,title:"Send"},{icon:Ie(()=>e[33]||(e[33]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1)])),_:1},8,["onClick"])),z(d,{onClick:r.submitWithInternetSearch,title:"Send with internet search"},{icon:Ie(()=>e[34]||(e[34]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})],-1)])),_:1},8,["onClick"]),z(d,{onClick:r.startSpeechRecognition,class:Ue({"text-red-500":i.isListeningToVoice}),title:"Voice input"},{icon:Ie(()=>e[35]||(e[35]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})],-1)])),_:1},8,["onClick","class"]),n.$store.state.config.active_tts_service!="None"&&n.$store.state.config.active_tts_service!=null&&this.$store.state.config.active_stt_service!="None"&&this.$store.state.config.active_stt_service!=null?(T(),at(d,{key:2,onClick:e[14]||(e[14]=_=>i.is_rt?r.stopRTCom:r.startRTCom),class:Ue(i.is_rt?"bg-red-500 dark:bg-red-600":"bg-green-500 dark:bg-green-600"),title:"Real-time audio mode"},{icon:Ie(()=>e[36]||(e[36]=[Ze(" 🪶 ")])),_:1},8,["class"])):B("",!0),z(d,{onClick:r.add_file,title:"Send file"},{icon:Ie(()=>e[37]||(e[37]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])),_:1},8,["onClick"]),z(d,{onClick:r.takePicture,title:"Take picture"},{icon:Ie(()=>e[38]||(e[38]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])),_:1},8,["onClick"]),z(d,{onClick:r.addWebLink,title:"Add web link"},{icon:Ie(()=>e[39]||(e[39]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})],-1)])),_:1},8,["onClick"]),z(d,{onClick:r.makeAnEmptyUserMessage,title:"New user message",class:"text-gray-600 dark:text-gray-300"},{icon:Ie(()=>e[40]||(e[40]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1)])),_:1},8,["onClick"]),z(d,{onClick:r.makeAnEmptyAIMessage,title:"New AI message",class:"text-red-400 dark:text-red-300"},{icon:Ie(()=>e[41]||(e[41]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})],-1)])),_:1},8,["onClick"])]),l("input",{type:"file",ref:"fileDialog",onChange:e[15]||(e[15]=(..._)=>r.addFiles&&r.addFiles(..._)),multiple:"",style:{display:"none"}},null,544)]),e[42]||(e[42]=l("div",{class:"ml-auto gap-2"},null,-1))])]),z(u,{ref:"universalForm",class:"z-20"},null,512)],64)}const uM=it(Yft,[["render",K_t],["__scopeId","data-v-fc5a462f"]]),j_t={name:"WelcomeComponent",setup(){const n=XD();return{logoSrc:Je(()=>n.state.config&&n.state.config.app_custom_logo?`/user_infos/${n.state.config.app_custom_logo}`:Us)}}},Q_t={class:"flex flex-col items-center justify-center w-full h-full min-h-screen bg-gradient-to-br from-indigo-100 to-purple-100 dark:from-indigo-900 dark:to-purple-900 p-8"},X_t={class:"text-center max-w-4xl"},Z_t={class:"flex items-center justify-center gap-8 mb-12"},J_t={class:"relative w-24 h-24"},emt=["src"];function tmt(n,e,t,s,i,r){return T(),w("div",Q_t,[l("div",X_t,[l("div",Z_t,[l("div",J_t,[l("img",{src:s.logoSrc,alt:"LoLLMS Logo",class:"w-24 h-24 rounded-full absolute animate-rolling-ball"},null,8,emt)]),e[0]||(e[0]=l("div",{class:"flex flex-col items-start"},[l("h1",{class:"text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 to-purple-600 dark:from-indigo-400 dark:to-purple-400"}," L🪶LLMS "),l("p",{class:"text-2xl text-gray-600 dark:text-gray-300 italic mt-2"}," Lord of Large Language And Multimodal Systems ")],-1))]),e[1]||(e[1]=Pi('

Welcome to L🪶LLMS WebUI

Embark on a journey through the realm of advanced AI with L🪶LLMS, your ultimate companion for intelligent conversations and multimodal interactions. Unleash the power of large language models and explore new frontiers in artificial intelligence.

Discover the capabilities of L🪶LLMS:

  • Engage in natural language conversations
  • Generate creative content and ideas
  • Analyze complex data and provide insights
  • Assist with coding and technical tasks
  • Process and understand multimodal inputs
',1))])])}const pM=it(j_t,[["render",tmt],["__scopeId","data-v-7d44caaa"]]);var nmt=function(){function n(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return n.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},n}(),ou=function(){return ou=Object.assign||function(n){for(var e,t=1,s=arguments.length;t @@ -260,7 +260,7 @@ Error: `+e.error,4,!1)},async unmount_personality(n){if(!n)return{status:!1,erro ${this.lastMessageHtml} `),e.close()}},async triggerRobotAction(){this.rightPanelCollapsed=!this.rightPanelCollapsed,this.rightPanelCollapsed||(this.leftPanelCollapsed=!0,this.$nextTick(()=>{this.extractHtml()})),console.log(this.rightPanelCollapsed)},add_webpage(){console.log("addWebLink received"),this.$refs.web_url_input_box.showPanel()},addWebpage(){Z.post("/add_webpage",{client_id:this.client_id,url:this.$refs.web_url_input_box.inputText},{headers:this.posts_headers}).then(n=>{n&&n.status&&(console.log("Done"),this.recoverFiles())})},show_progress(n){this.progress_visibility_val=!0},hide_progress(n){this.progress_visibility_val=!1},update_progress(n){console.log("Progress update"),this.progress_value=n.value},onSettingsBinding(){try{this.isLoading=!0,Z.get("/get_active_binding_settings").then(n=>{if(this.isLoading=!1,n)if(n.data&&Object.keys(n.data).length>0){const e=this.$store.state.bindingsZoo.find(t=>t.name==this.state.config.binding_name);this.$store.state.universalForm.showForm(n.data,"Binding settings - "+e.binding.name,"Save changes","Cancel").then(t=>{try{Z.post("/set_active_binding_settings",{client_id:this.$store.state.client_id,settings:t}).then(s=>{s&&s.data?(console.log("binding set with new settings",s.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. `+s,4,!1),this.isLoading=!1)})}catch(s){this.$store.state.toast.showToast(`Did not get binding settings responses. - Endpoint error: `+s.message,4,!1),this.isLoading=!1}})}else this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1})}catch(n){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},showDatabaseSelector(){this.database_selectorDialogVisible=!0},async ondatabase_selectorDialogRemoved(n){console.log("Deleted:",n)},async ondatabase_selectorDialogSelected(n){console.log("Selected:",n)},onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=!1},async onvalidatedatabase_selectorChoice(n){this.database_selectorDialogVisible=!1;const e={client_id:this.client_id,name:typeof n=="string"?n:n.name};if(console.log("data:"),console.log(e),(await Z.post("/select_database",e,{headers:this.posts_headers})).status){console.log("Selected database"),this.$store.state.config=await Z.post("/get_config",{client_id:this.client_id}),console.log("new config loaded :",this.$store.state.config);let s=await Z.get("/list_databases").data;console.log("New list of database: ",s),this.$store.state.databases=s,console.log("New list of database: ",this.$store.state.databases),location.reload()}},async addDiscussion2SkillsLibrary(){(await Z.post("/add_discussion_to_skills_library",{client_id:this.client_id},{headers:this.posts_headers})).status&&console.log("done")},async toggleSkillsLib(){this.$store.state.config.activate_skills_lib=!this.$store.state.config.activate_skills_lib,await this.applyConfiguration()},async showSkillsLib(){this.$refs.skills_lib.showSkillsLibrary()},async applyConfiguration(){this.loading=!0;const n=await Z.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.$store.state.config});this.loading=!1,n.data.status?this.$store.state.toast.showToast("Configuration changed successfully.",4,!0):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Le(()=>{Ve.replace()})},save_configuration(){this.showConfirmation=!1,Z.post("/save_settings",{}).then(n=>{if(n)return n.status?this.$store.state.toast.showToast("Settings saved!",4,!0):this.$store.state.messageBox.showMessage("Error: Couldn't save settings!"),n.data}).catch(n=>(console.log(n.message,"save_configuration"),this.$store.state.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},showToastMessage(n,e,t){console.log("sending",n),this.$store.state.toast.showToast(n,e,t)},togglePanel(){this.leftPanelCollapsed=!this.leftPanelCollapsed,this.leftPanelCollapsed||(this.rightPanelCollapsed=!0)},toggleDropdown(){this.isOpen=!this.isOpen},importChatGPT(){},async api_get_req(n){try{const e=await Z.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},async list_discussions(){try{const n=await Z.get("/list_discussions");if(n)return this.createDiscussionList(n.data),n.data}catch(n){return console.log("Error: Could not list discussions",n.message),[]}},load_discussion(n,e){n&&(console.log("Loading discussion",n),this.loading=!0,this.discussionArr=[],this.setDiscussionLoading(n,this.loading),qe.on("discussion",t=>{console.log("Discussion recovered"),this.loading=!1,this.setDiscussionLoading(n,this.loading),t&&(this.discussionArr=t.filter(s=>s.message_type==this.msgTypes.MSG_TYPE_CONTENT||s.message_type==this.msgTypes.MSG_TYPE_CONTENT_INVISIBLE_TO_AI),this.discussionArr.forEach(s=>{s.status_message="Done"}),console.log("this.discussionArr"),console.log(this.discussionArr),e&&e()),qe.off("discussion"),this.extractHtml()}),qe.emit("load_discussion",{id:n}))},recoverFiles(){console.log("Recovering files"),Z.post("/get_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{this.$refs.chatBox.filesList=n.data.files,this.$refs.chatBox.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.$refs.chatBox.filesList}`)})},new_discussion(n){try{this.loading=!0,qe.on("discussion_created",e=>{qe.off("discussion_created"),this.list_discussions().then(()=>{const t=this.list.findIndex(i=>i.id==e.id),s=this.list[t];this.selectDiscussion(s),this.load_discussion(e.id,()=>{this.loading=!1,this.recoverFiles(),Le(()=>{const i=document.getElementById("dis-"+e.id);this.scrollToElement(i),console.log("Scrolling tp "+i)})})})}),console.log("new_discussion ",n),qe.emit("new_discussion",{title:n})}catch(e){return console.log("Error: Could not create new discussion",e.message),{}}},async delete_discussion(n){try{n&&(this.loading=!0,this.setDiscussionLoading(n,this.loading),await Z.post("/delete_discussion",{client_id:this.client_id,id:n},{headers:this.posts_headers}),this.loading=!1,this.setDiscussionLoading(n,this.loading))}catch(e){console.log("Error: Could not delete discussion",e.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async edit_title(n,e){try{if(n){this.loading=!0,this.setDiscussionLoading(n,this.loading);const t=await Z.post("/edit_title",{client_id:this.client_id,id:n,title:e},{headers:this.posts_headers});if(this.loading=!1,this.setDiscussionLoading(n,this.loading),t.status==200){const s=this.list.findIndex(r=>r.id==n),i=this.list[s];i.title=e,this.tempList=this.list}}}catch(t){console.log("Error: Could not edit title",t.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async make_title(n){try{if(n){this.loading=!0,this.setDiscussionLoading(n,this.loading);const e=await Z.post("/make_title",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(console.log("Making title:",e),this.loading=!1,this.setDiscussionLoading(n,this.loading),e.status==200){const t=this.list.findIndex(i=>i.id==n),s=this.list[t];s.title=e.data.title,this.tempList=this.list}}}catch(e){console.log("Error: Could not edit title",e.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async delete_message(n){try{console.log(typeof n),console.log(typeof this.client_id),console.log(n),console.log(this.client_id);const e=await Z.post("/delete_message",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could delete message",e.message),{}}},async stop_gen(){try{if(this.discussionArr.length>0){const n=this.discussionArr[this.discussionArr.length-1];n.status_message="Generation canceled"}if(qe.emit("cancel_generation"),res)return res.data}catch(n){return console.log("Error: Could not stop generating",n.message),{}}},async message_rank_up(n){try{const e=await Z.post("/message_rank_up",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could not rank up message",e.message),{}}},async message_rank_down(n){try{const e=await Z.post("/message_rank_down",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could not rank down message",e.message),{}}},async edit_message(n,e,t){try{console.log(typeof this.client_id),console.log(typeof n),console.log(typeof e),console.log(typeof{audio_url:t});const s=await Z.post("/edit_message",{client_id:this.client_id,id:n,message:e,metadata:[{audio_url:t}]},{headers:this.posts_headers});if(s)return s.data}catch(s){return console.log("Error: Could not update message",s.message),{}}},async export_multiple_discussions(n,e){try{if(n.length>0){const t=await Z.post("/export_multiple_discussions",{client_id:this.$store.state.client_id,discussion_ids:n,export_format:e},{headers:this.posts_headers});if(t)return t.data}}catch(t){return console.log("Error: Could not export multiple discussions",t.message),{}}},async import_multiple_discussions(n){try{if(n.length>0){console.log("sending import",n);const e=await Z.post("/import_multiple_discussions",{client_id:this.$store.state.client_id,jArray:n},{headers:this.posts_headers});if(e)return console.log("import response",e.data),e.data}}catch(e){console.log("Error: Could not import multiple discussions",e.message);return}},filterDiscussions(){this.filterInProgress||(this.filterInProgress=!0,setTimeout(()=>{this.filterTitle?this.list=this.tempList.filter(n=>n.title&&n.title.includes(this.filterTitle)):this.list=this.tempList,this.filterInProgress=!1},100))},async selectDiscussion(n){if(this.isGenerating){this.$store.state.toast.showToast("You are currently generating a text. Please wait for text generation to finish or stop it before trying to select another discussion",4,!1);return}n&&(this.currentDiscussion===void 0?(this.currentDiscussion=n,this.setPageTitle(n),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(n.id,()=>{this.discussionArr.length>1&&((this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content),this.recoverFiles())})):this.currentDiscussion.id!=n.id&&(console.log("item",n),console.log("this.currentDiscussion",this.currentDiscussion),this.currentDiscussion=n,console.log("this.currentDiscussion",this.currentDiscussion),this.setPageTitle(n),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(n.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content),this.recoverFiles()})),Le(()=>{const e=document.getElementById("dis-"+this.currentDiscussion.id);this.scrollToElementInContainer(e,"leftPanel");const t=document.getElementById("messages-list");this.scrollBottom(t)}))},scrollToElement(n){n?n.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}):console.log("Error: scrollToElement")},scrollToElementInContainer(n,e){try{const t=n.offsetTop;document.getElementById(e).scrollTo({top:t,behavior:"smooth"})}catch{console.log("error")}},scrollBottom(n){n?n.scrollTo({top:n.scrollHeight,behavior:"smooth"}):console.log("Error: scrollBottom")},scrollTop(n){n?n.scrollTo({top:0,behavior:"smooth"}):console.log("Error: scrollTop")},createUserMsg(n){let e={content:n.message,id:n.id,rank:0,sender:n.user,created_at:n.created_at,steps:[],html_js_s:[],status_message:"Warming up"};this.discussionArr.push(e),Le(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},updateLastUserMsg(n){const e=this.discussionArr.indexOf(s=>s.id=n.user_id),t={binding:n.binding,content:n.message,created_at:n.created_at,type:n.type,finished_generating_at:n.finished_generating_at,id:n.user_id,model:n.model,personality:n.personality,sender:n.user,steps:[]};e!==-1&&(this.discussionArr[e]=t)},async socketIOConnected(){console.log("socketIOConnected")},socketIODisconnected(){return console.log("socketIOConnected"),this.currentDiscussion=null,this.$store.dispatch("refreshModels"),this.$store.state.isConnected=!1,!0},new_message(n){n.sender_type==this.SENDER_TYPES_AI&&(this.isGenerating=!0),console.log("Making a new message"),console.log("New message",n);let e={sender:n.sender,message_type:n.message_type,sender_type:n.sender_type,content:n.content,id:n.id,discussion_id:n.discussion_id,parent_id:n.parent_id,binding:n.binding,model:n.model,personality:n.personality,created_at:n.created_at,finished_generating_at:n.finished_generating_at,rank:0,ui:n.ui,steps:[],parameters:n.parameters,metadata:n.metadata,open:n.open};e.status_message="Warming up",console.log(e),this.discussionArr.push(e),(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,n.message),console.log("infos",n)},async talk(n){this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating);let e=await Z.get("/get_generation_status",{});if(e)if(e.data.status)console.log("Already generating");else{const t=this.$store.state.config.personalities.findIndex(i=>i===n.full_path),s={client_id:this.$store.state.client_id,id:t};e=await Z.post("/select_personality",s),console.log("Generating message from ",e.data.status),qe.emit("generate_msg_from",{id:-1})}},createEmptyUserMessage(n){qe.emit("create_empty_message",{type:0,message:n})},createEmptyAIMessage(){qe.emit("create_empty_message",{type:1})},sendMsg(n,e){if(!n){this.$store.state.toast.showToast("Message contains no content!",4,!1);return}this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Z.get("/get_generation_status",{}).then(t=>{if(t)if(t.data.status)console.log("Already generating");else{e=="internet"?qe.emit("generate_msg_with_internet",{prompt:n}):qe.emit("generate_msg",{prompt:n});let s=0;this.discussionArr.length>0&&(s=Number(this.discussionArr[this.discussionArr.length-1].id)+1);let i={message:n,id:s,rank:0,user:this.$store.state.config.user_name,created_at:new Date().toLocaleString(),sender:this.$store.state.config.user_name,message_type:this.operationTypes.MSG_TYPE_CONTENT,sender_type:this.senderTypes.SENDER_TYPES_USER,content:n,id:s,discussion_id:this.discussion_id,parent_id:s,binding:"",model:"",personality:"",created_at:new Date().toLocaleString(),finished_generating_at:new Date().toLocaleString(),rank:0,steps:[],parameters:null,metadata:[],ui:null};this.createUserMsg(i)}}).catch(t=>{console.log("Error: Could not get generation status",t)})},sendCmd(n){this.isGenerating=!0,qe.emit("execute_command",{command:n,parameters:[]})},notify(n){self.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Le(()=>{const e=document.getElementById("messages-list");this.scrollBottom(e)}),n.display_type==0?this.$store.state.toast.showToast(n.content,n.duration,n.notification_type):n.display_type==1?this.$store.state.messageBox.showMessage(n.content):n.display_type==2?(this.$store.state.messageBox.hideMessage(),this.$store.state.yesNoDialog.askQuestion(n.content,"Yes","No").then(e=>{qe.emit("yesNoRes",{yesRes:e})})):n.display_type==3?this.$store.state.messageBox.showBlockingMessage(n.content):n.display_type==4&&this.$store.state.messageBox.hideMessage(),this.chime.play()},update_message(n){if(console.log("update_message trigged"),console.log(n),this.discussion_id=n.discussion_id,this.setDiscussionLoading(this.discussion_id,!0),this.currentDiscussion.id==this.discussion_id){console.log("discussion ok");const e=this.discussionArr.findIndex(s=>s.id==n.id),t=this.discussionArr[e];if(t&&(n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_SET_CONTENT||n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_AI))console.log("Content triggered"),this.isGenerating=!0,t.content=n.content,t.created_at=n.created_at,t.started_generating_at=n.started_generating_at,t.nb_tokens=n.nb_tokens,t.finished_generating_at=n.finished_generating_at,this.extractHtml();else if(t&&n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_ADD_CHUNK)this.isGenerating=!0,t.content+=n.content,console.log("Chunk triggered"),t.created_at=n.created_at,t.started_generating_at=n.started_generating_at,t.nb_tokens=n.nb_tokens,t.finished_generating_at=n.finished_generating_at,this.extractHtml();else if(n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_STEP||n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_STEP_START||n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_STEP_END_SUCCESS||n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_STEP_END_FAILURE)Array.isArray(n.steps)?(t.status_message=n.steps[n.steps.length-1].text,console.log("step Content: ",t.status_message),t.steps=n.steps,console.log("steps: ",n.steps)):console.error("Invalid steps data:",n.steps);else if(n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_JSON_INFOS)if(console.log("metadata triggered",n.operation_type),console.log("metadata",n.metadata),typeof n.metadata=="string")try{t.metadata=JSON.parse(n.metadata)}catch(s){console.error("Error parsing metadata string:",s),t.metadata={raw:n.metadata}}else Array.isArray(n.metadata)||typeof n.metadata=="object"?t.metadata=n.metadata:t.metadata={value:n.metadata};else n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_UI?(console.log("UI triggered",n.operation_type),console.log("UI",n.ui),t.ui=n.ui):n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_EXCEPTION&&this.$store.state.toast.showToast(n.content,5,!1)}this.$nextTick(()=>{Ve.replace()})},async changeTitleUsingUserMSG(n,e){const t=this.list.findIndex(i=>i.id==n),s=this.list[t];e&&(s.title=e,this.tempList=this.list,await this.edit_title(n,e))},async createNewDiscussion(){this.new_discussion(null)},loadLastUsedDiscussion(){console.log("Loading last discussion");const n=localStorage.getItem("selected_discussion");if(console.log("Last discussion id: ",n),n){const e=this.list.findIndex(s=>s.id==n),t=this.list[e];t&&this.selectDiscussion(t)}},onCopyPersonalityName(n){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},async deleteDiscussion(n){await this.delete_discussion(n),this.currentDiscussion.id==n&&(this.currentDiscussion={},this.discussionArr=[],this.setPageTitle()),this.list.splice(this.list.findIndex(e=>e.id==n),1),this.createDiscussionList(this.list)},async deleteDiscussionMulti(){const n=this.selectedDiscussions;for(let e=0;es.id==t.id),1)}this.tempList=this.list,this.isCheckbox=!1,this.$store.state.toast.showToast("Removed ("+n.length+") items",4,!0),this.showConfirmation=!1,console.log("Multi delete done")},async deleteMessage(n){await this.delete_message(n).then(()=>{this.discussionArr.splice(this.discussionArr.findIndex(e=>e.id==n),1)}).catch(()=>{this.$store.state.toast.showToast("Could not remove message",4,!1),console.log("Error: Could not delete message")})},async openFolder(n){const e=JSON.stringify({client_id:this.$store.state.client_id,discussion_id:n.id});console.log(e),await Z.post("/open_discussion_folder",e,{method:"POST",headers:{"Content-Type":"application/json"}})},async editTitle(n){const e=this.list.findIndex(s=>s.id==n.id),t=this.list[e];t.title=n.title,t.loading=!0,await this.edit_title(n.id,n.title),t.loading=!1},async makeTitle(n){this.list.findIndex(e=>e.id==n.id),await this.make_title(n.id)},checkUncheckDiscussion(n,e){const t=this.list.findIndex(i=>i.id==e),s=this.list[t];s.checkBoxValue=n.target.checked,this.tempList=this.list},selectAllDiscussions(){this.isSelectAll=!this.tempList.filter(n=>n.checkBoxValue==!1).length>0;for(let n=0;n({id:t.id,title:t.title,selected:!1,loading:!1,checkBoxValue:!1})).sort(function(t,s){return s.id-t.id});this.list=e,this.tempList=e}},setDiscussionLoading(n,e){try{const t=this.list.findIndex(i=>i.id==n),s=this.list[t];s.loading=e}catch{console.log("Error setting discussion loading")}},setPageTitle(n){if(n)if(n.id){const e=n.title?n.title==="untitled"?"New discussion":n.title:"New discussion";document.title="L🪶LLMS WebUI - "+e}else{const e=n||"Welcome";document.title="L🪶LLMS WebUI - "+e}else{const e=n||"Welcome";document.title="L🪶LLMS WebUI - "+e}},async rankUpMessage(n){await this.message_rank_up(n).then(e=>{const t=this.discussionArr[this.discussionArr.findIndex(s=>s.id==n)];t.rank=e.new_rank}).catch(()=>{this.$store.state.toast.showToast("Could not rank up message",4,!1),console.log("Error: Could not rank up message")})},async rankDownMessage(n){await this.message_rank_down(n).then(e=>{const t=this.discussionArr[this.discussionArr.findIndex(s=>s.id==n)];t.rank=e.new_rank}).catch(()=>{this.$store.state.toast.showToast("Could not rank down message",4,!1),console.log("Error: Could not rank down message")})},async updateMessage(n,e,t){await this.edit_message(n,e,t).then(()=>{const s=this.discussionArr[this.discussionArr.findIndex(i=>i.id==n)];s.content=e}).catch(()=>{this.$store.state.toast.showToast("Could not update message",4,!1),console.log("Error: Could not update message")})},resendMessage(n,e,t){Le(()=>{Ve.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Z.get("/get_generation_status",{}).then(s=>{s&&(s.data.status?(this.$store.state.toast.showToast("The server is busy. Wait",4,!1),console.log("Already generating")):qe.emit("generate_msg_from",{prompt:e,id:n,msg_type:t}))}).catch(s=>{console.log("Error: Could not get generation status",s)})},continueMessage(n,e){Le(()=>{Ve.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Z.get("/get_generation_status",{}).then(t=>{t&&(t.data.status?console.log("Already generating"):qe.emit("continue_generate_msg_from",{prompt:e,id:n}))}).catch(t=>{console.log("Error: Could not get generation status",t)})},stopGenerating(){this.stop_gen(),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),console.log("Stopped generating"),Le(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)})},finalMsgEvent(n){console.log("Received message close order");let e=0;this.discussion_id=n.discussion_id,this.currentDiscussion.id==this.discussion_id&&(e=this.discussionArr.findIndex(s=>s.id==n.id),this.discussionArr[e].content=n.content,this.discussionArr[e].finished_generating_at=n.finished_generating_at,this.discussionArr[e].nb_tokens=n.nb_tokens,this.discussionArr[e].binding=n.binding,this.discussionArr[e].model=n.model,this.discussionArr[e].personality=n.personality),Le(()=>{const s=document.getElementById("messages-list");this.scrollBottom(s),this.recoverFiles()}),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),this.chime.play(),e=this.discussionArr.findIndex(s=>s.id==n.id);const t=this.discussionArr[e];if(t.status_message="Done",console.log("final",n),this.$store.state.config.auto_speak&&this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode){e=this.discussionArr.findIndex(i=>i.id==n.id);let s=this.$refs["msg-"+n.id][0];console.log(s),s.speak()}},copyToClipBoard(n){let e="";if(n.message.content&&(e=n.message.content),this.$store.state.config.copy_to_clipboard_add_all_details){let t="";n.message.binding&&(t=`Binding: ${n.message.binding}`);let s="";n.message.personality&&(s=` + Endpoint error: `+s.message,4,!1),this.isLoading=!1}})}else this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1})}catch(n){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},showDatabaseSelector(){this.database_selectorDialogVisible=!0},async ondatabase_selectorDialogRemoved(n){console.log("Deleted:",n)},async ondatabase_selectorDialogSelected(n){console.log("Selected:",n)},onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=!1},async onvalidatedatabase_selectorChoice(n){this.database_selectorDialogVisible=!1;const e={client_id:this.client_id,name:typeof n=="string"?n:n.name};if(console.log("data:"),console.log(e),(await Z.post("/select_database",e,{headers:this.posts_headers})).status){console.log("Selected database"),this.$store.state.config=await Z.post("/get_config",{client_id:this.client_id}),console.log("new config loaded :",this.$store.state.config);let s=await Z.get("/list_databases").data;console.log("New list of database: ",s),this.$store.state.databases=s,console.log("New list of database: ",this.$store.state.databases),location.reload()}},async addDiscussion2SkillsLibrary(){(await Z.post("/add_discussion_to_skills_library",{client_id:this.client_id},{headers:this.posts_headers})).status&&console.log("done")},async toggleSkillsLib(){this.$store.state.config.activate_skills_lib=!this.$store.state.config.activate_skills_lib,await this.applyConfiguration()},async showSkillsLib(){this.$refs.skills_lib.showSkillsLibrary()},async applyConfiguration(){this.loading=!0;const n=await Z.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.$store.state.config});this.loading=!1,n.data.status?this.$store.state.toast.showToast("Configuration changed successfully.",4,!0):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Le(()=>{Ve.replace()})},save_configuration(){this.showConfirmation=!1,Z.post("/save_settings",{}).then(n=>{if(n)return n.status?this.$store.state.toast.showToast("Settings saved!",4,!0):this.$store.state.messageBox.showMessage("Error: Couldn't save settings!"),n.data}).catch(n=>(console.log(n.message,"save_configuration"),this.$store.state.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},showToastMessage(n,e,t){console.log("sending",n),this.$store.state.toast.showToast(n,e,t)},togglePanel(){this.leftPanelCollapsed=!this.leftPanelCollapsed,this.leftPanelCollapsed||(this.rightPanelCollapsed=!0)},toggleDropdown(){this.isOpen=!this.isOpen},importChatGPT(){},async api_get_req(n){try{const e=await Z.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},async list_discussions(){try{const n=await Z.get("/list_discussions");if(n)return this.createDiscussionList(n.data),n.data}catch(n){return console.log("Error: Could not list discussions",n.message),[]}},load_discussion(n,e){n&&(console.log("Loading discussion",n),this.loading=!0,this.discussionArr=[],this.setDiscussionLoading(n,this.loading),Ye.on("discussion",t=>{console.log("Discussion recovered"),this.loading=!1,this.setDiscussionLoading(n,this.loading),t&&(this.discussionArr=t.filter(s=>s.message_type==this.msgTypes.MSG_TYPE_CONTENT||s.message_type==this.msgTypes.MSG_TYPE_CONTENT_INVISIBLE_TO_AI),this.discussionArr.forEach(s=>{s.status_message="Done"}),console.log("this.discussionArr"),console.log(this.discussionArr),e&&e()),Ye.off("discussion"),this.extractHtml()}),Ye.emit("load_discussion",{id:n}))},recoverFiles(){console.log("Recovering files"),Z.post("/get_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{this.$refs.chatBox.filesList=n.data.files,this.$refs.chatBox.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.$refs.chatBox.filesList}`)})},new_discussion(n){try{this.loading=!0,Ye.on("discussion_created",e=>{Ye.off("discussion_created"),this.list_discussions().then(()=>{const t=this.list.findIndex(i=>i.id==e.id),s=this.list[t];this.selectDiscussion(s),this.load_discussion(e.id,()=>{this.loading=!1,this.recoverFiles(),Le(()=>{const i=document.getElementById("dis-"+e.id);this.scrollToElement(i),console.log("Scrolling tp "+i)})})})}),console.log("new_discussion ",n),Ye.emit("new_discussion",{title:n})}catch(e){return console.log("Error: Could not create new discussion",e.message),{}}},async delete_discussion(n){try{n&&(this.loading=!0,this.setDiscussionLoading(n,this.loading),await Z.post("/delete_discussion",{client_id:this.client_id,id:n},{headers:this.posts_headers}),this.loading=!1,this.setDiscussionLoading(n,this.loading))}catch(e){console.log("Error: Could not delete discussion",e.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async edit_title(n,e){try{if(n){this.loading=!0,this.setDiscussionLoading(n,this.loading);const t=await Z.post("/edit_title",{client_id:this.client_id,id:n,title:e},{headers:this.posts_headers});if(this.loading=!1,this.setDiscussionLoading(n,this.loading),t.status==200){const s=this.list.findIndex(r=>r.id==n),i=this.list[s];i.title=e,this.tempList=this.list}}}catch(t){console.log("Error: Could not edit title",t.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async make_title(n){try{if(n){this.loading=!0,this.setDiscussionLoading(n,this.loading);const e=await Z.post("/make_title",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(console.log("Making title:",e),this.loading=!1,this.setDiscussionLoading(n,this.loading),e.status==200){const t=this.list.findIndex(i=>i.id==n),s=this.list[t];s.title=e.data.title,this.tempList=this.list}}}catch(e){console.log("Error: Could not edit title",e.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async delete_message(n){try{console.log(typeof n),console.log(typeof this.client_id),console.log(n),console.log(this.client_id);const e=await Z.post("/delete_message",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could delete message",e.message),{}}},async stop_gen(){try{if(this.discussionArr.length>0){const n=this.discussionArr[this.discussionArr.length-1];n.status_message="Generation canceled"}if(Ye.emit("cancel_generation"),res)return res.data}catch(n){return console.log("Error: Could not stop generating",n.message),{}}},async message_rank_up(n){try{const e=await Z.post("/message_rank_up",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could not rank up message",e.message),{}}},async message_rank_down(n){try{const e=await Z.post("/message_rank_down",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could not rank down message",e.message),{}}},async edit_message(n,e,t){try{console.log(typeof this.client_id),console.log(typeof n),console.log(typeof e),console.log(typeof{audio_url:t});const s=await Z.post("/edit_message",{client_id:this.client_id,id:n,message:e,metadata:[{audio_url:t}]},{headers:this.posts_headers});if(s)return s.data}catch(s){return console.log("Error: Could not update message",s.message),{}}},async export_multiple_discussions(n,e){try{if(n.length>0){const t=await Z.post("/export_multiple_discussions",{client_id:this.$store.state.client_id,discussion_ids:n,export_format:e},{headers:this.posts_headers});if(t)return t.data}}catch(t){return console.log("Error: Could not export multiple discussions",t.message),{}}},async import_multiple_discussions(n){try{if(n.length>0){console.log("sending import",n);const e=await Z.post("/import_multiple_discussions",{client_id:this.$store.state.client_id,jArray:n},{headers:this.posts_headers});if(e)return console.log("import response",e.data),e.data}}catch(e){console.log("Error: Could not import multiple discussions",e.message);return}},filterDiscussions(){this.filterInProgress||(this.filterInProgress=!0,setTimeout(()=>{this.filterTitle?this.list=this.tempList.filter(n=>n.title&&n.title.includes(this.filterTitle)):this.list=this.tempList,this.filterInProgress=!1},100))},async selectDiscussion(n){if(this.isGenerating){this.$store.state.toast.showToast("You are currently generating a text. Please wait for text generation to finish or stop it before trying to select another discussion",4,!1);return}n&&(this.currentDiscussion===void 0?(this.currentDiscussion=n,this.setPageTitle(n),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(n.id,()=>{this.discussionArr.length>1&&((this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content),this.recoverFiles())})):this.currentDiscussion.id!=n.id&&(console.log("item",n),console.log("this.currentDiscussion",this.currentDiscussion),this.currentDiscussion=n,console.log("this.currentDiscussion",this.currentDiscussion),this.setPageTitle(n),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(n.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content),this.recoverFiles()})),Le(()=>{const e=document.getElementById("dis-"+this.currentDiscussion.id);this.scrollToElementInContainer(e,"leftPanel");const t=document.getElementById("messages-list");this.scrollBottom(t)}))},scrollToElement(n){n?n.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}):console.log("Error: scrollToElement")},scrollToElementInContainer(n,e){try{const t=n.offsetTop;document.getElementById(e).scrollTo({top:t,behavior:"smooth"})}catch{console.log("error")}},scrollBottom(n){n?n.scrollTo({top:n.scrollHeight,behavior:"smooth"}):console.log("Error: scrollBottom")},scrollTop(n){n?n.scrollTo({top:0,behavior:"smooth"}):console.log("Error: scrollTop")},createUserMsg(n){let e={content:n.message,id:n.id,rank:0,sender:n.user,created_at:n.created_at,steps:[],html_js_s:[],status_message:"Warming up"};this.discussionArr.push(e),Le(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},updateLastUserMsg(n){const e=this.discussionArr.indexOf(s=>s.id=n.user_id),t={binding:n.binding,content:n.message,created_at:n.created_at,type:n.type,finished_generating_at:n.finished_generating_at,id:n.user_id,model:n.model,personality:n.personality,sender:n.user,steps:[]};e!==-1&&(this.discussionArr[e]=t)},async socketIOConnected(){console.log("socketIOConnected")},socketIODisconnected(){return console.log("socketIOConnected"),this.currentDiscussion=null,this.$store.dispatch("refreshModels"),this.$store.state.isConnected=!1,!0},new_message(n){n.sender_type==this.SENDER_TYPES_AI&&(this.isGenerating=!0),console.log("Making a new message"),console.log("New message",n);let e={sender:n.sender,message_type:n.message_type,sender_type:n.sender_type,content:n.content,id:n.id,discussion_id:n.discussion_id,parent_id:n.parent_id,binding:n.binding,model:n.model,personality:n.personality,created_at:n.created_at,finished_generating_at:n.finished_generating_at,rank:0,ui:n.ui,steps:[],parameters:n.parameters,metadata:n.metadata,open:n.open};e.status_message="Warming up",console.log(e),this.discussionArr.push(e),(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,n.message),console.log("infos",n)},async talk(n){this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating);let e=await Z.get("/get_generation_status",{});if(e)if(e.data.status)console.log("Already generating");else{const t=this.$store.state.config.personalities.findIndex(i=>i===n.full_path),s={client_id:this.$store.state.client_id,id:t};e=await Z.post("/select_personality",s),console.log("Generating message from ",e.data.status),Ye.emit("generate_msg_from",{id:-1})}},createEmptyUserMessage(n){Ye.emit("create_empty_message",{type:0,message:n})},createEmptyAIMessage(){Ye.emit("create_empty_message",{type:1})},sendMsg(n,e){if(!n){this.$store.state.toast.showToast("Message contains no content!",4,!1);return}this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Z.get("/get_generation_status",{}).then(t=>{if(t)if(t.data.status)console.log("Already generating");else{e=="internet"?Ye.emit("generate_msg_with_internet",{prompt:n}):Ye.emit("generate_msg",{prompt:n});let s=0;this.discussionArr.length>0&&(s=Number(this.discussionArr[this.discussionArr.length-1].id)+1);let i={message:n,id:s,rank:0,user:this.$store.state.config.user_name,created_at:new Date().toLocaleString(),sender:this.$store.state.config.user_name,message_type:this.operationTypes.MSG_TYPE_CONTENT,sender_type:this.senderTypes.SENDER_TYPES_USER,content:n,id:s,discussion_id:this.discussion_id,parent_id:s,binding:"",model:"",personality:"",created_at:new Date().toLocaleString(),finished_generating_at:new Date().toLocaleString(),rank:0,steps:[],parameters:null,metadata:[],ui:null};this.createUserMsg(i)}}).catch(t=>{console.log("Error: Could not get generation status",t)})},sendCmd(n){this.isGenerating=!0,Ye.emit("execute_command",{command:n,parameters:[]})},notify(n){self.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Le(()=>{const e=document.getElementById("messages-list");this.scrollBottom(e)}),n.display_type==0?this.$store.state.toast.showToast(n.content,n.duration,n.notification_type):n.display_type==1?this.$store.state.messageBox.showMessage(n.content):n.display_type==2?(this.$store.state.messageBox.hideMessage(),this.$store.state.yesNoDialog.askQuestion(n.content,"Yes","No").then(e=>{Ye.emit("yesNoRes",{yesRes:e})})):n.display_type==3?this.$store.state.messageBox.showBlockingMessage(n.content):n.display_type==4&&this.$store.state.messageBox.hideMessage(),this.chime.play()},update_message(n){if(console.log("update_message trigged"),console.log(n),this.discussion_id=n.discussion_id,this.setDiscussionLoading(this.discussion_id,!0),this.currentDiscussion.id==this.discussion_id){console.log("discussion ok");const e=this.discussionArr.findIndex(s=>s.id==n.id),t=this.discussionArr[e];if(t&&(n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_SET_CONTENT||n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_AI))console.log("Content triggered"),this.isGenerating=!0,t.content=n.content,t.created_at=n.created_at,t.started_generating_at=n.started_generating_at,t.nb_tokens=n.nb_tokens,t.finished_generating_at=n.finished_generating_at,this.extractHtml();else if(t&&n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_ADD_CHUNK)this.isGenerating=!0,t.content+=n.content,console.log("Chunk triggered"),t.created_at=n.created_at,t.started_generating_at=n.started_generating_at,t.nb_tokens=n.nb_tokens,t.finished_generating_at=n.finished_generating_at,this.extractHtml();else if(n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_STEP||n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_STEP_START||n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_STEP_END_SUCCESS||n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_STEP_END_FAILURE)Array.isArray(n.steps)?(t.status_message=n.steps[n.steps.length-1].text,console.log("step Content: ",t.status_message),t.steps=n.steps,console.log("steps: ",n.steps)):console.error("Invalid steps data:",n.steps);else if(n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_JSON_INFOS)if(console.log("metadata triggered",n.operation_type),console.log("metadata",n.metadata),typeof n.metadata=="string")try{t.metadata=JSON.parse(n.metadata)}catch(s){console.error("Error parsing metadata string:",s),t.metadata={raw:n.metadata}}else Array.isArray(n.metadata)||typeof n.metadata=="object"?t.metadata=n.metadata:t.metadata={value:n.metadata};else n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_UI?(console.log("UI triggered",n.operation_type),console.log("UI",n.ui),t.ui=n.ui):n.operation_type==this.operationTypes.MSG_OPERATION_TYPE_EXCEPTION&&this.$store.state.toast.showToast(n.content,5,!1)}this.$nextTick(()=>{Ve.replace()})},async changeTitleUsingUserMSG(n,e){const t=this.list.findIndex(i=>i.id==n),s=this.list[t];e&&(s.title=e,this.tempList=this.list,await this.edit_title(n,e))},async createNewDiscussion(){this.new_discussion(null)},loadLastUsedDiscussion(){console.log("Loading last discussion");const n=localStorage.getItem("selected_discussion");if(console.log("Last discussion id: ",n),n){const e=this.list.findIndex(s=>s.id==n),t=this.list[e];t&&this.selectDiscussion(t)}},onCopyPersonalityName(n){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},async deleteDiscussion(n){await this.delete_discussion(n),this.currentDiscussion.id==n&&(this.currentDiscussion={},this.discussionArr=[],this.setPageTitle()),this.list.splice(this.list.findIndex(e=>e.id==n),1),this.createDiscussionList(this.list)},async deleteDiscussionMulti(){const n=this.selectedDiscussions;for(let e=0;es.id==t.id),1)}this.tempList=this.list,this.isCheckbox=!1,this.$store.state.toast.showToast("Removed ("+n.length+") items",4,!0),this.showConfirmation=!1,console.log("Multi delete done")},async deleteMessage(n){await this.delete_message(n).then(()=>{this.discussionArr.splice(this.discussionArr.findIndex(e=>e.id==n),1)}).catch(()=>{this.$store.state.toast.showToast("Could not remove message",4,!1),console.log("Error: Could not delete message")})},async openFolder(n){const e=JSON.stringify({client_id:this.$store.state.client_id,discussion_id:n.id});console.log(e),await Z.post("/open_discussion_folder",e,{method:"POST",headers:{"Content-Type":"application/json"}})},async editTitle(n){const e=this.list.findIndex(s=>s.id==n.id),t=this.list[e];t.title=n.title,t.loading=!0,await this.edit_title(n.id,n.title),t.loading=!1},async makeTitle(n){this.list.findIndex(e=>e.id==n.id),await this.make_title(n.id)},checkUncheckDiscussion(n,e){const t=this.list.findIndex(i=>i.id==e),s=this.list[t];s.checkBoxValue=n.target.checked,this.tempList=this.list},selectAllDiscussions(){this.isSelectAll=!this.tempList.filter(n=>n.checkBoxValue==!1).length>0;for(let n=0;n({id:t.id,title:t.title,selected:!1,loading:!1,checkBoxValue:!1})).sort(function(t,s){return s.id-t.id});this.list=e,this.tempList=e}},setDiscussionLoading(n,e){try{const t=this.list.findIndex(i=>i.id==n),s=this.list[t];s.loading=e}catch{console.log("Error setting discussion loading")}},setPageTitle(n){if(n)if(n.id){const e=n.title?n.title==="untitled"?"New discussion":n.title:"New discussion";document.title="L🪶LLMS WebUI - "+e}else{const e=n||"Welcome";document.title="L🪶LLMS WebUI - "+e}else{const e=n||"Welcome";document.title="L🪶LLMS WebUI - "+e}},async rankUpMessage(n){await this.message_rank_up(n).then(e=>{const t=this.discussionArr[this.discussionArr.findIndex(s=>s.id==n)];t.rank=e.new_rank}).catch(()=>{this.$store.state.toast.showToast("Could not rank up message",4,!1),console.log("Error: Could not rank up message")})},async rankDownMessage(n){await this.message_rank_down(n).then(e=>{const t=this.discussionArr[this.discussionArr.findIndex(s=>s.id==n)];t.rank=e.new_rank}).catch(()=>{this.$store.state.toast.showToast("Could not rank down message",4,!1),console.log("Error: Could not rank down message")})},async updateMessage(n,e,t){await this.edit_message(n,e,t).then(()=>{const s=this.discussionArr[this.discussionArr.findIndex(i=>i.id==n)];s.content=e}).catch(()=>{this.$store.state.toast.showToast("Could not update message",4,!1),console.log("Error: Could not update message")})},resendMessage(n,e,t){Le(()=>{Ve.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Z.get("/get_generation_status",{}).then(s=>{s&&(s.data.status?(this.$store.state.toast.showToast("The server is busy. Wait",4,!1),console.log("Already generating")):Ye.emit("generate_msg_from",{prompt:e,id:n,msg_type:t}))}).catch(s=>{console.log("Error: Could not get generation status",s)})},continueMessage(n,e){Le(()=>{Ve.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Z.get("/get_generation_status",{}).then(t=>{t&&(t.data.status?console.log("Already generating"):Ye.emit("continue_generate_msg_from",{prompt:e,id:n}))}).catch(t=>{console.log("Error: Could not get generation status",t)})},stopGenerating(){this.stop_gen(),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),console.log("Stopped generating"),Le(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)})},finalMsgEvent(n){console.log("Received message close order");let e=0;this.discussion_id=n.discussion_id,this.currentDiscussion.id==this.discussion_id&&(e=this.discussionArr.findIndex(s=>s.id==n.id),this.discussionArr[e].content=n.content,this.discussionArr[e].finished_generating_at=n.finished_generating_at,this.discussionArr[e].nb_tokens=n.nb_tokens,this.discussionArr[e].binding=n.binding,this.discussionArr[e].model=n.model,this.discussionArr[e].personality=n.personality),Le(()=>{const s=document.getElementById("messages-list");this.scrollBottom(s),this.recoverFiles()}),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),this.chime.play(),e=this.discussionArr.findIndex(s=>s.id==n.id);const t=this.discussionArr[e];if(t.status_message="Done",console.log("final",n),this.$store.state.config.auto_speak&&this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode){e=this.discussionArr.findIndex(i=>i.id==n.id);let s=this.$refs["msg-"+n.id][0];console.log(s),s.speak()}},copyToClipBoard(n){let e="";if(n.message.content&&(e=n.message.content),this.$store.state.config.copy_to_clipboard_add_all_details){let t="";n.message.binding&&(t=`Binding: ${n.message.binding}`);let s="";n.message.personality&&(s=` Personality: ${n.message.personality}`);let i="";n.created_at_parsed&&(i=` Created: ${n.created_at_parsed}`);let r="";n.message.model&&(r=`Model: ${n.message.model}`);let o="";n.message.seed&&(o=`Seed: ${n.message.seed}`);let a="";n.time_spent&&(a=` Time spent: ${n.time_spent}`);let c="";c=`${t} ${r} ${o} ${a}`.trim();const d=`${n.message.sender}${s}${i} @@ -269,7 +269,7 @@ ${e} ${c}`;navigator.clipboard.writeText(d)}else navigator.clipboard.writeText(e);this.$store.state.toast.showToast("Copied to clipboard successfully",4,!0),Le(()=>{Ve.replace()})},closeToast(){this.showToast=!1},saveJSONtoFile(n,e){e=e||"data.json";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([JSON.stringify(n,null,2)],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},saveMarkdowntoFile(n,e){e=e||"data.md";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([n],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},parseJsonObj(n){try{return JSON.parse(n)}catch(e){return this.$store.state.toast.showToast(`Could not parse JSON. `+e.message,4,!1),null}},async parseJsonFile(n){return new Promise((e,t)=>{const s=new FileReader;s.onload=i=>e(this.parseJsonObj(i.target.result)),s.onerror=i=>t(i),s.readAsText(n)})},async exportDiscussionsAsMarkdown(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),s=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(t+"."+s+"."+i+"."+r+o+a)+".md";this.loading=!0;const u=await this.export_multiple_discussions(n,"markdown");u?(this.saveMarkdowntoFile(u,d),this.$store.state.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this.$store.state.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async exportDiscussions(){},async exportDiscussionsAsJson(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),s=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(t+"."+s+"."+i+"."+r+o+a)+".json";this.loading=!0;const u=await this.export_multiple_discussions(n,"json");u?(this.saveJSONtoFile(u,d),this.$store.state.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this.$store.state.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async importDiscussionsBundle(n){},async importDiscussions(n){const e=await this.parseJsonFile(n.target.files[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1)},async getPersonalityAvatars(){for(;this.$store.state.personalities===null;)await new Promise(e=>setTimeout(e,100));let n=this.$store.state.personalities;this.personalityAvatars=n.map(e=>({name:e.name,avatar:e.avatar}))},getAvatar(n){if(n.toLowerCase().trim()==this.$store.state.config.user_name.toLowerCase().trim())return"user_infos/"+this.$store.state.config.user_avatar;const e=this.personalityAvatars.findIndex(s=>s.name===n),t=this.personalityAvatars[e];if(t)return console.log("Avatar",t.avatar),t.avatar},setFileListChat(n){try{this.$refs.chatBox.fileList=this.$refs.chatBox.fileList.concat(n)}catch(e){this.$store.state.toast.showToast(`Failed to set filelist in chatbox -`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(n){if(n.length>1){this.$store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(n[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){console.log("Created discussions view");const e=(await Z.get("/get_versionID")).data.versionId;qe.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(item.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)}))},this.versionId!==e&&(this.$store.commit("updateVersionId",e),window.location.reload(!0)),this.$nextTick(()=>{Ve.replace()}),console.log("Connected to socket io");try{this.$store.state.loading_infos="Getting version",this.$store.state.loading_progress=30,await this.$store.dispatch("getVersion")}catch(t){console.log("Error cought:",t)}try{for(this.$store.state.loading_infos="Loading Configuration";qe.id===void 0;)await new Promise(t=>setTimeout(t,100));this.$store.state.client_id=qe.id,console.log(this.$store.state.client_id),await this.$store.dispatch("refreshConfig"),console.log("Config ready")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Loading Database",this.$store.state.loading_progress=20,await this.$store.dispatch("refreshDatabase")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting Bindings list",this.$store.state.loading_progress=40,await this.$store.dispatch("refreshBindings")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting personalities zoo",this.$store.state.loading_progress=70,await this.$store.dispatch("refreshPersonalitiesZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting mounted personalities",this.$store.state.loading_progress=80,await this.$store.dispatch("refreshMountedPersonalities")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting models zoo",this.$store.state.loading_progress=90,await this.$store.dispatch("refreshModelsZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting active models",this.$store.state.loading_progress=100,await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshModelStatus")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchLanguages"),await this.$store.dispatch("fetchLanguage")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchisRTOn")}catch(t){console.log("Error cought:",t)}this.$store.state.isConnected=!0,this.$store.state.client_id=qe.id,console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),this.isCreated=!0,this.$store.state.ready=!0,qe.on("connected",this.socketIOConnected),qe.on("disconnected",this.socketIODisconnected),console.log("Added events"),qe.on("show_progress",this.show_progress),qe.on("hide_progress",this.hide_progress),qe.on("update_progress",this.update_progress),qe.on("notification",this.notify),qe.on("new_message",this.new_message),qe.on("update_message",this.update_message),qe.on("close_message",this.finalMsgEvent),qe.on("disucssion_renamed",t=>{console.log("Received new title",t.discussion_id,t.title);const s=this.list.findIndex(r=>r.id==t.discussion_id),i=this.list[s];i.title=t.title}),qe.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},qe.on("connect_error",t=>{t.message==="ERR_CONNECTION_REFUSED"?console.error("Connection refused. The server is not available."):console.error("Connection error:",t),this.$store.state.isConnected=!1}),qe.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),qe.disconnect()}},async mounted(){qe.on("refresh_files",()=>{this.recoverFiles()}),this.$nextTick(()=>{Ve.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Le(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)}),this.$store.state.config.show_news_panel&&this.$store.state.news.show()},components:{Discussion:W0,Message:dM,ChatBox:uM,WelcomeComponent:pM,ChoiceDialog:$0,ProgressBar:cp,InputBox:aM,SkillsLibraryViewer:lM},watch:{messages:{handler:"extractHtml",deep:!0},progress_visibility_val(n){console.log("progress_visibility changed to "+n)},filterTitle(n){n==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(n){Le(()=>{Ve.replace()}),n||(this.isSelectAll=!1)},socketConnected(n){console.log("Websocket connected (watch)",n)},showConfirmation(){Le(()=>{Ve.replace()})},isSearch(){Le(()=>{Ve.replace()})}},computed:{..._L({versionId:n=>n.versionId}),progress_visibility:{get(){return self.progress_visibility_val}},version_info:{get(){return this.$store.state.version!=null&&this.$store.state.version!="unknown"?" v"+this.$store.state.version:""}},loading_infos:{get(){return this.$store.state.loading_infos}},loading_progress:{get(){return this.$store.state.loading_progress}},isModelOk:{get(){return this.$store.state.isModelOk},set(n){this.$store.state.isModelOk=n}},isGenerating:{get(){return this.$store.state.isGenerating},set(n){this.$store.state.isGenerating=n}},personality(){console.log("personality:",this.$store.state.config.personalities[this.$store.state.config.active_personality_id]);const n=this.$store.state.config.personalities[this.$store.state.config.active_personality_id];console.log("peronslities",this.$store.state.personalities[0]);const e=this.$store.state.personalities.find(t=>t.full_path===n);return console.log("personality:",e),e},prompts_list(){return console.log(this.personality.prompts_list),this.personality.prompts_list},formatted_database_name(){return this.$store.state.config.discussion_db_name},UseDiscussionHistory(){return this.$store.state.config.activate_skills_lib},isReady(){return this.$store.state.ready},databases(){return this.$store.state.databases},client_id(){return qe.id},showLeftPanel(){return this.$store.state.ready&&!this.leftPanelCollapsed},showRightPanel(){return this.$store.state.ready&&!this.rightPanelCollapsed},socketConnected(){return console.log(" --- > Websocket connected"),this.$store.commit("setIsConnected",!0),!0},socketDisconnected(){return this.$store.commit("setIsConnected",!1),console.log(" --- > Websocket disconnected"),!0},selectedDiscussions(){return Le(()=>{Ve.replace()}),this.list.filter(n=>n.checkBoxValue==!0)}}},eht=Object.assign(Jmt,{__name:"DiscussionsView",setup(n){return di(()=>{TM()}),Z.defaults.baseURL="/",(e,t)=>(T(),w(Be,null,[z(Ii,{name:"fade-and-fly"},{default:Ie(()=>[e.isReady?B("",!0):(T(),w("div",cmt,[l("div",dmt,[(T(),w(Be,null,Xe(50,s=>l("div",{key:s,class:"absolute animate-fall animate-giggle",style:Wt({left:`${Math.random()*100}%`,top:"-20px",animationDuration:`${3+Math.random()*7}s`,animationDelay:`${Math.random()*5}s`})}," 🪶 ",4)),64))]),l("div",umt,[l("div",pmt,[t[31]||(t[31]=l("div",{class:"text-6xl md:text-7xl font-bold text-amber-500 mb-2",style:{"text-shadow":"2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white"}}," L🪶LLMS ",-1)),t[32]||(t[32]=l("p",{class:"text-2xl text-gray-600 dark:text-gray-300 italic"}," One tool to rule them all ",-1)),t[33]||(t[33]=l("p",{class:"text-xl text-gray-500 dark:text-gray-400 mb-6"}," by ParisNeo ",-1)),l("p",fmt,W(e.version_info),1),t[34]||(t[34]=l("div",{class:"w-full h-24 relative overflow-hidden bg-gradient-to-r from-blue-200 to-purple-200 dark:from-blue-800 dark:to-purple-800 rounded-full shadow-lg flex items-center justify-center"},[l("p",{style:{"font-size":"48px","line-height":"1"}},"🪶")],-1))]),l("div",_mt,[l("div",mmt,[l("p",hmt,W(e.loading_infos)+"... ",1),l("p",gmt,W(Math.round(e.loading_progress))+"% ",1)])])])]))]),_:1}),e.isReady?(T(),w("button",{key:0,onClick:t[0]||(t[0]=(...s)=>e.togglePanel&&e.togglePanel(...s)),class:"absolute top-2 left-2 p-3 bg-white bg-opacity-0 cursor-pointer transition-all duration-300 hover:scale-110 hover:bg-opacity-20 hover:shadow-xl group"},[D(l("div",null,t[35]||(t[35]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,e.leftPanelCollapsed]]),D(l("div",null,t[36]||(t[36]=[l("i",{"data-feather":"chevron-left"},null,-1)]),512),[[xt,!e.leftPanelCollapsed]])])):B("",!0),e.isReady?(T(),w("button",{key:1,onClick:t[1]||(t[1]=K(s=>e.triggerRobotAction(),["stop"])),class:"absolute z-50 bottom-20 right-2 p-3 bg-white bg-opacity-10 rounded-full cursor-pointer transition-all duration-300 hover:scale-110 hover:bg-opacity-20 animate-pulse shadow-lg hover:shadow-xl group"},t[37]||(t[37]=[Pi('',1)]))):B("",!0),z(Ii,{name:"slide-right"},{default:Ie(()=>[e.showLeftPanel?(T(),w("div",bmt,[l("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:t[29]||(t[29]=K(s=>e.setDropZoneDiscussion(),["stop","prevent"]))},[l("div",ymt,[l("div",Emt,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:t[2]||(t[2]=s=>e.createNewDiscussion())},t[38]||(t[38]=[l("i",{"data-feather":"plus"},null,-1)])),l("button",{class:Ue(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:t[3]||(t[3]=s=>e.isCheckbox=!e.isCheckbox)},t[39]||(t[39]=[l("i",{"data-feather":"check-square"},null,-1)]),2),l("button",vmt,[l("i",{"data-feather":"trash-2",onClick:t[4]||(t[4]=K(()=>{},["stop"]))})]),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button",onClick:t[5]||(t[5]=K(s=>e.database_selectorDialogVisible=!0,["stop"]))},t[40]||(t[40]=[l("i",{"data-feather":"database"},null,-1)])),l("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:t[6]||(t[6]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},null,544),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:t[7]||(t[7]=K(s=>e.$refs.fileDialog.click(),["stop"]))},t[41]||(t[41]=[l("i",{"data-feather":"log-in"},null,-1)])),l("input",{type:"file",ref:"bundleLoadingDialog",style:{display:"none"},onChange:t[8]||(t[8]=(...s)=>e.importDiscussionsBundle&&e.importDiscussionsBundle(...s))},null,544),e.showSaveConfirmation?B("",!0):(T(),w("button",{key:0,title:"Import discussion bundle",onClick:t[9]||(t[9]=K(s=>e.$refs.bundleLoadingDialog.click(),["stop"])),class:"text-2xl hover:text-secondary duration-75 active:scale-90"},t[42]||(t[42]=[l("i",{"data-feather":"folder"},null,-1)]))),e.isOpen?(T(),w("div",Smt,[l("button",{onClick:t[10]||(t[10]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},"LOLLMS"),l("button",{onClick:t[11]||(t[11]=(...s)=>e.importChatGPT&&e.importChatGPT(...s))},"ChatGPT")])):B("",!0),l("button",{class:Ue(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:t[12]||(t[12]=s=>e.isSearch=!e.isSearch)},t[43]||(t[43]=[l("i",{"data-feather":"search"},null,-1)]),2),e.showSaveConfirmation?(T(),w("div",Tmt,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:t[13]||(t[13]=K(s=>e.showSaveConfirmation=!1,["stop"]))},t[44]||(t[44]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:t[14]||(t[14]=K(s=>e.save_configuration(),["stop"]))},t[45]||(t[45]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),e.loading?B("",!0):(T(),w("button",{key:3,type:"button",onClick:t[15]||(t[15]=K((...s)=>e.addDiscussion2SkillsLibrary&&e.addDiscussion2SkillsLibrary(...s),["stop"])),title:"Add this discussion content to skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},t[46]||(t[46]=[l("i",{"data-feather":"hard-drive"},null,-1)]))),!e.loading&&e.$store.state.config.activate_skills_lib?(T(),w("button",{key:4,type:"button",onClick:t[16]||(t[16]=K((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is activated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},t[47]||(t[47]=[l("i",{"data-feather":"check-circle"},null,-1)]))):B("",!0),!e.loading&&!e.$store.state.config.activate_skills_lib?(T(),w("button",{key:5,type:"button",onClick:t[17]||(t[17]=K((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is deactivated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},t[48]||(t[48]=[l("i",{"data-feather":"x-octagon"},null,-1)]))):B("",!0),e.loading?B("",!0):(T(),w("button",{key:6,type:"button",onClick:t[18]||(t[18]=K((...s)=>e.showSkillsLib&&e.showSkillsLib(...s),["stop"])),title:"Show Skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},t[49]||(t[49]=[l("i",{"data-feather":"book"},null,-1)]))),e.loading?(T(),w("div",xmt,t[50]||(t[50]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):B("",!0)]),e.isSearch?(T(),w("div",Cmt,[l("div",wmt,[l("div",Rmt,[t[52]||(t[52]=l("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[l("div",{class:"scale-75"},[l("i",{"data-feather":"search"})])],-1)),l("div",Amt,[l("div",{class:Ue(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:t[19]||(t[19]=s=>e.filterTitle="")},t[51]||(t[51]=[l("i",{"data-feather":"x"},null,-1)]),2)]),D(l("input",{type:"search",id:"default-search",class:"block w-full p-2 pl-10 pr-10 text-sm border border-gray-300 rounded-lg bg-bg-light focus:ring-secondary focus:border-secondary dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-secondary dark:focus:border-secondary",placeholder:"Search...",title:"Filter discussions by title","onUpdate:modelValue":t[20]||(t[20]=s=>e.filterTitle=s),onInput:t[21]||(t[21]=s=>e.filterDiscussions())},null,544),[[ue,e.filterTitle]])])])])):B("",!0),e.isCheckbox?(T(),w("hr",Nmt)):B("",!0),e.isCheckbox?(T(),w("div",Mmt,[l("div",Omt,[e.selectedDiscussions.length>0?(T(),w("p",Imt,"Selected: "+W(e.selectedDiscussions.length),1)):B("",!0)]),l("div",kmt,[e.selectedDiscussions.length>0?(T(),w("div",Dmt,[e.showConfirmation?B("",!0):(T(),w("button",{key:0,class:"flex mx-3 flex-1 text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove selected",type:"button",onClick:t[22]||(t[22]=K(s=>e.showConfirmation=!0,["stop"]))},t[53]||(t[53]=[l("i",{"data-feather":"trash"},null,-1)]))),e.showConfirmation?(T(),w("div",Lmt,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:t[23]||(t[23]=K((...s)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...s),["stop"]))},t[54]||(t[54]=[l("i",{"data-feather":"check"},null,-1)])),l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:t[24]||(t[24]=K(s=>e.showConfirmation=!1,["stop"]))},t[55]||(t[55]=[l("i",{"data-feather":"x"},null,-1)]))])):B("",!0)])):B("",!0),l("div",Pmt,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a json file",type:"button",onClick:t[25]||(t[25]=K((...s)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...s),["stop"]))},t[56]||(t[56]=[l("i",{"data-feather":"codepen"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:t[26]||(t[26]=K((...s)=>e.exportDiscussions&&e.exportDiscussions(...s),["stop"]))},t[57]||(t[57]=[l("i",{"data-feather":"folder"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:t[27]||(t[27]=K((...s)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...s),["stop"]))},t[58]||(t[58]=[l("i",{"data-feather":"bookmark"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:t[28]||(t[28]=K((...s)=>e.selectAllDiscussions&&e.selectAllDiscussions(...s),["stop"]))},t[59]||(t[59]=[l("i",{"data-feather":"list"},null,-1)]))])])])):B("",!0)]),l("div",Fmt,[l("div",{class:Ue(["mx-0 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[l("div",{id:"dis-list",class:Ue([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full pb-80"])},[e.list.length>0?(T(),at(ri,{key:0,name:"list"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(e.list,(s,i)=>(T(),at(W0,{key:s.id,id:s.id,title:s.title,selected:e.currentDiscussion.id==s.id,loading:s.loading,isCheckbox:e.isCheckbox,checkBoxValue:s.checkBoxValue,onSelect:r=>e.selectDiscussion(s),onDelete:r=>e.deleteDiscussion(s.id),onOpenFolder:e.openFolder,onEditTitle:e.editTitle,onMakeTitle:e.makeTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onOpenFolder","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):B("",!0),e.list.length<1?(T(),w("div",Umt,t[60]||(t[60]=[l("p",{class:"px-3"},"No discussions are found",-1)]))):B("",!0),t[61]||(t[61]=l("div",{class:"sticky bottom-0 bg-gradient-to-t pointer-events-none from-bg-light-tone dark:from-bg-dark-tone flex flex-grow"},null,-1))],2)],2)])],32),l("div",{class:"absolute h-15 bottom-0 left-0 w-full unicolor-panels-color light-text-panel py-4 cursor-pointer text-light-text-panel dark:text-dark-text-panel hover:text-secondary",onClick:t[30]||(t[30]=(...s)=>e.showDatabaseSelector&&e.showDatabaseSelector(...s))},[l("p",Bmt,W(e.formatted_database_name.replace("_"," ")),1)])])):B("",!0)]),_:1}),e.isReady?(T(),w("div",Gmt,[l("div",{id:"messages-list",class:Ue(["w-full z-0 flex flex-col flex-grow overflow-y-auto scrollbar",e.isDragOverChat?"pointer-events-none":""])},[l("div",Vmt,[e.discussionArr.length>0?(T(),at(ri,{key:0,name:"list"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(e.discussionArr,(s,i)=>(T(),at(dM,{key:s.id,message:s,id:"msg-"+s.id,ref_for:!0,ref:"msg-"+s.id,host:e.host,onCopy:e.copyToClipBoard,onDelete:e.deleteMessage,onRankUp:e.rankUpMessage,onRankDown:e.rankDownMessage,onUpdateMessage:e.updateMessage,onResendMessage:e.resendMessage,onContinueMessage:e.continueMessage,avatar:e.getAvatar(s.sender)},null,8,["message","id","host","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128)),e.discussionArr.length<2&&e.personality.prompts_list.length>0?(T(),w("div",zmt,[t[64]||(t[64]=l("h2",{class:"text-2xl font-bold mb-4"},"Prompt examples",-1)),e.discussionArr.length<2&&e.personality.prompts_list.length>0?(T(),w("div",Hmt,[l("div",qmt,[(T(!0),w(Be,null,Xe(e.personality.prompts_list,(s,i)=>(T(),w("div",{key:i,onClick:r=>e.selectPrompt(s),class:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg p-4 cursor-pointer hover:shadow-lg transition-all duration-300 ease-in-out transform hover:scale-105 flex flex-col justify-between h-[220px] overflow-hidden group"},[l("div",{title:s,class:"text-base text-gray-700 dark:text-gray-300 overflow-hidden relative h-full"},[l("div",Wmt,W(s),1),t[62]||(t[62]=l("div",{class:"absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-white dark:to-gray-800 group-hover:opacity-0 transition-opacity duration-300"},null,-1))],8,$mt),t[63]||(t[63]=l("div",{class:"mt-2 text-sm text-gray-500 dark:text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}," Click to select ",-1))],8,Ymt))),128))])])):B("",!0)])):B("",!0)]),_:1})):B("",!0),e.currentDiscussion.id?B("",!0):(T(),at(pM,{key:1})),t[65]||(t[65]=l("div",null,[l("br"),l("br"),l("br"),l("br"),l("br"),l("br"),l("br")],-1))]),t[66]||(t[66]=l("div",{class:"absolute w-full bottom-0 bg-transparent p-10 pt-16 bg-gradient-to-t from-bg-light dark:from-bg-dark from-5% via-bg-light dark:via-bg-dark via-10% to-transparent to-100%"},null,-1))],2),e.currentDiscussion.id?(T(),w("div",Kmt,[z(uM,{ref:"chatBox",loading:e.isGenerating,discussionList:e.discussionArr,"on-show-toast-message":e.showToastMessage,"on-talk":e.talk,onPersonalitySelected:e.recoverFiles,onMessageSentEvent:e.sendMsg,onSendCMDEvent:e.sendCmd,onAddWebLink:e.add_webpage,onCreateEmptyUserMessage:e.createEmptyUserMessage,onCreateEmptyAIMessage:e.createEmptyAIMessage,onStopGenerating:e.stopGenerating,onLoaded:e.recoverFiles},null,8,["loading","discussionList","on-show-toast-message","on-talk","onPersonalitySelected","onMessageSentEvent","onSendCMDEvent","onAddWebLink","onCreateEmptyUserMessage","onCreateEmptyAIMessage","onStopGenerating","onLoaded"])])):B("",!0)])):B("",!0),z(Ii,{name:"slide-left"},{default:Ie(()=>[e.showRightPanel?(T(),w("div",jmt,[l("div",Qmt,null,512)])):B("",!0)]),_:1}),z($0,{reference:"database_selector",class:"z-20",show:e.database_selectorDialogVisible,choices:e.databases,"can-remove":!0,onChoiceRemoved:e.ondatabase_selectorDialogRemoved,onChoiceSelected:e.ondatabase_selectorDialogSelected,onCloseDialog:e.onclosedatabase_selectorDialog,onChoiceValidated:e.onvalidatedatabase_selectorChoice},null,8,["show","choices","onChoiceRemoved","onChoiceSelected","onCloseDialog","onChoiceValidated"]),D(l("div",Xmt,[z(cp,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),l("p",Zmt,W(e.loading_infos)+" ...",1)],512),[[xt,e.progress_visibility]]),z(aM,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.addWebpage,ref:"web_url_input_box"},null,8,["onOk"]),z(lM,{ref:"skills_lib"},null,512)],64))}}),tht=it(eht,[["__scopeId","data-v-86d5eadc"]]);/** +`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(n){if(n.length>1){this.$store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(n[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){console.log("Created discussions view");const e=(await Z.get("/get_versionID")).data.versionId;Ye.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(item.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)}))},this.versionId!==e&&(this.$store.commit("updateVersionId",e),window.location.reload(!0)),this.$nextTick(()=>{Ve.replace()}),console.log("Connected to socket io");try{this.$store.state.loading_infos="Getting version",this.$store.state.loading_progress=30,await this.$store.dispatch("getVersion")}catch(t){console.log("Error cought:",t)}try{for(this.$store.state.loading_infos="Loading Configuration";Ye.id===void 0;)await new Promise(t=>setTimeout(t,100));this.$store.state.client_id=Ye.id,console.log(this.$store.state.client_id),await this.$store.dispatch("refreshConfig"),console.log("Config ready")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Loading Database",this.$store.state.loading_progress=20,await this.$store.dispatch("refreshDatabase")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting Bindings list",this.$store.state.loading_progress=40,await this.$store.dispatch("refreshBindings")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting personalities zoo",this.$store.state.loading_progress=70,await this.$store.dispatch("refreshPersonalitiesZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting mounted personalities",this.$store.state.loading_progress=80,await this.$store.dispatch("refreshMountedPersonalities")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting models zoo",this.$store.state.loading_progress=90,await this.$store.dispatch("refreshModelsZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting active models",this.$store.state.loading_progress=100,await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshModelStatus")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchLanguages"),await this.$store.dispatch("fetchLanguage")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchisRTOn")}catch(t){console.log("Error cought:",t)}this.$store.state.isConnected=!0,this.$store.state.client_id=Ye.id,console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),this.isCreated=!0,this.$store.state.ready=!0,Ye.on("connected",this.socketIOConnected),Ye.on("disconnected",this.socketIODisconnected),console.log("Added events"),Ye.on("show_progress",this.show_progress),Ye.on("hide_progress",this.hide_progress),Ye.on("update_progress",this.update_progress),Ye.on("notification",this.notify),Ye.on("new_message",this.new_message),Ye.on("update_message",this.update_message),Ye.on("close_message",this.finalMsgEvent),Ye.on("disucssion_renamed",t=>{console.log("Received new title",t.discussion_id,t.title);const s=this.list.findIndex(r=>r.id==t.discussion_id),i=this.list[s];i.title=t.title}),Ye.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Ye.on("connect_error",t=>{t.message==="ERR_CONNECTION_REFUSED"?console.error("Connection refused. The server is not available."):console.error("Connection error:",t),this.$store.state.isConnected=!1}),Ye.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),Ye.disconnect()}},async mounted(){Ye.on("refresh_files",()=>{this.recoverFiles()}),this.$nextTick(()=>{Ve.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Le(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)}),this.$store.state.config.show_news_panel&&this.$store.state.news.show()},components:{Discussion:W0,Message:dM,ChatBox:uM,WelcomeComponent:pM,ChoiceDialog:$0,ProgressBar:cp,InputBox:aM,SkillsLibraryViewer:lM},watch:{messages:{handler:"extractHtml",deep:!0},progress_visibility_val(n){console.log("progress_visibility changed to "+n)},filterTitle(n){n==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(n){Le(()=>{Ve.replace()}),n||(this.isSelectAll=!1)},socketConnected(n){console.log("Websocket connected (watch)",n)},showConfirmation(){Le(()=>{Ve.replace()})},isSearch(){Le(()=>{Ve.replace()})}},computed:{..._L({versionId:n=>n.versionId}),progress_visibility:{get(){return self.progress_visibility_val}},version_info:{get(){return this.$store.state.version!=null&&this.$store.state.version!="unknown"?" v"+this.$store.state.version:""}},loading_infos:{get(){return this.$store.state.loading_infos}},loading_progress:{get(){return this.$store.state.loading_progress}},isModelOk:{get(){return this.$store.state.isModelOk},set(n){this.$store.state.isModelOk=n}},isGenerating:{get(){return this.$store.state.isGenerating},set(n){this.$store.state.isGenerating=n}},personality(){console.log("personality:",this.$store.state.config.personalities[this.$store.state.config.active_personality_id]);const n=this.$store.state.config.personalities[this.$store.state.config.active_personality_id];console.log("peronslities",this.$store.state.personalities[0]);const e=this.$store.state.personalities.find(t=>t.full_path===n);return console.log("personality:",e),e},prompts_list(){return console.log(this.personality.prompts_list),this.personality.prompts_list},formatted_database_name(){return this.$store.state.config.discussion_db_name},UseDiscussionHistory(){return this.$store.state.config.activate_skills_lib},isReady(){return this.$store.state.ready},databases(){return this.$store.state.databases},client_id(){return Ye.id},showLeftPanel(){return this.$store.state.ready&&!this.leftPanelCollapsed},showRightPanel(){return this.$store.state.ready&&!this.rightPanelCollapsed},socketConnected(){return console.log(" --- > Websocket connected"),this.$store.commit("setIsConnected",!0),!0},socketDisconnected(){return this.$store.commit("setIsConnected",!1),console.log(" --- > Websocket disconnected"),!0},selectedDiscussions(){return Le(()=>{Ve.replace()}),this.list.filter(n=>n.checkBoxValue==!0)}}},eht=Object.assign(Jmt,{__name:"DiscussionsView",setup(n){return di(()=>{TM()}),Z.defaults.baseURL="/",(e,t)=>(T(),w(Be,null,[z(Ii,{name:"fade-and-fly"},{default:Ie(()=>[e.isReady?B("",!0):(T(),w("div",cmt,[l("div",dmt,[(T(),w(Be,null,Xe(50,s=>l("div",{key:s,class:"absolute animate-fall animate-giggle",style:Wt({left:`${Math.random()*100}%`,top:"-20px",animationDuration:`${3+Math.random()*7}s`,animationDelay:`${Math.random()*5}s`})}," 🪶 ",4)),64))]),l("div",umt,[l("div",pmt,[t[31]||(t[31]=l("div",{class:"text-6xl md:text-7xl font-bold text-amber-500 mb-2",style:{"text-shadow":"2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white"}}," L🪶LLMS ",-1)),t[32]||(t[32]=l("p",{class:"text-2xl text-gray-600 dark:text-gray-300 italic"}," One tool to rule them all ",-1)),t[33]||(t[33]=l("p",{class:"text-xl text-gray-500 dark:text-gray-400 mb-6"}," by ParisNeo ",-1)),l("p",fmt,W(e.version_info),1),t[34]||(t[34]=l("div",{class:"w-full h-24 relative overflow-hidden bg-gradient-to-r from-blue-200 to-purple-200 dark:from-blue-800 dark:to-purple-800 rounded-full shadow-lg flex items-center justify-center"},[l("p",{style:{"font-size":"48px","line-height":"1"}},"🪶")],-1))]),l("div",_mt,[l("div",mmt,[l("p",hmt,W(e.loading_infos)+"... ",1),l("p",gmt,W(Math.round(e.loading_progress))+"% ",1)])])])]))]),_:1}),e.isReady?(T(),w("button",{key:0,onClick:t[0]||(t[0]=(...s)=>e.togglePanel&&e.togglePanel(...s)),class:"absolute top-2 left-2 p-3 bg-white bg-opacity-0 cursor-pointer transition-all duration-300 hover:scale-110 hover:bg-opacity-20 hover:shadow-xl group"},[D(l("div",null,t[35]||(t[35]=[l("i",{"data-feather":"chevron-right"},null,-1)]),512),[[xt,e.leftPanelCollapsed]]),D(l("div",null,t[36]||(t[36]=[l("i",{"data-feather":"chevron-left"},null,-1)]),512),[[xt,!e.leftPanelCollapsed]])])):B("",!0),e.isReady?(T(),w("button",{key:1,onClick:t[1]||(t[1]=K(s=>e.triggerRobotAction(),["stop"])),class:"absolute z-50 bottom-20 right-2 p-3 bg-white bg-opacity-10 rounded-full cursor-pointer transition-all duration-300 hover:scale-110 hover:bg-opacity-20 animate-pulse shadow-lg hover:shadow-xl group"},t[37]||(t[37]=[Pi('',1)]))):B("",!0),z(Ii,{name:"slide-right"},{default:Ie(()=>[e.showLeftPanel?(T(),w("div",bmt,[l("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:t[29]||(t[29]=K(s=>e.setDropZoneDiscussion(),["stop","prevent"]))},[l("div",ymt,[l("div",Emt,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:t[2]||(t[2]=s=>e.createNewDiscussion())},t[38]||(t[38]=[l("i",{"data-feather":"plus"},null,-1)])),l("button",{class:Ue(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:t[3]||(t[3]=s=>e.isCheckbox=!e.isCheckbox)},t[39]||(t[39]=[l("i",{"data-feather":"check-square"},null,-1)]),2),l("button",vmt,[l("i",{"data-feather":"trash-2",onClick:t[4]||(t[4]=K(()=>{},["stop"]))})]),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button",onClick:t[5]||(t[5]=K(s=>e.database_selectorDialogVisible=!0,["stop"]))},t[40]||(t[40]=[l("i",{"data-feather":"database"},null,-1)])),l("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:t[6]||(t[6]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},null,544),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:t[7]||(t[7]=K(s=>e.$refs.fileDialog.click(),["stop"]))},t[41]||(t[41]=[l("i",{"data-feather":"log-in"},null,-1)])),l("input",{type:"file",ref:"bundleLoadingDialog",style:{display:"none"},onChange:t[8]||(t[8]=(...s)=>e.importDiscussionsBundle&&e.importDiscussionsBundle(...s))},null,544),e.showSaveConfirmation?B("",!0):(T(),w("button",{key:0,title:"Import discussion bundle",onClick:t[9]||(t[9]=K(s=>e.$refs.bundleLoadingDialog.click(),["stop"])),class:"text-2xl hover:text-secondary duration-75 active:scale-90"},t[42]||(t[42]=[l("i",{"data-feather":"folder"},null,-1)]))),e.isOpen?(T(),w("div",Smt,[l("button",{onClick:t[10]||(t[10]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},"LOLLMS"),l("button",{onClick:t[11]||(t[11]=(...s)=>e.importChatGPT&&e.importChatGPT(...s))},"ChatGPT")])):B("",!0),l("button",{class:Ue(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:t[12]||(t[12]=s=>e.isSearch=!e.isSearch)},t[43]||(t[43]=[l("i",{"data-feather":"search"},null,-1)]),2),e.showSaveConfirmation?(T(),w("div",Tmt,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:t[13]||(t[13]=K(s=>e.showSaveConfirmation=!1,["stop"]))},t[44]||(t[44]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:t[14]||(t[14]=K(s=>e.save_configuration(),["stop"]))},t[45]||(t[45]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),e.loading?B("",!0):(T(),w("button",{key:3,type:"button",onClick:t[15]||(t[15]=K((...s)=>e.addDiscussion2SkillsLibrary&&e.addDiscussion2SkillsLibrary(...s),["stop"])),title:"Add this discussion content to skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},t[46]||(t[46]=[l("i",{"data-feather":"hard-drive"},null,-1)]))),!e.loading&&e.$store.state.config.activate_skills_lib?(T(),w("button",{key:4,type:"button",onClick:t[16]||(t[16]=K((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is activated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},t[47]||(t[47]=[l("i",{"data-feather":"check-circle"},null,-1)]))):B("",!0),!e.loading&&!e.$store.state.config.activate_skills_lib?(T(),w("button",{key:5,type:"button",onClick:t[17]||(t[17]=K((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is deactivated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},t[48]||(t[48]=[l("i",{"data-feather":"x-octagon"},null,-1)]))):B("",!0),e.loading?B("",!0):(T(),w("button",{key:6,type:"button",onClick:t[18]||(t[18]=K((...s)=>e.showSkillsLib&&e.showSkillsLib(...s),["stop"])),title:"Show Skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},t[49]||(t[49]=[l("i",{"data-feather":"book"},null,-1)]))),e.loading?(T(),w("div",xmt,t[50]||(t[50]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):B("",!0)]),e.isSearch?(T(),w("div",Cmt,[l("div",wmt,[l("div",Rmt,[t[52]||(t[52]=l("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[l("div",{class:"scale-75"},[l("i",{"data-feather":"search"})])],-1)),l("div",Amt,[l("div",{class:Ue(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:t[19]||(t[19]=s=>e.filterTitle="")},t[51]||(t[51]=[l("i",{"data-feather":"x"},null,-1)]),2)]),D(l("input",{type:"search",id:"default-search",class:"block w-full p-2 pl-10 pr-10 text-sm border border-gray-300 rounded-lg bg-bg-light focus:ring-secondary focus:border-secondary dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-secondary dark:focus:border-secondary",placeholder:"Search...",title:"Filter discussions by title","onUpdate:modelValue":t[20]||(t[20]=s=>e.filterTitle=s),onInput:t[21]||(t[21]=s=>e.filterDiscussions())},null,544),[[ue,e.filterTitle]])])])])):B("",!0),e.isCheckbox?(T(),w("hr",Nmt)):B("",!0),e.isCheckbox?(T(),w("div",Mmt,[l("div",Omt,[e.selectedDiscussions.length>0?(T(),w("p",Imt,"Selected: "+W(e.selectedDiscussions.length),1)):B("",!0)]),l("div",kmt,[e.selectedDiscussions.length>0?(T(),w("div",Dmt,[e.showConfirmation?B("",!0):(T(),w("button",{key:0,class:"flex mx-3 flex-1 text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove selected",type:"button",onClick:t[22]||(t[22]=K(s=>e.showConfirmation=!0,["stop"]))},t[53]||(t[53]=[l("i",{"data-feather":"trash"},null,-1)]))),e.showConfirmation?(T(),w("div",Lmt,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:t[23]||(t[23]=K((...s)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...s),["stop"]))},t[54]||(t[54]=[l("i",{"data-feather":"check"},null,-1)])),l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:t[24]||(t[24]=K(s=>e.showConfirmation=!1,["stop"]))},t[55]||(t[55]=[l("i",{"data-feather":"x"},null,-1)]))])):B("",!0)])):B("",!0),l("div",Pmt,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a json file",type:"button",onClick:t[25]||(t[25]=K((...s)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...s),["stop"]))},t[56]||(t[56]=[l("i",{"data-feather":"codepen"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:t[26]||(t[26]=K((...s)=>e.exportDiscussions&&e.exportDiscussions(...s),["stop"]))},t[57]||(t[57]=[l("i",{"data-feather":"folder"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:t[27]||(t[27]=K((...s)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...s),["stop"]))},t[58]||(t[58]=[l("i",{"data-feather":"bookmark"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:t[28]||(t[28]=K((...s)=>e.selectAllDiscussions&&e.selectAllDiscussions(...s),["stop"]))},t[59]||(t[59]=[l("i",{"data-feather":"list"},null,-1)]))])])])):B("",!0)]),l("div",Fmt,[l("div",{class:Ue(["mx-0 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[l("div",{id:"dis-list",class:Ue([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full pb-80"])},[e.list.length>0?(T(),at(ri,{key:0,name:"list"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(e.list,(s,i)=>(T(),at(W0,{key:s.id,id:s.id,title:s.title,selected:e.currentDiscussion.id==s.id,loading:s.loading,isCheckbox:e.isCheckbox,checkBoxValue:s.checkBoxValue,onSelect:r=>e.selectDiscussion(s),onDelete:r=>e.deleteDiscussion(s.id),onOpenFolder:e.openFolder,onEditTitle:e.editTitle,onMakeTitle:e.makeTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onOpenFolder","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):B("",!0),e.list.length<1?(T(),w("div",Umt,t[60]||(t[60]=[l("p",{class:"px-3"},"No discussions are found",-1)]))):B("",!0),t[61]||(t[61]=l("div",{class:"sticky bottom-0 bg-gradient-to-t pointer-events-none from-bg-light-tone dark:from-bg-dark-tone flex flex-grow"},null,-1))],2)],2)])],32),l("div",{class:"absolute h-15 bottom-0 left-0 w-full unicolor-panels-color light-text-panel py-4 cursor-pointer text-light-text-panel dark:text-dark-text-panel hover:text-secondary",onClick:t[30]||(t[30]=(...s)=>e.showDatabaseSelector&&e.showDatabaseSelector(...s))},[l("p",Bmt,W(e.formatted_database_name.replace("_"," ")),1)])])):B("",!0)]),_:1}),e.isReady?(T(),w("div",Gmt,[l("div",{id:"messages-list",class:Ue(["w-full z-0 flex flex-col flex-grow overflow-y-auto scrollbar",e.isDragOverChat?"pointer-events-none":""])},[l("div",Vmt,[e.discussionArr.length>0?(T(),at(ri,{key:0,name:"list"},{default:Ie(()=>[(T(!0),w(Be,null,Xe(e.discussionArr,(s,i)=>(T(),at(dM,{key:s.id,message:s,id:"msg-"+s.id,ref_for:!0,ref:"msg-"+s.id,host:e.host,onCopy:e.copyToClipBoard,onDelete:e.deleteMessage,onRankUp:e.rankUpMessage,onRankDown:e.rankDownMessage,onUpdateMessage:e.updateMessage,onResendMessage:e.resendMessage,onContinueMessage:e.continueMessage,avatar:e.getAvatar(s.sender)},null,8,["message","id","host","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128)),e.discussionArr.length<2&&e.personality.prompts_list.length>0?(T(),w("div",zmt,[t[64]||(t[64]=l("h2",{class:"text-2xl font-bold mb-4"},"Prompt examples",-1)),e.discussionArr.length<2&&e.personality.prompts_list.length>0?(T(),w("div",Hmt,[l("div",qmt,[(T(!0),w(Be,null,Xe(e.personality.prompts_list,(s,i)=>(T(),w("div",{key:i,onClick:r=>e.selectPrompt(s),class:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg p-4 cursor-pointer hover:shadow-lg transition-all duration-300 ease-in-out transform hover:scale-105 flex flex-col justify-between h-[220px] overflow-hidden group"},[l("div",{title:s,class:"text-base text-gray-700 dark:text-gray-300 overflow-hidden relative h-full"},[l("div",Wmt,W(s),1),t[62]||(t[62]=l("div",{class:"absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-white dark:to-gray-800 group-hover:opacity-0 transition-opacity duration-300"},null,-1))],8,$mt),t[63]||(t[63]=l("div",{class:"mt-2 text-sm text-gray-500 dark:text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}," Click to select ",-1))],8,Ymt))),128))])])):B("",!0)])):B("",!0)]),_:1})):B("",!0),e.currentDiscussion.id?B("",!0):(T(),at(pM,{key:1})),t[65]||(t[65]=l("div",null,[l("br"),l("br"),l("br"),l("br"),l("br"),l("br"),l("br")],-1))]),t[66]||(t[66]=l("div",{class:"absolute w-full bottom-0 bg-transparent p-10 pt-16 bg-gradient-to-t from-bg-light dark:from-bg-dark from-5% via-bg-light dark:via-bg-dark via-10% to-transparent to-100%"},null,-1))],2),e.currentDiscussion.id?(T(),w("div",Kmt,[z(uM,{ref:"chatBox",loading:e.isGenerating,discussionList:e.discussionArr,"on-show-toast-message":e.showToastMessage,"on-talk":e.talk,onPersonalitySelected:e.recoverFiles,onMessageSentEvent:e.sendMsg,onSendCMDEvent:e.sendCmd,onAddWebLink:e.add_webpage,onCreateEmptyUserMessage:e.createEmptyUserMessage,onCreateEmptyAIMessage:e.createEmptyAIMessage,onStopGenerating:e.stopGenerating,onLoaded:e.recoverFiles},null,8,["loading","discussionList","on-show-toast-message","on-talk","onPersonalitySelected","onMessageSentEvent","onSendCMDEvent","onAddWebLink","onCreateEmptyUserMessage","onCreateEmptyAIMessage","onStopGenerating","onLoaded"])])):B("",!0)])):B("",!0),z(Ii,{name:"slide-left"},{default:Ie(()=>[e.showRightPanel?(T(),w("div",jmt,[l("div",Qmt,null,512)])):B("",!0)]),_:1}),z($0,{reference:"database_selector",class:"z-20",show:e.database_selectorDialogVisible,choices:e.databases,"can-remove":!0,onChoiceRemoved:e.ondatabase_selectorDialogRemoved,onChoiceSelected:e.ondatabase_selectorDialogSelected,onCloseDialog:e.onclosedatabase_selectorDialog,onChoiceValidated:e.onvalidatedatabase_selectorChoice},null,8,["show","choices","onChoiceRemoved","onChoiceSelected","onCloseDialog","onChoiceValidated"]),D(l("div",Xmt,[z(cp,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),l("p",Zmt,W(e.loading_infos)+" ...",1)],512),[[xt,e.progress_visibility]]),z(aM,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.addWebpage,ref:"web_url_input_box"},null,8,["onOk"]),z(lM,{ref:"skills_lib"},null,512)],64))}}),tht=it(eht,[["__scopeId","data-v-86d5eadc"]]);/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT @@ -3913,7 +3913,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function pvt(n,e,t){let s=new uy;const i=new Rt,r=new Rt,o=new $t,a=new lvt({depthPacking:Wht}),c=new cvt,d={},u=t.maxTextureSize,_={[Ui]:Xn,[Xn]:Ui,[Js]:Js},m=new mo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:dvt,fragmentShader:uvt}),h=m.clone();h.defines.HORIZONTAL_PASS=1;const f=new _i;f.setAttribute("position",new zn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Vn(f,m),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=xM;let y=this.type;this.render=function(R,C,A){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||R.length===0)return;const I=n.getRenderTarget(),x=n.getActiveCubeFace(),N=n.getActiveMipmapLevel(),G=n.state;G.setBlending(gr),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const V=y!==Ci&&this.type===Ci,te=y===Ci&&this.type!==Ci;for(let O=0,H=R.length;Ou||i.y>u)&&(i.x>u&&(r.x=Math.floor(u/Y.x),i.x=r.x*Y.x,L.mapSize.x=r.x),i.y>u&&(r.y=Math.floor(u/Y.y),i.y=r.y*Y.y,L.mapSize.y=r.y)),L.map===null||V===!0||te===!0){const oe=this.type!==Ci?{minFilter:gn,magFilter:gn}:{};L.map!==null&&L.map.dispose(),L.map=new _o(i.x,i.y,oe),L.map.texture.name=q.name+".shadowMap",L.camera.updateProjectionMatrix()}n.setRenderTarget(L.map),n.clear();const se=L.getViewportCount();for(let oe=0;oe0||C.map&&C.alphaTest>0){const G=x.uuid,V=C.uuid;let te=d[G];te===void 0&&(te={},d[G]=te);let O=te[V];O===void 0&&(O=x.clone(),te[V]=O),x=O}if(x.visible=C.visible,x.wireframe=C.wireframe,I===Ci?x.side=C.shadowSide!==null?C.shadowSide:C.side:x.side=C.shadowSide!==null?C.shadowSide:_[C.side],x.alphaMap=C.alphaMap,x.alphaTest=C.alphaTest,x.map=C.map,x.clipShadows=C.clipShadows,x.clippingPlanes=C.clippingPlanes,x.clipIntersection=C.clipIntersection,x.displacementMap=C.displacementMap,x.displacementScale=C.displacementScale,x.displacementBias=C.displacementBias,x.wireframeLinewidth=C.wireframeLinewidth,x.linewidth=C.linewidth,A.isPointLight===!0&&x.isMeshDistanceMaterial===!0){const G=n.properties.get(x);G.light=A}return x}function S(R,C,A,I,x){if(R.visible===!1)return;if(R.layers.test(C.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&x===Ci)&&(!R.frustumCulled||s.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,R.matrixWorld);const V=e.update(R),te=R.material;if(Array.isArray(te)){const O=V.groups;for(let H=0,q=O.length;H=1):oe.indexOf("OpenGL ES")!==-1&&(se=parseFloat(/^OpenGL ES (\d)/.exec(oe)[1]),Y=se>=2);let ye=null,xe={};const le=n.getParameter(n.SCISSOR_BOX),ve=n.getParameter(n.VIEWPORT),Oe=new $t().fromArray(le),De=new $t().fromArray(ve);function Q(ee,je,Ge,Me){const He=new Uint8Array(4),dt=n.createTexture();n.bindTexture(ee,dt),n.texParameteri(ee,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(ee,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Mt=0;Mt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let g;const b=new WeakMap;let y=!1;try{y=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(k,M){return y?new OffscreenCanvas(k,M):Jl("canvas")}function v(k,M,$,me){let j=1;if((k.width>me||k.height>me)&&(j=me/Math.max(k.width,k.height)),j<1||M===!0)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap){const ie=M?vu:Math.floor,Ce=ie(j*k.width),we=ie(j*k.height);g===void 0&&(g=E(Ce,we));const ke=$?E(Ce,we):g;return ke.width=Ce,ke.height=we,ke.getContext("2d").drawImage(k,0,0,Ce,we),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+Ce+"x"+we+")."),ke}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),k;return k}function S(k){return xb(k.width)&&xb(k.height)}function R(k){return a?!1:k.wrapS!==ms||k.wrapT!==ms||k.minFilter!==gn&&k.minFilter!==$n}function C(k,M){return k.generateMipmaps&&M&&k.minFilter!==gn&&k.minFilter!==$n}function A(k){n.generateMipmap(k)}function I(k,M,$,me,j=!1){if(a===!1)return M;if(k!==null){if(n[k]!==void 0)return n[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let ie=M;if(M===n.RED&&($===n.FLOAT&&(ie=n.R32F),$===n.HALF_FLOAT&&(ie=n.R16F),$===n.UNSIGNED_BYTE&&(ie=n.R8)),M===n.RED_INTEGER&&($===n.UNSIGNED_BYTE&&(ie=n.R8UI),$===n.UNSIGNED_SHORT&&(ie=n.R16UI),$===n.UNSIGNED_INT&&(ie=n.R32UI),$===n.BYTE&&(ie=n.R8I),$===n.SHORT&&(ie=n.R16I),$===n.INT&&(ie=n.R32I)),M===n.RG&&($===n.FLOAT&&(ie=n.RG32F),$===n.HALF_FLOAT&&(ie=n.RG16F),$===n.UNSIGNED_BYTE&&(ie=n.RG8)),M===n.RGBA){const Ce=j?gu:Lt.getTransfer(me);$===n.FLOAT&&(ie=n.RGBA32F),$===n.HALF_FLOAT&&(ie=n.RGBA16F),$===n.UNSIGNED_BYTE&&(ie=Ce===jt?n.SRGB8_ALPHA8:n.RGBA8),$===n.UNSIGNED_SHORT_4_4_4_4&&(ie=n.RGBA4),$===n.UNSIGNED_SHORT_5_5_5_1&&(ie=n.RGB5_A1)}return(ie===n.R16F||ie===n.R32F||ie===n.RG16F||ie===n.RG32F||ie===n.RGBA16F||ie===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ie}function x(k,M,$){return C(k,$)===!0||k.isFramebufferTexture&&k.minFilter!==gn&&k.minFilter!==$n?Math.log2(Math.max(M.width,M.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?M.mipmaps.length:1}function N(k){return k===gn||k===Eb||k===Fd?n.NEAREST:n.LINEAR}function G(k){const M=k.target;M.removeEventListener("dispose",G),te(M),M.isVideoTexture&&f.delete(M)}function V(k){const M=k.target;M.removeEventListener("dispose",V),H(M)}function te(k){const M=s.get(k);if(M.__webglInit===void 0)return;const $=k.source,me=b.get($);if(me){const j=me[M.__cacheKey];j.usedTimes--,j.usedTimes===0&&O(k),Object.keys(me).length===0&&b.delete($)}s.remove(k)}function O(k){const M=s.get(k);n.deleteTexture(M.__webglTexture);const $=k.source,me=b.get($);delete me[M.__cacheKey],o.memory.textures--}function H(k){const M=k.texture,$=s.get(k),me=s.get(M);if(me.__webglTexture!==void 0&&(n.deleteTexture(me.__webglTexture),o.memory.textures--),k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let j=0;j<6;j++){if(Array.isArray($.__webglFramebuffer[j]))for(let ie=0;ie<$.__webglFramebuffer[j].length;ie++)n.deleteFramebuffer($.__webglFramebuffer[j][ie]);else n.deleteFramebuffer($.__webglFramebuffer[j]);$.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer[j])}else{if(Array.isArray($.__webglFramebuffer))for(let j=0;j<$.__webglFramebuffer.length;j++)n.deleteFramebuffer($.__webglFramebuffer[j]);else n.deleteFramebuffer($.__webglFramebuffer);if($.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer),$.__webglMultisampledFramebuffer&&n.deleteFramebuffer($.__webglMultisampledFramebuffer),$.__webglColorRenderbuffer)for(let j=0;j<$.__webglColorRenderbuffer.length;j++)$.__webglColorRenderbuffer[j]&&n.deleteRenderbuffer($.__webglColorRenderbuffer[j]);$.__webglDepthRenderbuffer&&n.deleteRenderbuffer($.__webglDepthRenderbuffer)}if(k.isWebGLMultipleRenderTargets)for(let j=0,ie=M.length;j=c&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+c),q+=1,k}function se(k){const M=[];return M.push(k.wrapS),M.push(k.wrapT),M.push(k.wrapR||0),M.push(k.magFilter),M.push(k.minFilter),M.push(k.anisotropy),M.push(k.internalFormat),M.push(k.format),M.push(k.type),M.push(k.generateMipmaps),M.push(k.premultiplyAlpha),M.push(k.flipY),M.push(k.unpackAlignment),M.push(k.colorSpace),M.join()}function oe(k,M){const $=s.get(k);if(k.isVideoTexture&&Re(k),k.isRenderTargetTexture===!1&&k.version>0&&$.__version!==k.version){const me=k.image;if(me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{_e($,k,M);return}}t.bindTexture(n.TEXTURE_2D,$.__webglTexture,n.TEXTURE0+M)}function ye(k,M){const $=s.get(k);if(k.version>0&&$.__version!==k.version){_e($,k,M);return}t.bindTexture(n.TEXTURE_2D_ARRAY,$.__webglTexture,n.TEXTURE0+M)}function xe(k,M){const $=s.get(k);if(k.version>0&&$.__version!==k.version){_e($,k,M);return}t.bindTexture(n.TEXTURE_3D,$.__webglTexture,n.TEXTURE0+M)}function le(k,M){const $=s.get(k);if(k.version>0&&$.__version!==k.version){Ae($,k,M);return}t.bindTexture(n.TEXTURE_CUBE_MAP,$.__webglTexture,n.TEXTURE0+M)}const ve={[va]:n.REPEAT,[ms]:n.CLAMP_TO_EDGE,[hu]:n.MIRRORED_REPEAT},Oe={[gn]:n.NEAREST,[Eb]:n.NEAREST_MIPMAP_NEAREST,[Fd]:n.NEAREST_MIPMAP_LINEAR,[$n]:n.LINEAR,[wM]:n.LINEAR_MIPMAP_NEAREST,[fo]:n.LINEAR_MIPMAP_LINEAR},De={[jht]:n.NEVER,[tgt]:n.ALWAYS,[Qht]:n.LESS,[PM]:n.LEQUAL,[Xht]:n.EQUAL,[egt]:n.GEQUAL,[Zht]:n.GREATER,[Jht]:n.NOTEQUAL};function Q(k,M,$){if($?(n.texParameteri(k,n.TEXTURE_WRAP_S,ve[M.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,ve[M.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,ve[M.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,Oe[M.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,Oe[M.minFilter])):(n.texParameteri(k,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(k,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(M.wrapS!==ms||M.wrapT!==ms)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(k,n.TEXTURE_MAG_FILTER,N(M.magFilter)),n.texParameteri(k,n.TEXTURE_MIN_FILTER,N(M.minFilter)),M.minFilter!==gn&&M.minFilter!==$n&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),M.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,De[M.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const me=e.get("EXT_texture_filter_anisotropic");if(M.magFilter===gn||M.minFilter!==Fd&&M.minFilter!==fo||M.type===Ni&&e.has("OES_texture_float_linear")===!1||a===!1&&M.type===Xl&&e.has("OES_texture_half_float_linear")===!1)return;(M.anisotropy>1||s.get(M).__currentAnisotropy)&&(n.texParameterf(k,me.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(M.anisotropy,i.getMaxAnisotropy())),s.get(M).__currentAnisotropy=M.anisotropy)}}function fe(k,M){let $=!1;k.__webglInit===void 0&&(k.__webglInit=!0,M.addEventListener("dispose",G));const me=M.source;let j=b.get(me);j===void 0&&(j={},b.set(me,j));const ie=se(M);if(ie!==k.__cacheKey){j[ie]===void 0&&(j[ie]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,$=!0),j[ie].usedTimes++;const Ce=j[k.__cacheKey];Ce!==void 0&&(j[k.__cacheKey].usedTimes--,Ce.usedTimes===0&&O(M)),k.__cacheKey=ie,k.__webglTexture=j[ie].texture}return $}function _e(k,M,$){let me=n.TEXTURE_2D;(M.isDataArrayTexture||M.isCompressedArrayTexture)&&(me=n.TEXTURE_2D_ARRAY),M.isData3DTexture&&(me=n.TEXTURE_3D);const j=fe(k,M),ie=M.source;t.bindTexture(me,k.__webglTexture,n.TEXTURE0+$);const Ce=s.get(ie);if(ie.version!==Ce.__version||j===!0){t.activeTexture(n.TEXTURE0+$);const we=Lt.getPrimaries(Lt.workingColorSpace),ke=M.colorSpace===gs?null:Lt.getPrimaries(M.colorSpace),We=M.colorSpace===gs||we===ke?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,M.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,M.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,We);const lt=R(M)&&S(M.image)===!1;let Pe=v(M.image,lt,!1,u);Pe=ge(M,Pe);const Nt=S(Pe)||a,tt=r.convert(M.format,M.colorSpace);let nt=r.convert(M.type),ze=I(M.internalFormat,tt,nt,M.colorSpace,M.isVideoTexture);Q(me,M,Nt);let Ke;const _t=M.mipmaps,ee=a&&M.isVideoTexture!==!0&&ze!==kM,je=Ce.__version===void 0||j===!0,Ge=x(M,Pe,Nt);if(M.isDepthTexture)ze=n.DEPTH_COMPONENT,a?M.type===Ni?ze=n.DEPTH_COMPONENT32F:M.type===_r?ze=n.DEPTH_COMPONENT24:M.type===no?ze=n.DEPTH24_STENCIL8:ze=n.DEPTH_COMPONENT16:M.type===Ni&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),M.format===so&&ze===n.DEPTH_COMPONENT&&M.type!==ay&&M.type!==_r&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),M.type=_r,nt=r.convert(M.type)),M.format===Sa&&ze===n.DEPTH_COMPONENT&&(ze=n.DEPTH_STENCIL,M.type!==no&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),M.type=no,nt=r.convert(M.type))),je&&(ee?t.texStorage2D(n.TEXTURE_2D,1,ze,Pe.width,Pe.height):t.texImage2D(n.TEXTURE_2D,0,ze,Pe.width,Pe.height,0,tt,nt,null));else if(M.isDataTexture)if(_t.length>0&&Nt){ee&&je&&t.texStorage2D(n.TEXTURE_2D,Ge,ze,_t[0].width,_t[0].height);for(let Me=0,He=_t.length;Me>=1,He>>=1}}else if(_t.length>0&&Nt){ee&&je&&t.texStorage2D(n.TEXTURE_2D,Ge,ze,_t[0].width,_t[0].height);for(let Me=0,He=_t.length;Me0&&je++,t.texStorage2D(n.TEXTURE_CUBE_MAP,je,Ke,Pe[0].width,Pe[0].height));for(let Me=0;Me<6;Me++)if(lt){_t?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Me,0,0,0,Pe[Me].width,Pe[Me].height,nt,ze,Pe[Me].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Me,0,Ke,Pe[Me].width,Pe[Me].height,0,nt,ze,Pe[Me].data);for(let He=0;He>ie),Pe=Math.max(1,M.height>>ie);j===n.TEXTURE_3D||j===n.TEXTURE_2D_ARRAY?t.texImage3D(j,ie,ke,lt,Pe,M.depth,0,Ce,we,null):t.texImage2D(j,ie,ke,lt,Pe,0,Ce,we,null)}t.bindFramebuffer(n.FRAMEBUFFER,k),Ne(M)?m.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,me,j,s.get($).__webglTexture,0,ae(M)):(j===n.TEXTURE_2D||j>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&j<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,me,j,s.get($).__webglTexture,ie),t.bindFramebuffer(n.FRAMEBUFFER,null)}function ne(k,M,$){if(n.bindRenderbuffer(n.RENDERBUFFER,k),M.depthBuffer&&!M.stencilBuffer){let me=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if($||Ne(M)){const j=M.depthTexture;j&&j.isDepthTexture&&(j.type===Ni?me=n.DEPTH_COMPONENT32F:j.type===_r&&(me=n.DEPTH_COMPONENT24));const ie=ae(M);Ne(M)?m.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ie,me,M.width,M.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,ie,me,M.width,M.height)}else n.renderbufferStorage(n.RENDERBUFFER,me,M.width,M.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,k)}else if(M.depthBuffer&&M.stencilBuffer){const me=ae(M);$&&Ne(M)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,me,n.DEPTH24_STENCIL8,M.width,M.height):Ne(M)?m.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,me,n.DEPTH24_STENCIL8,M.width,M.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,M.width,M.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,k)}else{const me=M.isWebGLMultipleRenderTargets===!0?M.texture:[M.texture];for(let j=0;j0){$.__webglFramebuffer[we]=[];for(let ke=0;ke0){$.__webglFramebuffer=[];for(let we=0;we0&&Ne(k)===!1){const we=ie?M:[M];$.__webglMultisampledFramebuffer=n.createFramebuffer(),$.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,$.__webglMultisampledFramebuffer);for(let ke=0;ke0)for(let ke=0;ke0)for(let ke=0;ke0&&Ne(k)===!1){const M=k.isWebGLMultipleRenderTargets?k.texture:[k.texture],$=k.width,me=k.height;let j=n.COLOR_BUFFER_BIT;const ie=[],Ce=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,we=s.get(k),ke=k.isWebGLMultipleRenderTargets===!0;if(ke)for(let We=0;We0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&M.__useRenderToTexture!==!1}function Re(k){const M=o.render.frame;f.get(k)!==M&&(f.set(k,M),k.update())}function ge(k,M){const $=k.colorSpace,me=k.format,j=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||k.format===Tb||$!==Cn&&$!==gs&&(Lt.getTransfer($)===jt?a===!1?e.has("EXT_sRGB")===!0&&me===hs?(k.format=Tb,k.minFilter=$n,k.generateMipmaps=!1):M=UM.sRGBToLinear(M):(me!==hs||j!==yr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",$)),M}this.allocateTextureUnit=Y,this.resetTextureUnits=L,this.setTexture2D=oe,this.setTexture2DArray=ye,this.setTexture3D=xe,this.setTextureCube=le,this.rebindTextures=J,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=pe,this.updateMultisampleRenderTarget=he,this.setupDepthRenderbuffer=P,this.setupFrameBufferTexture=Fe,this.useMultisampledRTT=Ne}function mvt(n,e,t){const s=t.isWebGL2;function i(r,o=gs){let a;const c=Lt.getTransfer(o);if(r===yr)return n.UNSIGNED_BYTE;if(r===AM)return n.UNSIGNED_SHORT_4_4_4_4;if(r===NM)return n.UNSIGNED_SHORT_5_5_5_1;if(r===Pht)return n.BYTE;if(r===Fht)return n.SHORT;if(r===ay)return n.UNSIGNED_SHORT;if(r===RM)return n.INT;if(r===_r)return n.UNSIGNED_INT;if(r===Ni)return n.FLOAT;if(r===Xl)return s?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===Uht)return n.ALPHA;if(r===hs)return n.RGBA;if(r===Bht)return n.LUMINANCE;if(r===Ght)return n.LUMINANCE_ALPHA;if(r===so)return n.DEPTH_COMPONENT;if(r===Sa)return n.DEPTH_STENCIL;if(r===Tb)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===Vht)return n.RED;if(r===MM)return n.RED_INTEGER;if(r===zht)return n.RG;if(r===OM)return n.RG_INTEGER;if(r===IM)return n.RGBA_INTEGER;if(r===Kh||r===jh||r===Qh||r===Xh)if(c===jt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Kh)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===jh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Qh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Xh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Kh)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===jh)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Qh)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Xh)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===uC||r===pC||r===fC||r===_C)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===uC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===pC)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===fC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===_C)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===kM)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===mC||r===hC)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===mC)return c===jt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===hC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===gC||r===bC||r===yC||r===EC||r===vC||r===SC||r===TC||r===xC||r===CC||r===wC||r===RC||r===AC||r===NC||r===MC)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===gC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===bC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===yC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===EC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===vC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===SC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===TC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===xC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===CC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===wC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===RC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===AC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===NC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===MC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Zh||r===OC||r===IC)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Zh)return c===jt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===OC)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===IC)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===Hht||r===kC||r===DC||r===LC)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===Zh)return a.COMPRESSED_RED_RGTC1_EXT;if(r===kC)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===DC)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===LC)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===no?s?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[r]!==void 0?n[r]:null}return{convert:i}}class hvt extends Gn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Qr extends Jt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const gvt={type:"move"};class Sg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Qr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new re,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new re),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new re,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new re),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const s of e.hand.values())this._getHandJoint(t,s)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,s){let i=null,r=null,o=null;const a=this._targetRay,c=this._grip,d=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(const g of e.hand.values()){const b=t.getJointPose(g,s),y=this._getHandJoint(d,g);b!==null&&(y.matrix.fromArray(b.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,y.jointRadius=b.radius),y.visible=b!==null}const u=d.joints["index-finger-tip"],_=d.joints["thumb-tip"],m=u.position.distanceTo(_.position),h=.02,f=.005;d.inputState.pinching&&m>h+f?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&m<=h-f&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,s),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,s),i===null&&r!==null&&(i=r),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(gvt)))}return a!==null&&(a.visible=i!==null),c!==null&&(c.visible=r!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const s=new Qr;s.matrixAutoUpdate=!1,s.visible=!1,e.joints[t.jointName]=s,e.add(s)}return e.joints[t.jointName]}}class bvt extends Ha{constructor(e,t){super();const s=this;let i=null,r=1,o=null,a="local-floor",c=1,d=null,u=null,_=null,m=null,h=null,f=null;const g=t.getContextAttributes();let b=null,y=null;const E=[],v=[],S=new Rt;let R=null;const C=new Gn;C.layers.enable(1),C.viewport=new $t;const A=new Gn;A.layers.enable(2),A.viewport=new $t;const I=[C,A],x=new hvt;x.layers.enable(1),x.layers.enable(2);let N=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(le){let ve=E[le];return ve===void 0&&(ve=new Sg,E[le]=ve),ve.getTargetRaySpace()},this.getControllerGrip=function(le){let ve=E[le];return ve===void 0&&(ve=new Sg,E[le]=ve),ve.getGripSpace()},this.getHand=function(le){let ve=E[le];return ve===void 0&&(ve=new Sg,E[le]=ve),ve.getHandSpace()};function V(le){const ve=v.indexOf(le.inputSource);if(ve===-1)return;const Oe=E[ve];Oe!==void 0&&(Oe.update(le.inputSource,le.frame,d||o),Oe.dispatchEvent({type:le.type,data:le.inputSource}))}function te(){i.removeEventListener("select",V),i.removeEventListener("selectstart",V),i.removeEventListener("selectend",V),i.removeEventListener("squeeze",V),i.removeEventListener("squeezestart",V),i.removeEventListener("squeezeend",V),i.removeEventListener("end",te),i.removeEventListener("inputsourceschange",O);for(let le=0;le=0&&(v[De]=null,E[De].disconnect(Oe))}for(let ve=0;ve=v.length){v.push(Oe),De=fe;break}else if(v[fe]===null){v[fe]=Oe,De=fe;break}if(De===-1)break}const Q=E[De];Q&&Q.connect(Oe)}}const H=new re,q=new re;function L(le,ve,Oe){H.setFromMatrixPosition(ve.matrixWorld),q.setFromMatrixPosition(Oe.matrixWorld);const De=H.distanceTo(q),Q=ve.projectionMatrix.elements,fe=Oe.projectionMatrix.elements,_e=Q[14]/(Q[10]-1),Ae=Q[14]/(Q[10]+1),Fe=(Q[9]+1)/Q[5],ne=(Q[9]-1)/Q[5],U=(Q[8]-1)/Q[0],P=(fe[8]+1)/fe[0],J=_e*U,ce=_e*P,pe=De/(-U+P),he=pe*-U;ve.matrixWorld.decompose(le.position,le.quaternion,le.scale),le.translateX(he),le.translateZ(pe),le.matrixWorld.compose(le.position,le.quaternion,le.scale),le.matrixWorldInverse.copy(le.matrixWorld).invert();const ae=_e+pe,Ne=Ae+pe,Re=J-he,ge=ce+(De-he),k=Fe*Ae/Ne*ae,M=ne*Ae/Ne*ae;le.projectionMatrix.makePerspective(Re,ge,k,M,ae,Ne),le.projectionMatrixInverse.copy(le.projectionMatrix).invert()}function Y(le,ve){ve===null?le.matrixWorld.copy(le.matrix):le.matrixWorld.multiplyMatrices(ve.matrixWorld,le.matrix),le.matrixWorldInverse.copy(le.matrixWorld).invert()}this.updateCamera=function(le){if(i===null)return;x.near=A.near=C.near=le.near,x.far=A.far=C.far=le.far,(N!==x.near||G!==x.far)&&(i.updateRenderState({depthNear:x.near,depthFar:x.far}),N=x.near,G=x.far);const ve=le.parent,Oe=x.cameras;Y(x,ve);for(let De=0;De0&&(b.alphaTest.value=y.alphaTest);const E=e.get(y).envMap;if(E&&(b.envMap.value=E,b.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,b.reflectivity.value=y.reflectivity,b.ior.value=y.ior,b.refractionRatio.value=y.refractionRatio),y.lightMap){b.lightMap.value=y.lightMap;const v=n._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=y.lightMapIntensity*v,t(y.lightMap,b.lightMapTransform)}y.aoMap&&(b.aoMap.value=y.aoMap,b.aoMapIntensity.value=y.aoMapIntensity,t(y.aoMap,b.aoMapTransform))}function o(b,y){b.diffuse.value.copy(y.color),b.opacity.value=y.opacity,y.map&&(b.map.value=y.map,t(y.map,b.mapTransform))}function a(b,y){b.dashSize.value=y.dashSize,b.totalSize.value=y.dashSize+y.gapSize,b.scale.value=y.scale}function c(b,y,E,v){b.diffuse.value.copy(y.color),b.opacity.value=y.opacity,b.size.value=y.size*E,b.scale.value=v*.5,y.map&&(b.map.value=y.map,t(y.map,b.uvTransform)),y.alphaMap&&(b.alphaMap.value=y.alphaMap,t(y.alphaMap,b.alphaMapTransform)),y.alphaTest>0&&(b.alphaTest.value=y.alphaTest)}function d(b,y){b.diffuse.value.copy(y.color),b.opacity.value=y.opacity,b.rotation.value=y.rotation,y.map&&(b.map.value=y.map,t(y.map,b.mapTransform)),y.alphaMap&&(b.alphaMap.value=y.alphaMap,t(y.alphaMap,b.alphaMapTransform)),y.alphaTest>0&&(b.alphaTest.value=y.alphaTest)}function u(b,y){b.specular.value.copy(y.specular),b.shininess.value=Math.max(y.shininess,1e-4)}function _(b,y){y.gradientMap&&(b.gradientMap.value=y.gradientMap)}function m(b,y){b.metalness.value=y.metalness,y.metalnessMap&&(b.metalnessMap.value=y.metalnessMap,t(y.metalnessMap,b.metalnessMapTransform)),b.roughness.value=y.roughness,y.roughnessMap&&(b.roughnessMap.value=y.roughnessMap,t(y.roughnessMap,b.roughnessMapTransform)),e.get(y).envMap&&(b.envMapIntensity.value=y.envMapIntensity)}function h(b,y,E){b.ior.value=y.ior,y.sheen>0&&(b.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),b.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(b.sheenColorMap.value=y.sheenColorMap,t(y.sheenColorMap,b.sheenColorMapTransform)),y.sheenRoughnessMap&&(b.sheenRoughnessMap.value=y.sheenRoughnessMap,t(y.sheenRoughnessMap,b.sheenRoughnessMapTransform))),y.clearcoat>0&&(b.clearcoat.value=y.clearcoat,b.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(b.clearcoatMap.value=y.clearcoatMap,t(y.clearcoatMap,b.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,t(y.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(b.clearcoatNormalMap.value=y.clearcoatNormalMap,t(y.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===Xn&&b.clearcoatNormalScale.value.negate())),y.iridescence>0&&(b.iridescence.value=y.iridescence,b.iridescenceIOR.value=y.iridescenceIOR,b.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(b.iridescenceMap.value=y.iridescenceMap,t(y.iridescenceMap,b.iridescenceMapTransform)),y.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=y.iridescenceThicknessMap,t(y.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),y.transmission>0&&(b.transmission.value=y.transmission,b.transmissionSamplerMap.value=E.texture,b.transmissionSamplerSize.value.set(E.width,E.height),y.transmissionMap&&(b.transmissionMap.value=y.transmissionMap,t(y.transmissionMap,b.transmissionMapTransform)),b.thickness.value=y.thickness,y.thicknessMap&&(b.thicknessMap.value=y.thicknessMap,t(y.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=y.attenuationDistance,b.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(b.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(b.anisotropyMap.value=y.anisotropyMap,t(y.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=y.specularIntensity,b.specularColor.value.copy(y.specularColor),y.specularColorMap&&(b.specularColorMap.value=y.specularColorMap,t(y.specularColorMap,b.specularColorMapTransform)),y.specularIntensityMap&&(b.specularIntensityMap.value=y.specularIntensityMap,t(y.specularIntensityMap,b.specularIntensityMapTransform))}function f(b,y){y.matcap&&(b.matcap.value=y.matcap)}function g(b,y){const E=e.get(y).light;b.referencePosition.value.setFromMatrixPosition(E.matrixWorld),b.nearDistance.value=E.shadow.camera.near,b.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:i}}function Evt(n,e,t,s){let i={},r={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(E,v){const S=v.program;s.uniformBlockBinding(E,S)}function d(E,v){let S=i[E.id];S===void 0&&(f(E),S=u(E),i[E.id]=S,E.addEventListener("dispose",b));const R=v.program;s.updateUBOMapping(E,R);const C=e.render.frame;r[E.id]!==C&&(m(E),r[E.id]=C)}function u(E){const v=_();E.__bindingPointIndex=v;const S=n.createBuffer(),R=E.__size,C=E.usage;return n.bindBuffer(n.UNIFORM_BUFFER,S),n.bufferData(n.UNIFORM_BUFFER,R,C),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,v,S),S}function _(){for(let E=0;E0){C=S%R;const V=R-C;C!==0&&V-N.boundary<0&&(S+=R-C,x.__offset=S)}S+=N.storage}return C=S%R,C>0&&(S+=R-C),E.__size=S,E.__cache={},this}function g(E){const v={boundary:0,storage:0};return typeof E=="number"?(v.boundary=4,v.storage=4):E.isVector2?(v.boundary=8,v.storage=8):E.isVector3||E.isColor?(v.boundary=16,v.storage=12):E.isVector4?(v.boundary=16,v.storage=16):E.isMatrix3?(v.boundary=48,v.storage=48):E.isMatrix4?(v.boundary=64,v.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),v}function b(E){const v=E.target;v.removeEventListener("dispose",b);const S=o.indexOf(v.__bindingPointIndex);o.splice(S,1),n.deleteBuffer(i[v.id]),delete i[v.id],delete r[v.id]}function y(){for(const E in i)n.deleteBuffer(i[E]);o=[],i={},r={}}return{bind:c,update:d,dispose:y}}class tO{constructor(e={}){const{canvas:t=ggt(),context:s=null,depth:i=!0,stencil:r=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:d=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:_=!1}=e;this.isWebGLRenderer=!0;let m;s!==null?m=s.getContextAttributes().alpha:m=o;const h=new Uint32Array(4),f=new Int32Array(4);let g=null,b=null;const y=[],E=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=nn,this._useLegacyLights=!1,this.toneMapping=br,this.toneMappingExposure=1;const v=this;let S=!1,R=0,C=0,A=null,I=-1,x=null;const N=new $t,G=new $t;let V=null;const te=new pt(0);let O=0,H=t.width,q=t.height,L=1,Y=null,se=null;const oe=new $t(0,0,H,q),ye=new $t(0,0,H,q);let xe=!1;const le=new uy;let ve=!1,Oe=!1,De=null;const Q=new St,fe=new Rt,_e=new re,Ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Fe(){return A===null?L:1}let ne=s;function U(F,de){for(let Ee=0;Ee{function Qe(){if(Se.forEach(function(st){he.get(st).currentProgram.isReady()&&Se.delete(st)}),Se.size===0){be(F);return}setTimeout(Qe,10)}P.get("KHR_parallel_shader_compile")!==null?Qe():setTimeout(Qe,10)})};let Mt=null;function cn(F){Mt&&Mt(F)}function wn(){Rn.stop()}function Ht(){Rn.start()}const Rn=new KM;Rn.setAnimationLoop(cn),typeof self<"u"&&Rn.setContext(self),this.setAnimationLoop=function(F){Mt=F,Ke.setAnimationLoop(F),F===null?Rn.stop():Rn.start()},Ke.addEventListener("sessionstart",wn),Ke.addEventListener("sessionend",Ht),this.render=function(F,de){if(de!==void 0&&de.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),de.parent===null&&de.matrixWorldAutoUpdate===!0&&de.updateMatrixWorld(),Ke.enabled===!0&&Ke.isPresenting===!0&&(Ke.cameraAutoUpdate===!0&&Ke.updateCamera(de),de=Ke.getCamera()),F.isScene===!0&&F.onBeforeRender(v,F,de,A),b=ie.get(F,E.length),b.init(),E.push(b),Q.multiplyMatrices(de.projectionMatrix,de.matrixWorldInverse),le.setFromProjectionMatrix(Q),Oe=this.localClippingEnabled,ve=Ce.init(this.clippingPlanes,Oe),g=j.get(F,y.length),g.init(),y.push(g),Ns(F,de,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(Y,se),this.info.render.frame++,ve===!0&&Ce.beginShadows();const Ee=b.state.shadowsArray;if(we.render(Ee,F,de),ve===!0&&Ce.endShadows(),this.info.autoReset===!0&&this.info.reset(),ke.render(g,F),b.setupLights(v._useLegacyLights),de.isArrayCamera){const Se=de.cameras;for(let be=0,Qe=Se.length;be0?b=E[E.length-1]:b=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function Ns(F,de,Ee,Se){if(F.visible===!1)return;if(F.layers.test(de.layers)){if(F.isGroup)Ee=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(de);else if(F.isLight)b.pushLight(F),F.castShadow&&b.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||le.intersectsSprite(F)){Se&&_e.setFromMatrixPosition(F.matrixWorld).applyMatrix4(Q);const st=M.update(F),ct=F.material;ct.visible&&g.push(F,st,ct,Ee,_e.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||le.intersectsObject(F))){const st=M.update(F),ct=F.material;if(Se&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),_e.copy(F.boundingSphere.center)):(st.boundingSphere===null&&st.computeBoundingSphere(),_e.copy(st.boundingSphere.center)),_e.applyMatrix4(F.matrixWorld).applyMatrix4(Q)),Array.isArray(ct)){const ut=st.groups;for(let bt=0,mt=ut.length;bt0&&Py(be,Qe,de,Ee),Se&&ce.viewport(N.copy(Se)),be.length>0&&ja(be,de,Ee),Qe.length>0&&ja(Qe,de,Ee),st.length>0&&ja(st,de,Ee),ce.buffers.depth.setTest(!0),ce.buffers.depth.setMask(!0),ce.buffers.color.setMask(!0),ce.setPolygonOffset(!1)}function Py(F,de,Ee,Se){if((Ee.isScene===!0?Ee.overrideMaterial:null)!==null)return;const Qe=J.isWebGL2;De===null&&(De=new _o(1,1,{generateMipmaps:!0,type:P.has("EXT_color_buffer_half_float")?Xl:yr,minFilter:fo,samples:Qe?4:0})),v.getDrawingBufferSize(fe),Qe?De.setSize(fe.x,fe.y):De.setSize(vu(fe.x),vu(fe.y));const st=v.getRenderTarget();v.setRenderTarget(De),v.getClearColor(te),O=v.getClearAlpha(),O<1&&v.setClearColor(16777215,.5),v.clear();const ct=v.toneMapping;v.toneMapping=br,ja(F,Ee,Se),ae.updateMultisampleRenderTarget(De),ae.updateRenderTargetMipmap(De);let ut=!1;for(let bt=0,mt=de.length;bt0),ht=!!Ee.morphAttributes.position,tn=!!Ee.morphAttributes.normal,qn=!!Ee.morphAttributes.color;let dn=br;Se.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(dn=v.toneMapping);const Ws=Ee.morphAttributes.position||Ee.morphAttributes.normal||Ee.morphAttributes.color,Qt=Ws!==void 0?Ws.length:0,Et=he.get(Se),yc=b.state.lights;if(ve===!0&&(Oe===!0||F!==x)){const Jn=F===x&&Se.id===I;Ce.setState(Se,F,Jn)}let Zt=!1;Se.version===Et.__version?(Et.needsLights&&Et.lightsStateVersion!==yc.state.version||Et.outputColorSpace!==ct||be.isBatchedMesh&&Et.batching===!1||!be.isBatchedMesh&&Et.batching===!0||be.isInstancedMesh&&Et.instancing===!1||!be.isInstancedMesh&&Et.instancing===!0||be.isSkinnedMesh&&Et.skinning===!1||!be.isSkinnedMesh&&Et.skinning===!0||be.isInstancedMesh&&Et.instancingColor===!0&&be.instanceColor===null||be.isInstancedMesh&&Et.instancingColor===!1&&be.instanceColor!==null||Et.envMap!==ut||Se.fog===!0&&Et.fog!==Qe||Et.numClippingPlanes!==void 0&&(Et.numClippingPlanes!==Ce.numPlanes||Et.numIntersection!==Ce.numIntersection)||Et.vertexAlphas!==bt||Et.vertexTangents!==mt||Et.morphTargets!==ht||Et.morphNormals!==tn||Et.morphColors!==qn||Et.toneMapping!==dn||J.isWebGL2===!0&&Et.morphTargetsCount!==Qt)&&(Zt=!0):(Zt=!0,Et.__version=Se.version);let Hi=Et.currentProgram;Zt===!0&&(Hi=Qa(Se,de,be));let Np=!1,vo=!1,Ec=!1;const yn=Hi.getUniforms(),qi=Et.uniforms;if(ce.useProgram(Hi.program)&&(Np=!0,vo=!0,Ec=!0),Se.id!==I&&(I=Se.id,vo=!0),Np||x!==F){yn.setValue(ne,"projectionMatrix",F.projectionMatrix),yn.setValue(ne,"viewMatrix",F.matrixWorldInverse);const Jn=yn.map.cameraPosition;Jn!==void 0&&Jn.setValue(ne,_e.setFromMatrixPosition(F.matrixWorld)),J.logarithmicDepthBuffer&&yn.setValue(ne,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(Se.isMeshPhongMaterial||Se.isMeshToonMaterial||Se.isMeshLambertMaterial||Se.isMeshBasicMaterial||Se.isMeshStandardMaterial||Se.isShaderMaterial)&&yn.setValue(ne,"isOrthographic",F.isOrthographicCamera===!0),x!==F&&(x=F,vo=!0,Ec=!0)}if(be.isSkinnedMesh){yn.setOptional(ne,be,"bindMatrix"),yn.setOptional(ne,be,"bindMatrixInverse");const Jn=be.skeleton;Jn&&(J.floatVertexTextures?(Jn.boneTexture===null&&Jn.computeBoneTexture(),yn.setValue(ne,"boneTexture",Jn.boneTexture,ae)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}be.isBatchedMesh&&(yn.setOptional(ne,be,"batchingTexture"),yn.setValue(ne,"batchingTexture",be._matricesTexture,ae));const vc=Ee.morphAttributes;if((vc.position!==void 0||vc.normal!==void 0||vc.color!==void 0&&J.isWebGL2===!0)&&We.update(be,Ee,Hi),(vo||Et.receiveShadow!==be.receiveShadow)&&(Et.receiveShadow=be.receiveShadow,yn.setValue(ne,"receiveShadow",be.receiveShadow)),Se.isMeshGouraudMaterial&&Se.envMap!==null&&(qi.envMap.value=ut,qi.flipEnvMap.value=ut.isCubeTexture&&ut.isRenderTargetTexture===!1?-1:1),vo&&(yn.setValue(ne,"toneMappingExposure",v.toneMappingExposure),Et.needsLights&&Uy(qi,Ec),Qe&&Se.fog===!0&&me.refreshFogUniforms(qi,Qe),me.refreshMaterialUniforms(qi,Se,L,q,De),Ud.upload(ne,Rp(Et),qi,ae)),Se.isShaderMaterial&&Se.uniformsNeedUpdate===!0&&(Ud.upload(ne,Rp(Et),qi,ae),Se.uniformsNeedUpdate=!1),Se.isSpriteMaterial&&yn.setValue(ne,"center",be.center),yn.setValue(ne,"modelViewMatrix",be.modelViewMatrix),yn.setValue(ne,"normalMatrix",be.normalMatrix),yn.setValue(ne,"modelMatrix",be.matrixWorld),Se.isShaderMaterial||Se.isRawShaderMaterial){const Jn=Se.uniformsGroups;for(let Sc=0,Gy=Jn.length;Sc0&&ae.useMultisampledRTT(F)===!1?be=he.get(F).__webglMultisampledFramebuffer:Array.isArray(mt)?be=mt[Ee]:be=mt,N.copy(F.viewport),G.copy(F.scissor),V=F.scissorTest}else N.copy(oe).multiplyScalar(L).floor(),G.copy(ye).multiplyScalar(L).floor(),V=xe;if(ce.bindFramebuffer(ne.FRAMEBUFFER,be)&&J.drawBuffers&&Se&&ce.drawBuffers(F,be),ce.viewport(N),ce.scissor(G),ce.setScissorTest(V),Qe){const ut=he.get(F.texture);ne.framebufferTexture2D(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0,ne.TEXTURE_CUBE_MAP_POSITIVE_X+de,ut.__webglTexture,Ee)}else if(st){const ut=he.get(F.texture),bt=de||0;ne.framebufferTextureLayer(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0,ut.__webglTexture,Ee||0,bt)}I=-1},this.readRenderTargetPixels=function(F,de,Ee,Se,be,Qe,st){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ct=he.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&st!==void 0&&(ct=ct[st]),ct){ce.bindFramebuffer(ne.FRAMEBUFFER,ct);try{const ut=F.texture,bt=ut.format,mt=ut.type;if(bt!==hs&&Nt.convert(bt)!==ne.getParameter(ne.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=mt===Xl&&(P.has("EXT_color_buffer_half_float")||J.isWebGL2&&P.has("EXT_color_buffer_float"));if(mt!==yr&&Nt.convert(mt)!==ne.getParameter(ne.IMPLEMENTATION_COLOR_READ_TYPE)&&!(mt===Ni&&(J.isWebGL2||P.has("OES_texture_float")||P.has("WEBGL_color_buffer_float")))&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}de>=0&&de<=F.width-Se&&Ee>=0&&Ee<=F.height-be&&ne.readPixels(de,Ee,Se,be,Nt.convert(bt),Nt.convert(mt),Qe)}finally{const ut=A!==null?he.get(A).__webglFramebuffer:null;ce.bindFramebuffer(ne.FRAMEBUFFER,ut)}}},this.copyFramebufferToTexture=function(F,de,Ee=0){const Se=Math.pow(2,-Ee),be=Math.floor(de.image.width*Se),Qe=Math.floor(de.image.height*Se);ae.setTexture2D(de,0),ne.copyTexSubImage2D(ne.TEXTURE_2D,Ee,0,0,F.x,F.y,be,Qe),ce.unbindTexture()},this.copyTextureToTexture=function(F,de,Ee,Se=0){const be=de.image.width,Qe=de.image.height,st=Nt.convert(Ee.format),ct=Nt.convert(Ee.type);ae.setTexture2D(Ee,0),ne.pixelStorei(ne.UNPACK_FLIP_Y_WEBGL,Ee.flipY),ne.pixelStorei(ne.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ee.premultiplyAlpha),ne.pixelStorei(ne.UNPACK_ALIGNMENT,Ee.unpackAlignment),de.isDataTexture?ne.texSubImage2D(ne.TEXTURE_2D,Se,F.x,F.y,be,Qe,st,ct,de.image.data):de.isCompressedTexture?ne.compressedTexSubImage2D(ne.TEXTURE_2D,Se,F.x,F.y,de.mipmaps[0].width,de.mipmaps[0].height,st,de.mipmaps[0].data):ne.texSubImage2D(ne.TEXTURE_2D,Se,F.x,F.y,st,ct,de.image),Se===0&&Ee.generateMipmaps&&ne.generateMipmap(ne.TEXTURE_2D),ce.unbindTexture()},this.copyTextureToTexture3D=function(F,de,Ee,Se,be=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Qe=F.max.x-F.min.x+1,st=F.max.y-F.min.y+1,ct=F.max.z-F.min.z+1,ut=Nt.convert(Se.format),bt=Nt.convert(Se.type);let mt;if(Se.isData3DTexture)ae.setTexture3D(Se,0),mt=ne.TEXTURE_3D;else if(Se.isDataArrayTexture)ae.setTexture2DArray(Se,0),mt=ne.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ne.pixelStorei(ne.UNPACK_FLIP_Y_WEBGL,Se.flipY),ne.pixelStorei(ne.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Se.premultiplyAlpha),ne.pixelStorei(ne.UNPACK_ALIGNMENT,Se.unpackAlignment);const ht=ne.getParameter(ne.UNPACK_ROW_LENGTH),tn=ne.getParameter(ne.UNPACK_IMAGE_HEIGHT),qn=ne.getParameter(ne.UNPACK_SKIP_PIXELS),dn=ne.getParameter(ne.UNPACK_SKIP_ROWS),Ws=ne.getParameter(ne.UNPACK_SKIP_IMAGES),Qt=Ee.isCompressedTexture?Ee.mipmaps[0]:Ee.image;ne.pixelStorei(ne.UNPACK_ROW_LENGTH,Qt.width),ne.pixelStorei(ne.UNPACK_IMAGE_HEIGHT,Qt.height),ne.pixelStorei(ne.UNPACK_SKIP_PIXELS,F.min.x),ne.pixelStorei(ne.UNPACK_SKIP_ROWS,F.min.y),ne.pixelStorei(ne.UNPACK_SKIP_IMAGES,F.min.z),Ee.isDataTexture||Ee.isData3DTexture?ne.texSubImage3D(mt,be,de.x,de.y,de.z,Qe,st,ct,ut,bt,Qt.data):Ee.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ne.compressedTexSubImage3D(mt,be,de.x,de.y,de.z,Qe,st,ct,ut,Qt.data)):ne.texSubImage3D(mt,be,de.x,de.y,de.z,Qe,st,ct,ut,bt,Qt),ne.pixelStorei(ne.UNPACK_ROW_LENGTH,ht),ne.pixelStorei(ne.UNPACK_IMAGE_HEIGHT,tn),ne.pixelStorei(ne.UNPACK_SKIP_PIXELS,qn),ne.pixelStorei(ne.UNPACK_SKIP_ROWS,dn),ne.pixelStorei(ne.UNPACK_SKIP_IMAGES,Ws),be===0&&Se.generateMipmaps&&ne.generateMipmap(mt),ce.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?ae.setTextureCube(F,0):F.isData3DTexture?ae.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?ae.setTexture2DArray(F,0):ae.setTexture2D(F,0),ce.unbindTexture()},this.resetState=function(){R=0,C=0,A=null,ce.reset(),tt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Mi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===cy?"display-p3":"srgb",t.unpackColorSpace=Lt.workingColorSpace===gp?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===nn?io:LM}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===io?nn:Cn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class vvt extends tO{}vvt.prototype.isWebGL1Renderer=!0;class Svt extends Jt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class Tvt{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Sb,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Bs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,s){e*=this.stride,s*=t.stride;for(let i=0,r=this.stride;ic)continue;m.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(m);Ie.far||t.push({distance:I,point:_.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else{const y=Math.max(0,o.start),E=Math.min(b.count,o.start+o.count);for(let v=y,S=E-1;vc)continue;m.applyMatrix4(this.matrixWorld);const C=e.ray.origin.distanceTo(m);Ce.far||t.push({distance:C,point:_.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;ri.far)return;r.push({distance:d,distanceToRay:Math.sqrt(a),point:c,index:e,face:null,object:o})}}class by extends Gs{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new pt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ly,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class zi extends by{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Rt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return On(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new pt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new pt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new pt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Vw extends Gs{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new pt(16777215),this.specular=new pt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ly,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=oy,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function bd(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function kvt(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Dvt(n){function e(i,r){return n[i]-n[r]}const t=n.length,s=new Array(t);for(let i=0;i!==t;++i)s[i]=i;return s.sort(e),s}function zw(n,e,t){const s=n.length,i=new n.constructor(s);for(let r=0,o=0;o!==s;++r){const a=t[r]*e;for(let c=0;c!==e;++c)i[o++]=n[a+c]}return i}function rO(n,e,t,s){let i=1,r=n[0];for(;r!==void 0&&r[s]===void 0;)r=n[i++];if(r===void 0)return;let o=r[s];if(o!==void 0)if(Array.isArray(o))do o=r[s],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[i++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[s],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[i++];while(r!==void 0);else do o=r[s],o!==void 0&&(e.push(r.time),t.push(o)),r=n[i++];while(r!==void 0)}class _c{constructor(e,t,s,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(s),this.sampleValues=t,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let s=this._cachedIndex,i=t[s],r=t[s-1];e:{t:{let o;n:{s:if(!(e=r)){const a=t[1];e=r)break t}o=s,s=0;break n}break e}for(;s>>1;et;)--o;if(++o,r!==0||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=s.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,i=this.values,r=s.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const c=s[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(i!==void 0&&kvt(i))for(let a=0,c=i.length;a!==c;++a){const d=i[a];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,d),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),s=this.getValueSize(),i=this.getInterpolation()===Jh,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*s,c=o*s,d=0;d!==s;++d)t[c+d]=t[a+d];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*s)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),s=this.constructor,i=new s(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}mi.prototype.TimeBufferType=Float32Array;mi.prototype.ValueBufferType=Float32Array;mi.prototype.DefaultInterpolation=Ta;class Ya extends mi{}Ya.prototype.ValueTypeName="bool";Ya.prototype.ValueBufferType=Array;Ya.prototype.DefaultInterpolation=Zl;Ya.prototype.InterpolantFactoryMethodLinear=void 0;Ya.prototype.InterpolantFactoryMethodSmooth=void 0;class oO extends mi{}oO.prototype.ValueTypeName="color";class wa extends mi{}wa.prototype.ValueTypeName="number";class Uvt extends _c{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e,t,s,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(s-t)/(i-t);let d=e*a;for(let u=d+a;d!==u;d+=4)Mr.slerpFlat(r,0,o,d-a,o,d,c);return r}}class ho extends mi{InterpolantFactoryMethodLinear(e){return new Uvt(this.times,this.values,this.getValueSize(),e)}}ho.prototype.ValueTypeName="quaternion";ho.prototype.DefaultInterpolation=Ta;ho.prototype.InterpolantFactoryMethodSmooth=void 0;class $a extends mi{}$a.prototype.ValueTypeName="string";$a.prototype.ValueBufferType=Array;$a.prototype.DefaultInterpolation=Zl;$a.prototype.InterpolantFactoryMethodLinear=void 0;$a.prototype.InterpolantFactoryMethodSmooth=void 0;class Ra extends mi{}Ra.prototype.ValueTypeName="vector";class Bvt{constructor(e,t=-1,s,i=qht){this.name=e,this.tracks=s,this.duration=t,this.blendMode=i,this.uuid=Bs(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],s=e.tracks,i=1/(e.fps||1);for(let o=0,a=s.length;o!==a;++o)t.push(Vvt(s[o]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],s=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=s.length;r!==o;++r)t.push(mi.toJSON(s[r]));return i}static CreateFromMorphTargetSequence(e,t,s,i){const r=t.length,o=[];for(let a=0;a1){const _=u[1];let m=i[_];m||(i[_]=m=[]),m.push(d)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,s));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(_,m,h,f,g){if(h.length!==0){const b=[],y=[];rO(h,b,y,f),b.length!==0&&g.push(new _(m,b,y))}},i=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let c=e.length||-1;const d=e.hierarchy||[];for(let _=0;_{t&&t(r),this.manager.itemEnd(e)},0),r;if(Ti[e]!==void 0){Ti[e].push({onLoad:t,onProgress:s,onError:i});return}Ti[e]=[],Ti[e].push({onLoad:t,onProgress:s,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,c=this.responseType;fetch(o).then(d=>{if(d.status===200||d.status===0){if(d.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||d.body===void 0||d.body.getReader===void 0)return d;const u=Ti[e],_=d.body.getReader(),m=d.headers.get("Content-Length")||d.headers.get("X-File-Size"),h=m?parseInt(m):0,f=h!==0;let g=0;const b=new ReadableStream({start(y){E();function E(){_.read().then(({done:v,value:S})=>{if(v)y.close();else{g+=S.byteLength;const R=new ProgressEvent("progress",{lengthComputable:f,loaded:g,total:h});for(let C=0,A=u.length;C{switch(c){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return d.json();default:if(a===void 0)return d.text();{const _=/charset="?([^;"\s]*)"?/i.exec(a),m=_&&_[1]?_[1].toLowerCase():void 0,h=new TextDecoder(m);return d.arrayBuffer().then(f=>h.decode(f))}}}).then(d=>{Aa.add(e,d);const u=Ti[e];delete Ti[e];for(let _=0,m=u.length;_{const u=Ti[e];if(u===void 0)throw this.manager.itemError(e),d;delete Ti[e];for(let _=0,m=u.length;_{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Yvt extends Wa{constructor(e){super(e)}load(e,t,s,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Aa.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=Jl("img");function c(){u(),Aa.add(e,this),t&&t(this),r.manager.itemEnd(e)}function d(_){u(),i&&i(_),r.manager.itemError(e),r.manager.itemEnd(e)}function u(){a.removeEventListener("load",c,!1),a.removeEventListener("error",d,!1)}return a.addEventListener("load",c,!1),a.addEventListener("error",d,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class lO extends Wa{constructor(e){super(e)}load(e,t,s,i){const r=new xn,o=new Yvt(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},s,i),r}}class vp extends Jt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new pt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const wg=new St,Hw=new re,qw=new re;class yy{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Rt(512,512),this.map=null,this.mapPass=null,this.matrix=new St,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new uy,this._frameExtents=new Rt(1,1),this._viewportCount=1,this._viewports=[new $t(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,s=this.matrix;Hw.setFromMatrixPosition(e.matrixWorld),t.position.copy(Hw),qw.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(qw),t.updateMatrixWorld(),wg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(wg),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(wg)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class $vt extends yy{constructor(){super(new Gn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,s=xa*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(s!==t.fov||i!==t.aspect||r!==t.far)&&(t.fov=s,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Wvt extends vp{constructor(e,t,s=0,i=Math.PI/3,r=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.distance=s,this.angle=i,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new $vt}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Yw=new St,dl=new re,Rg=new re;class Kvt extends yy{constructor(){super(new Gn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Rt(4,2),this._viewportCount=6,this._viewports=[new $t(2,1,1,1),new $t(0,1,1,1),new $t(3,1,1,1),new $t(1,1,1,1),new $t(3,0,1,1),new $t(1,0,1,1)],this._cubeDirections=[new re(1,0,0),new re(-1,0,0),new re(0,0,1),new re(0,0,-1),new re(0,1,0),new re(0,-1,0)],this._cubeUps=[new re(0,1,0),new re(0,1,0),new re(0,1,0),new re(0,1,0),new re(0,0,1),new re(0,0,-1)]}updateMatrices(e,t=0){const s=this.camera,i=this.matrix,r=e.distance||s.far;r!==s.far&&(s.far=r,s.updateProjectionMatrix()),dl.setFromMatrixPosition(e.matrixWorld),s.position.copy(dl),Rg.copy(s.position),Rg.add(this._cubeDirections[t]),s.up.copy(this._cubeUps[t]),s.lookAt(Rg),s.updateMatrixWorld(),i.makeTranslation(-dl.x,-dl.y,-dl.z),Yw.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Yw)}}class jvt extends vp{constructor(e,t,s=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=i,this.shadow=new Kvt}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Qvt extends yy{constructor(){super(new fy(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class cO extends vp{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.shadow=new Qvt}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Xvt extends vp{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class kl{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let s=0,i=e.length;s"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,s,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Aa.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){Aa.add(e,c),t&&t(c),r.manager.itemEnd(e)}).catch(function(c){i&&i(c),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}const Ey="\\[\\]\\.:\\/",Jvt=new RegExp("["+Ey+"]","g"),vy="[^"+Ey+"]",eSt="[^"+Ey.replace("\\.","")+"]",tSt=/((?:WC+[\/:])*)/.source.replace("WC",vy),nSt=/(WCOD+)?/.source.replace("WCOD",eSt),sSt=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",vy),iSt=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",vy),rSt=new RegExp("^"+tSt+nSt+sSt+iSt+"$"),oSt=["material","materials","bones","map"];class aSt{constructor(e,t,s){const i=s||Ft.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const s=this._targetGroup.nCachedObjects_,i=this._bindings[s];i!==void 0&&i.getValue(e,t)}setValue(e,t){const s=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=s.length;i!==r;++i)s[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].unbind()}}class Ft{constructor(e,t,s){this.path=t,this.parsedPath=s||Ft.parseTrackName(t),this.node=Ft.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,s){return e&&e.isAnimationObjectGroup?new Ft.Composite(e,t,s):new Ft(e,t,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Jvt,"")}static parseTrackName(e){const t=rSt.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=s.nodeName&&s.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const r=s.nodeName.substring(i+1);oSt.indexOf(r)!==-1&&(s.nodeName=s.nodeName.substring(0,i),s.objectName=r)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(t);if(s!==void 0)return s}if(e.children){const s=function(r){for(let o=0;o=2.0 are supported."));return}const d=new GSt(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[_]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+_+'".')}}d.setExtensions(o),d.setPlugins(a),d.parse(s,i)}parseAsync(e,t){const s=this;return new Promise(function(i,r){s.parse(e,t,i,r)})}}function cSt(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const wt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class dSt{constructor(e){this.parser=e,this.name=wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,i=t.length;s=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class TSt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=i.images[o.source];let c=s.textureLoader;if(a.uri){const d=s.options.manager.getHandler(a.uri);d!==null&&(c=d)}return this.detectSupport().then(function(d){if(d)return s.loadTextureImage(e,o.source,c);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class xSt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=i.images[o.source];let c=s.textureLoader;if(a.uri){const d=s.options.manager.getHandler(a.uri);d!==null&&(c=d)}return this.detectSupport().then(function(d){if(d)return s.loadTextureImage(e,o.source,c);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class CSt{constructor(e){this.name=wt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const i=s.extensions[this.name],r=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const c=i.byteOffset||0,d=i.byteLength||0,u=i.count,_=i.byteStride,m=new Uint8Array(a,c,d);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,_,m,i.mode,i.filter).then(function(h){return h.buffer}):o.ready.then(function(){const h=new ArrayBuffer(u*_);return o.decodeGltfBuffer(new Uint8Array(h),u,_,m,i.mode,i.filter),h})})}else return null}}class wSt{constructor(e){this.name=wt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const i=t.meshes[s.mesh];for(const d of i.primitives)if(d.mode!==fs.TRIANGLES&&d.mode!==fs.TRIANGLE_STRIP&&d.mode!==fs.TRIANGLE_FAN&&d.mode!==void 0)return null;const o=s.extensions[this.name].attributes,a=[],c={};for(const d in o)a.push(this.parser.getDependency("accessor",o[d]).then(u=>(c[d]=u,c[d])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(d=>{const u=d.pop(),_=u.isGroup?u.children:[u],m=d[0].count,h=[];for(const f of _){const g=new St,b=new re,y=new Mr,E=new re(1,1,1),v=new Nvt(f.geometry,f.material,m);for(let S=0;S0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const BSt=new St;class GSt{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new cSt,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,i=!1,r=-1;typeof navigator<"u"&&(s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,r=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||s||i&&r<98?this.textureLoader=new lO(this.options.manager):this.textureLoader=new Zvt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new aO(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const a={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:s,userData:{}};return Br(r,a,i),ur(a,i),Promise.all(s._invokeAll(function(c){return c.afterRoot&&c.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let i=0,r=t.length;i{const c=this.associations.get(o);c!=null&&this.associations.set(a,c);for(const[d,u]of o.children.entries())r(u,a.children[d])};return r(s,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s=2&&b.setY(x,C[A*c+1]),c>=3&&b.setZ(x,C[A*c+2]),c>=4&&b.setW(x,C[A*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,s=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const c=s.manager.getHandler(o.uri);c!==null&&(a=c)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,s){const i=this,r=this.json,o=r.textures[e],a=r.images[t],c=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[c])return this.textureCache[c];const d=this.loadImageSource(t,s).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const m=(r.samplers||{})[o.sampler]||{};return u.magFilter=Kw[m.magFilter]||$n,u.minFilter=Kw[m.minFilter]||fo,u.wrapS=jw[m.wrapS]||va,u.wrapT=jw[m.wrapT]||va,i.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[c]=d,d}loadImageSource(e,t){const s=this,i=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(_=>_.clone());const o=i.images[e],a=self.URL||self.webkitURL;let c=o.uri||"",d=!1;if(o.bufferView!==void 0)c=s.getDependency("bufferView",o.bufferView).then(function(_){d=!0;const m=new Blob([_],{type:o.mimeType});return c=a.createObjectURL(m),c});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(c).then(function(_){return new Promise(function(m,h){let f=m;t.isImageBitmapLoader===!0&&(f=function(g){const b=new xn(g);b.needsUpdate=!0,m(b)}),t.load(kl.resolveURL(_,r.path),f,void 0,h)})}).then(function(_){return d===!0&&a.revokeObjectURL(c),_.userData.mimeType=o.mimeType||USt(o.uri),_}).catch(function(_){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),_});return this.sourceCache[e]=u,u}assignTexture(e,t,s,i){const r=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),r.extensions[wt.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[wt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const c=r.associations.get(o);o=r.extensions[wt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,c)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const i=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+s.uuid;let c=this.cache.get(a);c||(c=new iO,Gs.prototype.copy.call(c,s),c.color.copy(s.color),c.map=s.map,c.sizeAttenuation=!1,this.cache.add(a,c)),s=c}else if(e.isLine){const a="LineBasicMaterial:"+s.uuid;let c=this.cache.get(a);c||(c=new sO,Gs.prototype.copy.call(c,s),c.color.copy(s.color),c.map=s.map,this.cache.add(a,c)),s=c}if(i||r||o){let a="ClonedMaterial:"+s.uuid+":";i&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let c=this.cache.get(a);c||(c=s.clone(),r&&(c.vertexColors=!0),o&&(c.flatShading=!0),i&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(a,c),this.associations.set(c,this.associations.get(s))),s=c}e.material=s}getMaterialType(){return by}loadMaterial(e){const t=this,s=this.json,i=this.extensions,r=s.materials[e];let o;const a={},c=r.extensions||{},d=[];if(c[wt.KHR_MATERIALS_UNLIT]){const _=i[wt.KHR_MATERIALS_UNLIT];o=_.getMaterialType(),d.push(_.extendParams(a,r,t))}else{const _=r.pbrMetallicRoughness||{};if(a.color=new pt(1,1,1),a.opacity=1,Array.isArray(_.baseColorFactor)){const m=_.baseColorFactor;a.color.setRGB(m[0],m[1],m[2],Cn),a.opacity=m[3]}_.baseColorTexture!==void 0&&d.push(t.assignTexture(a,"map",_.baseColorTexture,nn)),a.metalness=_.metallicFactor!==void 0?_.metallicFactor:1,a.roughness=_.roughnessFactor!==void 0?_.roughnessFactor:1,_.metallicRoughnessTexture!==void 0&&(d.push(t.assignTexture(a,"metalnessMap",_.metallicRoughnessTexture)),d.push(t.assignTexture(a,"roughnessMap",_.metallicRoughnessTexture))),o=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),d.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=Js);const u=r.alphaMode||Ng.OPAQUE;if(u===Ng.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===Ng.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==mr&&(d.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Rt(1,1),r.normalTexture.scale!==void 0)){const _=r.normalTexture.scale;a.normalScale.set(_,_)}if(r.occlusionTexture!==void 0&&o!==mr&&(d.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==mr){const _=r.emissiveFactor;a.emissive=new pt().setRGB(_[0],_[1],_[2],Cn)}return r.emissiveTexture!==void 0&&o!==mr&&d.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,nn)),Promise.all(d).then(function(){const _=new o(a);return r.name&&(_.name=r.name),ur(_,r),t.associations.set(_,{materials:e}),r.extensions&&Br(i,_,r),_})}createUniqueName(e){const t=Ft.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,i=this.primitiveCache;function r(a){return s[wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(c){return Qw(c,a,t)})}const o=[];for(let a=0,c=e.length;a0&&PSt(y,r),y.name=t.createUniqueName(r.name||"mesh_"+e),ur(y,r),b.extensions&&Br(i,y,b),t.assignFinalMaterial(y),_.push(y)}for(let h=0,f=_.length;h1?u=new Qr:d.length===1?u=d[0]:u=new Jt,u!==d[0])for(let _=0,m=d.length;_{const _=new Map;for(const[m,h]of i.associations)(m instanceof Gs||m instanceof xn)&&_.set(m,h);return u.traverse(m=>{const h=i.associations.get(m);h!=null&&_.set(m,h)}),_};return i.associations=d(r),r})}_createAnimationTracks(e,t,s,i,r){const o=[],a=e.name?e.name:e.uuid,c=[];er[r.path]===er.weights?e.traverse(function(m){m.morphTargetInfluences&&c.push(m.name?m.name:m.uuid)}):c.push(a);let d;switch(er[r.path]){case er.weights:d=wa;break;case er.rotation:d=ho;break;case er.position:case er.scale:d=Ra;break;default:switch(s.itemSize){case 1:d=wa;break;case 2:case 3:default:d=Ra;break}break}const u=i.interpolation!==void 0?kSt[i.interpolation]:Ta,_=this._getArrayFromAccessor(s);for(let m=0,h=c.length;m{Ve.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,qe.emit("stop_webcam_video_stream"),Le(()=>{Ve.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ve.replace(),qe.on("video_stream_image",n=>{if(this.isVideoActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},HSt=["src"],qSt=["src"],YSt={class:"controls"},$St={key:2};function WSt(n,e,t,s,i,r){return T(),w("div",{class:"floating-frame bg-white",style:Wt({bottom:i.position.bottom+"px",right:i.position.right+"px","z-index":i.zIndex}),onMousedown:e[4]||(e[4]=K((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=K((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[l("div",{class:"handle",onMousedown:e[0]||(e[0]=K((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=K((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),i.isVideoActive&&i.imageDataUrl!=null?(T(),w("img",{key:0,src:i.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,HSt)):B("",!0),i.isVideoActive&&i.imageDataUrl==null?(T(),w("p",{key:1,src:i.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,qSt)):B("",!0),l("div",YSt,[i.isVideoActive?B("",!0):(T(),w("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>r.startVideoStream&&r.startVideoStream(...o))},e[6]||(e[6]=[l("i",{"data-feather":"video"},null,-1)]))),i.isVideoActive?(T(),w("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>r.stopVideoStream&&r.stopVideoStream(...o))},e[7]||(e[7]=[l("i",{"data-feather":"video"},null,-1)]))):B("",!0),i.isVideoActive?(T(),w("span",$St,"FPS: "+W(i.frameRate),1)):B("",!0)])],36)}const KSt=it(zSt,[["render",WSt]]),jSt={data(){return{isAudioActive:!1,imageDataUrl:null,isDragging:!1,position:{bottom:0,right:0},dragStart:{x:0,y:0},zIndex:0,frameRate:0,frameCount:0,lastFrameTime:Date.now()}},methods:{startAudioStream(){qe.emit("start_audio_stream",()=>{this.isAudioActive=!0}),Le(()=>{Ve.replace()})},stopAudioStream(){qe.emit("stop_audio_stream",()=>{this.isAudioActive=!1,this.imageDataUrl=null}),Le(()=>{Ve.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ve.replace(),qe.on("update_spectrogram",n=>{if(this.isAudioActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},QSt=["src"],XSt={class:"controls"};function ZSt(n,e,t,s,i,r){return T(),w("div",{class:"floating-frame bg-white",style:Wt({bottom:i.position.bottom+"px",right:i.position.right+"px","z-index":i.zIndex}),onMousedown:e[4]||(e[4]=K((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=K((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[l("div",{class:"handle",onMousedown:e[0]||(e[0]=K((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=K((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),i.isAudioActive&&i.imageDataUrl!=null?(T(),w("img",{key:0,src:i.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,QSt)):B("",!0),l("div",XSt,[i.isAudioActive?B("",!0):(T(),w("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>r.startAudioStream&&r.startAudioStream(...o))},e[6]||(e[6]=[l("i",{"data-feather":"mic"},null,-1)]))),i.isAudioActive?(T(),w("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>r.stopAudioStream&&r.stopAudioStream(...o))},e[7]||(e[7]=[l("i",{"data-feather":"mic"},null,-1)]))):B("",!0)])],36)}const JSt=it(jSt,[["render",ZSt]]),e1t={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:KSt,AudioFrame:JSt},computed:{isReady:{get(){return this.$store.state.ready}}},watch:{"$store.state.mountedPersArr":"updatePersonality","$store.state.config.active_personality_id":"updatePersonality"},async mounted(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));console.log("Personality:",this.personality),this.initWebGLScene(),this.updatePersonality(),Le(()=>{Ve.replace()}),this.$refs.video_frame.position={bottom:0,right:0},this.$refs.audio_frame.position={bottom:0,right:100}},beforeDestroy(){},methods:{initWebGLScene(){this.scene=new Svt,this.camera=new Gn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new tO,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const n=new Er,e=new Vw({color:65280});this.cube=new Vn(n,e),this.scene.add(this.cube);const t=new Xvt(4210752),s=new cO(16777215,.5);s.position.set(0,1,0),this.scene.add(t),this.scene.add(s),this.camera.position.z=5,this.animate()},updatePersonality(){const{mountedPersArr:n,config:e}=this.$store.state;this.activePersonality=n[e.active_personality_id],this.activePersonality.avatar?this.showBoxWithAvatar(this.activePersonality.avatar):this.showDefaultCube(),this.$emit("update:personality",this.activePersonality)},loadScene(n){new lSt().load(n,t=>{this.scene.remove(this.cube),this.cube=t.scene,this.scene.add(this.cube)})},showBoxWithAvatar(n){this.cube&&this.scene.remove(this.cube);const e=new Er,t=new lO().load(n),s=new mr({map:t});this.cube=new Vn(e,s),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const n=new Er,e=new Vw({color:65280});this.cube=new Vn(n,e),this.scene.add(this.cube)},animate(){requestAnimationFrame(this.animate),this.cube&&(this.cube.rotation.x+=.01,this.cube.rotation.y+=.01),this.renderer.render(this.scene,this.camera)}}},t1t={ref:"webglContainer"},n1t={class:"flex-col y-overflow scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},s1t={key:0,class:"text-center"},i1t={key:1,class:"text-center"},r1t={class:"floating-frame2"},o1t=["innerHTML"];function a1t(n,e,t,s,i,r){const o=et("VideoFrame"),a=et("AudioFrame");return T(),w(Be,null,[l("div",t1t,null,512),l("div",n1t,[!i.activePersonality||!i.activePersonality.scene_path?(T(),w("div",s1t," Personality does not have a 3d avatar. ")):B("",!0),!i.activePersonality||!i.activePersonality.avatar||i.activePersonality.avatar===""?(T(),w("div",i1t," Personality does not have an avatar. ")):B("",!0),l("div",r1t,[l("div",{innerHTML:n.htmlContent},null,8,o1t)])]),z(o,{ref:"video_frame"},null,512),z(a,{ref:"audio_frame"},null,512)],64)}const l1t=it(e1t,[["render",a1t]]);let yd;const c1t=new Uint8Array(16);function d1t(){if(!yd&&(yd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yd(c1t)}const En=[];for(let n=0;n<256;++n)En.push((n+256).toString(16).slice(1));function u1t(n,e=0){return En[n[e+0]]+En[n[e+1]]+En[n[e+2]]+En[n[e+3]]+"-"+En[n[e+4]]+En[n[e+5]]+"-"+En[n[e+6]]+En[n[e+7]]+"-"+En[n[e+8]]+En[n[e+9]]+"-"+En[n[e+10]]+En[n[e+11]]+En[n[e+12]]+En[n[e+13]]+En[n[e+14]]+En[n[e+15]]}const p1t=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Xw={randomUUID:p1t};function Di(n,e,t){if(Xw.randomUUID&&!e&&!n)return Xw.randomUUID();n=n||{};const s=n.random||(n.rng||d1t)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,u1t(s)}class ro{constructor(){this.listenerMap=new Map,this._listeners=[],this.proxyMap=new Map,this.proxies=[]}get listeners(){return this._listeners.concat(this.proxies.flatMap(e=>e()))}subscribe(e,t){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. +}`;function pvt(n,e,t){let s=new uy;const i=new Rt,r=new Rt,o=new $t,a=new lvt({depthPacking:Wht}),c=new cvt,d={},u=t.maxTextureSize,_={[Ui]:Xn,[Xn]:Ui,[Js]:Js},m=new mo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:dvt,fragmentShader:uvt}),h=m.clone();h.defines.HORIZONTAL_PASS=1;const f=new _i;f.setAttribute("position",new zn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Vn(f,m),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=xM;let y=this.type;this.render=function(R,C,A){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||R.length===0)return;const I=n.getRenderTarget(),x=n.getActiveCubeFace(),N=n.getActiveMipmapLevel(),G=n.state;G.setBlending(gr),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const V=y!==Ci&&this.type===Ci,te=y===Ci&&this.type!==Ci;for(let O=0,H=R.length;Ou||i.y>u)&&(i.x>u&&(r.x=Math.floor(u/Y.x),i.x=r.x*Y.x,L.mapSize.x=r.x),i.y>u&&(r.y=Math.floor(u/Y.y),i.y=r.y*Y.y,L.mapSize.y=r.y)),L.map===null||V===!0||te===!0){const oe=this.type!==Ci?{minFilter:gn,magFilter:gn}:{};L.map!==null&&L.map.dispose(),L.map=new _o(i.x,i.y,oe),L.map.texture.name=q.name+".shadowMap",L.camera.updateProjectionMatrix()}n.setRenderTarget(L.map),n.clear();const se=L.getViewportCount();for(let oe=0;oe0||C.map&&C.alphaTest>0){const G=x.uuid,V=C.uuid;let te=d[G];te===void 0&&(te={},d[G]=te);let O=te[V];O===void 0&&(O=x.clone(),te[V]=O),x=O}if(x.visible=C.visible,x.wireframe=C.wireframe,I===Ci?x.side=C.shadowSide!==null?C.shadowSide:C.side:x.side=C.shadowSide!==null?C.shadowSide:_[C.side],x.alphaMap=C.alphaMap,x.alphaTest=C.alphaTest,x.map=C.map,x.clipShadows=C.clipShadows,x.clippingPlanes=C.clippingPlanes,x.clipIntersection=C.clipIntersection,x.displacementMap=C.displacementMap,x.displacementScale=C.displacementScale,x.displacementBias=C.displacementBias,x.wireframeLinewidth=C.wireframeLinewidth,x.linewidth=C.linewidth,A.isPointLight===!0&&x.isMeshDistanceMaterial===!0){const G=n.properties.get(x);G.light=A}return x}function S(R,C,A,I,x){if(R.visible===!1)return;if(R.layers.test(C.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&x===Ci)&&(!R.frustumCulled||s.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,R.matrixWorld);const V=e.update(R),te=R.material;if(Array.isArray(te)){const O=V.groups;for(let H=0,q=O.length;H=1):oe.indexOf("OpenGL ES")!==-1&&(se=parseFloat(/^OpenGL ES (\d)/.exec(oe)[1]),Y=se>=2);let ye=null,xe={};const le=n.getParameter(n.SCISSOR_BOX),ve=n.getParameter(n.VIEWPORT),Oe=new $t().fromArray(le),De=new $t().fromArray(ve);function Q(ee,je,Ge,Me){const He=new Uint8Array(4),dt=n.createTexture();n.bindTexture(ee,dt),n.texParameteri(ee,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(ee,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Mt=0;Mt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let g;const b=new WeakMap;let y=!1;try{y=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(k,M){return y?new OffscreenCanvas(k,M):Jl("canvas")}function v(k,M,$,me){let j=1;if((k.width>me||k.height>me)&&(j=me/Math.max(k.width,k.height)),j<1||M===!0)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap){const ie=M?vu:Math.floor,Ce=ie(j*k.width),we=ie(j*k.height);g===void 0&&(g=E(Ce,we));const ke=$?E(Ce,we):g;return ke.width=Ce,ke.height=we,ke.getContext("2d").drawImage(k,0,0,Ce,we),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+Ce+"x"+we+")."),ke}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),k;return k}function S(k){return xb(k.width)&&xb(k.height)}function R(k){return a?!1:k.wrapS!==ms||k.wrapT!==ms||k.minFilter!==gn&&k.minFilter!==$n}function C(k,M){return k.generateMipmaps&&M&&k.minFilter!==gn&&k.minFilter!==$n}function A(k){n.generateMipmap(k)}function I(k,M,$,me,j=!1){if(a===!1)return M;if(k!==null){if(n[k]!==void 0)return n[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let ie=M;if(M===n.RED&&($===n.FLOAT&&(ie=n.R32F),$===n.HALF_FLOAT&&(ie=n.R16F),$===n.UNSIGNED_BYTE&&(ie=n.R8)),M===n.RED_INTEGER&&($===n.UNSIGNED_BYTE&&(ie=n.R8UI),$===n.UNSIGNED_SHORT&&(ie=n.R16UI),$===n.UNSIGNED_INT&&(ie=n.R32UI),$===n.BYTE&&(ie=n.R8I),$===n.SHORT&&(ie=n.R16I),$===n.INT&&(ie=n.R32I)),M===n.RG&&($===n.FLOAT&&(ie=n.RG32F),$===n.HALF_FLOAT&&(ie=n.RG16F),$===n.UNSIGNED_BYTE&&(ie=n.RG8)),M===n.RGBA){const Ce=j?gu:Lt.getTransfer(me);$===n.FLOAT&&(ie=n.RGBA32F),$===n.HALF_FLOAT&&(ie=n.RGBA16F),$===n.UNSIGNED_BYTE&&(ie=Ce===jt?n.SRGB8_ALPHA8:n.RGBA8),$===n.UNSIGNED_SHORT_4_4_4_4&&(ie=n.RGBA4),$===n.UNSIGNED_SHORT_5_5_5_1&&(ie=n.RGB5_A1)}return(ie===n.R16F||ie===n.R32F||ie===n.RG16F||ie===n.RG32F||ie===n.RGBA16F||ie===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ie}function x(k,M,$){return C(k,$)===!0||k.isFramebufferTexture&&k.minFilter!==gn&&k.minFilter!==$n?Math.log2(Math.max(M.width,M.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?M.mipmaps.length:1}function N(k){return k===gn||k===Eb||k===Fd?n.NEAREST:n.LINEAR}function G(k){const M=k.target;M.removeEventListener("dispose",G),te(M),M.isVideoTexture&&f.delete(M)}function V(k){const M=k.target;M.removeEventListener("dispose",V),H(M)}function te(k){const M=s.get(k);if(M.__webglInit===void 0)return;const $=k.source,me=b.get($);if(me){const j=me[M.__cacheKey];j.usedTimes--,j.usedTimes===0&&O(k),Object.keys(me).length===0&&b.delete($)}s.remove(k)}function O(k){const M=s.get(k);n.deleteTexture(M.__webglTexture);const $=k.source,me=b.get($);delete me[M.__cacheKey],o.memory.textures--}function H(k){const M=k.texture,$=s.get(k),me=s.get(M);if(me.__webglTexture!==void 0&&(n.deleteTexture(me.__webglTexture),o.memory.textures--),k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let j=0;j<6;j++){if(Array.isArray($.__webglFramebuffer[j]))for(let ie=0;ie<$.__webglFramebuffer[j].length;ie++)n.deleteFramebuffer($.__webglFramebuffer[j][ie]);else n.deleteFramebuffer($.__webglFramebuffer[j]);$.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer[j])}else{if(Array.isArray($.__webglFramebuffer))for(let j=0;j<$.__webglFramebuffer.length;j++)n.deleteFramebuffer($.__webglFramebuffer[j]);else n.deleteFramebuffer($.__webglFramebuffer);if($.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer),$.__webglMultisampledFramebuffer&&n.deleteFramebuffer($.__webglMultisampledFramebuffer),$.__webglColorRenderbuffer)for(let j=0;j<$.__webglColorRenderbuffer.length;j++)$.__webglColorRenderbuffer[j]&&n.deleteRenderbuffer($.__webglColorRenderbuffer[j]);$.__webglDepthRenderbuffer&&n.deleteRenderbuffer($.__webglDepthRenderbuffer)}if(k.isWebGLMultipleRenderTargets)for(let j=0,ie=M.length;j=c&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+c),q+=1,k}function se(k){const M=[];return M.push(k.wrapS),M.push(k.wrapT),M.push(k.wrapR||0),M.push(k.magFilter),M.push(k.minFilter),M.push(k.anisotropy),M.push(k.internalFormat),M.push(k.format),M.push(k.type),M.push(k.generateMipmaps),M.push(k.premultiplyAlpha),M.push(k.flipY),M.push(k.unpackAlignment),M.push(k.colorSpace),M.join()}function oe(k,M){const $=s.get(k);if(k.isVideoTexture&&Re(k),k.isRenderTargetTexture===!1&&k.version>0&&$.__version!==k.version){const me=k.image;if(me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{_e($,k,M);return}}t.bindTexture(n.TEXTURE_2D,$.__webglTexture,n.TEXTURE0+M)}function ye(k,M){const $=s.get(k);if(k.version>0&&$.__version!==k.version){_e($,k,M);return}t.bindTexture(n.TEXTURE_2D_ARRAY,$.__webglTexture,n.TEXTURE0+M)}function xe(k,M){const $=s.get(k);if(k.version>0&&$.__version!==k.version){_e($,k,M);return}t.bindTexture(n.TEXTURE_3D,$.__webglTexture,n.TEXTURE0+M)}function le(k,M){const $=s.get(k);if(k.version>0&&$.__version!==k.version){Ae($,k,M);return}t.bindTexture(n.TEXTURE_CUBE_MAP,$.__webglTexture,n.TEXTURE0+M)}const ve={[va]:n.REPEAT,[ms]:n.CLAMP_TO_EDGE,[hu]:n.MIRRORED_REPEAT},Oe={[gn]:n.NEAREST,[Eb]:n.NEAREST_MIPMAP_NEAREST,[Fd]:n.NEAREST_MIPMAP_LINEAR,[$n]:n.LINEAR,[wM]:n.LINEAR_MIPMAP_NEAREST,[fo]:n.LINEAR_MIPMAP_LINEAR},De={[jht]:n.NEVER,[tgt]:n.ALWAYS,[Qht]:n.LESS,[PM]:n.LEQUAL,[Xht]:n.EQUAL,[egt]:n.GEQUAL,[Zht]:n.GREATER,[Jht]:n.NOTEQUAL};function Q(k,M,$){if($?(n.texParameteri(k,n.TEXTURE_WRAP_S,ve[M.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,ve[M.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,ve[M.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,Oe[M.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,Oe[M.minFilter])):(n.texParameteri(k,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(k,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(M.wrapS!==ms||M.wrapT!==ms)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(k,n.TEXTURE_MAG_FILTER,N(M.magFilter)),n.texParameteri(k,n.TEXTURE_MIN_FILTER,N(M.minFilter)),M.minFilter!==gn&&M.minFilter!==$n&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),M.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,De[M.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const me=e.get("EXT_texture_filter_anisotropic");if(M.magFilter===gn||M.minFilter!==Fd&&M.minFilter!==fo||M.type===Ni&&e.has("OES_texture_float_linear")===!1||a===!1&&M.type===Xl&&e.has("OES_texture_half_float_linear")===!1)return;(M.anisotropy>1||s.get(M).__currentAnisotropy)&&(n.texParameterf(k,me.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(M.anisotropy,i.getMaxAnisotropy())),s.get(M).__currentAnisotropy=M.anisotropy)}}function fe(k,M){let $=!1;k.__webglInit===void 0&&(k.__webglInit=!0,M.addEventListener("dispose",G));const me=M.source;let j=b.get(me);j===void 0&&(j={},b.set(me,j));const ie=se(M);if(ie!==k.__cacheKey){j[ie]===void 0&&(j[ie]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,$=!0),j[ie].usedTimes++;const Ce=j[k.__cacheKey];Ce!==void 0&&(j[k.__cacheKey].usedTimes--,Ce.usedTimes===0&&O(M)),k.__cacheKey=ie,k.__webglTexture=j[ie].texture}return $}function _e(k,M,$){let me=n.TEXTURE_2D;(M.isDataArrayTexture||M.isCompressedArrayTexture)&&(me=n.TEXTURE_2D_ARRAY),M.isData3DTexture&&(me=n.TEXTURE_3D);const j=fe(k,M),ie=M.source;t.bindTexture(me,k.__webglTexture,n.TEXTURE0+$);const Ce=s.get(ie);if(ie.version!==Ce.__version||j===!0){t.activeTexture(n.TEXTURE0+$);const we=Lt.getPrimaries(Lt.workingColorSpace),ke=M.colorSpace===gs?null:Lt.getPrimaries(M.colorSpace),We=M.colorSpace===gs||we===ke?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,M.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,M.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,We);const lt=R(M)&&S(M.image)===!1;let Pe=v(M.image,lt,!1,u);Pe=ge(M,Pe);const Nt=S(Pe)||a,tt=r.convert(M.format,M.colorSpace);let nt=r.convert(M.type),ze=I(M.internalFormat,tt,nt,M.colorSpace,M.isVideoTexture);Q(me,M,Nt);let Ke;const _t=M.mipmaps,ee=a&&M.isVideoTexture!==!0&&ze!==kM,je=Ce.__version===void 0||j===!0,Ge=x(M,Pe,Nt);if(M.isDepthTexture)ze=n.DEPTH_COMPONENT,a?M.type===Ni?ze=n.DEPTH_COMPONENT32F:M.type===_r?ze=n.DEPTH_COMPONENT24:M.type===no?ze=n.DEPTH24_STENCIL8:ze=n.DEPTH_COMPONENT16:M.type===Ni&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),M.format===so&&ze===n.DEPTH_COMPONENT&&M.type!==ay&&M.type!==_r&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),M.type=_r,nt=r.convert(M.type)),M.format===Sa&&ze===n.DEPTH_COMPONENT&&(ze=n.DEPTH_STENCIL,M.type!==no&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),M.type=no,nt=r.convert(M.type))),je&&(ee?t.texStorage2D(n.TEXTURE_2D,1,ze,Pe.width,Pe.height):t.texImage2D(n.TEXTURE_2D,0,ze,Pe.width,Pe.height,0,tt,nt,null));else if(M.isDataTexture)if(_t.length>0&&Nt){ee&&je&&t.texStorage2D(n.TEXTURE_2D,Ge,ze,_t[0].width,_t[0].height);for(let Me=0,He=_t.length;Me>=1,He>>=1}}else if(_t.length>0&&Nt){ee&&je&&t.texStorage2D(n.TEXTURE_2D,Ge,ze,_t[0].width,_t[0].height);for(let Me=0,He=_t.length;Me0&&je++,t.texStorage2D(n.TEXTURE_CUBE_MAP,je,Ke,Pe[0].width,Pe[0].height));for(let Me=0;Me<6;Me++)if(lt){_t?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Me,0,0,0,Pe[Me].width,Pe[Me].height,nt,ze,Pe[Me].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Me,0,Ke,Pe[Me].width,Pe[Me].height,0,nt,ze,Pe[Me].data);for(let He=0;He>ie),Pe=Math.max(1,M.height>>ie);j===n.TEXTURE_3D||j===n.TEXTURE_2D_ARRAY?t.texImage3D(j,ie,ke,lt,Pe,M.depth,0,Ce,we,null):t.texImage2D(j,ie,ke,lt,Pe,0,Ce,we,null)}t.bindFramebuffer(n.FRAMEBUFFER,k),Ne(M)?m.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,me,j,s.get($).__webglTexture,0,ae(M)):(j===n.TEXTURE_2D||j>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&j<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,me,j,s.get($).__webglTexture,ie),t.bindFramebuffer(n.FRAMEBUFFER,null)}function ne(k,M,$){if(n.bindRenderbuffer(n.RENDERBUFFER,k),M.depthBuffer&&!M.stencilBuffer){let me=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if($||Ne(M)){const j=M.depthTexture;j&&j.isDepthTexture&&(j.type===Ni?me=n.DEPTH_COMPONENT32F:j.type===_r&&(me=n.DEPTH_COMPONENT24));const ie=ae(M);Ne(M)?m.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ie,me,M.width,M.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,ie,me,M.width,M.height)}else n.renderbufferStorage(n.RENDERBUFFER,me,M.width,M.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,k)}else if(M.depthBuffer&&M.stencilBuffer){const me=ae(M);$&&Ne(M)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,me,n.DEPTH24_STENCIL8,M.width,M.height):Ne(M)?m.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,me,n.DEPTH24_STENCIL8,M.width,M.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,M.width,M.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,k)}else{const me=M.isWebGLMultipleRenderTargets===!0?M.texture:[M.texture];for(let j=0;j0){$.__webglFramebuffer[we]=[];for(let ke=0;ke0){$.__webglFramebuffer=[];for(let we=0;we0&&Ne(k)===!1){const we=ie?M:[M];$.__webglMultisampledFramebuffer=n.createFramebuffer(),$.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,$.__webglMultisampledFramebuffer);for(let ke=0;ke0)for(let ke=0;ke0)for(let ke=0;ke0&&Ne(k)===!1){const M=k.isWebGLMultipleRenderTargets?k.texture:[k.texture],$=k.width,me=k.height;let j=n.COLOR_BUFFER_BIT;const ie=[],Ce=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,we=s.get(k),ke=k.isWebGLMultipleRenderTargets===!0;if(ke)for(let We=0;We0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&M.__useRenderToTexture!==!1}function Re(k){const M=o.render.frame;f.get(k)!==M&&(f.set(k,M),k.update())}function ge(k,M){const $=k.colorSpace,me=k.format,j=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||k.format===Tb||$!==Cn&&$!==gs&&(Lt.getTransfer($)===jt?a===!1?e.has("EXT_sRGB")===!0&&me===hs?(k.format=Tb,k.minFilter=$n,k.generateMipmaps=!1):M=UM.sRGBToLinear(M):(me!==hs||j!==yr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",$)),M}this.allocateTextureUnit=Y,this.resetTextureUnits=L,this.setTexture2D=oe,this.setTexture2DArray=ye,this.setTexture3D=xe,this.setTextureCube=le,this.rebindTextures=J,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=pe,this.updateMultisampleRenderTarget=he,this.setupDepthRenderbuffer=P,this.setupFrameBufferTexture=Fe,this.useMultisampledRTT=Ne}function mvt(n,e,t){const s=t.isWebGL2;function i(r,o=gs){let a;const c=Lt.getTransfer(o);if(r===yr)return n.UNSIGNED_BYTE;if(r===AM)return n.UNSIGNED_SHORT_4_4_4_4;if(r===NM)return n.UNSIGNED_SHORT_5_5_5_1;if(r===Pht)return n.BYTE;if(r===Fht)return n.SHORT;if(r===ay)return n.UNSIGNED_SHORT;if(r===RM)return n.INT;if(r===_r)return n.UNSIGNED_INT;if(r===Ni)return n.FLOAT;if(r===Xl)return s?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===Uht)return n.ALPHA;if(r===hs)return n.RGBA;if(r===Bht)return n.LUMINANCE;if(r===Ght)return n.LUMINANCE_ALPHA;if(r===so)return n.DEPTH_COMPONENT;if(r===Sa)return n.DEPTH_STENCIL;if(r===Tb)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===Vht)return n.RED;if(r===MM)return n.RED_INTEGER;if(r===zht)return n.RG;if(r===OM)return n.RG_INTEGER;if(r===IM)return n.RGBA_INTEGER;if(r===Kh||r===jh||r===Qh||r===Xh)if(c===jt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Kh)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===jh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Qh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Xh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Kh)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===jh)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Qh)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Xh)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===uC||r===pC||r===fC||r===_C)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===uC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===pC)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===fC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===_C)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===kM)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===mC||r===hC)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===mC)return c===jt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===hC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===gC||r===bC||r===yC||r===EC||r===vC||r===SC||r===TC||r===xC||r===CC||r===wC||r===RC||r===AC||r===NC||r===MC)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===gC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===bC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===yC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===EC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===vC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===SC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===TC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===xC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===CC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===wC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===RC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===AC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===NC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===MC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Zh||r===OC||r===IC)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Zh)return c===jt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===OC)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===IC)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===Hht||r===kC||r===DC||r===LC)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===Zh)return a.COMPRESSED_RED_RGTC1_EXT;if(r===kC)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===DC)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===LC)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===no?s?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[r]!==void 0?n[r]:null}return{convert:i}}class hvt extends Gn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Qr extends Jt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const gvt={type:"move"};class Sg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Qr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new re,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new re),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new re,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new re),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const s of e.hand.values())this._getHandJoint(t,s)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,s){let i=null,r=null,o=null;const a=this._targetRay,c=this._grip,d=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(const g of e.hand.values()){const b=t.getJointPose(g,s),y=this._getHandJoint(d,g);b!==null&&(y.matrix.fromArray(b.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,y.jointRadius=b.radius),y.visible=b!==null}const u=d.joints["index-finger-tip"],_=d.joints["thumb-tip"],m=u.position.distanceTo(_.position),h=.02,f=.005;d.inputState.pinching&&m>h+f?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&m<=h-f&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,s),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,s),i===null&&r!==null&&(i=r),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(gvt)))}return a!==null&&(a.visible=i!==null),c!==null&&(c.visible=r!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const s=new Qr;s.matrixAutoUpdate=!1,s.visible=!1,e.joints[t.jointName]=s,e.add(s)}return e.joints[t.jointName]}}class bvt extends Ha{constructor(e,t){super();const s=this;let i=null,r=1,o=null,a="local-floor",c=1,d=null,u=null,_=null,m=null,h=null,f=null;const g=t.getContextAttributes();let b=null,y=null;const E=[],v=[],S=new Rt;let R=null;const C=new Gn;C.layers.enable(1),C.viewport=new $t;const A=new Gn;A.layers.enable(2),A.viewport=new $t;const I=[C,A],x=new hvt;x.layers.enable(1),x.layers.enable(2);let N=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(le){let ve=E[le];return ve===void 0&&(ve=new Sg,E[le]=ve),ve.getTargetRaySpace()},this.getControllerGrip=function(le){let ve=E[le];return ve===void 0&&(ve=new Sg,E[le]=ve),ve.getGripSpace()},this.getHand=function(le){let ve=E[le];return ve===void 0&&(ve=new Sg,E[le]=ve),ve.getHandSpace()};function V(le){const ve=v.indexOf(le.inputSource);if(ve===-1)return;const Oe=E[ve];Oe!==void 0&&(Oe.update(le.inputSource,le.frame,d||o),Oe.dispatchEvent({type:le.type,data:le.inputSource}))}function te(){i.removeEventListener("select",V),i.removeEventListener("selectstart",V),i.removeEventListener("selectend",V),i.removeEventListener("squeeze",V),i.removeEventListener("squeezestart",V),i.removeEventListener("squeezeend",V),i.removeEventListener("end",te),i.removeEventListener("inputsourceschange",O);for(let le=0;le=0&&(v[De]=null,E[De].disconnect(Oe))}for(let ve=0;ve=v.length){v.push(Oe),De=fe;break}else if(v[fe]===null){v[fe]=Oe,De=fe;break}if(De===-1)break}const Q=E[De];Q&&Q.connect(Oe)}}const H=new re,q=new re;function L(le,ve,Oe){H.setFromMatrixPosition(ve.matrixWorld),q.setFromMatrixPosition(Oe.matrixWorld);const De=H.distanceTo(q),Q=ve.projectionMatrix.elements,fe=Oe.projectionMatrix.elements,_e=Q[14]/(Q[10]-1),Ae=Q[14]/(Q[10]+1),Fe=(Q[9]+1)/Q[5],ne=(Q[9]-1)/Q[5],U=(Q[8]-1)/Q[0],P=(fe[8]+1)/fe[0],J=_e*U,ce=_e*P,pe=De/(-U+P),he=pe*-U;ve.matrixWorld.decompose(le.position,le.quaternion,le.scale),le.translateX(he),le.translateZ(pe),le.matrixWorld.compose(le.position,le.quaternion,le.scale),le.matrixWorldInverse.copy(le.matrixWorld).invert();const ae=_e+pe,Ne=Ae+pe,Re=J-he,ge=ce+(De-he),k=Fe*Ae/Ne*ae,M=ne*Ae/Ne*ae;le.projectionMatrix.makePerspective(Re,ge,k,M,ae,Ne),le.projectionMatrixInverse.copy(le.projectionMatrix).invert()}function Y(le,ve){ve===null?le.matrixWorld.copy(le.matrix):le.matrixWorld.multiplyMatrices(ve.matrixWorld,le.matrix),le.matrixWorldInverse.copy(le.matrixWorld).invert()}this.updateCamera=function(le){if(i===null)return;x.near=A.near=C.near=le.near,x.far=A.far=C.far=le.far,(N!==x.near||G!==x.far)&&(i.updateRenderState({depthNear:x.near,depthFar:x.far}),N=x.near,G=x.far);const ve=le.parent,Oe=x.cameras;Y(x,ve);for(let De=0;De0&&(b.alphaTest.value=y.alphaTest);const E=e.get(y).envMap;if(E&&(b.envMap.value=E,b.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,b.reflectivity.value=y.reflectivity,b.ior.value=y.ior,b.refractionRatio.value=y.refractionRatio),y.lightMap){b.lightMap.value=y.lightMap;const v=n._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=y.lightMapIntensity*v,t(y.lightMap,b.lightMapTransform)}y.aoMap&&(b.aoMap.value=y.aoMap,b.aoMapIntensity.value=y.aoMapIntensity,t(y.aoMap,b.aoMapTransform))}function o(b,y){b.diffuse.value.copy(y.color),b.opacity.value=y.opacity,y.map&&(b.map.value=y.map,t(y.map,b.mapTransform))}function a(b,y){b.dashSize.value=y.dashSize,b.totalSize.value=y.dashSize+y.gapSize,b.scale.value=y.scale}function c(b,y,E,v){b.diffuse.value.copy(y.color),b.opacity.value=y.opacity,b.size.value=y.size*E,b.scale.value=v*.5,y.map&&(b.map.value=y.map,t(y.map,b.uvTransform)),y.alphaMap&&(b.alphaMap.value=y.alphaMap,t(y.alphaMap,b.alphaMapTransform)),y.alphaTest>0&&(b.alphaTest.value=y.alphaTest)}function d(b,y){b.diffuse.value.copy(y.color),b.opacity.value=y.opacity,b.rotation.value=y.rotation,y.map&&(b.map.value=y.map,t(y.map,b.mapTransform)),y.alphaMap&&(b.alphaMap.value=y.alphaMap,t(y.alphaMap,b.alphaMapTransform)),y.alphaTest>0&&(b.alphaTest.value=y.alphaTest)}function u(b,y){b.specular.value.copy(y.specular),b.shininess.value=Math.max(y.shininess,1e-4)}function _(b,y){y.gradientMap&&(b.gradientMap.value=y.gradientMap)}function m(b,y){b.metalness.value=y.metalness,y.metalnessMap&&(b.metalnessMap.value=y.metalnessMap,t(y.metalnessMap,b.metalnessMapTransform)),b.roughness.value=y.roughness,y.roughnessMap&&(b.roughnessMap.value=y.roughnessMap,t(y.roughnessMap,b.roughnessMapTransform)),e.get(y).envMap&&(b.envMapIntensity.value=y.envMapIntensity)}function h(b,y,E){b.ior.value=y.ior,y.sheen>0&&(b.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),b.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(b.sheenColorMap.value=y.sheenColorMap,t(y.sheenColorMap,b.sheenColorMapTransform)),y.sheenRoughnessMap&&(b.sheenRoughnessMap.value=y.sheenRoughnessMap,t(y.sheenRoughnessMap,b.sheenRoughnessMapTransform))),y.clearcoat>0&&(b.clearcoat.value=y.clearcoat,b.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(b.clearcoatMap.value=y.clearcoatMap,t(y.clearcoatMap,b.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,t(y.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(b.clearcoatNormalMap.value=y.clearcoatNormalMap,t(y.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===Xn&&b.clearcoatNormalScale.value.negate())),y.iridescence>0&&(b.iridescence.value=y.iridescence,b.iridescenceIOR.value=y.iridescenceIOR,b.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(b.iridescenceMap.value=y.iridescenceMap,t(y.iridescenceMap,b.iridescenceMapTransform)),y.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=y.iridescenceThicknessMap,t(y.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),y.transmission>0&&(b.transmission.value=y.transmission,b.transmissionSamplerMap.value=E.texture,b.transmissionSamplerSize.value.set(E.width,E.height),y.transmissionMap&&(b.transmissionMap.value=y.transmissionMap,t(y.transmissionMap,b.transmissionMapTransform)),b.thickness.value=y.thickness,y.thicknessMap&&(b.thicknessMap.value=y.thicknessMap,t(y.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=y.attenuationDistance,b.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(b.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(b.anisotropyMap.value=y.anisotropyMap,t(y.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=y.specularIntensity,b.specularColor.value.copy(y.specularColor),y.specularColorMap&&(b.specularColorMap.value=y.specularColorMap,t(y.specularColorMap,b.specularColorMapTransform)),y.specularIntensityMap&&(b.specularIntensityMap.value=y.specularIntensityMap,t(y.specularIntensityMap,b.specularIntensityMapTransform))}function f(b,y){y.matcap&&(b.matcap.value=y.matcap)}function g(b,y){const E=e.get(y).light;b.referencePosition.value.setFromMatrixPosition(E.matrixWorld),b.nearDistance.value=E.shadow.camera.near,b.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:i}}function Evt(n,e,t,s){let i={},r={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(E,v){const S=v.program;s.uniformBlockBinding(E,S)}function d(E,v){let S=i[E.id];S===void 0&&(f(E),S=u(E),i[E.id]=S,E.addEventListener("dispose",b));const R=v.program;s.updateUBOMapping(E,R);const C=e.render.frame;r[E.id]!==C&&(m(E),r[E.id]=C)}function u(E){const v=_();E.__bindingPointIndex=v;const S=n.createBuffer(),R=E.__size,C=E.usage;return n.bindBuffer(n.UNIFORM_BUFFER,S),n.bufferData(n.UNIFORM_BUFFER,R,C),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,v,S),S}function _(){for(let E=0;E0){C=S%R;const V=R-C;C!==0&&V-N.boundary<0&&(S+=R-C,x.__offset=S)}S+=N.storage}return C=S%R,C>0&&(S+=R-C),E.__size=S,E.__cache={},this}function g(E){const v={boundary:0,storage:0};return typeof E=="number"?(v.boundary=4,v.storage=4):E.isVector2?(v.boundary=8,v.storage=8):E.isVector3||E.isColor?(v.boundary=16,v.storage=12):E.isVector4?(v.boundary=16,v.storage=16):E.isMatrix3?(v.boundary=48,v.storage=48):E.isMatrix4?(v.boundary=64,v.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),v}function b(E){const v=E.target;v.removeEventListener("dispose",b);const S=o.indexOf(v.__bindingPointIndex);o.splice(S,1),n.deleteBuffer(i[v.id]),delete i[v.id],delete r[v.id]}function y(){for(const E in i)n.deleteBuffer(i[E]);o=[],i={},r={}}return{bind:c,update:d,dispose:y}}class tO{constructor(e={}){const{canvas:t=ggt(),context:s=null,depth:i=!0,stencil:r=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:d=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:_=!1}=e;this.isWebGLRenderer=!0;let m;s!==null?m=s.getContextAttributes().alpha:m=o;const h=new Uint32Array(4),f=new Int32Array(4);let g=null,b=null;const y=[],E=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=nn,this._useLegacyLights=!1,this.toneMapping=br,this.toneMappingExposure=1;const v=this;let S=!1,R=0,C=0,A=null,I=-1,x=null;const N=new $t,G=new $t;let V=null;const te=new pt(0);let O=0,H=t.width,q=t.height,L=1,Y=null,se=null;const oe=new $t(0,0,H,q),ye=new $t(0,0,H,q);let xe=!1;const le=new uy;let ve=!1,Oe=!1,De=null;const Q=new St,fe=new Rt,_e=new re,Ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Fe(){return A===null?L:1}let ne=s;function U(F,de){for(let Ee=0;Ee{function Qe(){if(Se.forEach(function(st){he.get(st).currentProgram.isReady()&&Se.delete(st)}),Se.size===0){be(F);return}setTimeout(Qe,10)}P.get("KHR_parallel_shader_compile")!==null?Qe():setTimeout(Qe,10)})};let Mt=null;function cn(F){Mt&&Mt(F)}function wn(){Rn.stop()}function Ht(){Rn.start()}const Rn=new KM;Rn.setAnimationLoop(cn),typeof self<"u"&&Rn.setContext(self),this.setAnimationLoop=function(F){Mt=F,Ke.setAnimationLoop(F),F===null?Rn.stop():Rn.start()},Ke.addEventListener("sessionstart",wn),Ke.addEventListener("sessionend",Ht),this.render=function(F,de){if(de!==void 0&&de.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),de.parent===null&&de.matrixWorldAutoUpdate===!0&&de.updateMatrixWorld(),Ke.enabled===!0&&Ke.isPresenting===!0&&(Ke.cameraAutoUpdate===!0&&Ke.updateCamera(de),de=Ke.getCamera()),F.isScene===!0&&F.onBeforeRender(v,F,de,A),b=ie.get(F,E.length),b.init(),E.push(b),Q.multiplyMatrices(de.projectionMatrix,de.matrixWorldInverse),le.setFromProjectionMatrix(Q),Oe=this.localClippingEnabled,ve=Ce.init(this.clippingPlanes,Oe),g=j.get(F,y.length),g.init(),y.push(g),Ns(F,de,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(Y,se),this.info.render.frame++,ve===!0&&Ce.beginShadows();const Ee=b.state.shadowsArray;if(we.render(Ee,F,de),ve===!0&&Ce.endShadows(),this.info.autoReset===!0&&this.info.reset(),ke.render(g,F),b.setupLights(v._useLegacyLights),de.isArrayCamera){const Se=de.cameras;for(let be=0,Qe=Se.length;be0?b=E[E.length-1]:b=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function Ns(F,de,Ee,Se){if(F.visible===!1)return;if(F.layers.test(de.layers)){if(F.isGroup)Ee=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(de);else if(F.isLight)b.pushLight(F),F.castShadow&&b.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||le.intersectsSprite(F)){Se&&_e.setFromMatrixPosition(F.matrixWorld).applyMatrix4(Q);const st=M.update(F),ct=F.material;ct.visible&&g.push(F,st,ct,Ee,_e.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||le.intersectsObject(F))){const st=M.update(F),ct=F.material;if(Se&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),_e.copy(F.boundingSphere.center)):(st.boundingSphere===null&&st.computeBoundingSphere(),_e.copy(st.boundingSphere.center)),_e.applyMatrix4(F.matrixWorld).applyMatrix4(Q)),Array.isArray(ct)){const ut=st.groups;for(let bt=0,mt=ut.length;bt0&&Py(be,Qe,de,Ee),Se&&ce.viewport(N.copy(Se)),be.length>0&&ja(be,de,Ee),Qe.length>0&&ja(Qe,de,Ee),st.length>0&&ja(st,de,Ee),ce.buffers.depth.setTest(!0),ce.buffers.depth.setMask(!0),ce.buffers.color.setMask(!0),ce.setPolygonOffset(!1)}function Py(F,de,Ee,Se){if((Ee.isScene===!0?Ee.overrideMaterial:null)!==null)return;const Qe=J.isWebGL2;De===null&&(De=new _o(1,1,{generateMipmaps:!0,type:P.has("EXT_color_buffer_half_float")?Xl:yr,minFilter:fo,samples:Qe?4:0})),v.getDrawingBufferSize(fe),Qe?De.setSize(fe.x,fe.y):De.setSize(vu(fe.x),vu(fe.y));const st=v.getRenderTarget();v.setRenderTarget(De),v.getClearColor(te),O=v.getClearAlpha(),O<1&&v.setClearColor(16777215,.5),v.clear();const ct=v.toneMapping;v.toneMapping=br,ja(F,Ee,Se),ae.updateMultisampleRenderTarget(De),ae.updateRenderTargetMipmap(De);let ut=!1;for(let bt=0,mt=de.length;bt0),ht=!!Ee.morphAttributes.position,tn=!!Ee.morphAttributes.normal,qn=!!Ee.morphAttributes.color;let dn=br;Se.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(dn=v.toneMapping);const Ws=Ee.morphAttributes.position||Ee.morphAttributes.normal||Ee.morphAttributes.color,Qt=Ws!==void 0?Ws.length:0,Et=he.get(Se),yc=b.state.lights;if(ve===!0&&(Oe===!0||F!==x)){const Jn=F===x&&Se.id===I;Ce.setState(Se,F,Jn)}let Zt=!1;Se.version===Et.__version?(Et.needsLights&&Et.lightsStateVersion!==yc.state.version||Et.outputColorSpace!==ct||be.isBatchedMesh&&Et.batching===!1||!be.isBatchedMesh&&Et.batching===!0||be.isInstancedMesh&&Et.instancing===!1||!be.isInstancedMesh&&Et.instancing===!0||be.isSkinnedMesh&&Et.skinning===!1||!be.isSkinnedMesh&&Et.skinning===!0||be.isInstancedMesh&&Et.instancingColor===!0&&be.instanceColor===null||be.isInstancedMesh&&Et.instancingColor===!1&&be.instanceColor!==null||Et.envMap!==ut||Se.fog===!0&&Et.fog!==Qe||Et.numClippingPlanes!==void 0&&(Et.numClippingPlanes!==Ce.numPlanes||Et.numIntersection!==Ce.numIntersection)||Et.vertexAlphas!==bt||Et.vertexTangents!==mt||Et.morphTargets!==ht||Et.morphNormals!==tn||Et.morphColors!==qn||Et.toneMapping!==dn||J.isWebGL2===!0&&Et.morphTargetsCount!==Qt)&&(Zt=!0):(Zt=!0,Et.__version=Se.version);let Hi=Et.currentProgram;Zt===!0&&(Hi=Qa(Se,de,be));let Np=!1,vo=!1,Ec=!1;const yn=Hi.getUniforms(),qi=Et.uniforms;if(ce.useProgram(Hi.program)&&(Np=!0,vo=!0,Ec=!0),Se.id!==I&&(I=Se.id,vo=!0),Np||x!==F){yn.setValue(ne,"projectionMatrix",F.projectionMatrix),yn.setValue(ne,"viewMatrix",F.matrixWorldInverse);const Jn=yn.map.cameraPosition;Jn!==void 0&&Jn.setValue(ne,_e.setFromMatrixPosition(F.matrixWorld)),J.logarithmicDepthBuffer&&yn.setValue(ne,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(Se.isMeshPhongMaterial||Se.isMeshToonMaterial||Se.isMeshLambertMaterial||Se.isMeshBasicMaterial||Se.isMeshStandardMaterial||Se.isShaderMaterial)&&yn.setValue(ne,"isOrthographic",F.isOrthographicCamera===!0),x!==F&&(x=F,vo=!0,Ec=!0)}if(be.isSkinnedMesh){yn.setOptional(ne,be,"bindMatrix"),yn.setOptional(ne,be,"bindMatrixInverse");const Jn=be.skeleton;Jn&&(J.floatVertexTextures?(Jn.boneTexture===null&&Jn.computeBoneTexture(),yn.setValue(ne,"boneTexture",Jn.boneTexture,ae)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}be.isBatchedMesh&&(yn.setOptional(ne,be,"batchingTexture"),yn.setValue(ne,"batchingTexture",be._matricesTexture,ae));const vc=Ee.morphAttributes;if((vc.position!==void 0||vc.normal!==void 0||vc.color!==void 0&&J.isWebGL2===!0)&&We.update(be,Ee,Hi),(vo||Et.receiveShadow!==be.receiveShadow)&&(Et.receiveShadow=be.receiveShadow,yn.setValue(ne,"receiveShadow",be.receiveShadow)),Se.isMeshGouraudMaterial&&Se.envMap!==null&&(qi.envMap.value=ut,qi.flipEnvMap.value=ut.isCubeTexture&&ut.isRenderTargetTexture===!1?-1:1),vo&&(yn.setValue(ne,"toneMappingExposure",v.toneMappingExposure),Et.needsLights&&Uy(qi,Ec),Qe&&Se.fog===!0&&me.refreshFogUniforms(qi,Qe),me.refreshMaterialUniforms(qi,Se,L,q,De),Ud.upload(ne,Rp(Et),qi,ae)),Se.isShaderMaterial&&Se.uniformsNeedUpdate===!0&&(Ud.upload(ne,Rp(Et),qi,ae),Se.uniformsNeedUpdate=!1),Se.isSpriteMaterial&&yn.setValue(ne,"center",be.center),yn.setValue(ne,"modelViewMatrix",be.modelViewMatrix),yn.setValue(ne,"normalMatrix",be.normalMatrix),yn.setValue(ne,"modelMatrix",be.matrixWorld),Se.isShaderMaterial||Se.isRawShaderMaterial){const Jn=Se.uniformsGroups;for(let Sc=0,Gy=Jn.length;Sc0&&ae.useMultisampledRTT(F)===!1?be=he.get(F).__webglMultisampledFramebuffer:Array.isArray(mt)?be=mt[Ee]:be=mt,N.copy(F.viewport),G.copy(F.scissor),V=F.scissorTest}else N.copy(oe).multiplyScalar(L).floor(),G.copy(ye).multiplyScalar(L).floor(),V=xe;if(ce.bindFramebuffer(ne.FRAMEBUFFER,be)&&J.drawBuffers&&Se&&ce.drawBuffers(F,be),ce.viewport(N),ce.scissor(G),ce.setScissorTest(V),Qe){const ut=he.get(F.texture);ne.framebufferTexture2D(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0,ne.TEXTURE_CUBE_MAP_POSITIVE_X+de,ut.__webglTexture,Ee)}else if(st){const ut=he.get(F.texture),bt=de||0;ne.framebufferTextureLayer(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0,ut.__webglTexture,Ee||0,bt)}I=-1},this.readRenderTargetPixels=function(F,de,Ee,Se,be,Qe,st){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ct=he.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&st!==void 0&&(ct=ct[st]),ct){ce.bindFramebuffer(ne.FRAMEBUFFER,ct);try{const ut=F.texture,bt=ut.format,mt=ut.type;if(bt!==hs&&Nt.convert(bt)!==ne.getParameter(ne.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=mt===Xl&&(P.has("EXT_color_buffer_half_float")||J.isWebGL2&&P.has("EXT_color_buffer_float"));if(mt!==yr&&Nt.convert(mt)!==ne.getParameter(ne.IMPLEMENTATION_COLOR_READ_TYPE)&&!(mt===Ni&&(J.isWebGL2||P.has("OES_texture_float")||P.has("WEBGL_color_buffer_float")))&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}de>=0&&de<=F.width-Se&&Ee>=0&&Ee<=F.height-be&&ne.readPixels(de,Ee,Se,be,Nt.convert(bt),Nt.convert(mt),Qe)}finally{const ut=A!==null?he.get(A).__webglFramebuffer:null;ce.bindFramebuffer(ne.FRAMEBUFFER,ut)}}},this.copyFramebufferToTexture=function(F,de,Ee=0){const Se=Math.pow(2,-Ee),be=Math.floor(de.image.width*Se),Qe=Math.floor(de.image.height*Se);ae.setTexture2D(de,0),ne.copyTexSubImage2D(ne.TEXTURE_2D,Ee,0,0,F.x,F.y,be,Qe),ce.unbindTexture()},this.copyTextureToTexture=function(F,de,Ee,Se=0){const be=de.image.width,Qe=de.image.height,st=Nt.convert(Ee.format),ct=Nt.convert(Ee.type);ae.setTexture2D(Ee,0),ne.pixelStorei(ne.UNPACK_FLIP_Y_WEBGL,Ee.flipY),ne.pixelStorei(ne.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ee.premultiplyAlpha),ne.pixelStorei(ne.UNPACK_ALIGNMENT,Ee.unpackAlignment),de.isDataTexture?ne.texSubImage2D(ne.TEXTURE_2D,Se,F.x,F.y,be,Qe,st,ct,de.image.data):de.isCompressedTexture?ne.compressedTexSubImage2D(ne.TEXTURE_2D,Se,F.x,F.y,de.mipmaps[0].width,de.mipmaps[0].height,st,de.mipmaps[0].data):ne.texSubImage2D(ne.TEXTURE_2D,Se,F.x,F.y,st,ct,de.image),Se===0&&Ee.generateMipmaps&&ne.generateMipmap(ne.TEXTURE_2D),ce.unbindTexture()},this.copyTextureToTexture3D=function(F,de,Ee,Se,be=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Qe=F.max.x-F.min.x+1,st=F.max.y-F.min.y+1,ct=F.max.z-F.min.z+1,ut=Nt.convert(Se.format),bt=Nt.convert(Se.type);let mt;if(Se.isData3DTexture)ae.setTexture3D(Se,0),mt=ne.TEXTURE_3D;else if(Se.isDataArrayTexture)ae.setTexture2DArray(Se,0),mt=ne.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ne.pixelStorei(ne.UNPACK_FLIP_Y_WEBGL,Se.flipY),ne.pixelStorei(ne.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Se.premultiplyAlpha),ne.pixelStorei(ne.UNPACK_ALIGNMENT,Se.unpackAlignment);const ht=ne.getParameter(ne.UNPACK_ROW_LENGTH),tn=ne.getParameter(ne.UNPACK_IMAGE_HEIGHT),qn=ne.getParameter(ne.UNPACK_SKIP_PIXELS),dn=ne.getParameter(ne.UNPACK_SKIP_ROWS),Ws=ne.getParameter(ne.UNPACK_SKIP_IMAGES),Qt=Ee.isCompressedTexture?Ee.mipmaps[0]:Ee.image;ne.pixelStorei(ne.UNPACK_ROW_LENGTH,Qt.width),ne.pixelStorei(ne.UNPACK_IMAGE_HEIGHT,Qt.height),ne.pixelStorei(ne.UNPACK_SKIP_PIXELS,F.min.x),ne.pixelStorei(ne.UNPACK_SKIP_ROWS,F.min.y),ne.pixelStorei(ne.UNPACK_SKIP_IMAGES,F.min.z),Ee.isDataTexture||Ee.isData3DTexture?ne.texSubImage3D(mt,be,de.x,de.y,de.z,Qe,st,ct,ut,bt,Qt.data):Ee.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ne.compressedTexSubImage3D(mt,be,de.x,de.y,de.z,Qe,st,ct,ut,Qt.data)):ne.texSubImage3D(mt,be,de.x,de.y,de.z,Qe,st,ct,ut,bt,Qt),ne.pixelStorei(ne.UNPACK_ROW_LENGTH,ht),ne.pixelStorei(ne.UNPACK_IMAGE_HEIGHT,tn),ne.pixelStorei(ne.UNPACK_SKIP_PIXELS,qn),ne.pixelStorei(ne.UNPACK_SKIP_ROWS,dn),ne.pixelStorei(ne.UNPACK_SKIP_IMAGES,Ws),be===0&&Se.generateMipmaps&&ne.generateMipmap(mt),ce.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?ae.setTextureCube(F,0):F.isData3DTexture?ae.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?ae.setTexture2DArray(F,0):ae.setTexture2D(F,0),ce.unbindTexture()},this.resetState=function(){R=0,C=0,A=null,ce.reset(),tt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Mi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===cy?"display-p3":"srgb",t.unpackColorSpace=Lt.workingColorSpace===gp?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===nn?io:LM}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===io?nn:Cn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class vvt extends tO{}vvt.prototype.isWebGL1Renderer=!0;class Svt extends Jt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class Tvt{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Sb,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Bs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,s){e*=this.stride,s*=t.stride;for(let i=0,r=this.stride;ic)continue;m.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(m);Ie.far||t.push({distance:I,point:_.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else{const y=Math.max(0,o.start),E=Math.min(b.count,o.start+o.count);for(let v=y,S=E-1;vc)continue;m.applyMatrix4(this.matrixWorld);const C=e.ray.origin.distanceTo(m);Ce.far||t.push({distance:C,point:_.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;ri.far)return;r.push({distance:d,distanceToRay:Math.sqrt(a),point:c,index:e,face:null,object:o})}}class by extends Gs{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new pt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ly,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class zi extends by{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Rt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return On(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new pt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new pt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new pt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Vw extends Gs{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new pt(16777215),this.specular=new pt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ly,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=oy,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function bd(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function kvt(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Dvt(n){function e(i,r){return n[i]-n[r]}const t=n.length,s=new Array(t);for(let i=0;i!==t;++i)s[i]=i;return s.sort(e),s}function zw(n,e,t){const s=n.length,i=new n.constructor(s);for(let r=0,o=0;o!==s;++r){const a=t[r]*e;for(let c=0;c!==e;++c)i[o++]=n[a+c]}return i}function rO(n,e,t,s){let i=1,r=n[0];for(;r!==void 0&&r[s]===void 0;)r=n[i++];if(r===void 0)return;let o=r[s];if(o!==void 0)if(Array.isArray(o))do o=r[s],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[i++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[s],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[i++];while(r!==void 0);else do o=r[s],o!==void 0&&(e.push(r.time),t.push(o)),r=n[i++];while(r!==void 0)}class _c{constructor(e,t,s,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(s),this.sampleValues=t,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let s=this._cachedIndex,i=t[s],r=t[s-1];e:{t:{let o;n:{s:if(!(e=r)){const a=t[1];e=r)break t}o=s,s=0;break n}break e}for(;s>>1;et;)--o;if(++o,r!==0||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=s.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,i=this.values,r=s.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const c=s[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(i!==void 0&&kvt(i))for(let a=0,c=i.length;a!==c;++a){const d=i[a];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,d),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),s=this.getValueSize(),i=this.getInterpolation()===Jh,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*s,c=o*s,d=0;d!==s;++d)t[c+d]=t[a+d];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*s)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),s=this.constructor,i=new s(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}mi.prototype.TimeBufferType=Float32Array;mi.prototype.ValueBufferType=Float32Array;mi.prototype.DefaultInterpolation=Ta;class Ya extends mi{}Ya.prototype.ValueTypeName="bool";Ya.prototype.ValueBufferType=Array;Ya.prototype.DefaultInterpolation=Zl;Ya.prototype.InterpolantFactoryMethodLinear=void 0;Ya.prototype.InterpolantFactoryMethodSmooth=void 0;class oO extends mi{}oO.prototype.ValueTypeName="color";class wa extends mi{}wa.prototype.ValueTypeName="number";class Uvt extends _c{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e,t,s,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(s-t)/(i-t);let d=e*a;for(let u=d+a;d!==u;d+=4)Mr.slerpFlat(r,0,o,d-a,o,d,c);return r}}class ho extends mi{InterpolantFactoryMethodLinear(e){return new Uvt(this.times,this.values,this.getValueSize(),e)}}ho.prototype.ValueTypeName="quaternion";ho.prototype.DefaultInterpolation=Ta;ho.prototype.InterpolantFactoryMethodSmooth=void 0;class $a extends mi{}$a.prototype.ValueTypeName="string";$a.prototype.ValueBufferType=Array;$a.prototype.DefaultInterpolation=Zl;$a.prototype.InterpolantFactoryMethodLinear=void 0;$a.prototype.InterpolantFactoryMethodSmooth=void 0;class Ra extends mi{}Ra.prototype.ValueTypeName="vector";class Bvt{constructor(e,t=-1,s,i=qht){this.name=e,this.tracks=s,this.duration=t,this.blendMode=i,this.uuid=Bs(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],s=e.tracks,i=1/(e.fps||1);for(let o=0,a=s.length;o!==a;++o)t.push(Vvt(s[o]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],s=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=s.length;r!==o;++r)t.push(mi.toJSON(s[r]));return i}static CreateFromMorphTargetSequence(e,t,s,i){const r=t.length,o=[];for(let a=0;a1){const _=u[1];let m=i[_];m||(i[_]=m=[]),m.push(d)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,s));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(_,m,h,f,g){if(h.length!==0){const b=[],y=[];rO(h,b,y,f),b.length!==0&&g.push(new _(m,b,y))}},i=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let c=e.length||-1;const d=e.hierarchy||[];for(let _=0;_{t&&t(r),this.manager.itemEnd(e)},0),r;if(Ti[e]!==void 0){Ti[e].push({onLoad:t,onProgress:s,onError:i});return}Ti[e]=[],Ti[e].push({onLoad:t,onProgress:s,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,c=this.responseType;fetch(o).then(d=>{if(d.status===200||d.status===0){if(d.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||d.body===void 0||d.body.getReader===void 0)return d;const u=Ti[e],_=d.body.getReader(),m=d.headers.get("Content-Length")||d.headers.get("X-File-Size"),h=m?parseInt(m):0,f=h!==0;let g=0;const b=new ReadableStream({start(y){E();function E(){_.read().then(({done:v,value:S})=>{if(v)y.close();else{g+=S.byteLength;const R=new ProgressEvent("progress",{lengthComputable:f,loaded:g,total:h});for(let C=0,A=u.length;C{switch(c){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return d.json();default:if(a===void 0)return d.text();{const _=/charset="?([^;"\s]*)"?/i.exec(a),m=_&&_[1]?_[1].toLowerCase():void 0,h=new TextDecoder(m);return d.arrayBuffer().then(f=>h.decode(f))}}}).then(d=>{Aa.add(e,d);const u=Ti[e];delete Ti[e];for(let _=0,m=u.length;_{const u=Ti[e];if(u===void 0)throw this.manager.itemError(e),d;delete Ti[e];for(let _=0,m=u.length;_{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Yvt extends Wa{constructor(e){super(e)}load(e,t,s,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Aa.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=Jl("img");function c(){u(),Aa.add(e,this),t&&t(this),r.manager.itemEnd(e)}function d(_){u(),i&&i(_),r.manager.itemError(e),r.manager.itemEnd(e)}function u(){a.removeEventListener("load",c,!1),a.removeEventListener("error",d,!1)}return a.addEventListener("load",c,!1),a.addEventListener("error",d,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class lO extends Wa{constructor(e){super(e)}load(e,t,s,i){const r=new xn,o=new Yvt(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},s,i),r}}class vp extends Jt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new pt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const wg=new St,Hw=new re,qw=new re;class yy{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Rt(512,512),this.map=null,this.mapPass=null,this.matrix=new St,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new uy,this._frameExtents=new Rt(1,1),this._viewportCount=1,this._viewports=[new $t(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,s=this.matrix;Hw.setFromMatrixPosition(e.matrixWorld),t.position.copy(Hw),qw.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(qw),t.updateMatrixWorld(),wg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(wg),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(wg)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class $vt extends yy{constructor(){super(new Gn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,s=xa*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(s!==t.fov||i!==t.aspect||r!==t.far)&&(t.fov=s,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Wvt extends vp{constructor(e,t,s=0,i=Math.PI/3,r=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.distance=s,this.angle=i,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new $vt}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Yw=new St,dl=new re,Rg=new re;class Kvt extends yy{constructor(){super(new Gn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Rt(4,2),this._viewportCount=6,this._viewports=[new $t(2,1,1,1),new $t(0,1,1,1),new $t(3,1,1,1),new $t(1,1,1,1),new $t(3,0,1,1),new $t(1,0,1,1)],this._cubeDirections=[new re(1,0,0),new re(-1,0,0),new re(0,0,1),new re(0,0,-1),new re(0,1,0),new re(0,-1,0)],this._cubeUps=[new re(0,1,0),new re(0,1,0),new re(0,1,0),new re(0,1,0),new re(0,0,1),new re(0,0,-1)]}updateMatrices(e,t=0){const s=this.camera,i=this.matrix,r=e.distance||s.far;r!==s.far&&(s.far=r,s.updateProjectionMatrix()),dl.setFromMatrixPosition(e.matrixWorld),s.position.copy(dl),Rg.copy(s.position),Rg.add(this._cubeDirections[t]),s.up.copy(this._cubeUps[t]),s.lookAt(Rg),s.updateMatrixWorld(),i.makeTranslation(-dl.x,-dl.y,-dl.z),Yw.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Yw)}}class jvt extends vp{constructor(e,t,s=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=i,this.shadow=new Kvt}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Qvt extends yy{constructor(){super(new fy(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class cO extends vp{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.shadow=new Qvt}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Xvt extends vp{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class kl{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let s=0,i=e.length;s"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,s,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Aa.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){Aa.add(e,c),t&&t(c),r.manager.itemEnd(e)}).catch(function(c){i&&i(c),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}const Ey="\\[\\]\\.:\\/",Jvt=new RegExp("["+Ey+"]","g"),vy="[^"+Ey+"]",eSt="[^"+Ey.replace("\\.","")+"]",tSt=/((?:WC+[\/:])*)/.source.replace("WC",vy),nSt=/(WCOD+)?/.source.replace("WCOD",eSt),sSt=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",vy),iSt=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",vy),rSt=new RegExp("^"+tSt+nSt+sSt+iSt+"$"),oSt=["material","materials","bones","map"];class aSt{constructor(e,t,s){const i=s||Ft.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const s=this._targetGroup.nCachedObjects_,i=this._bindings[s];i!==void 0&&i.getValue(e,t)}setValue(e,t){const s=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=s.length;i!==r;++i)s[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].unbind()}}class Ft{constructor(e,t,s){this.path=t,this.parsedPath=s||Ft.parseTrackName(t),this.node=Ft.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,s){return e&&e.isAnimationObjectGroup?new Ft.Composite(e,t,s):new Ft(e,t,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Jvt,"")}static parseTrackName(e){const t=rSt.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=s.nodeName&&s.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const r=s.nodeName.substring(i+1);oSt.indexOf(r)!==-1&&(s.nodeName=s.nodeName.substring(0,i),s.objectName=r)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(t);if(s!==void 0)return s}if(e.children){const s=function(r){for(let o=0;o=2.0 are supported."));return}const d=new GSt(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[_]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+_+'".')}}d.setExtensions(o),d.setPlugins(a),d.parse(s,i)}parseAsync(e,t){const s=this;return new Promise(function(i,r){s.parse(e,t,i,r)})}}function cSt(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const wt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class dSt{constructor(e){this.parser=e,this.name=wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,i=t.length;s=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class TSt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=i.images[o.source];let c=s.textureLoader;if(a.uri){const d=s.options.manager.getHandler(a.uri);d!==null&&(c=d)}return this.detectSupport().then(function(d){if(d)return s.loadTextureImage(e,o.source,c);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class xSt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=i.images[o.source];let c=s.textureLoader;if(a.uri){const d=s.options.manager.getHandler(a.uri);d!==null&&(c=d)}return this.detectSupport().then(function(d){if(d)return s.loadTextureImage(e,o.source,c);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class CSt{constructor(e){this.name=wt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const i=s.extensions[this.name],r=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const c=i.byteOffset||0,d=i.byteLength||0,u=i.count,_=i.byteStride,m=new Uint8Array(a,c,d);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,_,m,i.mode,i.filter).then(function(h){return h.buffer}):o.ready.then(function(){const h=new ArrayBuffer(u*_);return o.decodeGltfBuffer(new Uint8Array(h),u,_,m,i.mode,i.filter),h})})}else return null}}class wSt{constructor(e){this.name=wt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const i=t.meshes[s.mesh];for(const d of i.primitives)if(d.mode!==fs.TRIANGLES&&d.mode!==fs.TRIANGLE_STRIP&&d.mode!==fs.TRIANGLE_FAN&&d.mode!==void 0)return null;const o=s.extensions[this.name].attributes,a=[],c={};for(const d in o)a.push(this.parser.getDependency("accessor",o[d]).then(u=>(c[d]=u,c[d])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(d=>{const u=d.pop(),_=u.isGroup?u.children:[u],m=d[0].count,h=[];for(const f of _){const g=new St,b=new re,y=new Mr,E=new re(1,1,1),v=new Nvt(f.geometry,f.material,m);for(let S=0;S0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const BSt=new St;class GSt{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new cSt,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,i=!1,r=-1;typeof navigator<"u"&&(s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,r=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||s||i&&r<98?this.textureLoader=new lO(this.options.manager):this.textureLoader=new Zvt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new aO(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const a={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:s,userData:{}};return Br(r,a,i),ur(a,i),Promise.all(s._invokeAll(function(c){return c.afterRoot&&c.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let i=0,r=t.length;i{const c=this.associations.get(o);c!=null&&this.associations.set(a,c);for(const[d,u]of o.children.entries())r(u,a.children[d])};return r(s,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s=2&&b.setY(x,C[A*c+1]),c>=3&&b.setZ(x,C[A*c+2]),c>=4&&b.setW(x,C[A*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,s=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const c=s.manager.getHandler(o.uri);c!==null&&(a=c)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,s){const i=this,r=this.json,o=r.textures[e],a=r.images[t],c=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[c])return this.textureCache[c];const d=this.loadImageSource(t,s).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const m=(r.samplers||{})[o.sampler]||{};return u.magFilter=Kw[m.magFilter]||$n,u.minFilter=Kw[m.minFilter]||fo,u.wrapS=jw[m.wrapS]||va,u.wrapT=jw[m.wrapT]||va,i.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[c]=d,d}loadImageSource(e,t){const s=this,i=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(_=>_.clone());const o=i.images[e],a=self.URL||self.webkitURL;let c=o.uri||"",d=!1;if(o.bufferView!==void 0)c=s.getDependency("bufferView",o.bufferView).then(function(_){d=!0;const m=new Blob([_],{type:o.mimeType});return c=a.createObjectURL(m),c});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(c).then(function(_){return new Promise(function(m,h){let f=m;t.isImageBitmapLoader===!0&&(f=function(g){const b=new xn(g);b.needsUpdate=!0,m(b)}),t.load(kl.resolveURL(_,r.path),f,void 0,h)})}).then(function(_){return d===!0&&a.revokeObjectURL(c),_.userData.mimeType=o.mimeType||USt(o.uri),_}).catch(function(_){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),_});return this.sourceCache[e]=u,u}assignTexture(e,t,s,i){const r=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),r.extensions[wt.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[wt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const c=r.associations.get(o);o=r.extensions[wt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,c)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const i=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+s.uuid;let c=this.cache.get(a);c||(c=new iO,Gs.prototype.copy.call(c,s),c.color.copy(s.color),c.map=s.map,c.sizeAttenuation=!1,this.cache.add(a,c)),s=c}else if(e.isLine){const a="LineBasicMaterial:"+s.uuid;let c=this.cache.get(a);c||(c=new sO,Gs.prototype.copy.call(c,s),c.color.copy(s.color),c.map=s.map,this.cache.add(a,c)),s=c}if(i||r||o){let a="ClonedMaterial:"+s.uuid+":";i&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let c=this.cache.get(a);c||(c=s.clone(),r&&(c.vertexColors=!0),o&&(c.flatShading=!0),i&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(a,c),this.associations.set(c,this.associations.get(s))),s=c}e.material=s}getMaterialType(){return by}loadMaterial(e){const t=this,s=this.json,i=this.extensions,r=s.materials[e];let o;const a={},c=r.extensions||{},d=[];if(c[wt.KHR_MATERIALS_UNLIT]){const _=i[wt.KHR_MATERIALS_UNLIT];o=_.getMaterialType(),d.push(_.extendParams(a,r,t))}else{const _=r.pbrMetallicRoughness||{};if(a.color=new pt(1,1,1),a.opacity=1,Array.isArray(_.baseColorFactor)){const m=_.baseColorFactor;a.color.setRGB(m[0],m[1],m[2],Cn),a.opacity=m[3]}_.baseColorTexture!==void 0&&d.push(t.assignTexture(a,"map",_.baseColorTexture,nn)),a.metalness=_.metallicFactor!==void 0?_.metallicFactor:1,a.roughness=_.roughnessFactor!==void 0?_.roughnessFactor:1,_.metallicRoughnessTexture!==void 0&&(d.push(t.assignTexture(a,"metalnessMap",_.metallicRoughnessTexture)),d.push(t.assignTexture(a,"roughnessMap",_.metallicRoughnessTexture))),o=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),d.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=Js);const u=r.alphaMode||Ng.OPAQUE;if(u===Ng.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===Ng.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==mr&&(d.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Rt(1,1),r.normalTexture.scale!==void 0)){const _=r.normalTexture.scale;a.normalScale.set(_,_)}if(r.occlusionTexture!==void 0&&o!==mr&&(d.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==mr){const _=r.emissiveFactor;a.emissive=new pt().setRGB(_[0],_[1],_[2],Cn)}return r.emissiveTexture!==void 0&&o!==mr&&d.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,nn)),Promise.all(d).then(function(){const _=new o(a);return r.name&&(_.name=r.name),ur(_,r),t.associations.set(_,{materials:e}),r.extensions&&Br(i,_,r),_})}createUniqueName(e){const t=Ft.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,i=this.primitiveCache;function r(a){return s[wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(c){return Qw(c,a,t)})}const o=[];for(let a=0,c=e.length;a0&&PSt(y,r),y.name=t.createUniqueName(r.name||"mesh_"+e),ur(y,r),b.extensions&&Br(i,y,b),t.assignFinalMaterial(y),_.push(y)}for(let h=0,f=_.length;h1?u=new Qr:d.length===1?u=d[0]:u=new Jt,u!==d[0])for(let _=0,m=d.length;_{const _=new Map;for(const[m,h]of i.associations)(m instanceof Gs||m instanceof xn)&&_.set(m,h);return u.traverse(m=>{const h=i.associations.get(m);h!=null&&_.set(m,h)}),_};return i.associations=d(r),r})}_createAnimationTracks(e,t,s,i,r){const o=[],a=e.name?e.name:e.uuid,c=[];er[r.path]===er.weights?e.traverse(function(m){m.morphTargetInfluences&&c.push(m.name?m.name:m.uuid)}):c.push(a);let d;switch(er[r.path]){case er.weights:d=wa;break;case er.rotation:d=ho;break;case er.position:case er.scale:d=Ra;break;default:switch(s.itemSize){case 1:d=wa;break;case 2:case 3:default:d=Ra;break}break}const u=i.interpolation!==void 0?kSt[i.interpolation]:Ta,_=this._getArrayFromAccessor(s);for(let m=0,h=c.length;m{Ve.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,Ye.emit("stop_webcam_video_stream"),Le(()=>{Ve.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ve.replace(),Ye.on("video_stream_image",n=>{if(this.isVideoActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},HSt=["src"],qSt=["src"],YSt={class:"controls"},$St={key:2};function WSt(n,e,t,s,i,r){return T(),w("div",{class:"floating-frame bg-white",style:Wt({bottom:i.position.bottom+"px",right:i.position.right+"px","z-index":i.zIndex}),onMousedown:e[4]||(e[4]=K((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=K((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[l("div",{class:"handle",onMousedown:e[0]||(e[0]=K((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=K((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),i.isVideoActive&&i.imageDataUrl!=null?(T(),w("img",{key:0,src:i.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,HSt)):B("",!0),i.isVideoActive&&i.imageDataUrl==null?(T(),w("p",{key:1,src:i.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,qSt)):B("",!0),l("div",YSt,[i.isVideoActive?B("",!0):(T(),w("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>r.startVideoStream&&r.startVideoStream(...o))},e[6]||(e[6]=[l("i",{"data-feather":"video"},null,-1)]))),i.isVideoActive?(T(),w("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>r.stopVideoStream&&r.stopVideoStream(...o))},e[7]||(e[7]=[l("i",{"data-feather":"video"},null,-1)]))):B("",!0),i.isVideoActive?(T(),w("span",$St,"FPS: "+W(i.frameRate),1)):B("",!0)])],36)}const KSt=it(zSt,[["render",WSt]]),jSt={data(){return{isAudioActive:!1,imageDataUrl:null,isDragging:!1,position:{bottom:0,right:0},dragStart:{x:0,y:0},zIndex:0,frameRate:0,frameCount:0,lastFrameTime:Date.now()}},methods:{startAudioStream(){Ye.emit("start_audio_stream",()=>{this.isAudioActive=!0}),Le(()=>{Ve.replace()})},stopAudioStream(){Ye.emit("stop_audio_stream",()=>{this.isAudioActive=!1,this.imageDataUrl=null}),Le(()=>{Ve.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ve.replace(),Ye.on("update_spectrogram",n=>{if(this.isAudioActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},QSt=["src"],XSt={class:"controls"};function ZSt(n,e,t,s,i,r){return T(),w("div",{class:"floating-frame bg-white",style:Wt({bottom:i.position.bottom+"px",right:i.position.right+"px","z-index":i.zIndex}),onMousedown:e[4]||(e[4]=K((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=K((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[l("div",{class:"handle",onMousedown:e[0]||(e[0]=K((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=K((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),i.isAudioActive&&i.imageDataUrl!=null?(T(),w("img",{key:0,src:i.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,QSt)):B("",!0),l("div",XSt,[i.isAudioActive?B("",!0):(T(),w("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>r.startAudioStream&&r.startAudioStream(...o))},e[6]||(e[6]=[l("i",{"data-feather":"mic"},null,-1)]))),i.isAudioActive?(T(),w("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>r.stopAudioStream&&r.stopAudioStream(...o))},e[7]||(e[7]=[l("i",{"data-feather":"mic"},null,-1)]))):B("",!0)])],36)}const JSt=it(jSt,[["render",ZSt]]),e1t={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:KSt,AudioFrame:JSt},computed:{isReady:{get(){return this.$store.state.ready}}},watch:{"$store.state.mountedPersArr":"updatePersonality","$store.state.config.active_personality_id":"updatePersonality"},async mounted(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));console.log("Personality:",this.personality),this.initWebGLScene(),this.updatePersonality(),Le(()=>{Ve.replace()}),this.$refs.video_frame.position={bottom:0,right:0},this.$refs.audio_frame.position={bottom:0,right:100}},beforeDestroy(){},methods:{initWebGLScene(){this.scene=new Svt,this.camera=new Gn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new tO,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const n=new Er,e=new Vw({color:65280});this.cube=new Vn(n,e),this.scene.add(this.cube);const t=new Xvt(4210752),s=new cO(16777215,.5);s.position.set(0,1,0),this.scene.add(t),this.scene.add(s),this.camera.position.z=5,this.animate()},updatePersonality(){const{mountedPersArr:n,config:e}=this.$store.state;this.activePersonality=n[e.active_personality_id],this.activePersonality.avatar?this.showBoxWithAvatar(this.activePersonality.avatar):this.showDefaultCube(),this.$emit("update:personality",this.activePersonality)},loadScene(n){new lSt().load(n,t=>{this.scene.remove(this.cube),this.cube=t.scene,this.scene.add(this.cube)})},showBoxWithAvatar(n){this.cube&&this.scene.remove(this.cube);const e=new Er,t=new lO().load(n),s=new mr({map:t});this.cube=new Vn(e,s),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const n=new Er,e=new Vw({color:65280});this.cube=new Vn(n,e),this.scene.add(this.cube)},animate(){requestAnimationFrame(this.animate),this.cube&&(this.cube.rotation.x+=.01,this.cube.rotation.y+=.01),this.renderer.render(this.scene,this.camera)}}},t1t={ref:"webglContainer"},n1t={class:"flex-col y-overflow scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},s1t={key:0,class:"text-center"},i1t={key:1,class:"text-center"},r1t={class:"floating-frame2"},o1t=["innerHTML"];function a1t(n,e,t,s,i,r){const o=et("VideoFrame"),a=et("AudioFrame");return T(),w(Be,null,[l("div",t1t,null,512),l("div",n1t,[!i.activePersonality||!i.activePersonality.scene_path?(T(),w("div",s1t," Personality does not have a 3d avatar. ")):B("",!0),!i.activePersonality||!i.activePersonality.avatar||i.activePersonality.avatar===""?(T(),w("div",i1t," Personality does not have an avatar. ")):B("",!0),l("div",r1t,[l("div",{innerHTML:n.htmlContent},null,8,o1t)])]),z(o,{ref:"video_frame"},null,512),z(a,{ref:"audio_frame"},null,512)],64)}const l1t=it(e1t,[["render",a1t]]);let yd;const c1t=new Uint8Array(16);function d1t(){if(!yd&&(yd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yd(c1t)}const En=[];for(let n=0;n<256;++n)En.push((n+256).toString(16).slice(1));function u1t(n,e=0){return En[n[e+0]]+En[n[e+1]]+En[n[e+2]]+En[n[e+3]]+"-"+En[n[e+4]]+En[n[e+5]]+"-"+En[n[e+6]]+En[n[e+7]]+"-"+En[n[e+8]]+En[n[e+9]]+"-"+En[n[e+10]]+En[n[e+11]]+En[n[e+12]]+En[n[e+13]]+En[n[e+14]]+En[n[e+15]]}const p1t=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Xw={randomUUID:p1t};function Di(n,e,t){if(Xw.randomUUID&&!e&&!n)return Xw.randomUUID();n=n||{};const s=n.random||(n.rng||d1t)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,u1t(s)}class ro{constructor(){this.listenerMap=new Map,this._listeners=[],this.proxyMap=new Map,this.proxies=[]}get listeners(){return this._listeners.concat(this.proxies.flatMap(e=>e()))}subscribe(e,t){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. Please check that you don't accidentally use the same token twice to register two different handlers for the same event/hook.`),this.unsubscribe(e)),this.listenerMap.set(e,t),this._listeners.push(t)}unsubscribe(e){if(this.listenerMap.has(e)){const t=this.listenerMap.get(e);this.listenerMap.delete(e);const s=this._listeners.indexOf(t);s>=0&&this._listeners.splice(s,1)}}registerProxy(e,t){this.proxyMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. Please check that you don't accidentally use the same token twice to register two different proxies for the same event/hook.`),this.unregisterProxy(e)),this.proxyMap.set(e,t),this.proxies.push(t)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const t=this.proxyMap.get(e);this.proxyMap.delete(e);const s=this.proxies.indexOf(t);s>=0&&this.proxies.splice(s,1)}}class Gt extends ro{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class kn extends ro{constructor(e){super(),this.entity=e}emit(e){let t=!1;const s=()=>[t=!0];for(const i of Array.from(this.listeners.values()))if(i(e,s,this.entity),t)return{prevented:!0};return{prevented:!1}}}class pO extends ro{execute(e,t){let s=e;for(const i of this.listeners)s=i(s,t);return s}}class ls extends pO{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class f1t extends ro{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const s of this.listeners)t.push(s(e,this.entity));return t}}function Qs(){const n=Symbol(),e=new Map,t=new Set,s=(c,d)=>{d instanceof ro&&d.registerProxy(n,()=>{var u,_;return(_=(u=e.get(c))===null||u===void 0?void 0:u.listeners)!==null&&_!==void 0?_:[]})},i=c=>{const d=new ro;e.set(c,d),t.forEach(u=>s(c,u[c]))},r=c=>{t.add(c);for(const d of e.keys())s(d,c[d])},o=c=>{for(const d of e.keys())c[d]instanceof ro&&c[d].unregisterProxy(n);t.delete(c)},a=()=>{t.forEach(c=>o(c)),e.clear()};return new Proxy({},{get(c,d){return d==="addTarget"?r:d==="removeTarget"?o:d==="destroy"?a:typeof d!="string"||d.startsWith("_")?c[d]:(e.has(d)||i(d),e.get(d))}})}class Zw{constructor(e,t){if(this.destructed=!1,this.events={destruct:new Gt(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Di(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class fO{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Di(),this.from=e,this.to=t}}function Mb(n,e){return Object.fromEntries(Object.entries(n).map(([t,s])=>[t,e(s)]))}class _O{constructor(){this._title="",this.id=Di(),this.events={loaded:new Gt(this),beforeAddInput:new kn(this),addInput:new Gt(this),beforeRemoveInput:new kn(this),removeInput:new Gt(this),beforeAddOutput:new kn(this),addOutput:new Gt(this),beforeRemoveOutput:new kn(this),removeOutput:new Gt(this),beforeTitleChanged:new kn(this),titleChanged:new Gt(this),update:new Gt(this)},this.hooks={beforeLoad:new ls(this),afterSave:new ls(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,t){return this.addInterface("input",e,t)}addOutput(e,t){return this.addInterface("output",e,t)}removeInput(e){return this.removeInterface("input",e)}removeOutput(e){return this.removeInterface("output",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([t,s])=>{this.inputs[t]&&(this.inputs[t].load(s),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,s])=>{this.outputs[t]&&(this.outputs[t].load(s),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=Mb(this.inputs,i=>i.save()),t=Mb(this.outputs,i=>i.save()),s={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(s)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,t])=>this.initializeIntf("input",e,t)),Object.entries(this.outputs).forEach(([e,t])=>this.initializeIntf("output",e,t))}initializeIntf(e,t,s){s.isInput=e==="input",s.nodeId=this.id,s.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:s}))}addInterface(e,t,s){const i=e==="input"?this.events.beforeAddInput:this.events.beforeAddOutput,r=e==="input"?this.events.addInput:this.events.addOutput,o=e==="input"?this.inputs:this.outputs;return i.emit(s).prevented?!1:(o[t]=s,this.initializeIntf(e,t,s),r.emit(s),!0)}removeInterface(e,t){const s=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,i=e==="input"?this.events.removeInput:this.events.removeOutput,r=e==="input"?this.inputs[t]:this.outputs[t];if(!r||s.emit(r).prevented)return!1;if(r.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===r||a.to===r).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return r.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[t]:delete this.outputs[t],i.emit(r),!0}}let mO=class extends _O{load(e){super.load(e)}save(){return super.save()}};function Ka(n){return class extends mO{constructor(){var e,t;super(),this.type=n.type,this.inputs={},this.outputs={},this.calculate=n.calculate?(s,i)=>n.calculate.call(this,s,i):void 0,this._title=(e=n.title)!==null&&e!==void 0?e:n.type,this.executeFactory("input",n.inputs),this.executeFactory("output",n.outputs),(t=n.onCreate)===null||t===void 0||t.call(this)}onPlaced(){var e;(e=n.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=n.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,t){Object.keys(t||{}).forEach(s=>{const i=t[s]();e==="input"?this.addInput(s,i):this.addOutput(s,i)})}}}class en{set connectionCount(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)}get connectionCount(){return this._connectionCount}set value(e){this.events.beforeSetValue.emit(e).prevented||(this._value=e,this.events.setValue.emit(e))}get value(){return this._value}constructor(e,t){this.id=Di(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new Gt(this),beforeSetValue:new kn(this),setValue:new Gt(this),updated:new Gt(this)},this.hooks={load:new ls(this),save:new ls(this)},this._connectionCount=0,this.name=e,this._value=t}load(e){this.id=e.id,this.templateId=e.templateId,this.value=e.value,this.hooks.load.execute(e)}save(){const e={id:this.id,templateId:this.templateId,value:this.value};return this.hooks.save.execute(e)}setComponent(e){return this.component=e,this}setPort(e){return this.port=e,this}setHidden(e){return this.hidden=e,this}use(e,...t){return e(this,...t),this}}const Na="__baklava_SubgraphInputNode",Ma="__baklava_SubgraphOutputNode";class hO extends mO{constructor(){super(),this.graphInterfaceId=Di()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class Sy extends hO{constructor(){super(...arguments),this.type=Na,this.inputs={name:new en("Name","Input")},this.outputs={placeholder:new en("Value",void 0)}}static isGraphInputNode(e){return e.type===Na}}class Ty extends hO{constructor(){super(...arguments),this.type=Ma,this.inputs={name:new en("Name","Output"),placeholder:new en("Value",void 0)},this.outputs={output:new en("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===Ma}}class mc{get nodes(){return this._nodes}get connections(){return this._connections}get loading(){return this._loading}get destroying(){return this._destroying}get inputs(){return this.nodes.filter(t=>t.type===Na).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===Ma).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Di(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new kn(this),addNode:new Gt(this),beforeRemoveNode:new kn(this),removeNode:new Gt(this),beforeAddConnection:new kn(this),addConnection:new Gt(this),checkConnection:new kn(this),beforeRemoveConnection:new kn(this),removeConnection:new Gt(this)},this.hooks={save:new ls(this),load:new ls(this),checkConnection:new f1t(this)},this.nodeEvents=Qs(),this.nodeHooks=Qs(),this.connectionEvents=Qs(),this.editor=e,this.template=t,e.registerGraph(this)}addNode(e){if(!this.events.beforeAddNode.emit(e).prevented)return this.nodeEvents.addTarget(e.events),this.nodeHooks.addTarget(e.hooks),e.registerGraph(this),this._nodes.push(e),e=this.nodes.find(t=>t.id===e.id),e.onPlaced(),this.events.addNode.emit(e),e}removeNode(e){if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e).prevented)return;const t=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(s=>t.includes(s.from)||t.includes(s.to)).forEach(s=>this.removeConnection(s)),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e),e.onDestroy(),this.nodeEvents.removeTarget(e.events),this.nodeHooks.removeTarget(e.hooks)}}addConnection(e,t){const s=this.checkConnection(e,t);if(!s.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:t}).prevented)return;for(const r of s.connectionsInDanger){const o=this.connections.find(a=>a.id===r.id);o&&this.removeConnection(o)}const i=new Zw(s.dummyConnection.from,s.dummyConnection.to);return this.internalAddConnection(i),i}removeConnection(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e).prevented)return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e),this.connectionEvents.removeTarget(e.events)}}checkConnection(e,t){if(!e||!t)return{connectionAllowed:!1};const s=this.findNodeById(e.nodeId),i=this.findNodeById(t.nodeId);if(s&&i&&s===i)return{connectionAllowed:!1};if(e.isInput&&!t.isInput){const a=e;e=t,t=a}if(e.isInput||!t.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===t))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:t}).prevented)return{connectionAllowed:!1};const r=this.hooks.checkConnection.execute({from:e,to:t});if(r.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(r.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new fO(e,t),connectionsInDanger:o}}findNodeInterface(e){for(const t of this.nodes){for(const s in t.inputs){const i=t.inputs[s];if(i.id===e)return i}for(const s in t.outputs){const i=t.outputs[s];if(i.id===e)return i}}}findNodeById(e){return this.nodes.find(t=>t.id===e)}load(e){try{this._loading=!0;const t=[];for(let s=this.connections.length-1;s>=0;s--)this.removeConnection(this.connections[s]);for(let s=this.nodes.length-1;s>=0;s--)this.removeNode(this.nodes[s]);this.id=e.id;for(const s of e.nodes){const i=this.editor.nodeTypes.get(s.type);if(!i){t.push(`Node type ${s.type} is not registered`);continue}const r=new i.type;this.addNode(r),r.load(s)}for(const s of e.connections){const i=this.findNodeInterface(s.from),r=this.findNodeInterface(s.to);if(i)if(r){const o=new Zw(i,r);o.id=s.id,this.internalAddConnection(o)}else{t.push(`Could not find interface with id ${s.to}`);continue}else{t.push(`Could not find interface with id ${s.from}`);continue}}return this.hooks.load.execute(e),t}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(t=>t.save()),connections:this.connections.map(t=>({id:t.id,from:t.from.id,to:t.to.id})),inputs:this.inputs,outputs:this.outputs};return this.hooks.save.execute(e)}destroy(){this._destroying=!0;for(const e of this.nodes)this.removeNode(e);this.editor.unregisterGraph(this)}internalAddConnection(e){this.connectionEvents.addTarget(e.events),this._connections.push(e),this.events.addConnection.emit(e)}}const ec="__baklava_GraphNode-";function Oa(n){return ec+n.id}const _1t=["component","connectionCount","events","hidden","hooks","id","isInput","name","nodeId","port","templateId","value"];function m1t(n){return class extends _O{constructor(){super(...arguments),this.type=Oa(n),this.inputs={},this.outputs={},this.template=n,this.calculate=async(t,s)=>{var i;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!s.engine||typeof s.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const r=s.engine.getInputValues(this.subgraph);for(const c of this.subgraph.inputs)r.set(c.nodeInterfaceId,t[c.id]);const o=await s.engine.runGraph(this.subgraph,r,s.globalValues),a={};for(const c of this.subgraph.outputs)a[c.id]=(i=o.get(c.nodeId))===null||i===void 0?void 0:i.get("output");return a._calculationResults=o,a}}get title(){return this._title}set title(t){this.template.name=t}load(t){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(t.graphState),super.load(t)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,t=>{this._title=t}),this.initialize()}onDestroy(){var t;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(t=this.subgraph)===null||t===void 0||t.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.events.update.emit(null)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const t of this.subgraph.inputs)t.id in this.inputs?this.inputs[t.id].name=t.name:this.addInput(t.id,this.createProxyInterface(t,!0));for(const t of Object.keys(this.inputs))this.subgraph.inputs.some(s=>s.id===t)||this.removeInput(t);for(const t of this.subgraph.outputs)t.id in this.outputs?this.outputs[t.id].name=t.name:this.addOutput(t.id,this.createProxyInterface(t,!1));for(const t of Object.keys(this.outputs))this.subgraph.outputs.some(s=>s.id===t)||this.removeOutput(t);this.addOutput("_calculationResults",new en("_calculationResults",void 0).setHidden(!0))}createProxyInterface(t,s){const i=new en(t.name,void 0);return new Proxy(i,{get:(r,o)=>{var a,c,d;if(_1t.includes(o)||o in r||typeof o=="string"&&o.startsWith("__v_"))return Reflect.get(r,o);let u;if(s){const h=(a=this.subgraph)===null||a===void 0?void 0:a.nodes.find(f=>Sy.isGraphInputNode(f)&&f.graphInterfaceId===t.id);u=h==null?void 0:h.outputs.placeholder.id}else{const h=(c=this.subgraph)===null||c===void 0?void 0:c.nodes.find(f=>Ty.isGraphOutputNode(f)&&f.graphInterfaceId===t.id);u=h==null?void 0:h.inputs.placeholder.id}const _=(d=this.subgraph)===null||d===void 0?void 0:d.connections.find(h=>{var f;return u===((f=s?h.from:h.to)===null||f===void 0?void 0:f.id)}),m=s?_==null?void 0:_.to:_==null?void 0:_.from;if(m)return Reflect.get(m,o)}})}}}class Sp{static fromGraph(e,t){return new Sp(e.save(),t)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const t=this.editor.nodeTypes.get(Oa(this));t&&(t.title=e)}get inputs(){return this.nodes.filter(t=>t.type===Na).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===Ma).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Di(),this._name="Subgraph",this.events={nameChanged:new Gt(this),updated:new Gt(this)},this.hooks={beforeLoad:new ls(this),afterSave:new ls(this)},this.editor=t,e.id&&(this.id=e.id),e.name&&(this._name=e.name),this.update(e)}update(e){this.nodes=e.nodes,this.connections=e.connections,this.events.updated.emit()}save(){return{id:this.id,name:this.name,nodes:this.nodes,connections:this.connections,inputs:this.inputs,outputs:this.outputs}}createGraph(e){const t=new Map,s=m=>{const h=Di();return t.set(m,h),h},i=m=>{const h=t.get(m);if(!h)throw new Error(`Unable to create graph from template: Could not map old id ${m} to new id`);return h},r=m=>Mb(m,h=>({id:s(h.id),templateId:h.id,value:h.value})),o=this.nodes.map(m=>({...m,id:s(m.id),inputs:r(m.inputs),outputs:r(m.outputs)})),a=this.connections.map(m=>({id:s(m.id),from:i(m.from),to:i(m.to)})),c=this.inputs.map(m=>({id:m.id,name:m.name,nodeId:i(m.nodeId),nodeInterfaceId:i(m.nodeInterfaceId)})),d=this.outputs.map(m=>({id:m.id,name:m.name,nodeId:i(m.nodeId),nodeInterfaceId:i(m.nodeInterfaceId)})),u={id:Di(),nodes:o,connections:a,inputs:c,outputs:d};return e||(e=new mc(this.editor)),e.load(u).forEach(m=>console.warn(m)),e.template=this,e}}class h1t{get nodeTypes(){return this._nodeTypes}get graph(){return this._graph}get graphTemplates(){return this._graphTemplates}get graphs(){return this._graphs}get loading(){return this._loading}constructor(){this.events={loaded:new Gt(this),beforeRegisterNodeType:new kn(this),registerNodeType:new Gt(this),beforeUnregisterNodeType:new kn(this),unregisterNodeType:new Gt(this),beforeAddGraphTemplate:new kn(this),addGraphTemplate:new Gt(this),beforeRemoveGraphTemplate:new kn(this),removeGraphTemplate:new Gt(this),registerGraph:new Gt(this),unregisterGraph:new Gt(this)},this.hooks={save:new ls(this),load:new ls(this)},this.graphTemplateEvents=Qs(),this.graphTemplateHooks=Qs(),this.graphEvents=Qs(),this.graphHooks=Qs(),this.nodeEvents=Qs(),this.nodeHooks=Qs(),this.connectionEvents=Qs(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new mc(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(Sy),this.registerNodeType(Ty)}registerNodeType(e,t){var s,i;if(this.events.beforeRegisterNodeType.emit({type:e,options:t}).prevented)return;const r=new e;this._nodeTypes.set(r.type,{type:e,category:(s=t==null?void 0:t.category)!==null&&s!==void 0?s:"default",title:(i=t==null?void 0:t.title)!==null&&i!==void 0?i:r.title}),this.events.registerNodeType.emit({type:e,options:t})}unregisterNodeType(e){const t=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(t)){if(this.events.beforeUnregisterNodeType.emit(t).prevented)return;this._nodeTypes.delete(t),this.events.unregisterNodeType.emit(t)}}addGraphTemplate(e){if(this.events.beforeAddGraphTemplate.emit(e).prevented)return;this._graphTemplates.push(e),this.graphTemplateEvents.addTarget(e.events),this.graphTemplateHooks.addTarget(e.hooks);const t=m1t(e);this.registerNodeType(t,{category:"Subgraphs",title:e.name}),this.events.addGraphTemplate.emit(e)}removeGraphTemplate(e){if(this.graphTemplates.includes(e)){if(this.events.beforeRemoveGraphTemplate.emit(e).prevented)return;const t=Oa(e);for(const s of[this.graph,...this.graphs.values()]){const i=s.nodes.filter(r=>r.type===t);for(const r of i)s.removeNode(r)}this.unregisterNodeType(t),this._graphTemplates.splice(this._graphTemplates.indexOf(e),1),this.graphTemplateEvents.removeTarget(e.events),this.graphTemplateHooks.removeTarget(e.hooks),this.events.removeGraphTemplate.emit(e)}}registerGraph(e){this.graphEvents.addTarget(e.events),this.graphHooks.addTarget(e.hooks),this.nodeEvents.addTarget(e.nodeEvents),this.nodeHooks.addTarget(e.nodeHooks),this.connectionEvents.addTarget(e.connectionEvents),this.events.registerGraph.emit(e),this._graphs.add(e)}unregisterGraph(e){this.graphEvents.removeTarget(e.events),this.graphHooks.removeTarget(e.hooks),this.nodeEvents.removeTarget(e.nodeEvents),this.nodeHooks.removeTarget(e.nodeHooks),this.connectionEvents.removeTarget(e.connectionEvents),this.events.unregisterGraph.emit(e),this._graphs.delete(e)}load(e){try{for(this._loading=!0,e=this.hooks.load.execute(e);this.graphTemplates.length>0;)this.removeGraphTemplate(this.graphTemplates[0]);e.graphTemplates.forEach(s=>{const i=new Sp(s,this);this.addGraphTemplate(i)});const t=this._graph.load(e.graph);return this.events.loaded.emit(),t.forEach(s=>console.warn(s)),t}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(t=>t.save())};return this.hooks.save.execute(e)}}function g1t(n,e){const t=new Map;e.graphs.forEach(s=>{s.nodes.forEach(i=>t.set(i.id,i))}),n.forEach((s,i)=>{const r=t.get(i);r&&s.forEach((o,a)=>{const c=r.outputs[a];c&&(c.value=o)})})}class gO extends Error{constructor(){super("Cycle detected")}}function b1t(n){return typeof n=="string"}function bO(n,e){const t=new Map,s=new Map,i=new Map;let r,o;if(n instanceof mc)r=n.nodes,o=n.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");r=n,o=e}r.forEach(d=>{Object.values(d.inputs).forEach(u=>t.set(u.id,d.id)),Object.values(d.outputs).forEach(u=>t.set(u.id,d.id))}),r.forEach(d=>{const u=o.filter(m=>m.from&&t.get(m.from.id)===d.id),_=new Set(u.map(m=>t.get(m.to.id)).filter(b1t));s.set(d.id,_),i.set(d,u)});const a=r.slice();o.forEach(d=>{const u=a.findIndex(_=>t.get(d.to.id)===_.id);u>=0&&a.splice(u,1)});const c=[];for(;a.length>0;){const d=a.pop();c.push(d);const u=s.get(d.id);for(;u.size>0;){const _=u.values().next().value;if(u.delete(_),Array.from(s.values()).every(m=>!m.has(_))){const m=r.find(h=>h.id===_);a.push(m)}}}if(Array.from(s.values()).some(d=>d.size>0))throw new gO;return{calculationOrder:c,connectionsFromNode:i,interfaceIdToNodeId:t}}function y1t(n,e){try{return bO(n,e),!1}catch(t){if(t instanceof gO)return!0;throw t}}var Yn;(function(n){n.Running="Running",n.Idle="Idle",n.Paused="Paused",n.Stopped="Stopped"})(Yn||(Yn={}));class E1t{get status(){return this.isRunning?Yn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new kn(this),afterRun:new Gt(this),statusChange:new Gt(this),beforeNodeCalculation:new Gt(this),afterNodeCalculation:new Gt(this)},this.hooks={gatherCalculationData:new ls(this),transferData:new pO},this.recalculateOrder=!0,this.internalStatus=Yn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(t,s)=>{s.graph&&!s.graph.loading&&s.graph.activeTransactions===0&&this.internalOnChange(s,t??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,t=>this.checkConnection(t.from,t.to))}start(){this.internalStatus===Yn.Stopped&&(this.internalStatus=Yn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Yn.Idle&&(this.internalStatus=Yn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Yn.Paused&&(this.internalStatus=Yn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Yn.Idle||this.internalStatus===Yn.Paused)&&(this.internalStatus=Yn.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...t){if(this.events.beforeRun.emit(e).prevented)return null;try{this.isRunning=!0,this.events.statusChange.emit(this.status),this.recalculateOrder&&this.calculateOrder();const s=await this.execute(e,...t);return this.events.afterRun.emit(s),s}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,t){if(e.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};e=r}if(t.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,t.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};t=r}const s=new fO(e,t);let i=this.editor.graph.connections.slice();return t.allowMultipleConnections||(i=i.filter(r=>r.to!==t)),i.push(s),y1t(this.editor.graph.nodes,i)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:t.allowMultipleConnections?[]:this.editor.graph.connections.filter(r=>r.to===t)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const t=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(t,...e)}validateNodeCalculationOutput(e,t){if(typeof t!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(s=>{if(!(s in t))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${s}"`)})}internalOnChange(e,t){this.internalStatus===Yn.Idle&&this.onChange(this.recalculateOrder,e,t)}findInterfaceByTemplateId(e,t){for(const s of e)for(const i of[...Object.values(s.inputs),...Object.values(s.outputs)])if(i.templateId===t)return i;return null}}class v1t extends E1t{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,t,s){this.order.has(e.id)||this.order.set(e.id,bO(e));const{calculationOrder:i,connectionsFromNode:r}=this.order.get(e.id),o=new Map;for(const a of i){const c={};Object.entries(a.inputs).forEach(([u,_])=>{c[u]=this.getInterfaceValue(t,_.id)}),this.events.beforeNodeCalculation.emit({inputValues:c,node:a});let d;if(a.calculate)d=await a.calculate(c,{globalValues:s,engine:this});else{d={};for(const[u,_]of Object.entries(a.outputs))d[u]=this.getInterfaceValue(t,_.id)}this.validateNodeCalculationOutput(a,d),this.events.afterNodeCalculation.emit({outputValues:d,node:a}),o.set(a.id,new Map(Object.entries(d))),r.has(a)&&r.get(a).forEach(u=>{var _;const m=(_=Object.entries(a.outputs).find(([,f])=>f.id===u.from.id))===null||_===void 0?void 0:_[0];if(!m)throw new Error(`Could not find key for interface ${u.from.id} This is likely a Baklava internal issue. Please report it on GitHub.`);const h=this.hooks.transferData.execute(d[m],u);u.to.allowMultipleConnections?t.has(u.to.id)?t.get(u.to.id).push(h):t.set(u.to.id,[h]):t.set(u.to.id,h)})}return o}async execute(e){this.recalculateOrder&&(this.order.clear(),this.recalculateOrder=!1);const t=this.getInputValues(this.editor.graph);return await this.runGraph(this.editor.graph,t,e)}getInputValues(e){const t=new Map;for(const s of e.nodes)Object.values(s.inputs).forEach(i=>{i.connectionCount===0&&t.set(i.id,i.value)}),s.calculate||Object.values(s.outputs).forEach(i=>{t.set(i.id,i.value)});return t}onChange(e){this.recalculateOrder=e||this.recalculateOrder,this.calculateWithoutData()}getInterfaceValue(e,t){if(!e.has(t))throw new Error(`Could not find value for interface ${t} @@ -3972,8 +3972,8 @@ ${e} `}tablecell(e){const t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:s}){const i=this.parser.parseInline(s),r=d2(e);if(r===null)return i;e=r;let o='",o}image({href:e,title:t,text:s}){const i=d2(e);if(i===null)return s;e=i;let r=`${s}{const d=a[c].flat(1/0);s=s.concat(this.walkTokens(d,t))}):a.tokens&&(s=s.concat(this.walkTokens(a.tokens,t)))}}return s}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const i={...s};if(i.async=this.defaults.async||i.async||!1,s.extensions&&(s.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const o=t.renderers[r.name];o?t.renderers[r.name]=function(...a){let c=r.renderer.apply(this,a);return c===!1&&(c=o.apply(this,a)),c}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[r.level];o?o.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),s.renderer){const r=this.defaults.renderer||new wu(this.defaults);for(const o in s.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const a=o,c=s.renderer[a],d=r[a];r[a]=(...u)=>{let _=c.apply(r,u);return _===!1&&(_=d.apply(r,u)),_||""}}i.renderer=r}if(s.tokenizer){const r=this.defaults.tokenizer||new xu(this.defaults);for(const o in s.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const a=o,c=s.tokenizer[a],d=r[a];r[a]=(...u)=>{let _=c.apply(r,u);return _===!1&&(_=d.apply(r,u)),_}}i.tokenizer=r}if(s.hooks){const r=this.defaults.hooks||new Pl;for(const o in s.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const a=o,c=s.hooks[a],d=r[a];Pl.passThroughHooks.has(o)?r[a]=u=>{if(this.defaults.async)return Promise.resolve(c.call(r,u)).then(m=>d.call(r,m));const _=c.call(r,u);return d.call(r,_)}:r[a]=(...u)=>{let _=c.apply(r,u);return _===!1&&(_=d.apply(r,u)),_}}i.hooks=r}if(s.walkTokens){const r=this.defaults.walkTokens,o=s.walkTokens;i.walkTokens=function(a){let c=[];return c.push(o.call(this,a)),r&&(c=c.concat(r.call(this,a))),c}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ys.lex(e,t??this.defaults)}parser(e,t){return Es.parse(e,t??this.defaults)}parseMarkdown(e){return(s,i)=>{const r={...i},o={...this.defaults,...r},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const c=o.hooks?o.hooks.provideLexer():e?ys.lex:ys.lexInline,d=o.hooks?o.hooks.provideParser():e?Es.parse:Es.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(s):s).then(u=>c(u,o)).then(u=>o.hooks?o.hooks.processAllTokens(u):u).then(u=>o.walkTokens?Promise.all(this.walkTokens(u,o.walkTokens)).then(()=>u):u).then(u=>d(u,o)).then(u=>o.hooks?o.hooks.postprocess(u):u).catch(a);try{o.hooks&&(s=o.hooks.preprocess(s));let u=c(s,o);o.hooks&&(u=o.hooks.processAllTokens(u)),o.walkTokens&&this.walkTokens(u,o.walkTokens);let _=d(u,o);return o.hooks&&(_=o.hooks.postprocess(_)),_}catch(u){return a(u)}}}onError(e,t){return s=>{if(s.message+=` -Please report this to https://github.com/markedjs/marked.`,e){const i="

An error occurred:

"+ns(s.message+"",!0)+"
";return t?Promise.resolve(i):i}if(t)return Promise.reject(s);throw s}}}const go=new u2t;function Ut(n,e){return go.parse(n,e)}Ut.options=Ut.setOptions=function(n){return go.setOptions(n),Ut.defaults=go.defaults,DO(Ut.defaults),Ut};Ut.getDefaults=Ny;Ut.defaults=Eo;Ut.use=function(...n){return go.use(...n),Ut.defaults=go.defaults,DO(Ut.defaults),Ut};Ut.walkTokens=function(n,e){return go.walkTokens(n,e)};Ut.parseInline=go.parseInline;Ut.Parser=Es;Ut.parser=Es.parse;Ut.Renderer=wu;Ut.TextRenderer=Ly;Ut.Lexer=ys;Ut.lexer=ys.lex;Ut.Tokenizer=xu;Ut.Hooks=Pl;Ut.parse=Ut;Ut.options;Ut.setOptions;Ut.use;Ut.walkTokens;Ut.parseInline;Es.parse;ys.lex;const p2t={components:{AppCard:Iwt},data(){return{apps:[],githubApps:[],favorites:[],selectedCategory:"all",selectedApp:null,appCode:"",loading:!1,message:"",successMessage:!0,searchQuery:"",selectedFile:null,isUploading:!1,error:"",sortBy:"update",sortOrder:"desc",showOnlyInstalled:!1}},computed:{currentCategoryName(){return this.selectedCategory==="all"?"All Apps":this.selectedCategory},combinedApps(){this.apps.map(e=>e.name);const n=new Map(this.apps.map(e=>[e.name,{...e,installed:!0,existsInFolder:!0}]));return this.githubApps.forEach(e=>{n.has(e.name)||n.set(e.name,{...e,installed:!1,existsInFolder:!1})}),Array.from(n.values())},categories(){return[...new Set(this.combinedApps.map(n=>n.category))]},filteredApps(){return this.combinedApps.filter(n=>{const e=n.name.toLowerCase().includes(this.searchQuery.toLowerCase())||n.description.toLowerCase().includes(this.searchQuery.toLowerCase())||n.author.toLowerCase().includes(this.searchQuery.toLowerCase()),t=this.selectedCategory==="all"||n.category===this.selectedCategory,s=!this.showOnlyInstalled||n.installed;return e&&t&&s})},sortedAndFilteredApps(){return this.filteredApps.sort((n,e)=>{let t=0;switch(this.sortBy){case"name":t=n.name.localeCompare(e.name);break;case"author":t=n.author.localeCompare(e.author);break;case"date":t=new Date(n.creation_date)-new Date(e.creation_date);break;case"update":t=new Date(n.last_update_date)-new Date(e.last_update_date);break}return this.sortOrder==="asc"?t:-t})},favoriteApps(){return this.combinedApps.filter(n=>this.favorites.includes(n.uid))}},methods:{toggleSortOrder(){this.sortOrder=this.sortOrder==="asc"?"desc":"asc"},toggleFavorite(n){const e=this.favorites.indexOf(n);e===-1?this.favorites.push(n):this.favorites.splice(e,1),this.saveFavoritesToLocalStorage()},saveFavoritesToLocalStorage(){localStorage.setItem("appZooFavorites",JSON.stringify(this.favorites))},loadFavoritesFromLocalStorage(){const n=localStorage.getItem("appZooFavorites");console.log("savedFavorites",n),n&&(this.favorites=JSON.parse(n))},startServer(n){const e={client_id:this.$store.state.client_id,app_name:n};this.$store.state.messageBox.showBlockingMessage(`Loading server. -This may take some time the first time as some libraries need to be installed.`),Z.post("/apps/start_server",e).then(t=>{this.$store.state.messageBox.hideMessage(),console.log("Server start initiated:",t.data.message),this.$notify({type:"success",title:"Server Starting",text:t.data.message})}).catch(t=>{var s,i;this.$store.state.messageBox.hideMessage(),console.error("Error starting server:",t),this.$notify({type:"error",title:"Server Start Failed",text:((i=(s=t.response)==null?void 0:s.data)==null?void 0:i.detail)||"An error occurred while starting the server"})})},triggerFileInput(){this.$refs.fileInput.click()},onFileSelected(n){this.selectedFile=n.target.files[0],this.message="",this.error="",this.uploadApp()},async uploadApp(){var e,t;if(!this.selectedFile){this.error="Please select a file to upload.";return}this.isUploading=!0,this.message="",this.error="";const n=new FormData;n.append("file",this.selectedFile),n.append("client_id",this.$store.state.client_id);try{const s=await Z.post("/upload_app",n,{headers:{"Content-Type":"multipart/form-data"}});this.message=s.data.message,this.$refs.fileInput.value="",this.selectedFile=null}catch(s){console.error("Error uploading app:",s),this.error=((t=(e=s.response)==null?void 0:e.data)==null?void 0:t.detail)||"Failed to upload the app. Please try again."}finally{this.isUploading=!1}},async fetchApps(){this.loading=!0;try{const n=await Z.get("/apps");this.apps=n.data,this.showMessage("Refresh successful!",!0)}catch{this.showMessage("Failed to refresh apps.",!1)}finally{this.loading=!1}},async openAppsFolder(){this.loading=!0;try{console.log("opening apps folder");const n=await Z.post("/show_apps_folder",{client_id:this.$store.state.client_id})}catch{this.showMessage("Failed to open apps folder.",!1)}finally{this.loading=!1}},async fetchGithubApps(){this.loading=!0;try{const n=await Z.get("/github/apps");this.githubApps=n.data.apps,await this.fetchApps()}catch{this.showMessage("Failed to refresh GitHub apps.",!1)}finally{this.loading=!1}},async handleAppClick(n){if(n.installed){this.selectedApp=n;const e=await Z.get(`/apps/${n.folder_name}/README.md`);this.appCode=Ut(e.data)}else this.showMessage(`Please install ${n.folder_name} to view its code.`,!1)},backToZoo(){this.selectedApp=null,this.appCode=""},async installApp(n){this.loading=!0,this.$store.state.messageBox.showBlockingMessage(`Installing app ${n}`);try{await Z.post(`/install/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Installation succeeded!",!0)}catch{this.showMessage("Installation failed.",!1)}finally{this.loading=!1,this.fetchApps(),this.fetchGithubApps(),this.$store.state.messageBox.hideMessage()}},async uninstallApp(n){this.loading=!0;try{await Z.post(`/uninstall/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Uninstallation succeeded!",!0)}catch{this.showMessage("Uninstallation failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async deleteApp(n){this.loading=!0;try{await Z.post(`/delete/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Deletion succeeded!",!0)}catch{this.showMessage("Deletion failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async editApp(n){this.loading=!0;try{const e=await Z.post("/open_app_in_vscode",{client_id:this.$store.state.client_id,app_name:n.folder_name});this.showMessage(e.data.message,!0)}catch{this.showMessage("Failed to open folder in VSCode.",!1)}finally{this.loading=!1}},async downloadApp(n){this.isLoading=!0,this.error=null;try{const e=await Z.post("/download_app",{client_id:this.$store.state.client_id,app_name:n},{responseType:"arraybuffer"}),t=e.headers["content-disposition"],s=t&&t.match(/filename="?(.+)"?/i),i=s?s[1]:"app.zip",r=new Blob([e.data],{type:"application/zip"}),o=window.URL.createObjectURL(r),a=document.createElement("a");a.style.display="none",a.href=o,a.download=i,document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(o),document.body.removeChild(a)}catch(e){console.error("Error downloading app:",e),this.error="Failed to download the app. Please try again."}finally{this.isLoading=!1}},openApp(n){n.installed?window.open(`/apps/${n.folder_name}/index.html?client_id=${this.$store.state.client_id}`,"_blank"):this.showMessage(`Please install ${n.name} before opening.`,!1)},showMessage(n,e){this.message=n,this.successMessage=e,setTimeout(()=>{this.message=""},3e3)}},mounted(){this.fetchGithubApps(),this.loadFavoritesFromLocalStorage()}},f2t={class:"app-zoo background-color w-full p-6 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},_2t={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-50 pb-50"},m2t={class:"flex flex-wrap items-center justify-between gap-4"},h2t={class:"flex items-center space-x-4"},g2t=["disabled"],b2t={key:0},y2t={key:1,class:"error"},E2t={class:"relative flex-grow max-w-md"},v2t={class:"flex items-center space-x-4"},S2t=["value"],T2t={class:"flex items-center space-x-4"},x2t={for:"installed-only",class:"font-semibold"},C2t={class:"flex items-center space-x-4"},w2t={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},R2t={key:1},A2t={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-8"},N2t={class:"text-2xl font-bold mb-4"},M2t={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"},O2t={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},I2t={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},k2t={class:"flex justify-between items-center mb-4"},D2t={class:"text-2xl font-bold"},L2t=["srcdoc"],P2t={key:1,class:"text-center text-red-500"};function F2t(n,e,t,s,i,r){const o=et("app-card");return T(),w("div",f2t,[l("nav",_2t,[l("div",m2t,[l("div",h2t,[l("button",{onClick:e[0]||(e[0]=(...a)=>r.fetchGithubApps&&r.fetchGithubApps(...a)),class:"btn btn-primary","aria-label":"Refresh apps from GitHub"},e[10]||(e[10]=[l("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),Ze(" Refresh ")])),l("button",{onClick:e[1]||(e[1]=(...a)=>r.openAppsFolder&&r.openAppsFolder(...a)),class:"btn btn-secondary","aria-label":"Open apps folder"},e[11]||(e[11]=[l("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"})],-1),Ze(" Open Folder ")])),l("input",{type:"file",onChange:e[2]||(e[2]=(...a)=>r.onFileSelected&&r.onFileSelected(...a)),accept:".zip",ref:"fileInput",style:{display:"none"}},null,544),l("button",{onClick:e[3]||(e[3]=(...a)=>r.triggerFileInput&&r.triggerFileInput(...a)),disabled:i.isUploading,class:"btn-secondary text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Upload App"},W(i.isUploading?"Uploading...":"Upload App"),9,g2t)]),i.message?(T(),w("p",b2t,W(i.message),1)):B("",!0),i.error?(T(),w("p",y2t,W(i.error),1)):B("",!0),l("div",E2t,[D(l("input",{"onUpdate:modelValue":e[4]||(e[4]=a=>i.searchQuery=a),placeholder:"Search apps...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search apps"},null,512),[[ue,i.searchQuery]]),e[12]||(e[12]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",v2t,[e[14]||(e[14]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),D(l("select",{id:"category-select","onUpdate:modelValue":e[5]||(e[5]=a=>i.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[13]||(e[13]=l("option",{value:"all"},"All Categories",-1)),(T(!0),w(Be,null,Xe(r.categories,a=>(T(),w("option",{key:a,value:a},W(a),9,S2t))),128))],512),[[It,i.selectedCategory]])]),l("div",T2t,[l("label",x2t,[D(l("input",{id:"installed-only",type:"checkbox","onUpdate:modelValue":e[6]||(e[6]=a=>i.showOnlyInstalled=a),class:"mr-2"},null,512),[[Ye,i.showOnlyInstalled]]),e[15]||(e[15]=Ze(" Show only installed apps "))])]),l("div",C2t,[e[17]||(e[17]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),D(l("select",{id:"sort-select","onUpdate:modelValue":e[7]||(e[7]=a=>i.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[16]||(e[16]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[It,i.sortBy]]),l("button",{onClick:e[8]||(e[8]=(...a)=>r.toggleSortOrder&&r.toggleSortOrder(...a)),class:"btn btn-secondary"},W(i.sortOrder==="asc"?"↑":"↓"),1)])])]),i.loading?(T(),w("div",w2t,e[18]||(e[18]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),w("div",R2t,[e[19]||(e[19]=l("h2",{class:"text-2xl font-bold mb-4"},"Favorite Apps",-1)),l("div",A2t,[(T(!0),w(Be,null,Xe(r.favoriteApps,a=>(T(),at(o,{key:a.uid,app:a,onToggleFavorite:r.toggleFavorite,onInstall:r.installApp,onUninstall:r.uninstallApp,onDelete:r.deleteApp,onEdit:r.editApp,onDownload:r.downloadApp,onHelp:r.handleAppClick,onOpen:r.openApp,onStartServer:r.startServer},null,8,["app","onToggleFavorite","onInstall","onUninstall","onDelete","onEdit","onDownload","onHelp","onOpen","onStartServer"]))),128))]),l("h2",N2t,W(r.currentCategoryName)+" ("+W(r.sortedAndFilteredApps.length)+")",1),l("div",M2t,[(T(!0),w(Be,null,Xe(r.sortedAndFilteredApps,a=>(T(),at(o,{key:a.uid,app:a,onToggleFavorite:r.toggleFavorite,onInstall:r.installApp,onUninstall:r.uninstallApp,onDelete:r.deleteApp,onEdit:r.editApp,onDownload:r.downloadApp,onHelp:r.handleAppClick,onOpen:r.openApp,onStartServer:r.startServer},null,8,["app","onToggleFavorite","onInstall","onUninstall","onDelete","onEdit","onDownload","onHelp","onOpen","onStartServer"]))),128))])])),i.selectedApp?(T(),w("div",O2t,[l("div",I2t,[l("div",k2t,[l("h2",D2t,W(i.selectedApp.name),1),l("button",{onClick:e[9]||(e[9]=(...a)=>r.backToZoo&&r.backToZoo(...a)),class:"bg-gray-300 hover:bg-gray-400 px-4 py-2 rounded-lg transition duration-300 ease-in-out"},"Close")]),i.appCode?(T(),w("iframe",{key:0,srcdoc:i.appCode,class:"flex-grow border-none"},null,8,L2t)):(T(),w("p",P2t,"Please install this app to view its code."))])])):B("",!0),i.message?(T(),w("div",{key:3,class:Ue(["fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-md",{"bg-green-100 text-green-800":i.successMessage,"bg-red-100 text-red-800":!i.successMessage}])},W(i.message),3)):B("",!0)])}const U2t=it(p2t,[["render",F2t]]),B2t={components:{PersonalityEntry:Y0},data(){return{personalities:[],githubApps:[],favorites:[],selectedCategory:"all",selectedApp:null,appCode:"",loading:!1,message:"",successMessage:!0,searchQuery:"",selectedFile:null,isUploading:!1,error:"",sortBy:"name",sortOrder:"asc"}},computed:{currentCategoryName(){return this.selectedCategory=="all"?"All Personalities":this.selectedCategory},configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},combinedApps(){this.personalities.map(e=>e.name);const n=new Map(this.personalities.map(e=>[e.name,{...e,installed:!0,existsInFolder:!0}]));return this.githubApps.forEach(e=>{n.has(e.name)||n.set(e.name,{...e,installed:!1,existsInFolder:!1})}),Array.from(n.values())},categories(){return[...new Set(this.combinedApps.map(n=>n.category))].sort((n,e)=>n.localeCompare(e))},filteredApps(){return this.combinedApps.filter(n=>{const e=n.name.toLowerCase().includes(this.searchQuery.toLowerCase())||n.author.toLowerCase().includes(this.searchQuery.toLowerCase())||n.description.toLowerCase().includes(this.searchQuery.toLowerCase()),t=this.selectedCategory==="all"||n.category===this.selectedCategory;return e&&t})},sortedAndFilteredApps(){return this.filteredApps.sort((n,e)=>{let t=0;switch(this.sortBy){case"name":t=n.name.localeCompare(e.name);break;case"author":t=n.author.localeCompare(e.author);break;case"date":t=new Date(n.creation_date)-new Date(e.creation_date);break;case"update":t=new Date(n.last_update_date)-new Date(e.last_update_date);break}return this.sortOrder==="asc"?t:-t})},favoriteApps(){return this.combinedApps.filter(n=>this.favorites.includes(n.uid))}},methods:{async onPersonalitySelected(n){if(console.log("on pers",n),this.isLoading&&this.$store.state.toast.showToast("Loading... please wait",4,!1),this.isLoading=!0,console.log("selecting ",n),n){if(n.selected){this.$store.state.toast.showToast("Personality already selected",4,!0),this.isLoading=!1;return}let e=n.language==null?n.full_path:n.full_path+":"+n.language;if(console.log("pth",e),n.isMounted&&this.configFile.personalities.includes(e)){const t=await this.select_personality(n);console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this.$store.state.toast.showToast(`Selected personality: +Please report this to https://github.com/markedjs/marked.`,e){const i="

An error occurred:

"+ns(s.message+"",!0)+"
";return t?Promise.resolve(i):i}if(t)return Promise.reject(s);throw s}}}const go=new u2t;function Ut(n,e){return go.parse(n,e)}Ut.options=Ut.setOptions=function(n){return go.setOptions(n),Ut.defaults=go.defaults,DO(Ut.defaults),Ut};Ut.getDefaults=Ny;Ut.defaults=Eo;Ut.use=function(...n){return go.use(...n),Ut.defaults=go.defaults,DO(Ut.defaults),Ut};Ut.walkTokens=function(n,e){return go.walkTokens(n,e)};Ut.parseInline=go.parseInline;Ut.Parser=Es;Ut.parser=Es.parse;Ut.Renderer=wu;Ut.TextRenderer=Ly;Ut.Lexer=ys;Ut.lexer=ys.lex;Ut.Tokenizer=xu;Ut.Hooks=Pl;Ut.parse=Ut;Ut.options;Ut.setOptions;Ut.use;Ut.walkTokens;Ut.parseInline;Es.parse;ys.lex;const p2t={components:{AppCard:Iwt},data(){return{apps:[],githubApps:[],favorites:[],selectedCategory:"all",selectedApp:null,appCode:"",loading:!1,message:"",successMessage:!0,searchQuery:"",selectedFile:null,isUploading:!1,error:"",sortBy:"update",sortOrder:"desc",showOnlyInstalled:!1,showOnlyUnInstalled:!1}},computed:{currentCategoryName(){return this.selectedCategory==="all"?"All Apps":this.selectedCategory},combinedApps(){this.apps.map(e=>e.name);const n=new Map(this.apps.map(e=>[e.name,{...e,installed:!0,existsInFolder:!0}]));return this.githubApps.forEach(e=>{n.has(e.name)||n.set(e.name,{...e,installed:!1,existsInFolder:!1})}),Array.from(n.values())},categories(){return[...new Set(this.combinedApps.map(n=>n.category))]},filteredApps(){return this.combinedApps.filter(n=>{const e=n.name.toLowerCase().includes(this.searchQuery.toLowerCase())||n.description.toLowerCase().includes(this.searchQuery.toLowerCase())||n.author.toLowerCase().includes(this.searchQuery.toLowerCase()),t=this.selectedCategory==="all"||n.category===this.selectedCategory,s=this.showOnlyInstalled&&n.installed||this.showOnlyUnInstalled&&!n.installed||!this.showOnlyInstalled&&!this.showOnlyUnInstalled;return e&&t&&s})},sortedAndFilteredApps(){return this.filteredApps.sort((n,e)=>{let t=0;switch(this.sortBy){case"name":t=n.name.localeCompare(e.name);break;case"author":t=n.author.localeCompare(e.author);break;case"date":t=new Date(n.creation_date)-new Date(e.creation_date);break;case"update":t=new Date(n.last_update_date)-new Date(e.last_update_date);break}return this.sortOrder==="asc"?t:-t})},favoriteApps(){return this.combinedApps.filter(n=>this.favorites.includes(n.uid))}},methods:{toggleSortOrder(){this.sortOrder=this.sortOrder==="asc"?"desc":"asc"},toggleFavorite(n){const e=this.favorites.indexOf(n);e===-1?this.favorites.push(n):this.favorites.splice(e,1),this.saveFavoritesToLocalStorage()},saveFavoritesToLocalStorage(){localStorage.setItem("appZooFavorites",JSON.stringify(this.favorites))},loadFavoritesFromLocalStorage(){const n=localStorage.getItem("appZooFavorites");console.log("savedFavorites",n),n&&(this.favorites=JSON.parse(n))},startServer(n){const e={client_id:this.$store.state.client_id,app_name:n};this.$store.state.messageBox.showBlockingMessage(`Loading server. +This may take some time the first time as some libraries need to be installed.`),Z.post("/apps/start_server",e).then(t=>{this.$store.state.messageBox.hideMessage(),console.log("Server start initiated:",t.data.message),this.$notify({type:"success",title:"Server Starting",text:t.data.message})}).catch(t=>{var s,i;this.$store.state.messageBox.hideMessage(),console.error("Error starting server:",t),this.$notify({type:"error",title:"Server Start Failed",text:((i=(s=t.response)==null?void 0:s.data)==null?void 0:i.detail)||"An error occurred while starting the server"})})},triggerFileInput(){this.$refs.fileInput.click()},onFileSelected(n){this.selectedFile=n.target.files[0],this.message="",this.error="",this.uploadApp()},async uploadApp(){var e,t;if(!this.selectedFile){this.error="Please select a file to upload.";return}this.isUploading=!0,this.message="",this.error="";const n=new FormData;n.append("file",this.selectedFile),n.append("client_id",this.$store.state.client_id);try{const s=await Z.post("/upload_app",n,{headers:{"Content-Type":"multipart/form-data"}});this.message=s.data.message,this.$refs.fileInput.value="",this.selectedFile=null}catch(s){console.error("Error uploading app:",s),this.error=((t=(e=s.response)==null?void 0:e.data)==null?void 0:t.detail)||"Failed to upload the app. Please try again."}finally{this.isUploading=!1}},async fetchApps(){this.loading=!0;try{const n=await Z.get("/apps");this.apps=n.data,this.showMessage("Refresh successful!",!0)}catch{this.showMessage("Failed to refresh apps.",!1)}finally{this.loading=!1}},async openAppsFolder(){this.loading=!0;try{console.log("opening apps folder");const n=await Z.post("/show_apps_folder",{client_id:this.$store.state.client_id})}catch{this.showMessage("Failed to open apps folder.",!1)}finally{this.loading=!1}},async fetchGithubApps(){this.loading=!0;try{const n=await Z.get("/github/apps");this.githubApps=n.data.apps,await this.fetchApps()}catch{this.showMessage("Failed to refresh GitHub apps.",!1)}finally{this.loading=!1}},async handleAppClick(n){if(n.installed){this.selectedApp=n;const e=await Z.get(`/apps/${n.folder_name}/README.md`);this.appCode=Ut(e.data)}else this.showMessage(`Please install ${n.folder_name} to view its code.`,!1)},backToZoo(){this.selectedApp=null,this.appCode=""},async installApp(n){this.loading=!0,this.$store.state.messageBox.showBlockingMessage(`Installing app ${n}`);try{await Z.post(`/install/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Installation succeeded!",!0)}catch{this.showMessage("Installation failed.",!1)}finally{this.loading=!1,this.fetchApps(),this.fetchGithubApps(),this.$store.state.messageBox.hideMessage()}},async uninstallApp(n){this.loading=!0;try{await Z.post(`/uninstall/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Uninstallation succeeded!",!0)}catch{this.showMessage("Uninstallation failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async deleteApp(n){this.loading=!0;try{await Z.post(`/delete/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Deletion succeeded!",!0)}catch{this.showMessage("Deletion failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async editApp(n){this.loading=!0;try{const e=await Z.post("/open_app_in_vscode",{client_id:this.$store.state.client_id,app_name:n.folder_name});this.showMessage(e.data.message,!0)}catch{this.showMessage("Failed to open folder in VSCode.",!1)}finally{this.loading=!1}},async downloadApp(n){this.isLoading=!0,this.error=null;try{const e=await Z.post("/download_app",{client_id:this.$store.state.client_id,app_name:n},{responseType:"arraybuffer"}),t=e.headers["content-disposition"],s=t&&t.match(/filename="?(.+)"?/i),i=s?s[1]:"app.zip",r=new Blob([e.data],{type:"application/zip"}),o=window.URL.createObjectURL(r),a=document.createElement("a");a.style.display="none",a.href=o,a.download=i,document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(o),document.body.removeChild(a)}catch(e){console.error("Error downloading app:",e),this.error="Failed to download the app. Please try again."}finally{this.isLoading=!1}},openApp(n){n.installed?window.open(`/apps/${n.folder_name}/index.html?client_id=${this.$store.state.client_id}`,"_blank"):this.showMessage(`Please install ${n.name} before opening.`,!1)},showMessage(n,e){this.message=n,this.successMessage=e,setTimeout(()=>{this.message=""},3e3)}},mounted(){this.fetchGithubApps(),this.loadFavoritesFromLocalStorage()}},f2t={class:"app-zoo background-color w-full p-6 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},_2t={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-50 pb-50"},m2t={class:"flex flex-wrap items-center justify-between gap-4"},h2t={class:"flex items-center space-x-4"},g2t=["disabled"],b2t={key:0},y2t={key:1,class:"error"},E2t={class:"relative flex-grow max-w-md"},v2t={class:"flex items-center space-x-4"},S2t=["value"],T2t={class:"flex items-center space-x-4"},x2t={for:"installed-only",class:"font-semibold"},C2t={for:"installed-only",class:"font-semibold"},w2t={class:"flex items-center space-x-4"},R2t={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},A2t={key:1},N2t={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-8"},M2t={class:"text-2xl font-bold mb-4"},O2t={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"},I2t={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},k2t={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},D2t={class:"flex justify-between items-center mb-4"},L2t={class:"text-2xl font-bold"},P2t=["srcdoc"],F2t={key:1,class:"text-center text-red-500"};function U2t(n,e,t,s,i,r){const o=et("app-card");return T(),w("div",f2t,[l("nav",_2t,[l("div",m2t,[l("div",h2t,[l("button",{onClick:e[0]||(e[0]=(...a)=>r.fetchGithubApps&&r.fetchGithubApps(...a)),class:"btn btn-primary","aria-label":"Refresh apps from GitHub"},e[11]||(e[11]=[l("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),Ze(" Refresh ")])),l("button",{onClick:e[1]||(e[1]=(...a)=>r.openAppsFolder&&r.openAppsFolder(...a)),class:"btn btn-secondary","aria-label":"Open apps folder"},e[12]||(e[12]=[l("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"})],-1),Ze(" Open Folder ")])),l("input",{type:"file",onChange:e[2]||(e[2]=(...a)=>r.onFileSelected&&r.onFileSelected(...a)),accept:".zip",ref:"fileInput",style:{display:"none"}},null,544),l("button",{onClick:e[3]||(e[3]=(...a)=>r.triggerFileInput&&r.triggerFileInput(...a)),disabled:i.isUploading,class:"btn-secondary text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Upload App"},W(i.isUploading?"Uploading...":"Upload App"),9,g2t)]),i.message?(T(),w("p",b2t,W(i.message),1)):B("",!0),i.error?(T(),w("p",y2t,W(i.error),1)):B("",!0),l("div",E2t,[D(l("input",{"onUpdate:modelValue":e[4]||(e[4]=a=>i.searchQuery=a),placeholder:"Search apps...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search apps"},null,512),[[ue,i.searchQuery]]),e[13]||(e[13]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",v2t,[e[15]||(e[15]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),D(l("select",{id:"category-select","onUpdate:modelValue":e[5]||(e[5]=a=>i.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[14]||(e[14]=l("option",{value:"all"},"All Categories",-1)),(T(!0),w(Be,null,Xe(r.categories,a=>(T(),w("option",{key:a,value:a},W(a),9,S2t))),128))],512),[[It,i.selectedCategory]])]),l("div",T2t,[l("label",x2t,[D(l("input",{id:"installed-only",type:"checkbox","onUpdate:modelValue":e[6]||(e[6]=a=>i.showOnlyInstalled=a),class:"mr-2"},null,512),[[qe,i.showOnlyInstalled]]),e[16]||(e[16]=Ze(" Show only installed apps "))]),l("label",C2t,[D(l("input",{id:"uninstalled-only",type:"checkbox","onUpdate:modelValue":e[7]||(e[7]=a=>i.showOnlyUnInstalled=a),class:"mr-2"},null,512),[[qe,i.showOnlyUnInstalled]]),e[17]||(e[17]=Ze(" Show only non installed apps "))])]),l("div",w2t,[e[19]||(e[19]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),D(l("select",{id:"sort-select","onUpdate:modelValue":e[8]||(e[8]=a=>i.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[18]||(e[18]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[It,i.sortBy]]),l("button",{onClick:e[9]||(e[9]=(...a)=>r.toggleSortOrder&&r.toggleSortOrder(...a)),class:"btn btn-secondary"},W(i.sortOrder==="asc"?"↑":"↓"),1)])])]),i.loading?(T(),w("div",R2t,e[20]||(e[20]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),w("div",A2t,[e[21]||(e[21]=l("h2",{class:"text-2xl font-bold mb-4"},"Favorite Apps",-1)),l("div",N2t,[(T(!0),w(Be,null,Xe(r.favoriteApps,a=>(T(),at(o,{key:a.uid,app:a,onToggleFavorite:r.toggleFavorite,onInstall:r.installApp,onUninstall:r.uninstallApp,onDelete:r.deleteApp,onEdit:r.editApp,onDownload:r.downloadApp,onHelp:r.handleAppClick,onOpen:r.openApp,onStartServer:r.startServer},null,8,["app","onToggleFavorite","onInstall","onUninstall","onDelete","onEdit","onDownload","onHelp","onOpen","onStartServer"]))),128))]),l("h2",M2t,W(r.currentCategoryName)+" ("+W(r.sortedAndFilteredApps.length)+")",1),l("div",O2t,[(T(!0),w(Be,null,Xe(r.sortedAndFilteredApps,a=>(T(),at(o,{key:a.uid,app:a,onToggleFavorite:r.toggleFavorite,onInstall:r.installApp,onUninstall:r.uninstallApp,onDelete:r.deleteApp,onEdit:r.editApp,onDownload:r.downloadApp,onHelp:r.handleAppClick,onOpen:r.openApp,onStartServer:r.startServer},null,8,["app","onToggleFavorite","onInstall","onUninstall","onDelete","onEdit","onDownload","onHelp","onOpen","onStartServer"]))),128))])])),i.selectedApp?(T(),w("div",I2t,[l("div",k2t,[l("div",D2t,[l("h2",L2t,W(i.selectedApp.name),1),l("button",{onClick:e[10]||(e[10]=(...a)=>r.backToZoo&&r.backToZoo(...a)),class:"bg-gray-300 hover:bg-gray-400 px-4 py-2 rounded-lg transition duration-300 ease-in-out"},"Close")]),i.appCode?(T(),w("iframe",{key:0,srcdoc:i.appCode,class:"flex-grow border-none"},null,8,P2t)):(T(),w("p",F2t,"Please install this app to view its code."))])])):B("",!0),i.message?(T(),w("div",{key:3,class:Ue(["fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-md",{"bg-green-100 text-green-800":i.successMessage,"bg-red-100 text-red-800":!i.successMessage}])},W(i.message),3)):B("",!0)])}const B2t=it(p2t,[["render",U2t]]),G2t={components:{PersonalityEntry:Y0},data(){return{personalities:[],githubApps:[],favorites:[],selectedCategory:"all",selectedApp:null,appCode:"",loading:!1,message:"",successMessage:!0,searchQuery:"",selectedFile:null,isUploading:!1,error:"",sortBy:"name",sortOrder:"asc"}},computed:{currentCategoryName(){return this.selectedCategory=="all"?"All Personalities":this.selectedCategory},configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},combinedApps(){this.personalities.map(e=>e.name);const n=new Map(this.personalities.map(e=>[e.name,{...e,installed:!0,existsInFolder:!0}]));return this.githubApps.forEach(e=>{n.has(e.name)||n.set(e.name,{...e,installed:!1,existsInFolder:!1})}),Array.from(n.values())},categories(){return[...new Set(this.combinedApps.map(n=>n.category))].sort((n,e)=>n.localeCompare(e))},filteredApps(){return this.combinedApps.filter(n=>{const e=n.name.toLowerCase().includes(this.searchQuery.toLowerCase())||n.author.toLowerCase().includes(this.searchQuery.toLowerCase())||n.description.toLowerCase().includes(this.searchQuery.toLowerCase()),t=this.selectedCategory==="all"||n.category===this.selectedCategory;return e&&t})},sortedAndFilteredApps(){return this.filteredApps.sort((n,e)=>{let t=0;switch(this.sortBy){case"name":t=n.name.localeCompare(e.name);break;case"author":t=n.author.localeCompare(e.author);break;case"date":t=new Date(n.creation_date)-new Date(e.creation_date);break;case"update":t=new Date(n.last_update_date)-new Date(e.last_update_date);break}return this.sortOrder==="asc"?t:-t})},favoriteApps(){return this.combinedApps.filter(n=>this.favorites.includes(n.uid))}},methods:{async onPersonalitySelected(n){if(console.log("on pers",n),this.isLoading&&this.$store.state.toast.showToast("Loading... please wait",4,!1),this.isLoading=!0,console.log("selecting ",n),n){if(n.selected){this.$store.state.toast.showToast("Personality already selected",4,!0),this.isLoading=!1;return}let e=n.language==null?n.full_path:n.full_path+":"+n.language;if(console.log("pth",e),n.isMounted&&this.configFile.personalities.includes(e)){const t=await this.select_personality(n);console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this.$store.state.toast.showToast(`Selected personality: `+n.name,4,!0):this.$store.state.toast.showToast(`Error on select personality: `+n.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.mountPersonality(n);Le(()=>{feather.replace()})}},onModelSelected(n){if(this.isLoading){this.$store.state.toast.showToast("Loading... please wait",4,!1);return}n&&(n.isInstalled?this.update_model(n.model.name).then(e=>{console.log("update_model",e),this.configFile.model_name=n.model.name,e.status?(this.$store.state.toast.showToast(`Selected model: `+n.name,4,!0),Le(()=>{feather.replace(),this.is_loading_zoo=!1}),this.updateModelsZoo(),this.api_get_req("get_model_status").then(t=>{this.$store.commit("setIsModelOk",t)})):(this.$store.state.toast.showToast(`Couldn't select model: @@ -3993,4 +3993,4 @@ You have the freedom to give, sell, or keep the personas you create for yourself The possibilities are endless, they are now yours to mold and customize as you see fit.`),this.$store.dispatch("refreshPersonalitiesZoo")):this.$store.state.toast.showToast(`Personality couldn't be copied to the custom personalities folder: Verify that the personality is not already copied there.`,4,!1)}).catch(e=>{this.$store.state.toast.showToast(`Personality couldn't be copied to the custom personalities folder: `,4,!1),console.error(e)})},async remountPersonality(n){await this.unmountPersonality(n),await this.mountPersonality(n)},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log("Personality path:",n.personality.path),Z.post("/reinstall_personality",{client_id:this.$store.state.client_id,name:n.personality.path},{headers:this.posts_headers}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$store.state.toast.showToast("Personality reinstalled successfully!",4,!0):this.$store.state.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$store.state.toast.showToast(`Could not reinstall personality -`+e.message,4,!1),{status:!1}))},async handleOpenFolder(n){await Z.post("/open_personality_folder",{client_id:this.$store.state.client_id,personality_folder:n.personality.folder})},showMessage(n,e){this.message=n,this.successMessage=e,setTimeout(()=>{this.message=""},3e3)},loadPersonalities(){this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},mounted(){this.loadFavoritesFromLocalStorage(),this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},G2t={class:"app-zoo mb-100 pb-100 background-color w-full p-6 overflow-y-auto h-screen scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},V2t={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-8"},z2t={class:"flex flex-wrap items-center justify-between gap-4"},H2t={key:0},q2t={key:1,class:"error"},Y2t={class:"relative flex-grow max-w-md"},$2t={class:"flex items-center space-x-4"},W2t=["value"],K2t={class:"flex items-center space-x-4"},j2t={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},Q2t={key:1},X2t={class:"container mx-auto px-4 flex flex-column pb-20"},Z2t={key:0},J2t={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},eRt={class:"container mx-auto px-4 flex flex-column pb-20"},tRt={class:"text-2xl font-bold my-8"},nRt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},sRt={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 overflow-y-auto"},iRt={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},rRt={class:"flex justify-between items-center mb-4"},oRt={class:"text-2xl font-bold"},aRt=["srcdoc"],lRt={key:1,class:"text-center text-red-500"};function cRt(n,e,t,s,i,r){const o=et("personality-entry");return T(),w("div",G2t,[l("nav",V2t,[l("div",z2t,[i.message?(T(),w("p",H2t,W(i.message),1)):B("",!0),i.error?(T(),w("p",q2t,W(i.error),1)):B("",!0),l("div",Y2t,[D(l("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>i.searchQuery=a),placeholder:"Search personalities...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search personalities"},null,512),[[ue,i.searchQuery]]),e[5]||(e[5]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",$2t,[e[7]||(e[7]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),D(l("select",{id:"category-select","onUpdate:modelValue":e[1]||(e[1]=a=>i.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[6]||(e[6]=l("option",{value:"all"},"All Categories",-1)),(T(!0),w(Be,null,Xe(r.categories,a=>(T(),w("option",{key:a,value:a},W(a),9,W2t))),128))],512),[[It,i.selectedCategory]])]),l("div",K2t,[e[9]||(e[9]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),D(l("select",{id:"sort-select","onUpdate:modelValue":e[2]||(e[2]=a=>i.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[8]||(e[8]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[It,i.sortBy]]),l("button",{onClick:e[3]||(e[3]=(...a)=>r.toggleSortOrder&&r.toggleSortOrder(...a)),class:"btn btn-secondary"},W(i.sortOrder==="asc"?"↑":"↓"),1)])])]),i.loading?(T(),w("div",j2t,e[10]||(e[10]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),w("div",Q2t,[l("div",X2t,[r.favoriteApps.length>0&&!i.searchQuery?(T(),w("div",Z2t,[e[11]||(e[11]=l("h2",{class:"text-2xl font-bold my-8"},"Favorite Apps",-1)),l("div",J2t,[(T(!0),w(Be,null,Xe(r.favoriteApps,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":r.handleOpenFolder,"on-toggle-favorite":r.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","on-toggle-favorite"]))),128))])])):B("",!0)]),l("div",eRt,[l("h2",tRt,W(r.currentCategoryName)+" ("+W(r.sortedAndFilteredApps.length)+")",1),l("div",nRt,[(T(!0),w(Be,null,Xe(r.sortedAndFilteredApps,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":r.handleOpenFolder,"toggle-favorite":r.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","toggle-favorite"]))),128))])])])),i.selectedApp?(T(),w("div",sRt,[l("div",iRt,[l("div",rRt,[l("h2",oRt,W(i.selectedApp.name),1),l("button",{onClick:e[4]||(e[4]=(...a)=>n.backToZoo&&n.backToZoo(...a)),class:"bg-gray-300 hover:bg-gray-400 px-4 py-2 rounded-lg transition duration-300 ease-in-out"},"Close")]),i.appCode?(T(),w("iframe",{key:0,srcdoc:i.appCode,class:"flex-grow border-none"},null,8,aRt)):(T(),w("p",lRt,"Please install this app to view its code."))])])):B("",!0),i.message?(T(),w("div",{key:3,class:Ue(["fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-md",{"bg-green-100 text-green-800":i.successMessage,"bg-red-100 text-red-800":!i.successMessage}])},W(i.message),3)):B("",!0),e[12]||(e[12]=l("div",{class:"h-20"},null,-1))])}const dRt=it(B2t,[["render",cRt],["__scopeId","data-v-4e49bb35"]]),uRt=$3({history:x3("/"),routes:[{path:"/apps_view/",name:"AppsZoo",component:U2t},{path:"/personalities_view/",name:"PersonalitiesZoo",component:dRt},{path:"/auto_sd_view/",name:"AutoSD",component:dwt},{path:"/comfyui_view/",name:"ComfyUI",component:rwt},{path:"/playground/",name:"playground",component:jet},{path:"/extensions/",name:"extensions",component:itt},{path:"/help_view/",name:"help_view",component:ltt},{path:"/settings/",name:"settings",component:eut},{path:"/training/",name:"training",component:fut},{path:"/quantizing/",name:"quantizing",component:yut},{path:"/",name:"discussions",component:tht},{path:"/interactive/",name:"interactive",component:l1t},{path:"/nodes/",name:"nodes",component:ewt}]}),xp=GD(MXe);function pRt(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const Ds=fL({state(){return{is_rt_on:!1,language:"english",languages:[],currentTheme:"",personality_editor:null,showPersonalityEditor:!1,selectedPersonality:null,currentPersonConfig:{ai_name:"",ai_author:"",ai_category:"",ai_language:"",ai_description:"",ai_conditionning:"",ai_disclaimer:"",ai_icon:null},posts_headers:{accept:"application/json","Content-Type":"application/json"},client_id:"",yesNoDialog:null,universalForm:null,toast:null,news:null,messageBox:null,api_get_req:null,api_post_req:null,startSpeechRecognition:null,ready:!1,loading_infos:"",loading_progress:0,version:"unknown",settingsChanged:!1,isConnected:!1,isModelOk:!1,isGenerating:!1,config:null,mountedPers:null,mountedPersArr:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],installedBindings:[],currentModel:null,currentBinding:null,databases:[]}},mutations:{setisRTOn(n,e){n.is_rt_on=e},setLanguages(n,e){n.languages=e},setLanguage(n,e){n.language=e},setIsReady(n,e){n.ready=e},setIsConnected(n,e){n.isConnected=e},setIsModelOk(n,e){n.isModelOk=e},setIsGenerating(n,e){n.isGenerating=e},setConfig(n,e){n.config=e},setPersonalities(n,e){n.personalities=e},setMountedPers(n,e){n.mountedPers=e},setMountedPersArr(n,e){n.mountedPersArr=e},setbindingsZoo(n,e){n.bindingsZoo=e},setModelsArr(n,e){n.modelsArr=e},setselectedModel(n,e){n.selectedModel=e},setDiskUsage(n,e){n.diskUsage=e},setRamUsage(n,e){n.ramUsage=e},setVramUsage(n,e){n.vramUsage=e},setModelsZoo(n,e){n.modelsZoo=e},setCurrentBinding(n,e){n.currentBinding=e},setCurrentModel(n,e){n.currentModel=e},setDatabases(n,e){n.databases=e},setTheme(n){this.currentTheme=n}},getters:{getisRTOn(n){return n.is_rt_on},getLanguages(n){return n.languages},getLanguage(n){return n.language},getIsConnected(n){return n.isConnected},getIsModelOk(n){return n.isModelOk},getIsGenerating(n){return n.isGenerating},getConfig(n){return n.config},getPersonalities(n){return n.personalities},getMountedPersArr(n){return n.mountedPersArr},getMountedPers(n){return n.mountedPers},getbindingsZoo(n){return n.bindingsZoo},getModelsArr(n){return n.modelsArr},getDiskUsage(n){return n.diskUsage},getRamUsage(n){return n.ramUsage},getVramUsage(n){return n.vramUsage},getDatabasesList(n){return n.databases},getModelsZoo(n){return n.modelsZoo},getCyrrentBinding(n){return n.currentBinding},getCurrentModel(n){return n.currentModel}},actions:{async getVersion(){try{let n=await Z.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data)}catch{console.error("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{console.log("Fetching configuration with client id: ",this.state.client_id);const e=await qO("get_config",this.state.client_id);e.active_personality_id<0&&(e.active_personality_id=0);let t=e.personalities[e.active_personality_id].split("/");e.personality_category=t[0],e.personality_folder=t[1],console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),n("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:n}){let e=await Ks("list_databases");console.log("databases:",e),n("setDatabases",e)},async fetchisRTOn({commit:n}){const t=(await Z.get("/is_rt_on")).data.status;n("setisRTOn",t)},async fetchLanguages({commit:n}){console.log("get_personality_languages_list",this.state.client_id);const e=await Z.post("/get_personality_languages_list",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("languages",t),n("setLanguages",t)},async fetchLanguage({commit:n}){console.log("get_personality_language",this.state.client_id);const e=await Z.post("/get_personality_language",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("language",t),n("setLanguage",t)},async changeLanguage({commit:n},e){console.log("Changing language to ",e);let t=await Z.post("/set_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await Z.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await Z.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const i=t.data;console.log("language",i),n("setLanguage",i),console.log("Language changed successfully:",t.data.message)},async deleteLanguage({commit:n},e){console.log("Deleting ",e);let t=await Z.post("/del_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await Z.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await Z.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const i=t.data;console.log("language",i),n("setLanguage",i),console.log("Language changed successfully:",t.data.message)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await Ks("get_all_personalities"),s=Object.keys(t);console.log("Personalities recovered:"+this.state.config.personalities);for(let i=0;i{let d=!1;for(const _ of this.state.config.personalities)if(_.includes(r+"/"+c.folder))if(d=!0,_.includes(":")){const m=_.split(":");c.language=m[1]}else c.language=null;let u={};return u=c,u.category=r,u.full_path=r+"/"+c.folder,u.isMounted=d,u});e.length==0?e=a:e=e.concat(a)}e.sort((i,r)=>i.name.localeCompare(r.name)),n("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:n}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const t=[];for(let s=0;sa.full_path==i||a.full_path==r[0]);if(o>=0){let a=pRt(this.state.personalities[o]);r.length>1&&(a.language=r[1]),a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(c=>c.full_path=="generic/lollms")])}else t.push(s),console.log("Couldn't load personality : ",i)}for(let s=t.length-1;s>=0;s--)console.log("Removing personality : ",this.state.config.personalities[t[s]]),this.state.config.personalities.splice(t[s],1),this.state.config.active_personality_id>t[s]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(s=>s.full_path==this.state.config.personalities[this.state.config.active_personality_id]||s.full_path+":"+s.language==this.state.config.personalities[this.state.config.active_personality_id])]},async refreshBindings({commit:n}){let e=await Ks("list_bindings");console.log("Loaded bindings zoo :",e),this.state.installedBindings=e.filter(s=>s.installed),console.log("Loaded bindings zoo ",this.state.installedBindings),n("setbindingsZoo",e);const t=e.findIndex(s=>s.name==this.state.config.binding_name);t!=-1&&n("setCurrentBinding",e[t])},async refreshModelsZoo({commit:n}){console.log("Fetching models");const t=(await Z.get("/get_available_models")).data.filter(s=>s.variants&&s.variants.length>0);console.log(`get_available_models: ${t}`),n("setModelsZoo",t)},async refreshModelStatus({commit:n}){let e=await Ks("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){console.log("Fetching models");let e=await Ks("list_models");console.log(`Found ${e}`);let t=await Ks("get_active_model");console.log("Selected model ",t),t!=null&&n("setselectedModel",t.model),n("setModelsArr",e),console.log("setModelsArr",e),console.log("this.state.modelsZoo",this.state.modelsZoo),this.state.modelsZoo.map(i=>{i.isInstalled=e.includes(i.name)}),this.state.installedModels=this.state.modelsZoo.filter(i=>i.isInstalled);const s=this.state.modelsZoo.findIndex(i=>i.name==this.state.config.model_name);s!=-1&&n("setCurrentModel",this.state.modelsZoo[s])},async refreshDiskUsage({commit:n}){this.state.diskUsage=await Ks("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await Ks("ram_usage")},async refreshVramUsage({commit:n}){const e=await Ks("vram_usage"),t=[];if(e.nb_gpus>0){for(let i=0;i{this.message=""},3e3)},loadPersonalities(){this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},mounted(){this.loadFavoritesFromLocalStorage(),this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},V2t={class:"app-zoo mb-100 pb-100 background-color w-full p-6 overflow-y-auto h-screen scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},z2t={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-8"},H2t={class:"flex flex-wrap items-center justify-between gap-4"},q2t={key:0},Y2t={key:1,class:"error"},$2t={class:"relative flex-grow max-w-md"},W2t={class:"flex items-center space-x-4"},K2t=["value"],j2t={class:"flex items-center space-x-4"},Q2t={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},X2t={key:1},Z2t={class:"container mx-auto px-4 flex flex-column pb-20"},J2t={key:0},eRt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},tRt={class:"container mx-auto px-4 flex flex-column pb-20"},nRt={class:"text-2xl font-bold my-8"},sRt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},iRt={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 overflow-y-auto"},rRt={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},oRt={class:"flex justify-between items-center mb-4"},aRt={class:"text-2xl font-bold"},lRt=["srcdoc"],cRt={key:1,class:"text-center text-red-500"};function dRt(n,e,t,s,i,r){const o=et("personality-entry");return T(),w("div",V2t,[l("nav",z2t,[l("div",H2t,[i.message?(T(),w("p",q2t,W(i.message),1)):B("",!0),i.error?(T(),w("p",Y2t,W(i.error),1)):B("",!0),l("div",$2t,[D(l("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>i.searchQuery=a),placeholder:"Search personalities...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search personalities"},null,512),[[ue,i.searchQuery]]),e[5]||(e[5]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",W2t,[e[7]||(e[7]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),D(l("select",{id:"category-select","onUpdate:modelValue":e[1]||(e[1]=a=>i.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[6]||(e[6]=l("option",{value:"all"},"All Categories",-1)),(T(!0),w(Be,null,Xe(r.categories,a=>(T(),w("option",{key:a,value:a},W(a),9,K2t))),128))],512),[[It,i.selectedCategory]])]),l("div",j2t,[e[9]||(e[9]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),D(l("select",{id:"sort-select","onUpdate:modelValue":e[2]||(e[2]=a=>i.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[8]||(e[8]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[It,i.sortBy]]),l("button",{onClick:e[3]||(e[3]=(...a)=>r.toggleSortOrder&&r.toggleSortOrder(...a)),class:"btn btn-secondary"},W(i.sortOrder==="asc"?"↑":"↓"),1)])])]),i.loading?(T(),w("div",Q2t,e[10]||(e[10]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),w("div",X2t,[l("div",Z2t,[r.favoriteApps.length>0&&!i.searchQuery?(T(),w("div",J2t,[e[11]||(e[11]=l("h2",{class:"text-2xl font-bold my-8"},"Favorite Apps",-1)),l("div",eRt,[(T(!0),w(Be,null,Xe(r.favoriteApps,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":r.handleOpenFolder,"on-toggle-favorite":r.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","on-toggle-favorite"]))),128))])])):B("",!0)]),l("div",tRt,[l("h2",nRt,W(r.currentCategoryName)+" ("+W(r.sortedAndFilteredApps.length)+")",1),l("div",sRt,[(T(!0),w(Be,null,Xe(r.sortedAndFilteredApps,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":r.handleOpenFolder,"toggle-favorite":r.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","toggle-favorite"]))),128))])])])),i.selectedApp?(T(),w("div",iRt,[l("div",rRt,[l("div",oRt,[l("h2",aRt,W(i.selectedApp.name),1),l("button",{onClick:e[4]||(e[4]=(...a)=>n.backToZoo&&n.backToZoo(...a)),class:"bg-gray-300 hover:bg-gray-400 px-4 py-2 rounded-lg transition duration-300 ease-in-out"},"Close")]),i.appCode?(T(),w("iframe",{key:0,srcdoc:i.appCode,class:"flex-grow border-none"},null,8,lRt)):(T(),w("p",cRt,"Please install this app to view its code."))])])):B("",!0),i.message?(T(),w("div",{key:3,class:Ue(["fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-md",{"bg-green-100 text-green-800":i.successMessage,"bg-red-100 text-red-800":!i.successMessage}])},W(i.message),3)):B("",!0),e[12]||(e[12]=l("div",{class:"h-20"},null,-1))])}const uRt=it(G2t,[["render",dRt],["__scopeId","data-v-4e49bb35"]]),pRt=$3({history:x3("/"),routes:[{path:"/apps_view/",name:"AppsZoo",component:B2t},{path:"/personalities_view/",name:"PersonalitiesZoo",component:uRt},{path:"/auto_sd_view/",name:"AutoSD",component:dwt},{path:"/comfyui_view/",name:"ComfyUI",component:rwt},{path:"/playground/",name:"playground",component:jet},{path:"/extensions/",name:"extensions",component:itt},{path:"/help_view/",name:"help_view",component:ltt},{path:"/settings/",name:"settings",component:eut},{path:"/training/",name:"training",component:fut},{path:"/quantizing/",name:"quantizing",component:yut},{path:"/",name:"discussions",component:tht},{path:"/interactive/",name:"interactive",component:l1t},{path:"/nodes/",name:"nodes",component:ewt}]}),xp=GD(MXe);function fRt(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const Ds=fL({state(){return{is_rt_on:!1,language:"english",languages:[],currentTheme:"",personality_editor:null,showPersonalityEditor:!1,selectedPersonality:null,currentPersonConfig:{ai_name:"",ai_author:"",ai_category:"",ai_language:"",ai_description:"",ai_conditionning:"",ai_disclaimer:"",ai_icon:null},posts_headers:{accept:"application/json","Content-Type":"application/json"},client_id:"",yesNoDialog:null,universalForm:null,toast:null,news:null,messageBox:null,api_get_req:null,api_post_req:null,startSpeechRecognition:null,ready:!1,loading_infos:"",loading_progress:0,version:"unknown",settingsChanged:!1,isConnected:!1,isModelOk:!1,isGenerating:!1,config:null,mountedPers:null,mountedPersArr:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],installedBindings:[],currentModel:null,currentBinding:null,databases:[]}},mutations:{setisRTOn(n,e){n.is_rt_on=e},setLanguages(n,e){n.languages=e},setLanguage(n,e){n.language=e},setIsReady(n,e){n.ready=e},setIsConnected(n,e){n.isConnected=e},setIsModelOk(n,e){n.isModelOk=e},setIsGenerating(n,e){n.isGenerating=e},setConfig(n,e){n.config=e},setPersonalities(n,e){n.personalities=e},setMountedPers(n,e){n.mountedPers=e},setMountedPersArr(n,e){n.mountedPersArr=e},setbindingsZoo(n,e){n.bindingsZoo=e},setModelsArr(n,e){n.modelsArr=e},setselectedModel(n,e){n.selectedModel=e},setDiskUsage(n,e){n.diskUsage=e},setRamUsage(n,e){n.ramUsage=e},setVramUsage(n,e){n.vramUsage=e},setModelsZoo(n,e){n.modelsZoo=e},setCurrentBinding(n,e){n.currentBinding=e},setCurrentModel(n,e){n.currentModel=e},setDatabases(n,e){n.databases=e},setTheme(n){this.currentTheme=n}},getters:{getisRTOn(n){return n.is_rt_on},getLanguages(n){return n.languages},getLanguage(n){return n.language},getIsConnected(n){return n.isConnected},getIsModelOk(n){return n.isModelOk},getIsGenerating(n){return n.isGenerating},getConfig(n){return n.config},getPersonalities(n){return n.personalities},getMountedPersArr(n){return n.mountedPersArr},getMountedPers(n){return n.mountedPers},getbindingsZoo(n){return n.bindingsZoo},getModelsArr(n){return n.modelsArr},getDiskUsage(n){return n.diskUsage},getRamUsage(n){return n.ramUsage},getVramUsage(n){return n.vramUsage},getDatabasesList(n){return n.databases},getModelsZoo(n){return n.modelsZoo},getCyrrentBinding(n){return n.currentBinding},getCurrentModel(n){return n.currentModel}},actions:{async getVersion(){try{let n=await Z.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data)}catch{console.error("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{console.log("Fetching configuration with client id: ",this.state.client_id);const e=await qO("get_config",this.state.client_id);e.active_personality_id<0&&(e.active_personality_id=0);let t=e.personalities[e.active_personality_id].split("/");e.personality_category=t[0],e.personality_folder=t[1],console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),n("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:n}){let e=await Ks("list_databases");console.log("databases:",e),n("setDatabases",e)},async fetchisRTOn({commit:n}){const t=(await Z.get("/is_rt_on")).data.status;n("setisRTOn",t)},async fetchLanguages({commit:n}){console.log("get_personality_languages_list",this.state.client_id);const e=await Z.post("/get_personality_languages_list",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("languages",t),n("setLanguages",t)},async fetchLanguage({commit:n}){console.log("get_personality_language",this.state.client_id);const e=await Z.post("/get_personality_language",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("language",t),n("setLanguage",t)},async changeLanguage({commit:n},e){console.log("Changing language to ",e);let t=await Z.post("/set_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await Z.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await Z.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const i=t.data;console.log("language",i),n("setLanguage",i),console.log("Language changed successfully:",t.data.message)},async deleteLanguage({commit:n},e){console.log("Deleting ",e);let t=await Z.post("/del_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await Z.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await Z.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const i=t.data;console.log("language",i),n("setLanguage",i),console.log("Language changed successfully:",t.data.message)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await Ks("get_all_personalities"),s=Object.keys(t);console.log("Personalities recovered:"+this.state.config.personalities);for(let i=0;i{let d=!1;for(const _ of this.state.config.personalities)if(_.includes(r+"/"+c.folder))if(d=!0,_.includes(":")){const m=_.split(":");c.language=m[1]}else c.language=null;let u={};return u=c,u.category=r,u.full_path=r+"/"+c.folder,u.isMounted=d,u});e.length==0?e=a:e=e.concat(a)}e.sort((i,r)=>i.name.localeCompare(r.name)),n("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:n}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const t=[];for(let s=0;sa.full_path==i||a.full_path==r[0]);if(o>=0){let a=fRt(this.state.personalities[o]);r.length>1&&(a.language=r[1]),a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(c=>c.full_path=="generic/lollms")])}else t.push(s),console.log("Couldn't load personality : ",i)}for(let s=t.length-1;s>=0;s--)console.log("Removing personality : ",this.state.config.personalities[t[s]]),this.state.config.personalities.splice(t[s],1),this.state.config.active_personality_id>t[s]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(s=>s.full_path==this.state.config.personalities[this.state.config.active_personality_id]||s.full_path+":"+s.language==this.state.config.personalities[this.state.config.active_personality_id])]},async refreshBindings({commit:n}){let e=await Ks("list_bindings");console.log("Loaded bindings zoo :",e),this.state.installedBindings=e.filter(s=>s.installed),console.log("Loaded bindings zoo ",this.state.installedBindings),n("setbindingsZoo",e);const t=e.findIndex(s=>s.name==this.state.config.binding_name);t!=-1&&n("setCurrentBinding",e[t])},async refreshModelsZoo({commit:n}){console.log("Fetching models");const t=(await Z.get("/get_available_models")).data.filter(s=>s.variants&&s.variants.length>0);console.log(`get_available_models: ${t}`),n("setModelsZoo",t)},async refreshModelStatus({commit:n}){let e=await Ks("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){console.log("Fetching models");let e=await Ks("list_models");console.log(`Found ${e}`);let t=await Ks("get_active_model");console.log("Selected model ",t),t!=null&&n("setselectedModel",t.model),n("setModelsArr",e),console.log("setModelsArr",e),console.log("this.state.modelsZoo",this.state.modelsZoo),this.state.modelsZoo.map(i=>{i.isInstalled=e.includes(i.name)}),this.state.installedModels=this.state.modelsZoo.filter(i=>i.isInstalled);const s=this.state.modelsZoo.findIndex(i=>i.name==this.state.config.model_name);s!=-1&&n("setCurrentModel",this.state.modelsZoo[s])},async refreshDiskUsage({commit:n}){this.state.diskUsage=await Ks("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await Ks("ram_usage")},async refreshVramUsage({commit:n}){const e=await Ks("vram_usage"),t=[];if(e.nb_gpus>0){for(let i=0;i LoLLMS WebUI - + diff --git a/web/src/views/AppsZoo.vue b/web/src/views/AppsZoo.vue index 537c50f2..d85c9800 100644 --- a/web/src/views/AppsZoo.vue +++ b/web/src/views/AppsZoo.vue @@ -67,6 +67,15 @@ > Show only installed apps +
@@ -176,6 +185,7 @@ export default { sortBy: 'update', sortOrder: 'desc', showOnlyInstalled: false, + showOnlyUnInstalled: false, }; }, computed: { @@ -199,14 +209,20 @@ export default { }, filteredApps() { return this.combinedApps.filter(app => { - const matchesSearch = app.name.toLowerCase().includes(this.searchQuery.toLowerCase()) || + const matchesSearch = app.name.toLowerCase().includes(this.toLowerCase()) || app.description.toLowerCase().includes(this.searchQuery.toLowerCase()) || app.author.toLowerCase().includes(this.searchQuery.toLowerCase()); const matchesCategory = this.selectedCategory === 'all' || app.category === this.selectedCategory; - const matchesInstalled = !this.showOnlyInstalled || app.installed; + + // Adjusting the installed logic to account for both showOnlyInstalled and showOnlyUnInstalled + const matchesInstalled = (this.showOnlyInstalled && app.installed) || + (this.showOnlyUnInstalled && !app.installed) || + (!this.showOnlyInstalled && !this.showOnlyUnInstalled); + return matchesSearch && matchesCategory && matchesInstalled; }); }, + sortedAndFilteredApps() { return this.filteredApps.sort((a, b) => { let comparison = 0; diff --git a/zoos/personalities_zoo b/zoos/personalities_zoo index 30241634..43ae22ec 160000 --- a/zoos/personalities_zoo +++ b/zoos/personalities_zoo @@ -1 +1 @@ -Subproject commit 302416341efe683e9134549ee9771147c21194dd +Subproject commit 43ae22ec9c0207a4e7de1303ca34483dce10b8f4