import{i as e,h as a,c as s,a as t,d as n,b as l,e as r,t as i,F as u,s as o,v as c,o as m,N as p,af as v,q as d}from"./index-Dj1dnKzO.js";import{u as f}from"./experiment-DW4ZkdFG.js";import{F as x}from"./FuncBar-DcE69EVr.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(),$=e();a.get(`/experiment/${k.id}/requirements`).then((({data:e})=>{$.value=e.requirements})).catch((()=>{$.value=[]}));const C=e(""),F=e=>{C.value=e.toLowerCase().trim()},L=s((()=>$.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,a)=>{var s;const f=c;return $.value?(m(),t("div",b,[l("div",g,[l("h1",h,i(e.$t("experiment.env.title.dependencies")),1),r(x,{class:"basis-1/3",onInput:F,content:null==(s=$.value)?void 0:s.join("\n"),filename:"requirements.txt",placeholder:e.$t("experiment.func-bar.placeholder.requirements")},null,8,["content","placeholder"])]),0!==$.value.length&&""!==$.value[0]?(m(),t("div",w,[(m(!0),t(u,null,o(L.value,(e=>(m(),t("p",{key:e},[p(l("span",null,i(e.value),513),[[v,!e.isTarget]]),p(l("span",null,[(m(!0),t(u,null,o(e.value,(e=>(m(),t("span",{key:e,class:d(e.toLowerCase()===C.value?" bg-warning-dimmest":"")},i(e),3)))),128))],512),[[v,e.isTarget]])])))),128))])):(m(),t("div",y,[r(f,{class:"magnifier",icon:"search"}),l("div",q,i(e.$t("experiment.env.empty.requirements")),1)]))])):n("",!0)}}};export{j as default};
