diff --git a/web/dist/assets/index-acf5f42b.js b/web/dist/assets/index-ba01d903.js similarity index 97% rename from web/dist/assets/index-acf5f42b.js rename to web/dist/assets/index-ba01d903.js index 873af6c4..8c00a0a1 100644 --- a/web/dist/assets/index-acf5f42b.js +++ b/web/dist/assets/index-ba01d903.js @@ -80,7 +80,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),_e=T,we=q),G===void 0& }); } - `,t.async=!0,document.body.appendChild(t),this.renderedMarkdown=Mo.render(this.markdownText),be(()=>{ve.replace()})},methods:{},watch:{markdownText(t){this.renderedMarkdown=Mo.render(t),be(()=>{ve.replace()})}}},RTe={class:"break-all"},NTe=["innerHTML"];function DTe(t,e,n,s,o,r){return E(),A("div",RTe,[c("div",{innerHTML:o.renderedMarkdown,class:"markdown-content"},null,8,NTe)])}const Ig=Ue(OTe,[["render",DTe]]);const LTe={name:"PlayGroundView",data(){return{generating:!1,isSpeaking:!1,voices:[],isLesteningToVoice:!1,presets:{},selectedPreset:"",cursorPosition:0,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}},components:{Toast:Io,MarkdownRenderer:Ig},mounted(){const t=document.getElementById("text_element");t.addEventListener("input",()=>{this.cursorPosition=t.selectionStart+1}),t.addEventListener("click",()=>{this.cursorPosition=t.selectionStart}),xe.get("./presets.json").then(e=>{console.log(e.data),this.presets=e.data}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)}),Ee.on("text_chunk",e=>{this.appendToOutput(e.chunk);const n=document.getElementById("text_element");n.scrollTo(0,n.scrollHeight)}),Ee.on("text_generated",e=>{this.generating=!1}),Ee.on("generation_error",e=>{console.log("generation_error:",e),this.$refs.toast.showToast(`Error: ${e}`,4,!1),this.generating=!1}),Ee.on("connect",()=>{console.log("Connected to LoLLMs server"),this.$store.state.isConnected=!0,this.generating=!1}),Ee.on("buzzy",e=>{console.error("Server is busy. Wait for your turn",e),this.$refs.toast.showToast(`Error: ${e.message}`,4,!1),this.generating=!1}),Ee.on("generation_canceled",e=>{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(){},computed:{isTalking:{get(){return this.isSpeaking}}},methods:{onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let t=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(o=>o.name===this.$store.state.config.audio_out_voice)[0]);const n=o=>{let r=this.text.substring(o,o+e);const i=[".","!","?"];let a=-1;return i.forEach(l=>{const u=r.lastIndexOf(l);u>a&&(a=u)}),a==-1&&(a=r.length),console.log(a),a+o+1},s=()=>{const o=n(t),r=this.text.substring(t,o);this.msg.text=r,t=o+1,this.msg.onend=i=>{t{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",o))},this.speechSynthesis.speak(this.msg)};s()},getCursorPosition(){return this.cursorPosition},appendToOutput(t){this.pre_text+=t,this.text=this.pre_text+this.post_text},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 t=this.text.substring(0,this.getCursorPosition());console.log(t),Ee.emit("generate_text",{prompt:t,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(){Ee.emit("cancel_text_generation",{})},exportText(){const t=this.text,e=document.createElement("a"),n=new Blob([t],{type:"text/plain"});e.href=URL.createObjectURL(n),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const t=document.getElementById("import-input");t&&(t.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const n=new FileReader;n.onload=()=>{this.text=n.result},n.readAsText(e.target.files[0])}else alert("Please select a file.")}),t.click())},setPreset(){this.text=this.presets[this.selectedPreset]},addPreset(){let t=prompt("Enter the title of the preset:");this.presets[t]=this.text},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset]},savePreset(){xe.post("/save_presets",this.presets).then(t=>{console.log(t),this.$refs.toast.showToast("Presets saved",4,!0)})},reloadPresets(){xe.get("./presets.json").then(t=>{console.log(t.data),this.presets=t.data}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,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=t=>{this.generated="";for(let e=t.resultIndex;e{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.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.")}}},ITe={class:"container bg-bg-light dark:bg-bg-dark 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"},PTe={class:"container flex flex-row m-2"},FTe={class:"flex-grow m-2"},BTe={class:"flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},$Te=c("label",{class:"mt-2"},"Presets",-1),jTe=["value"],zTe=c("i",{"data-feather":"check"},null,-1),UTe=[zTe],qTe=c("i",{"data-feather":"plus"},null,-1),HTe=[qTe],VTe=c("i",{"data-feather":"x"},null,-1),GTe=[VTe],KTe=c("i",{"data-feather":"save"},null,-1),WTe=[KTe],ZTe=c("i",{"data-feather":"refresh-ccw"},null,-1),YTe=[ZTe],JTe={class:"flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},QTe={class:"m-0"},XTe=c("i",{"data-feather":"pen-tool"},null,-1),e7e=[XTe],t7e=c("i",{"data-feather":"x"},null,-1),n7e=[t7e],s7e=c("i",{"data-feather":"mic"},null,-1),o7e=[s7e],r7e=c("i",{"data-feather":"volume-2"},null,-1),i7e=[r7e],a7e=c("i",{"data-feather":"upload"},null,-1),l7e=[a7e],c7e=c("i",{"data-feather":"download"},null,-1),u7e=[c7e],d7e=c("input",{type:"file",id:"import-input",class:"hidden"},null,-1),h7e={class:"flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},f7e={id:"settings",class:"border border-blue-300 bg-blue-200 mt-4 w-25 mr-2 h-full mb-10 min-w-500",style:{"align-items":"center",height:"fit-content",margin:"10px","box-shadow":"0 2px 4px rgba(0, 0, 0, 0.1)","border-radius":"4px"}},p7e=c("div",{id:"title",class:"border border-blue-600 bg-blue-300 m-0 flex justify-center items-center box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) border-radius: 4px;"},[c("h3",{class:"text-gray-600 mb-4 text-center m-0"},"Settings")],-1),g7e={class:"slider-container ml-2 mr-2"},m7e=c("h3",{class:"text-gray-600"},"Temperature",-1),_7e={class:"slider-value text-gray-500"},b7e={class:"slider-container ml-2 mr-2"},y7e=c("h3",{class:"text-gray-600"},"Top K",-1),v7e={class:"slider-value text-gray-500"},w7e={class:"slider-container ml-2 mr-2"},x7e=c("h3",{class:"text-gray-600"},"Top P",-1),k7e={class:"slider-value text-gray-500"},E7e={class:"slider-container ml-2 mr-2"},C7e=c("h3",{class:"text-gray-600"},"Repeat Penalty",-1),A7e={class:"slider-value text-gray-500"},S7e={class:"slider-container ml-2 mr-2"},T7e=c("h3",{class:"text-gray-600"},"Repeat Last N",-1),M7e={class:"slider-value text-gray-500"},O7e={class:"slider-container ml-2 mr-2"},R7e=c("h3",{class:"text-gray-600"},"Number of tokens to crop the text to",-1),N7e={class:"slider-value text-gray-500"},D7e={class:"slider-container ml-2 mr-2"},L7e=c("h3",{class:"text-gray-600"},"Number of tokens to generate",-1),I7e={class:"slider-value text-gray-500"},P7e={class:"slider-container ml-2 mr-2"},F7e=c("h3",{class:"text-gray-600"},"Seed",-1),B7e={class:"slider-value text-gray-500"};function $7e(t,e,n,s,o,r){const i=Ke("MarkdownRenderer"),a=Ke("Toast");return E(),A(Oe,null,[c("div",ITe,[c("div",PTe,[c("div",FTe,[c("div",BTe,[$Te,pe(c("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>o.selectedPreset=l),class:"m-2 border-2 rounded-md shadow-sm w-full"},[(E(!0),A(Oe,null,Ze(Object.keys(o.presets),l=>(E(),A("option",{key:l,value:l},H(l),9,jTe))),128))],512),[[Er,o.selectedPreset]]),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[1]||(e[1]=(...l)=>r.setPreset&&r.setPreset(...l)),title:"Use preset"},UTe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[2]||(e[2]=(...l)=>r.addPreset&&r.addPreset(...l)),title:"Add this text as a preset"},HTe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[3]||(e[3]=(...l)=>r.removePreset&&r.removePreset(...l)),title:"Remove preset"},GTe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[4]||(e[4]=(...l)=>r.savePreset&&r.savePreset(...l)),title:"Save presets list"},WTe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[5]||(e[5]=(...l)=>r.reloadPresets&&r.reloadPresets(...l)),title:"Reload presets list"},YTe)]),c("div",JTe,[c("div",QTe,[pe(c("button",{id:"generate-button",onClick:e[6]||(e[6]=(...l)=>r.generate&&r.generate(...l)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},e7e,512),[[Qe,!o.generating]]),pe(c("button",{id:"stop-button",onClick:e[7]||(e[7]=(...l)=>r.stopGeneration&&r.stopGeneration(...l)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},n7e,512),[[Qe,o.generating]]),c("button",{type:"button",onClick:e[8]||(e[8]=(...l)=>r.startSpeechRecognition&&r.startSpeechRecognition(...l)),class:Me([{"text-red-500":o.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},o7e,2),c("button",{title:"speak",onClick:e[9]||(e[9]=re(l=>r.speak(),["stop"])),class:Me([{"text-red-500":r.isTalking},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},i7e,2),pe(c("button",{id:"export-button",onClick:e[10]||(e[10]=(...l)=>r.exportText&&r.exportText(...l)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},l7e,512),[[Qe,!o.generating]]),pe(c("button",{id:"import-button",onClick:e[11]||(e[11]=(...l)=>r.importText&&r.importText(...l)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},u7e,512),[[Qe,!o.generating]]),d7e]),pe(c("textarea",{"onUpdate:modelValue":e[12]||(e[12]=l=>o.text=l),id:"text_element",class:"mt-4 h-64 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",type:"text"},null,512),[[Le,o.text]]),c("span",null,"Cursor position "+H(o.cursorPosition),1)]),c("div",h7e,[he(i,{ref:"mdRender","markdown-text":o.text,class:"dark:bg-bg-dark"},null,8,["markdown-text"])])]),c("div",f7e,[p7e,c("div",g7e,[m7e,pe(c("input",{type:"range","onUpdate:modelValue":e[13]||(e[13]=l=>o.temperature=l),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[Le,o.temperature]]),c("span",_7e,"Current value: "+H(o.temperature),1)]),c("div",b7e,[y7e,pe(c("input",{type:"range","onUpdate:modelValue":e[14]||(e[14]=l=>o.top_k=l),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[Le,o.top_k]]),c("span",v7e,"Current value: "+H(o.top_k),1)]),c("div",w7e,[x7e,pe(c("input",{type:"range","onUpdate:modelValue":e[15]||(e[15]=l=>o.top_p=l),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[Le,o.top_p]]),c("span",k7e,"Current value: "+H(o.top_p),1)]),c("div",E7e,[C7e,pe(c("input",{type:"range","onUpdate:modelValue":e[16]||(e[16]=l=>o.repeat_penalty=l),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[Le,o.repeat_penalty]]),c("span",A7e,"Current value: "+H(o.repeat_penalty),1)]),c("div",S7e,[T7e,pe(c("input",{type:"range","onUpdate:modelValue":e[17]||(e[17]=l=>o.repeat_last_n=l),min:"0",max:"100",step:"1",class:"w-full"},null,512),[[Le,o.repeat_last_n]]),c("span",M7e,"Current value: "+H(o.repeat_last_n),1)]),c("div",O7e,[R7e,pe(c("input",{type:"number","onUpdate:modelValue":e[18]||(e[18]=l=>o.n_crop=l),class:"w-full"},null,512),[[Le,o.n_crop]]),c("span",N7e,"Current value: "+H(o.n_crop),1)]),c("div",D7e,[L7e,pe(c("input",{type:"number","onUpdate:modelValue":e[19]||(e[19]=l=>o.n_predicts=l),class:"w-full"},null,512),[[Le,o.n_predicts]]),c("span",I7e,"Current value: "+H(o.n_predicts),1)]),c("div",P7e,[F7e,pe(c("input",{type:"number","onUpdate:modelValue":e[20]||(e[20]=l=>o.seed=l),class:"w-full"},null,512),[[Le,o.seed]]),c("span",B7e,"Current value: "+H(o.seed),1)])])])]),he(a,{ref:"toast"},null,512)],64)}const j7e=Ue(LTe,[["render",$7e]]);const z7e={data(){return{activeExtension:null}},computed:{activeExtensions(){return this.$store.state.extensionsZoo.filter(t=>t.is_active)}},methods:{showExtensionPage(t){this.activeExtension=t}}},U7e={key:0},q7e=["onClick"],H7e={key:0},V7e=["src"],G7e={key:1},K7e=c("p",null,"No extension is active. Please install and activate an extension.",-1),W7e=[K7e];function Z7e(t,e,n,s,o,r){return E(),A("div",null,[r.activeExtensions.length>0?(E(),A("div",U7e,[(E(!0),A(Oe,null,Ze(r.activeExtensions,i=>(E(),A("div",{key:i.name,onClick:a=>r.showExtensionPage(i)},[c("div",{class:Me({"active-tab":i===o.activeExtension})},H(i.name),3)],8,q7e))),128)),o.activeExtension?(E(),A("div",H7e,[c("iframe",{src:o.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,V7e)])):B("",!0)])):(E(),A("div",G7e,W7e))])}const Y7e=Ue(z7e,[["render",Z7e]]);var Pg={exports:{}};/* @license + `,t.async=!0,document.body.appendChild(t),this.renderedMarkdown=Mo.render(this.markdownText),be(()=>{ve.replace()})},methods:{},watch:{markdownText(t){this.renderedMarkdown=Mo.render(t),be(()=>{ve.replace()})}}},RTe={class:"break-all"},NTe=["innerHTML"];function DTe(t,e,n,s,o,r){return E(),A("div",RTe,[c("div",{innerHTML:o.renderedMarkdown,class:"markdown-content"},null,8,NTe)])}const Ig=Ue(OTe,[["render",DTe]]);const LTe={name:"PlayGroundView",data(){return{generating:!1,isSpeaking:!1,voices:[],isLesteningToVoice:!1,presets:{},selectedPreset:"",cursorPosition:0,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}},components:{Toast:Io,MarkdownRenderer:Ig},mounted(){const t=document.getElementById("text_element");t.addEventListener("input",()=>{this.cursorPosition=t.selectionStart}),t.addEventListener("click",()=>{this.cursorPosition=t.selectionStart}),xe.get("./presets.json").then(e=>{console.log(e.data),this.presets=e.data}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)}),Ee.on("text_chunk",e=>{this.appendToOutput(e.chunk);const n=document.getElementById("text_element");n.scrollTo(0,n.scrollHeight)}),Ee.on("text_generated",e=>{this.generating=!1}),Ee.on("generation_error",e=>{console.log("generation_error:",e),this.$refs.toast.showToast(`Error: ${e}`,4,!1),this.generating=!1}),Ee.on("connect",()=>{console.log("Connected to LoLLMs server"),this.$store.state.isConnected=!0,this.generating=!1}),Ee.on("buzzy",e=>{console.error("Server is busy. Wait for your turn",e),this.$refs.toast.showToast(`Error: ${e.message}`,4,!1),this.generating=!1}),Ee.on("generation_canceled",e=>{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(){},computed:{isTalking:{get(){return this.isSpeaking}}},methods:{onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let t=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(o=>o.name===this.$store.state.config.audio_out_voice)[0]);const n=o=>{let r=this.text.substring(o,o+e);const i=[".","!","?"];let a=-1;return i.forEach(l=>{const u=r.lastIndexOf(l);u>a&&(a=u)}),a==-1&&(a=r.length),console.log(a),a+o+1},s=()=>{const o=n(t),r=this.text.substring(t,o);this.msg.text=r,t=o+1,this.msg.onend=i=>{t{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",o))},this.speechSynthesis.speak(this.msg)};s()},getCursorPosition(){return this.cursorPosition},appendToOutput(t){this.pre_text+=t,this.text=this.pre_text+this.post_text},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 t=this.text.substring(0,this.getCursorPosition());console.log(t),Ee.emit("generate_text",{prompt:t,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(){Ee.emit("cancel_text_generation",{})},exportText(){const t=this.text,e=document.createElement("a"),n=new Blob([t],{type:"text/plain"});e.href=URL.createObjectURL(n),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const t=document.getElementById("import-input");t&&(t.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const n=new FileReader;n.onload=()=>{this.text=n.result},n.readAsText(e.target.files[0])}else alert("Please select a file.")}),t.click())},setPreset(){this.text=this.presets[this.selectedPreset]},addPreset(){let t=prompt("Enter the title of the preset:");this.presets[t]=this.text},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset]},savePreset(){xe.post("/save_presets",this.presets).then(t=>{console.log(t),this.$refs.toast.showToast("Presets saved",4,!0)})},reloadPresets(){xe.get("./presets.json").then(t=>{console.log(t.data),this.presets=t.data}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,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=t=>{this.generated="";for(let e=t.resultIndex;e{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.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.")}}},ITe={class:"container bg-bg-light dark:bg-bg-dark 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"},PTe={class:"container flex flex-row m-2"},FTe={class:"flex-grow m-2"},BTe={class:"flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},$Te=c("label",{class:"mt-2"},"Presets",-1),jTe=["value"],zTe=c("i",{"data-feather":"check"},null,-1),UTe=[zTe],qTe=c("i",{"data-feather":"plus"},null,-1),HTe=[qTe],VTe=c("i",{"data-feather":"x"},null,-1),GTe=[VTe],KTe=c("i",{"data-feather":"save"},null,-1),WTe=[KTe],ZTe=c("i",{"data-feather":"refresh-ccw"},null,-1),YTe=[ZTe],JTe={class:"flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},QTe={class:"m-0"},XTe=c("i",{"data-feather":"pen-tool"},null,-1),e7e=[XTe],t7e=c("i",{"data-feather":"x"},null,-1),n7e=[t7e],s7e=c("i",{"data-feather":"mic"},null,-1),o7e=[s7e],r7e=c("i",{"data-feather":"volume-2"},null,-1),i7e=[r7e],a7e=c("i",{"data-feather":"upload"},null,-1),l7e=[a7e],c7e=c("i",{"data-feather":"download"},null,-1),u7e=[c7e],d7e=c("input",{type:"file",id:"import-input",class:"hidden"},null,-1),h7e={class:"flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},f7e={id:"settings",class:"border border-blue-300 bg-blue-200 mt-4 w-25 mr-2 h-full mb-10 min-w-500",style:{"align-items":"center",height:"fit-content",margin:"10px","box-shadow":"0 2px 4px rgba(0, 0, 0, 0.1)","border-radius":"4px"}},p7e=c("div",{id:"title",class:"border border-blue-600 bg-blue-300 m-0 flex justify-center items-center box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) border-radius: 4px;"},[c("h3",{class:"text-gray-600 mb-4 text-center m-0"},"Settings")],-1),g7e={class:"slider-container ml-2 mr-2"},m7e=c("h3",{class:"text-gray-600"},"Temperature",-1),_7e={class:"slider-value text-gray-500"},b7e={class:"slider-container ml-2 mr-2"},y7e=c("h3",{class:"text-gray-600"},"Top K",-1),v7e={class:"slider-value text-gray-500"},w7e={class:"slider-container ml-2 mr-2"},x7e=c("h3",{class:"text-gray-600"},"Top P",-1),k7e={class:"slider-value text-gray-500"},E7e={class:"slider-container ml-2 mr-2"},C7e=c("h3",{class:"text-gray-600"},"Repeat Penalty",-1),A7e={class:"slider-value text-gray-500"},S7e={class:"slider-container ml-2 mr-2"},T7e=c("h3",{class:"text-gray-600"},"Repeat Last N",-1),M7e={class:"slider-value text-gray-500"},O7e={class:"slider-container ml-2 mr-2"},R7e=c("h3",{class:"text-gray-600"},"Number of tokens to crop the text to",-1),N7e={class:"slider-value text-gray-500"},D7e={class:"slider-container ml-2 mr-2"},L7e=c("h3",{class:"text-gray-600"},"Number of tokens to generate",-1),I7e={class:"slider-value text-gray-500"},P7e={class:"slider-container ml-2 mr-2"},F7e=c("h3",{class:"text-gray-600"},"Seed",-1),B7e={class:"slider-value text-gray-500"};function $7e(t,e,n,s,o,r){const i=Ke("MarkdownRenderer"),a=Ke("Toast");return E(),A(Oe,null,[c("div",ITe,[c("div",PTe,[c("div",FTe,[c("div",BTe,[$Te,pe(c("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>o.selectedPreset=l),class:"m-2 border-2 rounded-md shadow-sm w-full"},[(E(!0),A(Oe,null,Ze(Object.keys(o.presets),l=>(E(),A("option",{key:l,value:l},H(l),9,jTe))),128))],512),[[Er,o.selectedPreset]]),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[1]||(e[1]=(...l)=>r.setPreset&&r.setPreset(...l)),title:"Use preset"},UTe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[2]||(e[2]=(...l)=>r.addPreset&&r.addPreset(...l)),title:"Add this text as a preset"},HTe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[3]||(e[3]=(...l)=>r.removePreset&&r.removePreset(...l)),title:"Remove preset"},GTe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[4]||(e[4]=(...l)=>r.savePreset&&r.savePreset(...l)),title:"Save presets list"},WTe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[5]||(e[5]=(...l)=>r.reloadPresets&&r.reloadPresets(...l)),title:"Reload presets list"},YTe)]),c("div",JTe,[c("div",QTe,[pe(c("button",{id:"generate-button",onClick:e[6]||(e[6]=(...l)=>r.generate&&r.generate(...l)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},e7e,512),[[Qe,!o.generating]]),pe(c("button",{id:"stop-button",onClick:e[7]||(e[7]=(...l)=>r.stopGeneration&&r.stopGeneration(...l)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},n7e,512),[[Qe,o.generating]]),c("button",{type:"button",onClick:e[8]||(e[8]=(...l)=>r.startSpeechRecognition&&r.startSpeechRecognition(...l)),class:Me([{"text-red-500":o.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},o7e,2),c("button",{title:"speak",onClick:e[9]||(e[9]=re(l=>r.speak(),["stop"])),class:Me([{"text-red-500":r.isTalking},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},i7e,2),pe(c("button",{id:"export-button",onClick:e[10]||(e[10]=(...l)=>r.exportText&&r.exportText(...l)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},l7e,512),[[Qe,!o.generating]]),pe(c("button",{id:"import-button",onClick:e[11]||(e[11]=(...l)=>r.importText&&r.importText(...l)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},u7e,512),[[Qe,!o.generating]]),d7e]),pe(c("textarea",{"onUpdate:modelValue":e[12]||(e[12]=l=>o.text=l),id:"text_element",class:"mt-4 h-64 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",type:"text"},null,512),[[Le,o.text]]),c("span",null,"Cursor position "+H(o.cursorPosition),1)]),c("div",h7e,[he(i,{ref:"mdRender","markdown-text":o.text,class:"dark:bg-bg-dark"},null,8,["markdown-text"])])]),c("div",f7e,[p7e,c("div",g7e,[m7e,pe(c("input",{type:"range","onUpdate:modelValue":e[13]||(e[13]=l=>o.temperature=l),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[Le,o.temperature]]),c("span",_7e,"Current value: "+H(o.temperature),1)]),c("div",b7e,[y7e,pe(c("input",{type:"range","onUpdate:modelValue":e[14]||(e[14]=l=>o.top_k=l),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[Le,o.top_k]]),c("span",v7e,"Current value: "+H(o.top_k),1)]),c("div",w7e,[x7e,pe(c("input",{type:"range","onUpdate:modelValue":e[15]||(e[15]=l=>o.top_p=l),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[Le,o.top_p]]),c("span",k7e,"Current value: "+H(o.top_p),1)]),c("div",E7e,[C7e,pe(c("input",{type:"range","onUpdate:modelValue":e[16]||(e[16]=l=>o.repeat_penalty=l),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[Le,o.repeat_penalty]]),c("span",A7e,"Current value: "+H(o.repeat_penalty),1)]),c("div",S7e,[T7e,pe(c("input",{type:"range","onUpdate:modelValue":e[17]||(e[17]=l=>o.repeat_last_n=l),min:"0",max:"100",step:"1",class:"w-full"},null,512),[[Le,o.repeat_last_n]]),c("span",M7e,"Current value: "+H(o.repeat_last_n),1)]),c("div",O7e,[R7e,pe(c("input",{type:"number","onUpdate:modelValue":e[18]||(e[18]=l=>o.n_crop=l),class:"w-full"},null,512),[[Le,o.n_crop]]),c("span",N7e,"Current value: "+H(o.n_crop),1)]),c("div",D7e,[L7e,pe(c("input",{type:"number","onUpdate:modelValue":e[19]||(e[19]=l=>o.n_predicts=l),class:"w-full"},null,512),[[Le,o.n_predicts]]),c("span",I7e,"Current value: "+H(o.n_predicts),1)]),c("div",P7e,[F7e,pe(c("input",{type:"number","onUpdate:modelValue":e[20]||(e[20]=l=>o.seed=l),class:"w-full"},null,512),[[Le,o.seed]]),c("span",B7e,"Current value: "+H(o.seed),1)])])])]),he(a,{ref:"toast"},null,512)],64)}const j7e=Ue(LTe,[["render",$7e]]);const z7e={data(){return{activeExtension:null}},computed:{activeExtensions(){return this.$store.state.extensionsZoo.filter(t=>t.is_active)}},methods:{showExtensionPage(t){this.activeExtension=t}}},U7e={key:0},q7e=["onClick"],H7e={key:0},V7e=["src"],G7e={key:1},K7e=c("p",null,"No extension is active. Please install and activate an extension.",-1),W7e=[K7e];function Z7e(t,e,n,s,o,r){return E(),A("div",null,[r.activeExtensions.length>0?(E(),A("div",U7e,[(E(!0),A(Oe,null,Ze(r.activeExtensions,i=>(E(),A("div",{key:i.name,onClick:a=>r.showExtensionPage(i)},[c("div",{class:Me({"active-tab":i===o.activeExtension})},H(i.name),3)],8,q7e))),128)),o.activeExtension?(E(),A("div",H7e,[c("iframe",{src:o.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,V7e)])):B("",!0)])):(E(),A("div",G7e,W7e))])}const Y7e=Ue(z7e,[["render",Z7e]]);var Pg={exports:{}};/* @license Papa Parse v5.4.1 https://github.com/mholt/PapaParse @@ -148,7 +148,7 @@ Response: Error: `+e.error,4,!1);this.isLoading=!1},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,xe.post("/reinstall_personality",{name:t.personality.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}))},onPersonalityMounted(t){console.log("on sel ",t),this.configFile.personalities.includes(t.full_path)?this.configFile.personalities.length==1?this.$refs.toast.showToast("Can't unmount last personality",4,!1):this.unmountPersonality(t):this.mountPersonality(t)},personalityImgPlacehodler(t){t.target.src=Xn},searchPersonality_func(){clearTimeout(this.searchPersonalityTimer),this.searchPersonality&&(this.searchPersonalityInProgress=!0,setTimeout(this.filterPersonalities,this.searchPersonalityTimerInterval))},searchModel_func(){clearTimeout(this.searchModelTimer),this.searchModel&&(this.searchModelInProgress=!0,setTimeout(this.filterModels,this.searchModelTimer))}},async mounted(){this.constructor(),console.log("Getting voices"),this.getVoices()},activated(){this.isMounted&&this.constructor()},computed:{audio_out_voice:{get(){return this.$store.state.config.audio_out_voice},set(t){this.$store.state.config.audio_out_voice=t}},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(t){this.$store.commit("setConfig",t)}},userName:{get(){return this.$store.state.config.user_name},set(t){this.$store.state.config.user_name=t}},user_avatar:{get(){return"/user_infos/"+this.$store.state.config.user_avatar},set(t){this.$store.state.config.user_avatar=t}},enable_gpu:{get(){return this.$store.state.config.enable_gpu},set(t){this.$store.state.config.enable_gpu=t}},auto_update:{get(){return this.$store.state.config.auto_update},set(t){this.$store.state.config.auto_update=t}},auto_speak:{get(){return this.$store.state.config.auto_speak},set(t){this.$store.state.config.auto_speak=t}},audio_pitch:{get(){return this.$store.state.config.audio_pitch},set(t){this.$store.state.config.audio_pitch=t}},audio_in_language:{get(){return this.$store.state.config.audio_in_language},set(t){this.$store.state.config.audio_in_language=t}},use_user_name_in_discussions:{get(){return this.$store.state.config.use_user_name_in_discussions},set(t){this.$store.state.config.use_user_name_in_discussions=t}},db_path:{get(){return this.$store.state.config.db_path},set(t){this.$store.state.config.db_path=t}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}},bindingsArr:{get(){return this.$store.state.bindingsArr},set(t){this.$store.commit("setBindingsArr",t)}},modelsArr:{get(){return this.$store.state.modelsArr},set(t){this.$store.commit("setModelsArr",t)}},models:{get(){return this.$store.state.models_zoo},set(t){this.$store.commit("setModelsZoo",t)}},diskUsage:{get(){return this.$store.state.diskUsage},set(t){this.$store.commit("setDiskUsage",t)}},ramUsage:{get(){return this.$store.state.ramUsage},set(t){this.$store.commit("setRamUsage",t)}},vramUsage:{get(){return this.$store.state.vramUsage},set(t){this.$store.commit("setVramUsage",t)}},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)},imgBinding(){if(this.isMounted)try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(t=>t.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Nr}},imgModel(){if(this.isMounted)try{return this.$refs.modelZoo[this.$refs.modelZoo.findIndex(t=>t.title==this.configFile.model_name)].$refs.imgElement.src}catch{return Nr}},model_name(){if(this.isMounted)return this.configFile.model_name},binding_name(){if(!this.isMounted)return;const t=this.bindingsArr.findIndex(e=>e.folder===this.configFile.binding_name);if(t>-1)return this.bindingsArr[t].name},active_pesonality(){if(!this.isMounted)return;const t=this.personalities.findIndex(e=>e.full_path===this.configFile.personalities[this.configFile.active_personality_id]);if(t>-1)return this.personalities[t].name},speed_computed(){return Gt(this.addModel.speed)},total_size_computed(){return Gt(this.addModel.total_size)},downloaded_size_computed(){return Gt(this.addModel.downloaded_size)}},watch:{bec_collapsed(){be(()=>{ve.replace()})},pc_collapsed(){be(()=>{ve.replace()})},mc_collapsed(){be(()=>{ve.replace()})},sc_collapsed(){be(()=>{ve.replace()})},showConfirmation(){be(()=>{ve.replace()})},mzl_collapsed(){be(()=>{ve.replace()})},pzl_collapsed(){be(()=>{ve.replace()})},bzl_collapsed(){be(()=>{ve.replace()})},all_collapsed(t){this.collapseAll(t),be(()=>{ve.replace()})},settingsChanged(t){this.$store.state.settingsChanged=t,be(()=>{ve.replace()})},isLoading(){be(()=>{ve.replace()})},searchPersonality(t){t==""&&this.filterPersonalities()},searchModel(t){t==""&&this.filterModels()},mzdc_collapsed(){be(()=>{ve.replace()})}},async beforeRouteLeave(t){if(await this.$router.isReady(),this.settingsChanged)return await this.$refs.yesNoDialog.askQuestion(`Did You forgot to apply changes? You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1;if(!this.isModelSelected)return await this.$refs.yesNoDialog.askQuestion(`Did You forgot to select model? -You need to select model before you leave, or else.`,"Ok","Cancel"),!1}},ie=t=>(ns("data-v-45255715"),t=t(),ss(),t),VDe={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-0"},GDe={class:"sticky top-0 z-10 flex flex-row mb-2 p-3 gap-3 w-full rounded-b-lg bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},KDe={key:0,class:"flex gap-3 flex-1 items-center duration-75"},WDe=ie(()=>c("i",{"data-feather":"x"},null,-1)),ZDe=[WDe],YDe=ie(()=>c("i",{"data-feather":"check"},null,-1)),JDe=[YDe],QDe={key:1,class:"flex gap-3 flex-1 items-center"},XDe=ie(()=>c("i",{"data-feather":"save"},null,-1)),eLe=[XDe],tLe=ie(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),nLe=[tLe],sLe=ie(()=>c("i",{"data-feather":"list"},null,-1)),oLe=[sLe],rLe={class:"flex gap-3 flex-1 items-center justify-end"},iLe={class:"flex gap-3 items-center"},aLe={key:0,class:"flex gap-3 items-center"},lLe=ie(()=>c("i",{"data-feather":"check"},null,-1)),cLe=[lLe],uLe={key:1,role:"status"},dLe=ie(()=>c("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"},[c("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"}),c("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)),hLe=ie(()=>c("span",{class:"sr-only"},"Loading...",-1)),fLe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},pLe={class:"flex flex-row p-3"},gLe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),mLe=[gLe],_Le=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),bLe=[_Le],yLe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),vLe=ie(()=>c("div",{class:"mr-2"},"|",-1)),wLe={class:"text-base font-semibold cursor-pointer select-none items-center"},xLe={class:"flex gap-2 items-center"},kLe={key:0},ELe={class:"flex gap-2 items-center"},CLe=["title"],ALe=os('',34),SLe=[ALe],TLe={class:"font-bold font-large text-lg"},MLe={key:1},OLe={class:"flex gap-2 items-center"},RLe=os('',1),NLe={class:"font-bold font-large text-lg"},DLe=ie(()=>c("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),LLe={class:"font-bold font-large text-lg"},ILe=ie(()=>c("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),PLe={class:"font-bold font-large text-lg"},FLe={class:"mb-2"},BLe=ie(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[c("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"})]),ye(" CPU Ram usage: ")],-1)),$Le={class:"flex flex-col mx-2"},jLe=ie(()=>c("b",null,"Avaliable ram: ",-1)),zLe=ie(()=>c("b",null,"Ram usage: ",-1)),ULe={class:"p-2"},qLe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},HLe={class:"mb-2"},VLe=ie(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),ye(" Disk usage: ")],-1)),GLe={class:"flex flex-col mx-2"},KLe=ie(()=>c("b",null,"Avaliable disk space: ",-1)),WLe=ie(()=>c("b",null,"Disk usage: ",-1)),ZLe={class:"p-2"},YLe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},JLe={class:"mb-2"},QLe=os('',1),XLe={class:"flex flex-col mx-2"},eIe=ie(()=>c("b",null,"Model: ",-1)),tIe=ie(()=>c("b",null,"Avaliable vram: ",-1)),nIe=ie(()=>c("b",null,"GPU usage: ",-1)),sIe={class:"p-2"},oIe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},rIe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},iIe={class:"flex flex-row p-3"},aIe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),lIe=[aIe],cIe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),uIe=[cIe],dIe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),hIe={class:"flex flex-col mb-2 px-3 pb-2"},fIe={class:"pb-2"},pIe={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"},gIe=ie(()=>c("th",null,"Generic",-1)),mIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),_Ie={style:{width:"100%"}},bIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),yIe=[bIe],vIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_gpu",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable GPU:")],-1)),wIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),xIe=[wIe],kIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),EIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),CIe=[EIe],AIe={class:"pb-2"},SIe={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"},TIe=ie(()=>c("th",null,"User",-1)),MIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),OIe={style:{width:"100%"}},RIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),NIe=[RIe],DIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),LIe={style:{width:"100%"}},IIe={for:"avatar-upload"},PIe=["src"],FIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),BIe=[FIe],$Ie=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),jIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),zIe=[jIe],UIe={class:"pb-2"},qIe={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"},HIe=ie(()=>c("th",null,"Audio",-1)),VIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),GIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),KIe=[GIe],WIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),ZIe={class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},YIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),JIe=[YIe],QIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),XIe=["value"],ePe=ie(()=>c("i",{"data-feather":"check"},null,-1)),tPe=[ePe],nPe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),sPe=["value"],oPe=ie(()=>c("i",{"data-feather":"check"},null,-1)),rPe=[oPe],iPe={class:"w-full"},aPe={class:"w-full"},lPe={class:"w-full"},cPe={key:0},uPe=ie(()=>c("i",{"data-feather":"alert-circle"},null,-1)),dPe=[uPe],hPe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},fPe={class:"flex flex-row p-3"},pPe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),gPe=[pPe],mPe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),_Pe=[mPe],bPe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),yPe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},vPe=ie(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),wPe={key:1,class:"mr-2"},xPe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},kPe={class:"flex gap-1 items-center"},EPe=["src"],CPe={class:"font-bold font-large text-lg line-clamp-1"},APe={key:0,class:"mb-2"},SPe={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},TPe=ie(()=>c("i",{"data-feather":"chevron-up"},null,-1)),MPe=[TPe],OPe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),RPe=[OPe],NPe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},DPe={class:"flex flex-row p-3"},LPe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),IPe=[LPe],PPe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),FPe=[PPe],BPe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),$Pe={class:"flex flex-row items-center"},jPe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},zPe=ie(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),UPe={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},qPe=ie(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),HPe={key:2,class:"mr-2"},VPe={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},GPe={class:"flex gap-1 items-center"},KPe=["src"],WPe={class:"font-bold font-large text-lg line-clamp-1"},ZPe={class:"mx-2 mb-4"},YPe={class:"relative"},JPe={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},QPe={key:0},XPe=ie(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),eFe=[XPe],tFe={key:1},nFe=ie(()=>c("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"},[c("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)),sFe=[nFe],oFe={key:0},rFe={key:0,class:"mb-2"},iFe={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},aFe={key:1},lFe={key:0,class:"mb-2"},cFe={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},uFe=ie(()=>c("i",{"data-feather":"chevron-up"},null,-1)),dFe=[uFe],hFe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),fFe=[hFe],pFe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},gFe={class:"flex flex-row p-3"},mFe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),_Fe=[mFe],bFe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),yFe=[bFe],vFe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Add models for binding",-1)),wFe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},xFe=ie(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),kFe={key:1,class:"mr-2"},EFe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},CFe={class:"flex gap-1 items-center"},AFe=["src"],SFe={class:"font-bold font-large text-lg line-clamp-1"},TFe={class:"mb-2"},MFe={class:"p-2"},OFe={class:"mb-3"},RFe=ie(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),NFe={key:0},DFe={class:"mb-3"},LFe=ie(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),IFe={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},PFe=ie(()=>c("div",{role:"status",class:"justify-center"},null,-1)),FFe={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},BFe={class:"w-full p-2"},$Fe={class:"flex justify-between mb-1"},jFe=os(' Downloading Loading...',1),zFe={class:"text-sm font-medium text-blue-700 dark:text-white"},UFe=["title"],qFe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},HFe={class:"flex justify-between mb-1"},VFe={class:"text-base font-medium text-blue-700 dark:text-white"},GFe={class:"text-sm font-medium text-blue-700 dark:text-white"},KFe={class:"flex flex-grow"},WFe={class:"flex flex-row flex-grow gap-3"},ZFe={class:"p-2 text-center grow"},YFe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},JFe={class:"flex flex-row p-3 items-center"},QFe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),XFe=[QFe],eBe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),tBe=[eBe],nBe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),sBe={key:0,class:"mr-2"},oBe={class:"mr-2 font-bold font-large text-lg line-clamp-1"},rBe={key:1,class:"mr-2"},iBe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},aBe={key:0,class:"flex -space-x-4 items-center"},lBe={class:"group items-center flex flex-row"},cBe=["onClick"],uBe=["src","title"],dBe=["onClick"],hBe=ie(()=>c("span",{class:"hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[c("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"},[c("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)),fBe=[hBe],pBe={class:"mx-2 mb-4"},gBe=ie(()=>c("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),mBe={class:"relative"},_Be={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},bBe={key:0},yBe=ie(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),vBe=[yBe],wBe={key:1},xBe=ie(()=>c("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"},[c("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)),kBe=[xBe],EBe={key:0,class:"mx-2 mb-4"},CBe={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},ABe=["selected"],SBe={key:0,class:"mb-2"},TBe={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},MBe=ie(()=>c("i",{"data-feather":"chevron-up"},null,-1)),OBe=[MBe],RBe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),NBe=[RBe],DBe={class:"flex flex-col mb-2 p-3 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},LBe={class:"flex flex-row"},IBe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),PBe=[IBe],FBe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),BBe=[FBe],$Be=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),jBe={class:"m-2"},zBe={class:"flex flex-row gap-2 items-center"},UBe=ie(()=>c("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),qBe={class:"m-2"},HBe=ie(()=>c("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),VBe={class:"m-2"},GBe={class:"flex flex-col align-bottom"},KBe={class:"relative"},WBe=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),ZBe={class:"absolute right-0"},YBe={class:"m-2"},JBe={class:"flex flex-col align-bottom"},QBe={class:"relative"},XBe=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),e$e={class:"absolute right-0"},t$e={class:"m-2"},n$e={class:"flex flex-col align-bottom"},s$e={class:"relative"},o$e=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),r$e={class:"absolute right-0"},i$e={class:"m-2"},a$e={class:"flex flex-col align-bottom"},l$e={class:"relative"},c$e=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),u$e={class:"absolute right-0"},d$e={class:"m-2"},h$e={class:"flex flex-col align-bottom"},f$e={class:"relative"},p$e=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),g$e={class:"absolute right-0"},m$e={class:"m-2"},_$e={class:"flex flex-col align-bottom"},b$e={class:"relative"},y$e=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),v$e={class:"absolute right-0"};function w$e(t,e,n,s,o,r){const i=Ke("BindingEntry"),a=Ke("model-entry"),l=Ke("personality-entry"),u=Ke("YesNoDialog"),d=Ke("AddModelDialog"),h=Ke("MessageBox"),f=Ke("Toast"),g=Ke("UniversalForm"),m=Ke("ChoiceDialog");return E(),A(Oe,null,[c("div",VDe,[c("div",GDe,[o.showConfirmation?(E(),A("div",KDe,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=re(p=>o.showConfirmation=!1,["stop"]))},ZDe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=re(p=>r.save_configuration(),["stop"]))},JDe)])):B("",!0),o.showConfirmation?B("",!0):(E(),A("div",QDe,[c("button",{title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=p=>o.showConfirmation=!0)},eLe),c("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[3]||(e[3]=p=>r.reset_configuration())},nLe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[4]||(e[4]=re(p=>o.all_collapsed=!o.all_collapsed,["stop"]))},oLe)])),c("div",rLe,[c("div",iLe,[o.settingsChanged?(E(),A("div",aLe,[ye(" Apply changes: "),o.isLoading?B("",!0):(E(),A("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[5]||(e[5]=re(p=>r.applyConfiguration(),["stop"]))},cLe))])):B("",!0),o.isLoading?(E(),A("div",uLe,[c("p",null,H(o.loading_text),1),dLe,hLe])):B("",!0)])])]),c("div",{class:Me(o.isLoading?"pointer-events-none opacity-30":"")},[c("div",fLe,[c("div",pLe,[c("button",{onClick:e[6]||(e[6]=re(p=>o.sc_collapsed=!o.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[pe(c("div",null,mLe,512),[[Qe,o.sc_collapsed]]),pe(c("div",null,bLe,512),[[Qe,!o.sc_collapsed]]),yLe,vLe,c("div",wLe,[c("div",xLe,[c("div",null,[r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(E(),A("div",kLe,[(E(!0),A(Oe,null,Ze(r.vramUsage.gpus,p=>(E(),A("div",ELe,[(E(),A("svg",{title:p.gpu_model,"aria-hidden":"true",class:"w-10 h-10 fill-secondary",viewBox:"0 -3 82 66",fill:"none",xmlns:"http://www.w3.org/2000/svg"},SLe,8,CLe)),c("h3",TLe,[c("div",null,H(r.computedFileSize(p.used_vram))+" / "+H(r.computedFileSize(p.total_vram))+" ("+H(p.percentage)+"%) ",1)])]))),256))])):B("",!0),r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(E(),A("div",MLe,[c("div",OLe,[RLe,c("h3",NLe,[c("div",null,H(r.vramUsage.gpus.length)+"x ",1)])])])):B("",!0)]),DLe,c("h3",LLe,[c("div",null,H(r.ram_usage)+" / "+H(r.ram_total_space)+" ("+H(r.ram_percent_usage)+"%)",1)]),ILe,c("h3",PLe,[c("div",null,H(r.disk_binding_models_usage)+" / "+H(r.disk_total_space)+" ("+H(r.disk_percent_usage)+"%)",1)])])])])]),c("div",{class:Me([{hidden:o.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",FLe,[BLe,c("div",$Le,[c("div",null,[jLe,ye(H(r.ram_available_space),1)]),c("div",null,[zLe,ye(" "+H(r.ram_usage)+" / "+H(r.ram_total_space)+" ("+H(r.ram_percent_usage)+")% ",1)])]),c("div",ULe,[c("div",qLe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:bt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),c("div",HLe,[VLe,c("div",GLe,[c("div",null,[KLe,ye(H(r.disk_available_space),1)]),c("div",null,[WLe,ye(" "+H(r.disk_binding_models_usage)+" / "+H(r.disk_total_space)+" ("+H(r.disk_percent_usage)+"%)",1)])]),c("div",ZLe,[c("div",YLe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:bt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(E(!0),A(Oe,null,Ze(r.vramUsage.gpus,p=>(E(),A("div",JLe,[QLe,c("div",XLe,[c("div",null,[eIe,ye(H(p.gpu_model),1)]),c("div",null,[tIe,ye(H(this.computedFileSize(p.available_space)),1)]),c("div",null,[nIe,ye(" "+H(this.computedFileSize(p.used_vram))+" / "+H(this.computedFileSize(p.total_vram))+" ("+H(p.percentage)+"%)",1)])]),c("div",sIe,[c("div",oIe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:bt("width: "+p.percentage+"%;")},null,4)])])]))),256))],2)]),c("div",rIe,[c("div",iIe,[c("button",{onClick:e[7]||(e[7]=re(p=>o.minconf_collapsed=!o.minconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[pe(c("div",null,lIe,512),[[Qe,o.minconf_collapsed]]),pe(c("div",null,uIe,512),[[Qe,!o.minconf_collapsed]]),dIe])]),c("div",{class:Me([{hidden:o.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",hIe,[c("div",fIe,[c("table",pIe,[gIe,c("tr",null,[mIe,c("td",_Ie,[pe(c("input",{type:"text",id:"db_path",required:"","onUpdate:modelValue":e[8]||(e[8]=p=>r.db_path=p),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,512),[[Le,r.db_path]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[9]||(e[9]=p=>r.update_setting("db_path",r.db_path))},yIe)])]),c("tr",null,[vIe,c("td",null,[pe(c("input",{type:"checkbox",id:"enable_gpu",required:"","onUpdate:modelValue":e[10]||(e[10]=p=>r.enable_gpu=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,512),[[kt,r.enable_gpu]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[11]||(e[11]=p=>r.update_setting("enable_gpu",r.enable_gpu))},xIe)])]),c("tr",null,[kIe,c("td",null,[pe(c("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[12]||(e[12]=p=>r.auto_update=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,512),[[kt,r.auto_update]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[13]||(e[13]=p=>r.update_setting("auto_update",r.auto_update))},CIe)])])])]),c("div",AIe,[c("table",SIe,[TIe,c("tr",null,[MIe,c("td",OIe,[pe(c("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[14]||(e[14]=p=>r.userName=p),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,512),[[Le,r.userName]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[15]||(e[15]=p=>r.update_setting("user_name",r.userName))},NIe)])]),c("tr",null,[DIe,c("td",LIe,[c("label",IIe,[c("img",{src:r.user_avatar,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,PIe)]),c("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[16]||(e[16]=(...p)=>r.uploadAvatar&&r.uploadAvatar(...p))},null,32)]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[17]||(e[17]=p=>r.update_setting("user_name",r.userName))},BIe)])]),c("tr",null,[$Ie,c("td",null,[pe(c("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[18]||(e[18]=p=>r.use_user_name_in_discussions=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,512),[[kt,r.use_user_name_in_discussions]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[19]||(e[19]=p=>r.update_setting("use_user_name_in_discussions",r.use_user_name_in_discussions))},zIe)])])])]),c("div",UIe,[c("table",qIe,[HIe,c("tr",null,[VIe,c("td",null,[pe(c("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[20]||(e[20]=p=>r.auto_speak=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,512),[[kt,r.auto_speak]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[21]||(e[21]=p=>r.update_setting("auto_speak",r.auto_speak))},KIe)])]),c("tr",null,[WIe,c("td",null,[pe(c("input",{id:"audio_pitch","onUpdate:modelValue":e[22]||(e[22]=p=>r.audio_pitch=p),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,512),[[Le,r.audio_pitch]]),c("p",ZIe,H(r.audio_pitch),1)]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[23]||(e[23]=p=>r.update_setting("audio_pitch",r.audio_pitch))},JIe)])]),c("tr",null,[QIe,c("td",null,[pe(c("select",{id:"audio_in_language","onUpdate:modelValue":e[24]||(e[24]=p=>r.audio_in_language=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(E(!0),A(Oe,null,Ze(r.audioLanguages,p=>(E(),A("option",{key:p.code,value:p.code},H(p.name),9,XIe))),128))],512),[[Er,r.audio_in_language]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[25]||(e[25]=p=>r.update_setting("audio_in_language",r.audio_in_language))},tPe)])]),c("tr",null,[nPe,c("td",null,[pe(c("select",{id:"audio_out_voice","onUpdate:modelValue":e[26]||(e[26]=p=>r.audio_out_voice=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(E(!0),A(Oe,null,Ze(o.audioVoices,p=>(E(),A("option",{key:p.name,value:p.name},H(p.name),9,sPe))),128))],512),[[Er,r.audio_out_voice]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[27]||(e[27]=p=>r.update_setting("audio_out_voice",r.audio_out_voice))},rPe)])])])])]),c("div",iPe,[c("button",{class:"hover:text-secondary dark:bg-gray-600 w-full bg-red-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[28]||(e[28]=p=>r.api_get_req("clear_uploads").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast(["failed!"],4,!1)}))}," Clear uploads ")]),c("div",aPe,[c("button",{class:"hover:text-secondary dark:bg-gray-600 w-full bg-red-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[29]||(e[29]=p=>r.api_get_req("restart_program").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast(["failed!"],4,!1)}))}," Restart program ")]),c("div",lPe,[c("button",{class:"hover:text-secondary dark:bg-gray-600 w-full bg-red-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[30]||(e[30]=p=>r.api_get_req("update_software").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast("Success!",4,!0)}))},[ye(" Upgrade program "),o.has_updates?(E(),A("div",cPe,dPe)):B("",!0)])])],2)]),c("div",hPe,[c("div",fPe,[c("button",{onClick:e[31]||(e[31]=re(p=>o.bzc_collapsed=!o.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[pe(c("div",null,gPe,512),[[Qe,o.bzc_collapsed]]),pe(c("div",null,_Pe,512),[[Qe,!o.bzc_collapsed]]),bPe,r.configFile.binding_name?B("",!0):(E(),A("div",yPe,[vPe,ye(" No binding selected! ")])),r.configFile.binding_name?(E(),A("div",wPe,"|")):B("",!0),r.configFile.binding_name?(E(),A("div",xPe,[c("div",kPe,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,EPe),c("h3",CPe,H(r.binding_name),1)])])):B("",!0)])]),c("div",{class:Me([{hidden:o.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsArr.length>0?(E(),A("div",APe,[c("label",SPe," Bindings: ("+H(r.bindingsArr.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.bzl_collapsed?"":"max-h-96"])},[he(Ut,{name:"list"},{default:Be(()=>[(E(!0),A(Oe,null,Ze(r.bindingsArr,(p,b)=>(E(),st(i,{ref_for:!0,ref:"bindingZoo",key:"index-"+b+"-"+p.folder,binding:p,"on-selected":r.onSelectedBinding,"on-reinstall":r.onReinstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:p.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):B("",!0),o.bzl_collapsed?(E(),A("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[32]||(e[32]=p=>o.bzl_collapsed=!o.bzl_collapsed)},MPe)):(E(),A("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[33]||(e[33]=p=>o.bzl_collapsed=!o.bzl_collapsed)},RPe))],2)]),c("div",NPe,[c("div",DPe,[c("button",{onClick:e[34]||(e[34]=re(p=>o.mzc_collapsed=!o.mzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[pe(c("div",null,IPe,512),[[Qe,o.mzc_collapsed]]),pe(c("div",null,FPe,512),[[Qe,!o.mzc_collapsed]]),BPe,c("div",$Pe,[r.configFile.binding_name?B("",!0):(E(),A("div",jPe,[zPe,ye(" Select binding first! ")])),!o.isModelSelected&&r.configFile.binding_name?(E(),A("div",UPe,[qPe,ye(" No model selected! ")])):B("",!0),r.configFile.model_name?(E(),A("div",HPe,"|")):B("",!0),r.configFile.model_name?(E(),A("div",VPe,[c("div",GPe,[c("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,KPe),c("h3",WPe,H(r.model_name),1)])])):B("",!0)])])]),c("div",{class:Me([{hidden:o.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",ZPe,[c("div",YPe,[c("div",JPe,[o.searchModelInProgress?(E(),A("div",QPe,eFe)):B("",!0),o.searchModelInProgress?B("",!0):(E(),A("div",tFe,sFe))]),pe(c("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[35]||(e[35]=p=>o.searchModel=p),onKeyup:e[36]||(e[36]=re((...p)=>r.searchModel_func&&r.searchModel_func(...p),["stop"]))},null,544),[[Le,o.searchModel]]),o.searchModel?(E(),A("button",{key:0,onClick:e[37]||(e[37]=re(p=>o.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)])]),o.searchModel?(E(),A("div",oFe,[o.modelsFiltered.length>0?(E(),A("div",rFe,[c("label",iFe," Search results: ("+H(o.modelsFiltered.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.mzl_collapsed?"":"max-h-96"])},[he(Ut,{name:"list"},{default:Be(()=>[(E(!0),A(Oe,null,Ze(o.modelsFiltered,(p,b)=>(E(),st(a,{ref_for:!0,ref:"modelZoo",key:"index-"+b+"-"+p.title,title:p.title,icon:p.icon,path:p.path,owner:p.owner,owner_link:p.owner_link,license:p.license,description:p.description,"is-installed":p.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onSelected,selected:p.title===r.configFile.model_name,model:p,model_type:p.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["title","icon","path","owner","owner_link","license","description","is-installed","on-install","on-uninstall","on-selected","selected","model","model_type","on-copy","on-copy-link","on-cancel-install"]))),128))]),_:1})],2)])):B("",!0)])):B("",!0),o.searchModel?B("",!0):(E(),A("div",aFe,[r.models&&r.models.length>0?(E(),A("div",lFe,[c("label",cFe," Models: ("+H(r.models.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.mzl_collapsed?"":"max-h-96"])},[he(Ut,{name:"list"},{default:Be(()=>[(E(!0),A(Oe,null,Ze(r.models,(p,b)=>(E(),st(a,{ref_for:!0,ref:"modelZoo",key:"index-"+b+"-"+p.title,title:p.title,icon:p.icon,path:p.path,owner:p.owner,owner_link:p.owner_link,license:p.license,description:p.description,"is-installed":p.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onSelected,selected:p.title===r.configFile.model_name,model:p,model_type:p.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["title","icon","path","owner","owner_link","license","description","is-installed","on-install","on-uninstall","on-selected","selected","model","model_type","on-copy","on-copy-link","on-cancel-install"]))),128))]),_:1})],2)])):B("",!0)])),o.mzl_collapsed?(E(),A("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[38]||(e[38]=(...p)=>r.open_mzl&&r.open_mzl(...p))},dFe)):(E(),A("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[39]||(e[39]=(...p)=>r.open_mzl&&r.open_mzl(...p))},fFe))],2)]),c("div",pFe,[c("div",gFe,[c("button",{onClick:e[40]||(e[40]=re(p=>o.mzdc_collapsed=!o.mzdc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[pe(c("div",null,_Fe,512),[[Qe,o.mzdc_collapsed]]),pe(c("div",null,yFe,512),[[Qe,!o.mzdc_collapsed]]),vFe,r.binding_name?B("",!0):(E(),A("div",wFe,[xFe,ye(" No binding selected! ")])),r.configFile.binding_name?(E(),A("div",kFe,"|")):B("",!0),r.configFile.binding_name?(E(),A("div",EFe,[c("div",CFe,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,AFe),c("h3",SFe,H(r.binding_name),1)])])):B("",!0)])]),c("div",{class:Me([{hidden:o.mzdc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",TFe,[c("div",MFe,[c("div",null,[c("div",OFe,[RFe,pe(c("input",{type:"text","onUpdate:modelValue":e[41]||(e[41]=p=>o.reference_path=p),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),[[Le,o.reference_path]])]),c("button",{type:"button",onClick:e[42]||(e[42]=re(p=>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")]),o.modelDownlaodInProgress?B("",!0):(E(),A("div",NFe,[c("div",DFe,[LFe,pe(c("input",{type:"text","onUpdate:modelValue":e[43]||(e[43]=p=>o.addModel.url=p),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),[[Le,o.addModel.url]])]),c("button",{type:"button",onClick:e[44]||(e[44]=re(p=>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")])),o.modelDownlaodInProgress?(E(),A("div",IFe,[PFe,c("div",FFe,[c("div",BFe,[c("div",$Fe,[jFe,c("span",zFe,H(Math.floor(o.addModel.progress))+"%",1)]),c("div",{class:"mx-1 opacity-80 line-clamp-1",title:o.addModel.url},H(o.addModel.url),9,UFe),c("div",qFe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:bt({width:o.addModel.progress+"%"})},null,4)]),c("div",HFe,[c("span",VFe,"Download speed: "+H(r.speed_computed)+"/s",1),c("span",GFe,H(r.downloaded_size_computed)+"/"+H(r.total_size_computed),1)])])]),c("div",KFe,[c("div",WFe,[c("div",ZFe,[c("button",{onClick:e[45]||(e[45]=re((...p)=>r.onCancelInstall&&r.onCancelInstall(...p),["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)]),c("div",YFe,[c("div",JFe,[c("button",{onClick:e[47]||(e[47]=re(p=>o.pzc_collapsed=!o.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[pe(c("div",null,XFe,512),[[Qe,o.pzc_collapsed]]),pe(c("div",null,tBe,512),[[Qe,!o.pzc_collapsed]]),nBe,r.configFile.personalities?(E(),A("div",sBe,"|")):B("",!0),c("div",oBe,H(r.active_pesonality),1),r.configFile.personalities?(E(),A("div",rBe,"|")):B("",!0),r.configFile.personalities?(E(),A("div",iBe,[r.mountedPersArr.length>0?(E(),A("div",aBe,[(E(!0),A(Oe,null,Ze(r.mountedPersArr,(p,b)=>(E(),A("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:b+"-"+p.name,ref_for:!0,ref:"mountedPersonalities"},[c("div",lBe,[c("button",{onClick:re(_=>r.onPersonalitySelected(p),["stop"])},[c("img",{src:o.bUrl+p.avatar,onError:e[46]||(e[46]=(..._)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(..._)),class:Me(["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(p.full_path)?"border-secondary":"border-transparent z-0"]),title:p.name},null,42,uBe)],8,cBe),c("button",{onClick:re(_=>r.onPersonalityMounted(p),["stop"])},fBe,8,dBe)])]))),128))])):B("",!0)])):B("",!0)])]),c("div",{class:Me([{hidden:o.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",pBe,[gBe,c("div",mBe,[c("div",_Be,[o.searchPersonalityInProgress?(E(),A("div",bBe,vBe)):B("",!0),o.searchPersonalityInProgress?B("",!0):(E(),A("div",wBe,kBe))]),pe(c("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[48]||(e[48]=p=>o.searchPersonality=p),onKeyup:e[49]||(e[49]=re((...p)=>r.searchPersonality_func&&r.searchPersonality_func(...p),["stop"]))},null,544),[[Le,o.searchPersonality]]),o.searchPersonality?(E(),A("button",{key:0,onClick:e[50]||(e[50]=re(p=>o.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)])]),o.searchPersonality?B("",!0):(E(),A("div",EBe,[c("label",CBe," Personalities Category: ("+H(o.persCatgArr.length)+") ",1),c("select",{id:"persCat",onChange:e[51]||(e[51]=p=>r.update_personality_category(p.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"},[(E(!0),A(Oe,null,Ze(o.persCatgArr,(p,b)=>(E(),A("option",{key:b,selected:p==this.configFile.personality_category},H(p),9,ABe))),128))],32)])),c("div",null,[o.personalitiesFiltered.length>0?(E(),A("div",SBe,[c("label",TBe,H(o.searchPersonality?"Search results":"Personalities")+": ("+H(o.personalitiesFiltered.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.pzl_collapsed?"":"max-h-96"])},[he(Ut,{name:"bounce"},{default:Be(()=>[(E(!0),A(Oe,null,Ze(o.personalitiesFiltered,(p,b)=>(E(),st(l,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+b+"-"+p.name,personality:p,full_path:p.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(_=>_===p.full_path),"on-selected":r.onPersonalitySelected,"on-mounted":r.onPersonalityMounted,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality},null,8,["personality","full_path","selected","on-selected","on-mounted","on-reinstall","on-settings"]))),128))]),_:1})],2)])):B("",!0)]),o.pzl_collapsed?(E(),A("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[52]||(e[52]=p=>o.pzl_collapsed=!o.pzl_collapsed)},OBe)):(E(),A("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[53]||(e[53]=p=>o.pzl_collapsed=!o.pzl_collapsed)},NBe))],2)]),c("div",DBe,[c("div",LBe,[c("button",{onClick:e[54]||(e[54]=re(p=>o.mc_collapsed=!o.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[pe(c("div",null,PBe,512),[[Qe,o.mc_collapsed]]),pe(c("div",null,BBe,512),[[Qe,!o.mc_collapsed]]),$Be])]),c("div",{class:Me([{hidden:o.mc_collapsed},"flex flex-col mb-2 p-2"])},[c("div",jBe,[c("div",zBe,[pe(c("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[55]||(e[55]=re(()=>{},["stop"])),"onUpdate:modelValue":e[56]||(e[56]=p=>r.configFile.override_personality_model_parameters=p),onChange:e[57]||(e[57]=p=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[kt,r.configFile.override_personality_model_parameters]]),UBe])]),c("div",{class:Me(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[c("div",qBe,[HBe,pe(c("input",{type:"text",id:"seed","onUpdate:modelValue":e[58]||(e[58]=p=>r.configFile.seed=p),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),[[Le,r.configFile.seed]])]),c("div",VBe,[c("div",GBe,[c("div",KBe,[WBe,c("p",ZBe,[pe(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[59]||(e[59]=p=>r.configFile.temperature=p),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,512),[[Le,r.configFile.temperature]])])]),pe(c("input",{id:"temperature",onChange:e[60]||(e[60]=p=>r.update_setting("temperature",p.target.value)),type:"range","onUpdate:modelValue":e[61]||(e[61]=p=>r.configFile.temperature=p),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),[[Le,r.configFile.temperature]])])]),c("div",YBe,[c("div",JBe,[c("div",QBe,[XBe,c("p",e$e,[pe(c("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[62]||(e[62]=p=>r.configFile.n_predict=p),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,512),[[Le,r.configFile.n_predict]])])]),pe(c("input",{id:"predict",onChange:e[63]||(e[63]=p=>r.update_setting("n_predict",p.target.value)),type:"range","onUpdate:modelValue":e[64]||(e[64]=p=>r.configFile.n_predict=p),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),[[Le,r.configFile.n_predict]])])]),c("div",t$e,[c("div",n$e,[c("div",s$e,[o$e,c("p",r$e,[pe(c("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[65]||(e[65]=p=>r.configFile.top_k=p),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,512),[[Le,r.configFile.top_k]])])]),pe(c("input",{id:"top_k",onChange:e[66]||(e[66]=p=>r.update_setting("top_k",p.target.value)),type:"range","onUpdate:modelValue":e[67]||(e[67]=p=>r.configFile.top_k=p),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),[[Le,r.configFile.top_k]])])]),c("div",i$e,[c("div",a$e,[c("div",l$e,[c$e,c("p",u$e,[pe(c("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[68]||(e[68]=p=>r.configFile.top_p=p),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,512),[[Le,r.configFile.top_p]])])]),pe(c("input",{id:"top_p",onChange:e[69]||(e[69]=p=>r.update_setting("top_p",p.target.value)),type:"range","onUpdate:modelValue":e[70]||(e[70]=p=>r.configFile.top_p=p),min:"0",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),[[Le,r.configFile.top_p]])])]),c("div",d$e,[c("div",h$e,[c("div",f$e,[p$e,c("p",g$e,[pe(c("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[71]||(e[71]=p=>r.configFile.repeat_penalty=p),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,512),[[Le,r.configFile.repeat_penalty]])])]),pe(c("input",{id:"repeat_penalty",onChange:e[72]||(e[72]=p=>r.update_setting("repeat_penalty",p.target.value)),type:"range","onUpdate:modelValue":e[73]||(e[73]=p=>r.configFile.repeat_penalty=p),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),[[Le,r.configFile.repeat_penalty]])])]),c("div",m$e,[c("div",_$e,[c("div",b$e,[y$e,c("p",v$e,[pe(c("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[74]||(e[74]=p=>r.configFile.repeat_last_n=p),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,512),[[Le,r.configFile.repeat_last_n]])])]),pe(c("input",{id:"repeat_last_n",onChange:e[75]||(e[75]=p=>r.update_setting("repeat_last_n",p.target.value)),type:"range","onUpdate:modelValue":e[76]||(e[76]=p=>r.configFile.repeat_last_n=p),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),[[Le,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),he(u,{ref:"yesNoDialog",class:"z-20"},null,512),he(d,{ref:"addmodeldialog"},null,512),he(h,{ref:"messageBox"},null,512),he(f,{ref:"toast"},null,512),he(g,{ref:"universalForm",class:"z-20"},null,512),he(m,{class:"z-20",show:o.variantSelectionDialogVisible,choices:o.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const x$e=Ue(HDe,[["render",w$e],["__scopeId","data-v-45255715"]]);const k$e={props:{value:String,inputType:{type:String,default:"text",validator:t=>["text","email","password","file","path","integer","float"].includes(t)},fileAccept:String},data(){return{inputValue:this.value,placeholderText:this.getPlaceholderText()}},watch:{value(t){console.log("Changing value to ",t),this.inputValue=t}},mounted(){be(()=>{ve.replace()}),console.log("Changing value to ",this.value),this.inputValue=this.value},methods:{handleSliderInput(t){this.inputValue=t.target.value,this.$emit("input",t.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(t){if(this.inputType==="integer"){const e=t.target.value.replace(/[^0-9]/g,"");this.inputValue=e}console.log("handling input : ",t.target.value),this.$emit("input",t.target.value)},async pasteFromClipboard(){try{const t=await navigator.clipboard.readText();this.handleClipboardData(t)}catch(t){console.error("Failed to read from clipboard:",t)}},handlePaste(t){const e=t.clipboardData.getData("text");this.handleClipboardData(e)},handleClipboardData(t){switch(this.inputType){case"email":this.inputValue=this.isValidEmail(t)?t:"";break;case"password":this.inputValue=t;break;case"file":case"path":this.inputValue="";break;case"integer":this.inputValue=this.parseInteger(t);break;case"float":this.inputValue=this.parseFloat(t);break;default:this.inputValue=t;break}},isValidEmail(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)},parseInteger(t){const e=parseInt(t);return isNaN(e)?"":e},parseFloat(t){const e=parseFloat(t);return isNaN(e)?"":e},openFileInput(){this.$refs.fileInput.click()},handleFileInputChange(t){const e=t.target.files[0];e&&(this.inputValue=e.name)}}},E$e={class:"flex items-center space-x-2"},C$e=["value","type","placeholder"],A$e=["value","min","max"],S$e=c("i",{"data-feather":"clipboard"},null,-1),T$e=[S$e],M$e=c("i",{"data-feather":"upload"},null,-1),O$e=[M$e],R$e=["accept"];function N$e(t,e,n,s,o,r){return E(),A("div",E$e,[t.useSlider?(E(),A("input",{key:1,type:"range",value:parseInt(o.inputValue),min:t.minSliderValue,max:t.maxSliderValue,onInput:e[2]||(e[2]=(...i)=>r.handleSliderInput&&r.handleSliderInput(...i)),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,A$e)):(E(),A("input",{key:0,value:o.inputValue,type:n.inputType,placeholder:o.placeholderText,onInput:e[0]||(e[0]=(...i)=>r.handleInput&&r.handleInput(...i)),onPaste:e[1]||(e[1]=(...i)=>r.handlePaste&&r.handlePaste(...i)),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,C$e)),c("button",{onClick:e[3]||(e[3]=(...i)=>r.pasteFromClipboard&&r.pasteFromClipboard(...i)),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"},T$e),n.inputType==="file"?(E(),A("button",{key:2,onClick:e[4]||(e[4]=(...i)=>r.openFileInput&&r.openFileInput(...i)),class:"p-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},O$e)):B("",!0),n.inputType==="file"?(E(),A("input",{key:3,ref:"fileInput",type:"file",style:{display:"none"},accept:n.fileAccept,onChange:e[5]||(e[5]=(...i)=>r.handleFileInputChange&&r.handleFileInputChange(...i))},null,40,R$e)):B("",!0)])}const $g=Ue(k$e,[["render",N$e]]);const D$e={props:{title:{type:String,default:""},isHorizontal:{type:Boolean,default:!1},cardWidth:{type:String,default:"w-3/4"},disableHoverAnimation:{type:Boolean,default:!1},disableFocus:{type:Boolean,default:!1}},data(){return{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-700","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)}}},L$e={key:0,class:"font-bold mb-2"},I$e={key:1,class:"flex flex-wrap"},P$e={key:2,class:"mb-2"};function F$e(t,e,n,s,o,r){return E(),A(Oe,null,[o.isActive?(E(),A("div",{key:0,class:"overlay",onClick:e[0]||(e[0]=(...i)=>r.toggleCard&&r.toggleCard(...i))})):B("",!0),c("div",{class:Me(["bg-white dark:bg-gray-700 border-blue-300 rounded-lg shadow-lg p-6",r.cardWidthClass,"m-2",{hovered:!n.disableHoverAnimation&&o.isHovered,active:o.isActive}]),onMouseenter:e[1]||(e[1]=i=>o.isHovered=!0),onMouseleave:e[2]||(e[2]=i=>o.isHovered=!1),onClick:e[3]||(e[3]=re((...i)=>r.toggleCard&&r.toggleCard(...i),["self"])),style:bt({cursor:this.disableFocus?"":"pointer"})},[n.title?(E(),A("div",L$e,H(n.title),1)):B("",!0),n.isHorizontal?(E(),A("div",I$e,[xr(t.$slots,"default")])):(E(),A("div",P$e,[xr(t.$slots,"default")]))],38)],64)}const jg=Ue(D$e,[["render",F$e]]),B$e={components:{ClipBoardTextInput:$g,Card:jg},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:"",selectedDataset:""}},methods:{submitForm(){const t={model_name:this.model_name,tokenizer_name:this.tokenizer_name,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};xe.post("/start_training",t).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(t){const e=t.target.files;e.length>0&&(this.selectedDataset=e[0])}},watch:{model_name(t){console.log("watching model_name",t),this.$refs.clipboardInput.inputValue=t}}},$$e={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"},j$e={class:"mb-4"},z$e=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),U$e={class:"mb-4"},q$e=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),H$e={class:"mb-4"},V$e=c("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),G$e={class:"mb-4"},K$e=c("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),W$e={class:"mb-4"},Z$e=c("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),Y$e={class:"mb-4"},J$e=c("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),Q$e={class:"mb-4"},X$e=c("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),eje={class:"mb-4"},tje=c("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),nje=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Train LLM",-1);function sje(t,e,n,s,o,r){const i=Ke("ClipBoardTextInput"),a=Ke("Card");return E(),A("div",$$e,[c("form",{onSubmit:e[0]||(e[0]=re((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[he(a,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Be(()=>[he(a,{title:"Model",class:"",isHorizontal:!1},{default:Be(()=>[c("div",j$e,[z$e,he(i,{id:"model_path",inputType:"text",value:o.model_name},null,8,["value"])]),c("div",U$e,[q$e,he(i,{id:"model_path",inputType:"text",value:o.tokenizer_name},null,8,["value"])])]),_:1}),he(a,{title:"Data",isHorizontal:!1},{default:Be(()=>[c("div",H$e,[V$e,he(i,{id:"model_path",inputType:"file",value:o.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),he(a,{title:"Training",isHorizontal:!1},{default:Be(()=>[c("div",G$e,[K$e,he(i,{id:"model_path",inputType:"integer",value:o.lr},null,8,["value"])]),c("div",W$e,[Z$e,he(i,{id:"model_path",inputType:"integer",value:o.num_epochs},null,8,["value"])]),c("div",Y$e,[J$e,he(i,{id:"model_path",inputType:"integer",value:o.max_length},null,8,["value"])]),c("div",Q$e,[X$e,he(i,{id:"model_path",inputType:"integer",value:o.batch_size},null,8,["value"])])]),_:1}),he(a,{title:"Output",isHorizontal:!1},{default:Be(()=>[c("div",eje,[tje,he(i,{id:"model_path",inputType:"text",value:t.output_dir},null,8,["value"])])]),_:1})]),_:1}),he(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Be(()=>[nje]),_:1})],32)])}const oje=Ue(B$e,[["render",sje]]),rje={components:{ClipBoardTextInput:$g,Card:jg},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(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(t){const e=t.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},ije={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"},aje={class:"mb-4"},lje=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),cje={class:"mb-4"},uje=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),dje=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function hje(t,e,n,s,o,r){const i=Ke("ClipBoardTextInput"),a=Ke("Card");return E(),A("div",ije,[c("form",{onSubmit:e[0]||(e[0]=re((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[he(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Be(()=>[he(a,{title:"Model",class:"",isHorizontal:!1},{default:Be(()=>[c("div",aje,[lje,he(i,{id:"model_path",inputType:"text",value:o.model_name},null,8,["value"])]),c("div",cje,[uje,he(i,{id:"model_path",inputType:"text",value:o.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),he(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Be(()=>[dje]),_:1})],32)])}const fje=Ue(rje,[["render",hje]]),pje={name:"Discussion",emits:["delete","select","editTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},chnageTitle(t){this.newTitle=t},checkedChangeEvent(t,e){this.$emit("checked",t,e)}},mounted(){this.newTitle=this.title,be(()=>{ve.replace()})},watch:{showConfirmation(){be(()=>{ve.replace()})},editTitleMode(t){this.showConfirmation=t,this.editTitle=t,t&&be(()=>{this.$refs.titleBox.focus()})},checkBoxValue(t,e){this.checkBoxValue_local=t}}},gje=["id"],mje={class:"flex flex-row items-center gap-2"},_je={key:0},bje=["title"],yje=["value"],vje={class:"flex items-center flex-1 max-h-6"},wje={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},xje=c("i",{"data-feather":"check"},null,-1),kje=[xje],Eje=c("i",{"data-feather":"x"},null,-1),Cje=[Eje],Aje={key:1,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Sje=c("i",{"data-feather":"x"},null,-1),Tje=[Sje],Mje=c("i",{"data-feather":"check"},null,-1),Oje=[Mje],Rje={key:2,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},Nje=c("i",{"data-feather":"edit-2"},null,-1),Dje=[Nje],Lje=c("i",{"data-feather":"trash"},null,-1),Ije=[Lje];function Pje(t,e,n,s,o,r){return E(),A("div",{class:Me([n.selected?"bg-bg-light-discussion dark:bg-bg-dark-discussion shadow-md min-w-[23rem] max-w-[23rem]":" min-w-[23rem] max-w-[23rem]","flex flex-row sm:flex-row flex-wrap flex-shrink: 0 item-center shadow-sm gap-2 py-2 my-2 hover:shadow-md hover:bg-primary-light dark:hover:bg-primary rounded-md p-2 duration-75 group cursor-pointer"]),id:"dis-"+n.id,onClick:e[13]||(e[13]=re(i=>r.selectEvent(),["stop"]))},[c("div",mje,[n.isCheckbox?(E(),A("div",_je,[pe(c("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]=re(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=i=>o.checkBoxValue_local=i),onInput:e[2]||(e[2]=i=>r.checkedChangeEvent(i,n.id))},null,544),[[kt,o.checkBoxValue_local]])])):B("",!0),n.selected?(E(),A("div",{key:1,class:Me(["min-h-full w-2 rounded-xl self-stretch",n.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):B("",!0),n.selected?B("",!0):(E(),A("div",{key:2,class:Me(["w-2",n.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),o.editTitle?B("",!0):(E(),A("p",{key:0,title:n.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},H(n.title?n.title==="untitled"?"New discussion":n.title:"New discussion"),9,bje)),o.editTitle?(E(),A("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:n.title,required:"",onKeydown:[e[3]||(e[3]=Ja(re(i=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=Ja(re(i=>o.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=i=>r.chnageTitle(i.target.value)),onClick:e[6]||(e[6]=re(()=>{},["stop"]))},null,40,yje)):B("",!0),c("div",vje,[o.showConfirmation&&!o.editTitleMode?(E(),A("div",wje,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:e[7]||(e[7]=re(i=>r.deleteEvent(),["stop"]))},kje),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:e[8]||(e[8]=re(i=>o.showConfirmation=!1,["stop"]))},Cje)])):B("",!0),o.showConfirmation&&o.editTitleMode?(E(),A("div",Aje,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[9]||(e[9]=re(i=>o.editTitleMode=!1,["stop"]))},Tje),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[10]||(e[10]=re(i=>r.editTitleEvent(),["stop"]))},Oje)])):B("",!0),o.showConfirmation?B("",!0):(E(),A("div",Rje,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[11]||(e[11]=re(i=>o.editTitleMode=!0,["stop"]))},Dje),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[12]||(e[12]=re(i=>o.showConfirmation=!0,["stop"]))},Ije)]))])],10,gje)}const zg=Ue(pje,[["render",Pje]]),Fje={props:{htmlContent:{type:String,required:!0}}},Bje=["innerHTML"];function $je(t,e,n,s,o,r){return E(),A("div",null,[c("div",{innerHTML:n.htmlContent},null,8,Bje)])}const jje=Ue(Fje,[["render",$je]]);const zje={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){if(console.log(typeof this.jsonData),typeof this.jsonData=="string"){let t=JSON.stringify(JSON.parse(this.jsonData),null," ").replace(/\n/g,"
");return console.log(t),console.log(this.jsonFormText),t}else{let t=JSON.stringify(this.jsonData,null," ").replace(/\n/g,"
");return console.log(t),console.log(this.jsonFormText),t}},isObject(){return console.log(typeof this.jsonData),console.log(this.jsonData),typeof this.jsonData=="object"&&this.jsonData!==null},isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")}},methods:{toggleCollapsed(){this.collapsed=!this.collapsed},toggleCollapsible(){this.collapsed=!this.collapsed}}},Uje={key:0},qje={class:"toggle-icon mr-1"},Hje={key:0,class:"fas fa-plus-circle text-gray-600"},Vje={key:1,class:"fas fa-minus-circle text-gray-600"},Gje={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},Kje={key:0,class:"fas fa-plus-circle text-gray-600"},Wje={key:1,class:"fas fa-minus-circle text-gray-600"},Zje=["innerHTML"];function Yje(t,e,n,s,o,r){return r.isContentPresent?(E(),A("div",Uje,[c("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...i)=>r.toggleCollapsible&&r.toggleCollapsible(...i))},[c("span",qje,[o.collapsed?(E(),A("i",Hje)):(E(),A("i",Vje))]),ye(" "+H(n.jsonFormText),1)]),pe(c("div",null,[c("div",Gje,[r.isObject?(E(),A("span",{key:0,onClick:e[1]||(e[1]=(...i)=>r.toggleCollapsed&&r.toggleCollapsed(...i)),class:"toggle-icon cursor-pointer mr-1"},[o.collapsed?(E(),A("i",Kje)):(E(),A("i",Wje))])):B("",!0),c("pre",{innerHTML:r.formattedJson},null,8,Zje)])],512),[[Qe,!o.collapsed]])])):B("",!0)}const Jje=Ue(zje,[["render",Yje]]),Qje={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0}}},Xje={class:"step flex items-center mb-4"},eze={class:"flex items-center justify-center w-6 h-6 mr-2"},tze={key:0},nze=c("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),sze=[nze],oze={key:1},rze=c("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),ize=[rze],aze={key:2},lze=c("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),cze=[lze],uze={key:0,role:"status"},dze=c("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"},[c("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"}),c("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),hze=[dze];function fze(t,e,n,s,o,r){return E(),A("div",Xje,[c("div",eze,[n.done?B("",!0):(E(),A("div",tze,sze)),n.done&&n.status?(E(),A("div",oze,ize)):B("",!0),n.done&&!n.status?(E(),A("div",aze,cze)):B("",!0)]),n.done?B("",!0):(E(),A("div",uze,hze)),c("div",{class:Me(["content flex-1 px-2",{"text-green-500":n.done,"text-yellow-500":!n.done}])},H(n.message),3)])}const pze=Ue(Qje,[["render",fze]]);const gze="/",mze={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:Ig,Step:pze,RenderHTMLJS:jje,JsonViewer:Jje},props:{message:Object,avatar:""},data(){return{msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){"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."),be(()=>{ve.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight})},methods:{onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let t=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(o=>o.name===this.$store.state.config.audio_out_voice)[0]);const n=o=>{let r=this.message.content.substring(o,o+e);const i=[".","!","?"];let a=-1;return i.forEach(l=>{const u=r.lastIndexOf(l);u>a&&(a=u)}),a==-1&&(a=r.length),console.log(a),a+o+1},s=()=>{const o=n(t),r=this.message.content.substring(t,o);this.msg.text=r,t=o+1,this.msg.onend=i=>{t{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",o))},this.speechSynthesis.speak(this.msg)};s()},toggleModel(){this.expanded=!this.expanded},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.editMsgMode=!1},resendMessage(){this.$emit("resendMessage",this.message.id,this.message.content)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?gze+this.avatar:Xn},defaultImg(t){t.target.src=Xn},parseDate(t){let e=new Date(Date.parse(t)),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":t},prettyDate(t){let e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," ")),n=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(n/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(n<60&&"just now"||n<120&&"1 minute ago"||n<3600&&Math.floor(n/60)+" minutes ago"||n<7200&&"1 hour ago"||n<86400&&Math.floor(n/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:{"message.content":function(t){this.$store.state.config.auto_speak&&(this.isSpeaking||this.checkForFullSentence())},showConfirmation(){be(()=>{ve.replace()})},editMsgMode(t){be(()=>{ve.replace()})},deleteMsgMode(){be(()=>{ve.replace()})}},computed:{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 t=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===t.getTime()||!e.getTime())return;let s=e.getTime()-t.getTime();const o=Math.floor(s/(1e3*60*60));s-=o*(1e3*60*60);const r=Math.floor(s/(1e3*60));s-=r*(1e3*60);const i=Math.floor(s/1e3);s-=i*1e3;function a(u){return u<10&&(u="0"+u),u}return a(o)+"h:"+a(r)+"m:"+a(i)+"s"}}},_ze={class:"relative group rounded-lg m-2 shadow-lg hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},bze={class:"flex flex-row gap-2"},yze={class:"flex-shrink-0"},vze={class:"group/avatar"},wze=["src","data-popover-target"],xze={class:"flex flex-col w-full flex-grow-0"},kze={class:"flex flex-row flex-grow items-start"},Eze={class:"flex flex-col mb-2"},Cze={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},Aze=["title"],Sze=c("div",{class:"flex-grow"},null,-1),Tze={class:"flex-row justify-end mx-2"},Mze={class:"invisible group-hover:visible flex flex-row"},Oze={key:0,class:"flex items-center duration-75"},Rze=c("i",{"data-feather":"x"},null,-1),Nze=[Rze],Dze=c("i",{"data-feather":"check"},null,-1),Lze=[Dze],Ize=c("i",{"data-feather":"edit"},null,-1),Pze=[Ize],Fze=c("i",{"data-feather":"copy"},null,-1),Bze=[Fze],$ze=c("i",{"data-feather":"refresh-cw"},null,-1),jze=[$ze],zze=c("i",{"data-feather":"fast-forward"},null,-1),Uze=[zze],qze={key:4,class:"flex items-center duration-75"},Hze=c("i",{"data-feather":"x"},null,-1),Vze=[Hze],Gze=c("i",{"data-feather":"check"},null,-1),Kze=[Gze],Wze=c("i",{"data-feather":"trash"},null,-1),Zze=[Wze],Yze=c("i",{"data-feather":"thumbs-up"},null,-1),Jze=[Yze],Qze={class:"flex flex-row items-center"},Xze=c("i",{"data-feather":"thumbs-down"},null,-1),eUe=[Xze],tUe={class:"flex flex-row items-center"},nUe=c("i",{"data-feather":"volume-2"},null,-1),sUe=[nUe],oUe={class:"overflow-x-auto w-full"},rUe={class:"flex flex-col items-start w-full"},iUe={class:"flex flex-col items-start w-full"},aUe={key:2},lUe={class:"text-sm text-gray-400 mt-2"},cUe={class:"flex flex-row items-center gap-2"},uUe={key:0},dUe={class:"font-thin"},hUe={key:1},fUe={class:"font-thin"},pUe={key:2},gUe={class:"font-thin"},mUe={key:3},_Ue=["title"];function bUe(t,e,n,s,o,r){const i=Ke("Step"),a=Ke("RenderHTMLJS"),l=Ke("MarkdownRenderer"),u=Ke("JsonViewer");return E(),A("div",_ze,[c("div",bze,[c("div",yze,[c("div",vze,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=d=>r.defaultImg(d)),"data-popover-target":"avatar"+n.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,wze)])]),c("div",xze,[c("div",kze,[c("div",Eze,[c("div",Cze,H(n.message.sender)+" ",1),n.message.created_at?(E(),A("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},H(r.created_at),9,Aze)):B("",!0)]),Sze,c("div",Tze,[c("div",Mze,[o.editMsgMode?(E(),A("div",Oze,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel edit",type:"button",onClick:e[1]||(e[1]=re(d=>o.editMsgMode=!1,["stop"]))},Nze),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[2]||(e[2]=re((...d)=>r.updateMessage&&r.updateMessage(...d),["stop"]))},Lze)])):B("",!0),o.editMsgMode?B("",!0):(E(),A("div",{key:1,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Edit message",onClick:e[3]||(e[3]=re(d=>o.editMsgMode=!0,["stop"]))},Pze)),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Copy message to clipboard",onClick:e[4]||(e[4]=re(d=>r.copyContentToClipboard(),["stop"]))},Bze),n.message.sender!=this.$store.state.mountedPers.name?(E(),A("div",{key:2,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Resend message",onClick:e[5]||(e[5]=re(d=>r.resendMessage(),["stop"]))},jze)):B("",!0),n.message.sender==this.$store.state.mountedPers.name?(E(),A("div",{key:3,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Resend message",onClick:e[6]||(e[6]=re(d=>r.continueMessage(),["stop"]))},Uze)):B("",!0),o.deleteMsgMode?(E(),A("div",qze,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel removal",type:"button",onClick:e[7]||(e[7]=re(d=>o.deleteMsgMode=!1,["stop"]))},Vze),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Confirm removal",type:"button",onClick:e[8]||(e[8]=re(d=>r.deleteMsg(),["stop"]))},Kze)])):B("",!0),o.deleteMsgMode?B("",!0):(E(),A("div",{key:5,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2",title:"Remove message",onClick:e[9]||(e[9]=d=>o.deleteMsgMode=!0)},Zze)),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Upvote",onClick:e[10]||(e[10]=re(d=>r.rankUp(),["stop"]))},Jze),c("div",Qze,[c("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2",title:"Downvote",onClick:e[11]||(e[11]=re(d=>r.rankDown(),["stop"]))},eUe),n.message.rank!=0?(E(),A("div",{key:0,class:Me(["rounded-full px-2 text-sm flex items-center justify-center font-bold",n.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},H(n.message.rank),3)):B("",!0)]),c("div",tUe,[c("div",{class:Me(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[12]||(e[12]=re(d=>r.speak(),["stop"]))},sUe,2)])])])]),c("div",oUe,[c("div",rUe,[(E(!0),A(Oe,null,Ze(n.message.steps,(d,h)=>(E(),A("div",{key:"step-"+n.message.id+"-"+h,class:"step font-bold",style:bt({backgroundColor:d.done?"transparent":"inherit"})},[he(i,{done:d.done,message:d.message,status:d.status},null,8,["done","message","status"])],4))),128))]),c("div",iUe,[(E(!0),A(Oe,null,Ze(n.message.html_js_s,(d,h)=>(E(),A("div",{key:"htmljs-"+n.message.id+"-"+h,class:"htmljs font-bold",style:bt({backgroundColor:t.step.done?"transparent":"inherit"})},[he(a,{htmlContent:d},null,8,["htmlContent"])],4))),128))]),o.editMsgMode?B("",!0):(E(),st(l,{key:0,ref:"mdRender","markdown-text":n.message.content},null,8,["markdown-text"])),o.editMsgMode?pe((E(),A("textarea",{key:1,ref:"mdTextarea",rows:4,class:"block p-2.5 w-full text-sm 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",style:bt({minHeight:o.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[13]||(e[13]=d=>this.message.content=d)},null,4)),[[Le,this.message.content]]):B("",!0),n.message.metadata!==null?(E(),A("div",aUe,[(E(!0),A(Oe,null,Ze(n.message.metadata,(d,h)=>(E(),A("div",{key:"json-"+n.message.id+"-"+h,class:"json font-bold"},[he(u,{jsonFormText:d.title,jsonData:d.content},null,8,["jsonFormText","jsonData"])]))),128))])):B("",!0)]),c("div",lUe,[c("div",cUe,[n.message.binding?(E(),A("p",uUe,[ye("Binding: "),c("span",dUe,H(n.message.binding),1)])):B("",!0),n.message.model?(E(),A("p",hUe,[ye("Model: "),c("span",fUe,H(n.message.model),1)])):B("",!0),n.message.seed?(E(),A("p",pUe,[ye("Seed: "),c("span",gUe,H(n.message.seed),1)])):B("",!0),r.time_spent?(E(),A("p",mUe,[ye("Time spent: "),c("span",{class:"font-thin",title:"Finished generating: "+r.finished_generating_at_parsed},H(r.time_spent),9,_Ue)])):B("",!0)])])])])])}const Ug=Ue(mze,[["render",bUe]]),yUe="/";xe.defaults.baseURL="/";const vUe={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{UniversalForm:yc},data(){return{bUrl:yUe,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(t){this.$store.commit("setConfig",t)}},mountedPers:{get(){return this.$store.state.mountedPers},set(t){this.$store.commit("setMountedPers",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{onSettingsPersonality(t){try{xe.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 - "+t.name,"Save changes","Cancel").then(n=>{try{xe.post("/set_active_personality_settings",n).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. +You need to select model before you leave, or else.`,"Ok","Cancel"),!1}},ie=t=>(ns("data-v-45255715"),t=t(),ss(),t),VDe={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-0"},GDe={class:"sticky top-0 z-10 flex flex-row mb-2 p-3 gap-3 w-full rounded-b-lg bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},KDe={key:0,class:"flex gap-3 flex-1 items-center duration-75"},WDe=ie(()=>c("i",{"data-feather":"x"},null,-1)),ZDe=[WDe],YDe=ie(()=>c("i",{"data-feather":"check"},null,-1)),JDe=[YDe],QDe={key:1,class:"flex gap-3 flex-1 items-center"},XDe=ie(()=>c("i",{"data-feather":"save"},null,-1)),eLe=[XDe],tLe=ie(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),nLe=[tLe],sLe=ie(()=>c("i",{"data-feather":"list"},null,-1)),oLe=[sLe],rLe={class:"flex gap-3 flex-1 items-center justify-end"},iLe={class:"flex gap-3 items-center"},aLe={key:0,class:"flex gap-3 items-center"},lLe=ie(()=>c("i",{"data-feather":"check"},null,-1)),cLe=[lLe],uLe={key:1,role:"status"},dLe=ie(()=>c("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"},[c("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"}),c("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)),hLe=ie(()=>c("span",{class:"sr-only"},"Loading...",-1)),fLe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},pLe={class:"flex flex-row p-3"},gLe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),mLe=[gLe],_Le=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),bLe=[_Le],yLe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),vLe=ie(()=>c("div",{class:"mr-2"},"|",-1)),wLe={class:"text-base font-semibold cursor-pointer select-none items-center"},xLe={class:"flex gap-2 items-center"},kLe={key:0},ELe={class:"flex gap-2 items-center"},CLe=["title"],ALe=os('',34),SLe=[ALe],TLe={class:"font-bold font-large text-lg"},MLe={key:1},OLe={class:"flex gap-2 items-center"},RLe=os('',1),NLe={class:"font-bold font-large text-lg"},DLe=ie(()=>c("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),LLe={class:"font-bold font-large text-lg"},ILe=ie(()=>c("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),PLe={class:"font-bold font-large text-lg"},FLe={class:"mb-2"},BLe=ie(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[c("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"})]),ye(" CPU Ram usage: ")],-1)),$Le={class:"flex flex-col mx-2"},jLe=ie(()=>c("b",null,"Avaliable ram: ",-1)),zLe=ie(()=>c("b",null,"Ram usage: ",-1)),ULe={class:"p-2"},qLe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},HLe={class:"mb-2"},VLe=ie(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),ye(" Disk usage: ")],-1)),GLe={class:"flex flex-col mx-2"},KLe=ie(()=>c("b",null,"Avaliable disk space: ",-1)),WLe=ie(()=>c("b",null,"Disk usage: ",-1)),ZLe={class:"p-2"},YLe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},JLe={class:"mb-2"},QLe=os('',1),XLe={class:"flex flex-col mx-2"},eIe=ie(()=>c("b",null,"Model: ",-1)),tIe=ie(()=>c("b",null,"Avaliable vram: ",-1)),nIe=ie(()=>c("b",null,"GPU usage: ",-1)),sIe={class:"p-2"},oIe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},rIe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},iIe={class:"flex flex-row p-3"},aIe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),lIe=[aIe],cIe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),uIe=[cIe],dIe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),hIe={class:"flex flex-col mb-2 px-3 pb-2"},fIe={class:"pb-2"},pIe={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"},gIe=ie(()=>c("th",null,"Generic",-1)),mIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),_Ie={style:{width:"100%"}},bIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),yIe=[bIe],vIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_gpu",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable GPU:")],-1)),wIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),xIe=[wIe],kIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),EIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),CIe=[EIe],AIe={class:"pb-2"},SIe={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"},TIe=ie(()=>c("th",null,"User",-1)),MIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),OIe={style:{width:"100%"}},RIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),NIe=[RIe],DIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),LIe={style:{width:"100%"}},IIe={for:"avatar-upload"},PIe=["src"],FIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),BIe=[FIe],$Ie=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),jIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),zIe=[jIe],UIe={class:"pb-2"},qIe={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"},HIe=ie(()=>c("th",null,"Audio",-1)),VIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),GIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),KIe=[GIe],WIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),ZIe={class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},YIe=ie(()=>c("i",{"data-feather":"check"},null,-1)),JIe=[YIe],QIe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),XIe=["value"],ePe=ie(()=>c("i",{"data-feather":"check"},null,-1)),tPe=[ePe],nPe=ie(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),sPe=["value"],oPe=ie(()=>c("i",{"data-feather":"check"},null,-1)),rPe=[oPe],iPe={class:"w-full"},aPe={class:"w-full"},lPe={class:"w-full"},cPe={key:0},uPe=ie(()=>c("i",{"data-feather":"alert-circle"},null,-1)),dPe=[uPe],hPe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},fPe={class:"flex flex-row p-3"},pPe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),gPe=[pPe],mPe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),_Pe=[mPe],bPe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),yPe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},vPe=ie(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),wPe={key:1,class:"mr-2"},xPe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},kPe={class:"flex gap-1 items-center"},EPe=["src"],CPe={class:"font-bold font-large text-lg line-clamp-1"},APe={key:0,class:"mb-2"},SPe={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},TPe=ie(()=>c("i",{"data-feather":"chevron-up"},null,-1)),MPe=[TPe],OPe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),RPe=[OPe],NPe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},DPe={class:"flex flex-row p-3"},LPe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),IPe=[LPe],PPe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),FPe=[PPe],BPe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),$Pe={class:"flex flex-row items-center"},jPe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},zPe=ie(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),UPe={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},qPe=ie(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),HPe={key:2,class:"mr-2"},VPe={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},GPe={class:"flex gap-1 items-center"},KPe=["src"],WPe={class:"font-bold font-large text-lg line-clamp-1"},ZPe={class:"mx-2 mb-4"},YPe={class:"relative"},JPe={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},QPe={key:0},XPe=ie(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),eFe=[XPe],tFe={key:1},nFe=ie(()=>c("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"},[c("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)),sFe=[nFe],oFe={key:0},rFe={key:0,class:"mb-2"},iFe={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},aFe={key:1},lFe={key:0,class:"mb-2"},cFe={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},uFe=ie(()=>c("i",{"data-feather":"chevron-up"},null,-1)),dFe=[uFe],hFe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),fFe=[hFe],pFe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},gFe={class:"flex flex-row p-3"},mFe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),_Fe=[mFe],bFe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),yFe=[bFe],vFe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Add models for binding",-1)),wFe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},xFe=ie(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),kFe={key:1,class:"mr-2"},EFe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},CFe={class:"flex gap-1 items-center"},AFe=["src"],SFe={class:"font-bold font-large text-lg line-clamp-1"},TFe={class:"mb-2"},MFe={class:"p-2"},OFe={class:"mb-3"},RFe=ie(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),NFe={key:0},DFe={class:"mb-3"},LFe=ie(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),IFe={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},PFe=ie(()=>c("div",{role:"status",class:"justify-center"},null,-1)),FFe={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},BFe={class:"w-full p-2"},$Fe={class:"flex justify-between mb-1"},jFe=os(' Downloading Loading...',1),zFe={class:"text-sm font-medium text-blue-700 dark:text-white"},UFe=["title"],qFe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},HFe={class:"flex justify-between mb-1"},VFe={class:"text-base font-medium text-blue-700 dark:text-white"},GFe={class:"text-sm font-medium text-blue-700 dark:text-white"},KFe={class:"flex flex-grow"},WFe={class:"flex flex-row flex-grow gap-3"},ZFe={class:"p-2 text-center grow"},YFe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},JFe={class:"flex flex-row p-3 items-center"},QFe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),XFe=[QFe],eBe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),tBe=[eBe],nBe=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),sBe={key:0,class:"mr-2"},oBe={class:"mr-2 font-bold font-large text-lg line-clamp-1"},rBe={key:1,class:"mr-2"},iBe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},aBe={key:0,class:"flex -space-x-4 items-center"},lBe={class:"group items-center flex flex-row"},cBe=["onClick"],uBe=["src","title"],dBe=["onClick"],hBe=ie(()=>c("span",{class:"hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[c("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"},[c("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)),fBe=[hBe],pBe={class:"mx-2 mb-4"},gBe=ie(()=>c("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),mBe={class:"relative"},_Be={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},bBe={key:0},yBe=ie(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),vBe=[yBe],wBe={key:1},xBe=ie(()=>c("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"},[c("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)),kBe=[xBe],EBe={key:0,class:"mx-2 mb-4"},CBe={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},ABe=["selected"],SBe={key:0,class:"mb-2"},TBe={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},MBe=ie(()=>c("i",{"data-feather":"chevron-up"},null,-1)),OBe=[MBe],RBe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),NBe=[RBe],DBe={class:"flex flex-col mb-2 p-3 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},LBe={class:"flex flex-row"},IBe=ie(()=>c("i",{"data-feather":"chevron-right"},null,-1)),PBe=[IBe],FBe=ie(()=>c("i",{"data-feather":"chevron-down"},null,-1)),BBe=[FBe],$Be=ie(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),jBe={class:"m-2"},zBe={class:"flex flex-row gap-2 items-center"},UBe=ie(()=>c("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),qBe={class:"m-2"},HBe=ie(()=>c("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),VBe={class:"m-2"},GBe={class:"flex flex-col align-bottom"},KBe={class:"relative"},WBe=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),ZBe={class:"absolute right-0"},YBe={class:"m-2"},JBe={class:"flex flex-col align-bottom"},QBe={class:"relative"},XBe=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),e$e={class:"absolute right-0"},t$e={class:"m-2"},n$e={class:"flex flex-col align-bottom"},s$e={class:"relative"},o$e=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),r$e={class:"absolute right-0"},i$e={class:"m-2"},a$e={class:"flex flex-col align-bottom"},l$e={class:"relative"},c$e=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),u$e={class:"absolute right-0"},d$e={class:"m-2"},h$e={class:"flex flex-col align-bottom"},f$e={class:"relative"},p$e=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),g$e={class:"absolute right-0"},m$e={class:"m-2"},_$e={class:"flex flex-col align-bottom"},b$e={class:"relative"},y$e=ie(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),v$e={class:"absolute right-0"};function w$e(t,e,n,s,o,r){const i=Ke("BindingEntry"),a=Ke("model-entry"),l=Ke("personality-entry"),u=Ke("YesNoDialog"),d=Ke("AddModelDialog"),h=Ke("MessageBox"),f=Ke("Toast"),g=Ke("UniversalForm"),m=Ke("ChoiceDialog");return E(),A(Oe,null,[c("div",VDe,[c("div",GDe,[o.showConfirmation?(E(),A("div",KDe,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=re(p=>o.showConfirmation=!1,["stop"]))},ZDe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=re(p=>r.save_configuration(),["stop"]))},JDe)])):B("",!0),o.showConfirmation?B("",!0):(E(),A("div",QDe,[c("button",{title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=p=>o.showConfirmation=!0)},eLe),c("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[3]||(e[3]=p=>r.reset_configuration())},nLe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[4]||(e[4]=re(p=>o.all_collapsed=!o.all_collapsed,["stop"]))},oLe)])),c("div",rLe,[c("div",iLe,[o.settingsChanged?(E(),A("div",aLe,[ye(" Apply changes: "),o.isLoading?B("",!0):(E(),A("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[5]||(e[5]=re(p=>r.applyConfiguration(),["stop"]))},cLe))])):B("",!0),o.isLoading?(E(),A("div",uLe,[c("p",null,H(o.loading_text),1),dLe,hLe])):B("",!0)])])]),c("div",{class:Me(o.isLoading?"pointer-events-none opacity-30":"")},[c("div",fLe,[c("div",pLe,[c("button",{onClick:e[6]||(e[6]=re(p=>o.sc_collapsed=!o.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[pe(c("div",null,mLe,512),[[Qe,o.sc_collapsed]]),pe(c("div",null,bLe,512),[[Qe,!o.sc_collapsed]]),yLe,vLe,c("div",wLe,[c("div",xLe,[c("div",null,[r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(E(),A("div",kLe,[(E(!0),A(Oe,null,Ze(r.vramUsage.gpus,p=>(E(),A("div",ELe,[(E(),A("svg",{title:p.gpu_model,"aria-hidden":"true",class:"w-10 h-10 fill-secondary",viewBox:"0 -3 82 66",fill:"none",xmlns:"http://www.w3.org/2000/svg"},SLe,8,CLe)),c("h3",TLe,[c("div",null,H(r.computedFileSize(p.used_vram))+" / "+H(r.computedFileSize(p.total_vram))+" ("+H(p.percentage)+"%) ",1)])]))),256))])):B("",!0),r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(E(),A("div",MLe,[c("div",OLe,[RLe,c("h3",NLe,[c("div",null,H(r.vramUsage.gpus.length)+"x ",1)])])])):B("",!0)]),DLe,c("h3",LLe,[c("div",null,H(r.ram_usage)+" / "+H(r.ram_total_space)+" ("+H(r.ram_percent_usage)+"%)",1)]),ILe,c("h3",PLe,[c("div",null,H(r.disk_binding_models_usage)+" / "+H(r.disk_total_space)+" ("+H(r.disk_percent_usage)+"%)",1)])])])])]),c("div",{class:Me([{hidden:o.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",FLe,[BLe,c("div",$Le,[c("div",null,[jLe,ye(H(r.ram_available_space),1)]),c("div",null,[zLe,ye(" "+H(r.ram_usage)+" / "+H(r.ram_total_space)+" ("+H(r.ram_percent_usage)+")% ",1)])]),c("div",ULe,[c("div",qLe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:bt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),c("div",HLe,[VLe,c("div",GLe,[c("div",null,[KLe,ye(H(r.disk_available_space),1)]),c("div",null,[WLe,ye(" "+H(r.disk_binding_models_usage)+" / "+H(r.disk_total_space)+" ("+H(r.disk_percent_usage)+"%)",1)])]),c("div",ZLe,[c("div",YLe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:bt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(E(!0),A(Oe,null,Ze(r.vramUsage.gpus,p=>(E(),A("div",JLe,[QLe,c("div",XLe,[c("div",null,[eIe,ye(H(p.gpu_model),1)]),c("div",null,[tIe,ye(H(this.computedFileSize(p.available_space)),1)]),c("div",null,[nIe,ye(" "+H(this.computedFileSize(p.used_vram))+" / "+H(this.computedFileSize(p.total_vram))+" ("+H(p.percentage)+"%)",1)])]),c("div",sIe,[c("div",oIe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:bt("width: "+p.percentage+"%;")},null,4)])])]))),256))],2)]),c("div",rIe,[c("div",iIe,[c("button",{onClick:e[7]||(e[7]=re(p=>o.minconf_collapsed=!o.minconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[pe(c("div",null,lIe,512),[[Qe,o.minconf_collapsed]]),pe(c("div",null,uIe,512),[[Qe,!o.minconf_collapsed]]),dIe])]),c("div",{class:Me([{hidden:o.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",hIe,[c("div",fIe,[c("table",pIe,[gIe,c("tr",null,[mIe,c("td",_Ie,[pe(c("input",{type:"text",id:"db_path",required:"","onUpdate:modelValue":e[8]||(e[8]=p=>r.db_path=p),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,512),[[Le,r.db_path]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[9]||(e[9]=p=>r.update_setting("db_path",r.db_path))},yIe)])]),c("tr",null,[vIe,c("td",null,[pe(c("input",{type:"checkbox",id:"enable_gpu",required:"","onUpdate:modelValue":e[10]||(e[10]=p=>r.enable_gpu=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,512),[[kt,r.enable_gpu]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[11]||(e[11]=p=>r.update_setting("enable_gpu",r.enable_gpu))},xIe)])]),c("tr",null,[kIe,c("td",null,[pe(c("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[12]||(e[12]=p=>r.auto_update=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,512),[[kt,r.auto_update]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[13]||(e[13]=p=>r.update_setting("auto_update",r.auto_update))},CIe)])])])]),c("div",AIe,[c("table",SIe,[TIe,c("tr",null,[MIe,c("td",OIe,[pe(c("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[14]||(e[14]=p=>r.userName=p),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,512),[[Le,r.userName]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[15]||(e[15]=p=>r.update_setting("user_name",r.userName))},NIe)])]),c("tr",null,[DIe,c("td",LIe,[c("label",IIe,[c("img",{src:r.user_avatar,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,PIe)]),c("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[16]||(e[16]=(...p)=>r.uploadAvatar&&r.uploadAvatar(...p))},null,32)]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[17]||(e[17]=p=>r.update_setting("user_name",r.userName))},BIe)])]),c("tr",null,[$Ie,c("td",null,[pe(c("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[18]||(e[18]=p=>r.use_user_name_in_discussions=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,512),[[kt,r.use_user_name_in_discussions]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[19]||(e[19]=p=>r.update_setting("use_user_name_in_discussions",r.use_user_name_in_discussions))},zIe)])])])]),c("div",UIe,[c("table",qIe,[HIe,c("tr",null,[VIe,c("td",null,[pe(c("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[20]||(e[20]=p=>r.auto_speak=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,512),[[kt,r.auto_speak]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[21]||(e[21]=p=>r.update_setting("auto_speak",r.auto_speak))},KIe)])]),c("tr",null,[WIe,c("td",null,[pe(c("input",{id:"audio_pitch","onUpdate:modelValue":e[22]||(e[22]=p=>r.audio_pitch=p),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,512),[[Le,r.audio_pitch]]),c("p",ZIe,H(r.audio_pitch),1)]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[23]||(e[23]=p=>r.update_setting("audio_pitch",r.audio_pitch))},JIe)])]),c("tr",null,[QIe,c("td",null,[pe(c("select",{id:"audio_in_language","onUpdate:modelValue":e[24]||(e[24]=p=>r.audio_in_language=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(E(!0),A(Oe,null,Ze(r.audioLanguages,p=>(E(),A("option",{key:p.code,value:p.code},H(p.name),9,XIe))),128))],512),[[Er,r.audio_in_language]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[25]||(e[25]=p=>r.update_setting("audio_in_language",r.audio_in_language))},tPe)])]),c("tr",null,[nPe,c("td",null,[pe(c("select",{id:"audio_out_voice","onUpdate:modelValue":e[26]||(e[26]=p=>r.audio_out_voice=p),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(E(!0),A(Oe,null,Ze(o.audioVoices,p=>(E(),A("option",{key:p.name,value:p.name},H(p.name),9,sPe))),128))],512),[[Er,r.audio_out_voice]])]),c("td",null,[c("button",{class:"hover:text-secondary dark:bg-gray-600 bg-blue-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[27]||(e[27]=p=>r.update_setting("audio_out_voice",r.audio_out_voice))},rPe)])])])])]),c("div",iPe,[c("button",{class:"hover:text-secondary dark:bg-gray-600 w-full bg-red-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[28]||(e[28]=p=>r.api_get_req("clear_uploads").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast(["failed!"],4,!1)}))}," Clear uploads ")]),c("div",aPe,[c("button",{class:"hover:text-secondary dark:bg-gray-600 w-full bg-red-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[29]||(e[29]=p=>r.api_get_req("restart_program").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast(["failed!"],4,!1)}))}," Restart program ")]),c("div",lPe,[c("button",{class:"hover:text-secondary dark:bg-gray-600 w-full bg-red-100 m-2 p-2 duration-75 flex justify-center w-full hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",onClick:e[30]||(e[30]=p=>r.api_get_req("update_software").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast("Success!",4,!0)}))},[ye(" Upgrade program "),o.has_updates?(E(),A("div",cPe,dPe)):B("",!0)])])],2)]),c("div",hPe,[c("div",fPe,[c("button",{onClick:e[31]||(e[31]=re(p=>o.bzc_collapsed=!o.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[pe(c("div",null,gPe,512),[[Qe,o.bzc_collapsed]]),pe(c("div",null,_Pe,512),[[Qe,!o.bzc_collapsed]]),bPe,r.configFile.binding_name?B("",!0):(E(),A("div",yPe,[vPe,ye(" No binding selected! ")])),r.configFile.binding_name?(E(),A("div",wPe,"|")):B("",!0),r.configFile.binding_name?(E(),A("div",xPe,[c("div",kPe,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,EPe),c("h3",CPe,H(r.binding_name),1)])])):B("",!0)])]),c("div",{class:Me([{hidden:o.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsArr.length>0?(E(),A("div",APe,[c("label",SPe," Bindings: ("+H(r.bindingsArr.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.bzl_collapsed?"":"max-h-96"])},[he(Ut,{name:"list"},{default:Be(()=>[(E(!0),A(Oe,null,Ze(r.bindingsArr,(p,b)=>(E(),st(i,{ref_for:!0,ref:"bindingZoo",key:"index-"+b+"-"+p.folder,binding:p,"on-selected":r.onSelectedBinding,"on-reinstall":r.onReinstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:p.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):B("",!0),o.bzl_collapsed?(E(),A("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[32]||(e[32]=p=>o.bzl_collapsed=!o.bzl_collapsed)},MPe)):(E(),A("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[33]||(e[33]=p=>o.bzl_collapsed=!o.bzl_collapsed)},RPe))],2)]),c("div",NPe,[c("div",DPe,[c("button",{onClick:e[34]||(e[34]=re(p=>o.mzc_collapsed=!o.mzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[pe(c("div",null,IPe,512),[[Qe,o.mzc_collapsed]]),pe(c("div",null,FPe,512),[[Qe,!o.mzc_collapsed]]),BPe,c("div",$Pe,[r.configFile.binding_name?B("",!0):(E(),A("div",jPe,[zPe,ye(" Select binding first! ")])),!o.isModelSelected&&r.configFile.binding_name?(E(),A("div",UPe,[qPe,ye(" No model selected! ")])):B("",!0),r.configFile.model_name?(E(),A("div",HPe,"|")):B("",!0),r.configFile.model_name?(E(),A("div",VPe,[c("div",GPe,[c("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,KPe),c("h3",WPe,H(r.model_name),1)])])):B("",!0)])])]),c("div",{class:Me([{hidden:o.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",ZPe,[c("div",YPe,[c("div",JPe,[o.searchModelInProgress?(E(),A("div",QPe,eFe)):B("",!0),o.searchModelInProgress?B("",!0):(E(),A("div",tFe,sFe))]),pe(c("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[35]||(e[35]=p=>o.searchModel=p),onKeyup:e[36]||(e[36]=re((...p)=>r.searchModel_func&&r.searchModel_func(...p),["stop"]))},null,544),[[Le,o.searchModel]]),o.searchModel?(E(),A("button",{key:0,onClick:e[37]||(e[37]=re(p=>o.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)])]),o.searchModel?(E(),A("div",oFe,[o.modelsFiltered.length>0?(E(),A("div",rFe,[c("label",iFe," Search results: ("+H(o.modelsFiltered.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.mzl_collapsed?"":"max-h-96"])},[he(Ut,{name:"list"},{default:Be(()=>[(E(!0),A(Oe,null,Ze(o.modelsFiltered,(p,b)=>(E(),st(a,{ref_for:!0,ref:"modelZoo",key:"index-"+b+"-"+p.title,title:p.title,icon:p.icon,path:p.path,owner:p.owner,owner_link:p.owner_link,license:p.license,description:p.description,"is-installed":p.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onSelected,selected:p.title===r.configFile.model_name,model:p,model_type:p.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["title","icon","path","owner","owner_link","license","description","is-installed","on-install","on-uninstall","on-selected","selected","model","model_type","on-copy","on-copy-link","on-cancel-install"]))),128))]),_:1})],2)])):B("",!0)])):B("",!0),o.searchModel?B("",!0):(E(),A("div",aFe,[r.models&&r.models.length>0?(E(),A("div",lFe,[c("label",cFe," Models: ("+H(r.models.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.mzl_collapsed?"":"max-h-96"])},[he(Ut,{name:"list"},{default:Be(()=>[(E(!0),A(Oe,null,Ze(r.models,(p,b)=>(E(),st(a,{ref_for:!0,ref:"modelZoo",key:"index-"+b+"-"+p.title,title:p.title,icon:p.icon,path:p.path,owner:p.owner,owner_link:p.owner_link,license:p.license,description:p.description,"is-installed":p.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onSelected,selected:p.title===r.configFile.model_name,model:p,model_type:p.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["title","icon","path","owner","owner_link","license","description","is-installed","on-install","on-uninstall","on-selected","selected","model","model_type","on-copy","on-copy-link","on-cancel-install"]))),128))]),_:1})],2)])):B("",!0)])),o.mzl_collapsed?(E(),A("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[38]||(e[38]=(...p)=>r.open_mzl&&r.open_mzl(...p))},dFe)):(E(),A("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[39]||(e[39]=(...p)=>r.open_mzl&&r.open_mzl(...p))},fFe))],2)]),c("div",pFe,[c("div",gFe,[c("button",{onClick:e[40]||(e[40]=re(p=>o.mzdc_collapsed=!o.mzdc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[pe(c("div",null,_Fe,512),[[Qe,o.mzdc_collapsed]]),pe(c("div",null,yFe,512),[[Qe,!o.mzdc_collapsed]]),vFe,r.binding_name?B("",!0):(E(),A("div",wFe,[xFe,ye(" No binding selected! ")])),r.configFile.binding_name?(E(),A("div",kFe,"|")):B("",!0),r.configFile.binding_name?(E(),A("div",EFe,[c("div",CFe,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,AFe),c("h3",SFe,H(r.binding_name),1)])])):B("",!0)])]),c("div",{class:Me([{hidden:o.mzdc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",TFe,[c("div",MFe,[c("div",null,[c("div",OFe,[RFe,pe(c("input",{type:"text","onUpdate:modelValue":e[41]||(e[41]=p=>o.reference_path=p),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),[[Le,o.reference_path]])]),c("button",{type:"button",onClick:e[42]||(e[42]=re(p=>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")]),o.modelDownlaodInProgress?B("",!0):(E(),A("div",NFe,[c("div",DFe,[LFe,pe(c("input",{type:"text","onUpdate:modelValue":e[43]||(e[43]=p=>o.addModel.url=p),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),[[Le,o.addModel.url]])]),c("button",{type:"button",onClick:e[44]||(e[44]=re(p=>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")])),o.modelDownlaodInProgress?(E(),A("div",IFe,[PFe,c("div",FFe,[c("div",BFe,[c("div",$Fe,[jFe,c("span",zFe,H(Math.floor(o.addModel.progress))+"%",1)]),c("div",{class:"mx-1 opacity-80 line-clamp-1",title:o.addModel.url},H(o.addModel.url),9,UFe),c("div",qFe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:bt({width:o.addModel.progress+"%"})},null,4)]),c("div",HFe,[c("span",VFe,"Download speed: "+H(r.speed_computed)+"/s",1),c("span",GFe,H(r.downloaded_size_computed)+"/"+H(r.total_size_computed),1)])])]),c("div",KFe,[c("div",WFe,[c("div",ZFe,[c("button",{onClick:e[45]||(e[45]=re((...p)=>r.onCancelInstall&&r.onCancelInstall(...p),["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)]),c("div",YFe,[c("div",JFe,[c("button",{onClick:e[47]||(e[47]=re(p=>o.pzc_collapsed=!o.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[pe(c("div",null,XFe,512),[[Qe,o.pzc_collapsed]]),pe(c("div",null,tBe,512),[[Qe,!o.pzc_collapsed]]),nBe,r.configFile.personalities?(E(),A("div",sBe,"|")):B("",!0),c("div",oBe,H(r.active_pesonality),1),r.configFile.personalities?(E(),A("div",rBe,"|")):B("",!0),r.configFile.personalities?(E(),A("div",iBe,[r.mountedPersArr.length>0?(E(),A("div",aBe,[(E(!0),A(Oe,null,Ze(r.mountedPersArr,(p,b)=>(E(),A("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:b+"-"+p.name,ref_for:!0,ref:"mountedPersonalities"},[c("div",lBe,[c("button",{onClick:re(_=>r.onPersonalitySelected(p),["stop"])},[c("img",{src:o.bUrl+p.avatar,onError:e[46]||(e[46]=(..._)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(..._)),class:Me(["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(p.full_path)?"border-secondary":"border-transparent z-0"]),title:p.name},null,42,uBe)],8,cBe),c("button",{onClick:re(_=>r.onPersonalityMounted(p),["stop"])},fBe,8,dBe)])]))),128))])):B("",!0)])):B("",!0)])]),c("div",{class:Me([{hidden:o.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",pBe,[gBe,c("div",mBe,[c("div",_Be,[o.searchPersonalityInProgress?(E(),A("div",bBe,vBe)):B("",!0),o.searchPersonalityInProgress?B("",!0):(E(),A("div",wBe,kBe))]),pe(c("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[48]||(e[48]=p=>o.searchPersonality=p),onKeyup:e[49]||(e[49]=re((...p)=>r.searchPersonality_func&&r.searchPersonality_func(...p),["stop"]))},null,544),[[Le,o.searchPersonality]]),o.searchPersonality?(E(),A("button",{key:0,onClick:e[50]||(e[50]=re(p=>o.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)])]),o.searchPersonality?B("",!0):(E(),A("div",EBe,[c("label",CBe," Personalities Category: ("+H(o.persCatgArr.length)+") ",1),c("select",{id:"persCat",onChange:e[51]||(e[51]=p=>r.update_personality_category(p.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"},[(E(!0),A(Oe,null,Ze(o.persCatgArr,(p,b)=>(E(),A("option",{key:b,selected:p==this.configFile.personality_category},H(p),9,ABe))),128))],32)])),c("div",null,[o.personalitiesFiltered.length>0?(E(),A("div",SBe,[c("label",TBe,H(o.searchPersonality?"Search results":"Personalities")+": ("+H(o.personalitiesFiltered.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.pzl_collapsed?"":"max-h-96"])},[he(Ut,{name:"bounce"},{default:Be(()=>[(E(!0),A(Oe,null,Ze(o.personalitiesFiltered,(p,b)=>(E(),st(l,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+b+"-"+p.name,personality:p,full_path:p.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(_=>_===p.full_path),"on-selected":r.onPersonalitySelected,"on-mounted":r.onPersonalityMounted,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality},null,8,["personality","full_path","selected","on-selected","on-mounted","on-reinstall","on-settings"]))),128))]),_:1})],2)])):B("",!0)]),o.pzl_collapsed?(E(),A("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[52]||(e[52]=p=>o.pzl_collapsed=!o.pzl_collapsed)},OBe)):(E(),A("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[53]||(e[53]=p=>o.pzl_collapsed=!o.pzl_collapsed)},NBe))],2)]),c("div",DBe,[c("div",LBe,[c("button",{onClick:e[54]||(e[54]=re(p=>o.mc_collapsed=!o.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[pe(c("div",null,PBe,512),[[Qe,o.mc_collapsed]]),pe(c("div",null,BBe,512),[[Qe,!o.mc_collapsed]]),$Be])]),c("div",{class:Me([{hidden:o.mc_collapsed},"flex flex-col mb-2 p-2"])},[c("div",jBe,[c("div",zBe,[pe(c("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[55]||(e[55]=re(()=>{},["stop"])),"onUpdate:modelValue":e[56]||(e[56]=p=>r.configFile.override_personality_model_parameters=p),onChange:e[57]||(e[57]=p=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[kt,r.configFile.override_personality_model_parameters]]),UBe])]),c("div",{class:Me(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[c("div",qBe,[HBe,pe(c("input",{type:"text",id:"seed","onUpdate:modelValue":e[58]||(e[58]=p=>r.configFile.seed=p),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),[[Le,r.configFile.seed]])]),c("div",VBe,[c("div",GBe,[c("div",KBe,[WBe,c("p",ZBe,[pe(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[59]||(e[59]=p=>r.configFile.temperature=p),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,512),[[Le,r.configFile.temperature]])])]),pe(c("input",{id:"temperature",onChange:e[60]||(e[60]=p=>r.update_setting("temperature",p.target.value)),type:"range","onUpdate:modelValue":e[61]||(e[61]=p=>r.configFile.temperature=p),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),[[Le,r.configFile.temperature]])])]),c("div",YBe,[c("div",JBe,[c("div",QBe,[XBe,c("p",e$e,[pe(c("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[62]||(e[62]=p=>r.configFile.n_predict=p),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,512),[[Le,r.configFile.n_predict]])])]),pe(c("input",{id:"predict",onChange:e[63]||(e[63]=p=>r.update_setting("n_predict",p.target.value)),type:"range","onUpdate:modelValue":e[64]||(e[64]=p=>r.configFile.n_predict=p),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),[[Le,r.configFile.n_predict]])])]),c("div",t$e,[c("div",n$e,[c("div",s$e,[o$e,c("p",r$e,[pe(c("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[65]||(e[65]=p=>r.configFile.top_k=p),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,512),[[Le,r.configFile.top_k]])])]),pe(c("input",{id:"top_k",onChange:e[66]||(e[66]=p=>r.update_setting("top_k",p.target.value)),type:"range","onUpdate:modelValue":e[67]||(e[67]=p=>r.configFile.top_k=p),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),[[Le,r.configFile.top_k]])])]),c("div",i$e,[c("div",a$e,[c("div",l$e,[c$e,c("p",u$e,[pe(c("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[68]||(e[68]=p=>r.configFile.top_p=p),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,512),[[Le,r.configFile.top_p]])])]),pe(c("input",{id:"top_p",onChange:e[69]||(e[69]=p=>r.update_setting("top_p",p.target.value)),type:"range","onUpdate:modelValue":e[70]||(e[70]=p=>r.configFile.top_p=p),min:"0",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),[[Le,r.configFile.top_p]])])]),c("div",d$e,[c("div",h$e,[c("div",f$e,[p$e,c("p",g$e,[pe(c("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[71]||(e[71]=p=>r.configFile.repeat_penalty=p),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,512),[[Le,r.configFile.repeat_penalty]])])]),pe(c("input",{id:"repeat_penalty",onChange:e[72]||(e[72]=p=>r.update_setting("repeat_penalty",p.target.value)),type:"range","onUpdate:modelValue":e[73]||(e[73]=p=>r.configFile.repeat_penalty=p),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),[[Le,r.configFile.repeat_penalty]])])]),c("div",m$e,[c("div",_$e,[c("div",b$e,[y$e,c("p",v$e,[pe(c("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[74]||(e[74]=p=>r.configFile.repeat_last_n=p),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,512),[[Le,r.configFile.repeat_last_n]])])]),pe(c("input",{id:"repeat_last_n",onChange:e[75]||(e[75]=p=>r.update_setting("repeat_last_n",p.target.value)),type:"range","onUpdate:modelValue":e[76]||(e[76]=p=>r.configFile.repeat_last_n=p),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),[[Le,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),he(u,{ref:"yesNoDialog",class:"z-20"},null,512),he(d,{ref:"addmodeldialog"},null,512),he(h,{ref:"messageBox"},null,512),he(f,{ref:"toast"},null,512),he(g,{ref:"universalForm",class:"z-20"},null,512),he(m,{class:"z-20",show:o.variantSelectionDialogVisible,choices:o.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const x$e=Ue(HDe,[["render",w$e],["__scopeId","data-v-45255715"]]);const k$e={props:{value:String,inputType:{type:String,default:"text",validator:t=>["text","email","password","file","path","integer","float"].includes(t)},fileAccept:String},data(){return{inputValue:this.value,placeholderText:this.getPlaceholderText()}},watch:{value(t){console.log("Changing value to ",t),this.inputValue=t}},mounted(){be(()=>{ve.replace()}),console.log("Changing value to ",this.value),this.inputValue=this.value},methods:{handleSliderInput(t){this.inputValue=t.target.value,this.$emit("input",t.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(t){if(this.inputType==="integer"){const e=t.target.value.replace(/[^0-9]/g,"");this.inputValue=e}console.log("handling input : ",t.target.value),this.$emit("input",t.target.value)},async pasteFromClipboard(){try{const t=await navigator.clipboard.readText();this.handleClipboardData(t)}catch(t){console.error("Failed to read from clipboard:",t)}},handlePaste(t){const e=t.clipboardData.getData("text");this.handleClipboardData(e)},handleClipboardData(t){switch(this.inputType){case"email":this.inputValue=this.isValidEmail(t)?t:"";break;case"password":this.inputValue=t;break;case"file":case"path":this.inputValue="";break;case"integer":this.inputValue=this.parseInteger(t);break;case"float":this.inputValue=this.parseFloat(t);break;default:this.inputValue=t;break}},isValidEmail(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)},parseInteger(t){const e=parseInt(t);return isNaN(e)?"":e},parseFloat(t){const e=parseFloat(t);return isNaN(e)?"":e},openFileInput(){this.$refs.fileInput.click()},handleFileInputChange(t){const e=t.target.files[0];e&&(this.inputValue=e.name)}}},E$e={class:"flex items-center space-x-2"},C$e=["value","type","placeholder"],A$e=["value","min","max"],S$e=c("i",{"data-feather":"clipboard"},null,-1),T$e=[S$e],M$e=c("i",{"data-feather":"upload"},null,-1),O$e=[M$e],R$e=["accept"];function N$e(t,e,n,s,o,r){return E(),A("div",E$e,[t.useSlider?(E(),A("input",{key:1,type:"range",value:parseInt(o.inputValue),min:t.minSliderValue,max:t.maxSliderValue,onInput:e[2]||(e[2]=(...i)=>r.handleSliderInput&&r.handleSliderInput(...i)),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,A$e)):(E(),A("input",{key:0,value:o.inputValue,type:n.inputType,placeholder:o.placeholderText,onInput:e[0]||(e[0]=(...i)=>r.handleInput&&r.handleInput(...i)),onPaste:e[1]||(e[1]=(...i)=>r.handlePaste&&r.handlePaste(...i)),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,C$e)),c("button",{onClick:e[3]||(e[3]=(...i)=>r.pasteFromClipboard&&r.pasteFromClipboard(...i)),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"},T$e),n.inputType==="file"?(E(),A("button",{key:2,onClick:e[4]||(e[4]=(...i)=>r.openFileInput&&r.openFileInput(...i)),class:"p-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},O$e)):B("",!0),n.inputType==="file"?(E(),A("input",{key:3,ref:"fileInput",type:"file",style:{display:"none"},accept:n.fileAccept,onChange:e[5]||(e[5]=(...i)=>r.handleFileInputChange&&r.handleFileInputChange(...i))},null,40,R$e)):B("",!0)])}const $g=Ue(k$e,[["render",N$e]]);const D$e={props:{title:{type:String,default:""},isHorizontal:{type:Boolean,default:!1},cardWidth:{type:String,default:"w-3/4"},disableHoverAnimation:{type:Boolean,default:!1},disableFocus:{type:Boolean,default:!1}},data(){return{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-700","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)}}},L$e={key:0,class:"font-bold mb-2"},I$e={key:1,class:"flex flex-wrap"},P$e={key:2,class:"mb-2"};function F$e(t,e,n,s,o,r){return E(),A(Oe,null,[o.isActive?(E(),A("div",{key:0,class:"overlay",onClick:e[0]||(e[0]=(...i)=>r.toggleCard&&r.toggleCard(...i))})):B("",!0),c("div",{class:Me(["bg-white dark:bg-gray-700 border-blue-300 rounded-lg shadow-lg p-6",r.cardWidthClass,"m-2",{hovered:!n.disableHoverAnimation&&o.isHovered,active:o.isActive}]),onMouseenter:e[1]||(e[1]=i=>o.isHovered=!0),onMouseleave:e[2]||(e[2]=i=>o.isHovered=!1),onClick:e[3]||(e[3]=re((...i)=>r.toggleCard&&r.toggleCard(...i),["self"])),style:bt({cursor:this.disableFocus?"":"pointer"})},[n.title?(E(),A("div",L$e,H(n.title),1)):B("",!0),n.isHorizontal?(E(),A("div",I$e,[xr(t.$slots,"default")])):(E(),A("div",P$e,[xr(t.$slots,"default")]))],38)],64)}const jg=Ue(D$e,[["render",F$e]]),B$e={components:{ClipBoardTextInput:$g,Card:jg},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:"",selectedDataset:""}},methods:{submitForm(){const t={model_name:this.model_name,tokenizer_name:this.tokenizer_name,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};xe.post("/start_training",t).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(t){const e=t.target.files;e.length>0&&(this.selectedDataset=e[0])}},watch:{model_name(t){console.log("watching model_name",t),this.$refs.clipboardInput.inputValue=t}}},$$e={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"},j$e={class:"mb-4"},z$e=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),U$e={class:"mb-4"},q$e=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),H$e={class:"mb-4"},V$e=c("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),G$e={class:"mb-4"},K$e=c("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),W$e={class:"mb-4"},Z$e=c("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),Y$e={class:"mb-4"},J$e=c("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),Q$e={class:"mb-4"},X$e=c("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),eje={class:"mb-4"},tje=c("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),nje=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Train LLM",-1);function sje(t,e,n,s,o,r){const i=Ke("ClipBoardTextInput"),a=Ke("Card");return E(),A("div",$$e,[c("form",{onSubmit:e[0]||(e[0]=re((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[he(a,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Be(()=>[he(a,{title:"Model",class:"",isHorizontal:!1},{default:Be(()=>[c("div",j$e,[z$e,he(i,{id:"model_path",inputType:"text",value:o.model_name},null,8,["value"])]),c("div",U$e,[q$e,he(i,{id:"model_path",inputType:"text",value:o.tokenizer_name},null,8,["value"])])]),_:1}),he(a,{title:"Data",isHorizontal:!1},{default:Be(()=>[c("div",H$e,[V$e,he(i,{id:"model_path",inputType:"file",value:o.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),he(a,{title:"Training",isHorizontal:!1},{default:Be(()=>[c("div",G$e,[K$e,he(i,{id:"model_path",inputType:"integer",value:o.lr},null,8,["value"])]),c("div",W$e,[Z$e,he(i,{id:"model_path",inputType:"integer",value:o.num_epochs},null,8,["value"])]),c("div",Y$e,[J$e,he(i,{id:"model_path",inputType:"integer",value:o.max_length},null,8,["value"])]),c("div",Q$e,[X$e,he(i,{id:"model_path",inputType:"integer",value:o.batch_size},null,8,["value"])])]),_:1}),he(a,{title:"Output",isHorizontal:!1},{default:Be(()=>[c("div",eje,[tje,he(i,{id:"model_path",inputType:"text",value:t.output_dir},null,8,["value"])])]),_:1})]),_:1}),he(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Be(()=>[nje]),_:1})],32)])}const oje=Ue(B$e,[["render",sje]]),rje={components:{ClipBoardTextInput:$g,Card:jg},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(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(t){const e=t.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},ije={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"},aje={class:"mb-4"},lje=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),cje={class:"mb-4"},uje=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),dje=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function hje(t,e,n,s,o,r){const i=Ke("ClipBoardTextInput"),a=Ke("Card");return E(),A("div",ije,[c("form",{onSubmit:e[0]||(e[0]=re((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[he(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Be(()=>[he(a,{title:"Model",class:"",isHorizontal:!1},{default:Be(()=>[c("div",aje,[lje,he(i,{id:"model_path",inputType:"text",value:o.model_name},null,8,["value"])]),c("div",cje,[uje,he(i,{id:"model_path",inputType:"text",value:o.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),he(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Be(()=>[dje]),_:1})],32)])}const fje=Ue(rje,[["render",hje]]),pje={name:"Discussion",emits:["delete","select","editTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},chnageTitle(t){this.newTitle=t},checkedChangeEvent(t,e){this.$emit("checked",t,e)}},mounted(){this.newTitle=this.title,be(()=>{ve.replace()})},watch:{showConfirmation(){be(()=>{ve.replace()})},editTitleMode(t){this.showConfirmation=t,this.editTitle=t,t&&be(()=>{this.$refs.titleBox.focus()})},checkBoxValue(t,e){this.checkBoxValue_local=t}}},gje=["id"],mje={class:"flex flex-row items-center gap-2"},_je={key:0},bje=["title"],yje=["value"],vje={class:"flex items-center flex-1 max-h-6"},wje={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},xje=c("i",{"data-feather":"check"},null,-1),kje=[xje],Eje=c("i",{"data-feather":"x"},null,-1),Cje=[Eje],Aje={key:1,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Sje=c("i",{"data-feather":"x"},null,-1),Tje=[Sje],Mje=c("i",{"data-feather":"check"},null,-1),Oje=[Mje],Rje={key:2,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},Nje=c("i",{"data-feather":"edit-2"},null,-1),Dje=[Nje],Lje=c("i",{"data-feather":"trash"},null,-1),Ije=[Lje];function Pje(t,e,n,s,o,r){return E(),A("div",{class:Me([n.selected?"bg-bg-light-discussion dark:bg-bg-dark-discussion shadow-md min-w-[23rem] max-w-[23rem]":" min-w-[23rem] max-w-[23rem]","flex flex-row sm:flex-row flex-wrap flex-shrink: 0 item-center shadow-sm gap-2 py-2 my-2 hover:shadow-md hover:bg-primary-light dark:hover:bg-primary rounded-md p-2 duration-75 group cursor-pointer"]),id:"dis-"+n.id,onClick:e[13]||(e[13]=re(i=>r.selectEvent(),["stop"]))},[c("div",mje,[n.isCheckbox?(E(),A("div",_je,[pe(c("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]=re(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=i=>o.checkBoxValue_local=i),onInput:e[2]||(e[2]=i=>r.checkedChangeEvent(i,n.id))},null,544),[[kt,o.checkBoxValue_local]])])):B("",!0),n.selected?(E(),A("div",{key:1,class:Me(["min-h-full w-2 rounded-xl self-stretch",n.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):B("",!0),n.selected?B("",!0):(E(),A("div",{key:2,class:Me(["w-2",n.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),o.editTitle?B("",!0):(E(),A("p",{key:0,title:n.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},H(n.title?n.title==="untitled"?"New discussion":n.title:"New discussion"),9,bje)),o.editTitle?(E(),A("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:n.title,required:"",onKeydown:[e[3]||(e[3]=Ja(re(i=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=Ja(re(i=>o.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=i=>r.chnageTitle(i.target.value)),onClick:e[6]||(e[6]=re(()=>{},["stop"]))},null,40,yje)):B("",!0),c("div",vje,[o.showConfirmation&&!o.editTitleMode?(E(),A("div",wje,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:e[7]||(e[7]=re(i=>r.deleteEvent(),["stop"]))},kje),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:e[8]||(e[8]=re(i=>o.showConfirmation=!1,["stop"]))},Cje)])):B("",!0),o.showConfirmation&&o.editTitleMode?(E(),A("div",Aje,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[9]||(e[9]=re(i=>o.editTitleMode=!1,["stop"]))},Tje),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[10]||(e[10]=re(i=>r.editTitleEvent(),["stop"]))},Oje)])):B("",!0),o.showConfirmation?B("",!0):(E(),A("div",Rje,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[11]||(e[11]=re(i=>o.editTitleMode=!0,["stop"]))},Dje),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[12]||(e[12]=re(i=>o.showConfirmation=!0,["stop"]))},Ije)]))])],10,gje)}const zg=Ue(pje,[["render",Pje]]),Fje={props:{htmlContent:{type:String,required:!0}}},Bje=["innerHTML"];function $je(t,e,n,s,o,r){return E(),A("div",null,[c("div",{innerHTML:n.htmlContent},null,8,Bje)])}const jje=Ue(Fje,[["render",$je]]);const zje={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){if(console.log(typeof this.jsonData),typeof this.jsonData=="string"){let t=JSON.stringify(JSON.parse(this.jsonData),null," ").replace(/\n/g,"
");return console.log(t),console.log(this.jsonFormText),t}else{let t=JSON.stringify(this.jsonData,null," ").replace(/\n/g,"
");return console.log(t),console.log(this.jsonFormText),t}},isObject(){return console.log(typeof this.jsonData),console.log(this.jsonData),typeof this.jsonData=="object"&&this.jsonData!==null},isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")}},methods:{toggleCollapsed(){this.collapsed=!this.collapsed},toggleCollapsible(){this.collapsed=!this.collapsed}}},Uje={key:0},qje={class:"toggle-icon mr-1"},Hje={key:0,class:"fas fa-plus-circle text-gray-600"},Vje={key:1,class:"fas fa-minus-circle text-gray-600"},Gje={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},Kje={key:0,class:"fas fa-plus-circle text-gray-600"},Wje={key:1,class:"fas fa-minus-circle text-gray-600"},Zje=["innerHTML"];function Yje(t,e,n,s,o,r){return r.isContentPresent?(E(),A("div",Uje,[c("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...i)=>r.toggleCollapsible&&r.toggleCollapsible(...i))},[c("span",qje,[o.collapsed?(E(),A("i",Hje)):(E(),A("i",Vje))]),ye(" "+H(n.jsonFormText),1)]),pe(c("div",null,[c("div",Gje,[r.isObject?(E(),A("span",{key:0,onClick:e[1]||(e[1]=(...i)=>r.toggleCollapsed&&r.toggleCollapsed(...i)),class:"toggle-icon cursor-pointer mr-1"},[o.collapsed?(E(),A("i",Kje)):(E(),A("i",Wje))])):B("",!0),c("pre",{innerHTML:r.formattedJson},null,8,Zje)])],512),[[Qe,!o.collapsed]])])):B("",!0)}const Jje=Ue(zje,[["render",Yje]]),Qje={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0}}},Xje={class:"step flex items-center mb-4"},eze={class:"flex items-center justify-center w-6 h-6 mr-2"},tze={key:0},nze=c("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),sze=[nze],oze={key:1},rze=c("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),ize=[rze],aze={key:2},lze=c("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),cze=[lze],uze={key:0,role:"status"},dze=c("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"},[c("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"}),c("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),hze=[dze];function fze(t,e,n,s,o,r){return E(),A("div",Xje,[c("div",eze,[n.done?B("",!0):(E(),A("div",tze,sze)),n.done&&n.status?(E(),A("div",oze,ize)):B("",!0),n.done&&!n.status?(E(),A("div",aze,cze)):B("",!0)]),n.done?B("",!0):(E(),A("div",uze,hze)),c("div",{class:Me(["content flex-1 px-2",{"text-green-500":n.done,"text-yellow-500":!n.done}])},H(n.message),3)])}const pze=Ue(Qje,[["render",fze]]);const gze="/",mze={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:Ig,Step:pze,RenderHTMLJS:jje,JsonViewer:Jje},props:{message:Object,avatar:""},data(){return{msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){"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."),be(()=>{ve.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight})},methods:{onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let t=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(o=>o.name===this.$store.state.config.audio_out_voice)[0]);const n=o=>{let r=this.message.content.substring(o,o+e);const i=[".","!","?"];let a=-1;return i.forEach(l=>{const u=r.lastIndexOf(l);u>a&&(a=u)}),a==-1&&(a=r.length),console.log(a),a+o+1},s=()=>{if(this.message.content.includes(".")){const o=n(t),r=this.message.content.substring(t,o);this.msg.text=r,t=o+1,this.msg.onend=i=>{t{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",o))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{s()},1)};s()},toggleModel(){this.expanded=!this.expanded},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.editMsgMode=!1},resendMessage(){this.$emit("resendMessage",this.message.id,this.message.content)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?gze+this.avatar:Xn},defaultImg(t){t.target.src=Xn},parseDate(t){let e=new Date(Date.parse(t)),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":t},prettyDate(t){let e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," ")),n=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(n/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(n<60&&"just now"||n<120&&"1 minute ago"||n<3600&&Math.floor(n/60)+" minutes ago"||n<7200&&"1 hour ago"||n<86400&&Math.floor(n/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:{"message.content":function(t){this.$store.state.config.auto_speak&&(this.isSpeaking||this.checkForFullSentence())},showConfirmation(){be(()=>{ve.replace()})},editMsgMode(t){be(()=>{ve.replace()})},deleteMsgMode(){be(()=>{ve.replace()})}},computed:{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 t=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===t.getTime()||!e.getTime())return;let s=e.getTime()-t.getTime();const o=Math.floor(s/(1e3*60*60));s-=o*(1e3*60*60);const r=Math.floor(s/(1e3*60));s-=r*(1e3*60);const i=Math.floor(s/1e3);s-=i*1e3;function a(u){return u<10&&(u="0"+u),u}return a(o)+"h:"+a(r)+"m:"+a(i)+"s"}}},_ze={class:"relative group rounded-lg m-2 shadow-lg hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},bze={class:"flex flex-row gap-2"},yze={class:"flex-shrink-0"},vze={class:"group/avatar"},wze=["src","data-popover-target"],xze={class:"flex flex-col w-full flex-grow-0"},kze={class:"flex flex-row flex-grow items-start"},Eze={class:"flex flex-col mb-2"},Cze={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},Aze=["title"],Sze=c("div",{class:"flex-grow"},null,-1),Tze={class:"flex-row justify-end mx-2"},Mze={class:"invisible group-hover:visible flex flex-row"},Oze={key:0,class:"flex items-center duration-75"},Rze=c("i",{"data-feather":"x"},null,-1),Nze=[Rze],Dze=c("i",{"data-feather":"check"},null,-1),Lze=[Dze],Ize=c("i",{"data-feather":"edit"},null,-1),Pze=[Ize],Fze=c("i",{"data-feather":"copy"},null,-1),Bze=[Fze],$ze=c("i",{"data-feather":"refresh-cw"},null,-1),jze=[$ze],zze=c("i",{"data-feather":"fast-forward"},null,-1),Uze=[zze],qze={key:4,class:"flex items-center duration-75"},Hze=c("i",{"data-feather":"x"},null,-1),Vze=[Hze],Gze=c("i",{"data-feather":"check"},null,-1),Kze=[Gze],Wze=c("i",{"data-feather":"trash"},null,-1),Zze=[Wze],Yze=c("i",{"data-feather":"thumbs-up"},null,-1),Jze=[Yze],Qze={class:"flex flex-row items-center"},Xze=c("i",{"data-feather":"thumbs-down"},null,-1),eUe=[Xze],tUe={class:"flex flex-row items-center"},nUe=c("i",{"data-feather":"volume-2"},null,-1),sUe=[nUe],oUe={class:"overflow-x-auto w-full"},rUe={class:"flex flex-col items-start w-full"},iUe={class:"flex flex-col items-start w-full"},aUe={key:2},lUe={class:"text-sm text-gray-400 mt-2"},cUe={class:"flex flex-row items-center gap-2"},uUe={key:0},dUe={class:"font-thin"},hUe={key:1},fUe={class:"font-thin"},pUe={key:2},gUe={class:"font-thin"},mUe={key:3},_Ue=["title"];function bUe(t,e,n,s,o,r){const i=Ke("Step"),a=Ke("RenderHTMLJS"),l=Ke("MarkdownRenderer"),u=Ke("JsonViewer");return E(),A("div",_ze,[c("div",bze,[c("div",yze,[c("div",vze,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=d=>r.defaultImg(d)),"data-popover-target":"avatar"+n.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,wze)])]),c("div",xze,[c("div",kze,[c("div",Eze,[c("div",Cze,H(n.message.sender)+" ",1),n.message.created_at?(E(),A("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},H(r.created_at),9,Aze)):B("",!0)]),Sze,c("div",Tze,[c("div",Mze,[o.editMsgMode?(E(),A("div",Oze,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel edit",type:"button",onClick:e[1]||(e[1]=re(d=>o.editMsgMode=!1,["stop"]))},Nze),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[2]||(e[2]=re((...d)=>r.updateMessage&&r.updateMessage(...d),["stop"]))},Lze)])):B("",!0),o.editMsgMode?B("",!0):(E(),A("div",{key:1,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Edit message",onClick:e[3]||(e[3]=re(d=>o.editMsgMode=!0,["stop"]))},Pze)),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Copy message to clipboard",onClick:e[4]||(e[4]=re(d=>r.copyContentToClipboard(),["stop"]))},Bze),n.message.sender!=this.$store.state.mountedPers.name?(E(),A("div",{key:2,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Resend message",onClick:e[5]||(e[5]=re(d=>r.resendMessage(),["stop"]))},jze)):B("",!0),n.message.sender==this.$store.state.mountedPers.name?(E(),A("div",{key:3,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Resend message",onClick:e[6]||(e[6]=re(d=>r.continueMessage(),["stop"]))},Uze)):B("",!0),o.deleteMsgMode?(E(),A("div",qze,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel removal",type:"button",onClick:e[7]||(e[7]=re(d=>o.deleteMsgMode=!1,["stop"]))},Vze),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Confirm removal",type:"button",onClick:e[8]||(e[8]=re(d=>r.deleteMsg(),["stop"]))},Kze)])):B("",!0),o.deleteMsgMode?B("",!0):(E(),A("div",{key:5,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2",title:"Remove message",onClick:e[9]||(e[9]=d=>o.deleteMsgMode=!0)},Zze)),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Upvote",onClick:e[10]||(e[10]=re(d=>r.rankUp(),["stop"]))},Jze),c("div",Qze,[c("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2",title:"Downvote",onClick:e[11]||(e[11]=re(d=>r.rankDown(),["stop"]))},eUe),n.message.rank!=0?(E(),A("div",{key:0,class:Me(["rounded-full px-2 text-sm flex items-center justify-center font-bold",n.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},H(n.message.rank),3)):B("",!0)]),c("div",tUe,[c("div",{class:Me(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[12]||(e[12]=re(d=>r.speak(),["stop"]))},sUe,2)])])])]),c("div",oUe,[c("div",rUe,[(E(!0),A(Oe,null,Ze(n.message.steps,(d,h)=>(E(),A("div",{key:"step-"+n.message.id+"-"+h,class:"step font-bold",style:bt({backgroundColor:d.done?"transparent":"inherit"})},[he(i,{done:d.done,message:d.message,status:d.status},null,8,["done","message","status"])],4))),128))]),c("div",iUe,[(E(!0),A(Oe,null,Ze(n.message.html_js_s,(d,h)=>(E(),A("div",{key:"htmljs-"+n.message.id+"-"+h,class:"htmljs font-bold",style:bt({backgroundColor:t.step.done?"transparent":"inherit"})},[he(a,{htmlContent:d},null,8,["htmlContent"])],4))),128))]),o.editMsgMode?B("",!0):(E(),st(l,{key:0,ref:"mdRender","markdown-text":n.message.content},null,8,["markdown-text"])),o.editMsgMode?pe((E(),A("textarea",{key:1,ref:"mdTextarea",rows:4,class:"block p-2.5 w-full text-sm 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",style:bt({minHeight:o.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[13]||(e[13]=d=>this.message.content=d)},null,4)),[[Le,this.message.content]]):B("",!0),n.message.metadata!==null?(E(),A("div",aUe,[(E(!0),A(Oe,null,Ze(n.message.metadata,(d,h)=>(E(),A("div",{key:"json-"+n.message.id+"-"+h,class:"json font-bold"},[he(u,{jsonFormText:d.title,jsonData:d.content},null,8,["jsonFormText","jsonData"])]))),128))])):B("",!0)]),c("div",lUe,[c("div",cUe,[n.message.binding?(E(),A("p",uUe,[ye("Binding: "),c("span",dUe,H(n.message.binding),1)])):B("",!0),n.message.model?(E(),A("p",hUe,[ye("Model: "),c("span",fUe,H(n.message.model),1)])):B("",!0),n.message.seed?(E(),A("p",pUe,[ye("Seed: "),c("span",gUe,H(n.message.seed),1)])):B("",!0),r.time_spent?(E(),A("p",mUe,[ye("Time spent: "),c("span",{class:"font-thin",title:"Finished generating: "+r.finished_generating_at_parsed},H(r.time_spent),9,_Ue)])):B("",!0)])])])])])}const Ug=Ue(mze,[["render",bUe]]),yUe="/";xe.defaults.baseURL="/";const vUe={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{UniversalForm:yc},data(){return{bUrl:yUe,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(t){this.$store.commit("setConfig",t)}},mountedPers:{get(){return this.$store.state.mountedPers},set(t){this.$store.commit("setMountedPers",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{onSettingsPersonality(t){try{xe.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 - "+t.name,"Save changes","Cancel").then(n=>{try{xe.post("/set_active_personality_settings",n).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(be(()=>{ve.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.onReady()},async api_get_req(t){try{const e=await xe.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=Xn}}},wUe={class:"w-fit select-none"},xUe={key:0,class:"flex -space-x-4"},kUe=["src","title"],EUe={key:1,class:"flex -space-x-4"},CUe=["src","title"],AUe={key:2,title:"Loading personalities"},SUe=c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1),TUe=[SUe];function MUe(t,e,n,s,o,r){const i=Ke("UniversalForm");return E(),A(Oe,null,[c("div",wUe,[r.mountedPersArr.length>1?(E(),A("div",xUe,[c("img",{src:o.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 border-2 active:scale-90 hover:z-20 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,kUe),c("div",{class:"flex items-center justify-center w-8 h-8 cursor-pointer text-xs font-medium bg-bg-light dark:bg-bg-dark border-2 hover:border-secondary rounded-full hover:bg-bg-light-tone dark:hover:bg-bg-dark-tone dark:border-gray-800 hover:z-20 hover:-translate-y-2 duration-150 active:scale-90",onClick:e[2]||(e[2]=re((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+H(r.mountedPersArr.length-1),1)])):B("",!0),r.mountedPersArr.length==1?(E(),A("div",EUe,[c("img",{src:o.bUrl+this.$store.state.mountedPers.avatar,onError:e[3]||(e[3]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 cursor-pointer border-secondary",title:"Active personality: "+this.$store.state.mountedPers.name,onClick:e[4]||(e[4]=re((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"]))},null,40,CUe)])):B("",!0),r.mountedPersArr.length==0?(E(),A("div",AUe,TUe)):B("",!0)]),he(i,{ref:"universalForm",class:"z-20"},null,512)],64)}const OUe=Ue(vUe,[["render",MUe]]);const RUe="/";xe.defaults.baseURL="/";const NUe={props:{onTalk:Function,onMountUnmount:Function,onRemount:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:Bg,Toast:Io,UniversalForm:yc},name:"MountedPersonalitiesList",data(){return{bUrl:RUe,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(t){this.$store.commit("setConfig",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{toggleShowPersList(){this.onShowPersList()},toggleMountUnmount(){this.onMountUnmount(this)},async constructor(){},async api_get_req(t){try{const e=await xe.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=Xn},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,xe.post("/reinstall_personality",{name:t.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}))},onPersonalityMounted(t){this.configFile.personalities.includes(t.full_path)?this.configFile.personalities.length==1?this.$refs.toast.showToast("Can't unmount last personality",4,!1):this.unmountPersonality(t):this.mountPersonality(t)},onPersonalityRemount(t){this.reMountPersonality(t)},async handleOnTalk(t){if(ve.replace(),console.log("ppa",t),t){if(t.isMounted){const e=await this.select_personality(t);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: diff --git a/web/dist/index.html b/web/dist/index.html index 6073a013..a43fd443 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,7 +6,7 @@ LoLLMS WebUI - Welcome - +