From d7e9bd1ccb7a46a6eb6de521e14d60962a36c2d1 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Sat, 18 Nov 2023 00:11:52 +0100 Subject: [PATCH] upgraded --- .../{index-aff40468.js => index-918b6136.js} | 2 +- web/dist/index.html | 2 +- web/src/components/UniversalForm.vue | 15 ++++++++++++++- zoos/bindings_zoo | 2 +- zoos/models_zoo | 2 +- 5 files changed, 18 insertions(+), 5 deletions(-) rename web/dist/assets/{index-aff40468.js => index-918b6136.js} (98%) diff --git a/web/dist/assets/index-aff40468.js b/web/dist/assets/index-918b6136.js similarity index 98% rename from web/dist/assets/index-aff40468.js rename to web/dist/assets/index-918b6136.js index 46d8ca55..cfb7eb52 100644 --- a/web/dist/assets/index-aff40468.js +++ b/web/dist/assets/index-918b6136.js @@ -92,7 +92,7 @@ License: MIT `:"\r"}(Y,O)),L=!1,y.delimiter)k(y.delimiter)&&(y.delimiter=y.delimiter(Y),ee.meta.delimiter=y.delimiter);else{var N=function($,W,ie,me,D){var K,G,q,V;D=D||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var ne=0;ne=B)return Ge(!0)}else for(oe=I,I++;;){if((oe=re.indexOf(R,oe+1))===-1)return _e||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:z.length,index:I}),Oe();if(oe===ee-1)return Oe(re.substring(I,oe).replace(ne,R));if(R!==H||re[oe+1]!==H){if(R===H||oe===0||re[oe-1]!==H){q!==-1&&q=B)return Ge(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:z.length,index:I}),oe++}}else oe++}return Oe();function le(Ze){z.push(Ze),ue=I}function Se(Ze){var et=0;if(Ze!==-1){var Xe=re.substring(oe+1,Ze);Xe&&Xe.trim()===""&&(et=Xe.length)}return et}function Oe(Ze){return _e||(Ze===void 0&&(Ze=re.substring(I)),Y.push(Ze),I=ee,le(Y),Ee&&nt()),Ge()}function Le(Ze){I=Ze,le(Y),Y=[],V=re.indexOf(L,I)}function Ge(Ze){return{data:z,errors:te,meta:{delimiter:w,linebreak:L,aborted:Q,truncated:!!Ze,cursor:ue+(X||0)}}}function nt(){Z(Ge()),z=[],te=[]}},this.abort=function(){Q=!0},this.getCharIndex=function(){return I}}function m(y){var R=y.data,w=i[R.workerId],L=!1;if(R.error)w.userError(R.error,R.file);else if(R.results&&R.results.data){var M={abort:function(){L=!0,S(R.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:T,resume:T};if(k(w.userStep)){for(var Z=0;Zt.text()).then(t=>{const{data:e}=Gqe.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,"
")}}},vn=t=>(hr("data-v-f0cce578"),t=t(),Er(),t),Yqe={class:"container flex-row mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-1 md:grid-cols-2 gap-4"},Vqe=vn(()=>c("h2",{class:"text-2xl font-bold mb-2"},"About Lord of large Language Models",-1)),zqe={class:"mb-4"},Hqe=vn(()=>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)),$qe=vn(()=>c("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1)),Wqe={class:"list-disc pl-4"},Kqe={class:"text-xl font-bold mb-1"},Qqe=["innerHTML"],jqe=vn(()=>c("h2",{class:"text-2xl font-bold mb-2"},"Contact Us",-1)),Zqe=vn(()=>c("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to me.",-1)),Xqe=vn(()=>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)),Jqe=vn(()=>c("h2",{class:"text-2xl font-bold mb-2"},"Credits",-1)),e7e=vn(()=>c("p",{class:"mb-4"},[xe("This project is developed by "),c("span",{class:"font-bold"},"ParisNeo"),xe(" With help from the community.")],-1)),t7e=vn(()=>c("p",{class:"mb-4"},[c("span",{class:"font-bold"},[c("a",{href:"https://github.com/ParisNeo/lollms-webui/graphs/contributors"},"Check out the full list of developers here and show them some love.")])],-1)),n7e=["href"];function r7e(t,e,n,r,s,o){const i=Pe("Card");return v(),C("div",Yqe,[he(i,{disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[Vqe,c("p",zqe," Lollms version "+j(o.version),1),Hqe]),_:1}),he(i,{disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[$qe,c("ul",Wqe,[(v(!0),C(we,null,Be(s.faqs,(a,l)=>(v(),C("li",{key:l},[c("h3",Kqe,j(a.question),1),c("p",{class:"mb-4",innerHTML:o.parseMultiline(a.answer)},null,8,Qqe)]))),128))])]),_:1}),he(i,{disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[jqe,Zqe,Xqe]),_:1}),he(i,{disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[Jqe,e7e,t7e,c("p",null,[xe("Check out the project on "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:s.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,n7e),xe(".")])]),_:1})])}const s7e=Ye(qqe,[["render",r7e],["__scopeId","data-v-f0cce578"]]);function Xt(t,e=!0,n=1){const r=e?1e3:1024;if(Math.abs(t)=r&&oo.hide&&o.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 ")])])])):U("",!0)}const pT=Ye(o7e,[["render",d7e]]),u7e={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(r=>{this.message=t,this.show=!0,this.resolve=r})}}},_7e={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},p7e={class:"relative w-full max-w-md max-h-full"},m7e={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},g7e=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),f7e=c("span",{class:"sr-only"},"Close modal",-1),h7e=[g7e,f7e],E7e={class:"p-4 text-center"},b7e=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),S7e={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none break-all"};function y7e(t,e,n,r,s,o){return s.show?(v(),C("div",_7e,[c("div",p7e,[c("div",m7e,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>o.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"},h7e),c("div",E7e,[b7e,c("h3",S7e,j(s.message),1),c("button",{onClick:e[1]||(e[1]=i=>o.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"},j(s.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=i=>o.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"},j(s.DenyButtonText),1)])])])])):U("",!0)}const v7e=Ye(u7e,[["render",y7e]]),zn="/assets/default_model-eeb65acd.png";const T7e={props:{title:{type:String,required:!1,value:"menu"},icon:{type:String,required:!1,value:"feather:menu"},commands:{type:Array,required:!0},force_position:{required:!1,value:0},execute_cmd:{type:Function,required:!1},menuIconClass:{type:String,required:!1,default:""},selected_entry:{type:String,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),ve(()=>{Re.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(),ve(()=>{Re.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},C7e={class:"menu-container"},R7e=["title"],x7e=["src"],O7e=["data-feather"],A7e={key:2,class:"w-5 h-5"},N7e={key:3,"data-feather":"menu"},w7e={class:"flex-grow menu-ul"},I7e=["onClick"],D7e={key:0,"data-feather":"check"},k7e=["src","alt"],M7e=["data-feather"],L7e={key:3,class:"menu-icon"};function P7e(t,e,n,r,s,o){return v(),C("div",C7e,[c("button",{onClick:e[0]||(e[0]=pe((...i)=>o.toggleMenu&&o.toggleMenu(...i),["prevent"])),title:n.title,class:Ae([n.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[n.icon&&!n.icon.includes("#")&&!n.icon.includes("feather")?(v(),C("img",{key:0,src:n.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,x7e)):n.icon&&n.icon.includes("feather")?(v(),C("i",{key:1,"data-feather":n.icon.split(":")[1],class:"w-5 h-5"},null,8,O7e)):n.icon&&n.icon.includes("#")?(v(),C("p",A7e,j(n.icon.split("#")[1]),1)):(v(),C("i",N7e))],10,R7e),he($r,{name:"slide"},{default:ke(()=>[s.isMenuOpen?(v(),C("div",{key:0,class:"menu-list flex-grow",style:ht(s.menuPosition),ref:"menu"},[c("ul",w7e,[(v(!0),C(we,null,Be(n.commands,(i,a)=>(v(),C("li",{key:a,onClick:pe(l=>o.executeCommand(i),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[n.selected_entry==i.name?(v(),C("i",D7e)):i.icon&&!i.icon.includes("feather")&&!i.is_file?(v(),C("img",{key:1,src:i.icon,alt:i.name,class:"menu-icon"},null,8,k7e)):U("",!0),i.icon&&i.icon.includes("feather")&&!i.is_file?(v(),C("i",{key:2,"data-feather":i.icon.split(":")[1],class:"mr-2"},null,8,M7e)):(v(),C("span",L7e)),c("span",null,j(i.name),1)],8,I7e))),128))])],4)):U("",!0)]),_:1})])}const lo=Ye(T7e,[["render",P7e]]),F7e={components:{InteractiveMenu:lo},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){ve(()=>{Re.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 Xt(t)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?zn:this.model.icon},defaultImg(t){t.target.src=zn},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(t=!1){this.onSelected(this,t),model.selected=!0,ve(()=>{Re.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){installing=!1,this.onCancelInstall(this)},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let t=[{name:this.model.isInstalled?"Uninstall":"Install",icon:"feather:settings",is_file:!1,value:this.toggleInstall},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.selected&&t.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),t},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const t=this.model.variants[0].size;return this.formatFileSize(t)}return null}},speed_computed(){return Xt(this.speed)},total_size_computed(){return Xt(this.total_size)},downloaded_size_computed(){return Xt(this.downloaded_size)}},watch:{linkNotValid(){ve(()=>{Re.replace()})}}},U7e=["title"],B7e={key:0,class:"flex flex-row"},G7e={class:"max-w-[300px] overflow-x-auto"},q7e={class:"flex gap-3 items-center grow"},Y7e=["href"],V7e=["src"],z7e={class:"flex-1 overflow-hidden"},H7e={class:"font-bold font-large text-lg truncate"},$7e={key:1,class:"flex items-center flex-row gap-2 my-1"},W7e={class:"flex grow items-center"},K7e=c("i",{"data-feather":"box",class:"w-5"},null,-1),Q7e=c("span",{class:"sr-only"},"Custom model / local model",-1),j7e=[K7e,Q7e],Z7e=c("span",{class:"sr-only"},"Remove",-1),X7e={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"},J7e={class:"relative flex flex-col items-center justify-center flex-grow h-full"},eYe=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),tYe={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},nYe={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},rYe={class:"flex justify-between mb-1"},sYe=c("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),oYe={class:"text-sm font-medium text-blue-700 dark:text-white"},iYe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},aYe={class:"flex justify-between mb-1"},lYe={class:"text-base font-medium text-blue-700 dark:text-white"},cYe={class:"text-sm font-medium text-blue-700 dark:text-white"},dYe={class:"flex flex-grow"},uYe={class:"flex flex-row flex-grow gap-3"},_Ye={class:"p-2 text-center grow"},pYe={key:3},mYe={class:"flex flex-row items-center gap-3"},gYe=["src"],fYe={class:"font-bold font-large text-lg truncate"},hYe=c("div",{class:"grow"},null,-1),EYe={class:"flex items-center flex-row-reverse gap-2 my-1"},bYe={class:"flex flex-row items-center"},SYe={key:0,class:"text-base text-red-600 flex items-center mt-1"},yYe=c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),vYe=["title"],TYe={class:""},CYe={class:"flex flex-row items-center"},RYe=c("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),xYe=c("b",null,"Card: ",-1),OYe=["href","title"],AYe=c("div",{class:"grow"},null,-1),NYe=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),wYe=[NYe],IYe={class:"flex items-center"},DYe=c("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),kYe=c("b",null,"File size: ",-1),MYe={class:"flex items-center"},LYe=c("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),PYe=c("b",null,"License: ",-1),FYe={key:0,class:"flex items-center"},UYe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),BYe=c("b",null,"quantizer: ",-1),GYe=["href"],qYe={class:"flex items-center"},YYe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),VYe=c("b",null,"Model creator: ",-1),zYe=["href"],HYe={class:"flex items-center"},$Ye=c("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1),WYe=c("b",null,"Release date: ",-1),KYe={class:"flex items-center"},QYe=c("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1),jYe=c("b",null,"Category: ",-1),ZYe=["href"],XYe={class:"flex items-center"},JYe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),eVe=c("b",null,"Hugging face rank: ",-1);function tVe(t,e,n,r,s,o){const i=Pe("InteractiveMenu");return v(),C("div",{class:Ae(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",o.computed_classes]),title:n.model.name,onClick:e[11]||(e[11]=pe(a=>o.toggleSelected(),["prevent"]))},[n.model.isCustomModel?(v(),C("div",B7e,[c("div",G7e,[c("div",q7e,[c("a",{href:n.model.model_creator_link,target:"_blank"},[c("img",{src:o.getImgUrl(),onError:e[0]||(e[0]=a=>o.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,V7e)],8,Y7e),c("div",z7e,[c("h3",H7e,j(n.model.name),1)])])])])):U("",!0),n.model.isCustomModel?(v(),C("div",$7e,[c("div",W7e,[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]=pe(()=>{},["stop"]))},j7e),xe(" Custom model ")]),c("div",null,[n.model.isInstalled?(v(),C("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=pe((...a)=>o.toggleInstall&&o.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[xe(" Uninstall "),Z7e])):U("",!0)])])):U("",!0),s.installing?(v(),C("div",X7e,[c("div",J7e,[eYe,c("div",tYe,[c("div",nYe,[c("div",rYe,[sYe,c("span",oYe,j(Math.floor(s.progress))+"%",1)]),c("div",iYe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:ht({width:s.progress+"%"})},null,4)]),c("div",aYe,[c("span",lYe,"Download speed: "+j(o.speed_computed)+"/s",1),c("span",cYe,j(o.downloaded_size_computed)+"/"+j(o.total_size_computed),1)])])]),c("div",dYe,[c("div",uYe,[c("div",_Ye,[c("button",{onClick:e[3]||(e[3]=pe((...a)=>o.toggleCancelInstall&&o.toggleCancelInstall(...a),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])])):U("",!0),n.model.isCustomModel?U("",!0):(v(),C("div",pYe,[c("div",mYe,[c("img",{ref:"imgElement",src:o.getImgUrl(),onError:e[4]||(e[4]=a=>o.defaultImg(a)),class:Ae(["w-10 h-10 rounded-lg object-fill",s.linkNotValid?"grayscale":""])},null,42,gYe),c("h3",fYe,j(n.model.name),1),hYe,he(i,{commands:o.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),c("div",EYe,[c("div",bYe,[s.linkNotValid?(v(),C("div",SYe,[yYe,xe(" Link is not valid ")])):U("",!0)])]),c("div",{class:"",title:n.model.isInstalled?n.model.name:"Not installed"},[c("div",TYe,[c("div",CYe,[RYe,xYe,c("a",{href:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name,target:"_blank",onClick:e[5]||(e[5]=pe(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:s.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,OYe),AYe,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[6]||(e[6]=pe(a=>o.toggleCopyLink(),["stop"]))},wYe)]),c("div",IYe,[c("div",{class:Ae(["flex flex-shrink-0 items-center",s.linkNotValid?"text-red-600":""])},[DYe,kYe,xe(" "+j(o.fileSize),1)],2)]),c("div",MYe,[LYe,PYe,xe(" "+j(n.model.license),1)]),n.model.quantizer!="None"?(v(),C("div",FYe,[UYe,BYe,c("a",{href:"https://huggingface.co/"+n.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=pe(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},j(n.model.quantizer),9,GYe)])):U("",!0),c("div",qYe,[YYe,VYe,c("a",{href:n.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=pe(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},j(n.model.model_creator),9,zYe)]),c("div",HYe,[$Ye,WYe,xe(" "+j(n.model.last_commit_time),1)]),c("div",KYe,[QYe,jYe,c("a",{href:"https://huggingface.co/"+n.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=pe(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},j(n.model.category),9,ZYe)]),c("div",XYe,[JYe,eVe,c("a",{href:"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard",target:"_blank",rel:"noopener noreferrer",onClick:e[10]||(e[10]=pe(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},j(n.model.rank),1)])])],8,vYe)]))],10,U7e)}const nVe=Ye(F7e,[["render",tVe]]),rVe={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}}},sVe={class:"p-4"},oVe={class:"flex items-center mb-4"},iVe=["src"],aVe={class:"text-lg font-semibold"},lVe=c("strong",null,"Author:",-1),cVe=c("strong",null,"Description:",-1),dVe=c("strong",null,"Category:",-1),uVe={key:0},_Ve=c("strong",null,"Disclaimer:",-1),pVe=c("strong",null,"Conditioning Text:",-1),mVe=c("strong",null,"AI Prefix:",-1),gVe=c("strong",null,"User Prefix:",-1),fVe=c("strong",null,"Antiprompts:",-1);function hVe(t,e,n,r,s,o){return v(),C("div",sVe,[c("div",oVe,[c("img",{src:s.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,iVe),c("h2",aVe,j(s.personalityName),1)]),c("p",null,[lVe,xe(" "+j(s.personalityAuthor),1)]),c("p",null,[cVe,xe(" "+j(s.personalityDescription),1)]),c("p",null,[dVe,xe(" "+j(s.personalityCategory),1)]),s.disclaimer?(v(),C("p",uVe,[_Ve,xe(" "+j(s.disclaimer),1)])):U("",!0),c("p",null,[pVe,xe(" "+j(s.conditioningText),1)]),c("p",null,[mVe,xe(" "+j(s.aiPrefix),1)]),c("p",null,[gVe,xe(" "+j(s.userPrefix),1)]),c("div",null,[fVe,c("ul",null,[(v(!0),C(we,null,Be(s.antipromptsList,i=>(v(),C("li",{key:i.id},j(i.text),1))),128))])]),c("button",{onClick:e[0]||(e[0]=i=>s.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),s.editMode?(v(),C("button",{key:1,onClick:e[1]||(e[1]=(...i)=>o.commitChanges&&o.commitChanges(...i)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):U("",!0)])}const EVe=Ye(rVe,[["render",hVe]]),ms="/assets/logo-9d653710.svg",bVe="/",SVe={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function},components:{InteractiveMenu:lo},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.isMounted?this.unmount:this.mount},{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.personality.has_scripts&&t.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),t},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,ve(()=>{Re.replace()})},methods:{getImgUrl(){return bVe+this.personality.avatar},defaultImg(t){t.target.src=ms},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){ve(()=>{Re.replace()})}}},yVe=["title"],vVe={class:"flex flex-row items-center flex-shrink-0 gap-3"},TVe=["src"],CVe=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),RVe=[CVe],xVe={class:""},OVe={class:""},AVe={class:"flex items-center"},NVe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),wVe=c("b",null,"Author: ",-1),IVe={class:"flex items-center"},DVe=c("i",{"data-feather":"git-commit",class:"w-5 m-1"},null,-1),kVe=c("b",null,"Version: ",-1),MVe={key:0,class:"flex items-center"},LVe=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),PVe=c("b",null,"Languages: ",-1),FVe=["selected"],UVe={key:1,class:"flex items-center"},BVe=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),GVe=c("b",null,"Language: ",-1),qVe={class:"flex items-center"},YVe=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),VVe=c("b",null,"Category: ",-1),zVe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),HVe=["title","innerHTML"],$Ve={class:"rounded bg-blue-300"},WVe=c("i",{"data-feather":"check"},null,-1),KVe=c("span",{class:"sr-only"},"Select",-1),QVe=[WVe,KVe],jVe=c("i",{"data-feather":"send",class:"w-5"},null,-1),ZVe=c("span",{class:"sr-only"},"Talk",-1),XVe=[jVe,ZVe];function JVe(t,e,n,r,s,o){const i=Pe("InteractiveMenu");return v(),C("div",{class:Ae(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",o.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:n.personality.installed?"":"Not installed"},[c("div",{class:Ae(n.personality.installed?"":"border-red-500")},[c("div",vVe,[c("img",{onClick:e[0]||(e[0]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),ref:"imgElement",src:o.getImgUrl(),onError:e[1]||(e[1]=a=>o.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,TVe),c("h3",{onClick:e[2]||(e[2]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},j(n.personality.name),1),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[3]||(e[3]=pe(a=>o.toggleCopyLink(),["stop"]))},RVe)]),c("div",xVe,[c("div",OVe,[c("div",AVe,[NVe,wVe,xe(" "+j(n.personality.author),1)]),c("div",IVe,[DVe,kVe,xe(" "+j(n.personality.version),1)]),n.personality.languages&&n.select_language?(v(),C("div",MVe,[LVe,PVe,ce(c("select",{id:"languages","onUpdate:modelValue":e[4]||(e[4]=a=>n.personality.language=a),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(v(!0),C(we,null,Be(n.personality.languages,(a,l)=>(v(),C("option",{key:l,selected:a==n.personality.languages[0]},j(a),9,FVe))),128))],512),[[Kt,n.personality.language]])])):U("",!0),n.personality.language?(v(),C("div",UVe,[BVe,GVe,xe(" "+j(n.personality.language),1)])):U("",!0),c("div",qVe,[YVe,VVe,xe(" "+j(n.personality.category),1)])]),zVe,c("p",{class:"mx-1 opacity-80 h-20 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",title:n.personality.description,innerHTML:n.personality.description},null,8,HVe)]),c("div",$Ve,[s.isMounted?(v(),C("button",{key:0,type:"button",title:"Select",onClick:[e[5]||(e[5]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),e[6]||(e[6]=pe(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},QVe)):U("",!0),s.isMounted?(v(),C("button",{key:1,type:"button",title:"Talk",onClick:[e[7]||(e[7]=(...a)=>o.toggleTalk&&o.toggleTalk(...a)),e[8]||(e[8]=pe(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},XVe)):U("",!0),he(i,{commands:o.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,yVe)}const mT=Ye(SVe,[["render",JVe]]);const eze={props:{code:String},data(){return{evaluatedCode:"",componentKey:0}},watch:{code:{handler(t){console.log("Code changed"),this.evaluateScriptTags(t),this.componentKey++},immediate:!0}},methods:{evaluateScriptTags(t){const e=document.createElement("div");e.innerHTML=t,e.querySelectorAll("script").forEach(r=>{const s=document.createElement("script");s.textContent=r.textContent,document.body.appendChild(s),document.body.removeChild(s)}),this.evaluatedCode=e.innerHTML,console.log("evaluated code: "+this.evaluatedCode)}}},tze=["innerHTML"];function nze(t,e,n,r,s,o){return v(),C("div",{innerHTML:s.evaluatedCode,key:s.componentKey},null,8,tze)}const gT=Ye(eze,[["render",nze]]),rze="/",sze={components:{DynamicUIRenderer:gT},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){ve(()=>{Re.replace()})},methods:{getImgUrl(){return rze+this.binding.icon},defaultImg(t){t.target.src=ms},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){ve(()=>{Re.replace()})}}},oze=["title"],ize={class:"flex flex-row items-center gap-3"},aze=["src"],lze={class:"font-bold font-large text-lg truncate"},cze=c("div",{class:"grow"},null,-1),dze={class:"flex-none gap-1"},uze=c("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),_ze=c("span",{class:"sr-only"},"Help",-1),pze=[uze,_ze],mze={class:"flex items-center flex-row-reverse gap-2 my-1"},gze=c("span",{class:"sr-only"},"Click to install",-1),fze=c("span",{class:"sr-only"},"Reinstall",-1),hze=c("span",{class:"sr-only"},"UnInstall",-1),Eze=c("span",{class:"sr-only"},"Settings",-1),bze={class:""},Sze={class:""},yze={class:"flex items-center"},vze=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Tze=c("b",null,"Author: ",-1),Cze={class:"flex items-center"},Rze=c("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),xze=c("b",null,"Folder: ",-1),Oze={class:"flex items-center"},Aze=c("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),Nze=c("b",null,"Version: ",-1),wze={class:"flex items-center"},Ize=c("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),Dze=c("b",null,"Link: ",-1),kze=["href"],Mze=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),Lze=["title","innerHTML"];function Pze(t,e,n,r,s,o){const i=Pe("DynamicUIRenderer");return v(),C("div",{class:Ae(["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[7]||(e[7]=pe((...a)=>o.toggleSelected&&o.toggleSelected(...a),["stop"])),title:n.binding.installed?n.binding.name:"Not installed"},[c("div",null,[c("div",ize,[c("img",{ref:"imgElement",src:o.getImgUrl(),onError:e[0]||(e[0]=a=>o.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,aze),c("h3",lze,j(n.binding.name),1),cze,c("div",dze,[n.selected?(v(),C("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>o.toggleReloadBinding&&o.toggleReloadBinding(...a)),e[2]||(e[2]=pe(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},pze)):U("",!0)])]),c("div",mze,[n.binding.installed?U("",!0):(v(),C("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=pe((...a)=>o.toggleInstall&&o.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[xe(" Install "),gze])),n.binding.installed?(v(),C("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=pe((...a)=>o.toggleReinstall&&o.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},[xe(" Reinstall "),fze])):U("",!0),n.binding.installed?(v(),C("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=pe((...a)=>o.toggleUnInstall&&o.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[xe(" Uninstall "),hze])):U("",!0),n.selected?(v(),C("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=pe((...a)=>o.toggleSettings&&o.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[xe(" Settings "),Eze])):U("",!0)]),n.binding.ui?(v(),rt(i,{key:0,class:"w-full h-full",code:n.binding.ui},null,8,["code"])):U("",!0),c("div",bze,[c("div",Sze,[c("div",yze,[vze,Tze,xe(" "+j(n.binding.author),1)]),c("div",Cze,[Rze,xze,xe(" "+j(n.binding.folder),1)]),c("div",Oze,[Aze,Nze,xe(" "+j(n.binding.version),1)]),c("div",wze,[Ize,Dze,c("a",{href:n.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},j(n.binding.link),9,kze)])]),Mze,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.binding.description,innerHTML:n.binding.description},null,8,Lze)])])],10,oze)}const Fze=Ye(sze,[["render",Pze]]),Uze={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})}}},Bze={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},Gze={class:"relative w-full max-w-md max-h-full"},qze={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},Yze=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),Vze=c("span",{class:"sr-only"},"Close modal",-1),zze=[Yze,Vze],Hze={class:"p-4 text-center"},$ze=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),Wze={class:"p-4 text-center mx-auto mb-4"},Kze=c("label",{class:"mr-2"},"Model path",-1);function Qze(t,e,n,r,s,o){return s.show?(v(),C("div",Bze,[c("div",Gze,[c("div",qze,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>o.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"},zze),c("div",Hze,[$ze,c("div",Wze,[Kze,ce(c("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>s.model_path=i),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[De,s.model_path]])]),c("button",{onClick:e[2]||(e[2]=i=>o.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=>o.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")])])])])):U("",!0)}const jze=Ye(Uze,[["render",Qze]]),Zze={setup(){return{}},name:"UniversalForm",data(){return{show:!1,resolve:null,controls_array:[],title:"Universal form",ConfirmButtonText:"Submit",DenyButtonText:"Cancel"}},mounted(){ve(()=>{Re.replace()})},methods:{hide(t){this.show=!1,this.resolve&&t&&(this.resolve(this.controls_array),this.resolve=null)},showForm(t,e,n,r){this.ConfirmButtonText=n||this.ConfirmButtonText,this.DenyButtonText=r||this.DenyButtonText;for(let s=0;s{this.controls_array=t,this.show=!0,this.title=e||this.title,this.resolve=s,console.log("show foam",this.controls_array)})}},watch:{show(){ve(()=>{Re.replace()})}}},Xze={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 p-4"},Jze={class:"relative w-full max-w-md"},eHe={class:"flex flex-col rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel duration-150 shadow-lg max-h-screen"},tHe={class:"flex flex-row flex-grow items-center m-2 p-1"},nHe={class:"grow flex items-center"},rHe=c("i",{"data-feather":"sliders",class:"mr-2 flex-shrink-0"},null,-1),sHe={class:"text-lg font-semibold select-none mr-2"},oHe={class:"items-end"},iHe=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),aHe=c("span",{class:"sr-only"},"Close form modal",-1),lHe=[iHe,aHe],cHe={class:"flex flex-col relative no-scrollbar overflow-y-scroll p-2"},dHe={class:"px-2"},uHe={key:0},_He={key:0},pHe={class:"text-base font-semibold"},mHe={key:0,class:"relative inline-flex"},gHe=["onUpdate:modelValue"],fHe=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),hHe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},EHe=["onUpdate:modelValue"],bHe={key:1},SHe={class:"text-base font-semibold"},yHe={key:0,class:"relative inline-flex"},vHe=["onUpdate:modelValue"],THe=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),CHe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},RHe=["onUpdate:modelValue"],xHe=["value","selected"],OHe={key:1},AHe={class:"text-base font-semibold"},NHe={key:0,class:"relative inline-flex"},wHe=["onUpdate:modelValue"],IHe=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),DHe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},kHe=["onUpdate:modelValue"],MHe=["onUpdate:modelValue","min","max"],LHe={key:2},PHe={class:"text-base font-semibold"},FHe={key:0,class:"relative inline-flex"},UHe=["onUpdate:modelValue"],BHe=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),GHe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},qHe=["onUpdate:modelValue"],YHe=["onUpdate:modelValue","min","max"],VHe={key:3},zHe={class:"mb-2 relative flex items-center gap-2"},HHe={for:"default-checkbox",class:"text-base font-semibold"},$He=["onUpdate:modelValue"],WHe={key:0,class:"relative inline-flex"},KHe=["onUpdate:modelValue"],QHe=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),jHe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},ZHe={key:4},XHe={class:"text-base font-semibold"},JHe={key:0,class:"relative inline-flex"},e$e=["onUpdate:modelValue"],t$e=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),n$e={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},r$e=["onUpdate:modelValue"],s$e=c("hr",{class:"h-px my-4 bg-gray-200 border-0 dark:bg-gray-700"},null,-1),o$e={class:"flex flex-row flex-grow gap-3"},i$e={class:"p-2 text-center grow"};function a$e(t,e,n,r,s,o){return s.show?(v(),C("div",Xze,[c("div",Jze,[c("div",eHe,[c("div",tHe,[c("div",nHe,[rHe,c("h3",sHe,j(s.title),1)]),c("div",oHe,[c("button",{type:"button",onClick:e[0]||(e[0]=pe(i=>o.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"},lHe)])]),c("div",cHe,[(v(!0),C(we,null,Be(s.controls_array,(i,a)=>(v(),C("div",dHe,[i.type=="str"?(v(),C("div",uHe,[i.options?U("",!0):(v(),C("div",_He,[c("label",{class:Ae(["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",pHe,j(i.name)+": ",1),i.help?(v(),C("label",mHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,gHe),[[tt,i.isHelp]]),fHe])):U("",!0)],2),i.isHelp?(v(),C("p",hHe,j(i.help),1)):U("",!0),ce(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,EHe),[[De,i.value]])])),i.options?(v(),C("div",bHe,[c("label",{class:Ae(["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",SHe,j(i.name)+": ",1),i.help?(v(),C("label",yHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,vHe),[[tt,i.isHelp]]),THe])):U("",!0)],2),i.isHelp?(v(),C("p",CHe,j(i.help),1)):U("",!0),ce(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"},[(v(!0),C(we,null,Be(i.options,l=>(v(),C("option",{value:l,selected:i.value===l},j(l),9,xHe))),256))],8,RHe),[[Kt,i.value]])])):U("",!0)])):U("",!0),i.type=="int"?(v(),C("div",OHe,[c("label",{class:Ae(["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",AHe,j(i.name)+": ",1),i.help?(v(),C("label",NHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,wHe),[[tt,i.isHelp]]),IHe])):U("",!0)],2),i.isHelp?(v(),C("p",DHe,j(i.help),1)):U("",!0),ce(c("input",{type:"number","onUpdate:modelValue":l=>i.value=l,step:"1",class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,kHe),[[De,i.value]]),i.min!=null&&i.max!=null?ce((v(),C("input",{key:1,type:"range","onUpdate:modelValue":l=>i.value=l,min:i.min,max:i.max,step:"1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,MHe)),[[De,i.value]]):U("",!0)])):U("",!0),i.type=="float"?(v(),C("div",LHe,[c("label",{class:Ae(["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",PHe,j(i.name)+": ",1),i.help?(v(),C("label",FHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,UHe),[[tt,i.isHelp]]),BHe])):U("",!0)],2),i.isHelp?(v(),C("p",GHe,j(i.help),1)):U("",!0),ce(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,qHe),[[De,i.value]]),i.min!=null&&i.max!=null?ce((v(),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,YHe)),[[De,i.value]]):U("",!0)])):U("",!0),i.type=="bool"?(v(),C("div",VHe,[c("div",zHe,[c("label",HHe,j(i.name)+": ",1),ce(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,$He),[[tt,i.value]]),i.help?(v(),C("label",WHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,KHe),[[tt,i.isHelp]]),QHe])):U("",!0)]),i.isHelp?(v(),C("p",jHe,j(i.help),1)):U("",!0)])):U("",!0),i.type=="list"?(v(),C("div",ZHe,[c("label",{class:Ae(["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",XHe,j(i.name)+": ",1),i.help?(v(),C("label",JHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,e$e),[[tt,i.isHelp]]),t$e])):U("",!0)],2),i.isHelp?(v(),C("p",n$e,j(i.help),1)):U("",!0),ce(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,r$e),[[De,i.value]])])):U("",!0),s$e]))),256)),c("div",o$e,[c("div",i$e,[c("button",{onClick:e[1]||(e[1]=pe(i=>o.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"},j(s.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=pe(i=>o.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"},j(s.DenyButtonText),1)])])])])])])):U("",!0)}const ea=Ye(Zze,[["render",a$e]]);const l$e={props:{show:{type:Boolean,default:!1,required:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(t){return console.log("choice:",t),typeof t=="string"?t:t&&t.name?t.name:""},selectChoice(t){this.selectedChoice=t,this.$emit("choice-selected",t)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(t){return t<1024?t+" bytes":t<1024*1024?(t/1024).toFixed(2)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/(1024*1024*1024)).toFixed(2)+" GB"},toggleInput(){this.showInput=!this.showInput},addNewFilename(){const t=this.newFilename.trim();t!==""&&(this.choices.push(t),this.newFilename="",this.selectChoice(t)),this.showInput=!1},removeChoice(t,e){this.choices.splice(e,1),t===this.selectedChoice&&(this.selectedChoice=null),this.$emit("choice-removed",t)}}},c$e={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"},d$e={class:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96"},u$e={class:"text-xl font-semibold mb-4"},_$e={class:"h-48 overflow-y-auto"},p$e=["onClick"],m$e={class:"font-bold"},g$e=c("br",null,null,-1),f$e={key:0,class:"text-xs text-gray-500"},h$e=["onClick"],E$e={key:0,class:"mt-4"},b$e={class:"flex justify-end mt-4"},S$e=["disabled"];function y$e(t,e,n,r,s,o){return v(),rt($r,{name:"fade"},{default:ke(()=>[n.show?(v(),C("div",c$e,[c("div",d$e,[c("h2",u$e,j(n.title),1),c("div",_$e,[c("ul",null,[(v(!0),C(we,null,Be(n.choices,(i,a)=>(v(),C("li",{key:a,onClick:l=>o.selectChoice(i),class:Ae([{"selected-choice":i===s.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700"])},[c("span",m$e,j(o.displayName(i)),1),g$e,i.size?(v(),C("span",f$e,j(o.formatSize(i.size)),1)):U("",!0),n.can_remove?(v(),C("button",{key:1,onClick:l=>o.removeChoice(i,a),class:"ml-2 text-red-500 hover:text-red-600"}," X ",8,h$e)):U("",!0)],10,p$e))),128))])]),s.showInput?(v(),C("div",E$e,[ce(c("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>s.newFilename=i),placeholder:"Enter a filename",class:"border border-gray-300 p-2 rounded-lg w-full"},null,512),[[De,s.newFilename]]),c("button",{onClick:e[1]||(e[1]=(...i)=>o.addNewFilename&&o.addNewFilename(...i)),class:"mt-2 py-2 px-4 bg-green-500 hover:bg-green-600 text-white rounded-lg transition duration-300"}," Add ")])):U("",!0),c("div",b$e,[c("button",{onClick:e[2]||(e[2]=(...i)=>o.closeDialog&&o.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[3]||(e[3]=(...i)=>o.validateChoice&&o.validateChoice(...i)),class:Ae([{"bg-gray-400 cursor-not-allowed":!s.selectedChoice,"bg-blue-500 hover:bg-blue-600":s.selectedChoice,"text-white":s.selectedChoice,"text-gray-500":!s.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!s.selectedChoice}," Validate ",10,S$e),c("button",{onClick:e[4]||(e[4]=(...i)=>o.toggleInput&&o.toggleInput(...i)),class:"py-2 px-4 ml-2 bg-blue-500 hover:bg-blue-600 text-white rounded-lg transition duration-300"}," Add New ")])])])):U("",!0)]),_:1})}const Tp=Ye(l$e,[["render",y$e]]),v$e={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:0}},data(){return{selectedValue:this.defaultValue}},methods:{handleRadioChange(t){this.selectedValue!==null&&this.$emit("radio-selected",this.selectedValue,t)}}},T$e={class:"flex space-x-4"},C$e=["value","onChange"],R$e={class:"text-gray-700"};function x$e(t,e,n,r,s,o){return v(),C("div",T$e,[(v(!0),C(we,null,Be(n.radioOptions,(i,a)=>(v(),C("label",{key:i.value,class:"flex items-center space-x-2"},[ce(c("input",{type:"radio",value:i.value,"onUpdate:modelValue":e[0]||(e[0]=l=>s.selectedValue=l),onChange:l=>o.handleRadioChange(a),class:"text-blue-500 focus:ring-2 focus:ring-blue-200"},null,40,C$e),[[P1,s.selectedValue]]),c("span",R$e,j(i.label),1)]))),128))])}const O$e=Ye(v$e,[["render",x$e]]),A$e="/",N$e={props:{extension:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onReinstall:Function,onSettings:Function},components:{InteractiveMenu:lo},data(){return{isMounted:!1,name:this.extension.name}},computed:{commandsList(){let t=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return this.isMounted&&t.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.extension.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.extension.isMounted,ve(()=>{Re.replace()})},methods:{getImgUrl(){return A$e+this.extension.avatar},defaultImg(t){t.target.src=ms},toggleTalk(){this.onTalk(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){ve(()=>{Re.replace()})}}},w$e=["title"],I$e={class:"flex flex-row items-center flex-shrink-0 gap-3"},D$e=["src"],k$e={class:""},M$e={class:""},L$e={class:"flex items-center"},P$e=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),F$e=c("b",null,"Author: ",-1),U$e={class:"flex items-center"},B$e=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),G$e=c("b",null,"Based on: ",-1),q$e={key:0,class:"flex items-center"},Y$e=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),V$e=c("b",null,"Languages: ",-1),z$e=["selected"],H$e={key:1,class:"flex items-center"},$$e=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),W$e=c("b",null,"Language: ",-1),K$e={class:"flex items-center"},Q$e=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),j$e=c("b",null,"Category: ",-1),Z$e=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),X$e=["title","innerHTML"],J$e={class:"rounded bg-blue-300"},eWe=c("i",{"data-feather":"check"},null,-1),tWe=c("span",{class:"sr-only"},"Select",-1),nWe=[eWe,tWe],rWe=c("i",{"data-feather":"send",class:"w-5"},null,-1),sWe=c("span",{class:"sr-only"},"Talk",-1),oWe=[rWe,sWe];function iWe(t,e,n,r,s,o){const i=Pe("InteractiveMenu");return v(),C("div",{class:Ae(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",o.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:n.extension.installed?"":"Not installed"},[c("div",{class:Ae(n.extension.installed?"":"border-red-500")},[c("div",I$e,[c("img",{onClick:e[0]||(e[0]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),ref:"imgElement",src:o.getImgUrl(),onError:e[1]||(e[1]=a=>o.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,D$e),c("h3",{onClick:e[2]||(e[2]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},j(n.extension.name),1)]),c("div",k$e,[c("div",M$e,[c("div",L$e,[P$e,F$e,xe(" "+j(n.extension.author),1)]),c("div",U$e,[B$e,G$e,xe(" "+j(n.extension.based_on),1)]),n.extension.languages&&n.select_language?(v(),C("div",q$e,[Y$e,V$e,ce(c("select",{id:"languages","onUpdate:modelValue":e[3]||(e[3]=a=>n.extension.language=a),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(v(!0),C(we,null,Be(n.extension.languages,(a,l)=>(v(),C("option",{key:l,selected:a==n.extension.languages[0]},j(a),9,z$e))),128))],512),[[Kt,n.extension.language]])])):U("",!0),n.extension.language?(v(),C("div",H$e,[$$e,W$e,xe(" "+j(n.extension.language),1)])):U("",!0),c("div",K$e,[Q$e,j$e,xe(" "+j(n.extension.category),1)])]),Z$e,c("p",{class:"mx-1 opacity-80 h-20 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",title:n.extension.description,innerHTML:n.extension.description},null,8,X$e)]),c("div",J$e,[s.isMounted?(v(),C("button",{key:0,type:"button",title:"Select",onClick:[e[4]||(e[4]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),e[5]||(e[5]=pe(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},nWe)):U("",!0),s.isMounted?(v(),C("button",{key:1,type:"button",title:"Talk",onClick:[e[6]||(e[6]=(...a)=>o.toggleTalk&&o.toggleTalk(...a)),e[7]||(e[7]=pe(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},oWe)):U("",!0),he(i,{commands:o.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,w$e)}const aWe=Ye(N$e,[["render",iWe]]),lWe="/assets/gpu-df72bf63.svg";const cWe="/";Te.defaults.baseURL="/";const dWe={components:{AddModelDialog:jze,MessageBox:pT,YesNoDialog:v7e,ModelEntry:nVe,PersonalityViewer:EVe,Toast:Sr,PersonalityEntry:mT,BindingEntry:Fze,UniversalForm:ea,ChoiceDialog:Tp,Card:ao,RadioOptions:O$e,ExtensionEntry:aWe},data(){return{imgModel:zn,SVGGPU:lWe,models_zoo:[],sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",extension_category:"bound_extensions",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],extensionsFiltererd:[],collapsedArr:[],all_collapsed:!0,minconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,ezc_collapsed:!0,mep_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:cWe,searchPersonality:"",searchExtension:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchExtensionInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){Ne.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{async modelsZooToggleCollapse(){this.mzc_collapsed=!this.mzc_collapsed,!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this.$store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo())},async selectSortOption(t){this.$store.state.sort_type=t,this.modelsFiltered=this.models_zoo,console.log(`Selected sorting:${t}`)},handleRadioSelected(t){this.isLoading=!0,this.selectSortOption(t).then(()=>{this.isLoading=!1})},filter_installed(t){return console.log("filtering"),t.filter(e=>e.isInstalled===!0)},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(t){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let e=this.currenModelToInstall;if(e.linkNotValid){e.installing=!1,this.$refs.toast.showToast("Link is not valid, file does not exist",4,!1);return}let n="https://huggingface.co/"+e.model.quantizer+"/"+e.model.name+"/resolve/main/"+this.selected_variant.name;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:n},console.log("installing...",this.addModel);const r=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),e.progress=s.progress,e.speed=s.speed,e.total_size=s.total_size,e.downloaded_size=s.downloaded_size,e.start_time=s.start_time,e.installing=!0,e.progress==100){const o=this.models_zoo.findIndex(i=>i.name===e.model.name);this.models_zoo[o].isInstalled=!0,this.showProgress=!1,e.installing=!1,console.log("Received succeeded"),Ne.off("install_progress",r),console.log("Installed successfully"),this.$refs.toast.showToast(`Model: +`);var I=0,Q=!1;this.parse=function(re,X,_e){if(typeof re!="string")throw new Error("Input must be a string");var ee=re.length,be=w.length,Ce=L.length,fe=M.length,Ee=k(Z),z=[],te=[],Y=[],ue=I=0;if(!re)return Ge();if(y.header&&!X){var ye=re.split(L)[0].split(w),O=[],N={},F=!1;for(var $ in ye){var W=ye[$];k(y.transformHeader)&&(W=y.transformHeader(W,$));var ie=W,me=N[W]||0;for(0=B)return Ge(!0)}else for(oe=I,I++;;){if((oe=re.indexOf(R,oe+1))===-1)return _e||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:z.length,index:I}),Oe();if(oe===ee-1)return Oe(re.substring(I,oe).replace(ne,R));if(R!==H||re[oe+1]!==H){if(R===H||oe===0||re[oe-1]!==H){q!==-1&&q=B)return Ge(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:z.length,index:I}),oe++}}else oe++}return Oe();function le(Ze){z.push(Ze),ue=I}function Se(Ze){var et=0;if(Ze!==-1){var Xe=re.substring(oe+1,Ze);Xe&&Xe.trim()===""&&(et=Xe.length)}return et}function Oe(Ze){return _e||(Ze===void 0&&(Ze=re.substring(I)),Y.push(Ze),I=ee,le(Y),Ee&&nt()),Ge()}function Le(Ze){I=Ze,le(Y),Y=[],V=re.indexOf(L,I)}function Ge(Ze){return{data:z,errors:te,meta:{delimiter:w,linebreak:L,aborted:Q,truncated:!!Ze,cursor:ue+(X||0)}}}function nt(){Z(Ge()),z=[],te=[]}},this.abort=function(){Q=!0},this.getCharIndex=function(){return I}}function m(y){var R=y.data,w=i[R.workerId],L=!1;if(R.error)w.userError(R.error,R.file);else if(R.results&&R.results.data){var M={abort:function(){L=!0,S(R.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:T,resume:T};if(k(w.userStep)){for(var Z=0;Zt.text()).then(t=>{const{data:e}=Gqe.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,"
")}}},vn=t=>(hr("data-v-f0cce578"),t=t(),Er(),t),Yqe={class:"container flex-row mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-1 md:grid-cols-2 gap-4"},Vqe=vn(()=>c("h2",{class:"text-2xl font-bold mb-2"},"About Lord of large Language Models",-1)),zqe={class:"mb-4"},Hqe=vn(()=>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)),$qe=vn(()=>c("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1)),Wqe={class:"list-disc pl-4"},Kqe={class:"text-xl font-bold mb-1"},Qqe=["innerHTML"],jqe=vn(()=>c("h2",{class:"text-2xl font-bold mb-2"},"Contact Us",-1)),Zqe=vn(()=>c("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to me.",-1)),Xqe=vn(()=>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)),Jqe=vn(()=>c("h2",{class:"text-2xl font-bold mb-2"},"Credits",-1)),e7e=vn(()=>c("p",{class:"mb-4"},[xe("This project is developed by "),c("span",{class:"font-bold"},"ParisNeo"),xe(" With help from the community.")],-1)),t7e=vn(()=>c("p",{class:"mb-4"},[c("span",{class:"font-bold"},[c("a",{href:"https://github.com/ParisNeo/lollms-webui/graphs/contributors"},"Check out the full list of developers here and show them some love.")])],-1)),n7e=["href"];function r7e(t,e,n,r,s,o){const i=Pe("Card");return v(),C("div",Yqe,[he(i,{disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[Vqe,c("p",zqe," Lollms version "+j(o.version),1),Hqe]),_:1}),he(i,{disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[$qe,c("ul",Wqe,[(v(!0),C(we,null,Be(s.faqs,(a,l)=>(v(),C("li",{key:l},[c("h3",Kqe,j(a.question),1),c("p",{class:"mb-4",innerHTML:o.parseMultiline(a.answer)},null,8,Qqe)]))),128))])]),_:1}),he(i,{disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[jqe,Zqe,Xqe]),_:1}),he(i,{disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[Jqe,e7e,t7e,c("p",null,[xe("Check out the project on "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:s.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,n7e),xe(".")])]),_:1})])}const s7e=Ye(qqe,[["render",r7e],["__scopeId","data-v-f0cce578"]]);function Xt(t,e=!0,n=1){const r=e?1e3:1024;if(Math.abs(t)=r&&oo.hide&&o.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 ")])])])):U("",!0)}const pT=Ye(o7e,[["render",d7e]]),u7e={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(r=>{this.message=t,this.show=!0,this.resolve=r})}}},_7e={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},p7e={class:"relative w-full max-w-md max-h-full"},m7e={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},g7e=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),f7e=c("span",{class:"sr-only"},"Close modal",-1),h7e=[g7e,f7e],E7e={class:"p-4 text-center"},b7e=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),S7e={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none break-all"};function y7e(t,e,n,r,s,o){return s.show?(v(),C("div",_7e,[c("div",p7e,[c("div",m7e,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>o.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"},h7e),c("div",E7e,[b7e,c("h3",S7e,j(s.message),1),c("button",{onClick:e[1]||(e[1]=i=>o.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"},j(s.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=i=>o.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"},j(s.DenyButtonText),1)])])])])):U("",!0)}const v7e=Ye(u7e,[["render",y7e]]),zn="/assets/default_model-eeb65acd.png";const T7e={props:{title:{type:String,required:!1,value:"menu"},icon:{type:String,required:!1,value:"feather:menu"},commands:{type:Array,required:!0},force_position:{required:!1,value:0},execute_cmd:{type:Function,required:!1},menuIconClass:{type:String,required:!1,default:""},selected_entry:{type:String,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),ve(()=>{Re.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(),ve(()=>{Re.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},C7e={class:"menu-container"},R7e=["title"],x7e=["src"],O7e=["data-feather"],A7e={key:2,class:"w-5 h-5"},N7e={key:3,"data-feather":"menu"},w7e={class:"flex-grow menu-ul"},I7e=["onClick"],D7e={key:0,"data-feather":"check"},k7e=["src","alt"],M7e=["data-feather"],L7e={key:3,class:"menu-icon"};function P7e(t,e,n,r,s,o){return v(),C("div",C7e,[c("button",{onClick:e[0]||(e[0]=pe((...i)=>o.toggleMenu&&o.toggleMenu(...i),["prevent"])),title:n.title,class:Ae([n.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[n.icon&&!n.icon.includes("#")&&!n.icon.includes("feather")?(v(),C("img",{key:0,src:n.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,x7e)):n.icon&&n.icon.includes("feather")?(v(),C("i",{key:1,"data-feather":n.icon.split(":")[1],class:"w-5 h-5"},null,8,O7e)):n.icon&&n.icon.includes("#")?(v(),C("p",A7e,j(n.icon.split("#")[1]),1)):(v(),C("i",N7e))],10,R7e),he($r,{name:"slide"},{default:ke(()=>[s.isMenuOpen?(v(),C("div",{key:0,class:"menu-list flex-grow",style:ht(s.menuPosition),ref:"menu"},[c("ul",w7e,[(v(!0),C(we,null,Be(n.commands,(i,a)=>(v(),C("li",{key:a,onClick:pe(l=>o.executeCommand(i),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[n.selected_entry==i.name?(v(),C("i",D7e)):i.icon&&!i.icon.includes("feather")&&!i.is_file?(v(),C("img",{key:1,src:i.icon,alt:i.name,class:"menu-icon"},null,8,k7e)):U("",!0),i.icon&&i.icon.includes("feather")&&!i.is_file?(v(),C("i",{key:2,"data-feather":i.icon.split(":")[1],class:"mr-2"},null,8,M7e)):(v(),C("span",L7e)),c("span",null,j(i.name),1)],8,I7e))),128))])],4)):U("",!0)]),_:1})])}const lo=Ye(T7e,[["render",P7e]]),F7e={components:{InteractiveMenu:lo},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){ve(()=>{Re.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 Xt(t)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?zn:this.model.icon},defaultImg(t){t.target.src=zn},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(t=!1){this.onSelected(this,t),model.selected=!0,ve(()=>{Re.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){installing=!1,this.onCancelInstall(this)},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let t=[{name:this.model.isInstalled?"Uninstall":"Install",icon:"feather:settings",is_file:!1,value:this.toggleInstall},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.selected&&t.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),t},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const t=this.model.variants[0].size;return this.formatFileSize(t)}return null}},speed_computed(){return Xt(this.speed)},total_size_computed(){return Xt(this.total_size)},downloaded_size_computed(){return Xt(this.downloaded_size)}},watch:{linkNotValid(){ve(()=>{Re.replace()})}}},U7e=["title"],B7e={key:0,class:"flex flex-row"},G7e={class:"max-w-[300px] overflow-x-auto"},q7e={class:"flex gap-3 items-center grow"},Y7e=["href"],V7e=["src"],z7e={class:"flex-1 overflow-hidden"},H7e={class:"font-bold font-large text-lg truncate"},$7e={key:1,class:"flex items-center flex-row gap-2 my-1"},W7e={class:"flex grow items-center"},K7e=c("i",{"data-feather":"box",class:"w-5"},null,-1),Q7e=c("span",{class:"sr-only"},"Custom model / local model",-1),j7e=[K7e,Q7e],Z7e=c("span",{class:"sr-only"},"Remove",-1),X7e={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"},J7e={class:"relative flex flex-col items-center justify-center flex-grow h-full"},eYe=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),tYe={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},nYe={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},rYe={class:"flex justify-between mb-1"},sYe=c("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),oYe={class:"text-sm font-medium text-blue-700 dark:text-white"},iYe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},aYe={class:"flex justify-between mb-1"},lYe={class:"text-base font-medium text-blue-700 dark:text-white"},cYe={class:"text-sm font-medium text-blue-700 dark:text-white"},dYe={class:"flex flex-grow"},uYe={class:"flex flex-row flex-grow gap-3"},_Ye={class:"p-2 text-center grow"},pYe={key:3},mYe={class:"flex flex-row items-center gap-3"},gYe=["src"],fYe={class:"font-bold font-large text-lg truncate"},hYe=c("div",{class:"grow"},null,-1),EYe={class:"flex items-center flex-row-reverse gap-2 my-1"},bYe={class:"flex flex-row items-center"},SYe={key:0,class:"text-base text-red-600 flex items-center mt-1"},yYe=c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),vYe=["title"],TYe={class:""},CYe={class:"flex flex-row items-center"},RYe=c("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),xYe=c("b",null,"Card: ",-1),OYe=["href","title"],AYe=c("div",{class:"grow"},null,-1),NYe=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),wYe=[NYe],IYe={class:"flex items-center"},DYe=c("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),kYe=c("b",null,"File size: ",-1),MYe={class:"flex items-center"},LYe=c("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),PYe=c("b",null,"License: ",-1),FYe={key:0,class:"flex items-center"},UYe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),BYe=c("b",null,"quantizer: ",-1),GYe=["href"],qYe={class:"flex items-center"},YYe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),VYe=c("b",null,"Model creator: ",-1),zYe=["href"],HYe={class:"flex items-center"},$Ye=c("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1),WYe=c("b",null,"Release date: ",-1),KYe={class:"flex items-center"},QYe=c("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1),jYe=c("b",null,"Category: ",-1),ZYe=["href"],XYe={class:"flex items-center"},JYe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),eVe=c("b",null,"Hugging face rank: ",-1);function tVe(t,e,n,r,s,o){const i=Pe("InteractiveMenu");return v(),C("div",{class:Ae(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",o.computed_classes]),title:n.model.name,onClick:e[11]||(e[11]=pe(a=>o.toggleSelected(),["prevent"]))},[n.model.isCustomModel?(v(),C("div",B7e,[c("div",G7e,[c("div",q7e,[c("a",{href:n.model.model_creator_link,target:"_blank"},[c("img",{src:o.getImgUrl(),onError:e[0]||(e[0]=a=>o.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,V7e)],8,Y7e),c("div",z7e,[c("h3",H7e,j(n.model.name),1)])])])])):U("",!0),n.model.isCustomModel?(v(),C("div",$7e,[c("div",W7e,[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]=pe(()=>{},["stop"]))},j7e),xe(" Custom model ")]),c("div",null,[n.model.isInstalled?(v(),C("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=pe((...a)=>o.toggleInstall&&o.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[xe(" Uninstall "),Z7e])):U("",!0)])])):U("",!0),s.installing?(v(),C("div",X7e,[c("div",J7e,[eYe,c("div",tYe,[c("div",nYe,[c("div",rYe,[sYe,c("span",oYe,j(Math.floor(s.progress))+"%",1)]),c("div",iYe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:ht({width:s.progress+"%"})},null,4)]),c("div",aYe,[c("span",lYe,"Download speed: "+j(o.speed_computed)+"/s",1),c("span",cYe,j(o.downloaded_size_computed)+"/"+j(o.total_size_computed),1)])])]),c("div",dYe,[c("div",uYe,[c("div",_Ye,[c("button",{onClick:e[3]||(e[3]=pe((...a)=>o.toggleCancelInstall&&o.toggleCancelInstall(...a),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])])):U("",!0),n.model.isCustomModel?U("",!0):(v(),C("div",pYe,[c("div",mYe,[c("img",{ref:"imgElement",src:o.getImgUrl(),onError:e[4]||(e[4]=a=>o.defaultImg(a)),class:Ae(["w-10 h-10 rounded-lg object-fill",s.linkNotValid?"grayscale":""])},null,42,gYe),c("h3",fYe,j(n.model.name),1),hYe,he(i,{commands:o.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),c("div",EYe,[c("div",bYe,[s.linkNotValid?(v(),C("div",SYe,[yYe,xe(" Link is not valid ")])):U("",!0)])]),c("div",{class:"",title:n.model.isInstalled?n.model.name:"Not installed"},[c("div",TYe,[c("div",CYe,[RYe,xYe,c("a",{href:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name,target:"_blank",onClick:e[5]||(e[5]=pe(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:s.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,OYe),AYe,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[6]||(e[6]=pe(a=>o.toggleCopyLink(),["stop"]))},wYe)]),c("div",IYe,[c("div",{class:Ae(["flex flex-shrink-0 items-center",s.linkNotValid?"text-red-600":""])},[DYe,kYe,xe(" "+j(o.fileSize),1)],2)]),c("div",MYe,[LYe,PYe,xe(" "+j(n.model.license),1)]),n.model.quantizer!="None"?(v(),C("div",FYe,[UYe,BYe,c("a",{href:"https://huggingface.co/"+n.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=pe(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},j(n.model.quantizer),9,GYe)])):U("",!0),c("div",qYe,[YYe,VYe,c("a",{href:n.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=pe(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},j(n.model.model_creator),9,zYe)]),c("div",HYe,[$Ye,WYe,xe(" "+j(n.model.last_commit_time),1)]),c("div",KYe,[QYe,jYe,c("a",{href:"https://huggingface.co/"+n.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=pe(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},j(n.model.category),9,ZYe)]),c("div",XYe,[JYe,eVe,c("a",{href:"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard",target:"_blank",rel:"noopener noreferrer",onClick:e[10]||(e[10]=pe(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},j(n.model.rank),1)])])],8,vYe)]))],10,U7e)}const nVe=Ye(F7e,[["render",tVe]]),rVe={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}}},sVe={class:"p-4"},oVe={class:"flex items-center mb-4"},iVe=["src"],aVe={class:"text-lg font-semibold"},lVe=c("strong",null,"Author:",-1),cVe=c("strong",null,"Description:",-1),dVe=c("strong",null,"Category:",-1),uVe={key:0},_Ve=c("strong",null,"Disclaimer:",-1),pVe=c("strong",null,"Conditioning Text:",-1),mVe=c("strong",null,"AI Prefix:",-1),gVe=c("strong",null,"User Prefix:",-1),fVe=c("strong",null,"Antiprompts:",-1);function hVe(t,e,n,r,s,o){return v(),C("div",sVe,[c("div",oVe,[c("img",{src:s.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,iVe),c("h2",aVe,j(s.personalityName),1)]),c("p",null,[lVe,xe(" "+j(s.personalityAuthor),1)]),c("p",null,[cVe,xe(" "+j(s.personalityDescription),1)]),c("p",null,[dVe,xe(" "+j(s.personalityCategory),1)]),s.disclaimer?(v(),C("p",uVe,[_Ve,xe(" "+j(s.disclaimer),1)])):U("",!0),c("p",null,[pVe,xe(" "+j(s.conditioningText),1)]),c("p",null,[mVe,xe(" "+j(s.aiPrefix),1)]),c("p",null,[gVe,xe(" "+j(s.userPrefix),1)]),c("div",null,[fVe,c("ul",null,[(v(!0),C(we,null,Be(s.antipromptsList,i=>(v(),C("li",{key:i.id},j(i.text),1))),128))])]),c("button",{onClick:e[0]||(e[0]=i=>s.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),s.editMode?(v(),C("button",{key:1,onClick:e[1]||(e[1]=(...i)=>o.commitChanges&&o.commitChanges(...i)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):U("",!0)])}const EVe=Ye(rVe,[["render",hVe]]),ms="/assets/logo-9d653710.svg",bVe="/",SVe={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function},components:{InteractiveMenu:lo},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.isMounted?this.unmount:this.mount},{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.personality.has_scripts&&t.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),t},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,ve(()=>{Re.replace()})},methods:{getImgUrl(){return bVe+this.personality.avatar},defaultImg(t){t.target.src=ms},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){ve(()=>{Re.replace()})}}},yVe=["title"],vVe={class:"flex flex-row items-center flex-shrink-0 gap-3"},TVe=["src"],CVe=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),RVe=[CVe],xVe={class:""},OVe={class:""},AVe={class:"flex items-center"},NVe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),wVe=c("b",null,"Author: ",-1),IVe={class:"flex items-center"},DVe=c("i",{"data-feather":"git-commit",class:"w-5 m-1"},null,-1),kVe=c("b",null,"Version: ",-1),MVe={key:0,class:"flex items-center"},LVe=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),PVe=c("b",null,"Languages: ",-1),FVe=["selected"],UVe={key:1,class:"flex items-center"},BVe=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),GVe=c("b",null,"Language: ",-1),qVe={class:"flex items-center"},YVe=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),VVe=c("b",null,"Category: ",-1),zVe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),HVe=["title","innerHTML"],$Ve={class:"rounded bg-blue-300"},WVe=c("i",{"data-feather":"check"},null,-1),KVe=c("span",{class:"sr-only"},"Select",-1),QVe=[WVe,KVe],jVe=c("i",{"data-feather":"send",class:"w-5"},null,-1),ZVe=c("span",{class:"sr-only"},"Talk",-1),XVe=[jVe,ZVe];function JVe(t,e,n,r,s,o){const i=Pe("InteractiveMenu");return v(),C("div",{class:Ae(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",o.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:n.personality.installed?"":"Not installed"},[c("div",{class:Ae(n.personality.installed?"":"border-red-500")},[c("div",vVe,[c("img",{onClick:e[0]||(e[0]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),ref:"imgElement",src:o.getImgUrl(),onError:e[1]||(e[1]=a=>o.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,TVe),c("h3",{onClick:e[2]||(e[2]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},j(n.personality.name),1),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[3]||(e[3]=pe(a=>o.toggleCopyLink(),["stop"]))},RVe)]),c("div",xVe,[c("div",OVe,[c("div",AVe,[NVe,wVe,xe(" "+j(n.personality.author),1)]),c("div",IVe,[DVe,kVe,xe(" "+j(n.personality.version),1)]),n.personality.languages&&n.select_language?(v(),C("div",MVe,[LVe,PVe,ce(c("select",{id:"languages","onUpdate:modelValue":e[4]||(e[4]=a=>n.personality.language=a),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(v(!0),C(we,null,Be(n.personality.languages,(a,l)=>(v(),C("option",{key:l,selected:a==n.personality.languages[0]},j(a),9,FVe))),128))],512),[[Kt,n.personality.language]])])):U("",!0),n.personality.language?(v(),C("div",UVe,[BVe,GVe,xe(" "+j(n.personality.language),1)])):U("",!0),c("div",qVe,[YVe,VVe,xe(" "+j(n.personality.category),1)])]),zVe,c("p",{class:"mx-1 opacity-80 h-20 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",title:n.personality.description,innerHTML:n.personality.description},null,8,HVe)]),c("div",$Ve,[s.isMounted?(v(),C("button",{key:0,type:"button",title:"Select",onClick:[e[5]||(e[5]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),e[6]||(e[6]=pe(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},QVe)):U("",!0),s.isMounted?(v(),C("button",{key:1,type:"button",title:"Talk",onClick:[e[7]||(e[7]=(...a)=>o.toggleTalk&&o.toggleTalk(...a)),e[8]||(e[8]=pe(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},XVe)):U("",!0),he(i,{commands:o.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,yVe)}const mT=Ye(SVe,[["render",JVe]]);const eze={props:{code:String},data(){return{evaluatedCode:"",componentKey:0}},watch:{code:{handler(t){console.log("Code changed"),this.evaluateScriptTags(t),this.componentKey++},immediate:!0}},methods:{evaluateScriptTags(t){const e=document.createElement("div");e.innerHTML=t,e.querySelectorAll("script").forEach(r=>{const s=document.createElement("script");s.textContent=r.textContent,document.body.appendChild(s),document.body.removeChild(s)}),this.evaluatedCode=e.innerHTML,console.log("evaluated code: "+this.evaluatedCode)}}},tze=["innerHTML"];function nze(t,e,n,r,s,o){return v(),C("div",{innerHTML:s.evaluatedCode,key:s.componentKey},null,8,tze)}const gT=Ye(eze,[["render",nze]]),rze="/",sze={components:{DynamicUIRenderer:gT},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){ve(()=>{Re.replace()})},methods:{getImgUrl(){return rze+this.binding.icon},defaultImg(t){t.target.src=ms},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){ve(()=>{Re.replace()})}}},oze=["title"],ize={class:"flex flex-row items-center gap-3"},aze=["src"],lze={class:"font-bold font-large text-lg truncate"},cze=c("div",{class:"grow"},null,-1),dze={class:"flex-none gap-1"},uze=c("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),_ze=c("span",{class:"sr-only"},"Help",-1),pze=[uze,_ze],mze={class:"flex items-center flex-row-reverse gap-2 my-1"},gze=c("span",{class:"sr-only"},"Click to install",-1),fze=c("span",{class:"sr-only"},"Reinstall",-1),hze=c("span",{class:"sr-only"},"UnInstall",-1),Eze=c("span",{class:"sr-only"},"Settings",-1),bze={class:""},Sze={class:""},yze={class:"flex items-center"},vze=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Tze=c("b",null,"Author: ",-1),Cze={class:"flex items-center"},Rze=c("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),xze=c("b",null,"Folder: ",-1),Oze={class:"flex items-center"},Aze=c("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),Nze=c("b",null,"Version: ",-1),wze={class:"flex items-center"},Ize=c("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),Dze=c("b",null,"Link: ",-1),kze=["href"],Mze=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),Lze=["title","innerHTML"];function Pze(t,e,n,r,s,o){const i=Pe("DynamicUIRenderer");return v(),C("div",{class:Ae(["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[7]||(e[7]=pe((...a)=>o.toggleSelected&&o.toggleSelected(...a),["stop"])),title:n.binding.installed?n.binding.name:"Not installed"},[c("div",null,[c("div",ize,[c("img",{ref:"imgElement",src:o.getImgUrl(),onError:e[0]||(e[0]=a=>o.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,aze),c("h3",lze,j(n.binding.name),1),cze,c("div",dze,[n.selected?(v(),C("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>o.toggleReloadBinding&&o.toggleReloadBinding(...a)),e[2]||(e[2]=pe(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},pze)):U("",!0)])]),c("div",mze,[n.binding.installed?U("",!0):(v(),C("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=pe((...a)=>o.toggleInstall&&o.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[xe(" Install "),gze])),n.binding.installed?(v(),C("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=pe((...a)=>o.toggleReinstall&&o.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},[xe(" Reinstall "),fze])):U("",!0),n.binding.installed?(v(),C("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=pe((...a)=>o.toggleUnInstall&&o.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[xe(" Uninstall "),hze])):U("",!0),n.selected?(v(),C("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=pe((...a)=>o.toggleSettings&&o.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[xe(" Settings "),Eze])):U("",!0)]),n.binding.ui?(v(),rt(i,{key:0,class:"w-full h-full",code:n.binding.ui},null,8,["code"])):U("",!0),c("div",bze,[c("div",Sze,[c("div",yze,[vze,Tze,xe(" "+j(n.binding.author),1)]),c("div",Cze,[Rze,xze,xe(" "+j(n.binding.folder),1)]),c("div",Oze,[Aze,Nze,xe(" "+j(n.binding.version),1)]),c("div",wze,[Ize,Dze,c("a",{href:n.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},j(n.binding.link),9,kze)])]),Mze,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.binding.description,innerHTML:n.binding.description},null,8,Lze)])])],10,oze)}const Fze=Ye(sze,[["render",Pze]]),Uze={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})}}},Bze={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},Gze={class:"relative w-full max-w-md max-h-full"},qze={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},Yze=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),Vze=c("span",{class:"sr-only"},"Close modal",-1),zze=[Yze,Vze],Hze={class:"p-4 text-center"},$ze=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),Wze={class:"p-4 text-center mx-auto mb-4"},Kze=c("label",{class:"mr-2"},"Model path",-1);function Qze(t,e,n,r,s,o){return s.show?(v(),C("div",Bze,[c("div",Gze,[c("div",qze,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>o.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"},zze),c("div",Hze,[$ze,c("div",Wze,[Kze,ce(c("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>s.model_path=i),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[De,s.model_path]])]),c("button",{onClick:e[2]||(e[2]=i=>o.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=>o.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")])])])])):U("",!0)}const jze=Ye(Uze,[["render",Qze]]),Zze={setup(){return{}},name:"UniversalForm",data(){return{show:!1,resolve:null,controls_array:[],title:"Universal form",ConfirmButtonText:"Submit",DenyButtonText:"Cancel"}},mounted(){ve(()=>{Re.replace()})},methods:{hide(t){this.show=!1,this.resolve&&t&&(this.resolve(this.controls_array),this.resolve=null)},showForm(t,e,n,r){this.ConfirmButtonText=n||this.ConfirmButtonText,this.DenyButtonText=r||this.DenyButtonText;for(let s=0;s{this.controls_array=t,this.show=!0,this.title=e||this.title,this.resolve=s,console.log("show form",this.controls_array)})}},watch:{controls_array:{deep:!0,handler(t){t.forEach(e=>{e.type==="int"?e.value=parseInt(e.value):e.type==="float"&&(e.value=parseFloat(e.value))})}},show(){ve(()=>{Re.replace()})}}},Xze={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 p-4"},Jze={class:"relative w-full max-w-md"},eHe={class:"flex flex-col rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel duration-150 shadow-lg max-h-screen"},tHe={class:"flex flex-row flex-grow items-center m-2 p-1"},nHe={class:"grow flex items-center"},rHe=c("i",{"data-feather":"sliders",class:"mr-2 flex-shrink-0"},null,-1),sHe={class:"text-lg font-semibold select-none mr-2"},oHe={class:"items-end"},iHe=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),aHe=c("span",{class:"sr-only"},"Close form modal",-1),lHe=[iHe,aHe],cHe={class:"flex flex-col relative no-scrollbar overflow-y-scroll p-2"},dHe={class:"px-2"},uHe={key:0},_He={key:0},pHe={class:"text-base font-semibold"},mHe={key:0,class:"relative inline-flex"},gHe=["onUpdate:modelValue"],fHe=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),hHe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},EHe=["onUpdate:modelValue"],bHe={key:1},SHe={class:"text-base font-semibold"},yHe={key:0,class:"relative inline-flex"},vHe=["onUpdate:modelValue"],THe=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),CHe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},RHe=["onUpdate:modelValue"],xHe=["value","selected"],OHe={key:1},AHe={class:"text-base font-semibold"},NHe={key:0,class:"relative inline-flex"},wHe=["onUpdate:modelValue"],IHe=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),DHe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},kHe=["onUpdate:modelValue"],MHe=["onUpdate:modelValue","min","max"],LHe={key:2},PHe={class:"text-base font-semibold"},FHe={key:0,class:"relative inline-flex"},UHe=["onUpdate:modelValue"],BHe=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),GHe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},qHe=["onUpdate:modelValue"],YHe=["onUpdate:modelValue","min","max"],VHe={key:3},zHe={class:"mb-2 relative flex items-center gap-2"},HHe={for:"default-checkbox",class:"text-base font-semibold"},$He=["onUpdate:modelValue"],WHe={key:0,class:"relative inline-flex"},KHe=["onUpdate:modelValue"],QHe=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),jHe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},ZHe={key:4},XHe={class:"text-base font-semibold"},JHe={key:0,class:"relative inline-flex"},e$e=["onUpdate:modelValue"],t$e=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),n$e={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},r$e=["onUpdate:modelValue"],s$e=c("hr",{class:"h-px my-4 bg-gray-200 border-0 dark:bg-gray-700"},null,-1),o$e={class:"flex flex-row flex-grow gap-3"},i$e={class:"p-2 text-center grow"};function a$e(t,e,n,r,s,o){return s.show?(v(),C("div",Xze,[c("div",Jze,[c("div",eHe,[c("div",tHe,[c("div",nHe,[rHe,c("h3",sHe,j(s.title),1)]),c("div",oHe,[c("button",{type:"button",onClick:e[0]||(e[0]=pe(i=>o.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"},lHe)])]),c("div",cHe,[(v(!0),C(we,null,Be(s.controls_array,(i,a)=>(v(),C("div",dHe,[i.type=="str"?(v(),C("div",uHe,[i.options?U("",!0):(v(),C("div",_He,[c("label",{class:Ae(["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",pHe,j(i.name)+": ",1),i.help?(v(),C("label",mHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,gHe),[[tt,i.isHelp]]),fHe])):U("",!0)],2),i.isHelp?(v(),C("p",hHe,j(i.help),1)):U("",!0),ce(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,EHe),[[De,i.value]])])),i.options?(v(),C("div",bHe,[c("label",{class:Ae(["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",SHe,j(i.name)+": ",1),i.help?(v(),C("label",yHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,vHe),[[tt,i.isHelp]]),THe])):U("",!0)],2),i.isHelp?(v(),C("p",CHe,j(i.help),1)):U("",!0),ce(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"},[(v(!0),C(we,null,Be(i.options,l=>(v(),C("option",{value:l,selected:i.value===l},j(l),9,xHe))),256))],8,RHe),[[Kt,i.value]])])):U("",!0)])):U("",!0),i.type=="int"?(v(),C("div",OHe,[c("label",{class:Ae(["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",AHe,j(i.name)+": ",1),i.help?(v(),C("label",NHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,wHe),[[tt,i.isHelp]]),IHe])):U("",!0)],2),i.isHelp?(v(),C("p",DHe,j(i.help),1)):U("",!0),ce(c("input",{type:"number","onUpdate:modelValue":l=>i.value=l,step:"1",class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,kHe),[[De,i.value]]),i.min!=null&&i.max!=null?ce((v(),C("input",{key:1,type:"range","onUpdate:modelValue":l=>i.value=l,min:i.min,max:i.max,step:"1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,MHe)),[[De,i.value]]):U("",!0)])):U("",!0),i.type=="float"?(v(),C("div",LHe,[c("label",{class:Ae(["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",PHe,j(i.name)+": ",1),i.help?(v(),C("label",FHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,UHe),[[tt,i.isHelp]]),BHe])):U("",!0)],2),i.isHelp?(v(),C("p",GHe,j(i.help),1)):U("",!0),ce(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,qHe),[[De,i.value]]),i.min!=null&&i.max!=null?ce((v(),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,YHe)),[[De,i.value]]):U("",!0)])):U("",!0),i.type=="bool"?(v(),C("div",VHe,[c("div",zHe,[c("label",HHe,j(i.name)+": ",1),ce(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,$He),[[tt,i.value]]),i.help?(v(),C("label",WHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,KHe),[[tt,i.isHelp]]),QHe])):U("",!0)]),i.isHelp?(v(),C("p",jHe,j(i.help),1)):U("",!0)])):U("",!0),i.type=="list"?(v(),C("div",ZHe,[c("label",{class:Ae(["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",XHe,j(i.name)+": ",1),i.help?(v(),C("label",JHe,[ce(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,e$e),[[tt,i.isHelp]]),t$e])):U("",!0)],2),i.isHelp?(v(),C("p",n$e,j(i.help),1)):U("",!0),ce(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,r$e),[[De,i.value]])])):U("",!0),s$e]))),256)),c("div",o$e,[c("div",i$e,[c("button",{onClick:e[1]||(e[1]=pe(i=>o.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"},j(s.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=pe(i=>o.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"},j(s.DenyButtonText),1)])])])])])])):U("",!0)}const ea=Ye(Zze,[["render",a$e]]);const l$e={props:{show:{type:Boolean,default:!1,required:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(t){return console.log("choice:",t),typeof t=="string"?t:t&&t.name?t.name:""},selectChoice(t){this.selectedChoice=t,this.$emit("choice-selected",t)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(t){return t<1024?t+" bytes":t<1024*1024?(t/1024).toFixed(2)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/(1024*1024*1024)).toFixed(2)+" GB"},toggleInput(){this.showInput=!this.showInput},addNewFilename(){const t=this.newFilename.trim();t!==""&&(this.choices.push(t),this.newFilename="",this.selectChoice(t)),this.showInput=!1},removeChoice(t,e){this.choices.splice(e,1),t===this.selectedChoice&&(this.selectedChoice=null),this.$emit("choice-removed",t)}}},c$e={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"},d$e={class:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96"},u$e={class:"text-xl font-semibold mb-4"},_$e={class:"h-48 overflow-y-auto"},p$e=["onClick"],m$e={class:"font-bold"},g$e=c("br",null,null,-1),f$e={key:0,class:"text-xs text-gray-500"},h$e=["onClick"],E$e={key:0,class:"mt-4"},b$e={class:"flex justify-end mt-4"},S$e=["disabled"];function y$e(t,e,n,r,s,o){return v(),rt($r,{name:"fade"},{default:ke(()=>[n.show?(v(),C("div",c$e,[c("div",d$e,[c("h2",u$e,j(n.title),1),c("div",_$e,[c("ul",null,[(v(!0),C(we,null,Be(n.choices,(i,a)=>(v(),C("li",{key:a,onClick:l=>o.selectChoice(i),class:Ae([{"selected-choice":i===s.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700"])},[c("span",m$e,j(o.displayName(i)),1),g$e,i.size?(v(),C("span",f$e,j(o.formatSize(i.size)),1)):U("",!0),n.can_remove?(v(),C("button",{key:1,onClick:l=>o.removeChoice(i,a),class:"ml-2 text-red-500 hover:text-red-600"}," X ",8,h$e)):U("",!0)],10,p$e))),128))])]),s.showInput?(v(),C("div",E$e,[ce(c("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>s.newFilename=i),placeholder:"Enter a filename",class:"border border-gray-300 p-2 rounded-lg w-full"},null,512),[[De,s.newFilename]]),c("button",{onClick:e[1]||(e[1]=(...i)=>o.addNewFilename&&o.addNewFilename(...i)),class:"mt-2 py-2 px-4 bg-green-500 hover:bg-green-600 text-white rounded-lg transition duration-300"}," Add ")])):U("",!0),c("div",b$e,[c("button",{onClick:e[2]||(e[2]=(...i)=>o.closeDialog&&o.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[3]||(e[3]=(...i)=>o.validateChoice&&o.validateChoice(...i)),class:Ae([{"bg-gray-400 cursor-not-allowed":!s.selectedChoice,"bg-blue-500 hover:bg-blue-600":s.selectedChoice,"text-white":s.selectedChoice,"text-gray-500":!s.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!s.selectedChoice}," Validate ",10,S$e),c("button",{onClick:e[4]||(e[4]=(...i)=>o.toggleInput&&o.toggleInput(...i)),class:"py-2 px-4 ml-2 bg-blue-500 hover:bg-blue-600 text-white rounded-lg transition duration-300"}," Add New ")])])])):U("",!0)]),_:1})}const Tp=Ye(l$e,[["render",y$e]]),v$e={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:0}},data(){return{selectedValue:this.defaultValue}},methods:{handleRadioChange(t){this.selectedValue!==null&&this.$emit("radio-selected",this.selectedValue,t)}}},T$e={class:"flex space-x-4"},C$e=["value","onChange"],R$e={class:"text-gray-700"};function x$e(t,e,n,r,s,o){return v(),C("div",T$e,[(v(!0),C(we,null,Be(n.radioOptions,(i,a)=>(v(),C("label",{key:i.value,class:"flex items-center space-x-2"},[ce(c("input",{type:"radio",value:i.value,"onUpdate:modelValue":e[0]||(e[0]=l=>s.selectedValue=l),onChange:l=>o.handleRadioChange(a),class:"text-blue-500 focus:ring-2 focus:ring-blue-200"},null,40,C$e),[[P1,s.selectedValue]]),c("span",R$e,j(i.label),1)]))),128))])}const O$e=Ye(v$e,[["render",x$e]]),A$e="/",N$e={props:{extension:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onReinstall:Function,onSettings:Function},components:{InteractiveMenu:lo},data(){return{isMounted:!1,name:this.extension.name}},computed:{commandsList(){let t=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return this.isMounted&&t.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.extension.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.extension.isMounted,ve(()=>{Re.replace()})},methods:{getImgUrl(){return A$e+this.extension.avatar},defaultImg(t){t.target.src=ms},toggleTalk(){this.onTalk(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){ve(()=>{Re.replace()})}}},w$e=["title"],I$e={class:"flex flex-row items-center flex-shrink-0 gap-3"},D$e=["src"],k$e={class:""},M$e={class:""},L$e={class:"flex items-center"},P$e=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),F$e=c("b",null,"Author: ",-1),U$e={class:"flex items-center"},B$e=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),G$e=c("b",null,"Based on: ",-1),q$e={key:0,class:"flex items-center"},Y$e=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),V$e=c("b",null,"Languages: ",-1),z$e=["selected"],H$e={key:1,class:"flex items-center"},$$e=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),W$e=c("b",null,"Language: ",-1),K$e={class:"flex items-center"},Q$e=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),j$e=c("b",null,"Category: ",-1),Z$e=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),X$e=["title","innerHTML"],J$e={class:"rounded bg-blue-300"},eWe=c("i",{"data-feather":"check"},null,-1),tWe=c("span",{class:"sr-only"},"Select",-1),nWe=[eWe,tWe],rWe=c("i",{"data-feather":"send",class:"w-5"},null,-1),sWe=c("span",{class:"sr-only"},"Talk",-1),oWe=[rWe,sWe];function iWe(t,e,n,r,s,o){const i=Pe("InteractiveMenu");return v(),C("div",{class:Ae(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",o.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:n.extension.installed?"":"Not installed"},[c("div",{class:Ae(n.extension.installed?"":"border-red-500")},[c("div",I$e,[c("img",{onClick:e[0]||(e[0]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),ref:"imgElement",src:o.getImgUrl(),onError:e[1]||(e[1]=a=>o.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,D$e),c("h3",{onClick:e[2]||(e[2]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},j(n.extension.name),1)]),c("div",k$e,[c("div",M$e,[c("div",L$e,[P$e,F$e,xe(" "+j(n.extension.author),1)]),c("div",U$e,[B$e,G$e,xe(" "+j(n.extension.based_on),1)]),n.extension.languages&&n.select_language?(v(),C("div",q$e,[Y$e,V$e,ce(c("select",{id:"languages","onUpdate:modelValue":e[3]||(e[3]=a=>n.extension.language=a),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(v(!0),C(we,null,Be(n.extension.languages,(a,l)=>(v(),C("option",{key:l,selected:a==n.extension.languages[0]},j(a),9,z$e))),128))],512),[[Kt,n.extension.language]])])):U("",!0),n.extension.language?(v(),C("div",H$e,[$$e,W$e,xe(" "+j(n.extension.language),1)])):U("",!0),c("div",K$e,[Q$e,j$e,xe(" "+j(n.extension.category),1)])]),Z$e,c("p",{class:"mx-1 opacity-80 h-20 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",title:n.extension.description,innerHTML:n.extension.description},null,8,X$e)]),c("div",J$e,[s.isMounted?(v(),C("button",{key:0,type:"button",title:"Select",onClick:[e[4]||(e[4]=(...a)=>o.toggleSelected&&o.toggleSelected(...a)),e[5]||(e[5]=pe(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},nWe)):U("",!0),s.isMounted?(v(),C("button",{key:1,type:"button",title:"Talk",onClick:[e[6]||(e[6]=(...a)=>o.toggleTalk&&o.toggleTalk(...a)),e[7]||(e[7]=pe(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},oWe)):U("",!0),he(i,{commands:o.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,w$e)}const aWe=Ye(N$e,[["render",iWe]]),lWe="/assets/gpu-df72bf63.svg";const cWe="/";Te.defaults.baseURL="/";const dWe={components:{AddModelDialog:jze,MessageBox:pT,YesNoDialog:v7e,ModelEntry:nVe,PersonalityViewer:EVe,Toast:Sr,PersonalityEntry:mT,BindingEntry:Fze,UniversalForm:ea,ChoiceDialog:Tp,Card:ao,RadioOptions:O$e,ExtensionEntry:aWe},data(){return{imgModel:zn,SVGGPU:lWe,models_zoo:[],sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",extension_category:"bound_extensions",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],extensionsFiltererd:[],collapsedArr:[],all_collapsed:!0,minconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,ezc_collapsed:!0,mep_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:cWe,searchPersonality:"",searchExtension:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchExtensionInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){Ne.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{async modelsZooToggleCollapse(){this.mzc_collapsed=!this.mzc_collapsed,!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this.$store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo())},async selectSortOption(t){this.$store.state.sort_type=t,this.modelsFiltered=this.models_zoo,console.log(`Selected sorting:${t}`)},handleRadioSelected(t){this.isLoading=!0,this.selectSortOption(t).then(()=>{this.isLoading=!1})},filter_installed(t){return console.log("filtering"),t.filter(e=>e.isInstalled===!0)},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(t){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let e=this.currenModelToInstall;if(e.linkNotValid){e.installing=!1,this.$refs.toast.showToast("Link is not valid, file does not exist",4,!1);return}let n="https://huggingface.co/"+e.model.quantizer+"/"+e.model.name+"/resolve/main/"+this.selected_variant.name;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:n},console.log("installing...",this.addModel);const r=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),e.progress=s.progress,e.speed=s.speed,e.total_size=s.total_size,e.downloaded_size=s.downloaded_size,e.start_time=s.start_time,e.installing=!0,e.progress==100){const o=this.models_zoo.findIndex(i=>i.name===e.model.name);this.models_zoo[o].isInstalled=!0,this.showProgress=!1,e.installing=!1,console.log("Received succeeded"),Ne.off("install_progress",r),console.log("Installed successfully"),this.$refs.toast.showToast(`Model: `+e.model.name+` installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else Ne.off("install_progress",r),console.log("Install failed"),e.installing=!1,this.showProgress=!1,console.error("Installation failed:",s.error),this.$refs.toast.showToast(`Model: `+e.model.name+` diff --git a/web/dist/index.html b/web/dist/index.html index 73bd18fc..8cdba984 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,7 +6,7 @@ LoLLMS WebUI - Welcome - + diff --git a/web/src/components/UniversalForm.vue b/web/src/components/UniversalForm.vue index 966c90f7..2db6c874 100644 --- a/web/src/components/UniversalForm.vue +++ b/web/src/components/UniversalForm.vue @@ -302,12 +302,25 @@ export default { this.show = true; this.title = title || this.title this.resolve = resolve; - console.log('show foam', this.controls_array) + console.log('show form', this.controls_array) }); }, }, watch: { + controls_array: { + deep: true, + handler(newArray) { + newArray.forEach(item => { + if (item.type === 'int') { + item.value = parseInt(item.value); + } else if (item.type === 'float') { + item.value = parseFloat(item.value); + } + // Add more conditions for other types if needed + }); + } + }, show() { nextTick(() => { feather.replace() diff --git a/zoos/bindings_zoo b/zoos/bindings_zoo index 398c0d5d..9ef76d37 160000 --- a/zoos/bindings_zoo +++ b/zoos/bindings_zoo @@ -1 +1 @@ -Subproject commit 398c0d5dc4bf44aa01fb8096b3cca277e67dc1b7 +Subproject commit 9ef76d37ffff83cfca593a8c9c92b05215ab24da diff --git a/zoos/models_zoo b/zoos/models_zoo index 5e792e73..16fc7015 160000 --- a/zoos/models_zoo +++ b/zoos/models_zoo @@ -1 +1 @@ -Subproject commit 5e792e733cd8f0ab339afd743ff24e3bc28a7367 +Subproject commit 16fc7015cffc57da8e3ed7b2c66ea95dc877dee7