From 7b4398e64cd3e528e672585de7a8fada056ce523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C3=96zdemir?= Date: Mon, 6 May 2024 12:48:30 +0300 Subject: [PATCH] =?UTF-8?q?=20clean=C4=B1up=20&=20dump=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/vuefinder.cjs | 2 +- dist/vuefinder.js | 3 +-- package.json | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dist/vuefinder.cjs b/dist/vuefinder.cjs index 4b73aed9..7f42d085 100644 --- a/dist/vuefinder.cjs +++ b/dist/vuefinder.cjs @@ -1 +1 @@ -"use strict";var ie=Object.defineProperty;var ce=(a,t,o)=>t in a?ie(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o;var W=(a,t,o)=>(ce(a,typeof t!="symbol"?t+"":t,o),o);const e=require("vue"),de=require("mitt"),ue=require("dragselect"),me=require("@uppy/core"),fe=require("@uppy/xhr-upload"),pe=require("vanilla-lazyload");require("cropperjs/dist/cropper.css");const he=require("cropperjs");require("microtip/microtip.css");var Y;const H=(Y=document.querySelector('meta[name="csrf-token"]'))==null?void 0:Y.getAttribute("content");class ve{constructor(t){W(this,"config");this.config=t}get config(){return this.config}transformRequestParams(t){const o=this.config,n={};H!=null&&H!==""&&(n[o.xsrfHeaderName]=H);const r=Object.assign({},o.headers,n,t.headers),u=Object.assign({},o.params,t.params),s=t.body,i=o.baseUrl+t.url,l=t.method;let c;l!=="get"&&(s instanceof FormData?(c=s,o.body!=null&&Object.entries(this.config.body).forEach(([h,d])=>{c.append(h,d)})):(c={...s},o.body!=null&&Object.assign(c,this.config.body)));const f={url:i,method:l,headers:r,params:u,body:c};if(o.transformRequest!=null){const h=o.transformRequest({url:i,method:l,headers:r,params:u,body:c});h.url!=null&&(f.url=h.url),h.method!=null&&(f.method=h.method),h.params!=null&&(f.params=h.params??{}),h.headers!=null&&(f.headers=h.headers??{}),h.body!=null&&(f.body=h.body)}return f}getDownloadUrl(t,o){if(o.url!=null)return o.url;const n=this.transformRequestParams({url:"",method:"get",params:{q:"download",adapter:t,path:o.path}});return n.url+"?"+new URLSearchParams(n.params).toString()}getPreviewUrl(t,o){if(o.url!=null)return o.url;const n=this.transformRequestParams({url:"",method:"get",params:{q:"preview",adapter:t,path:o.path}});return n.url+"?"+new URLSearchParams(n.params).toString()}async send(t){const o=this.transformRequestParams(t),n=t.responseType||"json",r={method:t.method,headers:o.headers,signal:t.abortSignal},u=o.url+"?"+new URLSearchParams(o.params);if(o.method!=="get"&&o.body!=null){let i;o.body instanceof FormData?i=t.body:(i=JSON.stringify(o.body),r.headers["Content-Type"]="application/json"),r.body=i}const s=await fetch(u,r);if(s.ok)return await s[n]();throw await s.json()}}function ge(a){const t={baseUrl:"",headers:{},params:{},body:{},xsrfHeaderName:"X-CSRF-Token"};return typeof a=="string"?Object.assign(t,{baseUrl:a}):Object.assign(t,a),new ve(t)}function ke(a){let t=localStorage.getItem(a+"_storage");const o=e.reactive(JSON.parse(t??"{}"));e.watch(o,n);function n(){Object.keys(o).length?localStorage.setItem(a+"_storage",JSON.stringify(o)):localStorage.removeItem(a+"_storage")}function r(l,c){o[l]=c}function u(l){delete o[l]}function s(){Object.keys(o).map(l=>u(l))}return{getStore:(l,c=null)=>o.hasOwnProperty(l)?o[l]:c,setStore:r,removeStore:u,clearStore:s}}async function _e(a,t){const o=t[a];return typeof o=="function"?(await o()).default:o}function xe(a,t,o,n){const{getStore:r,setStore:u}=a,s=e.ref({}),i=e.ref(r("locale",t)),l=(h,d=t)=>{_e(h,n).then(m=>{s.value=m,u("locale",h),i.value=h,u("translations",m),Object.values(n).length>1&&(o.emit("vf-toast-push",{label:"The language is set to "+h}),o.emit("vf-language-saved"))}).catch(m=>{d?(o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),l(d,null)):o.emit("vf-toast-push",{label:"Locale cannot be loaded!",type:"error"})})};!r("locale")&&!n.length?l(t):s.value=r("translations");const c=(h,...d)=>d.length?c(h=h.replace("%s",d.shift()),...d):h;function f(h,...d){return s.value&&s.value.hasOwnProperty(h)?c(s.value[h],...d):c(h,...d)}return{t:f,changeLocale:l,locale:i}}const C={EDIT:"edit",NEW_FILE:"newfile",NEW_FOLDER:"newfolder",PREVIEW:"preview",ARCHIVE:"archive",UNARCHIVE:"unarchive",SEARCH:"search",RENAME:"rename",UPLOAD:"upload",DELETE:"delete",FULL_SCREEN:"fullscreen",DOWNLOAD:"download",LANGUAGE:"language"},ye=Object.values(C),we="2.3.0";function J(a,t,o,n,r){return(t=Math,o=t.log,n=1024,r=o(a)/o(n)|0,a/t.pow(n,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"iB":"B")}function Q(a,t,o,n,r){return(t=Math,o=t.log,n=1e3,r=o(a)/o(n)|0,a/t.pow(n,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"B":"B")}function be(a){const t={k:1,m:2,g:3,t:4},n=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(a);return n[1]*Math.pow(1024,t[n[2].toLowerCase()])}const A={SYSTEM:"system",LIGHT:"light",DARK:"dark"};function Ee(a,t){const o=e.ref(A.SYSTEM),n=e.ref(A.LIGHT);o.value=a.getStore("theme",t??A.SYSTEM);const r=window.matchMedia("(prefers-color-scheme: dark)"),u=s=>{o.value===A.DARK||o.value===A.SYSTEM&&s.matches?n.value=A.DARK:n.value=A.LIGHT};return u(r),r.addEventListener("change",u),{value:o,actualValue:n,set(s){o.value=s,s!==A.SYSTEM?a.setStore("theme",s):a.removeStore("theme"),u(r)}}}function Ve(){const a=e.shallowRef(null),t=e.ref(!1),o=e.ref();return{visible:t,type:a,data:o,open:(u,s=null)=>{t.value=!0,a.value=u,o.value=s},close:()=>{t.value=!1,a.value=null}}}function Ne(){let a;const t=e.ref(),o=Math.floor(Math.random()*2**32),n=e.ref(!1),r=e.ref([]),u=()=>r.value,s=()=>a.getSelection(),i=()=>r.value.length,l=()=>a.clearSelection(!0),c=e.ref();function f(){a=new ue({area:t.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),a.subscribe("DS:start:pre",({items:m,event:p,isDragging:v})=>{if(v)a.Interaction._reset(p);else{const k=t.value.offsetWidth-p.offsetX,E=t.value.offsetHeight-p.offsetY;k<15&&E<15&&a.Interaction._reset(p)}}),document.addEventListener("dragleave",m=>{!m.buttons&&n.value&&(n.value=!1)})}const h=()=>e.nextTick(()=>{const m=u().map(p=>p.path);l(),a.setSettings({selectables:document.getElementsByClassName("vf-item-"+o)}),a.addSelection(a.getSelectables().filter(p=>m.includes(JSON.parse(p.dataset.item).path))),r.value=a.getSelection().map(p=>JSON.parse(p.dataset.item)),c.value(r.value)}),d=m=>{c.value=m,a.subscribe("DS:end",({items:p,event:v,isDragging:k})=>{r.value=p.map(E=>JSON.parse(E.dataset.item)),m(p.map(E=>JSON.parse(E.dataset.item)))})};return e.onMounted(()=>{f()}),e.onUnmounted(()=>{a&&a.stop()}),e.onUpdated(()=>{a&&a.Area.reset()}),{instance:a,area:t,explorerId:o,isDraggingRef:n,getSelected:u,getSelection:s,clearSelection:l,refreshSelection:h,getCount:i,onSelect:d}}function Be(a,t){const o=e.ref(a),n=e.ref(t),r=e.ref([]),u=e.ref([]),s=e.ref([]),i=e.ref(!1),l=e.ref(5);let c=!1,f=!1;const h=e.reactive({adapter:o,storages:[],dirname:n,files:[]});function d(){let _=[],x=[],M=n.value??o.value+"://";M.length===0&&(r.value=[]),M.replace(o.value+"://","").split("/").forEach(function(w){_.push(w),_.join("/")!==""&&x.push({basename:w,name:w,path:o.value+"://"+_.join("/"),type:"dir"})}),u.value=x;const[b,y]=p(x,l.value);s.value=y,r.value=b}function m(_){l.value=_,d()}function p(_,x){return _.length>x?[_.slice(-x),_.slice(0,-x)]:[_,[]]}function v(_=null){i.value=_??!i.value}function k(){return r.value&&r.value.length&&!f}const E=e.computed(()=>{var _;return((_=r.value[r.value.length-2])==null?void 0:_.path)??o.value+"://"});return e.onMounted(()=>{}),e.watch(n,d),e.onMounted(d),{adapter:o,path:n,loading:c,searchMode:f,data:h,breadcrumbs:r,breadcrumbItems:u,limitBreadcrumbItems:m,hiddenBreadcrumbs:s,showHiddenBreadcrumbs:i,toggleHiddenBreadcrumbs:v,isGoUpAvailable:k,parentFolderPath:E}}const $e=(a,t)=>{const o=ke(a.id),n=de(),r=o.getStore("metricUnits",!1),u=Ee(o,a.theme),s=t.i18n,i=a.locale??t.locale,l=o.getStore("adapter"),c=d=>Array.isArray(d)?d:ye,f=o.getStore("persist-path",a.persist),h=f?o.getStore("path",a.path):a.path;return e.reactive({version:we,root:null,debug:a.debug,emitter:n,storage:o,i18n:e.computed(()=>xe(o,i,n,s)),modal:Ve(),dragSelect:e.computed(()=>Ne()),requester:ge(a.request),features:c(a.features),view:o.getStore("viewport","grid"),fullScreen:o.getStore("full-screen",a.fullScreen),selectButton:a.selectButton,maxFileSize:a.maxFileSize,theme:u,metricUnits:r,filesize:r?Q:J,compactListView:o.getStore("compact-list-view",!0),persist:f,showThumbnails:o.getStore("show-thumbnails",a.showThumbnails),fs:Be(l,h)})},Se=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 dark:bg-gray-600 dark:bg-opacity-75 bg-opacity-75 transition-opacity"},null,-1),Ce={class:"fixed z-10 inset-0 overflow-hidden"},De={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-3xl w-full"},Me={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Te={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},T={__name:"ModalLayout",setup(a){const t=e.inject("ServiceContainer");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");setTimeout(()=>o&&o.focus(),100)}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:n[1]||(n[1]=e.withKeys(r=>e.unref(t).modal.close(),["esc"])),tabindex:"0"},[Se,e.createElementVNode("div",Ce,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:n[0]||(n[0]=e.withModifiers(r=>e.unref(t).modal.close(),["self"]))},[e.createElementVNode("div",De,[e.createElementVNode("div",Me,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Te,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},Le=["aria-label"],Ae=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),je=[Ae],L={__name:"Message",props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(a,{emit:t}){var c;const o=t,n=e.inject("ServiceContainer"),{t:r}=n.i18n,u=e.ref(!1),s=e.ref(null),i=e.ref((c=s.value)==null?void 0:c.strMessage);e.watch(i,()=>u.value=!1);const l=()=>{o("hidden"),u.value=!0};return(f,h)=>(e.openBlock(),e.createElementBlock("div",null,[u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:s,class:e.normalizeClass(["flex mt-2 p-1 px-2 rounded text-sm break-all dark:opacity-75",a.error?"bg-red-100 text-red-600 ":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(f.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:l,"aria-label":e.unref(r)("Close"),"data-microtip-position":"top-left",role:"tooltip"},je,8,Le)],2))]))}},Fe={class:"sm:flex sm:items-start"},Ue=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})])],-1),ze={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ie={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Re={class:"mt-2"},He={class:"text-sm text-gray-500"},qe=["placeholder"],X={__name:"ModalNewFolder",setup(a){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,n=e.ref(""),r=e.ref(""),u=()=>{n.value!==""&&t.emitter.emit("vf-fetch",{params:{q:"newfolder",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{name:n.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",n.value)})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:i[2]||(i[2]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Fe,[Ue,e.createElementVNode("div",ze,[e.createElementVNode("h3",Ie,e.toDisplayString(e.unref(o)("New Folder")),1),e.createElementVNode("div",Re,[e.createElementVNode("p",He,e.toDisplayString(e.unref(o)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>n.value=l),onKeyup:e.withKeys(u,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Folder Name"),type:"text"},null,40,qe),[[e.vModelText,n.value]]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[1]||(i[1]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},Oe={class:"sm:flex sm:items-start"},Pe=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),Ge={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},We={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ke={class:"mt-2"},Ye={class:"text-sm text-gray-500"},Je=["placeholder"],Qe={__name:"ModalNewFile",setup(a){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,n=e.ref(""),r=e.ref(""),u=()=>{n.value!==""&&t.emitter.emit("vf-fetch",{params:{q:"newfile",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{name:n.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",n.value)})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:i[2]||(i[2]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Oe,[Pe,e.createElementVNode("div",Ge,[e.createElementVNode("h3",We,e.toDisplayString(e.unref(o)("New File")),1),e.createElementVNode("div",Ke,[e.createElementVNode("p",Ye,e.toDisplayString(e.unref(o)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>n.value=l),onKeyup:e.withKeys(u,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("File Name"),type:"text"},null,40,Je),[[e.vModelText,n.value]]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[1]||(i[1]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},Xe={class:"sm:flex sm:items-start"},Ze=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})])],-1),et={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},tt={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ot={class:"mt-2"},rt={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},nt={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},at=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),st=[at],lt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},it=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),ct=[it],dt={class:"ml-1.5"},Z={__name:"ModalRename",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items[0]),r=e.ref(t.modal.data.items[0].basename),u=e.ref(""),s=()=>{r.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"rename",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{item:n.value.path,name:r.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is renamed.",r.value)})},onError:i=>{u.value=o(i.message)}})};return(i,l)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:l[2]||(l[2]=c=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Xe,[Ze,e.createElementVNode("div",et,[e.createElementVNode("h3",tt,e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("div",ot,[e.createElementVNode("p",rt,[n.value.type==="dir"?(e.openBlock(),e.createElementBlock("svg",nt,st)):(e.openBlock(),e.createElementBlock("svg",lt,ct)),e.createElementVNode("span",dt,e.toDisplayString(n.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),onKeyup:e.withKeys(s,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,544),[[e.vModelText,r.value]]),u.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:l[1]||(l[1]=c=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},ut={class:"sm:flex sm:items-start"},mt=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})])],-1),ft={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},pt={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ht={class:"mt-2"},vt={class:"text-sm text-gray-500"},gt={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},kt={class:"flex text-sm text-gray-800 dark:text-gray-400"},_t={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},xt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),yt=[xt],wt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},bt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Et=[bt],Vt={class:"ml-1.5"},Nt={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},ee={__name:"ModalDelete",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items),r=e.ref(""),u=()=>{n.value.length&&t.emitter.emit("vf-fetch",{params:{q:"delete",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{items:n.value.map(({path:s,type:i})=>({path:s,type:i}))},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files deleted.")})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-danger"},e.toDisplayString(e.unref(o)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:i[1]||(i[1]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",Nt,e.toDisplayString(e.unref(o)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ut,[mt,e.createElementVNode("div",ft,[e.createElementVNode("h3",pt,e.toDisplayString(e.unref(o)("Delete files")),1),e.createElementVNode("div",ht,[e.createElementVNode("p",vt,e.toDisplayString(e.unref(o)("Are you sure you want to delete these files?")),1),e.createElementVNode("div",gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,l=>(e.openBlock(),e.createElementBlock("p",kt,[l.type==="dir"?(e.openBlock(),e.createElementBlock("svg",_t,yt)):(e.openBlock(),e.createElementBlock("svg",wt,Et)),e.createElementVNode("span",Vt,e.toDisplayString(l.basename),1)]))),256))]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[0]||(i[0]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}};function P(a,t=14){let o=`((?=([\\w\\W]{0,${t}}))([\\w\\W]{${t+1},})([\\w\\W]{8,}))`;return a.replace(new RegExp(o),"$2..$4")}const Bt={class:"sm:flex sm:items-start"},$t=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})])],-1),St={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ct={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Dt={class:"mt-2"},Mt={key:0,class:"pointer-events-none"},Tt={key:1,class:"pointer-events-none"},Lt=["disabled"],At=["disabled"],jt={class:"text-gray-500 text-sm mb-1 pr-1 max-h-[200px] overflow-y-auto vf-scrollbar"},Ft={class:"rounded flex flex-shrink-0 w-6 h-6 border bg-gray-50 text-xs cursor-default dark:border-gray-700 dark:bg-gray-800 dark:text-gray-50"},Ut=["textContent"],zt={class:"ml-1 w-full h-fit"},It={class:"text-left hidden md:block"},Rt={class:"text-left md:hidden"},Ht={key:0,class:"ml-auto"},qt=["title","disabled","onClick"],Ot=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),Pt=[Ot],Gt={key:0,class:"py-2"},Wt=["disabled"],Kt={__name:"ModalUpload",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=o("uppy"),r={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10},u=e.ref({QUEUE_ENTRY_STATUS:r}),s=e.ref(null),i=e.ref(null),l=e.ref(null),c=e.ref(null),f=e.ref(null),h=e.ref(null),d=e.ref([]),m=e.ref(""),p=e.ref(!1),v=e.ref(!1);let k;function E(B){return d.value.findIndex(D=>D.id===B)}function _(B,D=null){D=D??(B.webkitRelativePath||B.name),k.addFile({name:D,type:B.type,data:B,source:"Local"})}function x(B){switch(B.status){case r.DONE:return"text-green-600";case r.ERROR:return"text-red-600";case r.CANCELED:return"text-red-600";case r.PENDING:default:return""}}const M=B=>{switch(B.status){case r.DONE:return"✓";case r.ERROR:case r.CANCELED:return"!";case r.PENDING:default:return"..."}};function b(){c.value.click()}function y(){if(!p.value){if(!d.value.filter(B=>B.status!==r.DONE).length){m.value=o("Please select file to upload first.");return}m.value="",k.retryAll(),k.upload()}}function w(){k.cancelAll({reason:"user"}),d.value.forEach(B=>{B.status!==r.DONE&&(B.status=r.CANCELED,B.statusName=o("Canceled"))}),p.value=!1}function $(B){p.value||(k.removeFile(B.id,"removed-by-user"),d.value.splice(E(B.id),1))}function S(B){if(!p.value){if(k.cancelAll({reason:"user"}),B){const D=[];d.value.forEach(g=>{g.status!==r.DONE&&D.push(g)}),d.value=[],D.forEach(g=>{_(g.originalFile,g.name)});return}d.value.splice(0)}}function z(){t.modal.close()}function F(){return t.requester.transformRequestParams({url:"",method:"post",params:{q:"upload",adapter:t.fs.adapter,path:t.fs.data.dirname}})}return e.onMounted(async()=>{k=new me({debug:t.debug,restrictions:{maxFileSize:be(t.maxFileSize)},locale:n,onBeforeFileAdded(g,V){if(V[g.id]!=null){const j=E(g.id);d.value[j].status===r.PENDING&&(m.value=k.i18n("noDuplicates",{fileName:g.name})),d.value=d.value.filter(R=>R.id!==g.id)}return d.value.push({id:g.id,name:g.name,size:t.filesize(g.size),status:r.PENDING,statusName:o("Pending upload"),percent:null,originalFile:g.data}),!0}}),k.use(fe,{endpoint:"WILL_BE_REPLACED_BEFORE_UPLOAD",limit:5,timeout:0,getResponseError(g,V){let N;try{N=JSON.parse(g).message}catch{N=o("Cannot parse server response.")}return new Error(N)}}),k.on("restriction-failed",(g,V)=>{const N=d.value[E(g.id)];$(N),m.value=V.message}),k.on("upload",()=>{const g=F();k.setMeta({...g.body});const V=k.getPlugin("XHRUpload");V.opts.method=g.method,V.opts.endpoint=g.url+"?"+new URLSearchParams(g.params),V.opts.headers=g.headers,p.value=!0,d.value.forEach(N=>{N.status!==r.DONE&&(N.percent=null,N.status=r.UPLOADING,N.statusName=o("Pending upload"))})}),k.on("upload-progress",(g,V)=>{const N=Math.floor(V.bytesUploaded/V.bytesTotal*100);d.value[E(g.id)].percent=`${N}%`}),k.on("upload-success",g=>{const V=d.value[E(g.id)];V.status=r.DONE,V.statusName=o("Done")}),k.on("upload-error",(g,V)=>{const N=d.value[E(g.id)];N.percent=null,N.status=r.ERROR,V.isNetworkError?N.statusName=o("Network Error, Unable establish connection to the server or interrupted."):N.statusName=V?V.message:o("Unknown Error")}),k.on("error",g=>{m.value=g.message,p.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname},noCloseModal:!0})}),k.on("complete",()=>{p.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname},noCloseModal:!0})}),c.value.addEventListener("click",()=>{i.value.click()}),f.value.addEventListener("click",()=>{l.value.click()}),h.value.addEventListener("dragover",g=>{g.preventDefault(),v.value=!0}),h.value.addEventListener("dragleave",g=>{g.preventDefault(),v.value=!1});function B(g,V){V.isFile&&V.file(N=>g(V,N)),V.isDirectory&&V.createReader().readEntries(N=>{N.forEach(j=>{B(g,j)})})}h.value.addEventListener("drop",g=>{g.preventDefault(),v.value=!1;const V=/^[/\\](.+)/;[...g.dataTransfer.items].forEach(N=>{N.kind==="file"&&B((j,R)=>{const le=V.exec(j.fullPath);_(R,le[1])},N.webkitGetAsEntry())})});const D=({target:g})=>{const V=g.files;for(const N of V)_(N);g.value=""};i.value.addEventListener("change",D),l.value.addEventListener("change",D)}),e.onBeforeUnmount(()=>{k==null||k.close({reason:"unmount"})}),(B,D)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["vf-btn vf-btn-primary",p.value?"bg-blue-200 hover:bg-blue-200 dark:bg-gray-700/50 dark:hover:bg-gray-700/50 dark:text-gray-500":"bg-blue-600 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-500"]),disabled:p.value,onClick:e.withModifiers(y,["prevent"])},e.toDisplayString(e.unref(o)("Upload")),11,Wt),p.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(w,["prevent"])},e.toDisplayString(e.unref(o)("Cancel")),1)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(z,["prevent"])},e.toDisplayString(e.unref(o)("Close")),1))]),default:e.withCtx(()=>[e.createElementVNode("div",Bt,[$t,e.createElementVNode("div",St,[e.createElementVNode("h3",Ct,e.toDisplayString(e.unref(o)("Upload Files")),1),e.createElementVNode("div",Dt,[e.createElementVNode("div",{ref_key:"dropArea",ref:h,class:"flex items-center justify-center text-lg mb-4 text-gray-500 border-2 border-gray-300 rounded border-dashed select-none cursor-pointer dark:border-gray-600 h-[120px]",onClick:b},[v.value?(e.openBlock(),e.createElementBlock("div",Mt,e.toDisplayString(e.unref(o)("Release to drop these files.")),1)):(e.openBlock(),e.createElementBlock("div",Tt,e.toDisplayString(e.unref(o)("Drag and drop the files/folders to here or click here.")),1))],512),e.createElementVNode("div",{ref_key:"container",ref:s,class:"text-gray-500 mb-1"},[e.createElementVNode("button",{ref_key:"pickFiles",ref:c,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Files")),513),e.createElementVNode("button",{ref_key:"pickFolders",ref:f,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Folders")),513),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:p.value,onClick:D[0]||(D[0]=g=>S(!1))},e.toDisplayString(e.unref(o)("Clear all")),9,Lt),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:p.value,onClick:D[1]||(D[1]=g=>S(!0))},e.toDisplayString(e.unref(o)("Clear only successful")),9,At)],512),e.createElementVNode("div",jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,g=>(e.openBlock(),e.createElementBlock("div",{class:"flex hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-gray-300",key:g.id},[e.createElementVNode("span",Ft,[e.createElementVNode("span",{class:e.normalizeClass(["text-base m-auto",x(g)]),textContent:e.toDisplayString(M(g))},null,10,Ut)]),e.createElementVNode("div",zt,[e.createElementVNode("div",It,e.toDisplayString(e.unref(P)(g.name,40))+" ("+e.toDisplayString(g.size)+")",1),e.createElementVNode("div",Rt,e.toDisplayString(e.unref(P)(g.name,16))+" ("+e.toDisplayString(g.size)+")",1),e.createElementVNode("div",{class:e.normalizeClass(["flex break-all text-left",x(g)])},[e.createTextVNode(e.toDisplayString(g.statusName)+" ",1),g.status===u.value.QUEUE_ENTRY_STATUS.UPLOADING?(e.openBlock(),e.createElementBlock("b",Ht,e.toDisplayString(g.percent),1)):e.createCommentVNode("",!0)],2)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["rounded w-5 h-5 border-1 text-base leading-none font-medium focus:outline-none dark:border-gray-200 dark:text-gray-400 dark:hover:text-gray-200 dark:bg-gray-600 ml-auto sm:text-xs hover:text-red-600",p.value?"disabled:bg-gray-100 text-white text-opacity-50":"bg-gray-100"]),title:e.unref(o)("Delete"),disabled:p.value,onClick:V=>$(g)},Pt,10,qt)]))),128)),d.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gt,e.toDisplayString(e.unref(o)("No files selected!")),1))]),m.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:D[2]||(D[2]=g=>m.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),e.createElementVNode("input",{ref_key:"internalFileInput",ref:i,type:"file",multiple:"",class:"hidden"},null,512),e.createElementVNode("input",{ref_key:"internalFolderInput",ref:l,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1}))}},Yt={class:"sm:flex sm:items-start"},Jt=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),Qt={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Xt={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Zt={class:"mt-2"},eo={class:"flex text-sm text-gray-800 dark:text-gray-400"},to={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},oo=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),ro=[oo],no={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ao=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),so=[ao],lo={class:"ml-1.5"},io={class:"my-1 text-sm text-gray-500"},te={__name:"ModalUnarchive",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items[0]),r=e.ref(""),u=e.ref([]),s=()=>{t.emitter.emit("vf-fetch",{params:{q:"unarchive",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{item:n.value.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file unarchived.")})},onError:i=>{r.value=o(i.message)}})};return(i,l)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:l[1]||(l[1]=c=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Yt,[Jt,e.createElementVNode("div",Qt,[e.createElementVNode("h3",Xt,e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("div",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,c=>(e.openBlock(),e.createElementBlock("p",eo,[c.type==="dir"?(e.openBlock(),e.createElementBlock("svg",to,ro)):(e.openBlock(),e.createElementBlock("svg",no,so)),e.createElementVNode("span",lo,e.toDisplayString(c.basename),1)]))),256)),e.createElementVNode("p",io,e.toDisplayString(e.unref(o)("The archive will be unarchived at"))+" ("+e.toDisplayString(e.unref(t).fs.data.dirname)+")",1),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:l[0]||(l[0]=c=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},co={class:"sm:flex sm:items-start"},uo=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),mo={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},fo={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},po={class:"mt-2"},ho={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},vo={class:"flex text-sm text-gray-800 dark:text-gray-400"},go={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ko=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),_o=[ko],xo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},yo=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),wo=[yo],bo={class:"ml-1.5"},Eo=["placeholder"],oe={__name:"ModalArchive",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(""),r=e.ref(""),u=e.ref(t.modal.data.items),s=()=>{u.value.length&&t.emitter.emit("vf-fetch",{params:{q:"archive",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{items:u.value.map(({path:i,type:l})=>({path:i,type:l})),name:n.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file(s) archived.")})},onError:i=>{r.value=o(i.message)}})};return(i,l)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:l[2]||(l[2]=c=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",co,[uo,e.createElementVNode("div",mo,[e.createElementVNode("h3",fo,e.toDisplayString(e.unref(o)("Archive the files")),1),e.createElementVNode("div",po,[e.createElementVNode("div",ho,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,c=>(e.openBlock(),e.createElementBlock("p",vo,[c.type==="dir"?(e.openBlock(),e.createElementBlock("svg",go,_o)):(e.openBlock(),e.createElementBlock("svg",xo,wo)),e.createElementVNode("span",bo,e.toDisplayString(c.basename),1)]))),256))]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>n.value=c),onKeyup:e.withKeys(s,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Archive name. (.zip file will be created)"),type:"text"},null,40,Eo),[[e.vModelText,n.value]]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:l[1]||(l[1]=c=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},Vo={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},No=e.createElementVNode("path",{d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44z"},null,-1),Bo=[No];function $o(a,t){return e.openBlock(),e.createElementBlock("svg",Vo,[...Bo])}const So={render:$o},Co={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},Do=e.createElementVNode("path",{d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"},null,-1),Mo=[Do];function To(a,t){return e.openBlock(),e.createElementBlock("svg",Co,[...Mo])}const Lo={render:To},Ao={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},jo=e.createElementVNode("path",{d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"},null,-1),Fo=[jo];function Uo(a,t){return e.openBlock(),e.createElementBlock("svg",Ao,[...Fo])}const zo={render:Uo},Io={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},Ro=e.createElementVNode("path",{d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21q.512.078 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48 48 0 0 0-3.478-.397m-12 .562q.51-.089 1.022-.165m0 0a48 48 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a52 52 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a49 49 0 0 0-7.5 0"},null,-1),Ho=[Ro];function qo(a,t){return e.openBlock(),e.createElementBlock("svg",Io,[...Ho])}const Oo={render:qo},Po={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},Go=e.createElementVNode("path",{d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"},null,-1),Wo=[Go];function Ko(a,t){return e.openBlock(),e.createElementBlock("svg",Po,[...Wo])}const Yo={render:Ko},Jo={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},Qo=e.createElementVNode("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1),Xo=[Qo];function Zo(a,t){return e.openBlock(),e.createElementBlock("svg",Jo,[...Xo])}const er={render:Zo},tr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},or=e.createElementVNode("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1),rr=[or];function nr(a,t){return e.openBlock(),e.createElementBlock("svg",tr,[...rr])}const ar={render:nr},sr={xmlns:"http://www.w3.org/2000/svg",fill:"none",class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",viewBox:"0 0 24 24"},lr=e.createElementVNode("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",class:"opacity-25 stroke-blue-900 dark:stroke-blue-100"},null,-1),ir=e.createElementVNode("path",{fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z",class:"opacity-75"},null,-1),cr=[lr,ir];function dr(a,t){return e.openBlock(),e.createElementBlock("svg",sr,[...cr])}const re={render:dr},ur={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},mr=e.createElementVNode("path",{d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},null,-1),fr=[mr];function pr(a,t){return e.openBlock(),e.createElementBlock("svg",ur,[...fr])}const hr={render:pr},vr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},gr=e.createElementVNode("path",{d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"},null,-1),kr=[gr];function _r(a,t){return e.openBlock(),e.createElementBlock("svg",vr,[...kr])}const xr={render:_r},yr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},wr=e.createElementVNode("path",{d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25zm0 9.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18zM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25zm0 9.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18z"},null,-1),br=[wr];function Er(a,t){return e.openBlock(),e.createElementBlock("svg",yr,[...br])}const Vr={render:Er},Nr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},Br=e.createElementVNode("path",{d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75"},null,-1),$r=[Br];function Sr(a,t){return e.openBlock(),e.createElementBlock("svg",Nr,[...$r])}const Cr={render:Sr},Dr={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Mr={key:0,class:"flex text-center"},Tr=["aria-label"],Lr=["aria-label"],Ar=["aria-label"],jr=["aria-label"],Fr=["aria-label"],Ur=["aria-label"],zr=["aria-label"],Ir={key:1,class:"flex text-center"},Rr={class:"pl-2"},Hr={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},qr={class:"flex text-center items-center justify-end"},Or=["aria-label"],Pr=["aria-label"],Gr={__name:"Toolbar",setup(a){const t=e.inject("ServiceContainer"),{setStore:o}=t.storage,{t:n}=t.i18n,r=t.dragSelect,u=e.ref("");t.emitter.on("vf-search-query",({newQuery:l})=>{u.value=l});const s=()=>{t.fullScreen=!t.fullScreen,o("full-screen",t.fullScreen),t.emitter.emit("vf-fullscreen-toggle")},i=()=>{t.view=t.view==="list"?"grid":"list",r.refreshSelection(),o("viewport",t.view)};return(l,c)=>(e.openBlock(),e.createElementBlock("div",Dr,[u.value.length?(e.openBlock(),e.createElementBlock("div",Ir,[e.createElementVNode("div",Rr,[e.createTextVNode(e.toDisplayString(e.unref(n)("Search results for"))+" ",1),e.createElementVNode("span",Hr,e.toDisplayString(u.value),1)]),e.unref(t).fs.loading?(e.openBlock(),e.createBlock(e.unref(re),{key:0})):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Mr,[e.unref(t).features.includes(e.unref(C).NEW_FOLDER)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(n)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:c[0]||(c[0]=f=>e.unref(t).modal.open(X,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(So))],8,Tr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).NEW_FILE)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(n)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[1]||(c[1]=f=>e.unref(t).modal.open(Qe,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(Lo))],8,Lr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).RENAME)?(e.openBlock(),e.createElementBlock("div",{key:2,class:"mx-1.5","aria-label":e.unref(n)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[2]||(c[2]=f=>e.unref(r).getCount()!==1||e.unref(t).modal.open(Z,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(zo),{class:e.normalizeClass(e.unref(r).getCount()===1?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,Ar)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).DELETE)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"mx-1.5","aria-label":e.unref(n)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[3]||(c[3]=f=>!e.unref(r).getCount()||e.unref(t).modal.open(ee,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(Oo),{class:e.normalizeClass(e.unref(r).getCount()?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,jr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).UPLOAD)?(e.openBlock(),e.createElementBlock("div",{key:4,class:"mx-1.5","aria-label":e.unref(n)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[4]||(c[4]=f=>e.unref(t).modal.open(Kt,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(Yo))],8,Fr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).UNARCHIVE)&&e.unref(r).getCount()===1&&e.unref(r).getSelected()[0].mime_type==="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:5,class:"mx-1.5","aria-label":e.unref(n)("Unarchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[5]||(c[5]=f=>!e.unref(r).getCount()||e.unref(t).modal.open(te,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(ar),{class:e.normalizeClass(e.unref(r).getCount()?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,Ur)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).ARCHIVE)?(e.openBlock(),e.createElementBlock("div",{key:6,class:"mx-1.5","aria-label":e.unref(n)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[6]||(c[6]=f=>!e.unref(r).getCount()||e.unref(t).modal.open(oe,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(er),{class:e.normalizeClass(e.unref(r).getCount()?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,zr)):e.createCommentVNode("",!0)])),e.createElementVNode("div",qr,[e.unref(t).features.includes(e.unref(C).FULL_SCREEN)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:s,class:"mx-1.5","aria-label":e.unref(n)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip"},[e.unref(t).fullScreen?(e.openBlock(),e.createBlock(e.unref(xr),{key:0})):(e.openBlock(),e.createBlock(e.unref(hr),{key:1}))],8,Or)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(n)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:c[7]||(c[7]=f=>u.value.length||i())},[e.unref(t).view==="grid"?(e.openBlock(),e.createBlock(e.unref(Vr),{key:0,class:e.normalizeClass(u.value.length?"vf-toolbar-icon-disabled":"vf-toolbar-icon")},null,8,["class"])):e.createCommentVNode("",!0),e.unref(t).view==="list"?(e.openBlock(),e.createBlock(e.unref(Cr),{key:1,class:e.normalizeClass(u.value.length?"vf-toolbar-icon-disabled":"vf-toolbar-icon")},null,8,["class"])):e.createCommentVNode("",!0)],8,Pr)])]))}},Wr=(a,t=0,o=!1)=>{let n;return(...r)=>{o&&!n&&a(...r),clearTimeout(n),n=setTimeout(()=>{a(...r)},t)}},K=(a,t,o)=>{const n=e.ref(a);return e.customRef((r,u)=>({get(){return r(),n.value},set:Wr(s=>{n.value=s,u()},t,o)}))},Kr={class:"sm:flex sm:items-start"},Yr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1),Jr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Qr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Xr={class:"text-sm text-gray-500 pb-1"},Zr={class:"max-h-[200px] overflow-y-auto vf-scrollbar text-left"},en={class:"flex text-sm text-gray-800 dark:text-gray-400"},tn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},on=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),rn=[on],nn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},an=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),sn=[an],ln={class:"ml-1.5"},cn={class:"font-bold text-xs text-gray-700 dark:text-gray-500 mt-3 tracking-wider"},dn={class:"flex text-sm text-gray-800 dark:text-gray-400 border dark:border-gray-700 p-1 rounded"},un=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),mn={class:"ml-1.5 overflow-auto"},fn={class:"m-1 mr-auto font-bold text-gray-500 text-sm dark:text-gray-200 self-center"},G={__name:"ModalMove",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items.from),r=e.ref(""),u=()=>{n.value.length&&t.emitter.emit("vf-fetch",{params:{q:"move",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{items:n.value.map(({path:s,type:i})=>({path:s,type:i})),item:t.modal.data.items.to.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files moved.",t.modal.data.items.to.name)})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:i[1]||(i[1]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",fn,e.toDisplayString(e.unref(o)("%s item(s) selected.",n.value.length)),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Kr,[Yr,e.createElementVNode("div",Jr,[e.createElementVNode("h3",Qr,e.toDisplayString(e.unref(o)("Move files")),1),e.createElementVNode("p",Xr,e.toDisplayString(e.unref(o)("Are you sure you want to move these files?")),1),e.createElementVNode("div",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,l=>(e.openBlock(),e.createElementBlock("div",en,[e.createElementVNode("div",null,[l.type==="dir"?(e.openBlock(),e.createElementBlock("svg",tn,rn)):(e.openBlock(),e.createElementBlock("svg",nn,sn))]),e.createElementVNode("div",ln,e.toDisplayString(l.path),1)]))),256))]),e.createElementVNode("h4",cn,e.toDisplayString(e.unref(o)("Target Directory")),1),e.createElementVNode("p",dn,[un,e.createElementVNode("span",mn,e.toDisplayString(e.unref(t).modal.data.items.to.path),1)]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[0]||(i[0]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1}))}},pn={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",viewBox:"-40 -40 580 580"},hn=e.createElementVNode("path",{d:"M463.5 224h8.5c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2S461.9 48.1 455 55l-41.6 41.6c-87.6-86.5-228.7-86.2-315.8 1-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 224 344 224z"},null,-1),vn=[hn];function gn(a,t){return e.openBlock(),e.createElementBlock("svg",pn,[...vn])}const kn={render:gn},_n={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-0.5 rounded",viewBox:"0 0 20 20"},xn=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 0 1 0-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L11 7.414V15a1 1 0 1 1-2 0V7.414L6.707 9.707a1 1 0 0 1-1.414 0",class:"pointer-events-none","clip-rule":"evenodd"},null,-1),yn=[xn];function wn(a,t){return e.openBlock(),e.createElementBlock("svg",_n,[...yn])}const bn={render:wn},En={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",viewBox:"0 0 24 24"},Vn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1),Nn=[Vn];function Bn(a,t){return e.openBlock(),e.createElementBlock("svg",En,[...Nn])}const $n={render:Bn},Sn={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",viewBox:"0 0 20 20"},Cn=e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 0 0-1.414 0l-7 7a1 1 0 0 0 1.414 1.414L4 10.414V17a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-6.586l.293.293a1 1 0 0 0 1.414-1.414z",class:"pointer-events-none"},null,-1),Dn=[Cn];function Mn(a,t){return e.openBlock(),e.createElementBlock("svg",Sn,[...Dn])}const Tn={render:Mn},Ln={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",viewBox:"0 0 20 20"},An=e.createElementVNode("path",{d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607"},null,-1),jn=[An];function Fn(a,t){return e.openBlock(),e.createElementBlock("svg",Ln,[...jn])}const Un={render:Fn},zn={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"w-6 h-6 cursor-pointer",viewBox:"0 0 24 24"},In=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1),Rn=[In];function Hn(a,t){return e.openBlock(),e.createElementBlock("svg",zn,[...Rn])}const qn={render:Hn},On={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",viewBox:"0 0 24 24"},Pn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2"},null,-1),Gn=[Pn];function Wn(a,t){return e.openBlock(),e.createElementBlock("svg",On,[...Gn])}const ne={render:Wn},Kn={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 rounded text-slate-700 hover:bg-neutral-100 dark:fill-neutral-300 dark:hover:bg-gray-800 cursor-pointer",viewBox:"0 0 448 512"},Yn=e.createElementVNode("path",{d:"M8 256a56 56 0 1 1 112 0 56 56 0 1 1-112 0m160 0a56 56 0 1 1 112 0 56 56 0 1 1-112 0m216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112"},null,-1),Jn=[Yn];function Qn(a,t){return e.openBlock(),e.createElementBlock("svg",Kn,[...Jn])}const Xn={render:Qn},Zn={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-sm"},ea=["aria-label"],ta=["aria-label"],oa=["aria-label"],ra={class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full overflow-hidden"},na={class:"flex leading-6"},aa={key:0,class:"flex"},sa=e.createElementVNode("div",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),la={class:"relative"},ia=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),ca=["onDragover","onDragleave","onDrop","title","onClick"],da={class:"relative flex bg-white dark:bg-gray-700 justify-between items-center rounded p-1 ml-2 w-full"},ua=["placeholder"],ma={class:"z-30 absolute top-[65px] md:top-[75px] left-[90px] rounded -mx-1.5 mt-1 bg-neutral-50 dark:bg-gray-800 max-w-80 max-h-50 shadow overflow-y-auto text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600"},fa=["onDrop","onClick"],pa={class:"flex pointer-events-none"},ha={class:"inline-block w-full text-ellipsis overflow-hidden"},va={__name:"Breadcrumb",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=t.dragSelect,r=e.ref(null),u=K(0,100);e.watch(u,b=>{const y=r.value.children;let w=0,$=0,S=5,z=1;t.fs.limitBreadcrumbItems(S),e.nextTick(()=>{console.log("width updated");for(let F=y.length-1;F>=0&&!(w+y[F].offsetWidth>u.value-40);F--)w+=parseInt(y[F].offsetWidth,10),$++;$S&&($=S),t.fs.limitBreadcrumbItems($)})});const s=()=>{u.value=r.value.offsetWidth};e.onMounted(()=>{new ResizeObserver(s).observe(r.value)});const i=(b,y=null)=>{b.preventDefault(),n.isDraggingRef.value=!1,f(b),y??(y=t.fs.hiddenBreadcrumbs.length-1);let w=JSON.parse(b.dataTransfer.getData("items"));if(w.find($=>$.storage!==t.fs.adapter)){alert("Moving items between different storages is not supported yet.");return}t.modal.open(G,{items:{from:w,to:t.fs.hiddenBreadcrumbs[y]??{path:t.fs.adapter+"://"}}})},l=(b,y=null)=>{b.preventDefault(),n.isDraggingRef.value=!1,f(b),y??(y=t.fs.breadcrumbs.length-2);let w=JSON.parse(b.dataTransfer.getData("items"));if(w.find($=>$.storage!==t.fs.adapter)){alert("Moving items between different storages is not supported yet.");return}t.modal.open(G,{items:{from:w,to:t.fs.breadcrumbs[y]??{path:t.fs.adapter+"://"}}})},c=b=>{b.preventDefault(),t.fs.isGoUpAvailable()?(b.dataTransfer.dropEffect="copy",b.currentTarget.classList.add("bg-blue-200","dark:bg-slate-600")):(b.dataTransfer.dropEffect="none",b.dataTransfer.effectAllowed="none")},f=b=>{b.preventDefault(),b.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-600"),t.fs.isGoUpAvailable()&&b.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-600")},h=()=>{x(),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname}})},d=()=>{x(),!t.fs.isGoUpAvailable()||t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.parentFolderPath}})},m=b=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:b.path}}),t.fs.toggleHiddenBreadcrumbs(!1)},p=()=>{t.fs.showHiddenBreadcrumbs&&t.fs.toggleHiddenBreadcrumbs(!1)},v={mounted(b,y,w,$){b.clickOutsideEvent=function(S){b===S.target||b.contains(S.target)||y.value()},document.body.addEventListener("click",b.clickOutsideEvent)},beforeUnmount(b,y,w,$){document.body.removeEventListener("click",b.clickOutsideEvent)}},k=e.ref(null),E=()=>{t.features.includes(C.SEARCH)&&(t.fs.searchMode=!0,e.nextTick(()=>k.value.focus()))},_=K("",400);e.watch(_,b=>{t.emitter.emit("vf-toast-clear"),t.emitter.emit("vf-search-query",{newQuery:b})});const x=()=>{t.fs.searchMode=!1,_.value=""};t.emitter.on("vf-search-exit",()=>{x()});const M=()=>{_.value===""&&x()};return(b,y)=>(e.openBlock(),e.createElementBlock("div",Zn,[e.createElementVNode("span",{"aria-label":e.unref(o)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[e.createVNode(e.unref(bn),{onDragover:y[0]||(y[0]=w=>c(w)),onDragleave:y[1]||(y[1]=w=>f(w)),onDrop:y[2]||(y[2]=w=>l(w)),onClick:d,class:e.normalizeClass(e.unref(t).fs.isGoUpAvailable()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500")},null,8,["class"])],8,ea),e.unref(t).fs.loading?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(o)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[e.createVNode(e.unref($n),{onClick:y[3]||(y[3]=w=>e.unref(t).emitter.emit("vf-fetch-abort"))})],8,oa)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(o)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[e.createVNode(e.unref(kn),{onClick:h})],8,ta)),e.withDirectives(e.createElementVNode("div",ra,[e.createElementVNode("div",null,[e.createVNode(e.unref(Tn),{onDragover:y[4]||(y[4]=w=>c(w)),onDragleave:y[5]||(y[5]=w=>f(w)),onDrop:y[6]||(y[6]=w=>l(w,-1)),onClick:y[7]||(y[7]=w=>e.unref(t).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(t).fs.adapter}}))})]),e.createElementVNode("div",na,[e.unref(t).fs.hiddenBreadcrumbs.length?e.withDirectives((e.openBlock(),e.createElementBlock("div",aa,[sa,e.createElementVNode("div",la,[e.createElementVNode("span",{onDragenter:y[8]||(y[8]=w=>e.unref(t).fs.toggleHiddenBreadcrumbs(!0)),onClick:y[9]||(y[9]=w=>e.unref(t).fs.toggleHiddenBreadcrumbs()),class:"text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer"},[e.createVNode(e.unref(Xn),{class:"px-1 pointer-events-none"})],32)])])),[[v,p]]):e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"breadcrumbContainer",ref:r,class:"flex leading-6 w-full overflow-hidden",onClick:e.withModifiers(E,["self"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).fs.breadcrumbs,(w,$)=>(e.openBlock(),e.createElementBlock("div",{key:$},[ia,e.createElementVNode("span",{onDragover:S=>$===e.unref(t).fs.breadcrumbs.length-1||c(S),onDragleave:S=>$===e.unref(t).fs.breadcrumbs.length-1||f(S),onDrop:S=>$===e.unref(t).fs.breadcrumbs.length-1||l(S,$),class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer whitespace-nowrap",title:w.basename,onClick:S=>e.unref(t).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(t).fs.adapter,path:w.path}})},e.toDisplayString(w.name),41,ca)]))),128))],512),e.unref(t).fs.loading?(e.openBlock(),e.createBlock(e.unref(re),{key:0})):e.createCommentVNode("",!0)],512),[[e.vShow,!e.unref(t).fs.searchMode]]),e.withDirectives(e.createElementVNode("div",da,[e.createElementVNode("div",null,[e.createVNode(e.unref(Un))]),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:k,onKeydown:e.withKeys(x,["esc"]),onBlur:M,"onUpdate:modelValue":y[10]||(y[10]=w=>e.isRef(_)?_.value=w:null),placeholder:e.unref(o)("Search anything.."),class:"w-full pb-0 px-1 border-0 text-base ring-0 outline-0 text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,ua),[[e.vModelText,e.unref(_)]]),e.createVNode(e.unref(qn),{onClick:x})],512),[[e.vShow,e.unref(t).fs.searchMode]]),e.withDirectives(e.createElementVNode("div",ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).fs.hiddenBreadcrumbs,(w,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,onDragover:y[11]||(y[11]=S=>c(S)),onDragleave:y[12]||(y[12]=S=>f(S)),onDrop:S=>i(S,$),onClick:S=>m(w),class:"px-2 py-0.5 hover:bg-gray-400/20 cursor-pointer items-center whitespace-nowrap"},[e.createElementVNode("div",pa,[e.createElementVNode("span",null,[e.createVNode(e.unref(ne),{class:"h-5 w-5"})]),e.createTextVNode(),e.createElementVNode("span",ha,e.toDisplayString(w.name),1)])],40,fa))),128))],512),[[e.vShow,e.unref(t).fs.showHiddenBreadcrumbs]])]))}},ae=(a,t=null)=>new Date(a*1e3).toLocaleString(t??navigator.language??"en-US"),ga=["onClick"],ka={__name:"Toast",setup(a){const t=e.inject("ServiceContainer"),{getStore:o}=t.storage,n=e.ref(o("full-screen",!1)),r=e.ref([]),u=l=>l==="error"?"text-red-400 border-red-400 dark:text-red-300 dark:border-red-300":"text-lime-600 border-lime-600 dark:text-lime-300 dark:border-lime-1300",s=l=>{r.value.splice(l,1)},i=l=>{let c=r.value.findIndex(f=>f.id===l);c!==-1&&s(c)};return t.emitter.on("vf-toast-clear",()=>{r.value=[]}),t.emitter.on("vf-toast-push",l=>{let c=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");l.id=c,r.value.push(l),setTimeout(()=>{i(c)},5e3)}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.value.value?"fixed":"absolute","max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(f,h)=>(e.openBlock(),e.createElementBlock("div",{onClick:d=>s(h),key:f,class:e.normalizeClass([u(f.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 dark:bg-gray-600 border text-xs sm:text-sm rounded cursor-pointer"])},e.toDisplayString(f.label),11,ga))),128))]),_:1})],2))}},_a={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 20 20"},xa=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414","clip-rule":"evenodd"},null,-1),ya=[xa];function wa(a,t){return e.openBlock(),e.createElementBlock("svg",_a,[...ya])}const ba={render:wa},Ea={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 20 20"},Va=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 0 1-1.414 0L10 9.414l-3.293 3.293a1 1 0 0 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414","clip-rule":"evenodd"},null,-1),Na=[Va];function Ba(a,t){return e.openBlock(),e.createElementBlock("svg",Ea,[...Na])}const $a={render:Ba},I={__name:"SortIcon",props:{direction:String},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[a.direction==="asc"?(e.openBlock(),e.createBlock(e.unref(ba),{key:0})):e.createCommentVNode("",!0),a.direction==="desc"?(e.openBlock(),e.createBlock(e.unref($a),{key:1})):e.createCommentVNode("",!0)]))}},Sa={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"text-neutral-500",viewBox:"0 0 24 24"},Ca=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1),Da=[Ca];function Ma(a,t){return e.openBlock(),e.createElementBlock("svg",Sa,[...Da])}const Ta={render:Ma},q={__name:"ItemIcon",props:{type:{type:String,required:!0},small:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("span",null,[a.type==="dir"?(e.openBlock(),e.createBlock(e.unref(ne),{key:0,class:e.normalizeClass({"h-5 w-5":a.small,"h-10 w-10 md:h-12 md:w-12 m-auto":!a.small})},null,8,["class"])):(e.openBlock(),e.createBlock(e.unref(Ta),{key:1,class:e.normalizeClass({"h-5 w-5":a.small,"h-10 w-10 md:h-12 md:w-12 m-auto":!a.small})},null,8,["class"]))]))}},La={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"absolute h-6 w-6 md:h-12 md:w-12 m-auto stroke-neutral-500 fill-white dark:fill-gray-700 dark:stroke-gray-600 z-10",viewBox:"0 0 24 24"},Aa=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1),ja=[Aa];function Fa(a,t){return e.openBlock(),e.createElementBlock("svg",La,[...ja])}const Ua={render:Fa},za={class:"absolute -z-50 -top-96"},Ia={class:"text-neutral-700 dark:text-neutral-300 p-1 absolute text-center top-4 right-[-2rem] md:top-5 md:right-[-2.4rem] z-20 text-xs"},Ra={__name:"DragItem",props:{count:{type:Number,default:0}},setup(a){const t=a;return(o,n)=>(e.openBlock(),e.createElementBlock("div",za,[e.createVNode(e.unref(Ua)),e.createElementVNode("div",Ia,e.toDisplayString(t.count),1)]))}},Ha={class:"flex"},qa=["aria-label"],Oa={class:"ml-auto mb-2"},Pa={key:0,class:"p-2 border font-normal whitespace-pre-wrap border-gray-200 dark:border-gray-700/50 dark:text-gray-200 rounded min-h-[200px] max-h-[60vh] text-xs overflow-auto"},Ga={key:1},Wa={__name:"Text",emits:["success"],setup(a,{emit:t}){const o=t,n=e.ref(""),r=e.ref(""),u=e.ref(null),s=e.ref(!1),i=e.ref(""),l=e.ref(!1),c=e.inject("ServiceContainer"),{t:f}=c.i18n;e.onMounted(()=>{c.requester.send({url:"",method:"get",params:{q:"preview",adapter:c.modal.data.adapter,path:c.modal.data.item.path},responseType:"text"}).then(m=>{n.value=m,o("success")})});const h=()=>{s.value=!s.value,r.value=n.value,s.value==!0&&e.nextTick(()=>{u.value.focus()})},d=()=>{i.value="",l.value=!1,c.requester.send({url:"",method:"post",params:{q:"save",adapter:c.modal.data.adapter,path:c.modal.data.item.path},body:{content:r.value},responseType:"text"}).then(m=>{i.value=f("Updated."),n.value=m,o("success"),s.value=!s.value}).catch(m=>{i.value=f(m.message),l.value=!0})};return(m,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ha,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(c).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(c).modal.data.item.basename),9,qa),e.createElementVNode("div",Oa,[s.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(f)("Save")),1)):e.createCommentVNode("",!0),e.unref(c).features.includes(e.unref(C).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:p[0]||(p[0]=v=>h())},e.toDisplayString(s.value?e.unref(f)("Cancel"):e.unref(f)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[s.value?(e.openBlock(),e.createElementBlock("div",Ga,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:u,"onUpdate:modelValue":p[1]||(p[1]=v=>r.value=v),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] max-h-[60vh] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,r.value]])])):(e.openBlock(),e.createElementBlock("pre",Pa,e.toDisplayString(n.value),1)),i.value.length?(e.openBlock(),e.createBlock(L,{key:2,onHidden:p[2]||(p[2]=v=>i.value=""),error:l.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},Ka={class:"flex"},Ya=["aria-label"],Ja={class:"ml-auto mb-2"},Qa={class:"w-full flex justify-center"},Xa=["src"],Za={__name:"Image",emits:["success"],setup(a,{emit:t}){const o=t,n=e.inject("ServiceContainer"),{t:r}=n.i18n,u=e.ref(null),s=e.ref(null),i=e.ref(!1),l=e.ref(""),c=e.ref(!1),f=()=>{i.value=!i.value,i.value?s.value=new he(u.value,{crop(d){}}):s.value.destroy()},h=()=>{s.value.getCroppedCanvas({width:795,height:341}).toBlob(d=>{l.value="",c.value=!1;const m=new FormData;m.set("file",d),n.requester.send({url:"",method:"post",params:{q:"upload",adapter:n.modal.data.adapter,path:n.modal.data.item.path},body:m}).then(p=>{l.value=r("Updated."),u.value.src=n.requester.getPreviewUrl(n.modal.data.adapter,n.modal.data.item),f(),o("success")}).catch(p=>{l.value=r(p.message),c.value=!0})})};return e.onMounted(()=>{o("success")}),(d,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ka,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(n).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(n).modal.data.item.basename),9,Ya),e.createElementVNode("div",Ja,[i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:h,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(r)("Crop")),1)):e.createCommentVNode("",!0),e.unref(n).features.includes(e.unref(C).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:m[0]||(m[0]=p=>f())},e.toDisplayString(i.value?e.unref(r)("Cancel"):e.unref(r)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Qa,[e.createElementVNode("img",{ref_key:"image",ref:u,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(n).requester.getPreviewUrl(e.unref(n).modal.data.adapter,e.unref(n).modal.data.item),alt:""},null,8,Xa)]),l.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:m[1]||(m[1]=p=>l.value=""),error:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},es={class:"flex"},ts=["aria-label"],os=e.createElementVNode("div",null,null,-1),rs={__name:"Default",emits:["success"],setup(a,{emit:t}){const o=e.inject("ServiceContainer"),n=t;return e.onMounted(()=>{n("success")}),(r,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",es,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ts)]),os],64))}},ns=["aria-label"],as={class:"w-full aspect-video",preload:"",controls:""},ss=["src"],ls={__name:"Video",emits:["success"],setup(a,{emit:t}){const o=e.inject("ServiceContainer"),n=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{n("success")}),(u,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ns),e.createElementVNode("div",null,[e.createElementVNode("video",as,[e.createElementVNode("source",{src:r(),type:"video/mp4"},null,8,ss),e.createTextVNode(" Your browser does not support the video tag. ")])])]))}},is=["aria-label"],cs={class:"w-full",controls:""},ds=["src"],us={__name:"Audio",emits:["success"],setup(a,{emit:t}){const o=t,n=e.inject("ServiceContainer"),r=()=>n.requester.getPreviewUrl(n.modal.data.adapter,n.modal.data.item);return e.onMounted(()=>{o("success")}),(u,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(n).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(n).modal.data.item.basename),9,is),e.createElementVNode("div",null,[e.createElementVNode("audio",cs,[e.createElementVNode("source",{src:r(),type:"audio/mpeg"},null,8,ds),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},ms=["aria-label"],fs=["data"],ps=["src"],hs=e.createElementVNode("p",null,[e.createTextVNode(" Your browser does not support PDFs. "),e.createElementVNode("a",{href:"https://example.com/test.pdf"},"Download the PDF"),e.createTextVNode(" . ")],-1),vs=[hs],gs={__name:"Pdf",emits:["success"],setup(a,{emit:t}){const o=e.inject("ServiceContainer"),n=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{n("success")}),(u,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ms),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:r(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:r(),width:"100%",height:"100%"},vs,8,ps)],8,fs)])],64))}},ks={class:"sm:flex sm:items-start"},_s={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},xs={key:0},ys={class:"text-gray-700 dark:text-gray-200 text-sm"},ws={key:0,class:"flex leading-5"},bs=e.createElementVNode("svg",{class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),Es={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},Vs={class:"font-bold"},Ns={class:"font-bold pl-2"},Bs={key:0,class:"text-xs text-gray-600 dark:text-gray-400"},$s=["download","href"],se={__name:"ModalPreview",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(!1),r=s=>(t.modal.data.item.mime_type??"").startsWith(s),u=t.features.includes(C.PREVIEW);return u||(n.value=!0),(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:i[6]||(i[6]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1),e.unref(t).features.includes(e.unref(C).DOWNLOAD)?(e.openBlock(),e.createElementBlock("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item),href:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item)},e.toDisplayString(e.unref(o)("Download")),9,$s)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",ks,[e.createElementVNode("div",_s,[e.unref(u)?(e.openBlock(),e.createElementBlock("div",xs,[r("text")?(e.openBlock(),e.createBlock(Wa,{key:0,onSuccess:i[0]||(i[0]=l=>n.value=!0)})):r("image")?(e.openBlock(),e.createBlock(Za,{key:1,onSuccess:i[1]||(i[1]=l=>n.value=!0)})):r("video")?(e.openBlock(),e.createBlock(ls,{key:2,onSuccess:i[2]||(i[2]=l=>n.value=!0)})):r("audio")?(e.openBlock(),e.createBlock(us,{key:3,onSuccess:i[3]||(i[3]=l=>n.value=!0)})):r("application/pdf")?(e.openBlock(),e.createBlock(gs,{key:4,onSuccess:i[4]||(i[4]=l=>n.value=!0)})):(e.openBlock(),e.createBlock(rs,{key:5,onSuccess:i[5]||(i[5]=l=>n.value=!0)}))])):e.createCommentVNode("",!0),e.createElementVNode("div",ys,[n.value===!1?(e.openBlock(),e.createElementBlock("div",ws,[bs,e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Es,[e.createElementVNode("div",null,[e.createElementVNode("span",Vs,e.toDisplayString(e.unref(o)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(t).filesize(e.unref(t).modal.data.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",Ns,e.toDisplayString(e.unref(o)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(ae)(e.unref(t).modal.data.item.last_modified)),1)])]),e.unref(t).features.includes(e.unref(C).DOWNLOAD)?(e.openBlock(),e.createElementBlock("div",Bs,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):e.createCommentVNode("",!0)]),_:1}))}},Ss=["data-type","data-item","data-index"],O={__name:"Item",props:{item:{type:Object},index:{type:Number},dragImage:{type:Object}},setup(a){const t=e.inject("ServiceContainer"),o=t.dragSelect,n=a,r=d=>{d.type==="dir"?(t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:d.path}})):t.modal.open(se,{adapter:t.fs.adapter,item:d})},u={mounted(d,m,p,v){p.props.draggable&&(d.addEventListener("dragstart",k=>s(k,m.value)),d.addEventListener("dragover",k=>l(k,m.value)),d.addEventListener("drop",k=>i(k,m.value)))},beforeUnmount(d,m,p,v){p.props.draggable&&(d.removeEventListener("dragstart",s),d.removeEventListener("dragover",l),d.removeEventListener("drop",i))}},s=(d,m)=>{if(d.altKey||d.ctrlKey||d.metaKey)return d.preventDefault(),!1;o.isDraggingRef.value=!0,d.dataTransfer.setDragImage(n.dragImage.$el,0,15),d.dataTransfer.effectAllowed="all",d.dataTransfer.dropEffect="copy",d.dataTransfer.setData("items",JSON.stringify(o.getSelected()))},i=(d,m)=>{d.preventDefault(),o.isDraggingRef.value=!1;let p=JSON.parse(d.dataTransfer.getData("items"));if(p.find(v=>v.storage!==t.fs.adapter)){alert("Moving items between different storages is not supported yet.");return}t.modal.open(G,{items:{from:p,to:m}})},l=(d,m)=>{d.preventDefault(),!m||m.type!=="dir"||o.getSelection().find(p=>p===d.currentTarget)?(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none"):d.dataTransfer.dropEffect="copy"};let c=null;const f=()=>{c&&clearTimeout(c)},h=d=>{c=setTimeout(()=>{const m=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:d.target.getBoundingClientRect().x,clientY:d.target.getBoundingClientRect().y});d.target.dispatchEvent(m)},500)};return(d,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({opacity:e.unref(o).isDraggingRef.value&&e.unref(o).getSelection().find(p=>d.$el===p)?"0.5 !important":""}),class:e.normalizeClass(["vf-item-"+e.unref(o).explorerId]),"data-type":a.item.type,key:a.item.path,"data-item":JSON.stringify(a.item),"data-index":a.index,onDblclick:m[0]||(m[0]=p=>r(a.item)),onTouchstart:m[1]||(m[1]=p=>h(p)),onTouchend:m[2]||(m[2]=p=>f()),onContextmenu:m[3]||(m[3]=e.withModifiers(p=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:p,items:e.unref(o).getSelected(),target:a.item}),["prevent"]))},[e.renderSlot(d.$slots,"default")],46,Ss)),[[u,a.item]])}},Cs={class:"relative flex-auto flex flex-col overflow-hidden"},Ds={key:0,class:"grid grid-cols-12 px-1 bg-neutral-50 dark:bg-gray-800 border-b border-neutral-300 dark:border-gray-700 text-xs select-none divide-x"},Ms={class:"relative"},Ts={class:"grid grid-cols-12 items-center"},Ls={class:"flex col-span-7 items-center"},As={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},js={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Fs={class:"grid grid-cols-12 items-center"},Us={class:"flex col-span-7 items-center"},zs={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Is={class:"col-span-2 text-center"},Rs={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap px-1 md:px-3"},Hs={class:"relative"},qs=["data-src","alt"],Os={key:2,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},Ps={class:"break-all"},Gs={__name:"Explorer",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=m=>m==null?void 0:m.substring(0,3),r=e.ref(null),u=e.ref(""),s=t.dragSelect;let i;t.emitter.on("vf-fullscreen-toggle",()=>{s.area.value.style.height=null}),t.emitter.on("vf-search-query",({newQuery:m})=>{u.value=m,m?t.emitter.emit("vf-fetch",{params:{q:"search",adapter:t.fs.adapter,path:t.fs.data.dirname,filter:m},onSuccess:p=>{p.files.length||t.emitter.emit("vf-toast-push",{label:o("No search result found.")})}}):t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname}})});const l=e.ref(!0),c=m=>{m.touches.length>1&&(l.value?(s.instance.stop(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: off")})):(s.instance.start(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: on")}),s.refreshSelection()),l.value=!l.value)},f=e.reactive({active:!1,column:"",order:""}),h=(m=!0)=>{let p=[...t.fs.data.files],v=f.column,k=f.order==="asc"?1:-1;if(!m)return p;const E=(_,x)=>typeof _=="string"&&typeof x=="string"?_.toLowerCase().localeCompare(x.toLowerCase()):_x?1:0;return f.active&&(p=p.slice().sort((_,x)=>E(_[v],x[v])*k)),p},d=m=>{f.active&&f.column===m?(f.active=f.order==="asc",f.column=m,f.order="desc"):(f.active=!0,f.column=m,f.order="asc")};return e.onMounted(()=>{i=new pe(s.area.value)}),e.onUpdated(()=>{i.update()}),e.onBeforeUnmount(()=>{i.destroy()}),(m,p)=>(e.openBlock(),e.createElementBlock("div",Cs,[e.unref(t).view==="list"||u.value.length?(e.openBlock(),e.createElementBlock("div",Ds,[e.createElementVNode("div",{onClick:p[0]||(p[0]=v=>d("basename")),class:"col-span-7 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Name"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="basename"]])]),u.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:p[1]||(p[1]=v=>d("file_size")),class:"justify-center col-span-2 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Size"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="file_size"]])])),u.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:p[2]||(p[2]=v=>d("last_modified")),class:"justify-center col-span-3 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Date"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="last_modified"]])])),u.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:p[3]||(p[3]=v=>d("path")),class:"justify-center col-span-5 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Filepath"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ms,[e.createVNode(Ra,{ref_key:"dragImage",ref:r,count:e.unref(s).getCount()},null,8,["count"])]),e.createElementVNode("div",{ref:e.unref(s).area,class:e.normalizeClass([e.unref(t).fullScreen?"":"resize-y","h-full w-full text-xs vf-selector-area vf-scrollbar min-h-[150px] overflow-auto p-1 z-0"]),onTouchstart:c,onContextmenu:p[4]||(p[4]=e.withModifiers(v=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:v,items:e.unref(s).getSelected()}),["self","prevent"]))},[u.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h(),(v,k)=>(e.openBlock(),e.createBlock(O,{item:v,index:k,dragImage:r.value,class:"vf-item vf-item-list"},{default:e.withCtx(()=>[e.createElementVNode("div",Ts,[e.createElementVNode("div",Ls,[e.createVNode(q,{type:v.type,small:e.unref(t).compactListView},null,8,["type","small"]),e.createElementVNode("span",As,e.toDisplayString(v.basename),1)]),e.createElementVNode("div",js,e.toDisplayString(v.path),1)])]),_:2},1032,["item","index","dragImage"]))),256)):e.createCommentVNode("",!0),e.unref(t).view==="list"&&!u.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(h(),(v,k)=>(e.openBlock(),e.createBlock(O,{item:v,index:k,dragImage:r.value,class:"vf-item vf-item-list",draggable:"true"},{default:e.withCtx(()=>[e.createElementVNode("div",Fs,[e.createElementVNode("div",Us,[e.createVNode(q,{type:v.type,small:e.unref(t).compactListView},null,8,["type","small"]),e.createElementVNode("span",zs,e.toDisplayString(v.basename),1)]),e.createElementVNode("div",Is,e.toDisplayString(v.file_size?e.unref(t).filesize(v.file_size):""),1),e.createElementVNode("div",Rs,e.toDisplayString(e.unref(ae)(v.last_modified)),1)])]),_:2},1032,["item","index","dragImage"]))),256)):e.createCommentVNode("",!0),e.unref(t).view==="grid"&&!u.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h(!1),(v,k)=>(e.openBlock(),e.createBlock(O,{item:v,index:k,dragImage:r.value,class:"vf-item vf-item-grid",draggable:"true"},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("div",Hs,[(v.mime_type??"").startsWith("image")&&e.unref(t).showThumbnails?(e.openBlock(),e.createElementBlock("img",{src:"data:image/png;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(t).requester.getPreviewUrl(e.unref(t).fs.adapter,v),alt:v.basename,key:v.path},null,8,qs)):(e.openBlock(),e.createBlock(q,{key:1,type:v.type},null,8,["type"])),!((v.mime_type??"").startsWith("image")&&e.unref(t).showThumbnails)&&v.type!=="dir"?(e.openBlock(),e.createElementBlock("div",Os,e.toDisplayString(n(v.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",Ps,e.toDisplayString(e.unref(P)(v.basename)),1)])]),_:2},1032,["item","index","dragImage"]))),256)):e.createCommentVNode("",!0)],34),e.createVNode(ka)]))}},Ws=["href","download"],Ks=["onClick"],Ys={__name:"ContextMenu",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(null),r=e.ref([]),u=e.ref(""),s=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),i=e.computed(()=>s.items.filter(h=>h.key==null||t.features.includes(h.key)));t.emitter.on("vf-context-selected",h=>{r.value=h});const l={newfolder:{key:C.NEW_FOLDER,title:()=>o("New Folder"),action:()=>t.modal.open(X)},delete:{key:C.DELETE,title:()=>o("Delete"),action:()=>{t.modal.open(ee,{items:r})}},refresh:{title:()=>o("Refresh"),action:()=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname}})}},preview:{key:C.PREVIEW,title:()=>o("Preview"),action:()=>t.modal.open(se,{adapter:t.fs.adapter,item:r.value[0]})},open:{title:()=>o("Open"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:r.value[0].path}})}},openDir:{title:()=>o("Open containing folder"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:r.value[0].dir}})}},download:{key:C.DOWNLOAD,link:e.computed(()=>t.requester.getDownloadUrl(t.fs.adapter,r.value[0])),title:()=>o("Download"),action:()=>{}},archive:{key:C.ARCHIVE,title:()=>o("Archive"),action:()=>t.modal.open(oe,{items:r})},unarchive:{key:C.UNARCHIVE,title:()=>o("Unarchive"),action:()=>t.modal.open(te,{items:r})},rename:{key:C.RENAME,title:()=>o("Rename"),action:()=>t.modal.open(Z,{items:r})}},c=h=>{t.emitter.emit("vf-contextmenu-hide"),h.action()};t.emitter.on("vf-search-query",({newQuery:h})=>{u.value=h}),t.emitter.on("vf-contextmenu-show",({event:h,items:d,target:m=null})=>{if(s.items=[],u.value)if(m)s.items.push(l.openDir),t.emitter.emit("vf-context-selected",[m]);else return;else!m&&!u.value?(s.items.push(l.refresh),s.items.push(l.newfolder),t.emitter.emit("vf-context-selected",[])):d.length>1&&d.some(p=>p.path===m.path)?(s.items.push(l.refresh),s.items.push(l.archive),s.items.push(l.delete),t.emitter.emit("vf-context-selected",d)):(m.type==="dir"?s.items.push(l.open):(s.items.push(l.preview),s.items.push(l.download)),s.items.push(l.rename),m.mime_type==="application/zip"?s.items.push(l.unarchive):s.items.push(l.archive),s.items.push(l.delete),t.emitter.emit("vf-context-selected",[m]));f(h)}),t.emitter.on("vf-contextmenu-hide",()=>{s.active=!1});const f=h=>{const d=t.dragSelect.area.value,m=t.root.getBoundingClientRect(),p=d.getBoundingClientRect();let v=h.clientX-m.left,k=h.clientY-m.top;s.active=!0,e.nextTick(()=>{var M;const E=(M=n.value)==null?void 0:M.getBoundingClientRect();let _=(E==null?void 0:E.height)??0,x=(E==null?void 0:E.width)??0;v=p.right-h.pageX+window.scrollXe.withDirectives((e.openBlock(),e.createElementBlock("ul",{ref_key:"contextmenu",ref:n,style:e.normalizeStyle(s.positions),class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded-sm select-none"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,m=>(e.openBlock(),e.createElementBlock("li",{class:"cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:m.title},[m.link?(e.openBlock(),e.createElementBlock("a",{key:0,class:"block pl-2 pr-3 py-2",target:"_blank",href:m.link,download:m.link,onClick:d[0]||(d[0]=p=>e.unref(t).emitter.emit("vf-contextmenu-hide"))},[e.createElementVNode("span",null,e.toDisplayString(m.title()),1)],8,Ws)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"pl-2 pr-3 py-1.5",onClick:p=>c(m)},[e.createElementVNode("span",null,e.toDisplayString(m.title()),1)],8,Ks))]))),128))],4)),[[e.vShow,s.active]])}},Js=(a,t)=>{const o=a.__vccOpts||a;for(const[n,r]of t)o[n]=r;return o},Qs={props:{on:{type:String,required:!0}},setup(a,{emit:t,slots:o}){const n=e.inject("ServiceContainer"),r=e.ref(!1),{t:u}=n.i18n;let s=null;const i=()=>{clearTimeout(s),r.value=!0,s=setTimeout(()=>{r.value=!1},2e3)};return e.onMounted(()=>{n.emitter.on(a.on,i)}),e.onUnmounted(()=>{clearTimeout(s)}),{shown:r,t:u}}},Xs={key:1};function Zs(a,t,o,n,r,u){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-sm text-green-600 dark:text-green-600 transition-opacity duration-500 ease-out",[{"opacity-0":!n.shown}]])},[a.$slots.default?e.renderSlot(a.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("span",Xs,e.toDisplayString(n.t("Saved.")),1))],2)}const U=Js(Qs,[["render",Zs]]),el={class:"sm:flex sm:items-start"},tl=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])],-1),ol={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},rl={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},nl={class:"mt-2"},al={class:"text-sm text-gray-500"},sl={class:"text-sm font-semibold mt-5 text-gray-900 dark:text-gray-400 tracking-wider"},ll={class:"mt-3 text-left"},il={class:"space-y-2"},cl={class:"flex relative gap-x-3"},dl={class:"h-6 items-center"},ul={class:"flex-1 block text-sm"},ml={for:"metric_unit",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},fl={class:"flex relative gap-x-3"},pl={class:"h-6 items-center"},hl={class:"flex-1 block text-sm"},vl={for:"large_icons",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},gl={class:"flex relative gap-x-3"},kl={class:"h-6 items-center"},_l={class:"flex-1 block text-sm"},xl={for:"persist_path",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},yl={class:"flex relative gap-x-3"},wl={class:"h-6 items-center"},bl={class:"flex-1 block text-sm"},El={for:"show_thumbnails",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},Vl={class:"flex relative gap-x-3"},Nl={class:"h-6 items-center"},Bl={for:"theme",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm"},$l={class:"flex text-sm"},Sl=["label"],Cl=["value"],Dl={key:0,class:"flex relative gap-x-3"},Ml={class:"h-6 items-center"},Tl={for:"language",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm text-nowrap"},Ll={class:"flex text-sm"},Al=["label"],jl=["value"],Fl={__name:"ModalAbout",setup(a){const t=e.inject("ServiceContainer"),{setStore:o,clearStore:n}=t.storage,{t:r,changeLocale:u,locale:s}=t.i18n,i=async()=>{n(),location.reload()},l=E=>{t.theme.set(E),t.emitter.emit("vf-theme-saved")},c=()=>{t.metricUnits=!t.metricUnits,t.filesize=t.metricUnits?Q:J,o("metricUnits",t.metricUnits),t.emitter.emit("vf-metric-units-saved")},f=()=>{t.compactListView=!t.compactListView,o("compactListView",t.compactListView),t.emitter.emit("vf-compact-view-saved")},h=()=>{t.showThumbnails=!t.showThumbnails,o("show-thumbnails",t.showThumbnails),t.emitter.emit("vf-show-thumbnails-saved")},d=()=>{t.persist=!t.persist,o("persist-path",t.persist),t.emitter.emit("vf-persist-path-saved")},{i18n:m}=e.inject("VueFinderOptions"),v=Object.fromEntries(Object.entries({en:"English",fr:"French (Français)",de:"German (Deutsch)",fa:"Persian (فارسی)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",ru:"Russian (Pусский)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)",zhCN:"Simplified Chinese (简体中文)",zhTW:"Traditional Chinese (繁體中文)"}).filter(([E])=>Object.keys(m).includes(E))),k=e.computed(()=>({system:r("System"),light:r("Light"),dark:r("Dark")}));return(E,_)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:_[8]||(_[8]=x=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(r)("Close")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",el,[tl,e.createElementVNode("div",ol,[e.createElementVNode("h3",rl,e.toDisplayString(e.unref(r)("About %s","Vuefinder "+e.unref(t).version)),1),e.createElementVNode("div",nl,[e.createElementVNode("p",al,e.toDisplayString(e.unref(r)("Vuefinder is a file manager component for vue 3.")),1),e.createElementVNode("div",null,[e.createElementVNode("h3",sl,e.toDisplayString(e.unref(r)("Settings")),1)]),e.createElementVNode("div",ll,[e.createElementVNode("fieldset",null,[e.createElementVNode("div",il,[e.createElementVNode("div",cl,[e.createElementVNode("div",dl,[e.withDirectives(e.createElementVNode("input",{id:"metric_unit",name:"metric_unit",type:"checkbox","onUpdate:modelValue":_[0]||(_[0]=x=>e.unref(t).metricUnits=x),onClick:c,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).metricUnits]])]),e.createElementVNode("div",ul,[e.createElementVNode("label",ml,[e.createTextVNode(e.toDisplayString(e.unref(r)("Use Metric Units"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-metric-units-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",fl,[e.createElementVNode("div",pl,[e.withDirectives(e.createElementVNode("input",{id:"large_icons",name:"large_icons",type:"checkbox","onUpdate:modelValue":_[1]||(_[1]=x=>e.unref(t).compactListView=x),onClick:f,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).compactListView]])]),e.createElementVNode("div",hl,[e.createElementVNode("label",vl,[e.createTextVNode(e.toDisplayString(e.unref(r)("Compact list view"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-compact-view-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",gl,[e.createElementVNode("div",kl,[e.withDirectives(e.createElementVNode("input",{id:"persist_path",name:"persist_path",type:"checkbox","onUpdate:modelValue":_[2]||(_[2]=x=>e.unref(t).persist=x),onClick:d,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).persist]])]),e.createElementVNode("div",_l,[e.createElementVNode("label",xl,[e.createTextVNode(e.toDisplayString(e.unref(r)("Persist path on reload"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-persist-path-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",yl,[e.createElementVNode("div",wl,[e.withDirectives(e.createElementVNode("input",{id:"show_thumbnails",name:"show_thumbnails",type:"checkbox","onUpdate:modelValue":_[3]||(_[3]=x=>e.unref(t).showThumbnails=x),onClick:h,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).showThumbnails]])]),e.createElementVNode("div",bl,[e.createElementVNode("label",El,[e.createTextVNode(e.toDisplayString(e.unref(r)("Show thumbnails"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-show-thumbnails-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",Vl,[e.createElementVNode("div",Nl,[e.createElementVNode("label",Bl,e.toDisplayString(e.unref(r)("Theme")),1)]),e.createElementVNode("div",$l,[e.withDirectives(e.createElementVNode("select",{id:"theme","onUpdate:modelValue":_[4]||(_[4]=x=>e.unref(t).theme.value=x),onChange:_[5]||(_[5]=x=>l(x.target.value)),class:"flex-shrink-0 w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(r)("Theme")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(x,M)=>(e.openBlock(),e.createElementBlock("option",{value:M},e.toDisplayString(x),9,Cl))),256))],8,Sl)],544),[[e.vModelSelect,e.unref(t).theme.value]]),e.createVNode(U,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-theme-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])]),e.unref(t).features.includes(e.unref(C).LANGUAGE)&&Object.keys(e.unref(v)).length>1?(e.openBlock(),e.createElementBlock("div",Dl,[e.createElementVNode("div",Ml,[e.createElementVNode("label",Tl,e.toDisplayString(e.unref(r)("Language")),1)]),e.createElementVNode("div",Ll,[e.withDirectives(e.createElementVNode("select",{id:"language","onUpdate:modelValue":_[6]||(_[6]=x=>e.isRef(s)?s.value=x:null),onChange:_[7]||(_[7]=x=>e.unref(u)(x.target.value)),class:"flex-shrink-0 w-1/2 sm:w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(r)("Language")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(x,M)=>(e.openBlock(),e.createElementBlock("option",{value:M},e.toDisplayString(x),9,jl))),256))],8,Al)],544),[[e.vModelSelect,e.unref(s)]]),e.createVNode(U,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-language-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:i,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(r)("Reset Settings")),1)])])])])])])]),_:1}))}},Ul={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"h-5 w-5",viewBox:"0 0 24 24"},zl=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},null,-1),Il=[zl];function Rl(a,t){return e.openBlock(),e.createElementBlock("svg",Ul,[...Il])}const Hl={render:Rl},ql={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"2",class:"h-5 w-5 stroke-slate-500 cursor-pointer",viewBox:"0 0 24 24"},Ol=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0"},null,-1),Pl=[Ol];function Gl(a,t){return e.openBlock(),e.createElementBlock("svg",ql,[...Pl])}const Wl={render:Gl},Kl={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Yl={class:"flex leading-5 items-center"},Jl=["aria-label"],Ql=["value"],Xl={class:"ml-3"},Zl={key:0},ei={class:"ml-1"},ti={class:"flex leading-5 items-center justify-end"},oi=["disabled"],ri=["aria-label"],ni={__name:"Statusbar",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,{setStore:n}=t.storage,r=t.dragSelect,u=()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter}}),n("adapter",t.fs.adapter)},s=e.ref("");t.emitter.on("vf-search-query",({newQuery:l})=>{s.value=l});const i=e.computed(()=>{const l=t.selectButton.multiple?r.getSelected().length>0:r.getSelected().length===1;return t.selectButton.active&&l});return(l,c)=>(e.openBlock(),e.createElementBlock("div",Kl,[e.createElementVNode("div",Yl,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(o)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},[e.createVNode(e.unref(Hl))],8,Jl),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":c[0]||(c[0]=f=>e.unref(t).fs.adapter=f),onChange:u,class:"py-0.5 text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).fs.data.storages,f=>(e.openBlock(),e.createElementBlock("option",{value:f},e.toDisplayString(f),9,Ql))),256))],544),[[e.vModelSelect,e.unref(t).fs.adapter]]),e.createElementVNode("div",Xl,[s.value.length?(e.openBlock(),e.createElementBlock("span",Zl,e.toDisplayString(e.unref(t).fs.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",ei,e.toDisplayString(e.unref(t).dragSelect.getCount()>0?e.unref(o)("%s item(s) selected.",e.unref(t).dragSelect.getCount()):""),1)])]),e.createElementVNode("div",ti,[e.unref(t).selectButton.active?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vf-btn py-0 vf-btn-primary",{disabled:!i.value}]),disabled:!i.value,onClick:c[1]||(c[1]=f=>e.unref(t).selectButton.click(e.unref(r).getSelected(),f))},e.toDisplayString(e.unref(o)("Select")),11,oi)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(o)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:c[2]||(c[2]=f=>e.unref(t).modal.open(Fl))},[e.createVNode(e.unref(Wl))],8,ri)])]))}},ai={__name:"VueFinder",props:{id:{type:String,default:"vf"},request:{type:[String,Object],required:!0},persist:{type:Boolean,default:!1},path:{type:String,default:"."},features:{type:[Array,Boolean],default:!0},debug:{type:Boolean,default:!1},theme:{type:String,default:"system"},locale:{type:String,default:null},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},fullScreen:{type:Boolean,default:!1},showThumbnails:{type:Boolean,default:!0},selectButton:{type:Object,default(a){return{active:!1,multiple:!1,click:t=>{},...a}}}},emits:["select"],setup(a,{emit:t}){const o=t,r=$e(a,e.inject("VueFinderOptions"));e.provide("ServiceContainer",r);const{setStore:u}=r.storage,s=e.ref(null);r.root=s;const i=r.dragSelect,l=f=>{Object.assign(r.fs.data,f),i.clearSelection(),i.refreshSelection()};let c;return r.emitter.on("vf-fetch-abort",()=>{c.abort(),r.fs.loading=!1}),r.emitter.on("vf-fetch",({params:f,body:h=null,onSuccess:d=null,onError:m=null,noCloseModal:p=!1})=>{["index","search"].includes(f.q)&&(c&&c.abort(),r.fs.loading=!0),c=new AbortController;const v=c.signal;r.requester.send({url:"",method:f.m||"get",params:f,body:h,abortSignal:v}).then(k=>{r.fs.adapter=k.adapter,r.persist&&(r.fs.path=k.dirname,u("path",r.fs.path)),["index","search"].includes(f.q)&&(r.fs.loading=!1),p||r.modal.close(),l(k),d&&d(k)}).catch(k=>{console.error(k),m&&m(k)})}),e.onMounted(()=>{let f={};r.fs.path.includes("://")&&(f={adapter:r.fs.path.split("://")[0],path:r.fs.path}),r.emitter.emit("vf-fetch",{params:{q:"index",adapter:r.fs.adapter,...f}}),i.onSelect(h=>{o("select",h)})}),(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:"vuefinder",ref_key:"root",ref:s},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).theme.actualValue)},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r).fullScreen?"fixed w-screen inset-0 z-20":"relative rounded","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 select-none"]),style:e.normalizeStyle(e.unref(r).fullScreen?"":"max-height: "+a.maxHeight),onMousedown:h[0]||(h[0]=d=>e.unref(r).emitter.emit("vf-contextmenu-hide")),onTouchstart:h[1]||(h[1]=d=>e.unref(r).emitter.emit("vf-contextmenu-hide"))},[e.createVNode(Gr),e.createVNode(va),e.createVNode(Gs),e.createVNode(ni)],38),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r).modal.visible?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r).modal.type),{key:0})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Ys)],2)],512))}},si={install(a,t={}){t.i18n=t.i18n??{};let[o]=Object.keys(t.i18n);t.locale=t.locale??o??"en",a.provide("VueFinderOptions",t),a.component("VueFinder",ai)}};module.exports=si; +"use strict";var ie=Object.defineProperty;var ce=(a,t,o)=>t in a?ie(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o;var W=(a,t,o)=>(ce(a,typeof t!="symbol"?t+"":t,o),o);const e=require("vue"),de=require("mitt"),ue=require("dragselect"),me=require("@uppy/core"),fe=require("@uppy/xhr-upload"),pe=require("vanilla-lazyload");require("cropperjs/dist/cropper.css");const he=require("cropperjs");require("microtip/microtip.css");var Y;const H=(Y=document.querySelector('meta[name="csrf-token"]'))==null?void 0:Y.getAttribute("content");class ve{constructor(t){W(this,"config");this.config=t}get config(){return this.config}transformRequestParams(t){const o=this.config,n={};H!=null&&H!==""&&(n[o.xsrfHeaderName]=H);const r=Object.assign({},o.headers,n,t.headers),u=Object.assign({},o.params,t.params),s=t.body,i=o.baseUrl+t.url,l=t.method;let c;l!=="get"&&(s instanceof FormData?(c=s,o.body!=null&&Object.entries(this.config.body).forEach(([h,d])=>{c.append(h,d)})):(c={...s},o.body!=null&&Object.assign(c,this.config.body)));const f={url:i,method:l,headers:r,params:u,body:c};if(o.transformRequest!=null){const h=o.transformRequest({url:i,method:l,headers:r,params:u,body:c});h.url!=null&&(f.url=h.url),h.method!=null&&(f.method=h.method),h.params!=null&&(f.params=h.params??{}),h.headers!=null&&(f.headers=h.headers??{}),h.body!=null&&(f.body=h.body)}return f}getDownloadUrl(t,o){if(o.url!=null)return o.url;const n=this.transformRequestParams({url:"",method:"get",params:{q:"download",adapter:t,path:o.path}});return n.url+"?"+new URLSearchParams(n.params).toString()}getPreviewUrl(t,o){if(o.url!=null)return o.url;const n=this.transformRequestParams({url:"",method:"get",params:{q:"preview",adapter:t,path:o.path}});return n.url+"?"+new URLSearchParams(n.params).toString()}async send(t){const o=this.transformRequestParams(t),n=t.responseType||"json",r={method:t.method,headers:o.headers,signal:t.abortSignal},u=o.url+"?"+new URLSearchParams(o.params);if(o.method!=="get"&&o.body!=null){let i;o.body instanceof FormData?i=t.body:(i=JSON.stringify(o.body),r.headers["Content-Type"]="application/json"),r.body=i}const s=await fetch(u,r);if(s.ok)return await s[n]();throw await s.json()}}function ge(a){const t={baseUrl:"",headers:{},params:{},body:{},xsrfHeaderName:"X-CSRF-Token"};return typeof a=="string"?Object.assign(t,{baseUrl:a}):Object.assign(t,a),new ve(t)}function ke(a){let t=localStorage.getItem(a+"_storage");const o=e.reactive(JSON.parse(t??"{}"));e.watch(o,n);function n(){Object.keys(o).length?localStorage.setItem(a+"_storage",JSON.stringify(o)):localStorage.removeItem(a+"_storage")}function r(l,c){o[l]=c}function u(l){delete o[l]}function s(){Object.keys(o).map(l=>u(l))}return{getStore:(l,c=null)=>o.hasOwnProperty(l)?o[l]:c,setStore:r,removeStore:u,clearStore:s}}async function _e(a,t){const o=t[a];return typeof o=="function"?(await o()).default:o}function xe(a,t,o,n){const{getStore:r,setStore:u}=a,s=e.ref({}),i=e.ref(r("locale",t)),l=(h,d=t)=>{_e(h,n).then(m=>{s.value=m,u("locale",h),i.value=h,u("translations",m),Object.values(n).length>1&&(o.emit("vf-toast-push",{label:"The language is set to "+h}),o.emit("vf-language-saved"))}).catch(m=>{d?(o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),l(d,null)):o.emit("vf-toast-push",{label:"Locale cannot be loaded!",type:"error"})})};!r("locale")&&!n.length?l(t):s.value=r("translations");const c=(h,...d)=>d.length?c(h=h.replace("%s",d.shift()),...d):h;function f(h,...d){return s.value&&s.value.hasOwnProperty(h)?c(s.value[h],...d):c(h,...d)}return{t:f,changeLocale:l,locale:i}}const C={EDIT:"edit",NEW_FILE:"newfile",NEW_FOLDER:"newfolder",PREVIEW:"preview",ARCHIVE:"archive",UNARCHIVE:"unarchive",SEARCH:"search",RENAME:"rename",UPLOAD:"upload",DELETE:"delete",FULL_SCREEN:"fullscreen",DOWNLOAD:"download",LANGUAGE:"language"},ye=Object.values(C),we="2.3.1";function J(a,t,o,n,r){return(t=Math,o=t.log,n=1024,r=o(a)/o(n)|0,a/t.pow(n,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"iB":"B")}function Q(a,t,o,n,r){return(t=Math,o=t.log,n=1e3,r=o(a)/o(n)|0,a/t.pow(n,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"B":"B")}function be(a){const t={k:1,m:2,g:3,t:4},n=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(a);return n[1]*Math.pow(1024,t[n[2].toLowerCase()])}const A={SYSTEM:"system",LIGHT:"light",DARK:"dark"};function Ee(a,t){const o=e.ref(A.SYSTEM),n=e.ref(A.LIGHT);o.value=a.getStore("theme",t??A.SYSTEM);const r=window.matchMedia("(prefers-color-scheme: dark)"),u=s=>{o.value===A.DARK||o.value===A.SYSTEM&&s.matches?n.value=A.DARK:n.value=A.LIGHT};return u(r),r.addEventListener("change",u),{value:o,actualValue:n,set(s){o.value=s,s!==A.SYSTEM?a.setStore("theme",s):a.removeStore("theme"),u(r)}}}function Ve(){const a=e.shallowRef(null),t=e.ref(!1),o=e.ref();return{visible:t,type:a,data:o,open:(u,s=null)=>{t.value=!0,a.value=u,o.value=s},close:()=>{t.value=!1,a.value=null}}}function Ne(){let a;const t=e.ref(),o=Math.floor(Math.random()*2**32),n=e.ref(!1),r=e.ref([]),u=()=>r.value,s=()=>a.getSelection(),i=()=>r.value.length,l=()=>a.clearSelection(!0),c=e.ref();function f(){a=new ue({area:t.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),a.subscribe("DS:start:pre",({items:m,event:p,isDragging:v})=>{if(v)a.Interaction._reset(p);else{const k=t.value.offsetWidth-p.offsetX,E=t.value.offsetHeight-p.offsetY;k<15&&E<15&&a.Interaction._reset(p)}}),document.addEventListener("dragleave",m=>{!m.buttons&&n.value&&(n.value=!1)})}const h=()=>e.nextTick(()=>{const m=u().map(p=>p.path);l(),a.setSettings({selectables:document.getElementsByClassName("vf-item-"+o)}),a.addSelection(a.getSelectables().filter(p=>m.includes(JSON.parse(p.dataset.item).path))),r.value=a.getSelection().map(p=>JSON.parse(p.dataset.item)),c.value(r.value)}),d=m=>{c.value=m,a.subscribe("DS:end",({items:p,event:v,isDragging:k})=>{r.value=p.map(E=>JSON.parse(E.dataset.item)),m(p.map(E=>JSON.parse(E.dataset.item)))})};return e.onMounted(()=>{f()}),e.onUnmounted(()=>{a&&a.stop()}),e.onUpdated(()=>{a&&a.Area.reset()}),{instance:a,area:t,explorerId:o,isDraggingRef:n,getSelected:u,getSelection:s,clearSelection:l,refreshSelection:h,getCount:i,onSelect:d}}function Be(a,t){const o=e.ref(a),n=e.ref(t),r=e.ref([]),u=e.ref([]),s=e.ref([]),i=e.ref(!1),l=e.ref(5);let c=!1,f=!1;const h=e.reactive({adapter:o,storages:[],dirname:n,files:[]});function d(){let _=[],x=[],M=n.value??o.value+"://";M.length===0&&(r.value=[]),M.replace(o.value+"://","").split("/").forEach(function(w){_.push(w),_.join("/")!==""&&x.push({basename:w,name:w,path:o.value+"://"+_.join("/"),type:"dir"})}),u.value=x;const[b,y]=p(x,l.value);s.value=y,r.value=b}function m(_){l.value=_,d()}function p(_,x){return _.length>x?[_.slice(-x),_.slice(0,-x)]:[_,[]]}function v(_=null){i.value=_??!i.value}function k(){return r.value&&r.value.length&&!f}const E=e.computed(()=>{var _;return((_=r.value[r.value.length-2])==null?void 0:_.path)??o.value+"://"});return e.onMounted(()=>{}),e.watch(n,d),e.onMounted(d),{adapter:o,path:n,loading:c,searchMode:f,data:h,breadcrumbs:r,breadcrumbItems:u,limitBreadcrumbItems:m,hiddenBreadcrumbs:s,showHiddenBreadcrumbs:i,toggleHiddenBreadcrumbs:v,isGoUpAvailable:k,parentFolderPath:E}}const $e=(a,t)=>{const o=ke(a.id),n=de(),r=o.getStore("metricUnits",!1),u=Ee(o,a.theme),s=t.i18n,i=a.locale??t.locale,l=o.getStore("adapter"),c=d=>Array.isArray(d)?d:ye,f=o.getStore("persist-path",a.persist),h=f?o.getStore("path",a.path):a.path;return e.reactive({version:we,root:null,debug:a.debug,emitter:n,storage:o,i18n:e.computed(()=>xe(o,i,n,s)),modal:Ve(),dragSelect:e.computed(()=>Ne()),requester:ge(a.request),features:c(a.features),view:o.getStore("viewport","grid"),fullScreen:o.getStore("full-screen",a.fullScreen),selectButton:a.selectButton,maxFileSize:a.maxFileSize,theme:u,metricUnits:r,filesize:r?Q:J,compactListView:o.getStore("compact-list-view",!0),persist:f,showThumbnails:o.getStore("show-thumbnails",a.showThumbnails),fs:Be(l,h)})},Se=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 dark:bg-gray-600 dark:bg-opacity-75 bg-opacity-75 transition-opacity"},null,-1),Ce={class:"fixed z-10 inset-0 overflow-hidden"},De={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-3xl w-full"},Me={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Te={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},T={__name:"ModalLayout",setup(a){const t=e.inject("ServiceContainer");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");setTimeout(()=>o&&o.focus(),100)}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:n[1]||(n[1]=e.withKeys(r=>e.unref(t).modal.close(),["esc"])),tabindex:"0"},[Se,e.createElementVNode("div",Ce,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:n[0]||(n[0]=e.withModifiers(r=>e.unref(t).modal.close(),["self"]))},[e.createElementVNode("div",De,[e.createElementVNode("div",Me,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Te,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},Le=["aria-label"],Ae=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),je=[Ae],L={__name:"Message",props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(a,{emit:t}){var c;const o=t,n=e.inject("ServiceContainer"),{t:r}=n.i18n,u=e.ref(!1),s=e.ref(null),i=e.ref((c=s.value)==null?void 0:c.strMessage);e.watch(i,()=>u.value=!1);const l=()=>{o("hidden"),u.value=!0};return(f,h)=>(e.openBlock(),e.createElementBlock("div",null,[u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:s,class:e.normalizeClass(["flex mt-2 p-1 px-2 rounded text-sm break-all dark:opacity-75",a.error?"bg-red-100 text-red-600 ":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(f.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:l,"aria-label":e.unref(r)("Close"),"data-microtip-position":"top-left",role:"tooltip"},je,8,Le)],2))]))}},Fe={class:"sm:flex sm:items-start"},Ue=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})])],-1),ze={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ie={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Re={class:"mt-2"},He={class:"text-sm text-gray-500"},qe=["placeholder"],X={__name:"ModalNewFolder",setup(a){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,n=e.ref(""),r=e.ref(""),u=()=>{n.value!==""&&t.emitter.emit("vf-fetch",{params:{q:"newfolder",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{name:n.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",n.value)})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:i[2]||(i[2]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Fe,[Ue,e.createElementVNode("div",ze,[e.createElementVNode("h3",Ie,e.toDisplayString(e.unref(o)("New Folder")),1),e.createElementVNode("div",Re,[e.createElementVNode("p",He,e.toDisplayString(e.unref(o)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>n.value=l),onKeyup:e.withKeys(u,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Folder Name"),type:"text"},null,40,qe),[[e.vModelText,n.value]]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[1]||(i[1]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},Oe={class:"sm:flex sm:items-start"},Pe=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),Ge={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},We={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ke={class:"mt-2"},Ye={class:"text-sm text-gray-500"},Je=["placeholder"],Qe={__name:"ModalNewFile",setup(a){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,n=e.ref(""),r=e.ref(""),u=()=>{n.value!==""&&t.emitter.emit("vf-fetch",{params:{q:"newfile",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{name:n.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",n.value)})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:i[2]||(i[2]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Oe,[Pe,e.createElementVNode("div",Ge,[e.createElementVNode("h3",We,e.toDisplayString(e.unref(o)("New File")),1),e.createElementVNode("div",Ke,[e.createElementVNode("p",Ye,e.toDisplayString(e.unref(o)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>n.value=l),onKeyup:e.withKeys(u,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("File Name"),type:"text"},null,40,Je),[[e.vModelText,n.value]]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[1]||(i[1]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},Xe={class:"sm:flex sm:items-start"},Ze=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})])],-1),et={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},tt={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ot={class:"mt-2"},rt={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},nt={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},at=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),st=[at],lt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},it=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),ct=[it],dt={class:"ml-1.5"},Z={__name:"ModalRename",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items[0]),r=e.ref(t.modal.data.items[0].basename),u=e.ref(""),s=()=>{r.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"rename",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{item:n.value.path,name:r.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is renamed.",r.value)})},onError:i=>{u.value=o(i.message)}})};return(i,l)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:l[2]||(l[2]=c=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Xe,[Ze,e.createElementVNode("div",et,[e.createElementVNode("h3",tt,e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("div",ot,[e.createElementVNode("p",rt,[n.value.type==="dir"?(e.openBlock(),e.createElementBlock("svg",nt,st)):(e.openBlock(),e.createElementBlock("svg",lt,ct)),e.createElementVNode("span",dt,e.toDisplayString(n.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),onKeyup:e.withKeys(s,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,544),[[e.vModelText,r.value]]),u.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:l[1]||(l[1]=c=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},ut={class:"sm:flex sm:items-start"},mt=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})])],-1),ft={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},pt={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ht={class:"mt-2"},vt={class:"text-sm text-gray-500"},gt={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},kt={class:"flex text-sm text-gray-800 dark:text-gray-400"},_t={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},xt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),yt=[xt],wt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},bt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Et=[bt],Vt={class:"ml-1.5"},Nt={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},ee={__name:"ModalDelete",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items),r=e.ref(""),u=()=>{n.value.length&&t.emitter.emit("vf-fetch",{params:{q:"delete",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{items:n.value.map(({path:s,type:i})=>({path:s,type:i}))},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files deleted.")})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-danger"},e.toDisplayString(e.unref(o)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:i[1]||(i[1]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",Nt,e.toDisplayString(e.unref(o)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ut,[mt,e.createElementVNode("div",ft,[e.createElementVNode("h3",pt,e.toDisplayString(e.unref(o)("Delete files")),1),e.createElementVNode("div",ht,[e.createElementVNode("p",vt,e.toDisplayString(e.unref(o)("Are you sure you want to delete these files?")),1),e.createElementVNode("div",gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,l=>(e.openBlock(),e.createElementBlock("p",kt,[l.type==="dir"?(e.openBlock(),e.createElementBlock("svg",_t,yt)):(e.openBlock(),e.createElementBlock("svg",wt,Et)),e.createElementVNode("span",Vt,e.toDisplayString(l.basename),1)]))),256))]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[0]||(i[0]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}};function P(a,t=14){let o=`((?=([\\w\\W]{0,${t}}))([\\w\\W]{${t+1},})([\\w\\W]{8,}))`;return a.replace(new RegExp(o),"$2..$4")}const Bt={class:"sm:flex sm:items-start"},$t=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})])],-1),St={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ct={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Dt={class:"mt-2"},Mt={key:0,class:"pointer-events-none"},Tt={key:1,class:"pointer-events-none"},Lt=["disabled"],At=["disabled"],jt={class:"text-gray-500 text-sm mb-1 pr-1 max-h-[200px] overflow-y-auto vf-scrollbar"},Ft={class:"rounded flex flex-shrink-0 w-6 h-6 border bg-gray-50 text-xs cursor-default dark:border-gray-700 dark:bg-gray-800 dark:text-gray-50"},Ut=["textContent"],zt={class:"ml-1 w-full h-fit"},It={class:"text-left hidden md:block"},Rt={class:"text-left md:hidden"},Ht={key:0,class:"ml-auto"},qt=["title","disabled","onClick"],Ot=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),Pt=[Ot],Gt={key:0,class:"py-2"},Wt=["disabled"],Kt={__name:"ModalUpload",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=o("uppy"),r={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10},u=e.ref({QUEUE_ENTRY_STATUS:r}),s=e.ref(null),i=e.ref(null),l=e.ref(null),c=e.ref(null),f=e.ref(null),h=e.ref(null),d=e.ref([]),m=e.ref(""),p=e.ref(!1),v=e.ref(!1);let k;function E(B){return d.value.findIndex(D=>D.id===B)}function _(B,D=null){D=D??(B.webkitRelativePath||B.name),k.addFile({name:D,type:B.type,data:B,source:"Local"})}function x(B){switch(B.status){case r.DONE:return"text-green-600";case r.ERROR:return"text-red-600";case r.CANCELED:return"text-red-600";case r.PENDING:default:return""}}const M=B=>{switch(B.status){case r.DONE:return"✓";case r.ERROR:case r.CANCELED:return"!";case r.PENDING:default:return"..."}};function b(){c.value.click()}function y(){if(!p.value){if(!d.value.filter(B=>B.status!==r.DONE).length){m.value=o("Please select file to upload first.");return}m.value="",k.retryAll(),k.upload()}}function w(){k.cancelAll({reason:"user"}),d.value.forEach(B=>{B.status!==r.DONE&&(B.status=r.CANCELED,B.statusName=o("Canceled"))}),p.value=!1}function $(B){p.value||(k.removeFile(B.id,"removed-by-user"),d.value.splice(E(B.id),1))}function S(B){if(!p.value){if(k.cancelAll({reason:"user"}),B){const D=[];d.value.forEach(g=>{g.status!==r.DONE&&D.push(g)}),d.value=[],D.forEach(g=>{_(g.originalFile,g.name)});return}d.value.splice(0)}}function z(){t.modal.close()}function F(){return t.requester.transformRequestParams({url:"",method:"post",params:{q:"upload",adapter:t.fs.adapter,path:t.fs.data.dirname}})}return e.onMounted(async()=>{k=new me({debug:t.debug,restrictions:{maxFileSize:be(t.maxFileSize)},locale:n,onBeforeFileAdded(g,V){if(V[g.id]!=null){const j=E(g.id);d.value[j].status===r.PENDING&&(m.value=k.i18n("noDuplicates",{fileName:g.name})),d.value=d.value.filter(R=>R.id!==g.id)}return d.value.push({id:g.id,name:g.name,size:t.filesize(g.size),status:r.PENDING,statusName:o("Pending upload"),percent:null,originalFile:g.data}),!0}}),k.use(fe,{endpoint:"WILL_BE_REPLACED_BEFORE_UPLOAD",limit:5,timeout:0,getResponseError(g,V){let N;try{N=JSON.parse(g).message}catch{N=o("Cannot parse server response.")}return new Error(N)}}),k.on("restriction-failed",(g,V)=>{const N=d.value[E(g.id)];$(N),m.value=V.message}),k.on("upload",()=>{const g=F();k.setMeta({...g.body});const V=k.getPlugin("XHRUpload");V.opts.method=g.method,V.opts.endpoint=g.url+"?"+new URLSearchParams(g.params),V.opts.headers=g.headers,p.value=!0,d.value.forEach(N=>{N.status!==r.DONE&&(N.percent=null,N.status=r.UPLOADING,N.statusName=o("Pending upload"))})}),k.on("upload-progress",(g,V)=>{const N=Math.floor(V.bytesUploaded/V.bytesTotal*100);d.value[E(g.id)].percent=`${N}%`}),k.on("upload-success",g=>{const V=d.value[E(g.id)];V.status=r.DONE,V.statusName=o("Done")}),k.on("upload-error",(g,V)=>{const N=d.value[E(g.id)];N.percent=null,N.status=r.ERROR,V.isNetworkError?N.statusName=o("Network Error, Unable establish connection to the server or interrupted."):N.statusName=V?V.message:o("Unknown Error")}),k.on("error",g=>{m.value=g.message,p.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname},noCloseModal:!0})}),k.on("complete",()=>{p.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname},noCloseModal:!0})}),c.value.addEventListener("click",()=>{i.value.click()}),f.value.addEventListener("click",()=>{l.value.click()}),h.value.addEventListener("dragover",g=>{g.preventDefault(),v.value=!0}),h.value.addEventListener("dragleave",g=>{g.preventDefault(),v.value=!1});function B(g,V){V.isFile&&V.file(N=>g(V,N)),V.isDirectory&&V.createReader().readEntries(N=>{N.forEach(j=>{B(g,j)})})}h.value.addEventListener("drop",g=>{g.preventDefault(),v.value=!1;const V=/^[/\\](.+)/;[...g.dataTransfer.items].forEach(N=>{N.kind==="file"&&B((j,R)=>{const le=V.exec(j.fullPath);_(R,le[1])},N.webkitGetAsEntry())})});const D=({target:g})=>{const V=g.files;for(const N of V)_(N);g.value=""};i.value.addEventListener("change",D),l.value.addEventListener("change",D)}),e.onBeforeUnmount(()=>{k==null||k.close({reason:"unmount"})}),(B,D)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["vf-btn vf-btn-primary",p.value?"bg-blue-200 hover:bg-blue-200 dark:bg-gray-700/50 dark:hover:bg-gray-700/50 dark:text-gray-500":"bg-blue-600 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-500"]),disabled:p.value,onClick:e.withModifiers(y,["prevent"])},e.toDisplayString(e.unref(o)("Upload")),11,Wt),p.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(w,["prevent"])},e.toDisplayString(e.unref(o)("Cancel")),1)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(z,["prevent"])},e.toDisplayString(e.unref(o)("Close")),1))]),default:e.withCtx(()=>[e.createElementVNode("div",Bt,[$t,e.createElementVNode("div",St,[e.createElementVNode("h3",Ct,e.toDisplayString(e.unref(o)("Upload Files")),1),e.createElementVNode("div",Dt,[e.createElementVNode("div",{ref_key:"dropArea",ref:h,class:"flex items-center justify-center text-lg mb-4 text-gray-500 border-2 border-gray-300 rounded border-dashed select-none cursor-pointer dark:border-gray-600 h-[120px]",onClick:b},[v.value?(e.openBlock(),e.createElementBlock("div",Mt,e.toDisplayString(e.unref(o)("Release to drop these files.")),1)):(e.openBlock(),e.createElementBlock("div",Tt,e.toDisplayString(e.unref(o)("Drag and drop the files/folders to here or click here.")),1))],512),e.createElementVNode("div",{ref_key:"container",ref:s,class:"text-gray-500 mb-1"},[e.createElementVNode("button",{ref_key:"pickFiles",ref:c,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Files")),513),e.createElementVNode("button",{ref_key:"pickFolders",ref:f,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Folders")),513),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:p.value,onClick:D[0]||(D[0]=g=>S(!1))},e.toDisplayString(e.unref(o)("Clear all")),9,Lt),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:p.value,onClick:D[1]||(D[1]=g=>S(!0))},e.toDisplayString(e.unref(o)("Clear only successful")),9,At)],512),e.createElementVNode("div",jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,g=>(e.openBlock(),e.createElementBlock("div",{class:"flex hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-gray-300",key:g.id},[e.createElementVNode("span",Ft,[e.createElementVNode("span",{class:e.normalizeClass(["text-base m-auto",x(g)]),textContent:e.toDisplayString(M(g))},null,10,Ut)]),e.createElementVNode("div",zt,[e.createElementVNode("div",It,e.toDisplayString(e.unref(P)(g.name,40))+" ("+e.toDisplayString(g.size)+")",1),e.createElementVNode("div",Rt,e.toDisplayString(e.unref(P)(g.name,16))+" ("+e.toDisplayString(g.size)+")",1),e.createElementVNode("div",{class:e.normalizeClass(["flex break-all text-left",x(g)])},[e.createTextVNode(e.toDisplayString(g.statusName)+" ",1),g.status===u.value.QUEUE_ENTRY_STATUS.UPLOADING?(e.openBlock(),e.createElementBlock("b",Ht,e.toDisplayString(g.percent),1)):e.createCommentVNode("",!0)],2)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["rounded w-5 h-5 border-1 text-base leading-none font-medium focus:outline-none dark:border-gray-200 dark:text-gray-400 dark:hover:text-gray-200 dark:bg-gray-600 ml-auto sm:text-xs hover:text-red-600",p.value?"disabled:bg-gray-100 text-white text-opacity-50":"bg-gray-100"]),title:e.unref(o)("Delete"),disabled:p.value,onClick:V=>$(g)},Pt,10,qt)]))),128)),d.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gt,e.toDisplayString(e.unref(o)("No files selected!")),1))]),m.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:D[2]||(D[2]=g=>m.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),e.createElementVNode("input",{ref_key:"internalFileInput",ref:i,type:"file",multiple:"",class:"hidden"},null,512),e.createElementVNode("input",{ref_key:"internalFolderInput",ref:l,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1}))}},Yt={class:"sm:flex sm:items-start"},Jt=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),Qt={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Xt={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Zt={class:"mt-2"},eo={class:"flex text-sm text-gray-800 dark:text-gray-400"},to={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},oo=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),ro=[oo],no={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ao=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),so=[ao],lo={class:"ml-1.5"},io={class:"my-1 text-sm text-gray-500"},te={__name:"ModalUnarchive",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items[0]),r=e.ref(""),u=e.ref([]),s=()=>{t.emitter.emit("vf-fetch",{params:{q:"unarchive",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{item:n.value.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file unarchived.")})},onError:i=>{r.value=o(i.message)}})};return(i,l)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:l[1]||(l[1]=c=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Yt,[Jt,e.createElementVNode("div",Qt,[e.createElementVNode("h3",Xt,e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("div",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,c=>(e.openBlock(),e.createElementBlock("p",eo,[c.type==="dir"?(e.openBlock(),e.createElementBlock("svg",to,ro)):(e.openBlock(),e.createElementBlock("svg",no,so)),e.createElementVNode("span",lo,e.toDisplayString(c.basename),1)]))),256)),e.createElementVNode("p",io,e.toDisplayString(e.unref(o)("The archive will be unarchived at"))+" ("+e.toDisplayString(e.unref(t).fs.data.dirname)+")",1),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:l[0]||(l[0]=c=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},co={class:"sm:flex sm:items-start"},uo=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),mo={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},fo={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},po={class:"mt-2"},ho={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},vo={class:"flex text-sm text-gray-800 dark:text-gray-400"},go={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ko=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),_o=[ko],xo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},yo=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),wo=[yo],bo={class:"ml-1.5"},Eo=["placeholder"],oe={__name:"ModalArchive",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(""),r=e.ref(""),u=e.ref(t.modal.data.items),s=()=>{u.value.length&&t.emitter.emit("vf-fetch",{params:{q:"archive",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{items:u.value.map(({path:i,type:l})=>({path:i,type:l})),name:n.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file(s) archived.")})},onError:i=>{r.value=o(i.message)}})};return(i,l)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:l[2]||(l[2]=c=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",co,[uo,e.createElementVNode("div",mo,[e.createElementVNode("h3",fo,e.toDisplayString(e.unref(o)("Archive the files")),1),e.createElementVNode("div",po,[e.createElementVNode("div",ho,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,c=>(e.openBlock(),e.createElementBlock("p",vo,[c.type==="dir"?(e.openBlock(),e.createElementBlock("svg",go,_o)):(e.openBlock(),e.createElementBlock("svg",xo,wo)),e.createElementVNode("span",bo,e.toDisplayString(c.basename),1)]))),256))]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>n.value=c),onKeyup:e.withKeys(s,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Archive name. (.zip file will be created)"),type:"text"},null,40,Eo),[[e.vModelText,n.value]]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:l[1]||(l[1]=c=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}},Vo={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},No=e.createElementVNode("path",{d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44z"},null,-1),Bo=[No];function $o(a,t){return e.openBlock(),e.createElementBlock("svg",Vo,[...Bo])}const So={render:$o},Co={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},Do=e.createElementVNode("path",{d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"},null,-1),Mo=[Do];function To(a,t){return e.openBlock(),e.createElementBlock("svg",Co,[...Mo])}const Lo={render:To},Ao={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},jo=e.createElementVNode("path",{d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"},null,-1),Fo=[jo];function Uo(a,t){return e.openBlock(),e.createElementBlock("svg",Ao,[...Fo])}const zo={render:Uo},Io={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},Ro=e.createElementVNode("path",{d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21q.512.078 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48 48 0 0 0-3.478-.397m-12 .562q.51-.089 1.022-.165m0 0a48 48 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a52 52 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a49 49 0 0 0-7.5 0"},null,-1),Ho=[Ro];function qo(a,t){return e.openBlock(),e.createElementBlock("svg",Io,[...Ho])}const Oo={render:qo},Po={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},Go=e.createElementVNode("path",{d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"},null,-1),Wo=[Go];function Ko(a,t){return e.openBlock(),e.createElementBlock("svg",Po,[...Wo])}const Yo={render:Ko},Jo={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},Qo=e.createElementVNode("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1),Xo=[Qo];function Zo(a,t){return e.openBlock(),e.createElementBlock("svg",Jo,[...Xo])}const er={render:Zo},tr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},or=e.createElementVNode("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1),rr=[or];function nr(a,t){return e.openBlock(),e.createElementBlock("svg",tr,[...rr])}const ar={render:nr},sr={xmlns:"http://www.w3.org/2000/svg",fill:"none",class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",viewBox:"0 0 24 24"},lr=e.createElementVNode("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",class:"opacity-25 stroke-blue-900 dark:stroke-blue-100"},null,-1),ir=e.createElementVNode("path",{fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z",class:"opacity-75"},null,-1),cr=[lr,ir];function dr(a,t){return e.openBlock(),e.createElementBlock("svg",sr,[...cr])}const re={render:dr},ur={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},mr=e.createElementVNode("path",{d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},null,-1),fr=[mr];function pr(a,t){return e.openBlock(),e.createElementBlock("svg",ur,[...fr])}const hr={render:pr},vr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"},gr=e.createElementVNode("path",{d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"},null,-1),kr=[gr];function _r(a,t){return e.openBlock(),e.createElementBlock("svg",vr,[...kr])}const xr={render:_r},yr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},wr=e.createElementVNode("path",{d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25zm0 9.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18zM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25zm0 9.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18z"},null,-1),br=[wr];function Er(a,t){return e.openBlock(),e.createElementBlock("svg",yr,[...br])}const Vr={render:Er},Nr={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"},Br=e.createElementVNode("path",{d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75"},null,-1),$r=[Br];function Sr(a,t){return e.openBlock(),e.createElementBlock("svg",Nr,[...$r])}const Cr={render:Sr},Dr={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Mr={key:0,class:"flex text-center"},Tr=["aria-label"],Lr=["aria-label"],Ar=["aria-label"],jr=["aria-label"],Fr=["aria-label"],Ur=["aria-label"],zr=["aria-label"],Ir={key:1,class:"flex text-center"},Rr={class:"pl-2"},Hr={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},qr={class:"flex text-center items-center justify-end"},Or=["aria-label"],Pr=["aria-label"],Gr={__name:"Toolbar",setup(a){const t=e.inject("ServiceContainer"),{setStore:o}=t.storage,{t:n}=t.i18n,r=t.dragSelect,u=e.ref("");t.emitter.on("vf-search-query",({newQuery:l})=>{u.value=l});const s=()=>{t.fullScreen=!t.fullScreen,o("full-screen",t.fullScreen),t.emitter.emit("vf-fullscreen-toggle")},i=()=>{t.view=t.view==="list"?"grid":"list",r.refreshSelection(),o("viewport",t.view)};return(l,c)=>(e.openBlock(),e.createElementBlock("div",Dr,[u.value.length?(e.openBlock(),e.createElementBlock("div",Ir,[e.createElementVNode("div",Rr,[e.createTextVNode(e.toDisplayString(e.unref(n)("Search results for"))+" ",1),e.createElementVNode("span",Hr,e.toDisplayString(u.value),1)]),e.unref(t).fs.loading?(e.openBlock(),e.createBlock(e.unref(re),{key:0})):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Mr,[e.unref(t).features.includes(e.unref(C).NEW_FOLDER)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(n)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:c[0]||(c[0]=f=>e.unref(t).modal.open(X,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(So))],8,Tr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).NEW_FILE)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(n)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[1]||(c[1]=f=>e.unref(t).modal.open(Qe,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(Lo))],8,Lr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).RENAME)?(e.openBlock(),e.createElementBlock("div",{key:2,class:"mx-1.5","aria-label":e.unref(n)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[2]||(c[2]=f=>e.unref(r).getCount()!==1||e.unref(t).modal.open(Z,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(zo),{class:e.normalizeClass(e.unref(r).getCount()===1?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,Ar)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).DELETE)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"mx-1.5","aria-label":e.unref(n)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[3]||(c[3]=f=>!e.unref(r).getCount()||e.unref(t).modal.open(ee,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(Oo),{class:e.normalizeClass(e.unref(r).getCount()?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,jr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).UPLOAD)?(e.openBlock(),e.createElementBlock("div",{key:4,class:"mx-1.5","aria-label":e.unref(n)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[4]||(c[4]=f=>e.unref(t).modal.open(Kt,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(Yo))],8,Fr)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).UNARCHIVE)&&e.unref(r).getCount()===1&&e.unref(r).getSelected()[0].mime_type==="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:5,class:"mx-1.5","aria-label":e.unref(n)("Unarchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[5]||(c[5]=f=>!e.unref(r).getCount()||e.unref(t).modal.open(te,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(ar),{class:e.normalizeClass(e.unref(r).getCount()?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,Ur)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(C).ARCHIVE)?(e.openBlock(),e.createElementBlock("div",{key:6,class:"mx-1.5","aria-label":e.unref(n)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:c[6]||(c[6]=f=>!e.unref(r).getCount()||e.unref(t).modal.open(oe,{items:e.unref(r).getSelected()}))},[e.createVNode(e.unref(er),{class:e.normalizeClass(e.unref(r).getCount()?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,zr)):e.createCommentVNode("",!0)])),e.createElementVNode("div",qr,[e.unref(t).features.includes(e.unref(C).FULL_SCREEN)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:s,class:"mx-1.5","aria-label":e.unref(n)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip"},[e.unref(t).fullScreen?(e.openBlock(),e.createBlock(e.unref(xr),{key:0})):(e.openBlock(),e.createBlock(e.unref(hr),{key:1}))],8,Or)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(n)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:c[7]||(c[7]=f=>u.value.length||i())},[e.unref(t).view==="grid"?(e.openBlock(),e.createBlock(e.unref(Vr),{key:0,class:e.normalizeClass(u.value.length?"vf-toolbar-icon-disabled":"vf-toolbar-icon")},null,8,["class"])):e.createCommentVNode("",!0),e.unref(t).view==="list"?(e.openBlock(),e.createBlock(e.unref(Cr),{key:1,class:e.normalizeClass(u.value.length?"vf-toolbar-icon-disabled":"vf-toolbar-icon")},null,8,["class"])):e.createCommentVNode("",!0)],8,Pr)])]))}},Wr=(a,t=0,o=!1)=>{let n;return(...r)=>{o&&!n&&a(...r),clearTimeout(n),n=setTimeout(()=>{a(...r)},t)}},K=(a,t,o)=>{const n=e.ref(a);return e.customRef((r,u)=>({get(){return r(),n.value},set:Wr(s=>{n.value=s,u()},t,o)}))},Kr={class:"sm:flex sm:items-start"},Yr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1),Jr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Qr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Xr={class:"text-sm text-gray-500 pb-1"},Zr={class:"max-h-[200px] overflow-y-auto vf-scrollbar text-left"},en={class:"flex text-sm text-gray-800 dark:text-gray-400"},tn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},on=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),rn=[on],nn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},an=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),sn=[an],ln={class:"ml-1.5"},cn={class:"font-bold text-xs text-gray-700 dark:text-gray-500 mt-3 tracking-wider"},dn={class:"flex text-sm text-gray-800 dark:text-gray-400 border dark:border-gray-700 p-1 rounded"},un=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),mn={class:"ml-1.5 overflow-auto"},fn={class:"m-1 mr-auto font-bold text-gray-500 text-sm dark:text-gray-200 self-center"},G={__name:"ModalMove",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(t.modal.data.items.from),r=e.ref(""),u=()=>{n.value.length&&t.emitter.emit("vf-fetch",{params:{q:"move",m:"post",adapter:t.fs.adapter,path:t.fs.data.dirname},body:{items:n.value.map(({path:s,type:i})=>({path:s,type:i})),item:t.modal.data.items.to.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files moved.",t.modal.data.items.to.name)})},onError:s=>{r.value=o(s.message)}})};return(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:i[1]||(i[1]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",fn,e.toDisplayString(e.unref(o)("%s item(s) selected.",n.value.length)),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Kr,[Yr,e.createElementVNode("div",Jr,[e.createElementVNode("h3",Qr,e.toDisplayString(e.unref(o)("Move files")),1),e.createElementVNode("p",Xr,e.toDisplayString(e.unref(o)("Are you sure you want to move these files?")),1),e.createElementVNode("div",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,l=>(e.openBlock(),e.createElementBlock("div",en,[e.createElementVNode("div",null,[l.type==="dir"?(e.openBlock(),e.createElementBlock("svg",tn,rn)):(e.openBlock(),e.createElementBlock("svg",nn,sn))]),e.createElementVNode("div",ln,e.toDisplayString(l.path),1)]))),256))]),e.createElementVNode("h4",cn,e.toDisplayString(e.unref(o)("Target Directory")),1),e.createElementVNode("p",dn,[un,e.createElementVNode("span",mn,e.toDisplayString(e.unref(t).modal.data.items.to.path),1)]),r.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:i[0]||(i[0]=l=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1}))}},pn={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",viewBox:"-40 -40 580 580"},hn=e.createElementVNode("path",{d:"M463.5 224h8.5c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2S461.9 48.1 455 55l-41.6 41.6c-87.6-86.5-228.7-86.2-315.8 1-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 224 344 224z"},null,-1),vn=[hn];function gn(a,t){return e.openBlock(),e.createElementBlock("svg",pn,[...vn])}const kn={render:gn},_n={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-0.5 rounded",viewBox:"0 0 20 20"},xn=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 0 1 0-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L11 7.414V15a1 1 0 1 1-2 0V7.414L6.707 9.707a1 1 0 0 1-1.414 0",class:"pointer-events-none","clip-rule":"evenodd"},null,-1),yn=[xn];function wn(a,t){return e.openBlock(),e.createElementBlock("svg",_n,[...yn])}const bn={render:wn},En={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",viewBox:"0 0 24 24"},Vn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1),Nn=[Vn];function Bn(a,t){return e.openBlock(),e.createElementBlock("svg",En,[...Nn])}const $n={render:Bn},Sn={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",viewBox:"0 0 20 20"},Cn=e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 0 0-1.414 0l-7 7a1 1 0 0 0 1.414 1.414L4 10.414V17a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-6.586l.293.293a1 1 0 0 0 1.414-1.414z",class:"pointer-events-none"},null,-1),Dn=[Cn];function Mn(a,t){return e.openBlock(),e.createElementBlock("svg",Sn,[...Dn])}const Tn={render:Mn},Ln={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",viewBox:"0 0 20 20"},An=e.createElementVNode("path",{d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607"},null,-1),jn=[An];function Fn(a,t){return e.openBlock(),e.createElementBlock("svg",Ln,[...jn])}const Un={render:Fn},zn={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"w-6 h-6 cursor-pointer",viewBox:"0 0 24 24"},In=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1),Rn=[In];function Hn(a,t){return e.openBlock(),e.createElementBlock("svg",zn,[...Rn])}const qn={render:Hn},On={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",viewBox:"0 0 24 24"},Pn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2"},null,-1),Gn=[Pn];function Wn(a,t){return e.openBlock(),e.createElementBlock("svg",On,[...Gn])}const ne={render:Wn},Kn={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 rounded text-slate-700 hover:bg-neutral-100 dark:fill-neutral-300 dark:hover:bg-gray-800 cursor-pointer",viewBox:"0 0 448 512"},Yn=e.createElementVNode("path",{d:"M8 256a56 56 0 1 1 112 0 56 56 0 1 1-112 0m160 0a56 56 0 1 1 112 0 56 56 0 1 1-112 0m216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112"},null,-1),Jn=[Yn];function Qn(a,t){return e.openBlock(),e.createElementBlock("svg",Kn,[...Jn])}const Xn={render:Qn},Zn={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-sm"},ea=["aria-label"],ta=["aria-label"],oa=["aria-label"],ra={class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full overflow-hidden"},na={class:"flex leading-6"},aa={key:0,class:"flex"},sa=e.createElementVNode("div",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),la={class:"relative"},ia=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),ca=["onDragover","onDragleave","onDrop","title","onClick"],da={class:"relative flex bg-white dark:bg-gray-700 justify-between items-center rounded p-1 ml-2 w-full"},ua=["placeholder"],ma={class:"z-30 absolute top-[65px] md:top-[75px] left-[90px] rounded -mx-1.5 mt-1 bg-neutral-50 dark:bg-gray-800 max-w-80 max-h-50 shadow overflow-y-auto text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600"},fa=["onDrop","onClick"],pa={class:"flex pointer-events-none"},ha={class:"inline-block w-full text-ellipsis overflow-hidden"},va={__name:"Breadcrumb",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=t.dragSelect,r=e.ref(null),u=K(0,100);e.watch(u,b=>{const y=r.value.children;let w=0,$=0,S=5,z=1;t.fs.limitBreadcrumbItems(S),e.nextTick(()=>{for(let F=y.length-1;F>=0&&!(w+y[F].offsetWidth>u.value-40);F--)w+=parseInt(y[F].offsetWidth,10),$++;$S&&($=S),t.fs.limitBreadcrumbItems($)})});const s=()=>{u.value=r.value.offsetWidth};e.onMounted(()=>{new ResizeObserver(s).observe(r.value)});const i=(b,y=null)=>{b.preventDefault(),n.isDraggingRef.value=!1,f(b),y??(y=t.fs.hiddenBreadcrumbs.length-1);let w=JSON.parse(b.dataTransfer.getData("items"));if(w.find($=>$.storage!==t.fs.adapter)){alert("Moving items between different storages is not supported yet.");return}t.modal.open(G,{items:{from:w,to:t.fs.hiddenBreadcrumbs[y]??{path:t.fs.adapter+"://"}}})},l=(b,y=null)=>{b.preventDefault(),n.isDraggingRef.value=!1,f(b),y??(y=t.fs.breadcrumbs.length-2);let w=JSON.parse(b.dataTransfer.getData("items"));if(w.find($=>$.storage!==t.fs.adapter)){alert("Moving items between different storages is not supported yet.");return}t.modal.open(G,{items:{from:w,to:t.fs.breadcrumbs[y]??{path:t.fs.adapter+"://"}}})},c=b=>{b.preventDefault(),t.fs.isGoUpAvailable()?(b.dataTransfer.dropEffect="copy",b.currentTarget.classList.add("bg-blue-200","dark:bg-slate-600")):(b.dataTransfer.dropEffect="none",b.dataTransfer.effectAllowed="none")},f=b=>{b.preventDefault(),b.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-600"),t.fs.isGoUpAvailable()&&b.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-600")},h=()=>{x(),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname}})},d=()=>{x(),!t.fs.isGoUpAvailable()||t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.parentFolderPath}})},m=b=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:b.path}}),t.fs.toggleHiddenBreadcrumbs(!1)},p=()=>{t.fs.showHiddenBreadcrumbs&&t.fs.toggleHiddenBreadcrumbs(!1)},v={mounted(b,y,w,$){b.clickOutsideEvent=function(S){b===S.target||b.contains(S.target)||y.value()},document.body.addEventListener("click",b.clickOutsideEvent)},beforeUnmount(b,y,w,$){document.body.removeEventListener("click",b.clickOutsideEvent)}},k=e.ref(null),E=()=>{t.features.includes(C.SEARCH)&&(t.fs.searchMode=!0,e.nextTick(()=>k.value.focus()))},_=K("",400);e.watch(_,b=>{t.emitter.emit("vf-toast-clear"),t.emitter.emit("vf-search-query",{newQuery:b})});const x=()=>{t.fs.searchMode=!1,_.value=""};t.emitter.on("vf-search-exit",()=>{x()});const M=()=>{_.value===""&&x()};return(b,y)=>(e.openBlock(),e.createElementBlock("div",Zn,[e.createElementVNode("span",{"aria-label":e.unref(o)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[e.createVNode(e.unref(bn),{onDragover:y[0]||(y[0]=w=>c(w)),onDragleave:y[1]||(y[1]=w=>f(w)),onDrop:y[2]||(y[2]=w=>l(w)),onClick:d,class:e.normalizeClass(e.unref(t).fs.isGoUpAvailable()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500")},null,8,["class"])],8,ea),e.unref(t).fs.loading?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(o)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[e.createVNode(e.unref($n),{onClick:y[3]||(y[3]=w=>e.unref(t).emitter.emit("vf-fetch-abort"))})],8,oa)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(o)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[e.createVNode(e.unref(kn),{onClick:h})],8,ta)),e.withDirectives(e.createElementVNode("div",ra,[e.createElementVNode("div",null,[e.createVNode(e.unref(Tn),{onDragover:y[4]||(y[4]=w=>c(w)),onDragleave:y[5]||(y[5]=w=>f(w)),onDrop:y[6]||(y[6]=w=>l(w,-1)),onClick:y[7]||(y[7]=w=>e.unref(t).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(t).fs.adapter}}))})]),e.createElementVNode("div",na,[e.unref(t).fs.hiddenBreadcrumbs.length?e.withDirectives((e.openBlock(),e.createElementBlock("div",aa,[sa,e.createElementVNode("div",la,[e.createElementVNode("span",{onDragenter:y[8]||(y[8]=w=>e.unref(t).fs.toggleHiddenBreadcrumbs(!0)),onClick:y[9]||(y[9]=w=>e.unref(t).fs.toggleHiddenBreadcrumbs()),class:"text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer"},[e.createVNode(e.unref(Xn),{class:"px-1 pointer-events-none"})],32)])])),[[v,p]]):e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"breadcrumbContainer",ref:r,class:"flex leading-6 w-full overflow-hidden",onClick:e.withModifiers(E,["self"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).fs.breadcrumbs,(w,$)=>(e.openBlock(),e.createElementBlock("div",{key:$},[ia,e.createElementVNode("span",{onDragover:S=>$===e.unref(t).fs.breadcrumbs.length-1||c(S),onDragleave:S=>$===e.unref(t).fs.breadcrumbs.length-1||f(S),onDrop:S=>$===e.unref(t).fs.breadcrumbs.length-1||l(S,$),class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer whitespace-nowrap",title:w.basename,onClick:S=>e.unref(t).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(t).fs.adapter,path:w.path}})},e.toDisplayString(w.name),41,ca)]))),128))],512),e.unref(t).fs.loading?(e.openBlock(),e.createBlock(e.unref(re),{key:0})):e.createCommentVNode("",!0)],512),[[e.vShow,!e.unref(t).fs.searchMode]]),e.withDirectives(e.createElementVNode("div",da,[e.createElementVNode("div",null,[e.createVNode(e.unref(Un))]),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:k,onKeydown:e.withKeys(x,["esc"]),onBlur:M,"onUpdate:modelValue":y[10]||(y[10]=w=>e.isRef(_)?_.value=w:null),placeholder:e.unref(o)("Search anything.."),class:"w-full pb-0 px-1 border-0 text-base ring-0 outline-0 text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,ua),[[e.vModelText,e.unref(_)]]),e.createVNode(e.unref(qn),{onClick:x})],512),[[e.vShow,e.unref(t).fs.searchMode]]),e.withDirectives(e.createElementVNode("div",ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).fs.hiddenBreadcrumbs,(w,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,onDragover:y[11]||(y[11]=S=>c(S)),onDragleave:y[12]||(y[12]=S=>f(S)),onDrop:S=>i(S,$),onClick:S=>m(w),class:"px-2 py-0.5 hover:bg-gray-400/20 cursor-pointer items-center whitespace-nowrap"},[e.createElementVNode("div",pa,[e.createElementVNode("span",null,[e.createVNode(e.unref(ne),{class:"h-5 w-5"})]),e.createTextVNode(),e.createElementVNode("span",ha,e.toDisplayString(w.name),1)])],40,fa))),128))],512),[[e.vShow,e.unref(t).fs.showHiddenBreadcrumbs]])]))}},ae=(a,t=null)=>new Date(a*1e3).toLocaleString(t??navigator.language??"en-US"),ga=["onClick"],ka={__name:"Toast",setup(a){const t=e.inject("ServiceContainer"),{getStore:o}=t.storage,n=e.ref(o("full-screen",!1)),r=e.ref([]),u=l=>l==="error"?"text-red-400 border-red-400 dark:text-red-300 dark:border-red-300":"text-lime-600 border-lime-600 dark:text-lime-300 dark:border-lime-1300",s=l=>{r.value.splice(l,1)},i=l=>{let c=r.value.findIndex(f=>f.id===l);c!==-1&&s(c)};return t.emitter.on("vf-toast-clear",()=>{r.value=[]}),t.emitter.on("vf-toast-push",l=>{let c=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");l.id=c,r.value.push(l),setTimeout(()=>{i(c)},5e3)}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.value.value?"fixed":"absolute","max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(f,h)=>(e.openBlock(),e.createElementBlock("div",{onClick:d=>s(h),key:f,class:e.normalizeClass([u(f.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 dark:bg-gray-600 border text-xs sm:text-sm rounded cursor-pointer"])},e.toDisplayString(f.label),11,ga))),128))]),_:1})],2))}},_a={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 20 20"},xa=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414","clip-rule":"evenodd"},null,-1),ya=[xa];function wa(a,t){return e.openBlock(),e.createElementBlock("svg",_a,[...ya])}const ba={render:wa},Ea={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 20 20"},Va=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 0 1-1.414 0L10 9.414l-3.293 3.293a1 1 0 0 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414","clip-rule":"evenodd"},null,-1),Na=[Va];function Ba(a,t){return e.openBlock(),e.createElementBlock("svg",Ea,[...Na])}const $a={render:Ba},I={__name:"SortIcon",props:{direction:String},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[a.direction==="asc"?(e.openBlock(),e.createBlock(e.unref(ba),{key:0})):e.createCommentVNode("",!0),a.direction==="desc"?(e.openBlock(),e.createBlock(e.unref($a),{key:1})):e.createCommentVNode("",!0)]))}},Sa={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"text-neutral-500",viewBox:"0 0 24 24"},Ca=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1),Da=[Ca];function Ma(a,t){return e.openBlock(),e.createElementBlock("svg",Sa,[...Da])}const Ta={render:Ma},q={__name:"ItemIcon",props:{type:{type:String,required:!0},small:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("span",null,[a.type==="dir"?(e.openBlock(),e.createBlock(e.unref(ne),{key:0,class:e.normalizeClass({"h-5 w-5":a.small,"h-10 w-10 md:h-12 md:w-12 m-auto":!a.small})},null,8,["class"])):(e.openBlock(),e.createBlock(e.unref(Ta),{key:1,class:e.normalizeClass({"h-5 w-5":a.small,"h-10 w-10 md:h-12 md:w-12 m-auto":!a.small})},null,8,["class"]))]))}},La={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"absolute h-6 w-6 md:h-12 md:w-12 m-auto stroke-neutral-500 fill-white dark:fill-gray-700 dark:stroke-gray-600 z-10",viewBox:"0 0 24 24"},Aa=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1),ja=[Aa];function Fa(a,t){return e.openBlock(),e.createElementBlock("svg",La,[...ja])}const Ua={render:Fa},za={class:"absolute -z-50 -top-96"},Ia={class:"text-neutral-700 dark:text-neutral-300 p-1 absolute text-center top-4 right-[-2rem] md:top-5 md:right-[-2.4rem] z-20 text-xs"},Ra={__name:"DragItem",props:{count:{type:Number,default:0}},setup(a){const t=a;return(o,n)=>(e.openBlock(),e.createElementBlock("div",za,[e.createVNode(e.unref(Ua)),e.createElementVNode("div",Ia,e.toDisplayString(t.count),1)]))}},Ha={class:"flex"},qa=["aria-label"],Oa={class:"ml-auto mb-2"},Pa={key:0,class:"p-2 border font-normal whitespace-pre-wrap border-gray-200 dark:border-gray-700/50 dark:text-gray-200 rounded min-h-[200px] max-h-[60vh] text-xs overflow-auto"},Ga={key:1},Wa={__name:"Text",emits:["success"],setup(a,{emit:t}){const o=t,n=e.ref(""),r=e.ref(""),u=e.ref(null),s=e.ref(!1),i=e.ref(""),l=e.ref(!1),c=e.inject("ServiceContainer"),{t:f}=c.i18n;e.onMounted(()=>{c.requester.send({url:"",method:"get",params:{q:"preview",adapter:c.modal.data.adapter,path:c.modal.data.item.path},responseType:"text"}).then(m=>{n.value=m,o("success")})});const h=()=>{s.value=!s.value,r.value=n.value,s.value==!0&&e.nextTick(()=>{u.value.focus()})},d=()=>{i.value="",l.value=!1,c.requester.send({url:"",method:"post",params:{q:"save",adapter:c.modal.data.adapter,path:c.modal.data.item.path},body:{content:r.value},responseType:"text"}).then(m=>{i.value=f("Updated."),n.value=m,o("success"),s.value=!s.value}).catch(m=>{i.value=f(m.message),l.value=!0})};return(m,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ha,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(c).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(c).modal.data.item.basename),9,qa),e.createElementVNode("div",Oa,[s.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(f)("Save")),1)):e.createCommentVNode("",!0),e.unref(c).features.includes(e.unref(C).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:p[0]||(p[0]=v=>h())},e.toDisplayString(s.value?e.unref(f)("Cancel"):e.unref(f)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[s.value?(e.openBlock(),e.createElementBlock("div",Ga,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:u,"onUpdate:modelValue":p[1]||(p[1]=v=>r.value=v),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] max-h-[60vh] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,r.value]])])):(e.openBlock(),e.createElementBlock("pre",Pa,e.toDisplayString(n.value),1)),i.value.length?(e.openBlock(),e.createBlock(L,{key:2,onHidden:p[2]||(p[2]=v=>i.value=""),error:l.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},Ka={class:"flex"},Ya=["aria-label"],Ja={class:"ml-auto mb-2"},Qa={class:"w-full flex justify-center"},Xa=["src"],Za={__name:"Image",emits:["success"],setup(a,{emit:t}){const o=t,n=e.inject("ServiceContainer"),{t:r}=n.i18n,u=e.ref(null),s=e.ref(null),i=e.ref(!1),l=e.ref(""),c=e.ref(!1),f=()=>{i.value=!i.value,i.value?s.value=new he(u.value,{crop(d){}}):s.value.destroy()},h=()=>{s.value.getCroppedCanvas({width:795,height:341}).toBlob(d=>{l.value="",c.value=!1;const m=new FormData;m.set("file",d),n.requester.send({url:"",method:"post",params:{q:"upload",adapter:n.modal.data.adapter,path:n.modal.data.item.path},body:m}).then(p=>{l.value=r("Updated."),u.value.src=n.requester.getPreviewUrl(n.modal.data.adapter,n.modal.data.item),f(),o("success")}).catch(p=>{l.value=r(p.message),c.value=!0})})};return e.onMounted(()=>{o("success")}),(d,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ka,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(n).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(n).modal.data.item.basename),9,Ya),e.createElementVNode("div",Ja,[i.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:h,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(r)("Crop")),1)):e.createCommentVNode("",!0),e.unref(n).features.includes(e.unref(C).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:m[0]||(m[0]=p=>f())},e.toDisplayString(i.value?e.unref(r)("Cancel"):e.unref(r)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Qa,[e.createElementVNode("img",{ref_key:"image",ref:u,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(n).requester.getPreviewUrl(e.unref(n).modal.data.adapter,e.unref(n).modal.data.item),alt:""},null,8,Xa)]),l.value.length?(e.openBlock(),e.createBlock(L,{key:0,onHidden:m[1]||(m[1]=p=>l.value=""),error:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},es={class:"flex"},ts=["aria-label"],os=e.createElementVNode("div",null,null,-1),rs={__name:"Default",emits:["success"],setup(a,{emit:t}){const o=e.inject("ServiceContainer"),n=t;return e.onMounted(()=>{n("success")}),(r,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",es,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ts)]),os],64))}},ns=["aria-label"],as={class:"w-full aspect-video",preload:"",controls:""},ss=["src"],ls={__name:"Video",emits:["success"],setup(a,{emit:t}){const o=e.inject("ServiceContainer"),n=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{n("success")}),(u,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ns),e.createElementVNode("div",null,[e.createElementVNode("video",as,[e.createElementVNode("source",{src:r(),type:"video/mp4"},null,8,ss),e.createTextVNode(" Your browser does not support the video tag. ")])])]))}},is=["aria-label"],cs={class:"w-full",controls:""},ds=["src"],us={__name:"Audio",emits:["success"],setup(a,{emit:t}){const o=t,n=e.inject("ServiceContainer"),r=()=>n.requester.getPreviewUrl(n.modal.data.adapter,n.modal.data.item);return e.onMounted(()=>{o("success")}),(u,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(n).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(n).modal.data.item.basename),9,is),e.createElementVNode("div",null,[e.createElementVNode("audio",cs,[e.createElementVNode("source",{src:r(),type:"audio/mpeg"},null,8,ds),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},ms=["aria-label"],fs=["data"],ps=["src"],hs=e.createElementVNode("p",null,[e.createTextVNode(" Your browser does not support PDFs. "),e.createElementVNode("a",{href:"https://example.com/test.pdf"},"Download the PDF"),e.createTextVNode(" . ")],-1),vs=[hs],gs={__name:"Pdf",emits:["success"],setup(a,{emit:t}){const o=e.inject("ServiceContainer"),n=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{n("success")}),(u,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ms),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:r(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:r(),width:"100%",height:"100%"},vs,8,ps)],8,fs)])],64))}},ks={class:"sm:flex sm:items-start"},_s={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},xs={key:0},ys={class:"text-gray-700 dark:text-gray-200 text-sm"},ws={key:0,class:"flex leading-5"},bs=e.createElementVNode("svg",{class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),Es={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},Vs={class:"font-bold"},Ns={class:"font-bold pl-2"},Bs={key:0,class:"text-xs text-gray-600 dark:text-gray-400"},$s=["download","href"],se={__name:"ModalPreview",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(!1),r=s=>(t.modal.data.item.mime_type??"").startsWith(s),u=t.features.includes(C.PREVIEW);return u||(n.value=!0),(s,i)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:i[6]||(i[6]=l=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1),e.unref(t).features.includes(e.unref(C).DOWNLOAD)?(e.openBlock(),e.createElementBlock("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item),href:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item)},e.toDisplayString(e.unref(o)("Download")),9,$s)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",ks,[e.createElementVNode("div",_s,[e.unref(u)?(e.openBlock(),e.createElementBlock("div",xs,[r("text")?(e.openBlock(),e.createBlock(Wa,{key:0,onSuccess:i[0]||(i[0]=l=>n.value=!0)})):r("image")?(e.openBlock(),e.createBlock(Za,{key:1,onSuccess:i[1]||(i[1]=l=>n.value=!0)})):r("video")?(e.openBlock(),e.createBlock(ls,{key:2,onSuccess:i[2]||(i[2]=l=>n.value=!0)})):r("audio")?(e.openBlock(),e.createBlock(us,{key:3,onSuccess:i[3]||(i[3]=l=>n.value=!0)})):r("application/pdf")?(e.openBlock(),e.createBlock(gs,{key:4,onSuccess:i[4]||(i[4]=l=>n.value=!0)})):(e.openBlock(),e.createBlock(rs,{key:5,onSuccess:i[5]||(i[5]=l=>n.value=!0)}))])):e.createCommentVNode("",!0),e.createElementVNode("div",ys,[n.value===!1?(e.openBlock(),e.createElementBlock("div",ws,[bs,e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Es,[e.createElementVNode("div",null,[e.createElementVNode("span",Vs,e.toDisplayString(e.unref(o)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(t).filesize(e.unref(t).modal.data.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",Ns,e.toDisplayString(e.unref(o)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(ae)(e.unref(t).modal.data.item.last_modified)),1)])]),e.unref(t).features.includes(e.unref(C).DOWNLOAD)?(e.openBlock(),e.createElementBlock("div",Bs,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):e.createCommentVNode("",!0)]),_:1}))}},Ss=["data-type","data-item","data-index"],O={__name:"Item",props:{item:{type:Object},index:{type:Number},dragImage:{type:Object}},setup(a){const t=e.inject("ServiceContainer"),o=t.dragSelect,n=a,r=d=>{d.type==="dir"?(t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:d.path}})):t.modal.open(se,{adapter:t.fs.adapter,item:d})},u={mounted(d,m,p,v){p.props.draggable&&(d.addEventListener("dragstart",k=>s(k,m.value)),d.addEventListener("dragover",k=>l(k,m.value)),d.addEventListener("drop",k=>i(k,m.value)))},beforeUnmount(d,m,p,v){p.props.draggable&&(d.removeEventListener("dragstart",s),d.removeEventListener("dragover",l),d.removeEventListener("drop",i))}},s=(d,m)=>{if(d.altKey||d.ctrlKey||d.metaKey)return d.preventDefault(),!1;o.isDraggingRef.value=!0,d.dataTransfer.setDragImage(n.dragImage.$el,0,15),d.dataTransfer.effectAllowed="all",d.dataTransfer.dropEffect="copy",d.dataTransfer.setData("items",JSON.stringify(o.getSelected()))},i=(d,m)=>{d.preventDefault(),o.isDraggingRef.value=!1;let p=JSON.parse(d.dataTransfer.getData("items"));if(p.find(v=>v.storage!==t.fs.adapter)){alert("Moving items between different storages is not supported yet.");return}t.modal.open(G,{items:{from:p,to:m}})},l=(d,m)=>{d.preventDefault(),!m||m.type!=="dir"||o.getSelection().find(p=>p===d.currentTarget)?(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none"):d.dataTransfer.dropEffect="copy"};let c=null;const f=()=>{c&&clearTimeout(c)},h=d=>{c=setTimeout(()=>{const m=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:d.target.getBoundingClientRect().x,clientY:d.target.getBoundingClientRect().y});d.target.dispatchEvent(m)},500)};return(d,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({opacity:e.unref(o).isDraggingRef.value&&e.unref(o).getSelection().find(p=>d.$el===p)?"0.5 !important":""}),class:e.normalizeClass(["vf-item-"+e.unref(o).explorerId]),"data-type":a.item.type,key:a.item.path,"data-item":JSON.stringify(a.item),"data-index":a.index,onDblclick:m[0]||(m[0]=p=>r(a.item)),onTouchstart:m[1]||(m[1]=p=>h(p)),onTouchend:m[2]||(m[2]=p=>f()),onContextmenu:m[3]||(m[3]=e.withModifiers(p=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:p,items:e.unref(o).getSelected(),target:a.item}),["prevent"]))},[e.renderSlot(d.$slots,"default")],46,Ss)),[[u,a.item]])}},Cs={class:"relative flex-auto flex flex-col overflow-hidden"},Ds={key:0,class:"grid grid-cols-12 px-1 bg-neutral-50 dark:bg-gray-800 border-b border-neutral-300 dark:border-gray-700 text-xs select-none divide-x"},Ms={class:"relative"},Ts={class:"grid grid-cols-12 items-center"},Ls={class:"flex col-span-7 items-center"},As={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},js={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Fs={class:"grid grid-cols-12 items-center"},Us={class:"flex col-span-7 items-center"},zs={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Is={class:"col-span-2 text-center"},Rs={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap px-1 md:px-3"},Hs={class:"relative"},qs=["data-src","alt"],Os={key:2,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},Ps={class:"break-all"},Gs={__name:"Explorer",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=m=>m==null?void 0:m.substring(0,3),r=e.ref(null),u=e.ref(""),s=t.dragSelect;let i;t.emitter.on("vf-fullscreen-toggle",()=>{s.area.value.style.height=null}),t.emitter.on("vf-search-query",({newQuery:m})=>{u.value=m,m?t.emitter.emit("vf-fetch",{params:{q:"search",adapter:t.fs.adapter,path:t.fs.data.dirname,filter:m},onSuccess:p=>{p.files.length||t.emitter.emit("vf-toast-push",{label:o("No search result found.")})}}):t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname}})});const l=e.ref(!0),c=m=>{m.touches.length>1&&(l.value?(s.instance.stop(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: off")})):(s.instance.start(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: on")}),s.refreshSelection()),l.value=!l.value)},f=e.reactive({active:!1,column:"",order:""}),h=(m=!0)=>{let p=[...t.fs.data.files],v=f.column,k=f.order==="asc"?1:-1;if(!m)return p;const E=(_,x)=>typeof _=="string"&&typeof x=="string"?_.toLowerCase().localeCompare(x.toLowerCase()):_x?1:0;return f.active&&(p=p.slice().sort((_,x)=>E(_[v],x[v])*k)),p},d=m=>{f.active&&f.column===m?(f.active=f.order==="asc",f.column=m,f.order="desc"):(f.active=!0,f.column=m,f.order="asc")};return e.onMounted(()=>{i=new pe(s.area.value)}),e.onUpdated(()=>{i.update()}),e.onBeforeUnmount(()=>{i.destroy()}),(m,p)=>(e.openBlock(),e.createElementBlock("div",Cs,[e.unref(t).view==="list"||u.value.length?(e.openBlock(),e.createElementBlock("div",Ds,[e.createElementVNode("div",{onClick:p[0]||(p[0]=v=>d("basename")),class:"col-span-7 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Name"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="basename"]])]),u.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:p[1]||(p[1]=v=>d("file_size")),class:"justify-center col-span-2 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Size"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="file_size"]])])),u.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:p[2]||(p[2]=v=>d("last_modified")),class:"justify-center col-span-3 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Date"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="last_modified"]])])),u.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:p[3]||(p[3]=v=>d("path")),class:"justify-center col-span-5 vf-sort-button"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Filepath"))+" ",1),e.withDirectives(e.createVNode(I,{direction:f.order},null,8,["direction"]),[[e.vShow,f.active&&f.column==="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ms,[e.createVNode(Ra,{ref_key:"dragImage",ref:r,count:e.unref(s).getCount()},null,8,["count"])]),e.createElementVNode("div",{ref:e.unref(s).area,class:e.normalizeClass([e.unref(t).fullScreen?"":"resize-y","h-full w-full text-xs vf-selector-area vf-scrollbar min-h-[150px] overflow-auto p-1 z-0"]),onTouchstart:c,onContextmenu:p[4]||(p[4]=e.withModifiers(v=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:v,items:e.unref(s).getSelected()}),["self","prevent"]))},[u.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h(),(v,k)=>(e.openBlock(),e.createBlock(O,{item:v,index:k,dragImage:r.value,class:"vf-item vf-item-list"},{default:e.withCtx(()=>[e.createElementVNode("div",Ts,[e.createElementVNode("div",Ls,[e.createVNode(q,{type:v.type,small:e.unref(t).compactListView},null,8,["type","small"]),e.createElementVNode("span",As,e.toDisplayString(v.basename),1)]),e.createElementVNode("div",js,e.toDisplayString(v.path),1)])]),_:2},1032,["item","index","dragImage"]))),256)):e.createCommentVNode("",!0),e.unref(t).view==="list"&&!u.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(h(),(v,k)=>(e.openBlock(),e.createBlock(O,{item:v,index:k,dragImage:r.value,class:"vf-item vf-item-list",draggable:"true"},{default:e.withCtx(()=>[e.createElementVNode("div",Fs,[e.createElementVNode("div",Us,[e.createVNode(q,{type:v.type,small:e.unref(t).compactListView},null,8,["type","small"]),e.createElementVNode("span",zs,e.toDisplayString(v.basename),1)]),e.createElementVNode("div",Is,e.toDisplayString(v.file_size?e.unref(t).filesize(v.file_size):""),1),e.createElementVNode("div",Rs,e.toDisplayString(e.unref(ae)(v.last_modified)),1)])]),_:2},1032,["item","index","dragImage"]))),256)):e.createCommentVNode("",!0),e.unref(t).view==="grid"&&!u.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h(!1),(v,k)=>(e.openBlock(),e.createBlock(O,{item:v,index:k,dragImage:r.value,class:"vf-item vf-item-grid",draggable:"true"},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("div",Hs,[(v.mime_type??"").startsWith("image")&&e.unref(t).showThumbnails?(e.openBlock(),e.createElementBlock("img",{src:"data:image/png;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(t).requester.getPreviewUrl(e.unref(t).fs.adapter,v),alt:v.basename,key:v.path},null,8,qs)):(e.openBlock(),e.createBlock(q,{key:1,type:v.type},null,8,["type"])),!((v.mime_type??"").startsWith("image")&&e.unref(t).showThumbnails)&&v.type!=="dir"?(e.openBlock(),e.createElementBlock("div",Os,e.toDisplayString(n(v.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",Ps,e.toDisplayString(e.unref(P)(v.basename)),1)])]),_:2},1032,["item","index","dragImage"]))),256)):e.createCommentVNode("",!0)],34),e.createVNode(ka)]))}},Ws=["href","download"],Ks=["onClick"],Ys={__name:"ContextMenu",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,n=e.ref(null),r=e.ref([]),u=e.ref(""),s=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),i=e.computed(()=>s.items.filter(h=>h.key==null||t.features.includes(h.key)));t.emitter.on("vf-context-selected",h=>{r.value=h});const l={newfolder:{key:C.NEW_FOLDER,title:()=>o("New Folder"),action:()=>t.modal.open(X)},delete:{key:C.DELETE,title:()=>o("Delete"),action:()=>{t.modal.open(ee,{items:r})}},refresh:{title:()=>o("Refresh"),action:()=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:t.fs.data.dirname}})}},preview:{key:C.PREVIEW,title:()=>o("Preview"),action:()=>t.modal.open(se,{adapter:t.fs.adapter,item:r.value[0]})},open:{title:()=>o("Open"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:r.value[0].path}})}},openDir:{title:()=>o("Open containing folder"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter,path:r.value[0].dir}})}},download:{key:C.DOWNLOAD,link:e.computed(()=>t.requester.getDownloadUrl(t.fs.adapter,r.value[0])),title:()=>o("Download"),action:()=>{}},archive:{key:C.ARCHIVE,title:()=>o("Archive"),action:()=>t.modal.open(oe,{items:r})},unarchive:{key:C.UNARCHIVE,title:()=>o("Unarchive"),action:()=>t.modal.open(te,{items:r})},rename:{key:C.RENAME,title:()=>o("Rename"),action:()=>t.modal.open(Z,{items:r})}},c=h=>{t.emitter.emit("vf-contextmenu-hide"),h.action()};t.emitter.on("vf-search-query",({newQuery:h})=>{u.value=h}),t.emitter.on("vf-contextmenu-show",({event:h,items:d,target:m=null})=>{if(s.items=[],u.value)if(m)s.items.push(l.openDir),t.emitter.emit("vf-context-selected",[m]);else return;else!m&&!u.value?(s.items.push(l.refresh),s.items.push(l.newfolder),t.emitter.emit("vf-context-selected",[])):d.length>1&&d.some(p=>p.path===m.path)?(s.items.push(l.refresh),s.items.push(l.archive),s.items.push(l.delete),t.emitter.emit("vf-context-selected",d)):(m.type==="dir"?s.items.push(l.open):(s.items.push(l.preview),s.items.push(l.download)),s.items.push(l.rename),m.mime_type==="application/zip"?s.items.push(l.unarchive):s.items.push(l.archive),s.items.push(l.delete),t.emitter.emit("vf-context-selected",[m]));f(h)}),t.emitter.on("vf-contextmenu-hide",()=>{s.active=!1});const f=h=>{const d=t.dragSelect.area.value,m=t.root.getBoundingClientRect(),p=d.getBoundingClientRect();let v=h.clientX-m.left,k=h.clientY-m.top;s.active=!0,e.nextTick(()=>{var M;const E=(M=n.value)==null?void 0:M.getBoundingClientRect();let _=(E==null?void 0:E.height)??0,x=(E==null?void 0:E.width)??0;v=p.right-h.pageX+window.scrollXe.withDirectives((e.openBlock(),e.createElementBlock("ul",{ref_key:"contextmenu",ref:n,style:e.normalizeStyle(s.positions),class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded-sm select-none"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,m=>(e.openBlock(),e.createElementBlock("li",{class:"cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:m.title},[m.link?(e.openBlock(),e.createElementBlock("a",{key:0,class:"block pl-2 pr-3 py-2",target:"_blank",href:m.link,download:m.link,onClick:d[0]||(d[0]=p=>e.unref(t).emitter.emit("vf-contextmenu-hide"))},[e.createElementVNode("span",null,e.toDisplayString(m.title()),1)],8,Ws)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"pl-2 pr-3 py-1.5",onClick:p=>c(m)},[e.createElementVNode("span",null,e.toDisplayString(m.title()),1)],8,Ks))]))),128))],4)),[[e.vShow,s.active]])}},Js=(a,t)=>{const o=a.__vccOpts||a;for(const[n,r]of t)o[n]=r;return o},Qs={props:{on:{type:String,required:!0}},setup(a,{emit:t,slots:o}){const n=e.inject("ServiceContainer"),r=e.ref(!1),{t:u}=n.i18n;let s=null;const i=()=>{clearTimeout(s),r.value=!0,s=setTimeout(()=>{r.value=!1},2e3)};return e.onMounted(()=>{n.emitter.on(a.on,i)}),e.onUnmounted(()=>{clearTimeout(s)}),{shown:r,t:u}}},Xs={key:1};function Zs(a,t,o,n,r,u){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-sm text-green-600 dark:text-green-600 transition-opacity duration-500 ease-out",[{"opacity-0":!n.shown}]])},[a.$slots.default?e.renderSlot(a.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("span",Xs,e.toDisplayString(n.t("Saved.")),1))],2)}const U=Js(Qs,[["render",Zs]]),el={class:"sm:flex sm:items-start"},tl=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])],-1),ol={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},rl={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},nl={class:"mt-2"},al={class:"text-sm text-gray-500"},sl={class:"text-sm font-semibold mt-5 text-gray-900 dark:text-gray-400 tracking-wider"},ll={class:"mt-3 text-left"},il={class:"space-y-2"},cl={class:"flex relative gap-x-3"},dl={class:"h-6 items-center"},ul={class:"flex-1 block text-sm"},ml={for:"metric_unit",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},fl={class:"flex relative gap-x-3"},pl={class:"h-6 items-center"},hl={class:"flex-1 block text-sm"},vl={for:"large_icons",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},gl={class:"flex relative gap-x-3"},kl={class:"h-6 items-center"},_l={class:"flex-1 block text-sm"},xl={for:"persist_path",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},yl={class:"flex relative gap-x-3"},wl={class:"h-6 items-center"},bl={class:"flex-1 block text-sm"},El={for:"show_thumbnails",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},Vl={class:"flex relative gap-x-3"},Nl={class:"h-6 items-center"},Bl={for:"theme",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm"},$l={class:"flex text-sm"},Sl=["label"],Cl=["value"],Dl={key:0,class:"flex relative gap-x-3"},Ml={class:"h-6 items-center"},Tl={for:"language",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm text-nowrap"},Ll={class:"flex text-sm"},Al=["label"],jl=["value"],Fl={__name:"ModalAbout",setup(a){const t=e.inject("ServiceContainer"),{setStore:o,clearStore:n}=t.storage,{t:r,changeLocale:u,locale:s}=t.i18n,i=async()=>{n(),location.reload()},l=E=>{t.theme.set(E),t.emitter.emit("vf-theme-saved")},c=()=>{t.metricUnits=!t.metricUnits,t.filesize=t.metricUnits?Q:J,o("metricUnits",t.metricUnits),t.emitter.emit("vf-metric-units-saved")},f=()=>{t.compactListView=!t.compactListView,o("compactListView",t.compactListView),t.emitter.emit("vf-compact-view-saved")},h=()=>{t.showThumbnails=!t.showThumbnails,o("show-thumbnails",t.showThumbnails),t.emitter.emit("vf-show-thumbnails-saved")},d=()=>{t.persist=!t.persist,o("persist-path",t.persist),t.emitter.emit("vf-persist-path-saved")},{i18n:m}=e.inject("VueFinderOptions"),v=Object.fromEntries(Object.entries({en:"English",fr:"French (Français)",de:"German (Deutsch)",fa:"Persian (فارسی)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",ru:"Russian (Pусский)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)",zhCN:"Simplified Chinese (简体中文)",zhTW:"Traditional Chinese (繁體中文)"}).filter(([E])=>Object.keys(m).includes(E))),k=e.computed(()=>({system:r("System"),light:r("Light"),dark:r("Dark")}));return(E,_)=>(e.openBlock(),e.createBlock(T,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:_[8]||(_[8]=x=>e.unref(t).modal.close()),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(r)("Close")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",el,[tl,e.createElementVNode("div",ol,[e.createElementVNode("h3",rl,e.toDisplayString(e.unref(r)("About %s","Vuefinder "+e.unref(t).version)),1),e.createElementVNode("div",nl,[e.createElementVNode("p",al,e.toDisplayString(e.unref(r)("Vuefinder is a file manager component for vue 3.")),1),e.createElementVNode("div",null,[e.createElementVNode("h3",sl,e.toDisplayString(e.unref(r)("Settings")),1)]),e.createElementVNode("div",ll,[e.createElementVNode("fieldset",null,[e.createElementVNode("div",il,[e.createElementVNode("div",cl,[e.createElementVNode("div",dl,[e.withDirectives(e.createElementVNode("input",{id:"metric_unit",name:"metric_unit",type:"checkbox","onUpdate:modelValue":_[0]||(_[0]=x=>e.unref(t).metricUnits=x),onClick:c,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).metricUnits]])]),e.createElementVNode("div",ul,[e.createElementVNode("label",ml,[e.createTextVNode(e.toDisplayString(e.unref(r)("Use Metric Units"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-metric-units-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",fl,[e.createElementVNode("div",pl,[e.withDirectives(e.createElementVNode("input",{id:"large_icons",name:"large_icons",type:"checkbox","onUpdate:modelValue":_[1]||(_[1]=x=>e.unref(t).compactListView=x),onClick:f,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).compactListView]])]),e.createElementVNode("div",hl,[e.createElementVNode("label",vl,[e.createTextVNode(e.toDisplayString(e.unref(r)("Compact list view"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-compact-view-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",gl,[e.createElementVNode("div",kl,[e.withDirectives(e.createElementVNode("input",{id:"persist_path",name:"persist_path",type:"checkbox","onUpdate:modelValue":_[2]||(_[2]=x=>e.unref(t).persist=x),onClick:d,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).persist]])]),e.createElementVNode("div",_l,[e.createElementVNode("label",xl,[e.createTextVNode(e.toDisplayString(e.unref(r)("Persist path on reload"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-persist-path-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",yl,[e.createElementVNode("div",wl,[e.withDirectives(e.createElementVNode("input",{id:"show_thumbnails",name:"show_thumbnails",type:"checkbox","onUpdate:modelValue":_[3]||(_[3]=x=>e.unref(t).showThumbnails=x),onClick:h,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).showThumbnails]])]),e.createElementVNode("div",bl,[e.createElementVNode("label",El,[e.createTextVNode(e.toDisplayString(e.unref(r)("Show thumbnails"))+" ",1),e.createVNode(U,{class:"ms-3",on:"vf-show-thumbnails-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",Vl,[e.createElementVNode("div",Nl,[e.createElementVNode("label",Bl,e.toDisplayString(e.unref(r)("Theme")),1)]),e.createElementVNode("div",$l,[e.withDirectives(e.createElementVNode("select",{id:"theme","onUpdate:modelValue":_[4]||(_[4]=x=>e.unref(t).theme.value=x),onChange:_[5]||(_[5]=x=>l(x.target.value)),class:"flex-shrink-0 w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(r)("Theme")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(x,M)=>(e.openBlock(),e.createElementBlock("option",{value:M},e.toDisplayString(x),9,Cl))),256))],8,Sl)],544),[[e.vModelSelect,e.unref(t).theme.value]]),e.createVNode(U,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-theme-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])]),e.unref(t).features.includes(e.unref(C).LANGUAGE)&&Object.keys(e.unref(v)).length>1?(e.openBlock(),e.createElementBlock("div",Dl,[e.createElementVNode("div",Ml,[e.createElementVNode("label",Tl,e.toDisplayString(e.unref(r)("Language")),1)]),e.createElementVNode("div",Ll,[e.withDirectives(e.createElementVNode("select",{id:"language","onUpdate:modelValue":_[6]||(_[6]=x=>e.isRef(s)?s.value=x:null),onChange:_[7]||(_[7]=x=>e.unref(u)(x.target.value)),class:"flex-shrink-0 w-1/2 sm:w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(r)("Language")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(x,M)=>(e.openBlock(),e.createElementBlock("option",{value:M},e.toDisplayString(x),9,jl))),256))],8,Al)],544),[[e.vModelSelect,e.unref(s)]]),e.createVNode(U,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-language-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Saved.")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:i,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(r)("Reset Settings")),1)])])])])])])]),_:1}))}},Ul={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",class:"h-5 w-5",viewBox:"0 0 24 24"},zl=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},null,-1),Il=[zl];function Rl(a,t){return e.openBlock(),e.createElementBlock("svg",Ul,[...Il])}const Hl={render:Rl},ql={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"2",class:"h-5 w-5 stroke-slate-500 cursor-pointer",viewBox:"0 0 24 24"},Ol=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0"},null,-1),Pl=[Ol];function Gl(a,t){return e.openBlock(),e.createElementBlock("svg",ql,[...Pl])}const Wl={render:Gl},Kl={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Yl={class:"flex leading-5 items-center"},Jl=["aria-label"],Ql=["value"],Xl={class:"ml-3"},Zl={key:0},ei={class:"ml-1"},ti={class:"flex leading-5 items-center justify-end"},oi=["disabled"],ri=["aria-label"],ni={__name:"Statusbar",setup(a){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,{setStore:n}=t.storage,r=t.dragSelect,u=()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.fs.adapter}}),n("adapter",t.fs.adapter)},s=e.ref("");t.emitter.on("vf-search-query",({newQuery:l})=>{s.value=l});const i=e.computed(()=>{const l=t.selectButton.multiple?r.getSelected().length>0:r.getSelected().length===1;return t.selectButton.active&&l});return(l,c)=>(e.openBlock(),e.createElementBlock("div",Kl,[e.createElementVNode("div",Yl,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(o)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},[e.createVNode(e.unref(Hl))],8,Jl),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":c[0]||(c[0]=f=>e.unref(t).fs.adapter=f),onChange:u,class:"py-0.5 text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).fs.data.storages,f=>(e.openBlock(),e.createElementBlock("option",{value:f},e.toDisplayString(f),9,Ql))),256))],544),[[e.vModelSelect,e.unref(t).fs.adapter]]),e.createElementVNode("div",Xl,[s.value.length?(e.openBlock(),e.createElementBlock("span",Zl,e.toDisplayString(e.unref(t).fs.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",ei,e.toDisplayString(e.unref(t).dragSelect.getCount()>0?e.unref(o)("%s item(s) selected.",e.unref(t).dragSelect.getCount()):""),1)])]),e.createElementVNode("div",ti,[e.unref(t).selectButton.active?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vf-btn py-0 vf-btn-primary",{disabled:!i.value}]),disabled:!i.value,onClick:c[1]||(c[1]=f=>e.unref(t).selectButton.click(e.unref(r).getSelected(),f))},e.toDisplayString(e.unref(o)("Select")),11,oi)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(o)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:c[2]||(c[2]=f=>e.unref(t).modal.open(Fl))},[e.createVNode(e.unref(Wl))],8,ri)])]))}},ai={__name:"VueFinder",props:{id:{type:String,default:"vf"},request:{type:[String,Object],required:!0},persist:{type:Boolean,default:!1},path:{type:String,default:"."},features:{type:[Array,Boolean],default:!0},debug:{type:Boolean,default:!1},theme:{type:String,default:"system"},locale:{type:String,default:null},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},fullScreen:{type:Boolean,default:!1},showThumbnails:{type:Boolean,default:!0},selectButton:{type:Object,default(a){return{active:!1,multiple:!1,click:t=>{},...a}}}},emits:["select"],setup(a,{emit:t}){const o=t,r=$e(a,e.inject("VueFinderOptions"));e.provide("ServiceContainer",r);const{setStore:u}=r.storage,s=e.ref(null);r.root=s;const i=r.dragSelect,l=f=>{Object.assign(r.fs.data,f),i.clearSelection(),i.refreshSelection()};let c;return r.emitter.on("vf-fetch-abort",()=>{c.abort(),r.fs.loading=!1}),r.emitter.on("vf-fetch",({params:f,body:h=null,onSuccess:d=null,onError:m=null,noCloseModal:p=!1})=>{["index","search"].includes(f.q)&&(c&&c.abort(),r.fs.loading=!0),c=new AbortController;const v=c.signal;r.requester.send({url:"",method:f.m||"get",params:f,body:h,abortSignal:v}).then(k=>{r.fs.adapter=k.adapter,r.persist&&(r.fs.path=k.dirname,u("path",r.fs.path)),["index","search"].includes(f.q)&&(r.fs.loading=!1),p||r.modal.close(),l(k),d&&d(k)}).catch(k=>{console.error(k),m&&m(k)})}),e.onMounted(()=>{let f={};r.fs.path.includes("://")&&(f={adapter:r.fs.path.split("://")[0],path:r.fs.path}),r.emitter.emit("vf-fetch",{params:{q:"index",adapter:r.fs.adapter,...f}}),i.onSelect(h=>{o("select",h)})}),(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:"vuefinder",ref_key:"root",ref:s},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).theme.actualValue)},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r).fullScreen?"fixed w-screen inset-0 z-20":"relative rounded","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 select-none"]),style:e.normalizeStyle(e.unref(r).fullScreen?"":"max-height: "+a.maxHeight),onMousedown:h[0]||(h[0]=d=>e.unref(r).emitter.emit("vf-contextmenu-hide")),onTouchstart:h[1]||(h[1]=d=>e.unref(r).emitter.emit("vf-contextmenu-hide"))},[e.createVNode(Gr),e.createVNode(va),e.createVNode(Gs),e.createVNode(ni)],38),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r).modal.visible?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r).modal.type),{key:0})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Ys)],2)],512))}},si={install(a,t={}){t.i18n=t.i18n??{};let[o]=Object.keys(t.i18n);t.locale=t.locale??o??"en",a.provide("VueFinderOptions",t),a.component("VueFinder",ai)}};module.exports=si; diff --git a/dist/vuefinder.js b/dist/vuefinder.js index 061cdaa9..baf7bbdd 100644 --- a/dist/vuefinder.js +++ b/dist/vuefinder.js @@ -186,7 +186,7 @@ const O = { FULL_SCREEN: "fullscreen", DOWNLOAD: "download", LANGUAGE: "language" -}, rt = Object.values(O), nt = "2.3.0"; +}, rt = Object.values(O), nt = "2.3.1"; function De(l, e, a, r, o) { return (e = Math, a = e.log, r = 1024, o = a(l) / a(r) | 0, l / e.pow(r, o)).toFixed(0) + " " + (o ? "KMGTPEZY"[--o] + "iB" : "B"); } @@ -2049,7 +2049,6 @@ const Nr = { render: Tr }, Ur = { class: "flex p-1.5 bg-neutral-100 dark:bg-gray const E = o.value.children; let D = 0, R = 0, F = 5, ce = 1; e.fs.limitBreadcrumbItems(F), le(() => { - console.log("width updated"); for (let se = E.length - 1; se >= 0 && !(D + E[se].offsetWidth > v.value - 40); se--) D += parseInt(E[se].offsetWidth, 10), R++; R < ce && (R = ce), R > F && (R = F), e.fs.limitBreadcrumbItems(R); diff --git a/package.json b/package.json index 5a1f31ae..054e3025 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuefinder", - "version": "2.3.0", + "version": "2.3.1", "description": "Vuefinder is a file manager component for vuejs.", "type": "module", "files": [