import{_ as e,c as a,o as l,a as t,b as s,e as n,S as o,Q as c,ai as u,t as d,w as i,H as r,ak as p,m as f,A as m,as as w,C as g,D as x}from"./index-BSOHXgJs.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"},k=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:k}){const V=e,C=k,S=a({get:()=>V.modelValue,set(e){e<1?C("update:modelValue",1):e>V.targets.length?C("update:modelValue",V.targets.length):C("update:modelValue",e)}}),j=e=>{C("input",e)},A=()=>{p(V.content),f.success(m("experiment.func-bar.copy-success"))},F=()=>{w(V.content,V.filename)};return(a,p)=>{var f,m;const w=g,k=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(S.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=>S.value++)}),n(w,{icon:"down",class:"w-full aspect-square",onClick:p[1]||(p[1]=e=>S.value--)})])],512),[[u,null==(m=e.targets)?void 0:m.length]])]),s("div",_,[n(k,{hollow:"",onClick:A},{default:i((()=>[n(w,{icon:"copy",class:"icon"}),r(" "+d(a.$t("experiment.func-bar.copy")),1)])),_:1}),n(k,{hollow:"",onClick:F},{default:i((()=>[n(w,{icon:"download",class:"icon"}),r(" "+d(a.$t("experiment.func-bar.download")),1)])),_:1})])])}}},[["__scopeId","data-v-2d2d0ea4"]]);export{k as F};
