import{_ as e,c as a,o as l,a as t,b as s,e as n,S as o,N as c,af as u,t as d,w as r,D as i,ah as p,m as f,y as m,ap as w,A as g,B as x}from"./index-mtICtCH6.js";const h={class:"w-full flex justify-between gap-5"},v={class:"flex items-center w-full"},y={class:"flex items-center px-4"},b={class:"w-3 flex-shrink-0 flex-col flex ml-2"},_={class:"flex gap-3"},V=e({__name:"FuncBar",props:{content:{type:String,default:""},filename:{type:String,default:"swanlab.file"},placeholder:{type:String,default:"Search..."},targets:{type:Array,default:()=>[]},modelValue:{type:Number,default:1}},emits:["input","download","update:modelValue"],setup(e,{emit:V}){const k=e,S=V,C=a({get:()=>k.modelValue,set(e){e<1?S("update:modelValue",1):e>k.targets.length?S("update:modelValue",k.targets.length):S("update:modelValue",e)}}),j=e=>{S("input",e)},A=()=>{p(k.content),f.success(m("experiment.func-bar.copy-success"))},B=()=>{w(k.content,k.filename)};return(a,p)=>{var f,m;const w=g,V=x;return l(),t("div",h,[s("div",v,[n(o,{onInput:j,placeholder:e.placeholder,class:"max-w-[400px]"},null,8,["placeholder"]),c(s("div",y,[s("span",null,d(C.value)+" / "+d(null==(f=e.targets)?void 0:f.length),1),s("div",b,[n(w,{icon:"down",class:"w-full h-3 -rotate-180 -mb-1",onClick:p[0]||(p[0]=e=>C.value++)}),n(w,{icon:"down",class:"w-full aspect-square",onClick:p[1]||(p[1]=e=>C.value--)})])],512),[[u,null==(m=e.targets)?void 0:m.length]])]),s("div",_,[n(V,{hollow:"",onClick:A},{default:r((()=>[n(w,{icon:"copy",class:"icon"}),i(" "+d(a.$t("experiment.func-bar.copy")),1)])),_:1}),n(V,{hollow:"",onClick:B},{default:r((()=>[n(w,{icon:"download",class:"icon"}),i(" "+d(a.$t("experiment.func-bar.download")),1)])),_:1})])])}}},[["__scopeId","data-v-2c15ccb6"]]);export{V as F};
