From 24debaa54cd4ec979fde5f7d978100ab53982f42 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Wed, 21 Aug 2024 03:27:01 +0200 Subject: [PATCH] new stuff --- endpoints/libraries/lollms_flow.js | 86 --------------- .../{index-9d85d317.js => index-14cd1bfc.js} | 2 +- web/dist/index.html | 2 +- web/src/components/DynamicUIRenderer.vue | 101 +++++++----------- zoos/personalities_zoo | 2 +- 5 files changed, 41 insertions(+), 152 deletions(-) rename web/dist/assets/{index-9d85d317.js => index-14cd1bfc.js} (99%) diff --git a/endpoints/libraries/lollms_flow.js b/endpoints/libraries/lollms_flow.js index baa6c0a0..c32ac68d 100644 --- a/endpoints/libraries/lollms_flow.js +++ b/endpoints/libraries/lollms_flow.js @@ -303,89 +303,3 @@ class WorkflowVisualizer { }); } } - -// Usage example -const nodeOperations = { - "Add": (inputs) => ({ sum: inputs.a + inputs.b }), - "Multiply": (inputs) => ({ product: inputs.x * inputs.y }), - "Output": (inputs) => console.log("Result:", inputs.result) -}; - -const visualizer = new WorkflowVisualizer("workflow-container"); - -const addNode = new WorkflowNode(0, "Add", [ - { name: "a", type: "number" }, - { name: "b", type: "number" } -], [ - { name: "sum", type: "number" } -], nodeOperations["Add"], 50, 50); - -const multiplyNode = new WorkflowNode(1, "Multiply", [ - { name: "x", type: "number" }, - { name: "y", type: "number" } -], [ - { name: "product", type: "number" } -], nodeOperations["Multiply"], 250, 50); - -const outputNode = new WorkflowNode(2, "Output", [ - { name: "result", type: "number" } -], [], nodeOperations["Output"], 450, 50); - -visualizer.addNode(addNode); -visualizer.addNode(multiplyNode); -visualizer.addNode(outputNode); - -visualizer.connectNodes(0, 0, 1, 0); -visualizer.connectNodes(1, 0, 2, 0); - -// Add save and load buttons -const saveButton = document.createElement("button"); -saveButton.textContent = "Save"; -saveButton.onclick = () => { - const json = visualizer.saveToJSON(); - const blob = new Blob([json], { type: "application/json" }); - const url = URL.createObjectURL(blob); - const a = document.createElement("a"); - a.href = url; - a.download = "workflow.json"; - a.click(); - URL.revokeObjectURL(url); -}; -document.body.appendChild(saveButton); - -const loadButton = document.createElement("button"); -loadButton.textContent = "Load"; -loadButton.onclick = () => { - const input = document.createElement("input"); - input.type = "file"; - input.accept = "application/json"; - input.onchange = (event) => { - const file = event.target.files[0]; - const reader = new FileReader(); - reader.onload = (e) => { - visualizer.loadFromJSON(e.target.result, nodeOperations); - }; - reader.readAsText(file); - }; - input.click(); -}; -document.body.appendChild(loadButton); - -// Add save and load to/from localStorage buttons -const saveLocalButton = document.createElement("button"); -saveLocalButton.textContent = "Save to LocalStorage"; -saveLocalButton.onclick = () => visualizer.saveToLocalStorage("workflow"); -document.body.appendChild(saveLocalButton); - -const loadLocalButton = document.createElement("button"); -loadLocalButton.textContent = "Load from LocalStorage"; -loadLocalButton.onclick = () => visualizer.loadFromLocalStorage("workflow", nodeOperations); -document.body.appendChild(loadLocalButton); - -const executeButton = document.createElement("button"); -executeButton.textContent = "Execute"; -executeButton.onclick = () => { - const results = visualizer.execute(); - console.log(results); -}; -document.body.appendChild(executeButton); diff --git a/web/dist/assets/index-9d85d317.js b/web/dist/assets/index-14cd1bfc.js similarity index 99% rename from web/dist/assets/index-9d85d317.js rename to web/dist/assets/index-14cd1bfc.js index f31198ff..dcad4563 100644 --- a/web/dist/assets/index-9d85d317.js +++ b/web/dist/assets/index-14cd1bfc.js @@ -150,7 +150,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),me=P,re=$),ee===void 0
  • Consult the FAQ section for common issues and solutions
  • If problems persist, please reach out to our support team through one of the contact methods listed below.

    - `}],contactLinks:[{text:"Email",url:"mailto:parisneoai@gmail.com"},{text:"Twitter",url:"https://twitter.com/ParisNeo_AI"},{text:"Discord",url:"https://discord.gg/BDxacQmv"},{text:"Sub-Reddit",url:"https://www.reddit.com/r/lollms"},{text:"Instagram",url:"https://www.instagram.com/spacenerduino/"}]}},methods:{scrollToSection(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth",block:"start"})}}},Det={class:"min-h-screen w-full bg-gradient-to-br from-blue-100 to-purple-100 dark:from-blue-900 dark:to-purple-900 overflow-y-auto"},Let={class:"container mx-auto px-4 py-8 relative z-10"},Pet=l("header",{class:"text-center mb-12 sticky top-0 bg-white dark:bg-gray-800 bg-opacity-90 dark:bg-opacity-90 backdrop-filter backdrop-blur-lg p-4 rounded-b-lg shadow-md"},[l("h1",{class:"text-5xl md:text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-400 dark:to-purple-400 mb-2 animate-glow"}," LoLLMs Help Documentation "),l("p",{class:"text-2xl text-gray-600 dark:text-gray-300 italic"},' "One tool to rule them all" ')],-1),Uet={class:"bg-white dark:bg-gray-800 shadow-md rounded-lg p-6 mb-8 animate-fade-in sticky top-32 max-h-[calc(100vh-8rem)] overflow-y-auto"},Fet=l("h2",{class:"text-3xl font-semibold mb-4 text-gray-800 dark:text-gray-200"},"Table of Contents",-1),Bet={class:"space-y-2"},Get=["href","onClick"],Vet={key:0,class:"ml-4 mt-2 space-y-1"},zet=["href","onClick"],Het={class:"bg-white dark:bg-gray-800 shadow-md rounded-lg p-6 animate-fade-in"},qet=["id"],Yet={class:"text-4xl font-semibold mb-6 text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-400 dark:to-purple-400"},$et=["innerHTML"],Wet={key:0,class:"mt-8"},Ket=["id"],jet={class:"text-3xl font-semibold mb-4 text-gray-700 dark:text-gray-300"},Qet=["innerHTML"],Xet={class:"mt-12 pt-8 border-t border-gray-300 dark:border-gray-700 animate-fade-in"},Zet=l("h2",{class:"text-3xl font-semibold mb-6 text-center text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-400 dark:to-purple-400"},"Contact",-1),Jet={class:"flex flex-wrap justify-center gap-6 mb-8"},ett=["href"],ttt=l("p",{class:"text-center font-bold text-2xl text-gray-700 dark:text-gray-300"},"See ya!",-1),ntt={class:"fixed inset-0 pointer-events-none overflow-hidden"},stt=l("svg",{class:"w-2 h-2 text-yellow-300",fill:"currentColor",viewBox:"0 0 20 20"},[l("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})],-1),itt=[stt];function rtt(t,e,n,s,i,r){return T(),w("div",Det,[l("div",Let,[Pet,l("nav",Uet,[Fet,l("ul",Bet,[(T(!0),w(Ge,null,je(i.sections,o=>(T(),w("li",{key:o.id,class:"ml-4"},[l("a",{href:`#${o.id}`,onClick:a=>r.scrollToSection(o.id),class:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 hover:underline transition-colors duration-200"},W(o.title),9,Get),o.subsections?(T(),w("ul",Vet,[(T(!0),w(Ge,null,je(o.subsections,a=>(T(),w("li",{key:a.id},[l("a",{href:`#${a.id}`,onClick:c=>r.scrollToSection(a.id),class:"text-blue-500 dark:text-blue-300 hover:text-blue-700 dark:hover:text-blue-200 hover:underline transition-colors duration-200"},W(a.title),9,zet)]))),128))])):G("",!0)]))),128))])]),l("main",Het,[(T(!0),w(Ge,null,je(i.sections,o=>(T(),w("section",{key:o.id,id:o.id,class:"mb-12"},[l("h2",Yet,W(o.title),1),l("div",{innerHTML:o.content,class:"prose dark:prose-invert max-w-none"},null,8,$et),o.subsections?(T(),w("div",Wet,[(T(!0),w(Ge,null,je(o.subsections,a=>(T(),w("section",{key:a.id,id:a.id,class:"mb-8"},[l("h3",jet,W(a.title),1),l("div",{innerHTML:a.content,class:"prose dark:prose-invert max-w-none"},null,8,Qet)],8,Ket))),128))])):G("",!0)],8,qet))),128))]),l("footer",Xet,[Zet,l("div",Jet,[(T(!0),w(Ge,null,je(i.contactLinks,(o,a)=>(T(),w("a",{key:a,href:o.url,target:"_blank",class:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 hover:underline transition-colors duration-200"},W(o.text),9,ett))),128))]),ttt])]),l("div",ntt,[(T(),w(Ge,null,je(50,o=>l("div",{key:o,class:"absolute animate-fall",style:Ht({left:`${Math.random()*100}%`,top:"-20px",animationDuration:`${3+Math.random()*7}s`,animationDelay:`${Math.random()*5}s`})},itt,4)),64))])])}const ott=rt(ket,[["render",rtt]]);function Qs(t,e=!0,n=1){const s=e?1e3:1024;if(Math.abs(t)=s&&r{ze.replace()})},executeCommand(t){this.isMenuOpen=!1,console.log("Selected"),console.log(t.value),typeof t.value=="function"&&(console.log("Command detected",t),t.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(t))},positionMenu(){var t;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),n=window.innerHeight;t=e.bottom>n/2}else this.force_position==1?t=!0:t=!1;this.menuPosition.top=t?"auto":"calc(100% + 10px)",this.menuPosition.bottom=t?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),Be(()=>{ze.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},ltt={class:"menu-container"},ctt=["title"],dtt=["src"],utt=["data-feather"],ptt={key:2,class:"w-5 h-5"},_tt={key:3,"data-feather":"menu"},htt={class:"flex-grow menu-ul"},ftt=["onClick"],mtt={key:0,"data-feather":"check"},gtt=["src","alt"],btt=["data-feather"],Ett={key:3,class:"menu-icon"};function ytt(t,e,n,s,i,r){return T(),w("div",ltt,[l("button",{onClick:e[0]||(e[0]=ue((...o)=>r.toggleMenu&&r.toggleMenu(...o),["prevent"])),title:n.title,class:Ue([n.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[n.icon&&!n.icon.includes("#")&&!n.icon.includes("feather")?(T(),w("img",{key:0,src:n.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,dtt)):n.icon&&n.icon.includes("feather")?(T(),w("i",{key:1,"data-feather":n.icon.split(":")[1],class:"w-5 h-5"},null,8,utt)):n.icon&&n.icon.includes("#")?(T(),w("p",ptt,W(n.icon.split("#")[1]),1)):(T(),w("i",_tt))],10,ctt),oe(ks,{name:"slide"},{default:De(()=>[i.isMenuOpen?(T(),w("div",{key:0,class:"menu-list flex-grow",style:Ht(i.menuPosition),ref:"menu"},[l("ul",htt,[(T(!0),w(Ge,null,je(n.commands,(o,a)=>(T(),w("li",{key:a,onClick:ue(c=>r.executeCommand(o),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[n.selected_entry==o.name?(T(),w("i",mtt)):o.icon&&!o.icon.includes("feather")&&!o.is_file?(T(),w("img",{key:1,src:o.icon,alt:o.name,class:"menu-icon"},null,8,gtt)):G("",!0),o.icon&&o.icon.includes("feather")&&!o.is_file?(T(),w("i",{key:2,"data-feather":o.icon.split(":")[1],class:"mr-2"},null,8,btt)):(T(),w("span",Ett)),l("span",null,W(o.name),1)],8,ftt))),128))])],4)):G("",!0)]),_:1})])}const sE=rt(att,[["render",ytt]]),vtt={components:{InteractiveMenu:sE},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){Be(()=>{ze.replace()})},methods:{formatFileSize(t){return t<1024?t+" bytes":t<1024*1024?(t/1024).toFixed(2)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(t){return Qs(t)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?As:this.model.icon},defaultImg(t){t.target.src=As},install(){this.onInstall(this)},uninstall(){this.isInstalled&&this.onUninstall(this)},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(t){if(console.log("event.target.tagName.toLowerCase()"),console.log(t.target.tagName.toLowerCase()),t.target.tagName.toLowerCase()==="button"||t.target.tagName.toLowerCase()==="svg"){t.stopPropagation();return}this.onSelected(this),this.model.selected=!0,Be(()=>{ze.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this),this.installing=!1},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let t=[{name:this.model.isInstalled?"Install Extra":"Install",icon:"feather:settings",is_file:!1,value:this.install},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.model.isInstalled&&t.push({name:"UnInstall",icon:"feather:settings",is_file:!1,value:this.uninstall}),this.selected&&t.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),t},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const t=this.model.variants[0].size;return this.formatFileSize(t)}return null}},speed_computed(){return Qs(this.speed)},total_size_computed(){return Qs(this.total_size)},downloaded_size_computed(){return Qs(this.downloaded_size)}},watch:{linkNotValid(){Be(()=>{ze.replace()})}}},Stt=["title"],Ttt={key:0,class:"flex flex-row"},xtt={class:"max-w-[300px] overflow-x-auto"},Ctt={class:"flex gap-3 items-center grow"},wtt=["href"],Rtt=["src"],Att={class:"flex-1 overflow-hidden"},Ntt={class:"font-bold font-large text-lg truncate"},Ott={key:1,class:"flex items-center flex-row gap-2 my-1"},Itt={class:"flex grow items-center"},Mtt=l("i",{"data-feather":"box",class:"w-5"},null,-1),ktt=l("span",{class:"sr-only"},"Custom model / local model",-1),Dtt=[Mtt,ktt],Ltt=l("span",{class:"sr-only"},"Remove",-1),Ptt={key:2,class:"absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center"},Utt={class:"relative flex flex-col items-center justify-center flex-grow h-full"},Ftt=l("div",{role:"status",class:"justify-center"},[l("svg",{"aria-hidden":"true",class:"w-24 h-24 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1),Btt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},Gtt={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},Vtt={class:"flex justify-between mb-1"},ztt=l("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),Htt={class:"text-sm font-medium text-blue-700 dark:text-white"},qtt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Ytt={class:"flex justify-between mb-1"},$tt={class:"text-base font-medium text-blue-700 dark:text-white"},Wtt={class:"text-sm font-medium text-blue-700 dark:text-white"},Ktt={class:"flex flex-grow"},jtt={class:"flex flex-row flex-grow gap-3"},Qtt={class:"p-2 text-center grow"},Xtt={key:3},Ztt={class:"flex flex-row items-center gap-3"},Jtt=["src"],ent={class:"font-bold font-large text-lg truncate"},tnt=l("div",{class:"grow"},null,-1),nnt={class:"flex items-center flex-row-reverse gap-2 my-1"},snt={class:"flex flex-row items-center"},int={key:0,class:"text-base text-red-600 flex items-center mt-1"},rnt=l("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),ont=["title"],ant={class:""},lnt={class:"flex flex-row items-center"},cnt=l("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),dnt=l("b",null,"Card: ",-1),unt=["href","title"],pnt=l("div",{class:"grow"},null,-1),_nt=l("i",{"data-feather":"clipboard",class:"w-5"},null,-1),hnt=[_nt],fnt={class:"flex items-center"},mnt=l("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),gnt=l("b",null,"File size: ",-1),bnt={class:"flex items-center"},Ent=l("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),ynt=l("b",null,"License: ",-1),vnt={key:0,class:"flex items-center"},Snt=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Tnt=l("b",null,"quantizer: ",-1),xnt=["href"],Cnt={class:"flex items-center"},wnt=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Rnt=l("b",null,"Model creator: ",-1),Ant=["href"],Nnt={class:"flex items-center"},Ont=l("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1),Int=l("b",null,"Release date: ",-1),Mnt={class:"flex items-center"},knt=l("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1),Dnt=l("b",null,"Category: ",-1),Lnt=["href"];function Pnt(t,e,n,s,i,r){const o=ot("InteractiveMenu");return T(),w("div",{class:Ue(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",r.computed_classes]),title:n.model.name,onClick:e[10]||(e[10]=ue(a=>r.toggleSelected(a),["prevent"]))},[n.model.isCustomModel?(T(),w("div",Ttt,[l("div",xtt,[l("div",Ctt,[l("a",{href:n.model.model_creator_link,target:"_blank"},[l("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,Rtt)],8,wtt),l("div",Att,[l("h3",Ntt,W(n.model.name),1)])])])])):G("",!0),n.model.isCustomModel?(T(),w("div",Ott,[l("div",Itt,[l("button",{type:"button",title:"Custom model / local model",class:"font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=ue(()=>{},["stop"]))},Dtt),Je(" Custom model ")]),l("div",null,[n.model.isInstalled?(T(),w("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=ue((...a)=>r.uninstall&&r.uninstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Je(" Uninstall "),Ltt])):G("",!0)])])):G("",!0),i.installing?(T(),w("div",Ptt,[l("div",Utt,[Ftt,l("div",Btt,[l("div",Gtt,[l("div",Vtt,[ztt,l("span",Htt,W(Math.floor(i.progress))+"%",1)]),l("div",qtt,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Ht({width:i.progress+"%"})},null,4)]),l("div",Ytt,[l("span",$tt,"Download speed: "+W(r.speed_computed)+"/s",1),l("span",Wtt,W(r.downloaded_size_computed)+"/"+W(r.total_size_computed),1)])])]),l("div",Ktt,[l("div",jtt,[l("div",Qtt,[l("button",{onClick:e[3]||(e[3]=ue((...a)=>r.toggleCancelInstall&&r.toggleCancelInstall(...a),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])])):G("",!0),n.model.isCustomModel?G("",!0):(T(),w("div",Xtt,[l("div",Ztt,[l("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=a=>r.defaultImg(a)),class:Ue(["w-10 h-10 rounded-lg object-fill",i.linkNotValid?"grayscale":""])},null,42,Jtt),l("h3",ent,W(n.model.name),1),tnt,oe(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),l("div",nnt,[l("div",snt,[i.linkNotValid?(T(),w("div",int,[rnt,Je(" Link is not valid ")])):G("",!0)])]),l("div",{class:"",title:n.model.isInstalled?n.model.name:"Not installed"},[l("div",ant,[l("div",lnt,[cnt,dnt,l("a",{href:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name,target:"_blank",onClick:e[5]||(e[5]=ue(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:i.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,unt),pnt,l("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[6]||(e[6]=ue(a=>r.toggleCopyLink(),["stop"]))},hnt)]),l("div",fnt,[l("div",{class:Ue(["flex flex-shrink-0 items-center",i.linkNotValid?"text-red-600":""])},[mnt,gnt,Je(" "+W(r.fileSize),1)],2)]),l("div",bnt,[Ent,ynt,Je(" "+W(n.model.license),1)]),n.model.quantizer!="None"&&n.model.type!="transformers"?(T(),w("div",vnt,[Snt,Tnt,l("a",{href:"https://huggingface.co/"+n.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=ue(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(n.model.quantizer),9,xnt)])):G("",!0),l("div",Cnt,[wnt,Rnt,l("a",{href:n.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=ue(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(n.model.model_creator),9,Ant)]),l("div",Nnt,[Ont,Int,Je(" "+W(n.model.last_commit_time),1)]),l("div",Mnt,[knt,Dnt,l("a",{href:"https://huggingface.co/"+n.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=ue(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(n.model.category),9,Lnt)])])],8,ont)]))],10,Stt)}const Unt=rt(vtt,[["render",Pnt]]),Fnt={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",personalityCategory:"Category",disclaimer:"Disclaimer text",conditioningText:"Conditioning Text",aiPrefix:"AI Prefix",userPrefix:"User Prefix",antipromptsList:[{id:1,text:"Antiprompt 1"},{id:2,text:"Antiprompt 2"},{id:3,text:"Antiprompt 3"}]}},methods:{commitChanges(){console.log("Personality changes committed"),this.editMode=!1}}},Bnt={class:"p-4"},Gnt={class:"flex items-center mb-4"},Vnt=["src"],znt={class:"text-lg font-semibold"},Hnt=l("strong",null,"Author:",-1),qnt=l("strong",null,"Description:",-1),Ynt=l("strong",null,"Category:",-1),$nt={key:0},Wnt=l("strong",null,"Disclaimer:",-1),Knt=l("strong",null,"Conditioning Text:",-1),jnt=l("strong",null,"AI Prefix:",-1),Qnt=l("strong",null,"User Prefix:",-1),Xnt=l("strong",null,"Antiprompts:",-1);function Znt(t,e,n,s,i,r){return T(),w("div",Bnt,[l("div",Gnt,[l("img",{src:i.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,Vnt),l("h2",znt,W(i.personalityName),1)]),l("p",null,[Hnt,Je(" "+W(i.personalityAuthor),1)]),l("p",null,[qnt,Je(" "+W(i.personalityDescription),1)]),l("p",null,[Ynt,Je(" "+W(i.personalityCategory),1)]),i.disclaimer?(T(),w("p",$nt,[Wnt,Je(" "+W(i.disclaimer),1)])):G("",!0),l("p",null,[Knt,Je(" "+W(i.conditioningText),1)]),l("p",null,[jnt,Je(" "+W(i.aiPrefix),1)]),l("p",null,[Qnt,Je(" "+W(i.userPrefix),1)]),l("div",null,[Xnt,l("ul",null,[(T(!0),w(Ge,null,je(i.antipromptsList,o=>(T(),w("li",{key:o.id},W(o.text),1))),128))])]),l("button",{onClick:e[0]||(e[0]=o=>i.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),i.editMode?(T(),w("button",{key:1,onClick:e[1]||(e[1]=(...o)=>r.commitChanges&&r.commitChanges(...o)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):G("",!0)])}const Jnt=rt(Fnt,[["render",Znt]]),zu="/assets/logo-9d653710.svg",est="/",tst={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onOpenFolder:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function},components:{InteractiveMenu:sE},data(){return{isMounted:!1,name:this.personality.name,thumbnailVisible:!1,thumbnailPosition:{x:0,y:0}}},computed:{commandsList(){let t=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return console.log("this.category",this.personality.category),this.personality.category=="custom_personalities"?t.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):t.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.isMounted&&t.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.personality.has_scripts&&t.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),t},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,Be(()=>{ze.replace()})},methods:{showThumbnail(){this.thumbnailVisible=!0},hideThumbnail(){this.thumbnailVisible=!1},updateThumbnailPosition(t){this.thumbnailPosition={x:t.clientX+10,y:t.clientY+10}},getImgUrl(){return est+this.personality.avatar},defaultImg(t){t.target.src=zu},showFolder(){this.onOpenFolder(this)},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.isMounted=!1},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Be(()=>{ze.replace()})}}},nst=["title"],sst={class:"flex flex-row items-center flex-shrink-0 gap-3"},ist=["src"],rst=l("i",{"data-feather":"clipboard",class:"w-5"},null,-1),ost=[rst],ast=["src"],lst={class:""},cst={class:""},dst={class:"flex items-center"},ust=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),pst=l("b",null,"Author: ",-1),_st={class:"flex items-center"},hst=l("i",{"data-feather":"git-commit",class:"w-5 m-1"},null,-1),fst=l("b",null,"Version: ",-1),mst={key:0,class:"flex items-center"},gst=l("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),bst=l("b",null,"Languages: ",-1),Est=["selected"],yst={key:1,class:"flex items-center"},vst=l("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),Sst=l("b",null,"Language: ",-1),Tst={class:"flex items-center"},xst=l("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),Cst=l("b",null,"Category: ",-1),wst=l("div",{class:"flex items-center"},[l("i",{"data-feather":"info",class:"w-5 m-1"}),l("b",null,"Description: "),l("br")],-1),Rst=["title","innerHTML"],Ast={class:"rounded bg-blue-300"},Nst=l("i",{"data-feather":"check"},null,-1),Ost=l("span",{class:"sr-only"},"Select",-1),Ist=[Nst,Ost],Mst=l("i",{"data-feather":"send",class:"w-5"},null,-1),kst=l("span",{class:"sr-only"},"Talk",-1),Dst=[Mst,kst],Lst=l("i",{"data-feather":"folder",class:"w-5"},null,-1),Pst=l("span",{class:"sr-only"},"Show Folder",-1),Ust=[Lst,Pst];function Fst(t,e,n,s,i,r){const o=ot("InteractiveMenu");return T(),w("div",{class:Ue(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",i.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:n.personality.installed?"":"Not installed"},[l("div",{class:Ue(n.personality.installed?"":"border-red-500")},[l("div",sst,[l("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer",onMouseover:e[2]||(e[2]=(...a)=>r.showThumbnail&&r.showThumbnail(...a)),onMousemove:e[3]||(e[3]=(...a)=>r.updateThumbnailPosition&&r.updateThumbnailPosition(...a)),onMouseleave:e[4]||(e[4]=(...a)=>r.hideThumbnail&&r.hideThumbnail(...a))},null,40,ist),l("h3",{onClick:e[5]||(e[5]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer",onMouseover:e[6]||(e[6]=(...a)=>r.showThumbnail&&r.showThumbnail(...a)),onMousemove:e[7]||(e[7]=(...a)=>r.updateThumbnailPosition&&r.updateThumbnailPosition(...a)),onMouseleave:e[8]||(e[8]=(...a)=>r.hideThumbnail&&r.hideThumbnail(...a))},W(n.personality.name),33),l("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[9]||(e[9]=ue(a=>r.toggleCopyLink(),["stop"]))},ost),i.thumbnailVisible?(T(),w("div",{key:0,style:Ht({top:i.thumbnailPosition.y+"px",left:i.thumbnailPosition.x+"px"}),class:"fixed z-50 w-20 h-20 rounded-full overflow-hidden"},[l("img",{src:r.getImgUrl(),class:"w-full h-full object-fill"},null,8,ast)],4)):G("",!0)]),l("div",lst,[l("div",cst,[l("div",dst,[ust,pst,Je(" "+W(n.personality.author),1)]),l("div",_st,[hst,fst,Je(" "+W(n.personality.version),1)]),n.personality.languages&&n.select_language?(T(),w("div",mst,[gst,bst,i.isMounted?G("",!0):U((T(),w("select",{key:0,id:"languages","onUpdate:modelValue":e[10]||(e[10]=a=>n.personality.language=a),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(T(!0),w(Ge,null,je(n.personality.languages,(a,c)=>(T(),w("option",{key:c,selected:a==n.personality.languages[0]},W(a),9,Est))),128))],512)),[[Gt,n.personality.language]])])):G("",!0),n.personality.language?(T(),w("div",yst,[vst,Sst,Je(" "+W(n.personality.language),1)])):G("",!0),l("div",Tst,[xst,Cst,Je(" "+W(n.personality.category),1)])]),wst,l("p",{class:"mx-1 opacity-80 h-20 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",title:n.personality.description,innerHTML:n.personality.description},null,8,Rst)]),l("div",Ast,[i.isMounted?(T(),w("button",{key:0,type:"button",title:"Select",onClick:[e[11]||(e[11]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[12]||(e[12]=ue(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Ist)):G("",!0),i.isMounted?(T(),w("button",{key:1,type:"button",title:"Talk",onClick:[e[13]||(e[13]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[14]||(e[14]=ue(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Dst)):G("",!0),l("button",{type:"button",title:"Show_folder",onClick:[e[15]||(e[15]=(...a)=>r.showFolder&&r.showFolder(...a)),e[16]||(e[16]=ue(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Ust),oe(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,nst)}const wN=rt(tst,[["render",Fst]]);const Bst={props:{ui:{type:String,required:!0,default:""}},watch:{ui:{handler(t){this.$nextTick(()=>{this.renderAndExecuteScripts(t)})},immediate:!0}},methods:{renderAndExecuteScripts(t){this.$refs.ui.innerHTML="";const e=document.createElement("div");e.innerHTML=t;const n=i=>new Promise(r=>{const o=document.createElement("script");i.src?(o.src=i.src,o.onload=r):o.textContent=i.textContent,Array.from(i.attributes).forEach(a=>{a.name!=="src"&&o.setAttribute(a.name,a.value)}),i.parentNode.replaceChild(o,i),i.src||r()}),s=async()=>{const i=e.querySelectorAll("script");for(let r of i)await n(r)};this.$refs.ui.appendChild(e),s()}}},Gst={class:"w-full h-auto 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",ref:"ui"};function Vst(t,e,n,s,i,r){return T(),w("div",Gst,null,512)}const RN=rt(Bst,[["render",Vst]]),zst="/",Hst={components:{DynamicUIRenderer:RN},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){Be(()=>{ze.replace()})},methods:{copyToClipBoard(t){console.log("Copying to clipboard :",t),navigator.clipboard.writeText(t)},getImgUrl(){return zst+this.binding.icon},defaultImg(t){t.target.src=zu},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){Be(()=>{ze.replace()})}}},qst=["title"],Yst={class:"flex flex-row items-center gap-3"},$st=["src"],Wst={class:"font-bold font-large text-lg truncate"},Kst=l("div",{class:"grow"},null,-1),jst={class:"flex-none gap-1"},Qst=l("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),Xst=l("span",{class:"sr-only"},"Help",-1),Zst=[Qst,Xst],Jst={class:"flex items-center flex-row-reverse gap-2 my-1"},eit=l("span",{class:"sr-only"},"Click to install",-1),tit=l("span",{class:"sr-only"},"Reinstall",-1),nit=l("span",{class:"sr-only"},"UnInstall",-1),sit=l("span",{class:"sr-only"},"Settings",-1),iit={class:""},rit={class:""},oit={class:"flex items-center"},ait=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),lit=l("b",null,"Author: ",-1),cit={class:"flex items-center"},dit=l("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),uit=l("b",null,"Folder: ",-1),pit=l("div",{class:"grow"},null,-1),_it=l("i",{"data-feather":"clipboard",class:"w-5"},null,-1),hit=[_it],fit={class:"flex items-center"},mit=l("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),git=l("b",null,"Version: ",-1),bit={class:"flex items-center"},Eit=l("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),yit=l("b",null,"Link: ",-1),vit=["href"],Sit=l("div",{class:"flex items-center"},[l("i",{"data-feather":"info",class:"w-5 m-1"}),l("b",null,"Description: "),l("br")],-1),Tit=["title","innerHTML"];function xit(t,e,n,s,i,r){const o=ot("DynamicUIRenderer");return T(),w("div",{class:Ue(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",n.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[8]||(e[8]=ue((...a)=>r.toggleSelected&&r.toggleSelected(...a),["stop"])),title:n.binding.installed?n.binding.name:"Not installed"},[l("div",null,[l("div",Yst,[l("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,$st),l("h3",Wst,W(n.binding.name),1),Kst,l("div",jst,[n.selected?(T(),w("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>r.toggleReloadBinding&&r.toggleReloadBinding(...a)),e[2]||(e[2]=ue(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Zst)):G("",!0)])]),l("div",Jst,[n.binding.installed?G("",!0):(T(),w("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=ue((...a)=>r.toggleInstall&&r.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Je(" Install "),eit])),n.binding.installed?(T(),w("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=ue((...a)=>r.toggleReinstall&&r.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},[Je(" Reinstall "),tit])):G("",!0),n.binding.installed?(T(),w("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=ue((...a)=>r.toggleUnInstall&&r.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Je(" Uninstall "),nit])):G("",!0),n.selected?(T(),w("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=ue((...a)=>r.toggleSettings&&r.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Je(" Settings "),sit])):G("",!0)]),n.binding.ui?(T(),mt(o,{key:0,class:"w-full h-full",code:n.binding.ui},null,8,["code"])):G("",!0),l("div",iit,[l("div",rit,[l("div",oit,[ait,lit,Je(" "+W(n.binding.author),1)]),l("div",cit,[dit,uit,Je(" "+W(n.binding.folder)+" ",1),pit,l("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[7]||(e[7]=ue(a=>r.copyToClipBoard(this.binding.folder),["stop"]))},hit)]),l("div",fit,[mit,git,Je(" "+W(n.binding.version),1)]),l("div",bit,[Eit,yit,l("a",{href:n.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},W(n.binding.link),9,vit)])]),Sit,l("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.binding.description,innerHTML:n.binding.description},null,8,Tit)])])],10,qst)}const Cit=rt(Hst,[["render",xit]]),wit={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(t=>{this.resolve=t})},hide(t){this.show=!1,this.resolve&&(this.resolve(t),this.resolve=null)},showDialog(t){return new Promise(e=>{this.model_path=t,this.show=!0,this.resolve=e})}}},Rit={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},Ait={class:"relative w-full max-w-md max-h-full"},Nit={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},Oit=l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),Iit=l("span",{class:"sr-only"},"Close modal",-1),Mit=[Oit,Iit],kit={class:"p-4 text-center"},Dit=l("svg",{"aria-hidden":"true",class:"mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Lit={class:"p-4 text-center mx-auto mb-4"},Pit=l("label",{class:"mr-2"},"Model path",-1);function Uit(t,e,n,s,i,r){return i.show?(T(),w("div",Rit,[l("div",Ait,[l("div",Nit,[l("button",{type:"button",onClick:e[0]||(e[0]=o=>r.hide(!1)),class:"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},Mit),l("div",kit,[Dit,l("div",Lit,[Pit,U(l("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>i.model_path=o),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[pe,i.model_path]])]),l("button",{onClick:e[2]||(e[2]=o=>r.hide(!0)),type:"button",class:"text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"}," Add "),l("button",{onClick:e[3]||(e[3]=o=>r.hide(!1)),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},"No, cancel")])])])])):G("",!0)}const Fit=rt(wit,[["render",Uit]]);const Bit={props:{show:{type:Boolean,default:!1,required:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(t){return console.log("choice:",t),typeof t=="string"?t:t&&t.name?t.name:""},selectChoice(t){this.selectedChoice=t,this.$emit("choice-selected",t)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(t){return t<1024?t+" bytes":t<1024*1024?(t/1024).toFixed(2)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/(1024*1024*1024)).toFixed(2)+" GB"},toggleInput(){this.showInput=!this.showInput},addNewFilename(){const t=this.newFilename.trim();t!==""&&(this.choices.push(t),this.newFilename="",this.selectChoice(t)),this.showInput=!1},removeChoice(t,e){this.choices.splice(e,1),t===this.selectedChoice&&(this.selectedChoice=null),this.$emit("choice-removed",t)}}},Git={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-20"},Vit={class:"bg-bg-light dark:bg-bg-dark rounded-lg p-6 w-96"},zit={class:"text-xl font-bold text-5xl drop-shadow-md align-middle"},Hit={class:"h-48 text-light-text-panel dark:text-dark-text-panel bg-bg-light-tone-panel dark:bg-dark-tone-panel overflow-y-auto rounded drop-shadow-md 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"},qit=["onClick"],Yit={class:"font-bold text-dark-text-panel dark:text-light-text-panel"},$it=l("br",null,null,-1),Wit={key:0,class:"text-xs text-gray-500"},Kit=["onClick"],jit={key:0,class:"flex flex-row mt-4 bg-light-tone-panel dark:bg-dark-tone-panel"},Qit={class:"flex justify-end mt-4"},Xit=["disabled"];function Zit(t,e,n,s,i,r){return T(),mt(ks,{name:"fade"},{default:De(()=>[n.show?(T(),w("div",Git,[l("div",Vit,[l("h2",zit,W(n.title),1),l("div",Hit,[l("ul",null,[(T(!0),w(Ge,null,je(n.choices,(o,a)=>(T(),w("li",{key:a,onClick:c=>r.selectChoice(o),class:Ue([{"selected-choice":o===i.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-accent dark:hover:bg-secondary"])},[l("span",Yit,W(r.displayName(o)),1),$it,o.size?(T(),w("span",Wit,W(r.formatSize(o.size)),1)):G("",!0),n.can_remove?(T(),w("button",{key:1,onClick:ue(c=>r.removeChoice(o,a),["stop"]),class:"ml-2 text-red-500 hover:text-red-600"}," X ",8,Kit)):G("",!0)],10,qit))),128))])]),i.showInput?(T(),w("div",jit,[U(l("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>i.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 p-2 rounded-lg w-full"},null,512),[[pe,i.newFilename]]),l("button",{onClick:e[1]||(e[1]=(...o)=>r.addNewFilename&&r.addNewFilename(...o)),class:"ml-2 grow pl-2 pr-2 bg-primary hover:bg-primary-light text-white rounded-lg transition duration-300"}," Add ")])):G("",!0),l("div",Qit,[l("button",{onClick:e[2]||(e[2]=(...o)=>r.closeDialog&&r.closeDialog(...o)),class:"py-2 px-4 mr-2 bg-secondary hover:bg-accent text-white rounded-lg transition duration-300"}," Cancel "),l("button",{onClick:e[3]||(e[3]=(...o)=>r.validateChoice&&r.validateChoice(...o)),class:Ue([{"bg-gray-400 cursor-not-allowed":!i.selectedChoice,"bg-primary hover:bg-primary-light":i.selectedChoice,"text-white":i.selectedChoice,"text-gray-500":!i.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!i.selectedChoice}," Validate ",10,Xit),l("button",{onClick:e[4]||(e[4]=(...o)=>r.toggleInput&&r.toggleInput(...o)),class:"py-2 px-4 ml-2 bg-accent hover:bg-secondary text-white rounded-lg transition duration-300"}," Add New ")])])])):G("",!0)]),_:1})}const iE=rt(Bit,[["render",Zit]]),Jit={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:"0"}},data(){return{selectedValue:this.defaultValue}},computed:{selectedLabel(){const t=this.radioOptions.find(e=>e.value===this.selectedValue);return t?t.label:""}},watch:{selectedValue(t,e){this.$emit("radio-selected",t)}},methods:{handleRadioChange(){}}},ert={class:"flex space-x-4"},trt=["value","aria-checked"],nrt={class:"text-gray-700"};function srt(t,e,n,s,i,r){return T(),w("div",ert,[(T(!0),w(Ge,null,je(n.radioOptions,(o,a)=>(T(),w("label",{key:o.value,class:"flex items-center space-x-2"},[U(l("input",{type:"radio",value:o.value,"onUpdate:modelValue":e[0]||(e[0]=c=>i.selectedValue=c),onChange:e[1]||(e[1]=(...c)=>r.handleRadioChange&&r.handleRadioChange(...c)),class:"text-blue-500 focus:ring-2 focus:ring-blue-200","aria-checked":i.selectedValue===o.value.toString(),role:"radio"},null,40,trt),[[tk,i.selectedValue]]),l("span",nrt,W(o.label),1)]))),128))])}const irt=rt(Jit,[["render",srt]]),rrt="/assets/gpu-df72bf63.svg",ort={name:"StringListManager",props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:"Enter an item"}},emits:["update:modelValue","change"],data(){return{newItem:"",draggingIndex:null}},methods:{addItem(){if(this.newItem.trim()){const t=[...this.modelValue,this.newItem.trim()];this.$emit("update:modelValue",t),this.$emit("change"),this.newItem=""}},removeItem(t){const e=this.modelValue.filter((n,s)=>s!==t);this.$emit("update:modelValue",e),this.$emit("change")},removeAll(){this.$emit("update:modelValue",[]),this.$emit("change")},startDragging(t){this.draggingIndex=t},dragItem(t){if(this.draggingIndex!==null){const e=[...this.modelValue],n=e.splice(this.draggingIndex,1)[0];e.splice(t,0,n),this.$emit("update:modelValue",e),this.$emit("change")}},stopDragging(){this.draggingIndex=null},moveUp(t){if(t>0){const e=[...this.modelValue],n=e.splice(t,1)[0];e.splice(t-1,0,n),this.$emit("update:modelValue",e),this.$emit("change")}},moveDown(t){if(ti.newItem=o),placeholder:n.placeholder,onKeyup:e[1]||(e[1]=ei((...o)=>r.addItem&&r.addItem(...o),["enter"])),class:"flex-grow mr-4 px-4 py-2 border border-gray-300 rounded dark:bg-gray-600 text-lg"},null,40,lrt),[[pe,i.newItem]]),l("button",{onClick:e[2]||(e[2]=(...o)=>r.addItem&&r.addItem(...o)),class:"bg-blue-500 text-white px-6 py-2 rounded hover:bg-blue-600 text-lg"},"Add")]),n.modelValue.length>0?(T(),w("ul",crt,[(T(!0),w(Ge,null,je(n.modelValue,(o,a)=>(T(),w("li",{key:a,class:Ue(["flex items-center mb-2 relative",{"bg-gray-200":i.draggingIndex===a}])},[l("span",drt,W(o),1),l("div",urt,[l("button",{onClick:c=>r.removeItem(a),class:"text-red-500 hover:text-red-700 p-2"},hrt,8,prt),a>0?(T(),w("button",{key:0,onClick:c=>r.moveUp(a),class:"bg-gray-300 hover:bg-gray-400 p-2 rounded mr-2"},grt,8,frt)):G("",!0),ar.moveDown(a),class:"bg-gray-300 hover:bg-gray-400 p-2 rounded"},yrt,8,brt)):G("",!0)]),i.draggingIndex===a?(T(),w("div",{key:0,class:"absolute top-0 left-0 w-full h-full bg-gray-200 opacity-50 cursor-move",onMousedown:c=>r.startDragging(a),onMousemove:c=>r.dragItem(a),onMouseup:e[3]||(e[3]=(...c)=>r.stopDragging&&r.stopDragging(...c))},null,40,vrt)):G("",!0)],2))),128))])):G("",!0),n.modelValue.length>0?(T(),w("div",Srt,[l("button",{onClick:e[4]||(e[4]=(...o)=>r.removeAll&&r.removeAll(...o)),class:"bg-red-500 text-white px-6 py-2 rounded hover:bg-red-600 text-lg"},"Remove All")])):G("",!0)])}const xrt=rt(ort,[["render",Trt]]);const Crt="/";de.defaults.baseURL="/";const wrt={components:{AddModelDialog:Fit,ModelEntry:Unt,PersonalityViewer:Jnt,PersonalityEntry:wN,BindingEntry:Cit,ChoiceDialog:iE,Card:Vu,StringListManager:xrt,RadioOptions:irt},data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},defaultModelImgPlaceholder:As,snd_input_devices:[],snd_input_devices_indexes:[],snd_output_devices:[],snd_output_devices_indexes:[],voices:[],voice_languages:{Arabic:"ar","Brazilian Portuguese":"pt",Chinese:"zh-cn",Czech:"cs",Dutch:"nl",English:"en",French:"fr",German:"de",Italian:"it",Polish:"pl",Russian:"ru",Spanish:"es",Turkish:"tr",Japanese:"ja",Korean:"ko",Hungarian:"hu",Hindi:"hi"},storeLogo:fs,binding_changed:!1,SVGGPU:rrt,models_zoo:[],models_zoo_initialLoadCount:10,models_zoo_loadMoreCount:5,models_zoo_loadedEntries:[],models_zoo_scrollThreshold:200,sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],comfyui_models:[],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],collapsedArr:[],all_collapsed:!0,data_conf_collapsed:!0,internet_conf_collapsed:!0,servers_conf_collapsed:!0,mainconf_collapsed:!0,smartrouterconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,ezl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:Crt,searchPersonality:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){try{this.$store.state.loading_infos="Getting Hardware usage",await this.refreshHardwareUsage(this.$store)}catch(t){console.log("Error cought:",t)}qe.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{fetchElevenLabsVoices(){fetch("https://api.elevenlabs.io/v1/voices").then(t=>t.json()).then(t=>{this.voices=t.voices}).catch(t=>console.error("Error fetching voices:",t))},async refreshHardwareUsage(t){await t.dispatch("refreshDiskUsage"),await t.dispatch("refreshRamUsage"),await t.dispatch("refreshVramUsage")},addDataSource(){this.$store.state.config.rag_databases.push(""),this.settingsChanged=!0},removeDataSource(t){this.$store.state.config.rag_databases.splice(t,1),this.settingsChanged=!0},async vectorize_folder(t){await de.post("/vectorize_folder",{client_id:this.$store.state.client_id,db_path:this.$store.state.config.rag_databases[t]},this.posts_headers)},async select_folder(t){try{qe.on("rag_db_added",e=>{console.log(e),e?(this.$store.state.config.rag_databases[t]=`${e.database_name}::${e.database_path}`,this.settingsChanged=!0):this.$store.state.toast.showToast("Failed to select a folder",4,!1)}),await de.post("/add_rag_database",{client_id:this.$store.state.client_id},this.posts_headers)}catch{this.$store.state.toast.showToast("Failed to select a folder",4,!1)}},handleTemplateSelection(t){console.log("handleTemplateSelection");const e=t.target.value;console.log("handleTemplateSelection: ",e),e==="lollms"?(console.log("Using lollms template"),this.configFile.start_header_id_template="!@>",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` + `}],contactLinks:[{text:"Email",url:"mailto:parisneoai@gmail.com"},{text:"Twitter",url:"https://twitter.com/ParisNeo_AI"},{text:"Discord",url:"https://discord.gg/BDxacQmv"},{text:"Sub-Reddit",url:"https://www.reddit.com/r/lollms"},{text:"Instagram",url:"https://www.instagram.com/spacenerduino/"}]}},methods:{scrollToSection(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth",block:"start"})}}},Det={class:"min-h-screen w-full bg-gradient-to-br from-blue-100 to-purple-100 dark:from-blue-900 dark:to-purple-900 overflow-y-auto"},Let={class:"container mx-auto px-4 py-8 relative z-10"},Pet=l("header",{class:"text-center mb-12 sticky top-0 bg-white dark:bg-gray-800 bg-opacity-90 dark:bg-opacity-90 backdrop-filter backdrop-blur-lg p-4 rounded-b-lg shadow-md"},[l("h1",{class:"text-5xl md:text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-400 dark:to-purple-400 mb-2 animate-glow"}," LoLLMs Help Documentation "),l("p",{class:"text-2xl text-gray-600 dark:text-gray-300 italic"},' "One tool to rule them all" ')],-1),Uet={class:"bg-white dark:bg-gray-800 shadow-md rounded-lg p-6 mb-8 animate-fade-in sticky top-32 max-h-[calc(100vh-8rem)] overflow-y-auto"},Fet=l("h2",{class:"text-3xl font-semibold mb-4 text-gray-800 dark:text-gray-200"},"Table of Contents",-1),Bet={class:"space-y-2"},Get=["href","onClick"],Vet={key:0,class:"ml-4 mt-2 space-y-1"},zet=["href","onClick"],Het={class:"bg-white dark:bg-gray-800 shadow-md rounded-lg p-6 animate-fade-in"},qet=["id"],Yet={class:"text-4xl font-semibold mb-6 text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-400 dark:to-purple-400"},$et=["innerHTML"],Wet={key:0,class:"mt-8"},Ket=["id"],jet={class:"text-3xl font-semibold mb-4 text-gray-700 dark:text-gray-300"},Qet=["innerHTML"],Xet={class:"mt-12 pt-8 border-t border-gray-300 dark:border-gray-700 animate-fade-in"},Zet=l("h2",{class:"text-3xl font-semibold mb-6 text-center text-transparent bg-clip-text bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-400 dark:to-purple-400"},"Contact",-1),Jet={class:"flex flex-wrap justify-center gap-6 mb-8"},ett=["href"],ttt=l("p",{class:"text-center font-bold text-2xl text-gray-700 dark:text-gray-300"},"See ya!",-1),ntt={class:"fixed inset-0 pointer-events-none overflow-hidden"},stt=l("svg",{class:"w-2 h-2 text-yellow-300",fill:"currentColor",viewBox:"0 0 20 20"},[l("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})],-1),itt=[stt];function rtt(t,e,n,s,i,r){return T(),w("div",Det,[l("div",Let,[Pet,l("nav",Uet,[Fet,l("ul",Bet,[(T(!0),w(Ge,null,je(i.sections,o=>(T(),w("li",{key:o.id,class:"ml-4"},[l("a",{href:`#${o.id}`,onClick:a=>r.scrollToSection(o.id),class:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 hover:underline transition-colors duration-200"},W(o.title),9,Get),o.subsections?(T(),w("ul",Vet,[(T(!0),w(Ge,null,je(o.subsections,a=>(T(),w("li",{key:a.id},[l("a",{href:`#${a.id}`,onClick:c=>r.scrollToSection(a.id),class:"text-blue-500 dark:text-blue-300 hover:text-blue-700 dark:hover:text-blue-200 hover:underline transition-colors duration-200"},W(a.title),9,zet)]))),128))])):G("",!0)]))),128))])]),l("main",Het,[(T(!0),w(Ge,null,je(i.sections,o=>(T(),w("section",{key:o.id,id:o.id,class:"mb-12"},[l("h2",Yet,W(o.title),1),l("div",{innerHTML:o.content,class:"prose dark:prose-invert max-w-none"},null,8,$et),o.subsections?(T(),w("div",Wet,[(T(!0),w(Ge,null,je(o.subsections,a=>(T(),w("section",{key:a.id,id:a.id,class:"mb-8"},[l("h3",jet,W(a.title),1),l("div",{innerHTML:a.content,class:"prose dark:prose-invert max-w-none"},null,8,Qet)],8,Ket))),128))])):G("",!0)],8,qet))),128))]),l("footer",Xet,[Zet,l("div",Jet,[(T(!0),w(Ge,null,je(i.contactLinks,(o,a)=>(T(),w("a",{key:a,href:o.url,target:"_blank",class:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 hover:underline transition-colors duration-200"},W(o.text),9,ett))),128))]),ttt])]),l("div",ntt,[(T(),w(Ge,null,je(50,o=>l("div",{key:o,class:"absolute animate-fall",style:Ht({left:`${Math.random()*100}%`,top:"-20px",animationDuration:`${3+Math.random()*7}s`,animationDelay:`${Math.random()*5}s`})},itt,4)),64))])])}const ott=rt(ket,[["render",rtt]]);function Qs(t,e=!0,n=1){const s=e?1e3:1024;if(Math.abs(t)=s&&r{ze.replace()})},executeCommand(t){this.isMenuOpen=!1,console.log("Selected"),console.log(t.value),typeof t.value=="function"&&(console.log("Command detected",t),t.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(t))},positionMenu(){var t;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),n=window.innerHeight;t=e.bottom>n/2}else this.force_position==1?t=!0:t=!1;this.menuPosition.top=t?"auto":"calc(100% + 10px)",this.menuPosition.bottom=t?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),Be(()=>{ze.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},ltt={class:"menu-container"},ctt=["title"],dtt=["src"],utt=["data-feather"],ptt={key:2,class:"w-5 h-5"},_tt={key:3,"data-feather":"menu"},htt={class:"flex-grow menu-ul"},ftt=["onClick"],mtt={key:0,"data-feather":"check"},gtt=["src","alt"],btt=["data-feather"],Ett={key:3,class:"menu-icon"};function ytt(t,e,n,s,i,r){return T(),w("div",ltt,[l("button",{onClick:e[0]||(e[0]=ue((...o)=>r.toggleMenu&&r.toggleMenu(...o),["prevent"])),title:n.title,class:Ue([n.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[n.icon&&!n.icon.includes("#")&&!n.icon.includes("feather")?(T(),w("img",{key:0,src:n.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,dtt)):n.icon&&n.icon.includes("feather")?(T(),w("i",{key:1,"data-feather":n.icon.split(":")[1],class:"w-5 h-5"},null,8,utt)):n.icon&&n.icon.includes("#")?(T(),w("p",ptt,W(n.icon.split("#")[1]),1)):(T(),w("i",_tt))],10,ctt),oe(ks,{name:"slide"},{default:De(()=>[i.isMenuOpen?(T(),w("div",{key:0,class:"menu-list flex-grow",style:Ht(i.menuPosition),ref:"menu"},[l("ul",htt,[(T(!0),w(Ge,null,je(n.commands,(o,a)=>(T(),w("li",{key:a,onClick:ue(c=>r.executeCommand(o),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[n.selected_entry==o.name?(T(),w("i",mtt)):o.icon&&!o.icon.includes("feather")&&!o.is_file?(T(),w("img",{key:1,src:o.icon,alt:o.name,class:"menu-icon"},null,8,gtt)):G("",!0),o.icon&&o.icon.includes("feather")&&!o.is_file?(T(),w("i",{key:2,"data-feather":o.icon.split(":")[1],class:"mr-2"},null,8,btt)):(T(),w("span",Ett)),l("span",null,W(o.name),1)],8,ftt))),128))])],4)):G("",!0)]),_:1})])}const sE=rt(att,[["render",ytt]]),vtt={components:{InteractiveMenu:sE},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){Be(()=>{ze.replace()})},methods:{formatFileSize(t){return t<1024?t+" bytes":t<1024*1024?(t/1024).toFixed(2)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(t){return Qs(t)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?As:this.model.icon},defaultImg(t){t.target.src=As},install(){this.onInstall(this)},uninstall(){this.isInstalled&&this.onUninstall(this)},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(t){if(console.log("event.target.tagName.toLowerCase()"),console.log(t.target.tagName.toLowerCase()),t.target.tagName.toLowerCase()==="button"||t.target.tagName.toLowerCase()==="svg"){t.stopPropagation();return}this.onSelected(this),this.model.selected=!0,Be(()=>{ze.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this),this.installing=!1},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let t=[{name:this.model.isInstalled?"Install Extra":"Install",icon:"feather:settings",is_file:!1,value:this.install},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.model.isInstalled&&t.push({name:"UnInstall",icon:"feather:settings",is_file:!1,value:this.uninstall}),this.selected&&t.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),t},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const t=this.model.variants[0].size;return this.formatFileSize(t)}return null}},speed_computed(){return Qs(this.speed)},total_size_computed(){return Qs(this.total_size)},downloaded_size_computed(){return Qs(this.downloaded_size)}},watch:{linkNotValid(){Be(()=>{ze.replace()})}}},Stt=["title"],Ttt={key:0,class:"flex flex-row"},xtt={class:"max-w-[300px] overflow-x-auto"},Ctt={class:"flex gap-3 items-center grow"},wtt=["href"],Rtt=["src"],Att={class:"flex-1 overflow-hidden"},Ntt={class:"font-bold font-large text-lg truncate"},Ott={key:1,class:"flex items-center flex-row gap-2 my-1"},Itt={class:"flex grow items-center"},Mtt=l("i",{"data-feather":"box",class:"w-5"},null,-1),ktt=l("span",{class:"sr-only"},"Custom model / local model",-1),Dtt=[Mtt,ktt],Ltt=l("span",{class:"sr-only"},"Remove",-1),Ptt={key:2,class:"absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center"},Utt={class:"relative flex flex-col items-center justify-center flex-grow h-full"},Ftt=l("div",{role:"status",class:"justify-center"},[l("svg",{"aria-hidden":"true",class:"w-24 h-24 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1),Btt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},Gtt={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},Vtt={class:"flex justify-between mb-1"},ztt=l("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),Htt={class:"text-sm font-medium text-blue-700 dark:text-white"},qtt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Ytt={class:"flex justify-between mb-1"},$tt={class:"text-base font-medium text-blue-700 dark:text-white"},Wtt={class:"text-sm font-medium text-blue-700 dark:text-white"},Ktt={class:"flex flex-grow"},jtt={class:"flex flex-row flex-grow gap-3"},Qtt={class:"p-2 text-center grow"},Xtt={key:3},Ztt={class:"flex flex-row items-center gap-3"},Jtt=["src"],ent={class:"font-bold font-large text-lg truncate"},tnt=l("div",{class:"grow"},null,-1),nnt={class:"flex items-center flex-row-reverse gap-2 my-1"},snt={class:"flex flex-row items-center"},int={key:0,class:"text-base text-red-600 flex items-center mt-1"},rnt=l("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),ont=["title"],ant={class:""},lnt={class:"flex flex-row items-center"},cnt=l("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),dnt=l("b",null,"Card: ",-1),unt=["href","title"],pnt=l("div",{class:"grow"},null,-1),_nt=l("i",{"data-feather":"clipboard",class:"w-5"},null,-1),hnt=[_nt],fnt={class:"flex items-center"},mnt=l("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),gnt=l("b",null,"File size: ",-1),bnt={class:"flex items-center"},Ent=l("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),ynt=l("b",null,"License: ",-1),vnt={key:0,class:"flex items-center"},Snt=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Tnt=l("b",null,"quantizer: ",-1),xnt=["href"],Cnt={class:"flex items-center"},wnt=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Rnt=l("b",null,"Model creator: ",-1),Ant=["href"],Nnt={class:"flex items-center"},Ont=l("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1),Int=l("b",null,"Release date: ",-1),Mnt={class:"flex items-center"},knt=l("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1),Dnt=l("b",null,"Category: ",-1),Lnt=["href"];function Pnt(t,e,n,s,i,r){const o=ot("InteractiveMenu");return T(),w("div",{class:Ue(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",r.computed_classes]),title:n.model.name,onClick:e[10]||(e[10]=ue(a=>r.toggleSelected(a),["prevent"]))},[n.model.isCustomModel?(T(),w("div",Ttt,[l("div",xtt,[l("div",Ctt,[l("a",{href:n.model.model_creator_link,target:"_blank"},[l("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,Rtt)],8,wtt),l("div",Att,[l("h3",Ntt,W(n.model.name),1)])])])])):G("",!0),n.model.isCustomModel?(T(),w("div",Ott,[l("div",Itt,[l("button",{type:"button",title:"Custom model / local model",class:"font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=ue(()=>{},["stop"]))},Dtt),Je(" Custom model ")]),l("div",null,[n.model.isInstalled?(T(),w("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=ue((...a)=>r.uninstall&&r.uninstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Je(" Uninstall "),Ltt])):G("",!0)])])):G("",!0),i.installing?(T(),w("div",Ptt,[l("div",Utt,[Ftt,l("div",Btt,[l("div",Gtt,[l("div",Vtt,[ztt,l("span",Htt,W(Math.floor(i.progress))+"%",1)]),l("div",qtt,[l("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Ht({width:i.progress+"%"})},null,4)]),l("div",Ytt,[l("span",$tt,"Download speed: "+W(r.speed_computed)+"/s",1),l("span",Wtt,W(r.downloaded_size_computed)+"/"+W(r.total_size_computed),1)])])]),l("div",Ktt,[l("div",jtt,[l("div",Qtt,[l("button",{onClick:e[3]||(e[3]=ue((...a)=>r.toggleCancelInstall&&r.toggleCancelInstall(...a),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])])):G("",!0),n.model.isCustomModel?G("",!0):(T(),w("div",Xtt,[l("div",Ztt,[l("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=a=>r.defaultImg(a)),class:Ue(["w-10 h-10 rounded-lg object-fill",i.linkNotValid?"grayscale":""])},null,42,Jtt),l("h3",ent,W(n.model.name),1),tnt,oe(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),l("div",nnt,[l("div",snt,[i.linkNotValid?(T(),w("div",int,[rnt,Je(" Link is not valid ")])):G("",!0)])]),l("div",{class:"",title:n.model.isInstalled?n.model.name:"Not installed"},[l("div",ant,[l("div",lnt,[cnt,dnt,l("a",{href:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name,target:"_blank",onClick:e[5]||(e[5]=ue(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:i.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,unt),pnt,l("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[6]||(e[6]=ue(a=>r.toggleCopyLink(),["stop"]))},hnt)]),l("div",fnt,[l("div",{class:Ue(["flex flex-shrink-0 items-center",i.linkNotValid?"text-red-600":""])},[mnt,gnt,Je(" "+W(r.fileSize),1)],2)]),l("div",bnt,[Ent,ynt,Je(" "+W(n.model.license),1)]),n.model.quantizer!="None"&&n.model.type!="transformers"?(T(),w("div",vnt,[Snt,Tnt,l("a",{href:"https://huggingface.co/"+n.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=ue(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(n.model.quantizer),9,xnt)])):G("",!0),l("div",Cnt,[wnt,Rnt,l("a",{href:n.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=ue(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(n.model.model_creator),9,Ant)]),l("div",Nnt,[Ont,Int,Je(" "+W(n.model.last_commit_time),1)]),l("div",Mnt,[knt,Dnt,l("a",{href:"https://huggingface.co/"+n.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=ue(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},W(n.model.category),9,Lnt)])])],8,ont)]))],10,Stt)}const Unt=rt(vtt,[["render",Pnt]]),Fnt={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",personalityCategory:"Category",disclaimer:"Disclaimer text",conditioningText:"Conditioning Text",aiPrefix:"AI Prefix",userPrefix:"User Prefix",antipromptsList:[{id:1,text:"Antiprompt 1"},{id:2,text:"Antiprompt 2"},{id:3,text:"Antiprompt 3"}]}},methods:{commitChanges(){console.log("Personality changes committed"),this.editMode=!1}}},Bnt={class:"p-4"},Gnt={class:"flex items-center mb-4"},Vnt=["src"],znt={class:"text-lg font-semibold"},Hnt=l("strong",null,"Author:",-1),qnt=l("strong",null,"Description:",-1),Ynt=l("strong",null,"Category:",-1),$nt={key:0},Wnt=l("strong",null,"Disclaimer:",-1),Knt=l("strong",null,"Conditioning Text:",-1),jnt=l("strong",null,"AI Prefix:",-1),Qnt=l("strong",null,"User Prefix:",-1),Xnt=l("strong",null,"Antiprompts:",-1);function Znt(t,e,n,s,i,r){return T(),w("div",Bnt,[l("div",Gnt,[l("img",{src:i.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,Vnt),l("h2",znt,W(i.personalityName),1)]),l("p",null,[Hnt,Je(" "+W(i.personalityAuthor),1)]),l("p",null,[qnt,Je(" "+W(i.personalityDescription),1)]),l("p",null,[Ynt,Je(" "+W(i.personalityCategory),1)]),i.disclaimer?(T(),w("p",$nt,[Wnt,Je(" "+W(i.disclaimer),1)])):G("",!0),l("p",null,[Knt,Je(" "+W(i.conditioningText),1)]),l("p",null,[jnt,Je(" "+W(i.aiPrefix),1)]),l("p",null,[Qnt,Je(" "+W(i.userPrefix),1)]),l("div",null,[Xnt,l("ul",null,[(T(!0),w(Ge,null,je(i.antipromptsList,o=>(T(),w("li",{key:o.id},W(o.text),1))),128))])]),l("button",{onClick:e[0]||(e[0]=o=>i.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),i.editMode?(T(),w("button",{key:1,onClick:e[1]||(e[1]=(...o)=>r.commitChanges&&r.commitChanges(...o)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):G("",!0)])}const Jnt=rt(Fnt,[["render",Znt]]),zu="/assets/logo-9d653710.svg",est="/",tst={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onOpenFolder:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function},components:{InteractiveMenu:sE},data(){return{isMounted:!1,name:this.personality.name,thumbnailVisible:!1,thumbnailPosition:{x:0,y:0}}},computed:{commandsList(){let t=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return console.log("this.category",this.personality.category),this.personality.category=="custom_personalities"?t.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):t.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.isMounted&&t.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.personality.has_scripts&&t.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),t},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,Be(()=>{ze.replace()})},methods:{showThumbnail(){this.thumbnailVisible=!0},hideThumbnail(){this.thumbnailVisible=!1},updateThumbnailPosition(t){this.thumbnailPosition={x:t.clientX+10,y:t.clientY+10}},getImgUrl(){return est+this.personality.avatar},defaultImg(t){t.target.src=zu},showFolder(){this.onOpenFolder(this)},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.isMounted=!1},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Be(()=>{ze.replace()})}}},nst=["title"],sst={class:"flex flex-row items-center flex-shrink-0 gap-3"},ist=["src"],rst=l("i",{"data-feather":"clipboard",class:"w-5"},null,-1),ost=[rst],ast=["src"],lst={class:""},cst={class:""},dst={class:"flex items-center"},ust=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),pst=l("b",null,"Author: ",-1),_st={class:"flex items-center"},hst=l("i",{"data-feather":"git-commit",class:"w-5 m-1"},null,-1),fst=l("b",null,"Version: ",-1),mst={key:0,class:"flex items-center"},gst=l("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),bst=l("b",null,"Languages: ",-1),Est=["selected"],yst={key:1,class:"flex items-center"},vst=l("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),Sst=l("b",null,"Language: ",-1),Tst={class:"flex items-center"},xst=l("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),Cst=l("b",null,"Category: ",-1),wst=l("div",{class:"flex items-center"},[l("i",{"data-feather":"info",class:"w-5 m-1"}),l("b",null,"Description: "),l("br")],-1),Rst=["title","innerHTML"],Ast={class:"rounded bg-blue-300"},Nst=l("i",{"data-feather":"check"},null,-1),Ost=l("span",{class:"sr-only"},"Select",-1),Ist=[Nst,Ost],Mst=l("i",{"data-feather":"send",class:"w-5"},null,-1),kst=l("span",{class:"sr-only"},"Talk",-1),Dst=[Mst,kst],Lst=l("i",{"data-feather":"folder",class:"w-5"},null,-1),Pst=l("span",{class:"sr-only"},"Show Folder",-1),Ust=[Lst,Pst];function Fst(t,e,n,s,i,r){const o=ot("InteractiveMenu");return T(),w("div",{class:Ue(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",i.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:n.personality.installed?"":"Not installed"},[l("div",{class:Ue(n.personality.installed?"":"border-red-500")},[l("div",sst,[l("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer",onMouseover:e[2]||(e[2]=(...a)=>r.showThumbnail&&r.showThumbnail(...a)),onMousemove:e[3]||(e[3]=(...a)=>r.updateThumbnailPosition&&r.updateThumbnailPosition(...a)),onMouseleave:e[4]||(e[4]=(...a)=>r.hideThumbnail&&r.hideThumbnail(...a))},null,40,ist),l("h3",{onClick:e[5]||(e[5]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer",onMouseover:e[6]||(e[6]=(...a)=>r.showThumbnail&&r.showThumbnail(...a)),onMousemove:e[7]||(e[7]=(...a)=>r.updateThumbnailPosition&&r.updateThumbnailPosition(...a)),onMouseleave:e[8]||(e[8]=(...a)=>r.hideThumbnail&&r.hideThumbnail(...a))},W(n.personality.name),33),l("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[9]||(e[9]=ue(a=>r.toggleCopyLink(),["stop"]))},ost),i.thumbnailVisible?(T(),w("div",{key:0,style:Ht({top:i.thumbnailPosition.y+"px",left:i.thumbnailPosition.x+"px"}),class:"fixed z-50 w-20 h-20 rounded-full overflow-hidden"},[l("img",{src:r.getImgUrl(),class:"w-full h-full object-fill"},null,8,ast)],4)):G("",!0)]),l("div",lst,[l("div",cst,[l("div",dst,[ust,pst,Je(" "+W(n.personality.author),1)]),l("div",_st,[hst,fst,Je(" "+W(n.personality.version),1)]),n.personality.languages&&n.select_language?(T(),w("div",mst,[gst,bst,i.isMounted?G("",!0):U((T(),w("select",{key:0,id:"languages","onUpdate:modelValue":e[10]||(e[10]=a=>n.personality.language=a),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(T(!0),w(Ge,null,je(n.personality.languages,(a,c)=>(T(),w("option",{key:c,selected:a==n.personality.languages[0]},W(a),9,Est))),128))],512)),[[Gt,n.personality.language]])])):G("",!0),n.personality.language?(T(),w("div",yst,[vst,Sst,Je(" "+W(n.personality.language),1)])):G("",!0),l("div",Tst,[xst,Cst,Je(" "+W(n.personality.category),1)])]),wst,l("p",{class:"mx-1 opacity-80 h-20 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",title:n.personality.description,innerHTML:n.personality.description},null,8,Rst)]),l("div",Ast,[i.isMounted?(T(),w("button",{key:0,type:"button",title:"Select",onClick:[e[11]||(e[11]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[12]||(e[12]=ue(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Ist)):G("",!0),i.isMounted?(T(),w("button",{key:1,type:"button",title:"Talk",onClick:[e[13]||(e[13]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[14]||(e[14]=ue(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Dst)):G("",!0),l("button",{type:"button",title:"Show_folder",onClick:[e[15]||(e[15]=(...a)=>r.showFolder&&r.showFolder(...a)),e[16]||(e[16]=ue(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Ust),oe(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,nst)}const wN=rt(tst,[["render",Fst]]),Bst={name:"DynamicUIRenderer",props:{ui:{type:String,required:!0,default:""}},mounted(){this.renderUI()},watch:{ui:{handler:"renderUI",immediate:!0}},methods:{renderUI(){const t=this.$refs.container;t.innerHTML="";const n=new DOMParser().parseFromString(this.ui,"text/html"),s=n.getElementsByTagName("style");Array.from(s).forEach(o=>{const a=document.createElement("style");a.textContent=o.textContent,t.appendChild(a)});const i=n.getElementsByTagName("script");Array.from(i).forEach(o=>{const a=document.createElement("script");a.textContent=o.textContent,t.appendChild(a)});const r=n.body;Array.from(r.children).forEach(o=>{t.appendChild(o)}),r.style.cssText&&(t.style.cssText=r.style.cssText)}}},Gst={ref:"container"};function Vst(t,e,n,s,i,r){return T(),w("div",Gst,null,512)}const RN=rt(Bst,[["render",Vst]]),zst="/",Hst={components:{DynamicUIRenderer:RN},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){Be(()=>{ze.replace()})},methods:{copyToClipBoard(t){console.log("Copying to clipboard :",t),navigator.clipboard.writeText(t)},getImgUrl(){return zst+this.binding.icon},defaultImg(t){t.target.src=zu},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){Be(()=>{ze.replace()})}}},qst=["title"],Yst={class:"flex flex-row items-center gap-3"},$st=["src"],Wst={class:"font-bold font-large text-lg truncate"},Kst=l("div",{class:"grow"},null,-1),jst={class:"flex-none gap-1"},Qst=l("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),Xst=l("span",{class:"sr-only"},"Help",-1),Zst=[Qst,Xst],Jst={class:"flex items-center flex-row-reverse gap-2 my-1"},eit=l("span",{class:"sr-only"},"Click to install",-1),tit=l("span",{class:"sr-only"},"Reinstall",-1),nit=l("span",{class:"sr-only"},"UnInstall",-1),sit=l("span",{class:"sr-only"},"Settings",-1),iit={class:""},rit={class:""},oit={class:"flex items-center"},ait=l("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),lit=l("b",null,"Author: ",-1),cit={class:"flex items-center"},dit=l("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),uit=l("b",null,"Folder: ",-1),pit=l("div",{class:"grow"},null,-1),_it=l("i",{"data-feather":"clipboard",class:"w-5"},null,-1),hit=[_it],fit={class:"flex items-center"},mit=l("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),git=l("b",null,"Version: ",-1),bit={class:"flex items-center"},Eit=l("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),yit=l("b",null,"Link: ",-1),vit=["href"],Sit=l("div",{class:"flex items-center"},[l("i",{"data-feather":"info",class:"w-5 m-1"}),l("b",null,"Description: "),l("br")],-1),Tit=["title","innerHTML"];function xit(t,e,n,s,i,r){const o=ot("DynamicUIRenderer");return T(),w("div",{class:Ue(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",n.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[8]||(e[8]=ue((...a)=>r.toggleSelected&&r.toggleSelected(...a),["stop"])),title:n.binding.installed?n.binding.name:"Not installed"},[l("div",null,[l("div",Yst,[l("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,$st),l("h3",Wst,W(n.binding.name),1),Kst,l("div",jst,[n.selected?(T(),w("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>r.toggleReloadBinding&&r.toggleReloadBinding(...a)),e[2]||(e[2]=ue(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Zst)):G("",!0)])]),l("div",Jst,[n.binding.installed?G("",!0):(T(),w("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=ue((...a)=>r.toggleInstall&&r.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Je(" Install "),eit])),n.binding.installed?(T(),w("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=ue((...a)=>r.toggleReinstall&&r.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},[Je(" Reinstall "),tit])):G("",!0),n.binding.installed?(T(),w("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=ue((...a)=>r.toggleUnInstall&&r.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Je(" Uninstall "),nit])):G("",!0),n.selected?(T(),w("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=ue((...a)=>r.toggleSettings&&r.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Je(" Settings "),sit])):G("",!0)]),n.binding.ui?(T(),mt(o,{key:0,class:"w-full h-full",code:n.binding.ui},null,8,["code"])):G("",!0),l("div",iit,[l("div",rit,[l("div",oit,[ait,lit,Je(" "+W(n.binding.author),1)]),l("div",cit,[dit,uit,Je(" "+W(n.binding.folder)+" ",1),pit,l("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[7]||(e[7]=ue(a=>r.copyToClipBoard(this.binding.folder),["stop"]))},hit)]),l("div",fit,[mit,git,Je(" "+W(n.binding.version),1)]),l("div",bit,[Eit,yit,l("a",{href:n.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},W(n.binding.link),9,vit)])]),Sit,l("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.binding.description,innerHTML:n.binding.description},null,8,Tit)])])],10,qst)}const Cit=rt(Hst,[["render",xit]]),wit={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(t=>{this.resolve=t})},hide(t){this.show=!1,this.resolve&&(this.resolve(t),this.resolve=null)},showDialog(t){return new Promise(e=>{this.model_path=t,this.show=!0,this.resolve=e})}}},Rit={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},Ait={class:"relative w-full max-w-md max-h-full"},Nit={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},Oit=l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),Iit=l("span",{class:"sr-only"},"Close modal",-1),Mit=[Oit,Iit],kit={class:"p-4 text-center"},Dit=l("svg",{"aria-hidden":"true",class:"mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Lit={class:"p-4 text-center mx-auto mb-4"},Pit=l("label",{class:"mr-2"},"Model path",-1);function Uit(t,e,n,s,i,r){return i.show?(T(),w("div",Rit,[l("div",Ait,[l("div",Nit,[l("button",{type:"button",onClick:e[0]||(e[0]=o=>r.hide(!1)),class:"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},Mit),l("div",kit,[Dit,l("div",Lit,[Pit,U(l("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>i.model_path=o),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[pe,i.model_path]])]),l("button",{onClick:e[2]||(e[2]=o=>r.hide(!0)),type:"button",class:"text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"}," Add "),l("button",{onClick:e[3]||(e[3]=o=>r.hide(!1)),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},"No, cancel")])])])])):G("",!0)}const Fit=rt(wit,[["render",Uit]]);const Bit={props:{show:{type:Boolean,default:!1,required:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(t){return console.log("choice:",t),typeof t=="string"?t:t&&t.name?t.name:""},selectChoice(t){this.selectedChoice=t,this.$emit("choice-selected",t)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(t){return t<1024?t+" bytes":t<1024*1024?(t/1024).toFixed(2)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/(1024*1024*1024)).toFixed(2)+" GB"},toggleInput(){this.showInput=!this.showInput},addNewFilename(){const t=this.newFilename.trim();t!==""&&(this.choices.push(t),this.newFilename="",this.selectChoice(t)),this.showInput=!1},removeChoice(t,e){this.choices.splice(e,1),t===this.selectedChoice&&(this.selectedChoice=null),this.$emit("choice-removed",t)}}},Git={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-20"},Vit={class:"bg-bg-light dark:bg-bg-dark rounded-lg p-6 w-96"},zit={class:"text-xl font-bold text-5xl drop-shadow-md align-middle"},Hit={class:"h-48 text-light-text-panel dark:text-dark-text-panel bg-bg-light-tone-panel dark:bg-dark-tone-panel overflow-y-auto rounded drop-shadow-md 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"},qit=["onClick"],Yit={class:"font-bold text-dark-text-panel dark:text-light-text-panel"},$it=l("br",null,null,-1),Wit={key:0,class:"text-xs text-gray-500"},Kit=["onClick"],jit={key:0,class:"flex flex-row mt-4 bg-light-tone-panel dark:bg-dark-tone-panel"},Qit={class:"flex justify-end mt-4"},Xit=["disabled"];function Zit(t,e,n,s,i,r){return T(),mt(ks,{name:"fade"},{default:De(()=>[n.show?(T(),w("div",Git,[l("div",Vit,[l("h2",zit,W(n.title),1),l("div",Hit,[l("ul",null,[(T(!0),w(Ge,null,je(n.choices,(o,a)=>(T(),w("li",{key:a,onClick:c=>r.selectChoice(o),class:Ue([{"selected-choice":o===i.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-accent dark:hover:bg-secondary"])},[l("span",Yit,W(r.displayName(o)),1),$it,o.size?(T(),w("span",Wit,W(r.formatSize(o.size)),1)):G("",!0),n.can_remove?(T(),w("button",{key:1,onClick:ue(c=>r.removeChoice(o,a),["stop"]),class:"ml-2 text-red-500 hover:text-red-600"}," X ",8,Kit)):G("",!0)],10,qit))),128))])]),i.showInput?(T(),w("div",jit,[U(l("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>i.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 p-2 rounded-lg w-full"},null,512),[[pe,i.newFilename]]),l("button",{onClick:e[1]||(e[1]=(...o)=>r.addNewFilename&&r.addNewFilename(...o)),class:"ml-2 grow pl-2 pr-2 bg-primary hover:bg-primary-light text-white rounded-lg transition duration-300"}," Add ")])):G("",!0),l("div",Qit,[l("button",{onClick:e[2]||(e[2]=(...o)=>r.closeDialog&&r.closeDialog(...o)),class:"py-2 px-4 mr-2 bg-secondary hover:bg-accent text-white rounded-lg transition duration-300"}," Cancel "),l("button",{onClick:e[3]||(e[3]=(...o)=>r.validateChoice&&r.validateChoice(...o)),class:Ue([{"bg-gray-400 cursor-not-allowed":!i.selectedChoice,"bg-primary hover:bg-primary-light":i.selectedChoice,"text-white":i.selectedChoice,"text-gray-500":!i.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!i.selectedChoice}," Validate ",10,Xit),l("button",{onClick:e[4]||(e[4]=(...o)=>r.toggleInput&&r.toggleInput(...o)),class:"py-2 px-4 ml-2 bg-accent hover:bg-secondary text-white rounded-lg transition duration-300"}," Add New ")])])])):G("",!0)]),_:1})}const iE=rt(Bit,[["render",Zit]]),Jit={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:"0"}},data(){return{selectedValue:this.defaultValue}},computed:{selectedLabel(){const t=this.radioOptions.find(e=>e.value===this.selectedValue);return t?t.label:""}},watch:{selectedValue(t,e){this.$emit("radio-selected",t)}},methods:{handleRadioChange(){}}},ert={class:"flex space-x-4"},trt=["value","aria-checked"],nrt={class:"text-gray-700"};function srt(t,e,n,s,i,r){return T(),w("div",ert,[(T(!0),w(Ge,null,je(n.radioOptions,(o,a)=>(T(),w("label",{key:o.value,class:"flex items-center space-x-2"},[U(l("input",{type:"radio",value:o.value,"onUpdate:modelValue":e[0]||(e[0]=c=>i.selectedValue=c),onChange:e[1]||(e[1]=(...c)=>r.handleRadioChange&&r.handleRadioChange(...c)),class:"text-blue-500 focus:ring-2 focus:ring-blue-200","aria-checked":i.selectedValue===o.value.toString(),role:"radio"},null,40,trt),[[tk,i.selectedValue]]),l("span",nrt,W(o.label),1)]))),128))])}const irt=rt(Jit,[["render",srt]]),rrt="/assets/gpu-df72bf63.svg",ort={name:"StringListManager",props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:"Enter an item"}},emits:["update:modelValue","change"],data(){return{newItem:"",draggingIndex:null}},methods:{addItem(){if(this.newItem.trim()){const t=[...this.modelValue,this.newItem.trim()];this.$emit("update:modelValue",t),this.$emit("change"),this.newItem=""}},removeItem(t){const e=this.modelValue.filter((n,s)=>s!==t);this.$emit("update:modelValue",e),this.$emit("change")},removeAll(){this.$emit("update:modelValue",[]),this.$emit("change")},startDragging(t){this.draggingIndex=t},dragItem(t){if(this.draggingIndex!==null){const e=[...this.modelValue],n=e.splice(this.draggingIndex,1)[0];e.splice(t,0,n),this.$emit("update:modelValue",e),this.$emit("change")}},stopDragging(){this.draggingIndex=null},moveUp(t){if(t>0){const e=[...this.modelValue],n=e.splice(t,1)[0];e.splice(t-1,0,n),this.$emit("update:modelValue",e),this.$emit("change")}},moveDown(t){if(ti.newItem=o),placeholder:n.placeholder,onKeyup:e[1]||(e[1]=ei((...o)=>r.addItem&&r.addItem(...o),["enter"])),class:"flex-grow mr-4 px-4 py-2 border border-gray-300 rounded dark:bg-gray-600 text-lg"},null,40,lrt),[[pe,i.newItem]]),l("button",{onClick:e[2]||(e[2]=(...o)=>r.addItem&&r.addItem(...o)),class:"bg-blue-500 text-white px-6 py-2 rounded hover:bg-blue-600 text-lg"},"Add")]),n.modelValue.length>0?(T(),w("ul",crt,[(T(!0),w(Ge,null,je(n.modelValue,(o,a)=>(T(),w("li",{key:a,class:Ue(["flex items-center mb-2 relative",{"bg-gray-200":i.draggingIndex===a}])},[l("span",drt,W(o),1),l("div",urt,[l("button",{onClick:c=>r.removeItem(a),class:"text-red-500 hover:text-red-700 p-2"},hrt,8,prt),a>0?(T(),w("button",{key:0,onClick:c=>r.moveUp(a),class:"bg-gray-300 hover:bg-gray-400 p-2 rounded mr-2"},grt,8,frt)):G("",!0),ar.moveDown(a),class:"bg-gray-300 hover:bg-gray-400 p-2 rounded"},yrt,8,brt)):G("",!0)]),i.draggingIndex===a?(T(),w("div",{key:0,class:"absolute top-0 left-0 w-full h-full bg-gray-200 opacity-50 cursor-move",onMousedown:c=>r.startDragging(a),onMousemove:c=>r.dragItem(a),onMouseup:e[3]||(e[3]=(...c)=>r.stopDragging&&r.stopDragging(...c))},null,40,vrt)):G("",!0)],2))),128))])):G("",!0),n.modelValue.length>0?(T(),w("div",Srt,[l("button",{onClick:e[4]||(e[4]=(...o)=>r.removeAll&&r.removeAll(...o)),class:"bg-red-500 text-white px-6 py-2 rounded hover:bg-red-600 text-lg"},"Remove All")])):G("",!0)])}const xrt=rt(ort,[["render",Trt]]);const Crt="/";de.defaults.baseURL="/";const wrt={components:{AddModelDialog:Fit,ModelEntry:Unt,PersonalityViewer:Jnt,PersonalityEntry:wN,BindingEntry:Cit,ChoiceDialog:iE,Card:Vu,StringListManager:xrt,RadioOptions:irt},data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},defaultModelImgPlaceholder:As,snd_input_devices:[],snd_input_devices_indexes:[],snd_output_devices:[],snd_output_devices_indexes:[],voices:[],voice_languages:{Arabic:"ar","Brazilian Portuguese":"pt",Chinese:"zh-cn",Czech:"cs",Dutch:"nl",English:"en",French:"fr",German:"de",Italian:"it",Polish:"pl",Russian:"ru",Spanish:"es",Turkish:"tr",Japanese:"ja",Korean:"ko",Hungarian:"hu",Hindi:"hi"},storeLogo:fs,binding_changed:!1,SVGGPU:rrt,models_zoo:[],models_zoo_initialLoadCount:10,models_zoo_loadMoreCount:5,models_zoo_loadedEntries:[],models_zoo_scrollThreshold:200,sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],comfyui_models:[],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],collapsedArr:[],all_collapsed:!0,data_conf_collapsed:!0,internet_conf_collapsed:!0,servers_conf_collapsed:!0,mainconf_collapsed:!0,smartrouterconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,ezl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:Crt,searchPersonality:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){try{this.$store.state.loading_infos="Getting Hardware usage",await this.refreshHardwareUsage(this.$store)}catch(t){console.log("Error cought:",t)}qe.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{fetchElevenLabsVoices(){fetch("https://api.elevenlabs.io/v1/voices").then(t=>t.json()).then(t=>{this.voices=t.voices}).catch(t=>console.error("Error fetching voices:",t))},async refreshHardwareUsage(t){await t.dispatch("refreshDiskUsage"),await t.dispatch("refreshRamUsage"),await t.dispatch("refreshVramUsage")},addDataSource(){this.$store.state.config.rag_databases.push(""),this.settingsChanged=!0},removeDataSource(t){this.$store.state.config.rag_databases.splice(t,1),this.settingsChanged=!0},async vectorize_folder(t){await de.post("/vectorize_folder",{client_id:this.$store.state.client_id,db_path:this.$store.state.config.rag_databases[t]},this.posts_headers)},async select_folder(t){try{qe.on("rag_db_added",e=>{console.log(e),e?(this.$store.state.config.rag_databases[t]=`${e.database_name}::${e.database_path}`,this.settingsChanged=!0):this.$store.state.toast.showToast("Failed to select a folder",4,!1)}),await de.post("/add_rag_database",{client_id:this.$store.state.client_id},this.posts_headers)}catch{this.$store.state.toast.showToast("Failed to select a folder",4,!1)}},handleTemplateSelection(t){console.log("handleTemplateSelection");const e=t.target.value;console.log("handleTemplateSelection: ",e),e==="lollms"?(console.log("Using lollms template"),this.configFile.start_header_id_template="!@>",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` `,this.configFile.start_user_header_id_template="!@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="!@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="lollms_simplified"?(console.log("Using lollms template"),this.configFile.start_header_id_template="@>",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` `,this.configFile.start_user_header_id_template="@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="bare"?(console.log("Using lollms template"),this.configFile.start_header_id_template="",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` `,this.configFile.start_user_header_id_template="",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="llama3"?(console.log("Using llama3 template"),this.configFile.start_header_id_template="<|start_header_id|>",this.configFile.system_message_template="system",this.configFile.end_header_id_template="<|end_header_id|>",this.configFile.separator_template="<|eot_id|>",this.configFile.start_user_header_id_template="<|start_header_id|>",this.configFile.end_user_header_id_template="<|end_header_id|>",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="<|start_header_id|>",this.configFile.end_ai_header_id_template="<|end_header_id|>",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="mistral"&&(console.log("Using mistral template"),this.configFile.start_header_id_template="[INST]",this.configFile.system_message_template=" Using this information",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` diff --git a/web/dist/index.html b/web/dist/index.html index 85493046..a1f2f1f6 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,7 +6,7 @@ LoLLMS WebUI - + diff --git a/web/src/components/DynamicUIRenderer.vue b/web/src/components/DynamicUIRenderer.vue index d53c89d0..3035534e 100644 --- a/web/src/components/DynamicUIRenderer.vue +++ b/web/src/components/DynamicUIRenderer.vue @@ -1,11 +1,10 @@ - - diff --git a/zoos/personalities_zoo b/zoos/personalities_zoo index 21e8a8c7..c3a351fb 160000 --- a/zoos/personalities_zoo +++ b/zoos/personalities_zoo @@ -1 +1 @@ -Subproject commit 21e8a8c7764d86429943a122f6d3fe22fb0c9c17 +Subproject commit c3a351fb8db5f030cfbc4bcf3091095a21b26fed