import{I as v}from"./iconify-p99pbjf9.js";import{d as A,t,g as d,A as n,B as r,j as a,am as L,au as N,J as i,K as C,L as _,H as y,P as h,O as g,c as u}from"./index-DOFLUERq.js";import{_ as I}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Q={class:"file-toolbar"},E={class:"view-toggle"},K=["onClick","title"],V=["title"],P={key:0,class:"size-toggle"},U=["onClick","title"],D=["disabled","title"],j=["disabled","title"],x={key:2,class:"toolbar-divider"},H=["disabled","title"],J=["disabled"],R=A({__name:"file_list_toolbar",props:{entity:{},searchQuery:{},viewMode:{},previewOn:{type:Boolean},selectedKeys:{},loading:{type:Boolean},canEdit:{type:Boolean},cardSize:{},fileTypeFilter:{}},emits:["update:searchQuery","update:viewMode","update:previewOn","update:cardSize","update:fileTypeFilter","reload","create","create-folder","delete-selected"],setup(S,{emit:$}){const s=S,p=$,k=u({get:()=>s.searchQuery,set:o=>p("update:searchQuery",o)}),f=u({get:()=>s.viewMode,set:o=>p("update:viewMode",o)}),m=u({get:()=>s.previewOn??!1,set:o=>p("update:previewOn",o)}),w=u({get:()=>s.cardSize??"M",set:o=>p("update:cardSize",o)}),M=u({get:()=>s.fileTypeFilter??"",set:o=>p("update:fileTypeFilter",o)}),c=u(()=>s.loading),b=u(()=>s.selectedKeys),z=u(()=>s.canEdit??!0),F=[{mode:"list",icon:"tabler:layout-list",label:t("List")},{mode:"card",icon:"tabler:layout-grid",label:t("Card")},{mode:"masonry",icon:"tabler:layout-dashboard",label:t("Masonry")}],O=[{size:"S",label:"S"},{size:"M",label:"M"},{size:"L",label:"L"}],B=[{label:t("All Categories"),value:""},{label:t("Images"),value:"image"},{label:t("Documents"),value:"document"},{label:t("Videos"),value:"video"},{label:t("Audio"),value:"audio"},{label:t("Archives"),value:"archive"},{label:t("Folders"),value:"folder"}];return(o,l)=>(d(),n("div",Q,[r(a(L),{value:k.value,"onUpdate:value":l[0]||(l[0]=e=>k.value=e),placeholder:a(t)("Search files..."),clearable:"",style:{width:"200px"}},null,8,["value","placeholder"]),r(a(N),{value:M.value,"onUpdate:value":l[1]||(l[1]=e=>M.value=e),options:B,placeholder:a(t)("All Categories"),clearable:"",style:{width:"130px"}},null,8,["value","placeholder"]),l[7]||(l[7]=i("div",{class:"toolbar-divider"},null,-1)),i("div",E,[(d(),n(C,null,_(F,e=>i("button",{key:e.mode,class:y(["toggle-btn",{active:f.value===e.mode}]),onClick:T=>f.value=e.mode,title:e.label},[r(a(v),{icon:e.icon,size:18},null,8,["icon"])],10,K)),64))]),i("button",{class:y(["toggle-btn preview-toggle",{active:m.value}]),onClick:l[2]||(l[2]=e=>m.value=!m.value),title:m.value?a(t)("Close Preview"):a(t)("Open Preview")},[r(a(v),{icon:"tabler:layout-sidebar-right",size:18})],10,V),f.value==="card"?(d(),n("div",P,[(d(),n(C,null,_(O,e=>i("button",{key:e.size,class:y(["size-btn",{active:w.value===e.size}]),onClick:T=>w.value=e.size,title:e.label},h(e.label),11,U)),64))])):g("",!0),l[8]||(l[8]=i("div",{class:"toolbar-divider"},null,-1)),i("button",{class:"icon-btn",onClick:l[3]||(l[3]=e=>o.$emit("reload")),disabled:c.value,title:a(t)("Refresh")},[r(a(v),{icon:c.value?"tabler:loader-2":"tabler:refresh",size:18,class:y({"spin-icon":c.value})},null,8,["icon","class"])],8,D),b.value.length===0&&z.value?(d(),n("button",{key:1,class:"folder-btn",onClick:l[4]||(l[4]=e=>o.$emit("create-folder")),disabled:c.value,title:a(t)("New Folder")},[r(a(v),{icon:"tabler:folder-plus",size:18})],8,j)):g("",!0),b.value.length===0&&z.value?(d(),n("div",x)):g("",!0),b.value.length===0&&z.value?(d(),n("button",{key:3,class:"upload-btn",onClick:l[5]||(l[5]=e=>o.$emit("create")),disabled:c.value,title:a(t)("Upload Files")},[r(a(v),{icon:"tabler:cloud-upload",size:18}),i("span",null,h(a(t)("Add")),1)],8,H)):b.value.length>0?(d(),n("button",{key:4,class:"delete-btn",onClick:l[6]||(l[6]=e=>o.$emit("delete-selected")),disabled:c.value},[r(a(v),{icon:"tabler:trash",size:18}),i("span",null,h(b.value.length),1)],8,J)):g("",!0)]))}}),X=I(R,[["__scopeId","data-v-b6c19afa"]]);export{X as default};
