diff --git a/web/dist/assets/index-8e0404da.js b/web/dist/assets/index-c4c09da1.js similarity index 97% rename from web/dist/assets/index-8e0404da.js rename to web/dist/assets/index-c4c09da1.js index b71191c3..3a982fec 100644 --- a/web/dist/assets/index-8e0404da.js +++ b/web/dist/assets/index-c4c09da1.js @@ -115,7 +115,7 @@ License: MIT `:"\r"}(X,w)),L=!1,v.delimiter)D(v.delimiter)&&(v.delimiter=v.delimiter(X),ee.meta.delimiter=v.delimiter);else{var A=function($,z,ne,ae,j){var re,U,Y,le;j=j||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var pe=0;pe=I)return We(!0)}else for(fe=T,T++;;){if((fe=G.indexOf(E,fe+1))===-1)return _e||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:V.length,index:T}),Te();if(fe===ee-1)return Te(G.substring(T,fe).replace(pe,E));if(E!==Z||G[fe+1]!==Z){if(E===Z||fe===0||G[fe-1]!==Z){Y!==-1&&Y=I)return We(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:V.length,index:T}),fe++}}else fe++}return Te();function ie(et){V.push(et),ge=T}function me(et){var nt=0;if(et!==-1){var ct=G.substring(fe+1,et);ct&&ct.trim()===""&&(nt=ct.length)}return nt}function Te(et){return _e||(et===void 0&&(et=G.substring(T)),X.push(et),T=ee,ie(X),Q&&Pe()),We()}function Be(et){T=et,ie(X),X=[],le=G.indexOf(L,T)}function We(et){return{data:V,errors:te,meta:{delimiter:M,linebreak:L,aborted:q,truncated:!!et,cursor:ge+(we||0)}}}function Pe(){J(We()),V=[],te=[]}},this.abort=function(){q=!0},this.getCharIndex=function(){return T}}function y(v){var E=v.data,M=i[E.workerId],L=!1;if(E.error)M.userError(E.error,E.file);else if(E.results&&E.results.data){var B={abort:function(){L=!0,x(E.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(D(M.userStep)){for(var J=0;J{this.lollmsVersion=t})},computed:{async fetchLollmsVersion(){return await ye.get("/get_lollms_version")}},async created(){},methods:{async api_get_req(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},loadFAQs(){fetch("/help/faqs.csv").then(t=>t.text()).then(t=>{const{data:e}=bMe.parse(t,{header:!0});console.log("Recovered data"),console.log(e),this.faqs=e}).catch(t=>{console.error("Error loading FAQs:",t)})},parseMultiline(t){return t.replace(/\n/g,"
")}}},wi=t=>(ss("data-v-6f1a11a2"),t=t(),os(),t),vMe={class:"container mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},wMe=wi(()=>c("h2",{class:"text-2xl font-bold mb-2"},"About Lord of large Language Models",-1)),xMe={class:"mb-4"},kMe=wi(()=>c("p",null,[xe("Discord link: "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/C73K7hjy"},"https://discord.gg/C73K7hjy")],-1)),EMe={class:"mb-8 overflow-y-auto max-h-96 scrollbar"},CMe=wi(()=>c("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1)),AMe={class:"list-disc pl-4"},SMe={class:"text-xl font-bold mb-1"},TMe=["innerHTML"],MMe=wi(()=>c("div",null,[c("h2",{class:"text-2xl font-bold mb-2"},"Contact Us"),c("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to me."),c("p",null,[xe("Discord link: "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/C73K7hjy"},"https://discord.gg/C73K7hjy")])],-1)),OMe={class:"mt-8"},RMe=rs('

Credits

This project is developed by ParisNeo With help from the community.

Check out the full list of developers here and show them some love.

',3),NMe=["href"];function DMe(t,e,n,s,o,r){return k(),C("div",vMe,[c("div",null,[wMe,c("p",xMe," Lollms version "+H(o.lollmsVersion),1),kMe]),c("div",EMe,[CMe,c("ul",AMe,[(k(!0),C(Re,null,Ge(o.faqs,(i,a)=>(k(),C("li",{key:a},[c("h3",SMe,H(i.question),1),c("p",{class:"mb-4",innerHTML:r.parseMultiline(i.answer)},null,8,TMe)]))),128))])]),MMe,c("div",OMe,[RMe,c("p",null,[xe("Check out the project on "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:o.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,NMe),xe(".")])])])}const LMe=Ue(yMe,[["render",DMe],["__scopeId","data-v-6f1a11a2"]]);function Gt(t,e=!0,n=1){const s=e?1e3:1024;if(Math.abs(t)=s&&rr.hide&&r.hide(...i)),class:"bg-primary hover:bg-primary-light active:scale-95 duration-150 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-secondary-dark"}," OK ")])])])):P("",!0)}const $g=Ue(IMe,[["render",zMe]]),jMe={data(){return{show:!1,message:"",resolve:null,ConfirmButtonText:"Yes, I'm sure",DenyButtonText:"No, cancel"}},methods:{hide(t){this.show=!1,this.resolve&&(this.resolve(t),this.resolve=null)},askQuestion(t,e,n){return this.ConfirmButtonText=e||this.ConfirmButtonText,this.DenyButtonText=n||this.DenyButtonText,new Promise(s=>{this.message=t,this.show=!0,this.resolve=s})}}},UMe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},qMe={class:"relative w-full max-w-md max-h-full"},HMe={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},VMe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),GMe=c("span",{class:"sr-only"},"Close modal",-1),KMe=[VMe,GMe],WMe={class:"p-4 text-center"},ZMe=c("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"},[c("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),YMe={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none break-all"};function JMe(t,e,n,s,o,r){return o.show?(k(),C("div",UMe,[c("div",qMe,[c("div",HMe,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>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"},KMe),c("div",WMe,[ZMe,c("h3",YMe,H(o.message),1),c("button",{onClick:e[1]||(e[1]=i=>r.hide(!0)),type:"button",class:"text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"},H(o.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=i=>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"},H(o.DenyButtonText),1)])])])])):P("",!0)}const QMe=Ue(jMe,[["render",JMe]]),Rr="/assets/default_model-9e24e852.png",XMe={props:{title:String,icon:String,path:String,owner:String,owner_link:String,license:String,description:String,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(()=>{ve.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 Gt(t)},async getFileSize(t){if(this.model_type!="api")try{const e=await ye.head(t);return e?e.headers["content-length"]?this.computedFileSize(e.headers["content-length"]):this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined":this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined"}catch(e){return console.log(e.message,"getFileSize"),"Could not be determined"}},getImgUrl(){return this.icon==="/images/default_model.png"?Rr:this.icon},defaultImg(t){t.target.src=Rr},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(){this.onSelected(this)},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this)},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{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 Gt(this.speed)},total_size_computed(){return Gt(this.total_size)},downloaded_size_computed(){return Gt(this.downloaded_size)}},watch:{linkNotValid(){be(()=>{ve.replace()})}}},eOe=["title"],tOe={key:0,class:"flex flex-row"},nOe={class:"max-w-[300px] overflow-x-auto"},sOe={class:"flex gap-3 items-center grow"},oOe=["src"],rOe={class:"flex-1 overflow-hidden"},iOe={class:"font-bold font-large text-lg truncate"},aOe={key:1,class:"flex items-center flex-row gap-2 my-1"},lOe={class:"flex grow items-center"},cOe=c("i",{"data-feather":"box",class:"w-5"},null,-1),dOe=c("span",{class:"sr-only"},"Custom model / local model",-1),uOe=[cOe,dOe],hOe=c("span",{class:"sr-only"},"Remove",-1),fOe={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"},pOe={class:"relative flex flex-col items-center justify-center flex-grow h-full"},gOe=c("div",{role:"status",class:"justify-center"},[c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),c("span",{class:"sr-only"},"Loading...")],-1),mOe={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},_Oe={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},bOe={class:"flex justify-between mb-1"},yOe=c("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),vOe={class:"text-sm font-medium text-blue-700 dark:text-white"},wOe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},xOe={class:"flex justify-between mb-1"},kOe={class:"text-base font-medium text-blue-700 dark:text-white"},EOe={class:"text-sm font-medium text-blue-700 dark:text-white"},COe={class:"flex flex-grow"},AOe={class:"flex flex-row flex-grow gap-3"},SOe={class:"p-2 text-center grow"},TOe={key:3},MOe={class:"flex flex-row items-center gap-3"},OOe=["src"],ROe={class:"font-bold font-large text-lg truncate"},NOe=c("div",{class:"grow"},null,-1),DOe=c("div",{class:"flex-none gap-1"},null,-1),LOe={class:"flex items-center flex-row-reverse gap-2 my-1"},IOe=c("span",{class:"sr-only"},"Copy info",-1),POe={class:"flex flex-row items-center"},FOe={key:0,class:"text-base text-red-600 flex items-center mt-1"},BOe=c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),$Oe=c("span",{class:"sr-only"},"Click to install",-1),zOe=c("span",{class:"sr-only"},"Remove",-1),jOe=["title"],UOe={class:""},qOe={class:"flex flex-row items-center"},HOe=c("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),VOe=c("b",null,"Manual download: ",-1),GOe=["href","title"],KOe=c("div",{class:"grow"},null,-1),WOe=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),ZOe=[WOe],YOe={class:"flex items-center"},JOe=c("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),QOe=c("b",null,"File size: ",-1),XOe={class:"flex items-center"},eRe=c("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),tRe=c("b",null,"License: ",-1),nRe={class:"flex items-center"},sRe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),oRe=c("b",null,"Owner: ",-1),rRe=["href"],iRe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),aRe=["title"];function lRe(t,e,n,s,o,r){return k(),C("div",{class:Me(["relative 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[11]||(e[11]=de((...i)=>r.toggleSelected&&r.toggleSelected(...i),["stop"])),title:n.title},[n.model.isCustomModel?(k(),C("div",tOe,[c("div",nOe,[c("div",sOe,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=i=>r.defaultImg(i)),class:"w-10 h-10 rounded-lg object-fill"},null,40,oOe),c("div",rOe,[c("h3",iOe,H(n.title),1)])])])])):P("",!0),n.model.isCustomModel?(k(),C("div",aOe,[c("div",lOe,[c("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]=de(()=>{},["stop"]))},uOe),xe(" Custom model ")]),c("div",null,[n.model.isInstalled?(k(),C("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Uninstall "),hOe])):P("",!0)])])):P("",!0),o.installing?(k(),C("div",fOe,[c("div",pOe,[gOe,c("div",mOe,[c("div",_Oe,[c("div",bOe,[yOe,c("span",vOe,H(Math.floor(o.progress))+"%",1)]),c("div",wOe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt({width:o.progress+"%"})},null,4)]),c("div",xOe,[c("span",kOe,"Download speed: "+H(r.speed_computed)+"/s",1),c("span",EOe,H(r.downloaded_size_computed)+"/"+H(r.total_size_computed),1)])])]),c("div",COe,[c("div",AOe,[c("div",SOe,[c("button",{onClick:e[3]||(e[3]=de((...i)=>r.toggleCancelInstall&&r.toggleCancelInstall(...i),["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 ")])])])])])):P("",!0),n.model.isCustomModel?P("",!0):(k(),C("div",TOe,[c("div",MOe,[c("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=i=>r.defaultImg(i)),class:Me(["w-10 h-10 rounded-lg object-fill",o.linkNotValid?"grayscale":""])},null,42,OOe),c("h3",ROe,H(n.title),1),NOe,DOe]),c("div",LOe,[c("button",{type:"button",title:"Copy model info to clipboard",onClick:e[5]||(e[5]=de(i=>r.toggleCopy(),["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"},[xe(" Copy info "),IOe]),c("div",POe,[o.linkNotValid?(k(),C("div",FOe,[BOe,xe(" Link is not valid ")])):P("",!0)]),!n.model.isInstalled&&!o.linkNotValid?(k(),C("button",{key:0,title:"Click to install",type:"button",onClick:e[6]||(e[6]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Install "),$Oe])):P("",!0),n.model.isInstalled?(k(),C("button",{key:1,title:"Delete file from disk",type:"button",onClick:e[7]||(e[7]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Uninstall "),zOe])):P("",!0)]),c("div",{class:"",title:n.model.isInstalled?n.title:"Not installed"},[c("div",UOe,[c("div",qOe,[HOe,VOe,c("a",{href:n.path,onClick:e[8]||(e[8]=de(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:o.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," Click here to download ",8,GOe),KOe,c("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]=de(i=>r.toggleCopyLink(),["stop"]))},ZOe)]),c("div",YOe,[c("div",{class:Me(["flex flex-shrink-0 items-center",o.linkNotValid?"text-red-600":""])},[JOe,QOe,xe(" "+H(r.fileSize),1)],2)]),c("div",XOe,[eRe,tRe,xe(" "+H(n.license),1)]),c("div",nRe,[sRe,oRe,c("a",{href:n.owner_link,target:"_blank",rel:"noopener noreferrer",onClick:e[10]||(e[10]=de(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"Owner's profile"},H(n.owner),9,rRe)])]),iRe,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.description},H(n.description.replace(/<\/?[^>]+>/ig," ")),9,aRe)],8,jOe)]))],10,eOe)}const cRe=Ue(XMe,[["render",lRe]]),dRe={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}}},uRe={class:"p-4"},hRe={class:"flex items-center mb-4"},fRe=["src"],pRe={class:"text-lg font-semibold"},gRe=c("strong",null,"Author:",-1),mRe=c("strong",null,"Description:",-1),_Re=c("strong",null,"Category:",-1),bRe={key:0},yRe=c("strong",null,"Disclaimer:",-1),vRe=c("strong",null,"Conditioning Text:",-1),wRe=c("strong",null,"AI Prefix:",-1),xRe=c("strong",null,"User Prefix:",-1),kRe=c("strong",null,"Antiprompts:",-1);function ERe(t,e,n,s,o,r){return k(),C("div",uRe,[c("div",hRe,[c("img",{src:o.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,fRe),c("h2",pRe,H(o.personalityName),1)]),c("p",null,[gRe,xe(" "+H(o.personalityAuthor),1)]),c("p",null,[mRe,xe(" "+H(o.personalityDescription),1)]),c("p",null,[_Re,xe(" "+H(o.personalityCategory),1)]),o.disclaimer?(k(),C("p",bRe,[yRe,xe(" "+H(o.disclaimer),1)])):P("",!0),c("p",null,[vRe,xe(" "+H(o.conditioningText),1)]),c("p",null,[wRe,xe(" "+H(o.aiPrefix),1)]),c("p",null,[xRe,xe(" "+H(o.userPrefix),1)]),c("div",null,[kRe,c("ul",null,[(k(!0),C(Re,null,Ge(o.antipromptsList,i=>(k(),C("li",{key:i.id},H(i.text),1))),128))])]),c("button",{onClick:e[0]||(e[0]=i=>o.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),o.editMode?(k(),C("button",{key:1,onClick:e[1]||(e[1]=(...i)=>r.commitChanges&&r.commitChanges(...i)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):P("",!0)])}const CRe=Ue(dRe,[["render",ERe]]),es="/assets/logo-9d653710.svg";const ARe={props:{icon:{type:String,required:!1,value:"feather:command"},commands:{type:Array,required:!0},force_position:{required:!1,value:0},execute_cmd:{type:Function,required:!1}},data(){return{isMenuOpen:!1,menuPosition:{bottom:"auto",top:"calc(100% + 10px)"}}},methods:{handleClickOutside(t){const e=this.$refs.menu,n=this.$refs.menuButton;e&&!e.contains(t.target)&&!n.contains(t.target)&&(this.isMenuOpen=!1,window.removeEventListener("click",this.handleClickOutside))},toggleMenu(){this.positionMenu(),this.isMenuOpen=!this.isMenuOpen,this.isMenuOpen?window.addEventListener("click",this.handleClickOutside):window.removeEventListener("click",this.handleClickOutside),be(()=>{ve.replace()})},executeCommand(t){this.isMenuOpen=!1,console.log("Selected"),console.log(t.value),typeof t.value=="function"&&(console.log("Command detected"),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(()=>{ve.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},SRe={class:"menu-container"},TRe=["src","alt"],MRe=["data-feather"],ORe=c("i",{"data-feather":"command"},null,-1),RRe={class:"flex-grow menu-ul"},NRe=["onClick"],DRe=["src","alt"],LRe=["data-feather"],IRe={key:2,class:"menu-icon"};function PRe(t,e,n,s,o,r){return k(),C("div",SRe,[c("button",{onClick:e[0]||(e[0]=de((...i)=>r.toggleMenu&&r.toggleMenu(...i),["prevent"])),class:"menu-button bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded-full flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer",ref:"menuButton"},[n.icon&&!n.icon.includes("feather")?(k(),C("img",{key:0,src:t.command.icon,alt:t.command.name,class:"w-5 h-5"},null,8,TRe)):P("",!0),n.icon&&n.icon.includes("feather")?(k(),C("i",{key:1,"data-feather":t.command.icon.split(":")[1],class:"w-5 h-5"},null,8,MRe)):P("",!0),ORe],512),ue(Ts,{name:"slide"},{default:Ne(()=>[o.isMenuOpen?(k(),C("div",{key:0,class:"menu-list flex-grow",style:yt(o.menuPosition),ref:"menu"},[c("ul",RRe,[(k(!0),C(Re,null,Ge(n.commands,(i,a)=>(k(),C("li",{key:a,onClick:l=>r.executeCommand(i),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[i.icon&&!i.icon.includes("feather")&&!i.is_file?(k(),C("img",{key:0,src:i.icon,alt:i.name,class:"menu-icon"},null,8,DRe)):P("",!0),i.icon&&i.icon.includes("feather")&&!i.is_file?(k(),C("i",{key:1,"data-feather":i.icon.split(":")[1],class:"mr-2"},null,8,LRe)):(k(),C("span",IRe)),c("span",null,H(i.name),1)],8,NRe))),128))])],4)):P("",!0)]),_:1})])}const zg=Ue(ARe,[["render",PRe]]),FRe="/",BRe={props:{personality:{},selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMounted:Function,onRemount:Function,onReinstall:Function,onSettings:Function},components:{InteractiveMenu:zg},data(){return{isMounted:!1,name:this.personality.name}},computed:{commandsList(){let t=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.toggleMounted},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return this.selected&&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(()=>{ve.replace()})},methods:{getImgUrl(){return FRe+this.personality.avatar},defaultImg(t){t.target.src=es},toggleTalk(){this.onTalk(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},toggleMounted(){console.log("Mounting/unmounting"),this.onMounted(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){be(()=>{ve.replace()})}}},$Re=["title"],zRe={class:"flex flex-row items-center flex-shrink-0 gap-3"},jRe=["src"],URe=c("i",{"data-feather":"check",class:"w-5"},null,-1),qRe=c("span",{class:"sr-only"},"Select",-1),HRe=[URe,qRe],VRe=c("i",{"data-feather":"send",class:"w-5"},null,-1),GRe=c("span",{class:"sr-only"},"Talk",-1),KRe=[VRe,GRe],WRe={class:""},ZRe={class:""},YRe={class:"flex items-center"},JRe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),QRe=c("b",null,"Author: ",-1),XRe={key:0,class:"flex items-center"},eNe=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),tNe=c("b",null,"Languages: ",-1),nNe=["selected"],sNe={class:"flex items-center"},oNe=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),rNe=c("b",null,"Category: ",-1),iNe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),aNe=["title"];function lNe(t,e,n,s,o,r){const i=qe("InteractiveMenu");return k(),C("div",{class:Me(["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",o.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:n.personality.installed?"":"Not installed"},[c("div",{class:Me(n.personality.installed?"":"opacity-50")},[c("div",zRe,[c("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"},null,40,jRe),c("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},H(n.personality.name),1),o.isMounted?(k(),C("button",{key:0,type:"button",title:"Select",onClick:[e[3]||(e[3]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[4]||(e[4]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},HRe)):P("",!0),o.isMounted?(k(),C("button",{key:1,type:"button",title:"Talk",onClick:[e[5]||(e[5]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[6]||(e[6]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},KRe)):P("",!0),ue(i,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),c("div",WRe,[c("div",ZRe,[c("div",YRe,[JRe,QRe,xe(" "+H(n.personality.author),1)]),n.personality.languages?(k(),C("div",XRe,[eNe,tNe,se(c("select",{id:"languages","onUpdate:modelValue":e[7]||(e[7]=a=>n.personality.lang=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"},[(k(!0),C(Re,null,Ge(n.personality.languages,(a,l)=>(k(),C("option",{key:l,selected:a==n.personality.languages[0]},H(a),9,nNe))),128))],512),[[on,n.personality.lang]])])):P("",!0),c("div",sNe,[oNe,rNe,xe(" "+H(n.personality.category),1)])]),iNe,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.personality.description},H(n.personality.description),9,aNe)])],2)],10,$Re)}const jg=Ue(BRe,[["render",lNe]]),cNe="/",dNe={props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){be(()=>{ve.replace()})},methods:{getImgUrl(){return cNe+this.binding.icon},defaultImg(t){t.target.src=es},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(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(()=>{ve.replace()})}}},uNe=["title"],hNe={class:"flex flex-row items-center gap-3"},fNe=["src"],pNe={class:"font-bold font-large text-lg truncate"},gNe=c("div",{class:"grow"},null,-1),mNe={class:"flex-none gap-1"},_Ne=c("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),bNe=c("span",{class:"sr-only"},"Help",-1),yNe=[_Ne,bNe],vNe={class:"flex items-center flex-row-reverse gap-2 my-1"},wNe=c("span",{class:"sr-only"},"Click to install",-1),xNe=c("span",{class:"sr-only"},"Reinstall binding",-1),kNe=c("span",{class:"sr-only"},"Settings",-1),ENe={class:""},CNe={class:""},ANe={class:"flex items-center"},SNe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),TNe=c("b",null,"Author: ",-1),MNe={class:"flex items-center"},ONe=c("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),RNe=c("b",null,"Folder: ",-1),NNe={class:"flex items-center"},DNe=c("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),LNe=c("b",null,"Version: ",-1),INe={class:"flex items-center"},PNe=c("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),FNe=c("b",null,"Link: ",-1),BNe=["href"],$Ne=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),zNe=["title"];function jNe(t,e,n,s,o,r){return k(),C("div",{class:Me(["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[6]||(e[6]=de((...i)=>r.toggleSelected&&r.toggleSelected(...i),["stop"])),title:n.binding.installed?n.binding.name:"Not installed"},[c("div",null,[c("div",hNe,[c("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=i=>r.defaultImg(i)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,fNe),c("h3",pNe,H(n.binding.name),1),gNe,c("div",mNe,[n.selected?(k(),C("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...i)=>r.toggleReloadBinding&&r.toggleReloadBinding(...i)),e[2]||(e[2]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},yNe)):P("",!0)])]),c("div",vNe,[n.binding.installed?P("",!0):(k(),C("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Install "),wNe])),n.binding.installed?(k(),C("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=de((...i)=>r.toggleReinstall&&r.toggleReinstall(...i),["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"},[xe(" Reinstall binding "),xNe])):P("",!0),n.selected?(k(),C("button",{key:2,title:"Click to open Settings",type:"button",onClick:e[5]||(e[5]=de((...i)=>r.toggleSettings&&r.toggleSettings(...i),["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"},[xe(" Settings "),kNe])):P("",!0)]),c("div",ENe,[c("div",CNe,[c("div",ANe,[SNe,TNe,xe(" "+H(n.binding.author),1)]),c("div",MNe,[ONe,RNe,xe(" "+H(n.binding.folder),1)]),c("div",NNe,[DNe,LNe,xe(" "+H(n.binding.version),1)]),c("div",INe,[PNe,FNe,c("a",{href:n.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},H(n.binding.link),9,BNe)])]),$Ne,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.binding.description},H(n.binding.description),9,zNe)])])],10,uNe)}const UNe=Ue(dNe,[["render",jNe]]),qNe={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})}}},HNe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},VNe={class:"relative w-full max-w-md max-h-full"},GNe={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},KNe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),WNe=c("span",{class:"sr-only"},"Close modal",-1),ZNe=[KNe,WNe],YNe={class:"p-4 text-center"},JNe=c("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"},[c("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),QNe={class:"p-4 text-center mx-auto mb-4"},XNe=c("label",{class:"mr-2"},"Model path",-1);function eDe(t,e,n,s,o,r){return o.show?(k(),C("div",HNe,[c("div",VNe,[c("div",GNe,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>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"},ZNe),c("div",YNe,[JNe,c("div",QNe,[XNe,se(c("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>o.model_path=i),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[Oe,o.model_path]])]),c("button",{onClick:e[2]||(e[2]=i=>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 "),c("button",{onClick:e[3]||(e[3]=i=>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")])])])])):P("",!0)}const tDe=Ue(qNe,[["render",eDe]]),nDe={setup(){return{}},name:"UniversalForm",data(){return{show:!1,resolve:null,controls_array:[],title:"Universal form",ConfirmButtonText:"Submit",DenyButtonText:"Cancel"}},mounted(){be(()=>{ve.replace()})},methods:{hide(t){this.show=!1,this.resolve&&t&&(this.resolve(this.controls_array),this.resolve=null)},showForm(t,e,n,s){this.ConfirmButtonText=n||this.ConfirmButtonText,this.DenyButtonText=s||this.DenyButtonText;for(let o=0;o{this.controls_array=t,this.show=!0,this.title=e||this.title,this.resolve=o,console.log("show foam",this.controls_array)})}},watch:{show(){be(()=>{ve.replace()})}}},sDe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 p-4"},oDe={class:"relative w-full max-w-md"},rDe={class:"flex flex-col rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel duration-150 shadow-lg max-h-screen"},iDe={class:"flex flex-row flex-grow items-center m-2 p-1"},aDe={class:"grow flex items-center"},lDe=c("i",{"data-feather":"sliders",class:"mr-2 flex-shrink-0"},null,-1),cDe={class:"text-lg font-semibold select-none mr-2"},dDe={class:"items-end"},uDe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),hDe=c("span",{class:"sr-only"},"Close form modal",-1),fDe=[uDe,hDe],pDe={class:"flex flex-col relative no-scrollbar overflow-y-scroll p-2"},gDe={class:"px-2"},mDe={key:0},_De={key:0},bDe={class:"text-base font-semibold"},yDe={key:0,class:"relative inline-flex"},vDe=["onUpdate:modelValue"],wDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),xDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},kDe=["onUpdate:modelValue"],EDe={key:1},CDe={class:"text-base font-semibold"},ADe={key:0,class:"relative inline-flex"},SDe=["onUpdate:modelValue"],TDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),MDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},ODe=["onUpdate:modelValue"],RDe=["value","selected"],NDe={key:1},DDe={class:"text-base font-semibold"},LDe={key:0,class:"relative inline-flex"},IDe=["onUpdate:modelValue"],PDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),FDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},BDe=["onUpdate:modelValue"],$De=["onUpdate:modelValue","min","max"],zDe={key:2},jDe={class:"mb-2 relative flex items-center gap-2"},UDe={for:"default-checkbox",class:"text-base font-semibold"},qDe=["onUpdate:modelValue"],HDe={key:0,class:"relative inline-flex"},VDe=["onUpdate:modelValue"],GDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),KDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},WDe={key:3},ZDe={class:"text-base font-semibold"},YDe={key:0,class:"relative inline-flex"},JDe=["onUpdate:modelValue"],QDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),XDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},eLe=["onUpdate:modelValue"],tLe=c("hr",{class:"h-px my-4 bg-gray-200 border-0 dark:bg-gray-700"},null,-1),nLe={class:"flex flex-row flex-grow gap-3"},sLe={class:"p-2 text-center grow"};function oLe(t,e,n,s,o,r){return o.show?(k(),C("div",sDe,[c("div",oDe,[c("div",rDe,[c("div",iDe,[c("div",aDe,[lDe,c("h3",cDe,H(o.title),1)]),c("div",dDe,[c("button",{type:"button",onClick:e[0]||(e[0]=de(i=>r.hide(!1),["stop"])),title:"Close",class:"bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},fDe)])]),c("div",pDe,[(k(!0),C(Re,null,Ge(o.controls_array,(i,a)=>(k(),C("div",gDe,[i.type=="str"?(k(),C("div",mDe,[i.options?P("",!0):(k(),C("div",_De,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",bDe,H(i.name)+": ",1),i.help?(k(),C("label",yDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,vDe),[[rt,i.isHelp]]),wDe])):P("",!0)],2),i.isHelp?(k(),C("p",xDe,H(i.help),1)):P("",!0),se(c("input",{type:"text","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter string"},null,8,kDe),[[Oe,i.value]])])),i.options?(k(),C("div",EDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",CDe,H(i.name)+": ",1),i.help?(k(),C("label",ADe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,SDe),[[rt,i.isHelp]]),TDe])):P("",!0)],2),i.isHelp?(k(),C("p",MDe,H(i.help),1)):P("",!0),se(c("select",{"onUpdate:modelValue":l=>i.value=l,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"},[(k(!0),C(Re,null,Ge(i.options,l=>(k(),C("option",{value:l,selected:i.value===l},H(l),9,RDe))),256))],8,ODe),[[on,i.value]])])):P("",!0)])):P("",!0),i.type=="int"||i.type=="float"?(k(),C("div",NDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",DDe,H(i.name)+": ",1),i.help?(k(),C("label",LDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,IDe),[[rt,i.isHelp]]),PDe])):P("",!0)],2),i.isHelp?(k(),C("p",FDe,H(i.help),1)):P("",!0),se(c("input",{type:"number","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,BDe),[[Oe,i.value]]),i.min!=null&&i.max!=null?se((k(),C("input",{key:1,type:"range","onUpdate:modelValue":l=>i.value=l,min:i.min,max:i.max,step:"0.1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,$De)),[[Oe,i.value]]):P("",!0)])):P("",!0),i.type=="bool"?(k(),C("div",zDe,[c("div",jDe,[c("label",UDe,H(i.name)+": ",1),se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.value=l,class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"},null,8,qDe),[[rt,i.value]]),i.help?(k(),C("label",HDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,VDe),[[rt,i.isHelp]]),GDe])):P("",!0)]),i.isHelp?(k(),C("p",KDe,H(i.help),1)):P("",!0)])):P("",!0),i.type=="list"?(k(),C("div",WDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",ZDe,H(i.name)+": ",1),i.help?(k(),C("label",YDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,JDe),[[rt,i.isHelp]]),QDe])):P("",!0)],2),i.isHelp?(k(),C("p",XDe,H(i.help),1)):P("",!0),se(c("input",{type:"text","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter comma separated values"},null,8,eLe),[[Oe,i.value]])])):P("",!0),tLe]))),256)),c("div",nLe,[c("div",sLe,[c("button",{onClick:e[1]||(e[1]=de(i=>r.hide(!0),["stop"])),type:"button",class:"mr-2 text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},H(o.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=de(i=>r.hide(!1),["stop"])),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-11 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},H(o.DenyButtonText),1)])])])])])])):P("",!0)}const wc=Ue(nDe,[["render",oLe]]);const rLe={props:{show:{type:Boolean,required:!0},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null}},methods:{selectChoice(t){this.selectedChoice=t,this.$emit("choice-selected",t)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated")},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"}}},iLe={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"},aLe={class:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96"},lLe={class:"text-xl font-semibold mb-4"},cLe={class:"h-48 overflow-y-auto"},dLe=["onClick"],uLe={class:"font-bold"},hLe=c("br",null,null,-1),fLe={class:"text-xs text-gray-500"},pLe={class:"flex justify-end mt-4"},gLe=["disabled"];function mLe(t,e,n,s,o,r){return k(),st(Ts,{name:"fade"},{default:Ne(()=>[n.show?(k(),C("div",iLe,[c("div",aLe,[c("h2",lLe,H(n.title),1),c("div",cLe,[c("ul",null,[(k(!0),C(Re,null,Ge(n.choices,(i,a)=>(k(),C("li",{key:a,onClick:l=>r.selectChoice(i),class:Me([{"selected-choice":i===o.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700"])},[c("span",uLe,H(i.name),1),hLe,c("span",fLe,H(this.formatSize(i.size)),1)],10,dLe))),128))])]),c("div",pLe,[c("button",{onClick:e[0]||(e[0]=(...i)=>r.closeDialog&&r.closeDialog(...i)),class:"py-2 px-4 mr-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition duration-300"}," Cancel "),c("button",{onClick:e[1]||(e[1]=(...i)=>r.validateChoice&&r.validateChoice(...i)),class:Me([{"bg-gray-400 cursor-not-allowed":!o.selectedChoice,"bg-blue-500 hover:bg-blue-600":o.selectedChoice,"text-white":o.selectedChoice,"text-gray-500":!o.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!o.selectedChoice}," Validate ",10,gLe)])])])):P("",!0)]),_:1})}const _Le=Ue(rLe,[["render",mLe]]);const bLe="/";ye.defaults.baseURL="/";const yLe={components:{AddModelDialog:tDe,MessageBox:$g,YesNoDialog:QMe,ModelEntry:cRe,PersonalityViewer:CRe,Toast:Ks,PersonalityEntry:jg,BindingEntry:UNe,UniversalForm:wc,ChoiceDialog:_Le,Card:vi},data(){return{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,minconf_collapsed:!0,bec_collapsed:!0,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,bzl_collapsed:!1,persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:bLe,searchPersonality:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){Ee.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{getVoices(){"speechSynthesis"in window&&(this.audioVoices=speechSynthesis.getVoices(),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let t=await this.api_get_req("check_update");this.has_updates=t.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(t){this.selected_variant=t},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let t=this.currenModelToInstall;if(t.linkNotValid){t.installing=!1,this.$refs.toast.showToast("Link is not valid, file does not exist",4,!1);return}let e=t.path;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t.path},console.log("installing...",this.addModel);const n=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),t.progress=s.progress,t.speed=s.speed,t.total_size=s.total_size,t.downloaded_size=s.downloaded_size,t.start_time=s.start_time,t.installing=!0,t.progress==100){const o=this.models.findIndex(r=>r.path===e);this.models[o].isInstalled=!0,this.showProgress=!1,t.installing=!1,console.log("Received succeeded"),Ee.off("install_progress",n),console.log("Installed successfully"),this.$refs.toast.showToast(`Model: +`);var T=0,q=!1;this.parse=function(G,we,_e){if(typeof G!="string")throw new Error("Input must be a string");var ee=G.length,ke=M.length,Se=L.length,N=B.length,Q=D(J),V=[],te=[],X=[],ge=T=0;if(!G)return We();if(v.header&&!we){var he=G.split(L)[0].split(M),w=[],A={},F=!1;for(var $ in he){var z=he[$];D(v.transformHeader)&&(z=v.transformHeader(z,$));var ne=z,ae=A[z]||0;for(0=I)return We(!0)}else for(fe=T,T++;;){if((fe=G.indexOf(E,fe+1))===-1)return _e||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:V.length,index:T}),Te();if(fe===ee-1)return Te(G.substring(T,fe).replace(pe,E));if(E!==Z||G[fe+1]!==Z){if(E===Z||fe===0||G[fe-1]!==Z){Y!==-1&&Y=I)return We(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:V.length,index:T}),fe++}}else fe++}return Te();function ie(et){V.push(et),ge=T}function me(et){var nt=0;if(et!==-1){var ct=G.substring(fe+1,et);ct&&ct.trim()===""&&(nt=ct.length)}return nt}function Te(et){return _e||(et===void 0&&(et=G.substring(T)),X.push(et),T=ee,ie(X),Q&&Pe()),We()}function Be(et){T=et,ie(X),X=[],le=G.indexOf(L,T)}function We(et){return{data:V,errors:te,meta:{delimiter:M,linebreak:L,aborted:q,truncated:!!et,cursor:ge+(we||0)}}}function Pe(){J(We()),V=[],te=[]}},this.abort=function(){q=!0},this.getCharIndex=function(){return T}}function y(v){var E=v.data,M=i[E.workerId],L=!1;if(E.error)M.userError(E.error,E.file);else if(E.results&&E.results.data){var B={abort:function(){L=!0,x(E.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(D(M.userStep)){for(var J=0;J{this.lollmsVersion=t})},computed:{async fetchLollmsVersion(){return await ye.get("/get_lollms_version")}},async created(){},methods:{async api_get_req(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},loadFAQs(){fetch("/help/faqs.csv").then(t=>t.text()).then(t=>{const{data:e}=bMe.parse(t,{header:!0});console.log("Recovered data"),console.log(e),this.faqs=e}).catch(t=>{console.error("Error loading FAQs:",t)})},parseMultiline(t){return t.replace(/\n/g,"
")}}},wi=t=>(ss("data-v-6f1a11a2"),t=t(),os(),t),vMe={class:"container mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},wMe=wi(()=>c("h2",{class:"text-2xl font-bold mb-2"},"About Lord of large Language Models",-1)),xMe={class:"mb-4"},kMe=wi(()=>c("p",null,[xe("Discord link: "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/C73K7hjy"},"https://discord.gg/C73K7hjy")],-1)),EMe={class:"mb-8 overflow-y-auto max-h-96 scrollbar"},CMe=wi(()=>c("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1)),AMe={class:"list-disc pl-4"},SMe={class:"text-xl font-bold mb-1"},TMe=["innerHTML"],MMe=wi(()=>c("div",null,[c("h2",{class:"text-2xl font-bold mb-2"},"Contact Us"),c("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to me."),c("p",null,[xe("Discord link: "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/C73K7hjy"},"https://discord.gg/C73K7hjy")])],-1)),OMe={class:"mt-8"},RMe=rs('

Credits

This project is developed by ParisNeo With help from the community.

Check out the full list of developers here and show them some love.

',3),NMe=["href"];function DMe(t,e,n,s,o,r){return k(),C("div",vMe,[c("div",null,[wMe,c("p",xMe," Lollms version "+H(o.lollmsVersion),1),kMe]),c("div",EMe,[CMe,c("ul",AMe,[(k(!0),C(Re,null,Ge(o.faqs,(i,a)=>(k(),C("li",{key:a},[c("h3",SMe,H(i.question),1),c("p",{class:"mb-4",innerHTML:r.parseMultiline(i.answer)},null,8,TMe)]))),128))])]),MMe,c("div",OMe,[RMe,c("p",null,[xe("Check out the project on "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:o.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,NMe),xe(".")])])])}const LMe=Ue(yMe,[["render",DMe],["__scopeId","data-v-6f1a11a2"]]);function Gt(t,e=!0,n=1){const s=e?1e3:1024;if(Math.abs(t)=s&&rr.hide&&r.hide(...i)),class:"bg-primary hover:bg-primary-light active:scale-95 duration-150 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-secondary-dark"}," OK ")])])])):P("",!0)}const $g=Ue(IMe,[["render",zMe]]),jMe={data(){return{show:!1,message:"",resolve:null,ConfirmButtonText:"Yes, I'm sure",DenyButtonText:"No, cancel"}},methods:{hide(t){this.show=!1,this.resolve&&(this.resolve(t),this.resolve=null)},askQuestion(t,e,n){return this.ConfirmButtonText=e||this.ConfirmButtonText,this.DenyButtonText=n||this.DenyButtonText,new Promise(s=>{this.message=t,this.show=!0,this.resolve=s})}}},UMe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},qMe={class:"relative w-full max-w-md max-h-full"},HMe={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},VMe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),GMe=c("span",{class:"sr-only"},"Close modal",-1),KMe=[VMe,GMe],WMe={class:"p-4 text-center"},ZMe=c("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"},[c("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),YMe={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none break-all"};function JMe(t,e,n,s,o,r){return o.show?(k(),C("div",UMe,[c("div",qMe,[c("div",HMe,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>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"},KMe),c("div",WMe,[ZMe,c("h3",YMe,H(o.message),1),c("button",{onClick:e[1]||(e[1]=i=>r.hide(!0)),type:"button",class:"text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"},H(o.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=i=>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"},H(o.DenyButtonText),1)])])])])):P("",!0)}const QMe=Ue(jMe,[["render",JMe]]),Rr="/assets/default_model-9e24e852.png",XMe={props:{title:String,icon:String,path:String,owner:String,owner_link:String,license:String,description:String,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(()=>{ve.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 Gt(t)},async getFileSize(t){if(this.model_type!="api")try{const e=await ye.head(t);return e?e.headers["content-length"]?this.computedFileSize(e.headers["content-length"]):this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined":this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined"}catch(e){return console.log(e.message,"getFileSize"),"Could not be determined"}},getImgUrl(){return this.icon==="/images/default_model.png"?Rr:this.icon},defaultImg(t){t.target.src=Rr},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(){this.onSelected(this)},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this)},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{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 Gt(this.speed)},total_size_computed(){return Gt(this.total_size)},downloaded_size_computed(){return Gt(this.downloaded_size)}},watch:{linkNotValid(){be(()=>{ve.replace()})}}},eOe=["title"],tOe={key:0,class:"flex flex-row"},nOe={class:"max-w-[300px] overflow-x-auto"},sOe={class:"flex gap-3 items-center grow"},oOe=["src"],rOe={class:"flex-1 overflow-hidden"},iOe={class:"font-bold font-large text-lg truncate"},aOe={key:1,class:"flex items-center flex-row gap-2 my-1"},lOe={class:"flex grow items-center"},cOe=c("i",{"data-feather":"box",class:"w-5"},null,-1),dOe=c("span",{class:"sr-only"},"Custom model / local model",-1),uOe=[cOe,dOe],hOe=c("span",{class:"sr-only"},"Remove",-1),fOe={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"},pOe={class:"relative flex flex-col items-center justify-center flex-grow h-full"},gOe=c("div",{role:"status",class:"justify-center"},[c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),c("span",{class:"sr-only"},"Loading...")],-1),mOe={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},_Oe={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},bOe={class:"flex justify-between mb-1"},yOe=c("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),vOe={class:"text-sm font-medium text-blue-700 dark:text-white"},wOe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},xOe={class:"flex justify-between mb-1"},kOe={class:"text-base font-medium text-blue-700 dark:text-white"},EOe={class:"text-sm font-medium text-blue-700 dark:text-white"},COe={class:"flex flex-grow"},AOe={class:"flex flex-row flex-grow gap-3"},SOe={class:"p-2 text-center grow"},TOe={key:3},MOe={class:"flex flex-row items-center gap-3"},OOe=["src"],ROe={class:"font-bold font-large text-lg truncate"},NOe=c("div",{class:"grow"},null,-1),DOe=c("div",{class:"flex-none gap-1"},null,-1),LOe={class:"flex items-center flex-row-reverse gap-2 my-1"},IOe=c("span",{class:"sr-only"},"Copy info",-1),POe={class:"flex flex-row items-center"},FOe={key:0,class:"text-base text-red-600 flex items-center mt-1"},BOe=c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),$Oe=c("span",{class:"sr-only"},"Click to install",-1),zOe=c("span",{class:"sr-only"},"Remove",-1),jOe=["title"],UOe={class:""},qOe={class:"flex flex-row items-center"},HOe=c("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),VOe=c("b",null,"Manual download: ",-1),GOe=["href","title"],KOe=c("div",{class:"grow"},null,-1),WOe=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),ZOe=[WOe],YOe={class:"flex items-center"},JOe=c("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),QOe=c("b",null,"File size: ",-1),XOe={class:"flex items-center"},eRe=c("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),tRe=c("b",null,"License: ",-1),nRe={class:"flex items-center"},sRe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),oRe=c("b",null,"Owner: ",-1),rRe=["href"],iRe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),aRe=["title"];function lRe(t,e,n,s,o,r){return k(),C("div",{class:Me(["relative 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[11]||(e[11]=de((...i)=>r.toggleSelected&&r.toggleSelected(...i),["stop"])),title:n.title},[n.model.isCustomModel?(k(),C("div",tOe,[c("div",nOe,[c("div",sOe,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=i=>r.defaultImg(i)),class:"w-10 h-10 rounded-lg object-fill"},null,40,oOe),c("div",rOe,[c("h3",iOe,H(n.title),1)])])])])):P("",!0),n.model.isCustomModel?(k(),C("div",aOe,[c("div",lOe,[c("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]=de(()=>{},["stop"]))},uOe),xe(" Custom model ")]),c("div",null,[n.model.isInstalled?(k(),C("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Uninstall "),hOe])):P("",!0)])])):P("",!0),o.installing?(k(),C("div",fOe,[c("div",pOe,[gOe,c("div",mOe,[c("div",_Oe,[c("div",bOe,[yOe,c("span",vOe,H(Math.floor(o.progress))+"%",1)]),c("div",wOe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt({width:o.progress+"%"})},null,4)]),c("div",xOe,[c("span",kOe,"Download speed: "+H(r.speed_computed)+"/s",1),c("span",EOe,H(r.downloaded_size_computed)+"/"+H(r.total_size_computed),1)])])]),c("div",COe,[c("div",AOe,[c("div",SOe,[c("button",{onClick:e[3]||(e[3]=de((...i)=>r.toggleCancelInstall&&r.toggleCancelInstall(...i),["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 ")])])])])])):P("",!0),n.model.isCustomModel?P("",!0):(k(),C("div",TOe,[c("div",MOe,[c("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=i=>r.defaultImg(i)),class:Me(["w-10 h-10 rounded-lg object-fill",o.linkNotValid?"grayscale":""])},null,42,OOe),c("h3",ROe,H(n.title),1),NOe,DOe]),c("div",LOe,[c("button",{type:"button",title:"Copy model info to clipboard",onClick:e[5]||(e[5]=de(i=>r.toggleCopy(),["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"},[xe(" Copy info "),IOe]),c("div",POe,[o.linkNotValid?(k(),C("div",FOe,[BOe,xe(" Link is not valid ")])):P("",!0)]),!n.model.isInstalled&&!o.linkNotValid?(k(),C("button",{key:0,title:"Click to install",type:"button",onClick:e[6]||(e[6]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Install "),$Oe])):P("",!0),n.model.isInstalled?(k(),C("button",{key:1,title:"Delete file from disk",type:"button",onClick:e[7]||(e[7]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Uninstall "),zOe])):P("",!0)]),c("div",{class:"",title:n.model.isInstalled?n.title:"Not installed"},[c("div",UOe,[c("div",qOe,[HOe,VOe,c("a",{href:n.path,onClick:e[8]||(e[8]=de(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:o.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," Click here to download ",8,GOe),KOe,c("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]=de(i=>r.toggleCopyLink(),["stop"]))},ZOe)]),c("div",YOe,[c("div",{class:Me(["flex flex-shrink-0 items-center",o.linkNotValid?"text-red-600":""])},[JOe,QOe,xe(" "+H(r.fileSize),1)],2)]),c("div",XOe,[eRe,tRe,xe(" "+H(n.license),1)]),c("div",nRe,[sRe,oRe,c("a",{href:n.owner_link,target:"_blank",rel:"noopener noreferrer",onClick:e[10]||(e[10]=de(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"Owner's profile"},H(n.owner),9,rRe)])]),iRe,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.description},H(n.description.replace(/<\/?[^>]+>/ig," ")),9,aRe)],8,jOe)]))],10,eOe)}const cRe=Ue(XMe,[["render",lRe]]),dRe={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}}},uRe={class:"p-4"},hRe={class:"flex items-center mb-4"},fRe=["src"],pRe={class:"text-lg font-semibold"},gRe=c("strong",null,"Author:",-1),mRe=c("strong",null,"Description:",-1),_Re=c("strong",null,"Category:",-1),bRe={key:0},yRe=c("strong",null,"Disclaimer:",-1),vRe=c("strong",null,"Conditioning Text:",-1),wRe=c("strong",null,"AI Prefix:",-1),xRe=c("strong",null,"User Prefix:",-1),kRe=c("strong",null,"Antiprompts:",-1);function ERe(t,e,n,s,o,r){return k(),C("div",uRe,[c("div",hRe,[c("img",{src:o.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,fRe),c("h2",pRe,H(o.personalityName),1)]),c("p",null,[gRe,xe(" "+H(o.personalityAuthor),1)]),c("p",null,[mRe,xe(" "+H(o.personalityDescription),1)]),c("p",null,[_Re,xe(" "+H(o.personalityCategory),1)]),o.disclaimer?(k(),C("p",bRe,[yRe,xe(" "+H(o.disclaimer),1)])):P("",!0),c("p",null,[vRe,xe(" "+H(o.conditioningText),1)]),c("p",null,[wRe,xe(" "+H(o.aiPrefix),1)]),c("p",null,[xRe,xe(" "+H(o.userPrefix),1)]),c("div",null,[kRe,c("ul",null,[(k(!0),C(Re,null,Ge(o.antipromptsList,i=>(k(),C("li",{key:i.id},H(i.text),1))),128))])]),c("button",{onClick:e[0]||(e[0]=i=>o.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),o.editMode?(k(),C("button",{key:1,onClick:e[1]||(e[1]=(...i)=>r.commitChanges&&r.commitChanges(...i)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):P("",!0)])}const CRe=Ue(dRe,[["render",ERe]]),es="/assets/logo-9d653710.svg";const ARe={props:{icon:{type:String,required:!1,value:"feather:command"},commands:{type:Array,required:!0},force_position:{required:!1,value:0},execute_cmd:{type:Function,required:!1}},data(){return{isMenuOpen:!1,menuPosition:{bottom:"auto",top:"calc(100% + 10px)"}}},methods:{handleClickOutside(t){const e=this.$refs.menu,n=this.$refs.menuButton;e&&!e.contains(t.target)&&!n.contains(t.target)&&(this.isMenuOpen=!1,window.removeEventListener("click",this.handleClickOutside))},toggleMenu(){this.positionMenu(),this.isMenuOpen=!this.isMenuOpen,this.isMenuOpen?window.addEventListener("click",this.handleClickOutside):window.removeEventListener("click",this.handleClickOutside),be(()=>{ve.replace()})},executeCommand(t){this.isMenuOpen=!1,console.log("Selected"),console.log(t.value),typeof t.value=="function"&&(console.log("Command detected"),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(()=>{ve.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},SRe={class:"menu-container"},TRe=["src","alt"],MRe=["data-feather"],ORe=c("i",{"data-feather":"command"},null,-1),RRe={class:"flex-grow menu-ul"},NRe=["onClick"],DRe=["src","alt"],LRe=["data-feather"],IRe={key:2,class:"menu-icon"};function PRe(t,e,n,s,o,r){return k(),C("div",SRe,[c("button",{onClick:e[0]||(e[0]=de((...i)=>r.toggleMenu&&r.toggleMenu(...i),["prevent"])),class:"menu-button bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded-full flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer",ref:"menuButton"},[n.icon&&!n.icon.includes("feather")?(k(),C("img",{key:0,src:t.command.icon,alt:t.command.name,class:"w-5 h-5"},null,8,TRe)):P("",!0),n.icon&&n.icon.includes("feather")?(k(),C("i",{key:1,"data-feather":t.command.icon.split(":")[1],class:"w-5 h-5"},null,8,MRe)):P("",!0),ORe],512),ue(Ts,{name:"slide"},{default:Ne(()=>[o.isMenuOpen?(k(),C("div",{key:0,class:"menu-list flex-grow",style:yt(o.menuPosition),ref:"menu"},[c("ul",RRe,[(k(!0),C(Re,null,Ge(n.commands,(i,a)=>(k(),C("li",{key:a,onClick:l=>r.executeCommand(i),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[i.icon&&!i.icon.includes("feather")&&!i.is_file?(k(),C("img",{key:0,src:i.icon,alt:i.name,class:"menu-icon"},null,8,DRe)):P("",!0),i.icon&&i.icon.includes("feather")&&!i.is_file?(k(),C("i",{key:1,"data-feather":i.icon.split(":")[1],class:"mr-2"},null,8,LRe)):(k(),C("span",IRe)),c("span",null,H(i.name),1)],8,NRe))),128))])],4)):P("",!0)]),_:1})])}const zg=Ue(ARe,[["render",PRe]]),FRe="/",BRe={props:{personality:{},selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMounted:Function,onRemount:Function,onReinstall:Function,onSettings:Function},components:{InteractiveMenu:zg},data(){return{isMounted:!1,name:this.personality.name}},computed:{commandsList(){let t=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.toggleMounted},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return this.isMounted&&t.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.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(()=>{ve.replace()})},methods:{getImgUrl(){return FRe+this.personality.avatar},defaultImg(t){t.target.src=es},toggleTalk(){this.onTalk(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},toggleMounted(){console.log("Mounting/unmounting"),this.onMounted(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){be(()=>{ve.replace()})}}},$Re=["title"],zRe={class:"flex flex-row items-center flex-shrink-0 gap-3"},jRe=["src"],URe=c("i",{"data-feather":"check",class:"w-5"},null,-1),qRe=c("span",{class:"sr-only"},"Select",-1),HRe=[URe,qRe],VRe=c("i",{"data-feather":"send",class:"w-5"},null,-1),GRe=c("span",{class:"sr-only"},"Talk",-1),KRe=[VRe,GRe],WRe={class:""},ZRe={class:""},YRe={class:"flex items-center"},JRe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),QRe=c("b",null,"Author: ",-1),XRe={key:0,class:"flex items-center"},eNe=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),tNe=c("b",null,"Languages: ",-1),nNe=["selected"],sNe={class:"flex items-center"},oNe=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),rNe=c("b",null,"Category: ",-1),iNe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),aNe=["title"];function lNe(t,e,n,s,o,r){const i=qe("InteractiveMenu");return k(),C("div",{class:Me(["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",o.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:n.personality.installed?"":"Not installed"},[c("div",{class:Me(n.personality.installed?"":"opacity-50")},[c("div",zRe,[c("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"},null,40,jRe),c("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},H(n.personality.name),1),o.isMounted?(k(),C("button",{key:0,type:"button",title:"Select",onClick:[e[3]||(e[3]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[4]||(e[4]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},HRe)):P("",!0),o.isMounted?(k(),C("button",{key:1,type:"button",title:"Talk",onClick:[e[5]||(e[5]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[6]||(e[6]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},KRe)):P("",!0),ue(i,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),c("div",WRe,[c("div",ZRe,[c("div",YRe,[JRe,QRe,xe(" "+H(n.personality.author),1)]),n.personality.languages?(k(),C("div",XRe,[eNe,tNe,se(c("select",{id:"languages","onUpdate:modelValue":e[7]||(e[7]=a=>n.personality.lang=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"},[(k(!0),C(Re,null,Ge(n.personality.languages,(a,l)=>(k(),C("option",{key:l,selected:a==n.personality.languages[0]},H(a),9,nNe))),128))],512),[[on,n.personality.lang]])])):P("",!0),c("div",sNe,[oNe,rNe,xe(" "+H(n.personality.category),1)])]),iNe,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.personality.description},H(n.personality.description),9,aNe)])],2)],10,$Re)}const jg=Ue(BRe,[["render",lNe]]),cNe="/",dNe={props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){be(()=>{ve.replace()})},methods:{getImgUrl(){return cNe+this.binding.icon},defaultImg(t){t.target.src=es},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(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(()=>{ve.replace()})}}},uNe=["title"],hNe={class:"flex flex-row items-center gap-3"},fNe=["src"],pNe={class:"font-bold font-large text-lg truncate"},gNe=c("div",{class:"grow"},null,-1),mNe={class:"flex-none gap-1"},_Ne=c("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),bNe=c("span",{class:"sr-only"},"Help",-1),yNe=[_Ne,bNe],vNe={class:"flex items-center flex-row-reverse gap-2 my-1"},wNe=c("span",{class:"sr-only"},"Click to install",-1),xNe=c("span",{class:"sr-only"},"Reinstall binding",-1),kNe=c("span",{class:"sr-only"},"Settings",-1),ENe={class:""},CNe={class:""},ANe={class:"flex items-center"},SNe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),TNe=c("b",null,"Author: ",-1),MNe={class:"flex items-center"},ONe=c("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),RNe=c("b",null,"Folder: ",-1),NNe={class:"flex items-center"},DNe=c("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),LNe=c("b",null,"Version: ",-1),INe={class:"flex items-center"},PNe=c("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),FNe=c("b",null,"Link: ",-1),BNe=["href"],$Ne=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),zNe=["title"];function jNe(t,e,n,s,o,r){return k(),C("div",{class:Me(["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[6]||(e[6]=de((...i)=>r.toggleSelected&&r.toggleSelected(...i),["stop"])),title:n.binding.installed?n.binding.name:"Not installed"},[c("div",null,[c("div",hNe,[c("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=i=>r.defaultImg(i)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,fNe),c("h3",pNe,H(n.binding.name),1),gNe,c("div",mNe,[n.selected?(k(),C("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...i)=>r.toggleReloadBinding&&r.toggleReloadBinding(...i)),e[2]||(e[2]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},yNe)):P("",!0)])]),c("div",vNe,[n.binding.installed?P("",!0):(k(),C("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Install "),wNe])),n.binding.installed?(k(),C("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=de((...i)=>r.toggleReinstall&&r.toggleReinstall(...i),["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"},[xe(" Reinstall binding "),xNe])):P("",!0),n.selected?(k(),C("button",{key:2,title:"Click to open Settings",type:"button",onClick:e[5]||(e[5]=de((...i)=>r.toggleSettings&&r.toggleSettings(...i),["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"},[xe(" Settings "),kNe])):P("",!0)]),c("div",ENe,[c("div",CNe,[c("div",ANe,[SNe,TNe,xe(" "+H(n.binding.author),1)]),c("div",MNe,[ONe,RNe,xe(" "+H(n.binding.folder),1)]),c("div",NNe,[DNe,LNe,xe(" "+H(n.binding.version),1)]),c("div",INe,[PNe,FNe,c("a",{href:n.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},H(n.binding.link),9,BNe)])]),$Ne,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.binding.description},H(n.binding.description),9,zNe)])])],10,uNe)}const UNe=Ue(dNe,[["render",jNe]]),qNe={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})}}},HNe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},VNe={class:"relative w-full max-w-md max-h-full"},GNe={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},KNe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),WNe=c("span",{class:"sr-only"},"Close modal",-1),ZNe=[KNe,WNe],YNe={class:"p-4 text-center"},JNe=c("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"},[c("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),QNe={class:"p-4 text-center mx-auto mb-4"},XNe=c("label",{class:"mr-2"},"Model path",-1);function eDe(t,e,n,s,o,r){return o.show?(k(),C("div",HNe,[c("div",VNe,[c("div",GNe,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>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"},ZNe),c("div",YNe,[JNe,c("div",QNe,[XNe,se(c("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>o.model_path=i),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[Oe,o.model_path]])]),c("button",{onClick:e[2]||(e[2]=i=>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 "),c("button",{onClick:e[3]||(e[3]=i=>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")])])])])):P("",!0)}const tDe=Ue(qNe,[["render",eDe]]),nDe={setup(){return{}},name:"UniversalForm",data(){return{show:!1,resolve:null,controls_array:[],title:"Universal form",ConfirmButtonText:"Submit",DenyButtonText:"Cancel"}},mounted(){be(()=>{ve.replace()})},methods:{hide(t){this.show=!1,this.resolve&&t&&(this.resolve(this.controls_array),this.resolve=null)},showForm(t,e,n,s){this.ConfirmButtonText=n||this.ConfirmButtonText,this.DenyButtonText=s||this.DenyButtonText;for(let o=0;o{this.controls_array=t,this.show=!0,this.title=e||this.title,this.resolve=o,console.log("show foam",this.controls_array)})}},watch:{show(){be(()=>{ve.replace()})}}},sDe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 p-4"},oDe={class:"relative w-full max-w-md"},rDe={class:"flex flex-col rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel duration-150 shadow-lg max-h-screen"},iDe={class:"flex flex-row flex-grow items-center m-2 p-1"},aDe={class:"grow flex items-center"},lDe=c("i",{"data-feather":"sliders",class:"mr-2 flex-shrink-0"},null,-1),cDe={class:"text-lg font-semibold select-none mr-2"},dDe={class:"items-end"},uDe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),hDe=c("span",{class:"sr-only"},"Close form modal",-1),fDe=[uDe,hDe],pDe={class:"flex flex-col relative no-scrollbar overflow-y-scroll p-2"},gDe={class:"px-2"},mDe={key:0},_De={key:0},bDe={class:"text-base font-semibold"},yDe={key:0,class:"relative inline-flex"},vDe=["onUpdate:modelValue"],wDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),xDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},kDe=["onUpdate:modelValue"],EDe={key:1},CDe={class:"text-base font-semibold"},ADe={key:0,class:"relative inline-flex"},SDe=["onUpdate:modelValue"],TDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),MDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},ODe=["onUpdate:modelValue"],RDe=["value","selected"],NDe={key:1},DDe={class:"text-base font-semibold"},LDe={key:0,class:"relative inline-flex"},IDe=["onUpdate:modelValue"],PDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),FDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},BDe=["onUpdate:modelValue"],$De=["onUpdate:modelValue","min","max"],zDe={key:2},jDe={class:"mb-2 relative flex items-center gap-2"},UDe={for:"default-checkbox",class:"text-base font-semibold"},qDe=["onUpdate:modelValue"],HDe={key:0,class:"relative inline-flex"},VDe=["onUpdate:modelValue"],GDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),KDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},WDe={key:3},ZDe={class:"text-base font-semibold"},YDe={key:0,class:"relative inline-flex"},JDe=["onUpdate:modelValue"],QDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),XDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},eLe=["onUpdate:modelValue"],tLe=c("hr",{class:"h-px my-4 bg-gray-200 border-0 dark:bg-gray-700"},null,-1),nLe={class:"flex flex-row flex-grow gap-3"},sLe={class:"p-2 text-center grow"};function oLe(t,e,n,s,o,r){return o.show?(k(),C("div",sDe,[c("div",oDe,[c("div",rDe,[c("div",iDe,[c("div",aDe,[lDe,c("h3",cDe,H(o.title),1)]),c("div",dDe,[c("button",{type:"button",onClick:e[0]||(e[0]=de(i=>r.hide(!1),["stop"])),title:"Close",class:"bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},fDe)])]),c("div",pDe,[(k(!0),C(Re,null,Ge(o.controls_array,(i,a)=>(k(),C("div",gDe,[i.type=="str"?(k(),C("div",mDe,[i.options?P("",!0):(k(),C("div",_De,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",bDe,H(i.name)+": ",1),i.help?(k(),C("label",yDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,vDe),[[rt,i.isHelp]]),wDe])):P("",!0)],2),i.isHelp?(k(),C("p",xDe,H(i.help),1)):P("",!0),se(c("input",{type:"text","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter string"},null,8,kDe),[[Oe,i.value]])])),i.options?(k(),C("div",EDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",CDe,H(i.name)+": ",1),i.help?(k(),C("label",ADe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,SDe),[[rt,i.isHelp]]),TDe])):P("",!0)],2),i.isHelp?(k(),C("p",MDe,H(i.help),1)):P("",!0),se(c("select",{"onUpdate:modelValue":l=>i.value=l,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"},[(k(!0),C(Re,null,Ge(i.options,l=>(k(),C("option",{value:l,selected:i.value===l},H(l),9,RDe))),256))],8,ODe),[[on,i.value]])])):P("",!0)])):P("",!0),i.type=="int"||i.type=="float"?(k(),C("div",NDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",DDe,H(i.name)+": ",1),i.help?(k(),C("label",LDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,IDe),[[rt,i.isHelp]]),PDe])):P("",!0)],2),i.isHelp?(k(),C("p",FDe,H(i.help),1)):P("",!0),se(c("input",{type:"number","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,BDe),[[Oe,i.value]]),i.min!=null&&i.max!=null?se((k(),C("input",{key:1,type:"range","onUpdate:modelValue":l=>i.value=l,min:i.min,max:i.max,step:"0.1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,$De)),[[Oe,i.value]]):P("",!0)])):P("",!0),i.type=="bool"?(k(),C("div",zDe,[c("div",jDe,[c("label",UDe,H(i.name)+": ",1),se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.value=l,class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"},null,8,qDe),[[rt,i.value]]),i.help?(k(),C("label",HDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,VDe),[[rt,i.isHelp]]),GDe])):P("",!0)]),i.isHelp?(k(),C("p",KDe,H(i.help),1)):P("",!0)])):P("",!0),i.type=="list"?(k(),C("div",WDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",ZDe,H(i.name)+": ",1),i.help?(k(),C("label",YDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,JDe),[[rt,i.isHelp]]),QDe])):P("",!0)],2),i.isHelp?(k(),C("p",XDe,H(i.help),1)):P("",!0),se(c("input",{type:"text","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter comma separated values"},null,8,eLe),[[Oe,i.value]])])):P("",!0),tLe]))),256)),c("div",nLe,[c("div",sLe,[c("button",{onClick:e[1]||(e[1]=de(i=>r.hide(!0),["stop"])),type:"button",class:"mr-2 text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},H(o.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=de(i=>r.hide(!1),["stop"])),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-11 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},H(o.DenyButtonText),1)])])])])])])):P("",!0)}const wc=Ue(nDe,[["render",oLe]]);const rLe={props:{show:{type:Boolean,required:!0},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null}},methods:{selectChoice(t){this.selectedChoice=t,this.$emit("choice-selected",t)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated")},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"}}},iLe={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"},aLe={class:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96"},lLe={class:"text-xl font-semibold mb-4"},cLe={class:"h-48 overflow-y-auto"},dLe=["onClick"],uLe={class:"font-bold"},hLe=c("br",null,null,-1),fLe={class:"text-xs text-gray-500"},pLe={class:"flex justify-end mt-4"},gLe=["disabled"];function mLe(t,e,n,s,o,r){return k(),st(Ts,{name:"fade"},{default:Ne(()=>[n.show?(k(),C("div",iLe,[c("div",aLe,[c("h2",lLe,H(n.title),1),c("div",cLe,[c("ul",null,[(k(!0),C(Re,null,Ge(n.choices,(i,a)=>(k(),C("li",{key:a,onClick:l=>r.selectChoice(i),class:Me([{"selected-choice":i===o.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700"])},[c("span",uLe,H(i.name),1),hLe,c("span",fLe,H(this.formatSize(i.size)),1)],10,dLe))),128))])]),c("div",pLe,[c("button",{onClick:e[0]||(e[0]=(...i)=>r.closeDialog&&r.closeDialog(...i)),class:"py-2 px-4 mr-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition duration-300"}," Cancel "),c("button",{onClick:e[1]||(e[1]=(...i)=>r.validateChoice&&r.validateChoice(...i)),class:Me([{"bg-gray-400 cursor-not-allowed":!o.selectedChoice,"bg-blue-500 hover:bg-blue-600":o.selectedChoice,"text-white":o.selectedChoice,"text-gray-500":!o.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!o.selectedChoice}," Validate ",10,gLe)])])])):P("",!0)]),_:1})}const _Le=Ue(rLe,[["render",mLe]]);const bLe="/";ye.defaults.baseURL="/";const yLe={components:{AddModelDialog:tDe,MessageBox:$g,YesNoDialog:QMe,ModelEntry:cRe,PersonalityViewer:CRe,Toast:Ks,PersonalityEntry:jg,BindingEntry:UNe,UniversalForm:wc,ChoiceDialog:_Le,Card:vi},data(){return{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,minconf_collapsed:!0,bec_collapsed:!0,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,bzl_collapsed:!1,persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:bLe,searchPersonality:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){Ee.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{getVoices(){"speechSynthesis"in window&&(this.audioVoices=speechSynthesis.getVoices(),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let t=await this.api_get_req("check_update");this.has_updates=t.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(t){this.selected_variant=t},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let t=this.currenModelToInstall;if(t.linkNotValid){t.installing=!1,this.$refs.toast.showToast("Link is not valid, file does not exist",4,!1);return}let e=t.path;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t.path},console.log("installing...",this.addModel);const n=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),t.progress=s.progress,t.speed=s.speed,t.total_size=s.total_size,t.downloaded_size=s.downloaded_size,t.start_time=s.start_time,t.installing=!0,t.progress==100){const o=this.models.findIndex(r=>r.path===e);this.models[o].isInstalled=!0,this.showProgress=!1,t.installing=!1,console.log("Received succeeded"),Ee.off("install_progress",n),console.log("Installed successfully"),this.$refs.toast.showToast(`Model: `+t.title+` installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else Ee.off("install_progress",n),console.log("Install failed"),t.installing=!1,this.showProgress=!1,console.error("Installation failed:",s.error),this.$refs.toast.showToast(`Model: `+t.title+` diff --git a/web/dist/index.html b/web/dist/index.html index ceaf32a0..edb38c77 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,7 +6,7 @@ LoLLMS WebUI - Welcome - + diff --git a/web/src/components/PersonalityEntry.vue b/web/src/components/PersonalityEntry.vue index 1f5fbcfa..aef82c67 100644 --- a/web/src/components/PersonalityEntry.vue +++ b/web/src/components/PersonalityEntry.vue @@ -109,7 +109,10 @@ export default { {name:this.isMounted?"unmount":"mount", icon: "feather:settings", is_file:false, value:this.toggleMounted}, {name:"reinstall", icon: "feather:terminal", is_file:false, value:this.toggleReinstall}, ]; - if(this.selected){ + if(this.isMounted){ + main_menu.push({name:"remount", icon: "feather:refresh-ccw", is_file:false, value:this.reMount}) + } + if(this.selected && this.has_scripts){ main_menu.push({name:"settings", icon: "feather:settings", is_file:false, value:this.toggleSettings}) } return main_menu