vuefinder 2.2.5 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,5 +85,6 @@ export default {
85
85
  "Light": "Licht",
86
86
  "System": "System",
87
87
  "Target Directory" : "Zielverzeichnis",
88
+ "Select": "Auswählen",
88
89
  "uppy" : uppyLocaleDe,
89
90
  }
@@ -85,5 +85,6 @@ export default {
85
85
  "Light": "Light",
86
86
  "System": "System",
87
87
  "Target Directory" : "Target Directory",
88
+ "Select": "Select",
88
89
  "uppy": uppyLocaleEn
89
90
  }
@@ -85,5 +85,6 @@ export default {
85
85
  "Light": "روشن",
86
86
  "System": "سیستم",
87
87
  "Target Directory" : "پوشه مقصد",
88
+ "Select": "انتخاب",
88
89
  "uppy": uppyLocaleFa
89
90
  }
@@ -86,5 +86,6 @@ export default {
86
86
  "Light": "Clair",
87
87
  "System": "Système",
88
88
  "Target Directory" : "Répertoire cible",
89
+ "Select": "Sélectionner",
89
90
  "uppy": uppyLocaleFr
90
91
  }
@@ -85,5 +85,6 @@ export default {
85
85
  "Light": "בהיר",
86
86
  "System": "מערכת",
87
87
  "Target Directory" : "תיקיית יעד",
88
+ "Select": "בחר",
88
89
  "uppy": uppyLocaleHe
89
90
  }
@@ -85,5 +85,6 @@ export default {
85
85
  "Light": "लाइट",
86
86
  "System": "सिस्टम",
87
87
  "Target Directory" : "लक्षित निर्देशिका",
88
+ "Select": "चयन",
88
89
  "uppy": uppyLocaleHi
89
90
  }
@@ -85,5 +85,6 @@ export default {
85
85
  "Light": "Светлый",
86
86
  "System": "Система",
87
87
  "Target Directory" : "Целевая директория",
88
+ "Select": "Выбрать",
88
89
  "uppy": uppyLocaleRu
89
90
  }
@@ -85,5 +85,6 @@ export default {
85
85
  "Light": "Ljus",
86
86
  "System": "System",
87
87
  "Target Directory" : "Mål katalog",
88
+ "Select": "Välj",
88
89
  "uppy": uppyLocaleSv
89
90
  }
@@ -85,5 +85,6 @@ export default {
85
85
  "Light": "Açık",
86
86
  "System": "Sistem",
87
87
  "Target Directory" : "Hedef Klasör",
88
+ "Select": "Seç",
88
89
  "uppy": uppyLocaleTr,
89
90
  }
@@ -85,5 +85,6 @@ export default {
85
85
  "Light": "浅色",
86
86
  "System": "系统",
87
87
  "Target Directory": "目标目录",
88
+ "Select": "选择",
88
89
  "uppy": uppyLocalezhCN
89
90
  }
@@ -85,5 +85,6 @@ export default {
85
85
  "Light": "淺色",
86
86
  "System": "系統",
87
87
  "Target Directory": "目標目錄",
88
+ "Select": "選擇",
88
89
  "uppy": uppyLocalezhTW
89
90
  }
@@ -1 +1 @@
1
- "use strict";var J=Object.defineProperty;var X=(d,t,o)=>t in d?J(d,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):d[t]=o;var I=(d,t,o)=>(X(d,typeof t!="symbol"?t+"":t,o),o);const e=require("vue"),Q=require("mitt"),Z=require("dragselect"),ee=require("vanilla-lazyload");require("cropperjs/dist/cropper.css");const te=require("cropperjs"),oe=require("@uppy/core"),re=require("@uppy/xhr-upload");require("microtip/microtip.css");var P;const H=(P=document.querySelector('meta[name="csrf-token"]'))==null?void 0:P.getAttribute("content");class ae{constructor(t){I(this,"config");this.config=t}get config(){return this.config}transformRequestParams(t){const o=this.config,a={};H!=null&&H!==""&&(a[o.xsrfHeaderName]=H);const r=Object.assign({},o.headers,a,t.headers),l=Object.assign({},o.params,t.params),c=t.body,s=o.baseUrl+t.url,n=t.method;let i;n!=="get"&&(c instanceof FormData?(i=c,o.body!=null&&Object.entries(this.config.body).forEach(([f,h])=>{i.append(f,h)})):(i={...c},o.body!=null&&Object.assign(i,this.config.body)));const p={url:s,method:n,headers:r,params:l,body:i};if(o.transformRequest!=null){const f=o.transformRequest({url:s,method:n,headers:r,params:l,body:i});f.url!=null&&(p.url=f.url),f.method!=null&&(p.method=f.method),f.params!=null&&(p.params=f.params??{}),f.headers!=null&&(p.headers=f.headers??{}),f.body!=null&&(p.body=f.body)}return p}getDownloadUrl(t,o){if(o.url!=null)return o.url;const a=this.transformRequestParams({url:"",method:"get",params:{q:"download",adapter:t,path:o.path}});return a.url+"?"+new URLSearchParams(a.params).toString()}getPreviewUrl(t,o){if(o.url!=null)return o.url;const a=this.transformRequestParams({url:"",method:"get",params:{q:"preview",adapter:t,path:o.path}});return a.url+"?"+new URLSearchParams(a.params).toString()}async send(t){const o=this.transformRequestParams(t),a=t.responseType||"json",r={method:t.method,headers:o.headers,signal:t.abortSignal},l=o.url+"?"+new URLSearchParams(o.params);if(o.method!=="get"&&o.body!=null){let s;o.body instanceof FormData?s=t.body:(s=JSON.stringify(o.body),r.headers["Content-Type"]="application/json"),r.body=s}const c=await fetch(l,r);if(c.ok)return await c[a]();throw await c.json()}}function ne(d){const t={baseUrl:"",headers:{},params:{},body:{},xsrfHeaderName:"X-CSRF-Token"};return typeof d=="string"?Object.assign(t,{baseUrl:d}):Object.assign(t,d),new ae(t)}function le(d){let t=localStorage.getItem(d+"_storage");const o=e.reactive(JSON.parse(t??"{}"));e.watch(o,a);function a(){Object.keys(o).length?localStorage.setItem(d+"_storage",JSON.stringify(o)):localStorage.removeItem(d+"_storage")}function r(n,i){o[n]=i}function l(n){delete o[n]}function c(){Object.keys(o).map(n=>l(n))}return{getStore:(n,i=null)=>o.hasOwnProperty(n)?o[n]:i,setStore:r,removeStore:l,clearStore:c}}async function se(d,t){const o=t[d];return typeof o=="function"?(await o()).default:o}function ie(d,t,o,a){const{getStore:r,setStore:l}=d,c=e.ref({}),s=e.ref(r("locale",t)),n=(f,h=t)=>{se(f,a).then(g=>{c.value=g,l("locale",f),s.value=f,l("translations",g),Object.values(a).length>1&&(o.emit("vf-toast-push",{label:"The language is set to "+f}),o.emit("vf-language-saved"))}).catch(g=>{h?(o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),n(h,null)):o.emit("vf-toast-push",{label:"Locale cannot be loaded!",type:"error"})})};!r("locale")&&!a.length?n(t):c.value=r("translations");const i=(f,...h)=>h.length?i(f=f.replace("%s",h.shift()),...h):f;function p(f,...h){return c.value&&c.value.hasOwnProperty(f)?i(c.value[f],...h):i(f,...h)}return{t:p,changeLocale:n,locale:s}}const $={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"},ce=Object.values($),de="2.2.5";function W(d,t,o,a,r){return(t=Math,o=t.log,a=1024,r=o(d)/o(a)|0,d/t.pow(a,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"iB":"B")}function G(d,t,o,a,r){return(t=Math,o=t.log,a=1e3,r=o(d)/o(a)|0,d/t.pow(a,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"B":"B")}function ue(d){const t={k:1,m:2,g:3,t:4},a=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(d);return a[1]*Math.pow(1024,t[a[2].toLowerCase()])}const j={SYSTEM:"system",LIGHT:"light",DARK:"dark"};function me(d,t){const o=e.ref(j.SYSTEM),a=e.ref(j.LIGHT);o.value=d.getStore("theme",t??j.SYSTEM);const r=window.matchMedia("(prefers-color-scheme: dark)"),l=c=>{o.value===j.DARK||o.value===j.SYSTEM&&c.matches?a.value=j.DARK:a.value=j.LIGHT};return l(r),r.addEventListener("change",l),{value:o,actualValue:a,set(c){o.value=c,c!==j.SYSTEM?d.setStore("theme",c):d.removeStore("theme"),l(r)}}}const pe=(d,t)=>{const o=le(d.id),a=Q(),r=o.getStore("metricUnits",!1),l=me(o,d.theme),c=t.i18n,s=d.locale??t.locale,n=e.computed(()=>ie(o,s,a,c)),i=f=>Array.isArray(f)?f:ce,p=d.persist?o.getStore("path",d.path):d.path;return e.reactive({version:de,root:null,debug:d.debug,emitter:a,features:i(d.features),requester:ne(d.request),theme:l,view:o.getStore("viewport","grid"),fullScreen:o.getStore("full-screen",d.fullScreen),selectButton:d.selectButton,metricUnits:r,filesize:r?G:W,maxFileSize:d.maxFileSize,loading:!1,i18n:n,modal:{active:!1,type:"delete",data:{}},adapter:o.getStore("adapter"),path:p,persist:d.persist,storage:o,data:{adapter:o.getStore("adapter"),storages:[],dirname:p,files:[]},selectedItems:[]})},fe={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},ve={key:0,class:"flex text-center"},he=["aria-label"],ge=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})],-1),ke=[ge],ye=["aria-label"],_e=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-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 00-9-9z"})],-1),xe=[_e],we=["aria-label"],be=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1),Ee=[be],Ve=["aria-label"],Ne=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),Be=[Ne],$e=["aria-label"],Ce=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})],-1),Se=[Ce],De=["aria-label"],Me=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"},null,-1),je=[Me],Te=["aria-label"],Le=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"},null,-1),Fe=[Le],ze={key:1,class:"flex text-center"},Ae={class:"pl-2"},Oe={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Ue={key:0,class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},He=e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),Re=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"},null,-1),qe=[He,Re],Ie={class:"flex text-center items-center justify-end"},Pe=["aria-label"],We={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ge={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9L3.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.5l5.25 5.25"},Ye={key:1,"stroke-linecap":"round","stroke-linejoin":"round",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"},Ke=["aria-label"],Je={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"},Xe={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"},Qe={name:"VFToolbar"},Ze=Object.assign(Qe,{setup(d){const t=e.inject("ServiceContainer"),{setStore:o}=t.storage,{t:a}=t.i18n,r=e.ref([]),l=e.ref("");t.emitter.on("vf-search-query",({newQuery:n})=>{l.value=n});const c=()=>{t.fullScreen=!t.fullScreen,o("full-screen",t.fullScreen),t.emitter.emit("vf-fullscreen-toggle")};t.emitter.on("vf-nodes-selected",n=>{r.value=n});const s=()=>{t.view=t.view==="list"?"grid":"list",o("viewport",t.view)};return(n,i)=>(e.openBlock(),e.createElementBlock("div",fe,[l.value.length?(e.openBlock(),e.createElementBlock("div",ze,[e.createElementVNode("div",Ae,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Oe,e.toDisplayString(l.value),1)]),e.unref(t).loading?(e.openBlock(),e.createElementBlock("svg",Ue,qe)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ve,[e.unref(t).features.includes(e.unref($).NEW_FOLDER)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:i[0]||(i[0]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"new-folder",items:r.value}))},ke,8,he)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).NEW_FILE)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[1]||(i[1]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"new-file",items:r.value}))},xe,8,ye)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).RENAME)?(e.openBlock(),e.createElementBlock("div",{key:2,class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[2]||(i[2]=p=>r.value.length!=1||e.unref(t).emitter.emit("vf-modal-show",{type:"rename",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length==1?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ee,2))],8,we)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).DELETE)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[3]||(i[3]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"delete",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Be,2))],8,Ve)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).UPLOAD)?(e.openBlock(),e.createElementBlock("div",{key:4,class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[4]||(i[4]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"upload",items:r.value}))},Se,8,$e)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).UNARCHIVE)&&r.value.length==1&&r.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:5,class:"mx-1.5","aria-label":e.unref(a)("Unarchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[5]||(i[5]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"unarchive",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},je,2))],8,De)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).ARCHIVE)?(e.openBlock(),e.createElementBlock("div",{key:6,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[6]||(i[6]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"archive",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Fe,2))],8,Te)):e.createCommentVNode("",!0)])),e.createElementVNode("div",Ie,[e.unref(t).features.includes(e.unref($).FULL_SCREEN)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:c},[(e.openBlock(),e.createElementBlock("svg",We,[e.unref(t).fullScreen?(e.openBlock(),e.createElementBlock("path",Ge)):(e.openBlock(),e.createElementBlock("path",Ye))]))],8,Pe)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:i[7]||(i[7]=p=>l.value.length||s())},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.value.length?"stroke-gray-200 dark:stroke-gray-700":"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.unref(t).view==="grid"?(e.openBlock(),e.createElementBlock("path",Je)):e.createCommentVNode("",!0),e.unref(t).view==="list"?(e.openBlock(),e.createElementBlock("path",Xe)):e.createCommentVNode("",!0)],2))],8,Ke)])]))}}),et=(d,t=0,o=!1)=>{let a;return(...r)=>{o&&!a&&d(...r),clearTimeout(a),a=setTimeout(()=>{d(...r)},t)}},tt=(d,t,o)=>{const a=e.ref(d);return e.customRef((r,l)=>({get(){return r(),a.value},set:et(c=>{a.value=c,l()},t,o)}))},ot={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"},rt=["aria-label"],at=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1),nt=[at],lt=["aria-label"],st=e.createElementVNode("path",{d:"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-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.2s12.5 14.8 22.2 14.8H463.5z"},null,-1),it=[st],ct=["aria-label"],dt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),ut=[dt],mt=e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},null,-1),pt=[mt],ft={class:"flex leading-6"},vt=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),ht=["onDragover","onDragleave","onDrop","title","onClick"],gt={key:0,class:"animate-spin p-1 h-6 w-6 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},kt=e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),yt=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"},null,-1),_t=[kt,yt],xt={key:3,class:"relative flex bg-white dark:bg-gray-700 justify-between items-center rounded p-1 ml-2 w-full"},wt=e.createElementVNode("div",null,[e.createElementVNode("svg",{class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})])],-1),bt=["placeholder"],Et=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),Vt=[Et],Nt={name:"VFBreadcrumb"},Bt=Object.assign(Nt,{setup(d){const t=e.ref(null),o=e.ref([]),a=e.ref(!1),r=e.ref(null),l=e.inject("ServiceContainer"),{t:c}=l.i18n;l.emitter.on("vf-explorer-update",()=>{let y=[],m=[];t.value=l.data.dirname??l.adapter+"://",t.value.length==0&&(o.value=[]),t.value.replace(l.adapter+"://","").split("/").forEach(function(u){y.push(u),y.join("/")!=""&&m.push({basename:u,name:u,path:l.adapter+"://"+y.join("/"),type:"dir"})}),m.length>4&&(m=m.slice(-5),m[0].name=".."),o.value=m});const s=()=>{a.value=!1,i.value=""};l.emitter.on("vf-search-exit",()=>{s()});const n=()=>{l.features.includes($.SEARCH)&&(a.value=!0,e.nextTick(()=>r.value.focus()))},i=tt("",400);e.watch(i,y=>{l.emitter.emit("vf-toast-clear"),l.emitter.emit("vf-search-query",{newQuery:y})});const p=()=>o.value.length&&!a.value,f=(y,m=null)=>{y.preventDefault(),g(y),m??(m=o.value.length-2);let u=JSON.parse(y.dataTransfer.getData("items"));if(u.find(B=>B.storage!==l.adapter)){alert("Moving items between different storages is not supported yet.");return}l.emitter.emit("vf-modal-show",{type:"move",items:{from:u,to:o.value[m]??{path:l.adapter+"://"}}})},h=y=>{y.preventDefault(),p()?(y.dataTransfer.dropEffect="copy",y.currentTarget.classList.add("bg-blue-200","dark:bg-slate-500")):(y.dataTransfer.dropEffect="none",y.dataTransfer.effectAllowed="none")},g=y=>{y.preventDefault(),y.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-500"),p()&&y.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-500")},w=()=>{i.value==""&&s()};return(y,m)=>(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("span",{"aria-label":e.unref(c)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:m[0]||(m[0]=u=>h(u)),onDragleave:m[1]||(m[1]=u=>g(u)),onDrop:m[2]||(m[2]=u=>f(u)),onClick:m[3]||(m[3]=u=>{var B;return!p()||e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:((B=o.value[o.value.length-2])==null?void 0:B.path)??e.unref(l).adapter+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",p()?"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"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},nt,34))],8,rt),e.unref(l).loading?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(c)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:m[5]||(m[5]=u=>e.unref(l).emitter.emit("vf-fetch-abort")),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"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"},ut))],8,ct)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(c)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:m[4]||(m[4]=u=>{e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:e.unref(l).data.dirname}})}),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",xmlns:"http://www.w3.org/2000/svg",viewBox:"-40 -40 580 580",fill:"currentColor"},it))],8,lt)),a.value?(e.openBlock(),e.createElementBlock("div",xt,[wt,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:r,onKeydown:e.withKeys(s,["esc"]),onBlur:w,"onUpdate:modelValue":m[10]||(m[10]=u=>e.isRef(i)?i.value=u:null),placeholder:e.unref(c)("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,bt),[[e.vModelText,e.unref(i)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:s,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Vt))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(n,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onDragover:m[6]||(m[6]=u=>h(u)),onDragleave:m[7]||(m[7]=u=>g(u)),onDrop:m[8]||(m[8]=u=>f(u,-1)),onClick:m[9]||(m[9]=u=>e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter}})),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",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},pt,32)),e.createElementVNode("div",ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(u,B)=>(e.openBlock(),e.createElementBlock("div",{key:B},[vt,e.createElementVNode("span",{onDragover:C=>B===o.value.length-1||h(C),onDragleave:C=>B===o.value.length-1||g(C),onDrop:C=>B===o.value.length-1||f(C,B),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",title:u.basename,onClick:C=>e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:u.path}})},e.toDisplayString(u.name),41,ht)]))),128))]),e.unref(l).loading?(e.openBlock(),e.createElementBlock("svg",gt,_t)):e.createCommentVNode("",!0)]))]))}}),Y=(d,t=null)=>new Date(d*1e3).toLocaleString(t??navigator.language??"en-US"),$t={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Ct=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1),St=[Ct],Dt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Mt=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1),jt=[Mt],Tt={name:"VFSortIcon"},O=Object.assign(Tt,{props:{direction:String},setup(d){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[d.direction==="down"?(e.openBlock(),e.createElementBlock("svg",$t,St)):e.createCommentVNode("",!0),d.direction==="up"?(e.openBlock(),e.createElementBlock("svg",Dt,jt)):e.createCommentVNode("",!0)]))}}),Lt=["onClick"],Ft={name:"VFToast.vue"},zt=Object.assign(Ft,{setup(d){const t=e.inject("ServiceContainer"),{getStore:o}=t.storage,a=e.ref(o("full-screen",!1)),r=e.ref([]),l=n=>n==="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",c=n=>{r.value.splice(n,1)},s=n=>{let i=r.value.findIndex(p=>p.id===n);i!==-1&&c(i)};return t.emitter.on("vf-toast-clear",()=>{r.value=[]}),t.emitter.on("vf-toast-push",n=>{let i=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");n.id=i,r.value.push(n),setTimeout(()=>{s(i)},5e3)}),(n,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.value.value?"fixed":"absolute","bottom-0 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,(p,f)=>(e.openBlock(),e.createElementBlock("div",{onClick:h=>c(f),key:p,class:e.normalizeClass([l(p.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(p.label),11,Lt))),128))]),_:1})],2))}});function q(d,t=14){let o=`((?=([\\w\\W]{0,${t}}))([\\w\\W]{${t+1},})([\\w\\W]{8,}))`;return d.replace(new RegExp(o),"$2..$4")}const At={class:"relative flex-auto flex flex-col overflow-hidden"},Ot={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Ut={class:"absolute"},Ht=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",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",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[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"})],-1),Rt={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"},qt=["onDblclick","onContextmenu","data-type","data-item","data-index"],It={class:"grid grid-cols-12 items-center"},Pt={class:"flex col-span-7 items-center"},Wt={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"},Gt=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=[Gt],Kt={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"},Jt=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),Xt=[Jt],Qt={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Zt={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},eo=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],to={class:"grid grid-cols-12 items-center"},oo={class:"flex col-span-7 items-center"},ro={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"},ao=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),no=[ao],lo={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"},so=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),io=[so],co={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},uo={class:"col-span-2 text-center"},mo={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},po=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],fo={class:"relative"},vo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto 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"},ho=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),go=[ho],ko=["data-src","alt"],yo={key:2,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},_o=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),xo=[_o],wo={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},bo={class:"break-all"},Eo={name:"VFExplorer"},Vo=Object.assign(Eo,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;t.storage;const a=k=>k==null?void 0:k.substring(0,3),r=e.ref(null),l=e.ref(null),c=e.ref(0),s=e.ref(null),n=Math.floor(Math.random()*2**32),i=e.ref("");let p;t.emitter.on("vf-fullscreen-toggle",()=>{r.value.style.height=null}),t.emitter.on("vf-search-query",({newQuery:k})=>{i.value=k,k?t.emitter.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:k},onSuccess:b=>{b.files.length||t.emitter.emit("vf-toast-push",{label:o("No search result found.")})}}):t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let f=null;const h=()=>{f&&clearTimeout(f)},g=e.ref(!0),w=k=>{k.touches.length>1&&(g.value?(s.value.stop(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: off")})):(s.value.start(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: on")}),t.emitter.emit("vf-explorer-update")),g.value=!g.value)},y=k=>{f=setTimeout(()=>{const b=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:k.target.getBoundingClientRect().x,clientY:k.target.getBoundingClientRect().y});k.target.dispatchEvent(b)},500)},m=k=>{k.type==="dir"?(t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:k.path}})):t.emitter.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:k})},u=e.reactive({active:!1,column:"",order:""}),B=(k=!0)=>{let b=[...t.data.files],_=u.column,E=u.order=="asc"?1:-1;if(!k)return b;const x=(v,V)=>typeof v=="string"&&typeof V=="string"?v.toLowerCase().localeCompare(V.toLowerCase()):v<V?-1:v>V?1:0;return u.active&&(b=b.slice().sort((v,V)=>x(v[_],V[_])*E)),b},C=k=>{u.active&&u.column==k?(u.active=u.order=="asc",u.column=k,u.order="desc"):(u.active=!0,u.column=k,u.order="asc")},M=()=>s.value.getSelection().map(k=>JSON.parse(k.dataset.item)),L=(k,b)=>{if(k.altKey||k.ctrlKey||k.metaKey)return k.preventDefault(),!1;k.dataTransfer.setDragImage(l.value,0,15),k.dataTransfer.effectAllowed="all",k.dataTransfer.dropEffect="copy",k.dataTransfer.setData("items",JSON.stringify(M()))},F=(k,b)=>{k.preventDefault();let _=JSON.parse(k.dataTransfer.getData("items"));if(_.find(E=>E.storage!==t.adapter)){alert("Moving items between different storages is not supported yet.");return}t.emitter.emit("vf-modal-show",{type:"move",items:{from:_,to:b}})},z=(k,b)=>{k.preventDefault(),!b||b.type!=="dir"||s.value.getSelection().find(_=>_==k.currentTarget)?(k.dataTransfer.dropEffect="none",k.dataTransfer.effectAllowed="none"):k.dataTransfer.dropEffect="copy"},A=()=>{s.value=new Z({area:r.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),t.emitter.on("vf-explorer-update",()=>e.nextTick(()=>{s.value.clearSelection(),s.value.setSettings({selectables:document.getElementsByClassName("vf-item-"+n)})})),s.value.subscribe("predragstart",({event:k,isDragging:b})=>{if(b)c.value=s.value.getSelection().length,s.value.break();else{const _=k.target.offsetWidth-k.offsetX,E=k.target.offsetHeight-k.offsetY;_<15&&E<15&&(s.value.clearSelection(),s.value.break())}}),s.value.subscribe("predragmove",({isDragging:k})=>{k&&s.value.break()}),s.value.subscribe("callback",({items:k,event:b,isDragging:_})=>{t.emitter.emit("vf-nodes-selected",M()),c.value=s.value.getSelection().length})};return e.onMounted(()=>{p=new ee(r.value),A()}),e.onUpdated(()=>{s.value.Area.reset(),s.value.SelectorArea.updatePos(),p.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>t.emitter.emit("vf-explorer-update"))}),e.onBeforeUnmount(()=>{p.destroy()}),(k,b)=>(e.openBlock(),e.createElementBlock("div",At,[e.unref(t).view=="list"||i.value.length?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",{onClick:b[0]||(b[0]=_=>C("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Name"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="basename"]])]),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:b[1]||(b[1]=_=>C("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Size"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="file_size"]])])),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:b[2]||(b[2]=_=>C("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Date"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="last_modified"]])])),i.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:b[3]||(b[3]=_=>C("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Filepath"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ut,[e.createElementVNode("div",{ref_key:"dragImage",ref:l,class:"absolute -z-50 -top-96"},[Ht,e.createElementVNode("div",Rt,e.toDisplayString(c.value),1)],512)]),e.createElementVNode("div",{onTouchstart:w,onContextmenu:b[10]||(b[10]=e.withModifiers(_=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:_,area:r.value,items:M()}),["self","prevent"])),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"]),ref_key:"selectorArea",ref:r},[i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B(),(_,E)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:x=>m(_),onTouchstart:b[4]||(b[4]=x=>y(x)),onTouchend:b[5]||(b[5]=x=>h()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:_}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(n),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":_.type,"data-item":JSON.stringify(_),"data-index":E},[e.createElementVNode("div",It,[e.createElementVNode("div",Pt,[_.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Wt,Yt)):(e.openBlock(),e.createElementBlock("svg",Kt,Xt)),e.createElementVNode("span",Qt,e.toDisplayString(_.basename),1)]),e.createElementVNode("div",Zt,e.toDisplayString(_.path),1)])],42,qt))),256)):e.createCommentVNode("",!0),e.unref(t).view==="list"&&!i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B(),(_,E)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:x=>m(_),onTouchstart:b[6]||(b[6]=x=>y(x)),onTouchend:b[7]||(b[7]=x=>h()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:_}),["prevent"]),onDragstart:x=>L(x),onDragover:x=>z(x,_),onDrop:x=>F(x,_),class:e.normalizeClass(["vf-item-"+e.unref(n),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":_.type,"data-item":JSON.stringify(_),"data-index":E},[e.createElementVNode("div",to,[e.createElementVNode("div",oo,[_.type==="dir"?(e.openBlock(),e.createElementBlock("svg",ro,no)):(e.openBlock(),e.createElementBlock("svg",lo,io)),e.createElementVNode("span",co,e.toDisplayString(_.basename),1)]),e.createElementVNode("div",uo,e.toDisplayString(_.file_size?e.unref(t).filesize(_.file_size):""),1),e.createElementVNode("div",mo,e.toDisplayString(e.unref(Y)(_.last_modified)),1)])],42,eo))),256)):e.createCommentVNode("",!0),e.unref(t).view==="grid"&&!i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(B(!1),(_,E)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:x=>m(_),onTouchstart:b[8]||(b[8]=x=>y(x)),onTouchend:b[9]||(b[9]=x=>h()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:_}),["prevent"]),onDragstart:x=>L(x),onDragover:x=>z(x,_),onDrop:x=>F(x,_),class:e.normalizeClass(["vf-item-"+e.unref(n),"border border-transparent hover:bg-neutral-50 m-1 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 text-center justify-center select-none"]),"data-type":_.type,"data-item":JSON.stringify(_),"data-index":E},[e.createElementVNode("div",null,[e.createElementVNode("div",fo,[_.type==="dir"?(e.openBlock(),e.createElementBlock("svg",vo,go)):(_.mime_type??"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(t).requester.getPreviewUrl(e.unref(t).adapter,_),alt:_.basename},null,8,ko)):(e.openBlock(),e.createElementBlock("svg",yo,xo)),!(_.mime_type??"").startsWith("image")&&_.type!="dir"?(e.openBlock(),e.createElementBlock("div",wo,e.toDisplayString(a(_.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",bo,e.toDisplayString(e.unref(q)(_.basename)),1)])],42,po))),256)):e.createCommentVNode("",!0)],34),e.createVNode(zt)]))}}),No=["href","download"],Bo=["onClick"],$o={name:"VFContextMenu"},Co=Object.assign($o,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=e.ref(null),r=e.ref([]),l=e.ref(""),c=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),s=e.computed(()=>c.items.filter(f=>f.key==null||t.features.includes(f.key)));t.emitter.on("vf-context-selected",f=>{r.value=f});const n={newfolder:{key:$.NEW_FOLDER,title:()=>o("New Folder"),action:()=>{t.emitter.emit("vf-modal-show",{type:"new-folder"})}},delete:{key:$.DELETE,title:()=>o("Delete"),action:()=>{t.emitter.emit("vf-modal-show",{type:"delete",items:r})}},refresh:{title:()=>o("Refresh"),action:()=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})}},preview:{key:$.PREVIEW,title:()=>o("Preview"),action:()=>{t.emitter.emit("vf-modal-show",{type:"preview",adapter:t.data.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.data.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.data.adapter,path:r.value[0].dir}})}},download:{key:$.DOWNLOAD,link:e.computed(()=>t.requester.getDownloadUrl(t.data.adapter,r.value[0])),title:()=>o("Download"),action:()=>{}},archive:{key:$.ARCHIVE,title:()=>o("Archive"),action:()=>{t.emitter.emit("vf-modal-show",{type:"archive",items:r})}},unarchive:{key:$.UNARCHIVE,title:()=>o("Unarchive"),action:()=>{t.emitter.emit("vf-modal-show",{type:"unarchive",items:r})}},rename:{key:$.RENAME,title:()=>o("Rename"),action:()=>{t.emitter.emit("vf-modal-show",{type:"rename",items:r})}}},i=f=>{t.emitter.emit("vf-contextmenu-hide"),f.action()};t.emitter.on("vf-search-query",({newQuery:f})=>{l.value=f}),t.emitter.on("vf-contextmenu-show",({event:f,area:h,items:g,target:w=null})=>{if(c.items=[],l.value)if(w)c.items.push(n.openDir),t.emitter.emit("vf-context-selected",[w]);else return;else!w&&!l.value?(c.items.push(n.refresh),c.items.push(n.newfolder),t.emitter.emit("vf-context-selected",[])):g.length>1&&g.some(y=>y.path===w.path)?(c.items.push(n.refresh),c.items.push(n.archive),c.items.push(n.delete),t.emitter.emit("vf-context-selected",g)):(w.type=="dir"?c.items.push(n.open):(c.items.push(n.preview),c.items.push(n.download)),c.items.push(n.rename),w.mime_type=="application/zip"?c.items.push(n.unarchive):c.items.push(n.archive),c.items.push(n.delete),t.emitter.emit("vf-context-selected",[w]));p(f,h)}),t.emitter.on("vf-contextmenu-hide",()=>{c.active=!1});const p=(f,h)=>{c.active=!0,e.nextTick(()=>{const g=t.root.getBoundingClientRect(),w=h.getBoundingClientRect();let y=f.pageX-g.left,m=f.pageY-g.top,u=a.value.offsetHeight,B=a.value.offsetWidth;y=w.right-f.pageX+window.scrollX<B?y-B:y,m=w.bottom-f.pageY+window.scrollY<u?m-u:m,c.positions={left:y+"px",top:m+"px"}})};return(f,h)=>c.active?(e.openBlock(),e.createElementBlock("ul",{key:0,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 select-none",ref_key:"contextmenu",ref:a,style:e.normalizeStyle(c.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,g=>(e.openBlock(),e.createElementBlock("li",{class:"cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:g.title},[g.link?(e.openBlock(),e.createElementBlock("a",{key:0,class:"block pl-2 pr-3 py-1",target:"_blank",href:g.link,download:g.link,onClick:h[0]||(h[0]=w=>e.unref(t).emitter.emit("vf-contextmenu-hide"))},[e.createElementVNode("span",null,e.toDisplayString(g.title()),1)],8,No)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"pl-2 pr-3 py-1",onClick:w=>i(g)},[e.createElementVNode("span",null,e.toDisplayString(g.title()),1)],8,Bo))]))),128))],4)):e.createCommentVNode("",!0)}}),So={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Do={class:"flex leading-5 items-center"},Mo=["aria-label"],jo=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[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"})],-1),To=[jo],Lo=["value"],Fo={class:"ml-3"},zo={key:0},Ao={class:"ml-1"},Oo={class:"flex leading-5 items-center justify-end"},Uo=["disabled"],Ho=["aria-label"],Ro=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 stroke-slate-500 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[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 11-18 0 9 9 0 0118 0z"})],-1),qo=[Ro],Io={name:"VFStatusbar"},Po=Object.assign(Io,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,{setStore:a}=t.storage,r=e.ref(0),l=()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.adapter}}),a("adapter",t.adapter)};t.emitter.on("vf-nodes-selected",n=>{r.value=n.length});const c=e.ref("");t.emitter.on("vf-search-query",({newQuery:n})=>{c.value=n});const s=e.computed(()=>{const n=t.selectButton.multiple?t.selectedItems.length>0:t.selectedItems.length===1;return t.selectButton.active&&n});return(n,i)=>(e.openBlock(),e.createElementBlock("div",So,[e.createElementVNode("div",Do,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(o)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},To,8,Mo),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i[0]||(i[0]=p=>e.unref(t).adapter=p),onChange:l,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).data.storages,p=>(e.openBlock(),e.createElementBlock("option",{value:p},e.toDisplayString(p),9,Lo))),256))],544),[[e.vModelSelect,e.unref(t).adapter]]),e.createElementVNode("div",Fo,[c.value.length?(e.openBlock(),e.createElementBlock("span",zo,e.toDisplayString(e.unref(t).data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Ao,e.toDisplayString(r.value>0?e.unref(o)("%s item(s) selected.",r.value):""),1)])]),e.createElementVNode("div",Oo,[e.unref(t).selectButton.active?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vf-btn py-0 vf-btn-primary",{disabled:!s.value}]),disabled:!s.value,onClick:i[1]||(i[1]=p=>e.unref(t).selectButton.click(e.unref(t).selectedItems,p))},e.toDisplayString(e.unref(o)("Select")),11,Uo)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(o)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:i[2]||(i[2]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"about"}))},qo,8,Ho)])]))}}),Wo={name:"VueFinder"},Go=Object.assign(Wo,{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},selectButton:{type:Object,default(d){return{active:!1,multiple:!1,click:t=>{},...d}}}},emits:["select"],setup(d,{emit:t}){const o=t,r=pe(d,e.inject("VueFinderOptions"));e.provide("ServiceContainer",r);const{setStore:l}=r.storage,c=e.ref(null);r.root=c,r.i18n,r.emitter.on("vf-modal-close",()=>{r.modal.active=!1}),r.emitter.on("vf-modal-show",i=>{r.modal.active=!0,r.modal.type=i.type,r.modal.data=i});const s=i=>{Object.assign(r.data,i),r.emitter.emit("vf-nodes-selected",{}),r.emitter.emit("vf-explorer-update")};r.emitter.on("vf-nodes-selected",i=>{r.selectedItems=i,o("select",i)});let n;return r.emitter.on("vf-fetch-abort",()=>{n.abort(),r.loading=!1}),r.emitter.on("vf-fetch",({params:i,body:p=null,onSuccess:f=null,onError:h=null,noCloseModal:g=!1})=>{["index","search"].includes(i.q)&&(n&&n.abort(),r.loading=!0),n=new AbortController;const w=n.signal;r.requester.send({url:"",method:i.m||"get",params:i,body:p,abortSignal:w}).then(y=>{r.adapter=y.adapter,r.persist&&(r.path=y.dirname,l("path",r.path)),["index","search"].includes(i.q)&&(r.loading=!1),g||r.emitter.emit("vf-modal-close"),s(y),f&&f(y)}).catch(y=>{console.error(y),h&&h(y)})}),r.emitter.on("vf-download",i=>{const p=document.createElement("a");p.style.display="none",p.target="_blank",p.href=i,p.download=i,r.root.appendChild(p),p.click(),p.remove()}),e.onMounted(()=>{let i={};r.path.includes("://")&&(i={adapter:r.path.split("://")[0],path:r.path}),r.emitter.emit("vf-fetch",{params:{q:"index",adapter:r.adapter,...i}})}),(i,p)=>(e.openBlock(),e.createElementBlock("div",{class:"vuefinder",ref_key:"root",ref:c},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).theme.actualValue==="dark"?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r).fullScreen?"fixed w-screen inset-0 z-20":"relative rounded-md","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(e.unref(r).fullScreen?"":"max-height: "+d.maxHeight),onMousedown:p[0]||(p[0]=f=>e.unref(r).emitter.emit("vf-contextmenu-hide")),onTouchstart:p[1]||(p[1]=f=>e.unref(r).emitter.emit("vf-contextmenu-hide"))},[e.createVNode(Ze),e.createVNode(Bt),e.createVNode(Vo),e.createVNode(Po)],38),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r).modal.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+e.unref(r).modal.type),{key:0})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Co)],2)],512))}}),Yo=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),Ko={class:"fixed z-10 inset-0 overflow-hidden"},Jo={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-5xl w-full"},Xo={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qo={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"},S={__name:"ModalLayout",setup(d){const t=e.inject("ServiceContainer");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:a[1]||(a[1]=e.withKeys(r=>e.unref(t).emitter.emit("vf-modal-close"),["esc"])),tabindex:"0"},[Yo,e.createElementVNode("div",Ko,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:a[0]||(a[0]=e.withModifiers(r=>e.unref(t).emitter.emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Jo,[e.createElementVNode("div",Xo,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Qo,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},Zo=["aria-label"],er=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),tr=[er],or={name:"Message"},D=Object.assign(or,{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(d,{emit:t}){var i;const o=t,a=e.inject("ServiceContainer"),{t:r}=a.i18n,l=e.ref(!1),c=e.ref(null),s=e.ref((i=c.value)==null?void 0:i.strMessage);e.watch(s,()=>l.value=!1);const n=()=>{o("hidden"),l.value=!0};return(p,f)=>(e.openBlock(),e.createElementBlock("div",null,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:c,class:e.normalizeClass(["flex mt-2 p-1 px-2 rounded text-sm break-all dark:opacity-75",d.error?"bg-red-100 text-red-600 ":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(p.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:n,"aria-label":e.unref(r)("Close"),"data-microtip-position":"top-left",role:"tooltip"},tr,8,Zo)],2))]))}}),rr={class:"sm:flex sm:items-start"},ar=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),nr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},lr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},sr={class:"mt-2"},ir={class:"text-sm text-gray-500"},cr={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},dr={class:"flex text-sm text-gray-800 dark:text-gray-400"},ur={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"},mr=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),pr=[mr],fr={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"},vr=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),hr=[vr],gr={class:"ml-1.5"},kr={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},yr={name:"VFModalDelete"},_r=Object.assign(yr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(t.modal.data.items),r=e.ref(""),l=()=>{a.value.length&&t.emitter.emit("vf-fetch",{params:{q:"delete",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:a.value.map(({path:c,type:s})=>({path:c,type:s}))},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files deleted.")})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-danger"},e.toDisplayString(e.unref(o)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",kr,e.toDisplayString(e.unref(o)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",rr,[ar,e.createElementVNode("div",nr,[e.createElementVNode("h3",lr,e.toDisplayString(e.unref(o)("Delete files")),1),e.createElementVNode("div",sr,[e.createElementVNode("p",ir,e.toDisplayString(e.unref(o)("Are you sure you want to delete these files?")),1),e.createElementVNode("div",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,n=>(e.openBlock(),e.createElementBlock("p",dr,[n.type==="dir"?(e.openBlock(),e.createElementBlock("svg",ur,pr)):(e.openBlock(),e.createElementBlock("svg",fr,hr)),e.createElementVNode("span",gr,e.toDisplayString(n.basename),1)]))),256))]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[0]||(s[0]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),xr={class:"sm:flex sm:items-start"},wr=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:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1),br={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Er={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Vr={class:"mt-2"},Nr={class:"text-sm text-gray-500"},Br={name:"VFModalMessage"},$r=Object.assign(Br,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;return(a,r)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=l=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var l,c;return[e.createElementVNode("div",xr,[wr,e.createElementVNode("div",br,[e.createElementVNode("h3",Er,e.toDisplayString(((l=e.unref(t).modal.data)==null?void 0:l.title)??"Title"),1),e.createElementVNode("div",Vr,[e.createElementVNode("p",Nr,e.toDisplayString(((c=e.unref(t).modal.data)==null?void 0:c.message)??"Message"),1)])])])]}),_:1}))}}),Cr={class:"sm:flex sm:items-start"},Sr=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),Dr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Mr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},jr={class:"mt-2"},Tr={class:"text-sm text-gray-500"},Lr=["placeholder"],Fr={name:"VFModalNewFolder"},zr=Object.assign(Fr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=()=>{a.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"newfolder",m:"post",adapter:t.adapter,path:t.data.dirname},body:{name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",a.value)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Cr,[Sr,e.createElementVNode("div",Dr,[e.createElementVNode("h3",Mr,e.toDisplayString(e.unref(o)("New Folder")),1),e.createElementVNode("div",jr,[e.createElementVNode("p",Tr,e.toDisplayString(e.unref(o)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onKeyup:e.withKeys(l,["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,Lr),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[1]||(s[1]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ar={class:"sm:flex sm:items-start"},Or=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),Ur={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Hr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Rr={class:"mt-2"},qr={class:"text-sm text-gray-500"},Ir=["placeholder"],Pr={name:"VFModalNewFile"},Wr=Object.assign(Pr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=()=>{a.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"newfile",m:"post",adapter:t.adapter,path:t.data.dirname},body:{name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",a.value)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ar,[Or,e.createElementVNode("div",Ur,[e.createElementVNode("h3",Hr,e.toDisplayString(e.unref(o)("New File")),1),e.createElementVNode("div",Rr,[e.createElementVNode("p",qr,e.toDisplayString(e.unref(o)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onKeyup:e.withKeys(l,["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,Ir),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[1]||(s[1]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Gr={class:"flex"},Yr=["aria-label"],Kr={class:"ml-auto mb-2"},Jr={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"},Xr={key:1},Qr={__name:"Text",emits:["success"],setup(d,{emit:t}){const o=t,a=e.ref(""),r=e.ref(""),l=e.ref(null),c=e.ref(!1),s=e.ref(""),n=e.ref(!1),i=e.inject("ServiceContainer"),{t:p}=i.i18n;e.onMounted(()=>{i.requester.send({url:"",method:"get",params:{q:"preview",adapter:i.modal.data.adapter,path:i.modal.data.item.path},responseType:"text"}).then(g=>{a.value=g,o("success")})});const f=()=>{c.value=!c.value,r.value=a.value,c.value==!0&&e.nextTick(()=>{l.value.focus()})},h=()=>{s.value="",n.value=!1,i.requester.send({url:"",method:"post",params:{q:"save",adapter:i.modal.data.adapter,path:i.modal.data.item.path},body:{content:r.value},responseType:"text"}).then(g=>{s.value=p("Updated."),a.value=g,o("success"),c.value=!c.value}).catch(g=>{s.value=p(g.message),n.value=!0})};return(g,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Gr,[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(i).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(i).modal.data.item.basename),9,Yr),e.createElementVNode("div",Kr,[c.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(p)("Save")),1)):e.createCommentVNode("",!0),e.unref(i).features.includes(e.unref($).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:w[0]||(w[0]=y=>f())},e.toDisplayString(c.value?e.unref(p)("Cancel"):e.unref(p)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",Xr,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:l,"onUpdate:modelValue":w[1]||(w[1]=y=>r.value=y),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",Jr,e.toDisplayString(a.value),1)),s.value.length?(e.openBlock(),e.createBlock(D,{key:2,onHidden:w[2]||(w[2]=y=>s.value=""),error:n.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},Zr={class:"flex"},ea=["aria-label"],ta={class:"ml-auto mb-2"},oa={class:"w-full flex justify-center"},ra=["src"],aa={__name:"Image",emits:["success"],setup(d,{emit:t}){const o=t,a=e.inject("ServiceContainer"),{t:r}=a.i18n,l=e.ref(null),c=e.ref(null),s=e.ref(!1),n=e.ref(""),i=e.ref(!1),p=()=>{s.value=!s.value,s.value?c.value=new te(l.value,{crop(h){}}):c.value.destroy()},f=()=>{c.value.getCroppedCanvas({width:795,height:341}).toBlob(h=>{n.value="",i.value=!1;const g=new FormData;g.set("file",h),a.requester.send({url:"",method:"post",params:{q:"upload",adapter:a.modal.data.adapter,path:a.modal.data.item.path},body:g}).then(w=>{n.value=r("Updated."),l.value.src=a.requester.getPreviewUrl(a.modal.data.adapter,a.modal.data.item),p(),o("success")}).catch(w=>{n.value=r(w.message),i.value=!0})})};return e.onMounted(()=>{o("success")}),(h,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Zr,[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(a).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(a).modal.data.item.basename),9,ea),e.createElementVNode("div",ta,[s.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f,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(a).features.includes(e.unref($).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:g[0]||(g[0]=w=>p())},e.toDisplayString(s.value?e.unref(r)("Cancel"):e.unref(r)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",oa,[e.createElementVNode("img",{ref_key:"image",ref:l,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(a).requester.getPreviewUrl(e.unref(a).modal.data.adapter,e.unref(a).modal.data.item),alt:""},null,8,ra)]),n.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:g[1]||(g[1]=w=>n.value=""),error:i.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},na={class:"flex"},la=["aria-label"],sa=e.createElementVNode("div",null,null,-1),ia={__name:"Default",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t;return e.onMounted(()=>{a("success")}),(r,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",na,[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,la)]),sa],64))}},ca=["aria-label"],da={class:"w-full",preload:"",controls:""},ua=["src"],ma={__name:"Video",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{a("success")}),(l,c)=>(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,ca),e.createElementVNode("div",null,[e.createElementVNode("video",da,[e.createElementVNode("source",{src:r(),type:"video/mp4"},null,8,ua),e.createTextVNode(" Your browser does not support the video tag. ")])])]))}},pa=["aria-label"],fa={class:"w-full",controls:""},va=["src"],ha={__name:"Audio",emits:["success"],setup(d,{emit:t}){const o=t,a=e.inject("ServiceContainer"),r=()=>a.requester.getPreviewUrl(a.modal.data.adapter,a.modal.data.item);return e.onMounted(()=>{o("success")}),(l,c)=>(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(a).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(a).modal.data.item.basename),9,pa),e.createElementVNode("div",null,[e.createElementVNode("audio",fa,[e.createElementVNode("source",{src:r(),type:"audio/mpeg"},null,8,va),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},ga=["aria-label"],ka=["data"],ya=["src"],_a=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),xa=[_a],wa={__name:"Pdf",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{a("success")}),(l,c)=>(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,ga),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%"},xa,8,ya)],8,ka)])],64))}},ba={class:"sm:flex sm:items-start"},Ea={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},Va={key:0},Na={class:"text-gray-700 dark:text-gray-200 text-sm"},Ba={key:0,class:"flex leading-5"},$a=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),Ca={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},Sa={class:"font-bold"},Da={class:"font-bold pl-2"},Ma={key:0,class:"text-xs text-gray-600 dark:text-gray-400"},ja=["download","href"],Ta={name:"VFModalPreview"},La=Object.assign(Ta,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=e.ref(!1),r=c=>(t.modal.data.item.mime_type??"").startsWith(c),l=t.features.includes($.PREVIEW);return l||(a.value=!0),(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[6]||(s[6]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1),e.unref(t).features.includes(e.unref($).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,ja)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",ba,[e.createElementVNode("div",Ea,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",Va,[r("text")?(e.openBlock(),e.createBlock(Qr,{key:0,onSuccess:s[0]||(s[0]=n=>a.value=!0)})):r("image")?(e.openBlock(),e.createBlock(aa,{key:1,onSuccess:s[1]||(s[1]=n=>a.value=!0)})):r("video")?(e.openBlock(),e.createBlock(ma,{key:2,onSuccess:s[2]||(s[2]=n=>a.value=!0)})):r("audio")?(e.openBlock(),e.createBlock(ha,{key:3,onSuccess:s[3]||(s[3]=n=>a.value=!0)})):r("application/pdf")?(e.openBlock(),e.createBlock(wa,{key:4,onSuccess:s[4]||(s[4]=n=>a.value=!0)})):(e.openBlock(),e.createBlock(ia,{key:5,onSuccess:s[5]||(s[5]=n=>a.value=!0)}))])):e.createCommentVNode("",!0),e.createElementVNode("div",Na,[a.value===!1?(e.openBlock(),e.createElementBlock("div",Ba,[$a,e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Ca,[e.createElementVNode("div",null,[e.createElementVNode("span",Sa,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",Da,e.toDisplayString(e.unref(o)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(Y)(e.unref(t).modal.data.item.last_modified)),1)])]),e.unref(t).features.includes(e.unref($).DOWNLOAD)?(e.openBlock(),e.createElementBlock("div",Ma,[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}))}}),Fa={class:"sm:flex sm:items-start"},za=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),Aa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Oa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ua={class:"mt-2"},Ha={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},Ra={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"},qa=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),Ia=[qa],Pa={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"},Wa=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),Ga=[Wa],Ya={class:"ml-1.5"},Ka={name:"VFModalRename"},Ja=Object.assign(Ka,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(t.modal.data.items[0]),r=e.ref(t.modal.data.items[0].basename),l=e.ref(""),c=()=>{r.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"rename",m:"post",adapter:t.adapter,path:t.data.dirname},body:{item:a.value.path,name:r.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is renamed.",r.value)})},onError:s=>{l.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Fa,[za,e.createElementVNode("div",Aa,[e.createElementVNode("h3",Oa,e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("div",Ua,[e.createElementVNode("p",Ha,[a.value.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Ra,Ia)):(e.openBlock(),e.createElementBlock("svg",Pa,Ga)),e.createElementVNode("span",Ya,e.toDisplayString(a.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>r.value=i),onKeyup:e.withKeys(c,["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]]),l.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[1]||(n[1]=i=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Xa={class:"sm:flex sm:items-start"},Qa=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),Za={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},en={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},tn={class:"mt-2"},on={key:0,class:"pointer-events-none"},rn={key:1,class:"pointer-events-none"},an=["disabled"],nn=["disabled"],ln={class:"text-gray-500 text-sm mb-1 pr-1 max-h-[200px] overflow-y-auto vf-scrollbar"},sn={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"},cn=["textContent"],dn={class:"ml-1 w-full h-fit"},un={class:"text-left hidden md:block"},mn={class:"text-left md:hidden"},pn={key:0,class:"ml-auto"},fn=["title","disabled","onClick"],vn=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),hn=[vn],gn={key:0,class:"py-2"},kn=["disabled"],yn={name:"VFModalUpload"},_n=Object.assign(yn,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=o("uppy"),r={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10},l=e.ref({QUEUE_ENTRY_STATUS:r}),c=e.ref(null),s=e.ref(null),n=e.ref(null),i=e.ref(null),p=e.ref(null),f=e.ref(null),h=e.ref([]),g=e.ref(""),w=e.ref(!1),y=e.ref(!1);let m;function u(E){return h.value.findIndex(x=>x.id===E)}function B(E,x=null){x=x??(E.webkitRelativePath||E.name),m.addFile({name:x,type:E.type,data:E,source:"Local"})}function C(E){switch(E.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=E=>{switch(E.status){case r.DONE:return"✓";case r.ERROR:case r.CANCELED:return"!";case r.PENDING:default:return"..."}};function L(){i.value.click()}function F(){if(!w.value){if(!h.value.filter(E=>E.status!==r.DONE).length){g.value=o("Please select file to upload first.");return}g.value="",m.retryAll(),m.upload()}}function z(){m.cancelAll({reason:"user"}),h.value.forEach(E=>{E.status!==r.DONE&&(E.status=r.CANCELED,E.statusName=o("Canceled"))}),w.value=!1}function A(E){w.value||(m.removeFile(E.id,"removed-by-user"),h.value.splice(u(E.id),1))}function k(E){if(!w.value){if(m.cancelAll({reason:"user"}),E){const x=[];h.value.forEach(v=>{v.status!==r.DONE&&x.push(v)}),h.value=[],x.forEach(v=>{B(v.originalFile,v.name)});return}h.value.splice(0)}}function b(){t.emitter.emit("vf-modal-close")}function _(){return t.requester.transformRequestParams({url:"",method:"post",params:{q:"upload",adapter:t.data.adapter,path:t.data.dirname}})}return e.onMounted(async()=>{m=new oe({debug:t.debug,restrictions:{maxFileSize:ue(t.maxFileSize)},locale:a,onBeforeFileAdded(v,V){if(V[v.id]!=null){const T=u(v.id);h.value[T].status===r.PENDING&&(g.value=m.i18n("noDuplicates",{fileName:v.name})),h.value=h.value.filter(U=>U.id!==v.id)}return h.value.push({id:v.id,name:v.name,size:t.filesize(v.size),status:r.PENDING,statusName:o("Pending upload"),percent:null,originalFile:v.data}),!0}}),m.use(re,{endpoint:"WILL_BE_REPLACED_BEFORE_UPLOAD",limit:5,timeout:0,getResponseError(v,V){let N;try{N=JSON.parse(v).message}catch{N=o("Cannot parse server response.")}return new Error(N)}}),m.on("restriction-failed",(v,V)=>{const N=h.value[u(v.id)];A(N),g.value=V.message}),m.on("upload",()=>{const v=_();m.setMeta({...v.body});const V=m.getPlugin("XHRUpload");V.opts.method=v.method,V.opts.endpoint=v.url+"?"+new URLSearchParams(v.params),V.opts.headers=v.headers,w.value=!0,h.value.forEach(N=>{N.status!==r.DONE&&(N.percent=null,N.status=r.UPLOADING,N.statusName=o("Pending upload"))})}),m.on("upload-progress",(v,V)=>{const N=Math.floor(V.bytesUploaded/V.bytesTotal*100);h.value[u(v.id)].percent=`${N}%`}),m.on("upload-success",v=>{const V=h.value[u(v.id)];V.status=r.DONE,V.statusName=o("Done")}),m.on("upload-error",(v,V)=>{const N=h.value[u(v.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")}),m.on("error",v=>{g.value=v.message,w.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname},noCloseModal:!0})}),m.on("complete",()=>{w.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname},noCloseModal:!0})}),i.value.addEventListener("click",()=>{s.value.click()}),p.value.addEventListener("click",()=>{n.value.click()}),f.value.addEventListener("dragover",v=>{v.preventDefault(),y.value=!0}),f.value.addEventListener("dragleave",v=>{v.preventDefault(),y.value=!1});function E(v,V){V.isFile&&V.file(N=>v(V,N)),V.isDirectory&&V.createReader().readEntries(N=>{N.forEach(T=>{E(v,T)})})}f.value.addEventListener("drop",v=>{v.preventDefault(),y.value=!1;const V=/^[/\\](.+)/;[...v.dataTransfer.items].forEach(N=>{N.kind==="file"&&E((T,U)=>{const K=V.exec(T.fullPath);B(U,K[1])},N.webkitGetAsEntry())})});const x=({target:v})=>{const V=v.files;for(const N of V)B(N);v.value=""};s.value.addEventListener("change",x),n.value.addEventListener("change",x)}),e.onBeforeUnmount(()=>{m==null||m.close({reason:"unmount"})}),(E,x)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["vf-btn vf-btn-primary",w.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:w.value,onClick:e.withModifiers(F,["prevent"])},e.toDisplayString(e.unref(o)("Upload")),11,kn),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(z,["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(b,["prevent"])},e.toDisplayString(e.unref(o)("Close")),1))]),default:e.withCtx(()=>[e.createElementVNode("div",Xa,[Qa,e.createElementVNode("div",Za,[e.createElementVNode("h3",en,e.toDisplayString(e.unref(o)("Upload Files")),1),e.createElementVNode("div",tn,[e.createElementVNode("div",{ref_key:"dropArea",ref:f,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:L},[y.value?(e.openBlock(),e.createElementBlock("div",on,e.toDisplayString(e.unref(o)("Release to drop these files.")),1)):(e.openBlock(),e.createElementBlock("div",rn,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:c,class:"text-gray-500 mb-1"},[e.createElementVNode("button",{ref_key:"pickFiles",ref:i,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Files")),513),e.createElementVNode("button",{ref_key:"pickFolders",ref:p,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:w.value,onClick:x[0]||(x[0]=v=>k(!1))},e.toDisplayString(e.unref(o)("Clear all")),9,an),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:w.value,onClick:x[1]||(x[1]=v=>k(!0))},e.toDisplayString(e.unref(o)("Clear only successful")),9,nn)],512),e.createElementVNode("div",ln,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,v=>(e.openBlock(),e.createElementBlock("div",{class:"flex hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-gray-300",key:v.id},[e.createElementVNode("span",sn,[e.createElementVNode("span",{class:e.normalizeClass(["text-base m-auto",C(v)]),textContent:e.toDisplayString(M(v))},null,10,cn)]),e.createElementVNode("div",dn,[e.createElementVNode("div",un,e.toDisplayString(e.unref(q)(v.name,40))+" ("+e.toDisplayString(v.size)+")",1),e.createElementVNode("div",mn,e.toDisplayString(e.unref(q)(v.name,16))+" ("+e.toDisplayString(v.size)+")",1),e.createElementVNode("div",{class:e.normalizeClass(["flex break-all text-left",C(v)])},[e.createTextVNode(e.toDisplayString(v.statusName)+" ",1),v.status===l.value.QUEUE_ENTRY_STATUS.UPLOADING?(e.openBlock(),e.createElementBlock("b",pn,e.toDisplayString(v.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",w.value?"disabled:bg-gray-100 text-white text-opacity-50":"bg-gray-100"]),title:e.unref(o)("Delete"),disabled:w.value,onClick:V=>A(v)},hn,10,fn)]))),128)),h.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gn,e.toDisplayString(e.unref(o)("No files selected!")),1))]),g.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:x[2]||(x[2]=v=>g.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),e.createElementVNode("input",{ref_key:"internalFileInput",ref:s,type:"file",multiple:"",class:"hidden"},null,512),e.createElementVNode("input",{ref_key:"internalFolderInput",ref:n,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1}))}}),xn={class:"sm:flex sm:items-start"},wn=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),bn={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},En={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Vn={class:"mt-2"},Nn={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},Bn={class:"flex text-sm text-gray-800 dark:text-gray-400"},$n={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"},Cn=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),Sn=[Cn],Dn={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"},Mn=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),jn=[Mn],Tn={class:"ml-1.5"},Ln=["placeholder"],Fn={name:"VFModalArchive"},zn=Object.assign(Fn,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=e.ref(t.modal.data.items),c=()=>{l.value.length&&t.emitter.emit("vf-fetch",{params:{q:"archive",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:l.value.map(({path:s,type:n})=>({path:s,type:n})),name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file(s) archived.")})},onError:s=>{r.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",xn,[wn,e.createElementVNode("div",bn,[e.createElementVNode("h3",En,e.toDisplayString(e.unref(o)("Archive the files")),1),e.createElementVNode("div",Vn,[e.createElementVNode("div",Nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("p",Bn,[i.type==="dir"?(e.openBlock(),e.createElementBlock("svg",$n,Sn)):(e.openBlock(),e.createElementBlock("svg",Dn,jn)),e.createElementVNode("span",Tn,e.toDisplayString(i.basename),1)]))),256))]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>a.value=i),onKeyup:e.withKeys(c,["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,Ln),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[1]||(n[1]=i=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),An={class:"sm:flex sm:items-start"},On=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),Un={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Hn={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Rn={class:"mt-2"},qn={class:"flex text-sm text-gray-800 dark:text-gray-400"},In={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"},Pn=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),Wn=[Pn],Gn={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"},Yn=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),Kn=[Yn],Jn={class:"ml-1.5"},Xn={class:"my-1 text-sm text-gray-500"},Qn={name:"VFModalUnarchive"},Zn=Object.assign(Qn,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n;e.ref("");const a=e.ref(t.modal.data.items[0]),r=e.ref(""),l=e.ref([]),c=()=>{t.emitter.emit("vf-fetch",{params:{q:"unarchive",m:"post",adapter:t.adapter,path:t.data.dirname},body:{item:a.value.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file unarchived.")})},onError:s=>{r.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:n[1]||(n[1]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",An,[On,e.createElementVNode("div",Un,[e.createElementVNode("h3",Hn,e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("div",Rn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("p",qn,[i.type==="dir"?(e.openBlock(),e.createElementBlock("svg",In,Wn)):(e.openBlock(),e.createElementBlock("svg",Gn,Kn)),e.createElementVNode("span",Jn,e.toDisplayString(i.basename),1)]))),256)),e.createElementVNode("p",Xn,e.toDisplayString(e.unref(o)("The archive will be unarchived at"))+" ("+e.toDisplayString(e.unref(t).data.dirname)+")",1),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[0]||(n[0]=i=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),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",{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),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"},al={class:"text-sm text-gray-500 pb-1"},nl={class:"max-h-[200px] overflow-y-auto vf-scrollbar text-left"},ll={class:"flex text-sm text-gray-800 dark:text-gray-400"},sl={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"},il=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),cl=[il],dl={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"},ul=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),ml=[ul],pl={class:"ml-1.5"},fl={class:"font-bold text-xs text-gray-700 dark:text-gray-500 mt-3 tracking-wider"},vl={class:"flex text-sm text-gray-800 dark:text-gray-400 border dark:border-gray-700 p-1 rounded"},hl=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),gl={class:"ml-1.5 overflow-auto"},kl={class:"m-1 mr-auto font-bold text-gray-500 text-sm dark:text-gray-200 self-center"},yl={name:"VFModalMove"},_l=Object.assign(yl,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;t.storage;const a=e.ref(t.modal.data.items.from),r=e.ref(""),l=()=>{a.value.length&&t.emitter.emit("vf-fetch",{params:{q:"move",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:a.value.map(({path:c,type:s})=>({path:c,type:s})),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:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",kl,e.toDisplayString(e.unref(o)("%s item(s) selected.",a.value.length)),1)]),default:e.withCtx(()=>[e.createElementVNode("div",el,[tl,e.createElementVNode("div",ol,[e.createElementVNode("h3",rl,e.toDisplayString(e.unref(o)("Move files")),1),e.createElementVNode("p",al,e.toDisplayString(e.unref(o)("Are you sure you want to move these files?")),1),e.createElementVNode("div",nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,n=>(e.openBlock(),e.createElementBlock("div",ll,[e.createElementVNode("div",null,[n.type==="dir"?(e.openBlock(),e.createElementBlock("svg",sl,cl)):(e.openBlock(),e.createElementBlock("svg",dl,ml))]),e.createElementVNode("div",pl,e.toDisplayString(n.path),1)]))),256))]),e.createElementVNode("h4",fl,e.toDisplayString(e.unref(o)("Target Directory")),1),e.createElementVNode("p",vl,[hl,e.createElementVNode("span",gl,e.toDisplayString(e.unref(t).modal.data.items.to.path),1)]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[0]||(s[0]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1}))}}),xl=(d,t)=>{const o=d.__vccOpts||d;for(const[a,r]of t)o[a]=r;return o},wl={props:{on:{type:String,required:!0}},setup(d,{emit:t,slots:o}){const a=e.inject("ServiceContainer"),r=e.ref(!1),{t:l}=a.i18n;let c=null;const s=()=>{clearTimeout(c),r.value=!0,c=setTimeout(()=>{r.value=!1},2e3)};return e.onMounted(()=>{a.emitter.on(d.on,s)}),e.onUnmounted(()=>{clearTimeout(c)}),{shown:r,t:l}}},bl={key:1};function El(d,t,o,a,r,l){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":!a.shown}]])},[d.$slots.default?e.renderSlot(d.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("span",bl,e.toDisplayString(a.t("Saved.")),1))],2)}const R=xl(wl,[["render",El]]),Vl={class:"sm:flex sm:items-start"},Nl=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),Bl={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},$l={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Cl={class:"mt-2"},Sl={class:"text-sm text-gray-500"},Dl={class:"text-sm font-semibold mt-5 text-gray-900 dark:text-gray-400 tracking-wider"},Ml={class:"mt-3 text-left"},jl={class:"space-y-2"},Tl={class:"flex relative gap-x-3"},Ll={class:"h-6 items-center"},Fl={class:"flex-1 block text-sm"},zl={for:"metric_unit",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},Al={class:"flex relative gap-x-3"},Ol={class:"h-6 items-center"},Ul={for:"theme",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm"},Hl={class:"flex text-sm"},Rl=["label"],ql=["value"],Il={key:0,class:"flex relative gap-x-3"},Pl={class:"h-6 items-center"},Wl={for:"language",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm text-nowrap"},Gl={class:"flex text-sm"},Yl=["label"],Kl=["value"],Jl={name:"VFModalAbout"},Xl=Object.assign(Jl,{setup(d){const t=e.inject("ServiceContainer"),{getStore:o,setStore:a,clearStore:r}=t.storage,{t:l,changeLocale:c,locale:s}=t.i18n;e.ref(""),e.ref("");const n=async()=>{r(),location.reload()},i=y=>{t.theme.set(y),t.emitter.emit("vf-theme-saved")},p=()=>{t.metricUnits=!t.metricUnits,t.filesize=t.metricUnits?G:W,a("metricUnits",t.metricUnits),t.emitter.emit("vf-metric-units-saved")},{i18n:f}=e.inject("VueFinderOptions"),g=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(([y])=>Object.keys(f).includes(y))),w=e.computed(()=>({system:l("System"),light:l("Light"),dark:l("Dark")}));return(y,m)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m[5]||(m[5]=u=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(l)("Close")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Vl,[Nl,e.createElementVNode("div",Bl,[e.createElementVNode("h3",$l,e.toDisplayString(e.unref(l)("About %s","Vuefinder "+e.unref(t).version)),1),e.createElementVNode("div",Cl,[e.createElementVNode("p",Sl,e.toDisplayString(e.unref(l)("Vuefinder is a file manager component for vue 3.")),1),e.createElementVNode("div",null,[e.createElementVNode("h3",Dl,e.toDisplayString(e.unref(l)("Settings")),1)]),e.createElementVNode("div",Ml,[e.createElementVNode("fieldset",null,[e.createElementVNode("div",jl,[e.createElementVNode("div",Tl,[e.createElementVNode("div",Ll,[e.withDirectives(e.createElementVNode("input",{id:"metric_unit",name:"metric_unit",type:"checkbox","onUpdate:modelValue":m[0]||(m[0]=u=>e.unref(t).metricUnits=u),onClick:p,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",Fl,[e.createElementVNode("label",zl,[e.createTextVNode(e.toDisplayString(e.unref(l)("Use Metric Units"))+" ",1),e.createVNode(R,{class:"ms-3",on:"vf-metric-units-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",Al,[e.createElementVNode("div",Ol,[e.createElementVNode("label",Ul,e.toDisplayString(e.unref(l)("Theme")),1)]),e.createElementVNode("div",Hl,[e.withDirectives(e.createElementVNode("select",{id:"theme","onUpdate:modelValue":m[1]||(m[1]=u=>e.unref(t).theme.value=u),onChange:m[2]||(m[2]=u=>i(u.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(l)("Theme")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(u,B)=>(e.openBlock(),e.createElementBlock("option",{value:B},e.toDisplayString(u),9,ql))),256))],8,Rl)],544),[[e.vModelSelect,e.unref(t).theme.value]]),e.createVNode(R,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-theme-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])]),e.unref(t).features.includes(e.unref($).LANGUAGE)&&Object.keys(e.unref(g)).length>1?(e.openBlock(),e.createElementBlock("div",Il,[e.createElementVNode("div",Pl,[e.createElementVNode("label",Wl,e.toDisplayString(e.unref(l)("Language")),1)]),e.createElementVNode("div",Gl,[e.withDirectives(e.createElementVNode("select",{id:"language","onUpdate:modelValue":m[3]||(m[3]=u=>e.isRef(s)?s.value=u:null),onChange:m[4]||(m[4]=u=>e.unref(c)(u.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(l)("Language")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(u,B)=>(e.openBlock(),e.createElementBlock("option",{value:B},e.toDisplayString(u),9,Kl))),256))],8,Yl)],544),[[e.vModelSelect,e.unref(s)]]),e.createVNode(R,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-language-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:n,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(l)("Reset Settings")),1)])])])])])])]),_:1}))}}),Ql=Object.freeze(Object.defineProperty({__proto__:null,ModalAbout:Xl,ModalArchive:zn,ModalDelete:_r,ModalMessage:$r,ModalMove:_l,ModalNewFile:Wr,ModalNewFolder:zr,ModalPreview:La,ModalRename:Ja,ModalUnarchive:Zn,ModalUpload:_n},Symbol.toStringTag,{value:"Module"})),Zl={install(d,t={}){d.component("VueFinder",Go);for(const a of Object.values(Ql))d.component(a.name,a);t.i18n=t.i18n??{};let[o]=Object.keys(t.i18n);t.locale=t.locale??o??"en",d.provide("VueFinderOptions",t)}};module.exports=Zl;
1
+ "use strict";var J=Object.defineProperty;var X=(d,t,o)=>t in d?J(d,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):d[t]=o;var I=(d,t,o)=>(X(d,typeof t!="symbol"?t+"":t,o),o);const e=require("vue"),Q=require("mitt"),Z=require("dragselect"),ee=require("vanilla-lazyload");require("cropperjs/dist/cropper.css");const te=require("cropperjs"),oe=require("@uppy/core"),re=require("@uppy/xhr-upload");require("microtip/microtip.css");var P;const H=(P=document.querySelector('meta[name="csrf-token"]'))==null?void 0:P.getAttribute("content");class ae{constructor(t){I(this,"config");this.config=t}get config(){return this.config}transformRequestParams(t){const o=this.config,a={};H!=null&&H!==""&&(a[o.xsrfHeaderName]=H);const r=Object.assign({},o.headers,a,t.headers),l=Object.assign({},o.params,t.params),c=t.body,s=o.baseUrl+t.url,n=t.method;let i;n!=="get"&&(c instanceof FormData?(i=c,o.body!=null&&Object.entries(this.config.body).forEach(([f,h])=>{i.append(f,h)})):(i={...c},o.body!=null&&Object.assign(i,this.config.body)));const p={url:s,method:n,headers:r,params:l,body:i};if(o.transformRequest!=null){const f=o.transformRequest({url:s,method:n,headers:r,params:l,body:i});f.url!=null&&(p.url=f.url),f.method!=null&&(p.method=f.method),f.params!=null&&(p.params=f.params??{}),f.headers!=null&&(p.headers=f.headers??{}),f.body!=null&&(p.body=f.body)}return p}getDownloadUrl(t,o){if(o.url!=null)return o.url;const a=this.transformRequestParams({url:"",method:"get",params:{q:"download",adapter:t,path:o.path}});return a.url+"?"+new URLSearchParams(a.params).toString()}getPreviewUrl(t,o){if(o.url!=null)return o.url;const a=this.transformRequestParams({url:"",method:"get",params:{q:"preview",adapter:t,path:o.path}});return a.url+"?"+new URLSearchParams(a.params).toString()}async send(t){const o=this.transformRequestParams(t),a=t.responseType||"json",r={method:t.method,headers:o.headers,signal:t.abortSignal},l=o.url+"?"+new URLSearchParams(o.params);if(o.method!=="get"&&o.body!=null){let s;o.body instanceof FormData?s=t.body:(s=JSON.stringify(o.body),r.headers["Content-Type"]="application/json"),r.body=s}const c=await fetch(l,r);if(c.ok)return await c[a]();throw await c.json()}}function ne(d){const t={baseUrl:"",headers:{},params:{},body:{},xsrfHeaderName:"X-CSRF-Token"};return typeof d=="string"?Object.assign(t,{baseUrl:d}):Object.assign(t,d),new ae(t)}function le(d){let t=localStorage.getItem(d+"_storage");const o=e.reactive(JSON.parse(t??"{}"));e.watch(o,a);function a(){Object.keys(o).length?localStorage.setItem(d+"_storage",JSON.stringify(o)):localStorage.removeItem(d+"_storage")}function r(n,i){o[n]=i}function l(n){delete o[n]}function c(){Object.keys(o).map(n=>l(n))}return{getStore:(n,i=null)=>o.hasOwnProperty(n)?o[n]:i,setStore:r,removeStore:l,clearStore:c}}async function se(d,t){const o=t[d];return typeof o=="function"?(await o()).default:o}function ie(d,t,o,a){const{getStore:r,setStore:l}=d,c=e.ref({}),s=e.ref(r("locale",t)),n=(f,h=t)=>{se(f,a).then(g=>{c.value=g,l("locale",f),s.value=f,l("translations",g),Object.values(a).length>1&&(o.emit("vf-toast-push",{label:"The language is set to "+f}),o.emit("vf-language-saved"))}).catch(g=>{h?(o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),n(h,null)):o.emit("vf-toast-push",{label:"Locale cannot be loaded!",type:"error"})})};!r("locale")&&!a.length?n(t):c.value=r("translations");const i=(f,...h)=>h.length?i(f=f.replace("%s",h.shift()),...h):f;function p(f,...h){return c.value&&c.value.hasOwnProperty(f)?i(c.value[f],...h):i(f,...h)}return{t:p,changeLocale:n,locale:s}}const $={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"},ce=Object.values($),de="2.2.6";function W(d,t,o,a,r){return(t=Math,o=t.log,a=1024,r=o(d)/o(a)|0,d/t.pow(a,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"iB":"B")}function G(d,t,o,a,r){return(t=Math,o=t.log,a=1e3,r=o(d)/o(a)|0,d/t.pow(a,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"B":"B")}function ue(d){const t={k:1,m:2,g:3,t:4},a=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(d);return a[1]*Math.pow(1024,t[a[2].toLowerCase()])}const j={SYSTEM:"system",LIGHT:"light",DARK:"dark"};function me(d,t){const o=e.ref(j.SYSTEM),a=e.ref(j.LIGHT);o.value=d.getStore("theme",t??j.SYSTEM);const r=window.matchMedia("(prefers-color-scheme: dark)"),l=c=>{o.value===j.DARK||o.value===j.SYSTEM&&c.matches?a.value=j.DARK:a.value=j.LIGHT};return l(r),r.addEventListener("change",l),{value:o,actualValue:a,set(c){o.value=c,c!==j.SYSTEM?d.setStore("theme",c):d.removeStore("theme"),l(r)}}}const pe=(d,t)=>{const o=le(d.id),a=Q(),r=o.getStore("metricUnits",!1),l=me(o,d.theme),c=t.i18n,s=d.locale??t.locale,n=e.computed(()=>ie(o,s,a,c)),i=f=>Array.isArray(f)?f:ce,p=d.persist?o.getStore("path",d.path):d.path;return e.reactive({version:de,root:null,debug:d.debug,emitter:a,features:i(d.features),requester:ne(d.request),theme:l,view:o.getStore("viewport","grid"),fullScreen:o.getStore("full-screen",d.fullScreen),selectButton:d.selectButton,metricUnits:r,filesize:r?G:W,maxFileSize:d.maxFileSize,loading:!1,i18n:n,modal:{active:!1,type:"delete",data:{}},adapter:o.getStore("adapter"),path:p,persist:d.persist,storage:o,data:{adapter:o.getStore("adapter"),storages:[],dirname:p,files:[]},selectedItems:[]})},fe={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},ve={key:0,class:"flex text-center"},he=["aria-label"],ge=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})],-1),ke=[ge],ye=["aria-label"],_e=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-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 00-9-9z"})],-1),xe=[_e],we=["aria-label"],be=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1),Ee=[be],Ve=["aria-label"],Ne=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),Be=[Ne],$e=["aria-label"],Ce=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})],-1),Se=[Ce],De=["aria-label"],Me=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"},null,-1),je=[Me],Te=["aria-label"],Le=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"},null,-1),Fe=[Le],ze={key:1,class:"flex text-center"},Ae={class:"pl-2"},Oe={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Ue={key:0,class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},He=e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),Re=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"},null,-1),qe=[He,Re],Ie={class:"flex text-center items-center justify-end"},Pe=["aria-label"],We={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ge={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9L3.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.5l5.25 5.25"},Ye={key:1,"stroke-linecap":"round","stroke-linejoin":"round",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"},Ke=["aria-label"],Je={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"},Xe={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"},Qe={name:"VFToolbar"},Ze=Object.assign(Qe,{setup(d){const t=e.inject("ServiceContainer"),{setStore:o}=t.storage,{t:a}=t.i18n,r=e.ref([]),l=e.ref("");t.emitter.on("vf-search-query",({newQuery:n})=>{l.value=n});const c=()=>{t.fullScreen=!t.fullScreen,o("full-screen",t.fullScreen),t.emitter.emit("vf-fullscreen-toggle")};t.emitter.on("vf-nodes-selected",n=>{r.value=n});const s=()=>{t.view=t.view==="list"?"grid":"list",o("viewport",t.view)};return(n,i)=>(e.openBlock(),e.createElementBlock("div",fe,[l.value.length?(e.openBlock(),e.createElementBlock("div",ze,[e.createElementVNode("div",Ae,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Oe,e.toDisplayString(l.value),1)]),e.unref(t).loading?(e.openBlock(),e.createElementBlock("svg",Ue,qe)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ve,[e.unref(t).features.includes(e.unref($).NEW_FOLDER)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:i[0]||(i[0]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"new-folder",items:r.value}))},ke,8,he)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).NEW_FILE)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[1]||(i[1]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"new-file",items:r.value}))},xe,8,ye)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).RENAME)?(e.openBlock(),e.createElementBlock("div",{key:2,class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[2]||(i[2]=p=>r.value.length!=1||e.unref(t).emitter.emit("vf-modal-show",{type:"rename",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length==1?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ee,2))],8,we)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).DELETE)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[3]||(i[3]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"delete",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Be,2))],8,Ve)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).UPLOAD)?(e.openBlock(),e.createElementBlock("div",{key:4,class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[4]||(i[4]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"upload",items:r.value}))},Se,8,$e)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).UNARCHIVE)&&r.value.length==1&&r.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:5,class:"mx-1.5","aria-label":e.unref(a)("Unarchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[5]||(i[5]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"unarchive",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},je,2))],8,De)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).ARCHIVE)?(e.openBlock(),e.createElementBlock("div",{key:6,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[6]||(i[6]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"archive",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Fe,2))],8,Te)):e.createCommentVNode("",!0)])),e.createElementVNode("div",Ie,[e.unref(t).features.includes(e.unref($).FULL_SCREEN)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:c},[(e.openBlock(),e.createElementBlock("svg",We,[e.unref(t).fullScreen?(e.openBlock(),e.createElementBlock("path",Ge)):(e.openBlock(),e.createElementBlock("path",Ye))]))],8,Pe)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:i[7]||(i[7]=p=>l.value.length||s())},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.value.length?"stroke-gray-200 dark:stroke-gray-700":"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.unref(t).view==="grid"?(e.openBlock(),e.createElementBlock("path",Je)):e.createCommentVNode("",!0),e.unref(t).view==="list"?(e.openBlock(),e.createElementBlock("path",Xe)):e.createCommentVNode("",!0)],2))],8,Ke)])]))}}),et=(d,t=0,o=!1)=>{let a;return(...r)=>{o&&!a&&d(...r),clearTimeout(a),a=setTimeout(()=>{d(...r)},t)}},tt=(d,t,o)=>{const a=e.ref(d);return e.customRef((r,l)=>({get(){return r(),a.value},set:et(c=>{a.value=c,l()},t,o)}))},ot={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"},rt=["aria-label"],at=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1),nt=[at],lt=["aria-label"],st=e.createElementVNode("path",{d:"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-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.2s12.5 14.8 22.2 14.8H463.5z"},null,-1),it=[st],ct=["aria-label"],dt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),ut=[dt],mt=e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},null,-1),pt=[mt],ft={class:"flex leading-6"},vt=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),ht=["onDragover","onDragleave","onDrop","title","onClick"],gt={key:0,class:"animate-spin p-1 h-6 w-6 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},kt=e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),yt=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"},null,-1),_t=[kt,yt],xt={key:3,class:"relative flex bg-white dark:bg-gray-700 justify-between items-center rounded p-1 ml-2 w-full"},wt=e.createElementVNode("div",null,[e.createElementVNode("svg",{class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})])],-1),bt=["placeholder"],Et=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),Vt=[Et],Nt={name:"VFBreadcrumb"},Bt=Object.assign(Nt,{setup(d){const t=e.ref(null),o=e.ref([]),a=e.ref(!1),r=e.ref(null),l=e.inject("ServiceContainer"),{t:c}=l.i18n;l.emitter.on("vf-explorer-update",()=>{let y=[],m=[];t.value=l.data.dirname??l.adapter+"://",t.value.length==0&&(o.value=[]),t.value.replace(l.adapter+"://","").split("/").forEach(function(u){y.push(u),y.join("/")!=""&&m.push({basename:u,name:u,path:l.adapter+"://"+y.join("/"),type:"dir"})}),m.length>4&&(m=m.slice(-5),m[0].name=".."),o.value=m});const s=()=>{a.value=!1,i.value=""};l.emitter.on("vf-search-exit",()=>{s()});const n=()=>{l.features.includes($.SEARCH)&&(a.value=!0,e.nextTick(()=>r.value.focus()))},i=tt("",400);e.watch(i,y=>{l.emitter.emit("vf-toast-clear"),l.emitter.emit("vf-search-query",{newQuery:y})});const p=()=>o.value.length&&!a.value,f=(y,m=null)=>{y.preventDefault(),g(y),m??(m=o.value.length-2);let u=JSON.parse(y.dataTransfer.getData("items"));if(u.find(B=>B.storage!==l.adapter)){alert("Moving items between different storages is not supported yet.");return}l.emitter.emit("vf-modal-show",{type:"move",items:{from:u,to:o.value[m]??{path:l.adapter+"://"}}})},h=y=>{y.preventDefault(),p()?(y.dataTransfer.dropEffect="copy",y.currentTarget.classList.add("bg-blue-200","dark:bg-slate-500")):(y.dataTransfer.dropEffect="none",y.dataTransfer.effectAllowed="none")},g=y=>{y.preventDefault(),y.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-500"),p()&&y.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-500")},w=()=>{i.value==""&&s()};return(y,m)=>(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("span",{"aria-label":e.unref(c)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:m[0]||(m[0]=u=>h(u)),onDragleave:m[1]||(m[1]=u=>g(u)),onDrop:m[2]||(m[2]=u=>f(u)),onClick:m[3]||(m[3]=u=>{var B;return!p()||e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:((B=o.value[o.value.length-2])==null?void 0:B.path)??e.unref(l).adapter+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",p()?"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"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},nt,34))],8,rt),e.unref(l).loading?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(c)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:m[5]||(m[5]=u=>e.unref(l).emitter.emit("vf-fetch-abort")),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"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"},ut))],8,ct)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(c)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:m[4]||(m[4]=u=>{e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:e.unref(l).data.dirname}})}),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",xmlns:"http://www.w3.org/2000/svg",viewBox:"-40 -40 580 580",fill:"currentColor"},it))],8,lt)),a.value?(e.openBlock(),e.createElementBlock("div",xt,[wt,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:r,onKeydown:e.withKeys(s,["esc"]),onBlur:w,"onUpdate:modelValue":m[10]||(m[10]=u=>e.isRef(i)?i.value=u:null),placeholder:e.unref(c)("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,bt),[[e.vModelText,e.unref(i)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:s,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Vt))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(n,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onDragover:m[6]||(m[6]=u=>h(u)),onDragleave:m[7]||(m[7]=u=>g(u)),onDrop:m[8]||(m[8]=u=>f(u,-1)),onClick:m[9]||(m[9]=u=>e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter}})),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",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},pt,32)),e.createElementVNode("div",ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(u,B)=>(e.openBlock(),e.createElementBlock("div",{key:B},[vt,e.createElementVNode("span",{onDragover:C=>B===o.value.length-1||h(C),onDragleave:C=>B===o.value.length-1||g(C),onDrop:C=>B===o.value.length-1||f(C,B),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",title:u.basename,onClick:C=>e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:u.path}})},e.toDisplayString(u.name),41,ht)]))),128))]),e.unref(l).loading?(e.openBlock(),e.createElementBlock("svg",gt,_t)):e.createCommentVNode("",!0)]))]))}}),Y=(d,t=null)=>new Date(d*1e3).toLocaleString(t??navigator.language??"en-US"),$t={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Ct=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1),St=[Ct],Dt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Mt=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1),jt=[Mt],Tt={name:"VFSortIcon"},O=Object.assign(Tt,{props:{direction:String},setup(d){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[d.direction==="down"?(e.openBlock(),e.createElementBlock("svg",$t,St)):e.createCommentVNode("",!0),d.direction==="up"?(e.openBlock(),e.createElementBlock("svg",Dt,jt)):e.createCommentVNode("",!0)]))}}),Lt=["onClick"],Ft={name:"VFToast.vue"},zt=Object.assign(Ft,{setup(d){const t=e.inject("ServiceContainer"),{getStore:o}=t.storage,a=e.ref(o("full-screen",!1)),r=e.ref([]),l=n=>n==="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",c=n=>{r.value.splice(n,1)},s=n=>{let i=r.value.findIndex(p=>p.id===n);i!==-1&&c(i)};return t.emitter.on("vf-toast-clear",()=>{r.value=[]}),t.emitter.on("vf-toast-push",n=>{let i=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");n.id=i,r.value.push(n),setTimeout(()=>{s(i)},5e3)}),(n,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.value.value?"fixed":"absolute","bottom-0 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,(p,f)=>(e.openBlock(),e.createElementBlock("div",{onClick:h=>c(f),key:p,class:e.normalizeClass([l(p.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(p.label),11,Lt))),128))]),_:1})],2))}});function q(d,t=14){let o=`((?=([\\w\\W]{0,${t}}))([\\w\\W]{${t+1},})([\\w\\W]{8,}))`;return d.replace(new RegExp(o),"$2..$4")}const At={class:"relative flex-auto flex flex-col overflow-hidden"},Ot={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Ut={class:"absolute"},Ht=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",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",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[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"})],-1),Rt={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"},qt=["onDblclick","onContextmenu","data-type","data-item","data-index"],It={class:"grid grid-cols-12 items-center"},Pt={class:"flex col-span-7 items-center"},Wt={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"},Gt=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=[Gt],Kt={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"},Jt=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),Xt=[Jt],Qt={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Zt={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},eo=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],to={class:"grid grid-cols-12 items-center"},oo={class:"flex col-span-7 items-center"},ro={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"},ao=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),no=[ao],lo={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"},so=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),io=[so],co={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},uo={class:"col-span-2 text-center"},mo={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},po=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],fo={class:"relative"},vo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto 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"},ho=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),go=[ho],ko=["data-src","alt"],yo={key:2,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},_o=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),xo=[_o],wo={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},bo={class:"break-all"},Eo={name:"VFExplorer"},Vo=Object.assign(Eo,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;t.storage;const a=k=>k==null?void 0:k.substring(0,3),r=e.ref(null),l=e.ref(null),c=e.ref(0),s=e.ref(null),n=Math.floor(Math.random()*2**32),i=e.ref("");let p;t.emitter.on("vf-fullscreen-toggle",()=>{r.value.style.height=null}),t.emitter.on("vf-search-query",({newQuery:k})=>{i.value=k,k?t.emitter.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:k},onSuccess:b=>{b.files.length||t.emitter.emit("vf-toast-push",{label:o("No search result found.")})}}):t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let f=null;const h=()=>{f&&clearTimeout(f)},g=e.ref(!0),w=k=>{k.touches.length>1&&(g.value?(s.value.stop(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: off")})):(s.value.start(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: on")}),t.emitter.emit("vf-explorer-update")),g.value=!g.value)},y=k=>{f=setTimeout(()=>{const b=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:k.target.getBoundingClientRect().x,clientY:k.target.getBoundingClientRect().y});k.target.dispatchEvent(b)},500)},m=k=>{k.type==="dir"?(t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:k.path}})):t.emitter.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:k})},u=e.reactive({active:!1,column:"",order:""}),B=(k=!0)=>{let b=[...t.data.files],_=u.column,E=u.order=="asc"?1:-1;if(!k)return b;const x=(v,V)=>typeof v=="string"&&typeof V=="string"?v.toLowerCase().localeCompare(V.toLowerCase()):v<V?-1:v>V?1:0;return u.active&&(b=b.slice().sort((v,V)=>x(v[_],V[_])*E)),b},C=k=>{u.active&&u.column==k?(u.active=u.order=="asc",u.column=k,u.order="desc"):(u.active=!0,u.column=k,u.order="asc")},M=()=>s.value.getSelection().map(k=>JSON.parse(k.dataset.item)),L=(k,b)=>{if(k.altKey||k.ctrlKey||k.metaKey)return k.preventDefault(),!1;k.dataTransfer.setDragImage(l.value,0,15),k.dataTransfer.effectAllowed="all",k.dataTransfer.dropEffect="copy",k.dataTransfer.setData("items",JSON.stringify(M()))},F=(k,b)=>{k.preventDefault();let _=JSON.parse(k.dataTransfer.getData("items"));if(_.find(E=>E.storage!==t.adapter)){alert("Moving items between different storages is not supported yet.");return}t.emitter.emit("vf-modal-show",{type:"move",items:{from:_,to:b}})},z=(k,b)=>{k.preventDefault(),!b||b.type!=="dir"||s.value.getSelection().find(_=>_==k.currentTarget)?(k.dataTransfer.dropEffect="none",k.dataTransfer.effectAllowed="none"):k.dataTransfer.dropEffect="copy"},A=()=>{s.value=new Z({area:r.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),t.emitter.on("vf-explorer-update",()=>e.nextTick(()=>{s.value.clearSelection(),s.value.setSettings({selectables:document.getElementsByClassName("vf-item-"+n)})})),s.value.subscribe("predragstart",({event:k,isDragging:b})=>{if(b)c.value=s.value.getSelection().length,s.value.break();else{const _=k.target.offsetWidth-k.offsetX,E=k.target.offsetHeight-k.offsetY;_<15&&E<15&&(s.value.clearSelection(),s.value.break())}}),s.value.subscribe("predragmove",({isDragging:k})=>{k&&s.value.break()}),s.value.subscribe("callback",({items:k,event:b,isDragging:_})=>{t.emitter.emit("vf-nodes-selected",M()),c.value=s.value.getSelection().length})};return e.onMounted(()=>{p=new ee(r.value),A()}),e.onUpdated(()=>{s.value.Area.reset(),s.value.SelectorArea.updatePos(),p.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>t.emitter.emit("vf-explorer-update"))}),e.onBeforeUnmount(()=>{p.destroy()}),(k,b)=>(e.openBlock(),e.createElementBlock("div",At,[e.unref(t).view=="list"||i.value.length?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",{onClick:b[0]||(b[0]=_=>C("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Name"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="basename"]])]),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:b[1]||(b[1]=_=>C("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Size"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="file_size"]])])),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:b[2]||(b[2]=_=>C("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Date"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="last_modified"]])])),i.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:b[3]||(b[3]=_=>C("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Filepath"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ut,[e.createElementVNode("div",{ref_key:"dragImage",ref:l,class:"absolute -z-50 -top-96"},[Ht,e.createElementVNode("div",Rt,e.toDisplayString(c.value),1)],512)]),e.createElementVNode("div",{onTouchstart:w,onContextmenu:b[10]||(b[10]=e.withModifiers(_=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:_,area:r.value,items:M()}),["self","prevent"])),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"]),ref_key:"selectorArea",ref:r},[i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B(),(_,E)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:x=>m(_),onTouchstart:b[4]||(b[4]=x=>y(x)),onTouchend:b[5]||(b[5]=x=>h()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:_}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(n),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":_.type,"data-item":JSON.stringify(_),"data-index":E},[e.createElementVNode("div",It,[e.createElementVNode("div",Pt,[_.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Wt,Yt)):(e.openBlock(),e.createElementBlock("svg",Kt,Xt)),e.createElementVNode("span",Qt,e.toDisplayString(_.basename),1)]),e.createElementVNode("div",Zt,e.toDisplayString(_.path),1)])],42,qt))),256)):e.createCommentVNode("",!0),e.unref(t).view==="list"&&!i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B(),(_,E)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:x=>m(_),onTouchstart:b[6]||(b[6]=x=>y(x)),onTouchend:b[7]||(b[7]=x=>h()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:_}),["prevent"]),onDragstart:x=>L(x),onDragover:x=>z(x,_),onDrop:x=>F(x,_),class:e.normalizeClass(["vf-item-"+e.unref(n),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":_.type,"data-item":JSON.stringify(_),"data-index":E},[e.createElementVNode("div",to,[e.createElementVNode("div",oo,[_.type==="dir"?(e.openBlock(),e.createElementBlock("svg",ro,no)):(e.openBlock(),e.createElementBlock("svg",lo,io)),e.createElementVNode("span",co,e.toDisplayString(_.basename),1)]),e.createElementVNode("div",uo,e.toDisplayString(_.file_size?e.unref(t).filesize(_.file_size):""),1),e.createElementVNode("div",mo,e.toDisplayString(e.unref(Y)(_.last_modified)),1)])],42,eo))),256)):e.createCommentVNode("",!0),e.unref(t).view==="grid"&&!i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(B(!1),(_,E)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:x=>m(_),onTouchstart:b[8]||(b[8]=x=>y(x)),onTouchend:b[9]||(b[9]=x=>h()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:_}),["prevent"]),onDragstart:x=>L(x),onDragover:x=>z(x,_),onDrop:x=>F(x,_),class:e.normalizeClass(["vf-item-"+e.unref(n),"border border-transparent hover:bg-neutral-50 m-1 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 text-center justify-center select-none"]),"data-type":_.type,"data-item":JSON.stringify(_),"data-index":E},[e.createElementVNode("div",null,[e.createElementVNode("div",fo,[_.type==="dir"?(e.openBlock(),e.createElementBlock("svg",vo,go)):(_.mime_type??"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(t).requester.getPreviewUrl(e.unref(t).adapter,_),alt:_.basename},null,8,ko)):(e.openBlock(),e.createElementBlock("svg",yo,xo)),!(_.mime_type??"").startsWith("image")&&_.type!="dir"?(e.openBlock(),e.createElementBlock("div",wo,e.toDisplayString(a(_.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",bo,e.toDisplayString(e.unref(q)(_.basename)),1)])],42,po))),256)):e.createCommentVNode("",!0)],34),e.createVNode(zt)]))}}),No=["href","download"],Bo=["onClick"],$o={name:"VFContextMenu"},Co=Object.assign($o,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=e.ref(null),r=e.ref([]),l=e.ref(""),c=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),s=e.computed(()=>c.items.filter(f=>f.key==null||t.features.includes(f.key)));t.emitter.on("vf-context-selected",f=>{r.value=f});const n={newfolder:{key:$.NEW_FOLDER,title:()=>o("New Folder"),action:()=>{t.emitter.emit("vf-modal-show",{type:"new-folder"})}},delete:{key:$.DELETE,title:()=>o("Delete"),action:()=>{t.emitter.emit("vf-modal-show",{type:"delete",items:r})}},refresh:{title:()=>o("Refresh"),action:()=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})}},preview:{key:$.PREVIEW,title:()=>o("Preview"),action:()=>{t.emitter.emit("vf-modal-show",{type:"preview",adapter:t.data.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.data.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.data.adapter,path:r.value[0].dir}})}},download:{key:$.DOWNLOAD,link:e.computed(()=>t.requester.getDownloadUrl(t.data.adapter,r.value[0])),title:()=>o("Download"),action:()=>{}},archive:{key:$.ARCHIVE,title:()=>o("Archive"),action:()=>{t.emitter.emit("vf-modal-show",{type:"archive",items:r})}},unarchive:{key:$.UNARCHIVE,title:()=>o("Unarchive"),action:()=>{t.emitter.emit("vf-modal-show",{type:"unarchive",items:r})}},rename:{key:$.RENAME,title:()=>o("Rename"),action:()=>{t.emitter.emit("vf-modal-show",{type:"rename",items:r})}}},i=f=>{t.emitter.emit("vf-contextmenu-hide"),f.action()};t.emitter.on("vf-search-query",({newQuery:f})=>{l.value=f}),t.emitter.on("vf-contextmenu-show",({event:f,area:h,items:g,target:w=null})=>{if(c.items=[],l.value)if(w)c.items.push(n.openDir),t.emitter.emit("vf-context-selected",[w]);else return;else!w&&!l.value?(c.items.push(n.refresh),c.items.push(n.newfolder),t.emitter.emit("vf-context-selected",[])):g.length>1&&g.some(y=>y.path===w.path)?(c.items.push(n.refresh),c.items.push(n.archive),c.items.push(n.delete),t.emitter.emit("vf-context-selected",g)):(w.type=="dir"?c.items.push(n.open):(c.items.push(n.preview),c.items.push(n.download)),c.items.push(n.rename),w.mime_type=="application/zip"?c.items.push(n.unarchive):c.items.push(n.archive),c.items.push(n.delete),t.emitter.emit("vf-context-selected",[w]));p(f,h)}),t.emitter.on("vf-contextmenu-hide",()=>{c.active=!1});const p=(f,h)=>{c.active=!0,e.nextTick(()=>{const g=t.root.getBoundingClientRect(),w=h.getBoundingClientRect();let y=f.pageX-g.left,m=f.pageY-g.top,u=a.value.offsetHeight,B=a.value.offsetWidth;y=w.right-f.pageX+window.scrollX<B?y-B:y,m=w.bottom-f.pageY+window.scrollY<u?m-u:m,c.positions={left:y+"px",top:m+"px"}})};return(f,h)=>c.active?(e.openBlock(),e.createElementBlock("ul",{key:0,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 select-none",ref_key:"contextmenu",ref:a,style:e.normalizeStyle(c.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,g=>(e.openBlock(),e.createElementBlock("li",{class:"cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:g.title},[g.link?(e.openBlock(),e.createElementBlock("a",{key:0,class:"block pl-2 pr-3 py-1",target:"_blank",href:g.link,download:g.link,onClick:h[0]||(h[0]=w=>e.unref(t).emitter.emit("vf-contextmenu-hide"))},[e.createElementVNode("span",null,e.toDisplayString(g.title()),1)],8,No)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"pl-2 pr-3 py-1",onClick:w=>i(g)},[e.createElementVNode("span",null,e.toDisplayString(g.title()),1)],8,Bo))]))),128))],4)):e.createCommentVNode("",!0)}}),So={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Do={class:"flex leading-5 items-center"},Mo=["aria-label"],jo=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[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"})],-1),To=[jo],Lo=["value"],Fo={class:"ml-3"},zo={key:0},Ao={class:"ml-1"},Oo={class:"flex leading-5 items-center justify-end"},Uo=["disabled"],Ho=["aria-label"],Ro=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 stroke-slate-500 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[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 11-18 0 9 9 0 0118 0z"})],-1),qo=[Ro],Io={name:"VFStatusbar"},Po=Object.assign(Io,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,{setStore:a}=t.storage,r=e.ref(0),l=()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.adapter}}),a("adapter",t.adapter)};t.emitter.on("vf-nodes-selected",n=>{r.value=n.length});const c=e.ref("");t.emitter.on("vf-search-query",({newQuery:n})=>{c.value=n});const s=e.computed(()=>{const n=t.selectButton.multiple?t.selectedItems.length>0:t.selectedItems.length===1;return t.selectButton.active&&n});return(n,i)=>(e.openBlock(),e.createElementBlock("div",So,[e.createElementVNode("div",Do,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(o)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},To,8,Mo),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i[0]||(i[0]=p=>e.unref(t).adapter=p),onChange:l,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).data.storages,p=>(e.openBlock(),e.createElementBlock("option",{value:p},e.toDisplayString(p),9,Lo))),256))],544),[[e.vModelSelect,e.unref(t).adapter]]),e.createElementVNode("div",Fo,[c.value.length?(e.openBlock(),e.createElementBlock("span",zo,e.toDisplayString(e.unref(t).data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Ao,e.toDisplayString(r.value>0?e.unref(o)("%s item(s) selected.",r.value):""),1)])]),e.createElementVNode("div",Oo,[e.unref(t).selectButton.active?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vf-btn py-0 vf-btn-primary",{disabled:!s.value}]),disabled:!s.value,onClick:i[1]||(i[1]=p=>e.unref(t).selectButton.click(e.unref(t).selectedItems,p))},e.toDisplayString(e.unref(o)("Select")),11,Uo)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(o)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:i[2]||(i[2]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"about"}))},qo,8,Ho)])]))}}),Wo={name:"VueFinder"},Go=Object.assign(Wo,{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},selectButton:{type:Object,default(d){return{active:!1,multiple:!1,click:t=>{},...d}}}},emits:["select"],setup(d,{emit:t}){const o=t,r=pe(d,e.inject("VueFinderOptions"));e.provide("ServiceContainer",r);const{setStore:l}=r.storage,c=e.ref(null);r.root=c,r.i18n,r.emitter.on("vf-modal-close",()=>{r.modal.active=!1}),r.emitter.on("vf-modal-show",i=>{r.modal.active=!0,r.modal.type=i.type,r.modal.data=i});const s=i=>{Object.assign(r.data,i),r.emitter.emit("vf-nodes-selected",{}),r.emitter.emit("vf-explorer-update")};r.emitter.on("vf-nodes-selected",i=>{r.selectedItems=i,o("select",i)});let n;return r.emitter.on("vf-fetch-abort",()=>{n.abort(),r.loading=!1}),r.emitter.on("vf-fetch",({params:i,body:p=null,onSuccess:f=null,onError:h=null,noCloseModal:g=!1})=>{["index","search"].includes(i.q)&&(n&&n.abort(),r.loading=!0),n=new AbortController;const w=n.signal;r.requester.send({url:"",method:i.m||"get",params:i,body:p,abortSignal:w}).then(y=>{r.adapter=y.adapter,r.persist&&(r.path=y.dirname,l("path",r.path)),["index","search"].includes(i.q)&&(r.loading=!1),g||r.emitter.emit("vf-modal-close"),s(y),f&&f(y)}).catch(y=>{console.error(y),h&&h(y)})}),r.emitter.on("vf-download",i=>{const p=document.createElement("a");p.style.display="none",p.target="_blank",p.href=i,p.download=i,r.root.appendChild(p),p.click(),p.remove()}),e.onMounted(()=>{let i={};r.path.includes("://")&&(i={adapter:r.path.split("://")[0],path:r.path}),r.emitter.emit("vf-fetch",{params:{q:"index",adapter:r.adapter,...i}})}),(i,p)=>(e.openBlock(),e.createElementBlock("div",{class:"vuefinder",ref_key:"root",ref:c},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).theme.actualValue==="dark"?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r).fullScreen?"fixed w-screen inset-0 z-20":"relative rounded-md","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(e.unref(r).fullScreen?"":"max-height: "+d.maxHeight),onMousedown:p[0]||(p[0]=f=>e.unref(r).emitter.emit("vf-contextmenu-hide")),onTouchstart:p[1]||(p[1]=f=>e.unref(r).emitter.emit("vf-contextmenu-hide"))},[e.createVNode(Ze),e.createVNode(Bt),e.createVNode(Vo),e.createVNode(Po)],38),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r).modal.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+e.unref(r).modal.type),{key:0})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Co)],2)],512))}}),Yo=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),Ko={class:"fixed z-10 inset-0 overflow-hidden"},Jo={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-5xl w-full"},Xo={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qo={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"},S={__name:"ModalLayout",setup(d){const t=e.inject("ServiceContainer");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:a[1]||(a[1]=e.withKeys(r=>e.unref(t).emitter.emit("vf-modal-close"),["esc"])),tabindex:"0"},[Yo,e.createElementVNode("div",Ko,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:a[0]||(a[0]=e.withModifiers(r=>e.unref(t).emitter.emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Jo,[e.createElementVNode("div",Xo,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Qo,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},Zo=["aria-label"],er=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),tr=[er],or={name:"Message"},D=Object.assign(or,{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(d,{emit:t}){var i;const o=t,a=e.inject("ServiceContainer"),{t:r}=a.i18n,l=e.ref(!1),c=e.ref(null),s=e.ref((i=c.value)==null?void 0:i.strMessage);e.watch(s,()=>l.value=!1);const n=()=>{o("hidden"),l.value=!0};return(p,f)=>(e.openBlock(),e.createElementBlock("div",null,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:c,class:e.normalizeClass(["flex mt-2 p-1 px-2 rounded text-sm break-all dark:opacity-75",d.error?"bg-red-100 text-red-600 ":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(p.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:n,"aria-label":e.unref(r)("Close"),"data-microtip-position":"top-left",role:"tooltip"},tr,8,Zo)],2))]))}}),rr={class:"sm:flex sm:items-start"},ar=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),nr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},lr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},sr={class:"mt-2"},ir={class:"text-sm text-gray-500"},cr={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},dr={class:"flex text-sm text-gray-800 dark:text-gray-400"},ur={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"},mr=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),pr=[mr],fr={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"},vr=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),hr=[vr],gr={class:"ml-1.5"},kr={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},yr={name:"VFModalDelete"},_r=Object.assign(yr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(t.modal.data.items),r=e.ref(""),l=()=>{a.value.length&&t.emitter.emit("vf-fetch",{params:{q:"delete",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:a.value.map(({path:c,type:s})=>({path:c,type:s}))},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files deleted.")})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-danger"},e.toDisplayString(e.unref(o)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",kr,e.toDisplayString(e.unref(o)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",rr,[ar,e.createElementVNode("div",nr,[e.createElementVNode("h3",lr,e.toDisplayString(e.unref(o)("Delete files")),1),e.createElementVNode("div",sr,[e.createElementVNode("p",ir,e.toDisplayString(e.unref(o)("Are you sure you want to delete these files?")),1),e.createElementVNode("div",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,n=>(e.openBlock(),e.createElementBlock("p",dr,[n.type==="dir"?(e.openBlock(),e.createElementBlock("svg",ur,pr)):(e.openBlock(),e.createElementBlock("svg",fr,hr)),e.createElementVNode("span",gr,e.toDisplayString(n.basename),1)]))),256))]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[0]||(s[0]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),xr={class:"sm:flex sm:items-start"},wr=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:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1),br={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Er={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Vr={class:"mt-2"},Nr={class:"text-sm text-gray-500"},Br={name:"VFModalMessage"},$r=Object.assign(Br,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;return(a,r)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=l=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var l,c;return[e.createElementVNode("div",xr,[wr,e.createElementVNode("div",br,[e.createElementVNode("h3",Er,e.toDisplayString(((l=e.unref(t).modal.data)==null?void 0:l.title)??"Title"),1),e.createElementVNode("div",Vr,[e.createElementVNode("p",Nr,e.toDisplayString(((c=e.unref(t).modal.data)==null?void 0:c.message)??"Message"),1)])])])]}),_:1}))}}),Cr={class:"sm:flex sm:items-start"},Sr=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),Dr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Mr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},jr={class:"mt-2"},Tr={class:"text-sm text-gray-500"},Lr=["placeholder"],Fr={name:"VFModalNewFolder"},zr=Object.assign(Fr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=()=>{a.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"newfolder",m:"post",adapter:t.adapter,path:t.data.dirname},body:{name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",a.value)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Cr,[Sr,e.createElementVNode("div",Dr,[e.createElementVNode("h3",Mr,e.toDisplayString(e.unref(o)("New Folder")),1),e.createElementVNode("div",jr,[e.createElementVNode("p",Tr,e.toDisplayString(e.unref(o)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onKeyup:e.withKeys(l,["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,Lr),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[1]||(s[1]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ar={class:"sm:flex sm:items-start"},Or=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),Ur={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Hr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Rr={class:"mt-2"},qr={class:"text-sm text-gray-500"},Ir=["placeholder"],Pr={name:"VFModalNewFile"},Wr=Object.assign(Pr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=()=>{a.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"newfile",m:"post",adapter:t.adapter,path:t.data.dirname},body:{name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",a.value)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ar,[Or,e.createElementVNode("div",Ur,[e.createElementVNode("h3",Hr,e.toDisplayString(e.unref(o)("New File")),1),e.createElementVNode("div",Rr,[e.createElementVNode("p",qr,e.toDisplayString(e.unref(o)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onKeyup:e.withKeys(l,["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,Ir),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[1]||(s[1]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Gr={class:"flex"},Yr=["aria-label"],Kr={class:"ml-auto mb-2"},Jr={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"},Xr={key:1},Qr={__name:"Text",emits:["success"],setup(d,{emit:t}){const o=t,a=e.ref(""),r=e.ref(""),l=e.ref(null),c=e.ref(!1),s=e.ref(""),n=e.ref(!1),i=e.inject("ServiceContainer"),{t:p}=i.i18n;e.onMounted(()=>{i.requester.send({url:"",method:"get",params:{q:"preview",adapter:i.modal.data.adapter,path:i.modal.data.item.path},responseType:"text"}).then(g=>{a.value=g,o("success")})});const f=()=>{c.value=!c.value,r.value=a.value,c.value==!0&&e.nextTick(()=>{l.value.focus()})},h=()=>{s.value="",n.value=!1,i.requester.send({url:"",method:"post",params:{q:"save",adapter:i.modal.data.adapter,path:i.modal.data.item.path},body:{content:r.value},responseType:"text"}).then(g=>{s.value=p("Updated."),a.value=g,o("success"),c.value=!c.value}).catch(g=>{s.value=p(g.message),n.value=!0})};return(g,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Gr,[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(i).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(i).modal.data.item.basename),9,Yr),e.createElementVNode("div",Kr,[c.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(p)("Save")),1)):e.createCommentVNode("",!0),e.unref(i).features.includes(e.unref($).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:w[0]||(w[0]=y=>f())},e.toDisplayString(c.value?e.unref(p)("Cancel"):e.unref(p)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",Xr,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:l,"onUpdate:modelValue":w[1]||(w[1]=y=>r.value=y),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",Jr,e.toDisplayString(a.value),1)),s.value.length?(e.openBlock(),e.createBlock(D,{key:2,onHidden:w[2]||(w[2]=y=>s.value=""),error:n.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},Zr={class:"flex"},ea=["aria-label"],ta={class:"ml-auto mb-2"},oa={class:"w-full flex justify-center"},ra=["src"],aa={__name:"Image",emits:["success"],setup(d,{emit:t}){const o=t,a=e.inject("ServiceContainer"),{t:r}=a.i18n,l=e.ref(null),c=e.ref(null),s=e.ref(!1),n=e.ref(""),i=e.ref(!1),p=()=>{s.value=!s.value,s.value?c.value=new te(l.value,{crop(h){}}):c.value.destroy()},f=()=>{c.value.getCroppedCanvas({width:795,height:341}).toBlob(h=>{n.value="",i.value=!1;const g=new FormData;g.set("file",h),a.requester.send({url:"",method:"post",params:{q:"upload",adapter:a.modal.data.adapter,path:a.modal.data.item.path},body:g}).then(w=>{n.value=r("Updated."),l.value.src=a.requester.getPreviewUrl(a.modal.data.adapter,a.modal.data.item),p(),o("success")}).catch(w=>{n.value=r(w.message),i.value=!0})})};return e.onMounted(()=>{o("success")}),(h,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Zr,[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(a).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(a).modal.data.item.basename),9,ea),e.createElementVNode("div",ta,[s.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f,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(a).features.includes(e.unref($).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:g[0]||(g[0]=w=>p())},e.toDisplayString(s.value?e.unref(r)("Cancel"):e.unref(r)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",oa,[e.createElementVNode("img",{ref_key:"image",ref:l,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(a).requester.getPreviewUrl(e.unref(a).modal.data.adapter,e.unref(a).modal.data.item),alt:""},null,8,ra)]),n.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:g[1]||(g[1]=w=>n.value=""),error:i.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},na={class:"flex"},la=["aria-label"],sa=e.createElementVNode("div",null,null,-1),ia={__name:"Default",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t;return e.onMounted(()=>{a("success")}),(r,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",na,[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,la)]),sa],64))}},ca=["aria-label"],da={class:"w-full",preload:"",controls:""},ua=["src"],ma={__name:"Video",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{a("success")}),(l,c)=>(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,ca),e.createElementVNode("div",null,[e.createElementVNode("video",da,[e.createElementVNode("source",{src:r(),type:"video/mp4"},null,8,ua),e.createTextVNode(" Your browser does not support the video tag. ")])])]))}},pa=["aria-label"],fa={class:"w-full",controls:""},va=["src"],ha={__name:"Audio",emits:["success"],setup(d,{emit:t}){const o=t,a=e.inject("ServiceContainer"),r=()=>a.requester.getPreviewUrl(a.modal.data.adapter,a.modal.data.item);return e.onMounted(()=>{o("success")}),(l,c)=>(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(a).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(a).modal.data.item.basename),9,pa),e.createElementVNode("div",null,[e.createElementVNode("audio",fa,[e.createElementVNode("source",{src:r(),type:"audio/mpeg"},null,8,va),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},ga=["aria-label"],ka=["data"],ya=["src"],_a=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),xa=[_a],wa={__name:"Pdf",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{a("success")}),(l,c)=>(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,ga),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%"},xa,8,ya)],8,ka)])],64))}},ba={class:"sm:flex sm:items-start"},Ea={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},Va={key:0},Na={class:"text-gray-700 dark:text-gray-200 text-sm"},Ba={key:0,class:"flex leading-5"},$a=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),Ca={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},Sa={class:"font-bold"},Da={class:"font-bold pl-2"},Ma={key:0,class:"text-xs text-gray-600 dark:text-gray-400"},ja=["download","href"],Ta={name:"VFModalPreview"},La=Object.assign(Ta,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=e.ref(!1),r=c=>(t.modal.data.item.mime_type??"").startsWith(c),l=t.features.includes($.PREVIEW);return l||(a.value=!0),(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[6]||(s[6]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1),e.unref(t).features.includes(e.unref($).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,ja)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",ba,[e.createElementVNode("div",Ea,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",Va,[r("text")?(e.openBlock(),e.createBlock(Qr,{key:0,onSuccess:s[0]||(s[0]=n=>a.value=!0)})):r("image")?(e.openBlock(),e.createBlock(aa,{key:1,onSuccess:s[1]||(s[1]=n=>a.value=!0)})):r("video")?(e.openBlock(),e.createBlock(ma,{key:2,onSuccess:s[2]||(s[2]=n=>a.value=!0)})):r("audio")?(e.openBlock(),e.createBlock(ha,{key:3,onSuccess:s[3]||(s[3]=n=>a.value=!0)})):r("application/pdf")?(e.openBlock(),e.createBlock(wa,{key:4,onSuccess:s[4]||(s[4]=n=>a.value=!0)})):(e.openBlock(),e.createBlock(ia,{key:5,onSuccess:s[5]||(s[5]=n=>a.value=!0)}))])):e.createCommentVNode("",!0),e.createElementVNode("div",Na,[a.value===!1?(e.openBlock(),e.createElementBlock("div",Ba,[$a,e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Ca,[e.createElementVNode("div",null,[e.createElementVNode("span",Sa,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",Da,e.toDisplayString(e.unref(o)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(Y)(e.unref(t).modal.data.item.last_modified)),1)])]),e.unref(t).features.includes(e.unref($).DOWNLOAD)?(e.openBlock(),e.createElementBlock("div",Ma,[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}))}}),Fa={class:"sm:flex sm:items-start"},za=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),Aa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Oa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ua={class:"mt-2"},Ha={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},Ra={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"},qa=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),Ia=[qa],Pa={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"},Wa=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),Ga=[Wa],Ya={class:"ml-1.5"},Ka={name:"VFModalRename"},Ja=Object.assign(Ka,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(t.modal.data.items[0]),r=e.ref(t.modal.data.items[0].basename),l=e.ref(""),c=()=>{r.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"rename",m:"post",adapter:t.adapter,path:t.data.dirname},body:{item:a.value.path,name:r.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is renamed.",r.value)})},onError:s=>{l.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Fa,[za,e.createElementVNode("div",Aa,[e.createElementVNode("h3",Oa,e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("div",Ua,[e.createElementVNode("p",Ha,[a.value.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Ra,Ia)):(e.openBlock(),e.createElementBlock("svg",Pa,Ga)),e.createElementVNode("span",Ya,e.toDisplayString(a.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>r.value=i),onKeyup:e.withKeys(c,["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]]),l.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[1]||(n[1]=i=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Xa={class:"sm:flex sm:items-start"},Qa=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),Za={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},en={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},tn={class:"mt-2"},on={key:0,class:"pointer-events-none"},rn={key:1,class:"pointer-events-none"},an=["disabled"],nn=["disabled"],ln={class:"text-gray-500 text-sm mb-1 pr-1 max-h-[200px] overflow-y-auto vf-scrollbar"},sn={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"},cn=["textContent"],dn={class:"ml-1 w-full h-fit"},un={class:"text-left hidden md:block"},mn={class:"text-left md:hidden"},pn={key:0,class:"ml-auto"},fn=["title","disabled","onClick"],vn=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),hn=[vn],gn={key:0,class:"py-2"},kn=["disabled"],yn={name:"VFModalUpload"},_n=Object.assign(yn,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=o("uppy"),r={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10},l=e.ref({QUEUE_ENTRY_STATUS:r}),c=e.ref(null),s=e.ref(null),n=e.ref(null),i=e.ref(null),p=e.ref(null),f=e.ref(null),h=e.ref([]),g=e.ref(""),w=e.ref(!1),y=e.ref(!1);let m;function u(E){return h.value.findIndex(x=>x.id===E)}function B(E,x=null){x=x??(E.webkitRelativePath||E.name),m.addFile({name:x,type:E.type,data:E,source:"Local"})}function C(E){switch(E.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=E=>{switch(E.status){case r.DONE:return"✓";case r.ERROR:case r.CANCELED:return"!";case r.PENDING:default:return"..."}};function L(){i.value.click()}function F(){if(!w.value){if(!h.value.filter(E=>E.status!==r.DONE).length){g.value=o("Please select file to upload first.");return}g.value="",m.retryAll(),m.upload()}}function z(){m.cancelAll({reason:"user"}),h.value.forEach(E=>{E.status!==r.DONE&&(E.status=r.CANCELED,E.statusName=o("Canceled"))}),w.value=!1}function A(E){w.value||(m.removeFile(E.id,"removed-by-user"),h.value.splice(u(E.id),1))}function k(E){if(!w.value){if(m.cancelAll({reason:"user"}),E){const x=[];h.value.forEach(v=>{v.status!==r.DONE&&x.push(v)}),h.value=[],x.forEach(v=>{B(v.originalFile,v.name)});return}h.value.splice(0)}}function b(){t.emitter.emit("vf-modal-close")}function _(){return t.requester.transformRequestParams({url:"",method:"post",params:{q:"upload",adapter:t.data.adapter,path:t.data.dirname}})}return e.onMounted(async()=>{m=new oe({debug:t.debug,restrictions:{maxFileSize:ue(t.maxFileSize)},locale:a,onBeforeFileAdded(v,V){if(V[v.id]!=null){const T=u(v.id);h.value[T].status===r.PENDING&&(g.value=m.i18n("noDuplicates",{fileName:v.name})),h.value=h.value.filter(U=>U.id!==v.id)}return h.value.push({id:v.id,name:v.name,size:t.filesize(v.size),status:r.PENDING,statusName:o("Pending upload"),percent:null,originalFile:v.data}),!0}}),m.use(re,{endpoint:"WILL_BE_REPLACED_BEFORE_UPLOAD",limit:5,timeout:0,getResponseError(v,V){let N;try{N=JSON.parse(v).message}catch{N=o("Cannot parse server response.")}return new Error(N)}}),m.on("restriction-failed",(v,V)=>{const N=h.value[u(v.id)];A(N),g.value=V.message}),m.on("upload",()=>{const v=_();m.setMeta({...v.body});const V=m.getPlugin("XHRUpload");V.opts.method=v.method,V.opts.endpoint=v.url+"?"+new URLSearchParams(v.params),V.opts.headers=v.headers,w.value=!0,h.value.forEach(N=>{N.status!==r.DONE&&(N.percent=null,N.status=r.UPLOADING,N.statusName=o("Pending upload"))})}),m.on("upload-progress",(v,V)=>{const N=Math.floor(V.bytesUploaded/V.bytesTotal*100);h.value[u(v.id)].percent=`${N}%`}),m.on("upload-success",v=>{const V=h.value[u(v.id)];V.status=r.DONE,V.statusName=o("Done")}),m.on("upload-error",(v,V)=>{const N=h.value[u(v.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")}),m.on("error",v=>{g.value=v.message,w.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname},noCloseModal:!0})}),m.on("complete",()=>{w.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname},noCloseModal:!0})}),i.value.addEventListener("click",()=>{s.value.click()}),p.value.addEventListener("click",()=>{n.value.click()}),f.value.addEventListener("dragover",v=>{v.preventDefault(),y.value=!0}),f.value.addEventListener("dragleave",v=>{v.preventDefault(),y.value=!1});function E(v,V){V.isFile&&V.file(N=>v(V,N)),V.isDirectory&&V.createReader().readEntries(N=>{N.forEach(T=>{E(v,T)})})}f.value.addEventListener("drop",v=>{v.preventDefault(),y.value=!1;const V=/^[/\\](.+)/;[...v.dataTransfer.items].forEach(N=>{N.kind==="file"&&E((T,U)=>{const K=V.exec(T.fullPath);B(U,K[1])},N.webkitGetAsEntry())})});const x=({target:v})=>{const V=v.files;for(const N of V)B(N);v.value=""};s.value.addEventListener("change",x),n.value.addEventListener("change",x)}),e.onBeforeUnmount(()=>{m==null||m.close({reason:"unmount"})}),(E,x)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["vf-btn vf-btn-primary",w.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:w.value,onClick:e.withModifiers(F,["prevent"])},e.toDisplayString(e.unref(o)("Upload")),11,kn),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(z,["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(b,["prevent"])},e.toDisplayString(e.unref(o)("Close")),1))]),default:e.withCtx(()=>[e.createElementVNode("div",Xa,[Qa,e.createElementVNode("div",Za,[e.createElementVNode("h3",en,e.toDisplayString(e.unref(o)("Upload Files")),1),e.createElementVNode("div",tn,[e.createElementVNode("div",{ref_key:"dropArea",ref:f,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:L},[y.value?(e.openBlock(),e.createElementBlock("div",on,e.toDisplayString(e.unref(o)("Release to drop these files.")),1)):(e.openBlock(),e.createElementBlock("div",rn,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:c,class:"text-gray-500 mb-1"},[e.createElementVNode("button",{ref_key:"pickFiles",ref:i,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Files")),513),e.createElementVNode("button",{ref_key:"pickFolders",ref:p,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:w.value,onClick:x[0]||(x[0]=v=>k(!1))},e.toDisplayString(e.unref(o)("Clear all")),9,an),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:w.value,onClick:x[1]||(x[1]=v=>k(!0))},e.toDisplayString(e.unref(o)("Clear only successful")),9,nn)],512),e.createElementVNode("div",ln,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,v=>(e.openBlock(),e.createElementBlock("div",{class:"flex hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-gray-300",key:v.id},[e.createElementVNode("span",sn,[e.createElementVNode("span",{class:e.normalizeClass(["text-base m-auto",C(v)]),textContent:e.toDisplayString(M(v))},null,10,cn)]),e.createElementVNode("div",dn,[e.createElementVNode("div",un,e.toDisplayString(e.unref(q)(v.name,40))+" ("+e.toDisplayString(v.size)+")",1),e.createElementVNode("div",mn,e.toDisplayString(e.unref(q)(v.name,16))+" ("+e.toDisplayString(v.size)+")",1),e.createElementVNode("div",{class:e.normalizeClass(["flex break-all text-left",C(v)])},[e.createTextVNode(e.toDisplayString(v.statusName)+" ",1),v.status===l.value.QUEUE_ENTRY_STATUS.UPLOADING?(e.openBlock(),e.createElementBlock("b",pn,e.toDisplayString(v.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",w.value?"disabled:bg-gray-100 text-white text-opacity-50":"bg-gray-100"]),title:e.unref(o)("Delete"),disabled:w.value,onClick:V=>A(v)},hn,10,fn)]))),128)),h.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gn,e.toDisplayString(e.unref(o)("No files selected!")),1))]),g.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:x[2]||(x[2]=v=>g.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),e.createElementVNode("input",{ref_key:"internalFileInput",ref:s,type:"file",multiple:"",class:"hidden"},null,512),e.createElementVNode("input",{ref_key:"internalFolderInput",ref:n,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1}))}}),xn={class:"sm:flex sm:items-start"},wn=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),bn={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},En={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Vn={class:"mt-2"},Nn={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},Bn={class:"flex text-sm text-gray-800 dark:text-gray-400"},$n={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"},Cn=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),Sn=[Cn],Dn={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"},Mn=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),jn=[Mn],Tn={class:"ml-1.5"},Ln=["placeholder"],Fn={name:"VFModalArchive"},zn=Object.assign(Fn,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=e.ref(t.modal.data.items),c=()=>{l.value.length&&t.emitter.emit("vf-fetch",{params:{q:"archive",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:l.value.map(({path:s,type:n})=>({path:s,type:n})),name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file(s) archived.")})},onError:s=>{r.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",xn,[wn,e.createElementVNode("div",bn,[e.createElementVNode("h3",En,e.toDisplayString(e.unref(o)("Archive the files")),1),e.createElementVNode("div",Vn,[e.createElementVNode("div",Nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("p",Bn,[i.type==="dir"?(e.openBlock(),e.createElementBlock("svg",$n,Sn)):(e.openBlock(),e.createElementBlock("svg",Dn,jn)),e.createElementVNode("span",Tn,e.toDisplayString(i.basename),1)]))),256))]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>a.value=i),onKeyup:e.withKeys(c,["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,Ln),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[1]||(n[1]=i=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),An={class:"sm:flex sm:items-start"},On=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),Un={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Hn={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Rn={class:"mt-2"},qn={class:"flex text-sm text-gray-800 dark:text-gray-400"},In={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"},Pn=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),Wn=[Pn],Gn={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"},Yn=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),Kn=[Yn],Jn={class:"ml-1.5"},Xn={class:"my-1 text-sm text-gray-500"},Qn={name:"VFModalUnarchive"},Zn=Object.assign(Qn,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n;e.ref("");const a=e.ref(t.modal.data.items[0]),r=e.ref(""),l=e.ref([]),c=()=>{t.emitter.emit("vf-fetch",{params:{q:"unarchive",m:"post",adapter:t.adapter,path:t.data.dirname},body:{item:a.value.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file unarchived.")})},onError:s=>{r.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:n[1]||(n[1]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",An,[On,e.createElementVNode("div",Un,[e.createElementVNode("h3",Hn,e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("div",Rn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("p",qn,[i.type==="dir"?(e.openBlock(),e.createElementBlock("svg",In,Wn)):(e.openBlock(),e.createElementBlock("svg",Gn,Kn)),e.createElementVNode("span",Jn,e.toDisplayString(i.basename),1)]))),256)),e.createElementVNode("p",Xn,e.toDisplayString(e.unref(o)("The archive will be unarchived at"))+" ("+e.toDisplayString(e.unref(t).data.dirname)+")",1),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[0]||(n[0]=i=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),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",{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),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"},al={class:"text-sm text-gray-500 pb-1"},nl={class:"max-h-[200px] overflow-y-auto vf-scrollbar text-left"},ll={class:"flex text-sm text-gray-800 dark:text-gray-400"},sl={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"},il=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),cl=[il],dl={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"},ul=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),ml=[ul],pl={class:"ml-1.5"},fl={class:"font-bold text-xs text-gray-700 dark:text-gray-500 mt-3 tracking-wider"},vl={class:"flex text-sm text-gray-800 dark:text-gray-400 border dark:border-gray-700 p-1 rounded"},hl=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),gl={class:"ml-1.5 overflow-auto"},kl={class:"m-1 mr-auto font-bold text-gray-500 text-sm dark:text-gray-200 self-center"},yl={name:"VFModalMove"},_l=Object.assign(yl,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;t.storage;const a=e.ref(t.modal.data.items.from),r=e.ref(""),l=()=>{a.value.length&&t.emitter.emit("vf-fetch",{params:{q:"move",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:a.value.map(({path:c,type:s})=>({path:c,type:s})),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:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",kl,e.toDisplayString(e.unref(o)("%s item(s) selected.",a.value.length)),1)]),default:e.withCtx(()=>[e.createElementVNode("div",el,[tl,e.createElementVNode("div",ol,[e.createElementVNode("h3",rl,e.toDisplayString(e.unref(o)("Move files")),1),e.createElementVNode("p",al,e.toDisplayString(e.unref(o)("Are you sure you want to move these files?")),1),e.createElementVNode("div",nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,n=>(e.openBlock(),e.createElementBlock("div",ll,[e.createElementVNode("div",null,[n.type==="dir"?(e.openBlock(),e.createElementBlock("svg",sl,cl)):(e.openBlock(),e.createElementBlock("svg",dl,ml))]),e.createElementVNode("div",pl,e.toDisplayString(n.path),1)]))),256))]),e.createElementVNode("h4",fl,e.toDisplayString(e.unref(o)("Target Directory")),1),e.createElementVNode("p",vl,[hl,e.createElementVNode("span",gl,e.toDisplayString(e.unref(t).modal.data.items.to.path),1)]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[0]||(s[0]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1}))}}),xl=(d,t)=>{const o=d.__vccOpts||d;for(const[a,r]of t)o[a]=r;return o},wl={props:{on:{type:String,required:!0}},setup(d,{emit:t,slots:o}){const a=e.inject("ServiceContainer"),r=e.ref(!1),{t:l}=a.i18n;let c=null;const s=()=>{clearTimeout(c),r.value=!0,c=setTimeout(()=>{r.value=!1},2e3)};return e.onMounted(()=>{a.emitter.on(d.on,s)}),e.onUnmounted(()=>{clearTimeout(c)}),{shown:r,t:l}}},bl={key:1};function El(d,t,o,a,r,l){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":!a.shown}]])},[d.$slots.default?e.renderSlot(d.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("span",bl,e.toDisplayString(a.t("Saved.")),1))],2)}const R=xl(wl,[["render",El]]),Vl={class:"sm:flex sm:items-start"},Nl=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),Bl={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},$l={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Cl={class:"mt-2"},Sl={class:"text-sm text-gray-500"},Dl={class:"text-sm font-semibold mt-5 text-gray-900 dark:text-gray-400 tracking-wider"},Ml={class:"mt-3 text-left"},jl={class:"space-y-2"},Tl={class:"flex relative gap-x-3"},Ll={class:"h-6 items-center"},Fl={class:"flex-1 block text-sm"},zl={for:"metric_unit",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},Al={class:"flex relative gap-x-3"},Ol={class:"h-6 items-center"},Ul={for:"theme",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm"},Hl={class:"flex text-sm"},Rl=["label"],ql=["value"],Il={key:0,class:"flex relative gap-x-3"},Pl={class:"h-6 items-center"},Wl={for:"language",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm text-nowrap"},Gl={class:"flex text-sm"},Yl=["label"],Kl=["value"],Jl={name:"VFModalAbout"},Xl=Object.assign(Jl,{setup(d){const t=e.inject("ServiceContainer"),{getStore:o,setStore:a,clearStore:r}=t.storage,{t:l,changeLocale:c,locale:s}=t.i18n;e.ref(""),e.ref("");const n=async()=>{r(),location.reload()},i=y=>{t.theme.set(y),t.emitter.emit("vf-theme-saved")},p=()=>{t.metricUnits=!t.metricUnits,t.filesize=t.metricUnits?G:W,a("metricUnits",t.metricUnits),t.emitter.emit("vf-metric-units-saved")},{i18n:f}=e.inject("VueFinderOptions"),g=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(([y])=>Object.keys(f).includes(y))),w=e.computed(()=>({system:l("System"),light:l("Light"),dark:l("Dark")}));return(y,m)=>(e.openBlock(),e.createBlock(S,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m[5]||(m[5]=u=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(l)("Close")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Vl,[Nl,e.createElementVNode("div",Bl,[e.createElementVNode("h3",$l,e.toDisplayString(e.unref(l)("About %s","Vuefinder "+e.unref(t).version)),1),e.createElementVNode("div",Cl,[e.createElementVNode("p",Sl,e.toDisplayString(e.unref(l)("Vuefinder is a file manager component for vue 3.")),1),e.createElementVNode("div",null,[e.createElementVNode("h3",Dl,e.toDisplayString(e.unref(l)("Settings")),1)]),e.createElementVNode("div",Ml,[e.createElementVNode("fieldset",null,[e.createElementVNode("div",jl,[e.createElementVNode("div",Tl,[e.createElementVNode("div",Ll,[e.withDirectives(e.createElementVNode("input",{id:"metric_unit",name:"metric_unit",type:"checkbox","onUpdate:modelValue":m[0]||(m[0]=u=>e.unref(t).metricUnits=u),onClick:p,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",Fl,[e.createElementVNode("label",zl,[e.createTextVNode(e.toDisplayString(e.unref(l)("Use Metric Units"))+" ",1),e.createVNode(R,{class:"ms-3",on:"vf-metric-units-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",Al,[e.createElementVNode("div",Ol,[e.createElementVNode("label",Ul,e.toDisplayString(e.unref(l)("Theme")),1)]),e.createElementVNode("div",Hl,[e.withDirectives(e.createElementVNode("select",{id:"theme","onUpdate:modelValue":m[1]||(m[1]=u=>e.unref(t).theme.value=u),onChange:m[2]||(m[2]=u=>i(u.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(l)("Theme")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(u,B)=>(e.openBlock(),e.createElementBlock("option",{value:B},e.toDisplayString(u),9,ql))),256))],8,Rl)],544),[[e.vModelSelect,e.unref(t).theme.value]]),e.createVNode(R,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-theme-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])]),e.unref(t).features.includes(e.unref($).LANGUAGE)&&Object.keys(e.unref(g)).length>1?(e.openBlock(),e.createElementBlock("div",Il,[e.createElementVNode("div",Pl,[e.createElementVNode("label",Wl,e.toDisplayString(e.unref(l)("Language")),1)]),e.createElementVNode("div",Gl,[e.withDirectives(e.createElementVNode("select",{id:"language","onUpdate:modelValue":m[3]||(m[3]=u=>e.isRef(s)?s.value=u:null),onChange:m[4]||(m[4]=u=>e.unref(c)(u.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(l)("Language")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(u,B)=>(e.openBlock(),e.createElementBlock("option",{value:B},e.toDisplayString(u),9,Kl))),256))],8,Yl)],544),[[e.vModelSelect,e.unref(s)]]),e.createVNode(R,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-language-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:n,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(l)("Reset Settings")),1)])])])])])])]),_:1}))}}),Ql=Object.freeze(Object.defineProperty({__proto__:null,ModalAbout:Xl,ModalArchive:zn,ModalDelete:_r,ModalMessage:$r,ModalMove:_l,ModalNewFile:Wr,ModalNewFolder:zr,ModalPreview:La,ModalRename:Ja,ModalUnarchive:Zn,ModalUpload:_n},Symbol.toStringTag,{value:"Module"})),Zl={install(d,t={}){d.component("VueFinder",Go);for(const a of Object.values(Ql))d.component(a.name,a);t.i18n=t.i18n??{};let[o]=Object.keys(t.i18n);t.locale=t.locale??o??"en",d.provide("VueFinderOptions",t)}};module.exports=Zl;
package/dist/vuefinder.js CHANGED
@@ -186,7 +186,7 @@ const B = {
186
186
  FULL_SCREEN: "fullscreen",
187
187
  DOWNLOAD: "download",
188
188
  LANGUAGE: "language"
189
- }, We = Object.values(B), Ge = "2.2.5";
189
+ }, We = Object.values(B), Ge = "2.2.6";
190
190
  function ye(p, e, s, r, o) {
191
191
  return (e = Math, s = e.log, r = 1024, o = s(p) / s(r) | 0, p / e.pow(r, o)).toFixed(0) + " " + (o ? "KMGTPEZY"[--o] + "iB" : "B");
192
192
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuefinder",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "description": "Vuefinder is a file manager component for vuejs.",
5
5
  "type": "module",
6
6
  "files": [