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