import{h as e,c as a,a as s,t,d as n,F as l,q as r,v as i,e as u,s as o,f as c,o as p,N as m,af as v,p as d}from"./index-5CctA6VU.js";import{u as f}from"./experiment-BWsAMZL-.js";import{F as x}from"./FuncBar-CGKNjWmP.js";const b={key:0,class:"w-full border p-6 rounded-lg bg-default"},g={class:"flex items-center justify-between border-b pb-4 mb-5"},h={class:"text-xl font-semibold border-none basis-1/4"},w={key:0,class:"px-6 py-4 bg-higher rounded max-h-[60vh] overflow-y-auto"},y={key:1,class:"w-full flex flex-wrap justify-center pt-10"},q={class:"font-semibold w-full text-center pt-10"},j={__name:"EnvRequirements",setup(j){const k=f(),$=o();e.get(`/experiment/${k.id}/requirements`).then(({data:e})=>{$.value=e.requirements}).catch(()=>{$.value=[]});const C=o(""),F=e=>{C.value=e.toLowerCase().trim()},L=c(()=>$.value.map(e=>{const a=""!==C.value&&e.toLowerCase().includes(C.value);return{isTarget:a,value:a?T(e,C.value):e}}));function T(e,a){let s=e.split(new RegExp(`(${a})`,"i"));return s=s.filter(e=>""!==e),s}return(e,o)=>{var c;const f=i;return $.value?(p(),a("div",b,[s("div",g,[s("h1",h,t(e.$t("experiment.env.title.dependencies")),1),n(x,{class:"basis-1/3",onInput:F,content:null==(c=$.value)?void 0:c.join("\n"),filename:"requirements.txt",placeholder:e.$t("experiment.func-bar.placeholder.requirements")},null,8,["content","placeholder"])]),0!==$.value.length&&""!==$.value[0]?(p(),a("div",w,[(p(!0),a(l,null,r(L.value,e=>(p(),a("p",{key:e},[m(s("span",null,t(e.value),513),[[v,!e.isTarget]]),m(s("span",null,[(p(!0),a(l,null,r(e.value,e=>(p(),a("span",{key:e,class:d(e.toLowerCase()===C.value?" bg-warning-dimmest":"")},t(e),3))),128))],512),[[v,e.isTarget]])]))),128))])):(p(),a("div",y,[n(f,{class:"magnifier",icon:"search"}),s("div",q,t(e.$t("experiment.env.empty.requirements")),1)]))])):u("",!0)}}};export{j as default};
