From 8b8af6fd7dcbca2edf5c418d1748808fde1405d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C3=96zdemir?= Date: Thu, 27 Jul 2023 19:56:14 +0300 Subject: [PATCH 01/22] update --- dist/vuefinder.js | 4 ++-- dist/vuefinder.umd.cjs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/vuefinder.js b/dist/vuefinder.js index 830a11e9..2c74a885 100644 --- a/dist/vuefinder.js +++ b/dist/vuefinder.js @@ -262,7 +262,7 @@ const Bo = { class: "border-neutral-300 flex justify-between items-center py-1 t g.value.length == 1 && g.value[0].mime_type == "application/zip" ? (w(), C("div", { key: 0, class: "mx-1.5", - "aria-label": x(i)("Unrchive"), + "aria-label": x(i)("Unarchive"), "data-microtip-position": "bottom", role: "tooltip", onClick: k[5] || (k[5] = (I) => !g.value.length || x(e).emit("vf-modal-show", { type: "unarchive", items: g.value })) @@ -3139,7 +3139,7 @@ const Ji = { class: "relative flex-auto flex flex-col overflow-hidden" }, Qi = { Ce(Un) ])); } -}), Va = "1.2.3", Ba = { class: "p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none" }, za = { class: "flex leading-5 items-center" }, Ha = ["aria-label"], Ua = /* @__PURE__ */ f("svg", { +}), Va = "1.2.4", Ba = { class: "p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none" }, za = { class: "flex leading-5 items-center" }, Ha = ["aria-label"], Ua = /* @__PURE__ */ f("svg", { xmlns: "http://www.w3.org/2000/svg", class: "h-5 w-5", fill: "none", diff --git a/dist/vuefinder.umd.cjs b/dist/vuefinder.umd.cjs index be99334e..49b5b804 100644 --- a/dist/vuefinder.umd.cjs +++ b/dist/vuefinder.umd.cjs @@ -1,7 +1,7 @@ -(function(e,ve){typeof exports=="object"&&typeof module<"u"?module.exports=ve(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],ve):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=ve(e.Vue,e.plupload))})(this,function(e,ve){var bn;"use strict";const nt=(bn=document.querySelector('meta[name="csrf-token"]'))==null?void 0:bn.getAttribute("content"),ot=(n,{method:t="get",params:o={},json:i=!0,signal:l=null})=>{const a={method:t};if(a.signal=l,t=="get")n+="?"+new URLSearchParams(o);else{a.headers={},nt&&(a.headers["X-CSRF-Token"]=nt);let u=new FormData;for(const[p,c]of Object.entries(o))u.append(p,c);a.body=u}return fetch(n,a).then(u=>u.ok?i?u.json():u.text():u.json().then(Promise.reject.bind(Promise)))};function Cn(n){return{all:n=n||new Map,on:function(t,o){var i=n.get(t);i?i.push(o):n.set(t,[o])},off:function(t,o){var i=n.get(t);i&&(o?i.splice(i.indexOf(o)>>>0,1):n.set(t,[]))},emit:function(t,o){var i=n.get(t);i&&i.slice().map(function(l){l(o)}),(i=n.get("*"))&&i.slice().map(function(l){l(t,o)})}}}function wt(n){let t=localStorage.getItem(n+"_storage");const o=e.ref(JSON.parse(t));e.watch(o,i);function i(){o.value===null||o.value===""?localStorage.removeItem(n+"_storage"):localStorage.setItem(n+"_storage",JSON.stringify(o.value))}function l(p,c){o.value=Object.assign({...o.value},{[p]:c})}function a(){o.value=null}return{getStore:(p,c=null)=>o.value===null||o.value===""?c:o.value.hasOwnProperty(p)?o.value[p]:c,setStore:l,clearStore:a}}const nr=e.ref("");function ue(){function n(t){nr.value=t}return{apiUrl:nr,setApiUrl:n}}const Vn={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Mn={key:0,class:"flex text-center"},Tn=["aria-label"],Bn=[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)],$n=["aria-label"],An=[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)],In=["aria-label"],Ln=[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)],On=["aria-label"],jn=[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)],Pn=["aria-label"],zn=[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)],Rn=["aria-label"],Hn=[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)],Fn=["aria-label"],Un=[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)],Yn={key:1,class:"flex text-center"},Kn={class:"pl-2"},Wn={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Xn={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"},Zn=[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),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)],qn={class:"flex text-center items-center justify-end"},Gn=["aria-label"],Jn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"},null,-1)],Qn=["aria-label"],eo={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"},to={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"},ro={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"},no=["aria-label"],oo={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"},io={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"},so=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),o=e.inject("usePropDarkMode"),{getStore:i,setStore:l}=e.inject("storage"),{t:a}=e.inject("i18n"),u=e.ref(i("viewport","grid")),p=e.ref([]),c=e.ref(i("full-screen",!1)),y=e.ref("");t.on("vf-search-query",({newQuery:E})=>{y.value=E});const m=e.inject("loadingState"),b=()=>m.value,S=()=>{c.value=!c.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",E=>{p.value=E}),t.on("vf-view-toggle",E=>{l("viewport",E),u.value=E}),(E,_)=>(e.openBlock(),e.createElementBlock("div",Vn,[y.value.length?(e.openBlock(),e.createElementBlock("div",Yn,[e.createElementVNode("div",Kn,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Wn,e.toDisplayString(y.value),1)]),b()?(e.openBlock(),e.createElementBlock("svg",Xn,Zn)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Mn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:_[0]||(_[0]=N=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:p.value}))},Bn,8,Tn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[1]||(_[1]=N=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:p.value}))},An,8,$n),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[2]||(_[2]=N=>p.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},Ln,2))],8,In),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[3]||(_[3]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},jn,2))],8,On),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[4]||(_[4]=N=>e.unref(t).emit("vf-modal-show",{type:"upload",items:p.value}))},zn,8,Pn),p.value.length==1&&p.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[5]||(_[5]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},Hn,2))],8,Rn)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[6]||(_[6]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},Un,2))],8,Fn))])),e.createElementVNode("div",qn,[e.withDirectives(e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:_[7]||(_[7]=N=>e.unref(t).emit("vf-darkMode-toggle")),viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-6 w-6 m-auto cursor-pointer stroke-sky-500 fill-sky-100 hover:stroke-sky-600 dark:stroke-gray-400 dark:fill-gray-400/20 dark:hover:stroke-gray-300"},Jn))],8,Gn),[[e.vShow,!e.unref(o)]]),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:S},[(e.openBlock(),e.createElementBlock("svg",eo,[c.value?(e.openBlock(),e.createElementBlock("path",to)):(e.openBlock(),e.createElementBlock("path",ro))]))],8,Qn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:_[8]||(_[8]=N=>y.value.length||e.unref(t).emit("vf-view-toggle",u.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([y.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"},[u.value=="grid"?(e.openBlock(),e.createElementBlock("path",oo)):e.createCommentVNode("",!0),u.value=="list"?(e.openBlock(),e.createElementBlock("path",io)):e.createCommentVNode("",!0)],2))],8,no)])]))}});var ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var or={exports:{}};(function(n,t){(function(o,i){n.exports=i()})(ao,function(){function o(d,h){var r=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(r!=null){var g,s,f,v,w=[],x=!0,A=!1;try{if(f=(r=r.call(d)).next,h===0){if(Object(r)!==r)return;x=!1}else for(;!(x=(g=f.call(r)).done)&&(w.push(g.value),w.length!==h);x=!0);}catch(z){A=!0,s=z}finally{try{if(!x&&r.return!=null&&(v=r.return(),Object(v)!==v))return}finally{if(A)throw s}}return w}}function i(d,h){var r=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);h&&(g=g.filter(function(s){return Object.getOwnPropertyDescriptor(d,s).enumerable})),r.push.apply(r,g)}return r}function l(d){for(var h=1;h"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function E(d,h,r){return S()?E=Reflect.construct.bind():E=function(s,f,v){var w=[null];w.push.apply(w,f);var x=Function.bind.apply(s,w),A=new x;return v&&b(A,v.prototype),A},E.apply(null,arguments)}function _(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function N(d){var h=typeof Map=="function"?new Map:void 0;return N=function(g){if(g===null||!_(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h<"u"){if(h.has(g))return h.get(g);h.set(g,s)}function s(){return E(g,arguments,m(this).constructor)}return s.prototype=Object.create(g.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),b(s,g)},N(d)}function D(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function L(d,h){if(h&&(typeof h=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(d)}function $(d){var h=S();return function(){var g=m(d),s;if(h){var f=m(this).constructor;s=Reflect.construct(g,arguments,f)}else s=g.apply(this,arguments);return L(this,s)}}function T(d,h){for(;!Object.prototype.hasOwnProperty.call(d,h)&&(d=m(d),d!==null););return d}function I(){return typeof Reflect<"u"&&Reflect.get?I=Reflect.get.bind():I=function(h,r,g){var s=T(h,r);if(s){var f=Object.getOwnPropertyDescriptor(s,r);return f.get?f.get.call(arguments.length<3?h:g):f.value}},I.apply(this,arguments)}function R(d,h){return H(d)||o(d,h)||W(d,h)||ne()}function k(d){return M(d)||X(d)||W(d)||se()}function M(d){if(Array.isArray(d))return te(d)}function H(d){if(Array.isArray(d))return d}function X(d){if(typeof Symbol<"u"&&d[Symbol.iterator]!=null||d["@@iterator"]!=null)return Array.from(d)}function W(d,h){if(d){if(typeof d=="string")return te(d,h);var r=Object.prototype.toString.call(d).slice(8,-1);if(r==="Object"&&d.constructor&&(r=d.constructor.name),r==="Map"||r==="Set")return Array.from(d);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(d,h)}}function te(d,h){(h==null||h>d.length)&&(h=d.length);for(var r=0,g=new Array(h);r{const a={method:t};if(a.signal=l,t=="get")n+="?"+new URLSearchParams(o);else{a.headers={},nt&&(a.headers["X-CSRF-Token"]=nt);let u=new FormData;for(const[p,c]of Object.entries(o))u.append(p,c);a.body=u}return fetch(n,a).then(u=>u.ok?i?u.json():u.text():u.json().then(Promise.reject.bind(Promise)))};function Cn(n){return{all:n=n||new Map,on:function(t,o){var i=n.get(t);i?i.push(o):n.set(t,[o])},off:function(t,o){var i=n.get(t);i&&(o?i.splice(i.indexOf(o)>>>0,1):n.set(t,[]))},emit:function(t,o){var i=n.get(t);i&&i.slice().map(function(l){l(o)}),(i=n.get("*"))&&i.slice().map(function(l){l(t,o)})}}}function wt(n){let t=localStorage.getItem(n+"_storage");const o=e.ref(JSON.parse(t));e.watch(o,i);function i(){o.value===null||o.value===""?localStorage.removeItem(n+"_storage"):localStorage.setItem(n+"_storage",JSON.stringify(o.value))}function l(p,c){o.value=Object.assign({...o.value},{[p]:c})}function a(){o.value=null}return{getStore:(p,c=null)=>o.value===null||o.value===""?c:o.value.hasOwnProperty(p)?o.value[p]:c,setStore:l,clearStore:a}}const nr=e.ref("");function ue(){function n(t){nr.value=t}return{apiUrl:nr,setApiUrl:n}}const Vn={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Mn={key:0,class:"flex text-center"},Tn=["aria-label"],Bn=[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)],$n=["aria-label"],An=[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)],In=["aria-label"],Ln=[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)],On=["aria-label"],jn=[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)],Pn=["aria-label"],zn=[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)],Rn=["aria-label"],Hn=[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)],Fn=["aria-label"],Un=[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)],Yn={key:1,class:"flex text-center"},Kn={class:"pl-2"},Wn={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Xn={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"},Zn=[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),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)],qn={class:"flex text-center items-center justify-end"},Gn=["aria-label"],Jn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"},null,-1)],Qn=["aria-label"],eo={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"},to={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"},ro={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"},no=["aria-label"],oo={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"},io={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"},so=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),o=e.inject("usePropDarkMode"),{getStore:i,setStore:l}=e.inject("storage"),{t:a}=e.inject("i18n"),u=e.ref(i("viewport","grid")),p=e.ref([]),c=e.ref(i("full-screen",!1)),y=e.ref("");t.on("vf-search-query",({newQuery:E})=>{y.value=E});const m=e.inject("loadingState"),b=()=>m.value,S=()=>{c.value=!c.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",E=>{p.value=E}),t.on("vf-view-toggle",E=>{l("viewport",E),u.value=E}),(E,_)=>(e.openBlock(),e.createElementBlock("div",Vn,[y.value.length?(e.openBlock(),e.createElementBlock("div",Yn,[e.createElementVNode("div",Kn,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Wn,e.toDisplayString(y.value),1)]),b()?(e.openBlock(),e.createElementBlock("svg",Xn,Zn)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Mn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:_[0]||(_[0]=N=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:p.value}))},Bn,8,Tn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[1]||(_[1]=N=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:p.value}))},An,8,$n),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[2]||(_[2]=N=>p.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},Ln,2))],8,In),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[3]||(_[3]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},jn,2))],8,On),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[4]||(_[4]=N=>e.unref(t).emit("vf-modal-show",{type:"upload",items:p.value}))},zn,8,Pn),p.value.length==1&&p.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Unarchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[5]||(_[5]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},Hn,2))],8,Rn)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[6]||(_[6]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},Un,2))],8,Fn))])),e.createElementVNode("div",qn,[e.withDirectives(e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:_[7]||(_[7]=N=>e.unref(t).emit("vf-darkMode-toggle")),viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-6 w-6 m-auto cursor-pointer stroke-sky-500 fill-sky-100 hover:stroke-sky-600 dark:stroke-gray-400 dark:fill-gray-400/20 dark:hover:stroke-gray-300"},Jn))],8,Gn),[[e.vShow,!e.unref(o)]]),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:S},[(e.openBlock(),e.createElementBlock("svg",eo,[c.value?(e.openBlock(),e.createElementBlock("path",to)):(e.openBlock(),e.createElementBlock("path",ro))]))],8,Qn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:_[8]||(_[8]=N=>y.value.length||e.unref(t).emit("vf-view-toggle",u.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([y.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"},[u.value=="grid"?(e.openBlock(),e.createElementBlock("path",oo)):e.createCommentVNode("",!0),u.value=="list"?(e.openBlock(),e.createElementBlock("path",io)):e.createCommentVNode("",!0)],2))],8,no)])]))}});var ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var or={exports:{}};(function(n,t){(function(o,i){n.exports=i()})(ao,function(){function o(d,h){var r=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(r!=null){var g,s,f,v,w=[],x=!0,A=!1;try{if(f=(r=r.call(d)).next,h===0){if(Object(r)!==r)return;x=!1}else for(;!(x=(g=f.call(r)).done)&&(w.push(g.value),w.length!==h);x=!0);}catch(z){A=!0,s=z}finally{try{if(!x&&r.return!=null&&(v=r.return(),Object(v)!==v))return}finally{if(A)throw s}}return w}}function i(d,h){var r=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);h&&(g=g.filter(function(s){return Object.getOwnPropertyDescriptor(d,s).enumerable})),r.push.apply(r,g)}return r}function l(d){for(var h=1;h"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function E(d,h,r){return S()?E=Reflect.construct.bind():E=function(s,f,v){var w=[null];w.push.apply(w,f);var x=Function.bind.apply(s,w),A=new x;return v&&b(A,v.prototype),A},E.apply(null,arguments)}function _(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function N(d){var h=typeof Map=="function"?new Map:void 0;return N=function(g){if(g===null||!_(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h<"u"){if(h.has(g))return h.get(g);h.set(g,s)}function s(){return E(g,arguments,m(this).constructor)}return s.prototype=Object.create(g.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),b(s,g)},N(d)}function D(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function L(d,h){if(h&&(typeof h=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(d)}function $(d){var h=S();return function(){var g=m(d),s;if(h){var f=m(this).constructor;s=Reflect.construct(g,arguments,f)}else s=g.apply(this,arguments);return L(this,s)}}function T(d,h){for(;!Object.prototype.hasOwnProperty.call(d,h)&&(d=m(d),d!==null););return d}function I(){return typeof Reflect<"u"&&Reflect.get?I=Reflect.get.bind():I=function(h,r,g){var s=T(h,r);if(s){var f=Object.getOwnPropertyDescriptor(s,r);return f.get?f.get.call(arguments.length<3?h:g):f.value}},I.apply(this,arguments)}function R(d,h){return H(d)||o(d,h)||W(d,h)||ne()}function k(d){return M(d)||X(d)||W(d)||se()}function M(d){if(Array.isArray(d))return te(d)}function H(d){if(Array.isArray(d))return d}function X(d){if(typeof Symbol<"u"&&d[Symbol.iterator]!=null||d["@@iterator"]!=null)return Array.from(d)}function W(d,h){if(d){if(typeof d=="string")return te(d,h);var r=Object.prototype.toString.call(d).slice(8,-1);if(r==="Object"&&d.constructor&&(r=d.constructor.name),r==="Map"||r==="Set")return Array.from(d);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(d,h)}}function te(d,h){(h==null||h>d.length)&&(h=d.length);for(var r=0,g=new Array(h);r=d.length?{done:!0}:{done:!1,value:d[g++]}},e:function(x){throw x},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,v=!1,w;return{s:function(){r=r.call(d)},n:function(){var x=r.next();return f=x.done,x},e:function(x){v=!0,w=x},f:function(){try{!f&&r.return!=null&&r.return()}finally{if(v)throw w}}}}function C(d,h){if(typeof d!="object"||d===null)return d;var r=d[Symbol.toPrimitive];if(r!==void 0){var g=r.call(d,h||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}function B(d){var h=C(d,"string");return typeof h=="symbol"?h:String(h)}var V=function(h,r,g){var s=h.x,f=h.y,v=g.x,w=g.y,x={"+":{x:s+v,y:f+w},"-":{x:s-v,y:f-w},"*":{x:s*v,y:f*w},"/":{x:s/v,y:f/w}};return x[r]},Y=function(h){return{x:h.left,y:h.top}},O=function(h){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:h.x,top:h.y,right:h.x,bottom:h.y,width:r,height:r}},ce=function(h){return{x:h,y:h}},ae=function(d,h){var r=h;window.addEventListener("resize",r),window.addEventListener("scroll",r);var g=new MutationObserver(r);d.forEach(function(f,v){g.observe(f,{childList:v!==0,attributes:!0})});var s=function(){return jd(g,r)};return{observer:g,callback:r,cleanup:s}},pt=function(d){var h=bt(d);return h.x||h.y?!0:d instanceof Document?d.body?!!(d.body.scrollTop=1):!!(d.documentElement.scrollTop=1):!!(d.scrollTop=1)},gt=function(){var d=document.createElement("div");return d.style.position="fixed",d.style.overflow="hidden",d.style.pointerEvents="none",d.style.zIndex="999999999999999999",d},Qt=function(d){var h=document.createElement("div");return h.style.position="absolute",d||(h.style.background="rgba(0, 175, 255, 0.2)",h.style.border="1px solid rgba(0, 175, 255, 0.8)",h.style.display="none",h.style.pointerEvents="none"),h},yt=function(d,h){var r;return function(){for(var g=arguments.length,s=new Array(g),f=0;f1&&arguments[1]!==void 0?arguments[1]:0,v=(s=g[f])===null||s===void 0?void 0:s.parentNode;return v?(g.push(v),f++,r(g,f)):g};return h([d])},Nd=function(d,h){if(d instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var r=d.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(d.clientWidth||r.width)*h,height:(d.clientHeight||r.height)*h}},Sn=function(d,h){var r={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return Ne(d).forEach(function(g){var s=h.getRect(g);r.top=Math.min(r.top,s.top),r.left=Math.min(r.left,s.left),r.bottom=Math.max(r.bottom,s.bottom),r.right=Math.max(r.right,s.right)}),r.height=r.bottom-r.top,r.width=r.right-r.left,r},bt=function(d){return!d||d instanceof Document?er():{x:d.scrollLeft>=0?d.scrollLeft:er().x,y:d.scrollTop>=0?d.scrollTop:er().y}},wn=function(d){var h=d.elementRect,r=d.containerRect,g=d.tolerance,s=g===void 0?{x:0,y:0}:g,f=[];return h.top-s.yr.bottom&&f.push("bottom"),h.right+s.y>r.right&&f.push("right"),f},Cd=function(d){var h=d.event;return{x:h.clientX,y:h.clientY}},Vd=function(d){var h=d.scrollAmount,r=d.initialPointerPos,g=d.pointerPos,s={};return g.x>r.x-h.x?(s.left=r.x-h.x,s.width=g.x-r.x+h.x):(s.left=g.x,s.width=r.x-g.x-h.x),g.y>r.y-h.y?(s.top=r.y-h.y,s.height=g.y-r.y+h.y):(s.top=g.y,s.height=r.y-g.y-h.y),s},_n=function(h){var r={x:0,y:0},g=window.getComputedStyle(h);if(!g.transform||g.transform==="none")return r;if(g.transform.indexOf("3d")>=0){var s=g.transform.trim().match(/matrix3d\((.*?)\)/);if(s&&s.length){var f,v=(f=s[1])===null||f===void 0?void 0:f.split(",");r.x=parseInt(v[12])||0,r.y=parseInt(v[13])||0}return r}var w=g.transform.trim().match(/matrix\((.*?)\)/);if(w&&w.length){var x,A=(x=w[1])===null||x===void 0?void 0:x.split(",");r.x=parseInt(A[4])||0,r.y=parseInt(A[5])||0}return r},Md=function(h){var r=h.style.transform;if(!r||r.indexOf("translate")<0)return _n(h);var g={x:0,y:0},s=r.trim().match(/translate[3dD]*?\(.*?\)/);if(s){var f,v=(f=s[0])===null||f===void 0?void 0:f.split("(");if(v){var w,x=(w=v[1])===null||w===void 0?void 0:w.split(",");g.x=parseInt(x[0])||0,g.y=parseInt(x[1])||0}}return!g.x&&!g.x?_n(h):g},Td=function(h){var r=h.style,g={x:parseInt(r.left)||0,y:parseInt(r.top)||0};if(!g.x&&!g.x){var s=window.getComputedStyle(h);return{x:parseInt(s.left)||0,y:parseInt(s.top)||0}}return g},Bd=function(d,h){return h?Md(d):Td(d)},$d=function(d){var h=d.element,r=d.edges,g=d.elementRect,s=d.containerRect,f=d.elementPos,v=d.useTransform;r.includes("top")&&et(h,{y:f.y+s.top-g.top,x:f.x},v),r.includes("left")&&et(h,{y:f.y,x:f.x+s.left-g.left},v),r.includes("bottom")&&et(h,{y:f.y+s.bottom-g.bottom,x:f.x},v),r.includes("right")&&et(h,{y:f.y,x:f.x+s.right-g.right},v)},kn=function(d){var h=d.computedStyle,r=d.node,g=h.position,s=g==="absolute"||g==="relative"||g==="fixed";!(r instanceof Document)&&!s&&(r.style.position="relative")},Ad=function(d){var h=d.shiftKey,r=d.keyboardDragSpeed,g=d.zoom,s=d.key,f=d.dragKeys,v=d.scrollDiff,w=d.canScroll,x=d.scrollCallback,A={x:0,y:0},z=h?r*4*g:r*g;return f.left.includes(s)&&(A.x=v.x||-z,!h&&!v.x&&w&&x(["left"],r)),f.right.includes(s)&&(A.x=v.x||z,!h&&!v.x&&w&&x(["right"],r)),f.up.includes(s)&&(A.y=v.y||-z,!h&&!v.y&&w&&x(["top"],r)),f.down.includes(s)&&(A.y=v.y||z,!h&&!v.y&&w&&x(["bottom"],r)),A},Id=function(d){var h=d.element,r=d.force,g=d.multiSelectionToggle,s=d.SelectedSet,f=d.hoverClassName;h.classList.contains(f)&&!r||(s.has(h)?g&&s.delete(h):s.add(h),h.classList.add(f))},Ld=function(d){var h=d.element,r=d.force,g=d.SelectedSet,s=d.PrevSelectedSet,f=d.hoverClassName;if(!h.classList.contains(f)&&!r)return!1;var v=g.has(h),w=s.has(h);v&&!w?g.delete(h):!v&&w&&g.add(h),h.classList.remove(f)},Qe=function(h,r,g){return console.warn('[DragSelect] TypeIssue: setting "'.concat(h,'" is not of type "').concat(r,'".'))},P=function(h,r,g,s){if(r===void 0)return g?c({},h,s):{};if(r===null)return c({},h,null);var f=!0,v=!1,w=typeof s=="string";w&&(f=typeof r=="string"||r instanceof String),w&&!f&&(v=!0,Qe(h,"string"));var x=!Number.isNaN(s)&&typeof s=="number";x&&(f=!Number.isNaN(r)&&typeof r=="number"),x&&!f&&(v=!0,Qe(h,"number"));var A=Object.prototype.toString.call(s)==="[object Object]";A&&(f=Object.prototype.toString.call(r)==="[object Object]"),A&&!f&&(v=!0,Qe(h,"object"));var z=typeof s=="boolean";z&&(f=typeof r=="boolean"),z&&!f&&(v=!0,Qe(h,"boolean"));var G=Array.isArray(s);G&&(f=Array.isArray(r)),G&&!f&&(v=!0,Qe(h,"array"));var de=v||g;return h==="dragKeys"&&f?c({},h,Object.assign(s,r)):h==="dragKeys"&&!f?de?c({},h,s):{}:(h==="dropZones"&&f&&new Set(r.map(function(he){return he.id})).size!==r.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),f?c({},h,r):de?c({},h,s):{})},Od=function(d,h){return l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l({},P("area",d.area,h,document)),P("selectables",d.selectables,h,null)),P("autoScrollSpeed",d.autoScrollSpeed,h,5)),P("overflowTolerance",d.overflowTolerance,h,{x:25,y:25})),P("zoom",d.zoom,h,1)),P("customStyles",d.customStyles,h,!1)),P("multiSelectMode",d.multiSelectMode,h,!1)),P("multiSelectToggling",d.multiSelectToggling,h,!0)),P("multiSelectKeys",d.multiSelectKeys,h,["Control","Shift","Meta"])),P("selector",d.selector,h,null)),P("selectionThreshold",d.selectionThreshold,h,0)),P("draggability",d.draggability,h,!0)),P("immediateDrag",d.immediateDrag,h,!0)),P("keyboardDrag",d.keyboardDrag,h,!0)),P("dragKeys",d.dragKeys,h,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),P("keyboardDragSpeed",d.keyboardDragSpeed,h,10)),P("useTransform",d.useTransform,h,!0)),P("refreshMemoryRate",d.refreshMemoryRate,h,80)),P("dropZones",d.dropZones,h,[])),P("dropInsideThreshold",d.dropInsideThreshold,h,1)),P("dropTargetThreshold",d.dropTargetThreshold,h,0)),P("usePointerEvents",d.usePointerEvents,h,!1)),P("hoverClass",d.hoverClass,h,"ds-hover")),P("selectableClass",d.selectableClass,h,"ds-selectable")),P("selectedClass",d.selectedClass,h,"ds-selected")),P("selectorClass",d.selectorClass,h,"ds-selector")),P("selectorAreaClass",d.selectorAreaClass,h,"ds-selector-area")),P("droppedTargetClass",d.droppedTargetClass,h,"ds-dropped-target")),P("droppedInsideClass",d.droppedInsideClass,h,"ds-dropped-inside")),P("droppableClass",d.droppableClass,h,"ds-droppable")),P("dropZoneClass",d.dropZoneClass,h,"ds-dropzone")),P("dropZoneReadyClass",d.dropZoneReadyClass,h,"ds-dropzone-ready")),P("dropZoneTargetClass",d.dropZoneTargetClass,h,"ds-dropzone-target")),P("dropZoneInsideClass",d.dropZoneInsideClass,h,"ds-dropzone-inside")),P("dragAsBlock",d.dragAsBlock,h,!1))},Re=function(d,h){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=d;if(r>0){var s=(d.right-d.left)*r,f=(d.bottom-d.top)*r;g={left:d.left+s,right:d.right-s,top:d.top+f,bottom:d.bottom-f}}return g.lefth.left&&g.toph.top},xn=function(d){var h=d.element,r=d.posDirection,g=d.containerRect,s=d.useTransform,f=Bd(h,s),v=V(f,"+",r);et(h,v,s);var w=h.getBoundingClientRect(),x=wn({elementRect:w,containerRect:g});$d({element:h,edges:x,elementRect:w,containerRect:g,elementPos:v,useTransform:s})},jd=function(d,h){window.removeEventListener("resize",h),window.removeEventListener("scroll",h),d.disconnect()},Pd=function(d,h,r){if(h.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=d instanceof Document?g||document.body:d,f=h.includes("top")&&s.scrollTop>0,v=h.includes("bottom")&&s.scrollTop0,x=h.includes("right")&&s.scrollLeft0&&(s.y=Math.min(s.y,w.bottom)),s.x>0&&(s.x=Math.min(s.x,w.right)),r._selectionRect.top+=s.y,r._selectionRect.bottom+=s.y,r._selectionRect.left+=s.x,r._selectionRect.right+=s.x),s}),c(this,"handleZIndex",function(s){r._elements.forEach(function(f){return f.style.zIndex="".concat((parseInt(f.style.zIndex)||0)+s?9999:-9998)})}),this.DS=g,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return p(d,[{key:"_cursorDiff",get:function(){var r=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?V(r,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=r,g}},{key:"_scrollDiff",get:function(){var r=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?V(r,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=r,g}}]),d}(),Fd=function(){function d(h){var r=this,g=h.DS,s=h.id,f=h.element,v=h.droppables;a(this,d),c(this,"id",void 0),c(this,"element",void 0),c(this,"_droppables",void 0),c(this,"_rect",void 0),c(this,"_observers",void 0),c(this,"_timeout",void 0),c(this,"_itemsDropped",[]),c(this,"_itemsInside",void 0),c(this,"setReadyClasses",function(w){if(!r.isDestroyed){var x=r.droppables.filter(function(A){return r.DS.SelectedSet.has(A)});x.length&&(x.forEach(function(A){A.classList[w]("".concat(r.Settings.droppableClass)),A.classList[w]("".concat(r.Settings.droppableClass,"-").concat(r.id))}),r.element.classList[w]("".concat(r.Settings.dropZoneReadyClass)))}}),c(this,"handleNoDrop",function(){var w;r.isDestroyed||(r.DS.SelectedSet.forEach(function(x){x.classList.remove(r.Settings.droppedTargetClass),x.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),r._itemsDropped=r._itemsDropped.filter(function(x){return!r.DS.SelectedSet.has(x)}),(w=r._itemsDropped)!==null&&w!==void 0&&w.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleDrop",function(){var w,x,A;r.isDestroyed||(r._itemsDropped=k(new Set([].concat(k(r._itemsDropped),k((w=r.droppables)===null||w===void 0?void 0:w.filter(function(z){return r.DS.SelectedSet.has(z)}))))),(x=r._itemsDropped)===null||x===void 0||x.forEach(function(z){z.classList.add("".concat(r.Settings.droppedTargetClass)),z.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),(A=r._itemsDropped)!==null&&A!==void 0&&A.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleItemsInsideClasses",function(){var w=!1;r.droppables.forEach(function(x){r.itemsInside.includes(x)?(x.classList.add("".concat(r.Settings.droppedInsideClass)),x.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),w=!0):(x.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),x.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||x.classList.remove("".concat(r.Settings.droppedInsideClass)))}),w?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))}),c(this,"start",function(w){var x=w.isDragging;!x||r.isDestroyed||r.setReadyClasses("add")}),c(this,"stop",function(w){var x=w.isDragging;!x||r.isDestroyed||(r.setReadyClasses("remove"),r.handleItemsInsideClasses())}),c(this,"toObject",function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.id=s,this.element=f,v&&(this.droppables=Ne(v)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",function(w){var x=w.settings;r.element&&(r.element.classList.remove(x["dropZoneClass:pre"]),r.element.classList.add(x.dropZoneClass))}),this._observers=ae(this.parentNodes,yt(function(){return r._rect=null},this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return p(d,[{key:"destroy",value:function(){var r=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach(function(g){g.classList.remove("".concat(r.Settings.droppedTargetClass)),g.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id)),g.classList.remove("".concat(r.Settings.droppableClass)),g.classList.remove("".concat(r.Settings.droppableClass,"-").concat(r.id))}),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var r=this;return this.isDestroyed?null:this._itemsInside?this._itemsInside:(this._itemsInside=this.droppables.flatMap(function(g){return Re(r.DS.SelectableSet.rects.get(g),r.rect,r.Settings.dropInsideThreshold)?[g]:[]}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return r._itemsInside=null},this.Settings.refreshMemoryRate),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=vn(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(r){this._droppables=r}}]),d}(),Ud=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"_zoneByElement",new Map),c(this,"_zoneById",new Map),c(this,"_zonesByDroppable",new Map),c(this,"_zones",void 0),c(this,"setDropZones",function(s){var f=s.dropZones;f&&(r._zones&&r._zones.forEach(function(v){return v.destroy()}),r._zones=f.map(function(v){return new Fd(l({DS:r.DS},v))}),r._zones.forEach(function(v){r._zoneByElement.set(v.element,v),r._zoneById.set(v.id,v),v.droppables.forEach(function(w){var x=r._zonesByDroppable.get(w);if(!(x!=null&&x.length))return r._zonesByDroppable.set(w,[v]);r._zonesByDroppable.set(w,k(new Set([].concat(k(x),[v]))))})}))}),c(this,"_handleDrop",function(s){r._zones.forEach(function(f){f!==s&&f.handleNoDrop()}),s&&s.handleDrop()}),c(this,"_getZoneByElementsFromPoint",function(s,f){for(var v=f.x,w=f.y,x=0,A=s.length;x0)){var v=r.DS,w=v.stores,x=w.PointerStore,A=w.KeyStore,z=v.SelectableSet,G=v.SelectedSet;x.start(f);var de=f.target;z.has(de)&&(A.isMultiSelectKeyPressed(f)||G.clear(),G.toggle(de),r.reset())}}),c(this,"stop",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(s.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(s.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),s.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)}),c(this,"update",function(s){var f=s.event,v=s.scroll_directions,w=s.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:f,scroll_directions:v,scroll_multiplier:w,isDragging:r.isDragging})}),c(this,"reset",function(s){return r.DS.publish("Interaction:end:pre",{event:s,isDragging:r.isDragging})}),c(this,"_reset",function(s){var f=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:s,isDragging:f})}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",function(s){var f=s.settings;r.stop(f["area:pre"]),r.init()}),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:start:pre",function(s){var f=s.event;return r._start(f)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(s){var f=s.event;return r._reset(f)}),this.DS.subscribe("Area:scroll",this.update)}return p(d,[{key:"_canInteract",value:function(r){var g=r.clientX===0&&r.clientY===0&&r.detail===0&&r.target;return!(r.button===2||this.isInteracting||r.target&&!this.DS.SelectorArea.isInside(r.target)||!g&&!this.DS.SelectorArea.isClicked(r))}}]),d}(),Kd=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"subscribers",{}),c(this,"subscribe",function(s,f){return Array.isArray(r.subscribers[s])||(r.subscribers[s]=[]),r.subscribers[s].push(f),r.subscribers[s].length-1}),c(this,"unsubscribe",function(s,f,v){v>=0?r.subscribers[s].splice(v,1):f&&(r.subscribers[s]=r.subscribers[s].filter(function(w){return w!==f}))}),c(this,"publish",function(s,f){Array.isArray(s)?s.forEach(function(v){return r._publish(v,f)}):r._publish(s,f)}),c(this,"_publish",function(s,f){var v=r.subscribers[s];Array.isArray(v)&&(s.includes(":pre")?r._handlePrePublish(v,f):r._handlePublish(v,f))}),c(this,"_handlePublish",function(s,f){for(var v=0,w=s.length;v0&&arguments[0]!==void 0?arguments[0]:"append",f=document.body?"body":"documentElement",v="".concat(s,"Child");r.HTMLNode[v](r.DS.Selector.HTMLNode),document[f][v](r.HTMLNode)}),c(this,"updatePos",function(){r._rect=null;var s=r.DS.Area.rect,f=r.DS.Area.computedBorder,v=r.HTMLNode.style,w="".concat(s.top+f.top,"px"),x="".concat(s.left+f.left,"px"),A="".concat(s.width,"px"),z="".concat(s.height,"px");v.top!==w&&(v.top=w),v.left!==x&&(v.left=x),v.width!==A&&(v.width=A),v.height!==z&&(v.height=z)}),c(this,"stop",function(s){r.stopAutoScroll(),s&&r.applyElements("remove")}),c(this,"startAutoScroll",function(){r.currentEdges=[],r._scrollInterval=setInterval(function(){return r.handleAutoScroll()},16)}),c(this,"handleAutoScroll",function(){if(!r.DS.continue){var s=r.DS,f=s.stores.PointerStore,v=s.Area;r.currentEdges=wn({elementRect:O(f.currentVal),containerRect:r.rect,tolerance:r.DS.stores.SettingsStore.s.overflowTolerance}),r.currentEdges.length&&v.scroll(r.currentEdges,r.DS.stores.SettingsStore.s.autoScrollSpeed)}}),c(this,"stopAutoScroll",function(){r.currentEdges=[],clearInterval(r._scrollInterval)}),c(this,"isInside",function(s,f){return r.DS.Area.HTMLNode.contains(s)&&r.DS.stores.ScrollStore.canScroll?!0:Re(r.rect,f||s.getBoundingClientRect())}),this.DS=g,this.HTMLNode=gt(),this.DS.subscribe("Settings:updated:selectorAreaClass",function(s){var f=s.settings;r.HTMLNode.classList.remove(f["selectorAreaClass:pre"]),r.HTMLNode.classList.add(f.selectorAreaClass)}),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){r.updatePos(),r.stopAutoScroll()})}return p(d,[{key:"isClicked",value:function(r){var g=this.DS.stores.PointerStore,s=r?g.getPointerPosition(r):g.initialVal;return Re({left:s.x,top:s.y,right:s.x,bottom:s.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),d}(),Jd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_currentValues",new Set),c(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),c(this,"init",function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)}),c(this,"keydown",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:s,key:f}),r._currentValues.add(f),r.DS.publish("KeyStore:down",{event:s,key:f})}),c(this,"keyup",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:s,key:f}),r._currentValues.delete(f),r.DS.publish("KeyStore:up",{event:s,key:f})}),c(this,"stop",function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()}),c(this,"reset",function(){return r._currentValues.clear()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init)}return p(d,[{key:"isMultiSelectKeyPressed",value:function(r){var g=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var s=this.DS.stores.SettingsStore.s.multiSelectKeys.map(function(f){return f.toLocaleLowerCase()});return!!(this.currentValues.some(function(f){return s.includes(f.toLocaleLowerCase())})||r&&s.some(function(f){return r[g._keyMapping[f]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),d}(),Qd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_isMouseInteraction",!1),c(this,"_initialValArea",void 0),c(this,"_currentValArea",void 0),c(this,"_lastValArea",void 0),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_lastVal",void 0),c(this,"_lastTouch",void 0),c(this,"init",function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})}),c(this,"getPointerPosition",function(s){return Cd({event:r._normalizedEvent(s)})}),c(this,"update",function(s){s&&(r.DS.publish("PointerStore:updated:pre",{event:s}),r.currentVal=r.getPointerPosition(s),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:s}))}),c(this,"stop",function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout(function(){return r._isMouseInteraction=!1},100)}),c(this,"reset",function(s){s&&(r.currentVal=r.lastVal=r.getPointerPosition(s),r.stop(),r.init())}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:end",function(s){var f=s.event;return r.reset(f)})}return p(d,[{key:"start",value:function(r){r&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(r))}},{key:"_normalizedEvent",value:function(r){return"touches"in r&&r.type!=="touchend"&&(this._lastTouch=r),"touches"in r?this._lastTouch.touches[0]:r}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(r){this._initialVal=r,this._initialValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(r){this._currentVal=r,this._currentValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(r){this._lastVal=r,this._lastValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}}]),d}(),eh=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_canScroll",void 0),c(this,"init",function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"start",function(){r._currentVal=r._initialVal=bt(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"update",function(){return r._currentVal=bt(r.DS.stores.SettingsStore.s.area)}),c(this,"stop",function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null}),c(this,"reset",function(){r.stop(),r.start()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return r.start()}),this.DS.subscribe("Interaction:end",function(){return r.reset()})}return p(d,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=pt(this.DS.stores.SettingsStore.s.area)}},{key:"scrollAmount",get:function(){var r=V(this.currentVal,"-",this.initialVal),g=ce(this.DS.stores.SettingsStore.s.zoom),s=V(V(r,"*",g),"-",r);return{x:r.x+s.x,y:r.y+s.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=bt(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),d}(),th=p(function d(h){var r=this,g=h.DS,s=h.settings;a(this,d),c(this,"_settings",{}),c(this,"s",{}),c(this,"update",function(f){var v=f.settings,w=f.init;return r.DS.publish("Settings:updated:pre",l({settings:v},w?{init:w}:{}))}),c(this,"_update",function(f){for(var v=f.settings,w=f.init,x=Od(v,w),A=function(){var he,be=R(G[z],2),Z=be[0],oe=be[1];Z in r._settings||Object.defineProperty(r.s,Z,{get:function(){return r._settings[Z]},set:function(rt){return r.update({settings:c({},Z,rt)})}}),r._settings["".concat(Z,":pre")]=r._settings[Z],r._settings[Z]=oe;var tt={settings:(he={},c(he,Z,r._settings[Z]),c(he,"".concat(Z,":pre"),r._settings["".concat(Z,":pre")]),he)};r.DS.publish("Settings:updated",tt),r.DS.publish("Settings:updated:".concat(Z),tt)},z=0,G=Object.entries(x);z0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(r),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),r&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ne(r)),s||this.addSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ne(r)),s&&this.removeSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(r){var g=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ne(r).forEach(function(v){return g.SelectedSet.has(v)?g.removeSelection(r,s,f):g.addSelection(r,s,f)}),s&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(r,g,s),this.getSelection()}},{key:"clearSelection",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),r&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(r,g,s){var f=Ne(r);return this.SelectableSet.addAll(f),g&&this.SelectedSet.addAll(f),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}},{key:"setSelectables",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(r,g),this.addSelectables(r,s)}},{key:"removeSelectables",value:function(r,g,s){return this.SelectableSet.deleteAll(Ne(r)),g&&this.removeSelection(r),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}}]),d}();return En.isCollision=Re,En})})(or);var co=or.exports;const ho=lo(co),ir=(n,t,o,i,l)=>(t=Math,o=t.log,i=1024,l=o(n)/o(i)|0,n/t.pow(i,l)).toFixed(0)+" "+(l?"KMGTPEZY"[--l]+"iB":"B"),sr=(n,t=null)=>new Date(n*1e3).toLocaleString(t??navigator.language??"en-US"),uo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},fo=[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)],mo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},po=[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)],it=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(n){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[n.direction=="down"?(e.openBlock(),e.createElementBlock("svg",uo,fo)):e.createCommentVNode("",!0),n.direction=="up"?(e.openBlock(),e.createElementBlock("svg",mo,po)):e.createCommentVNode("",!0)]))}}),go=["onClick"],yo=Object.assign({name:"VFToast.vue"},{setup(n){const t=e.inject("emitter"),{getStore:o}=e.inject("storage"),i=e.ref(o("full-screen",!1)),l=c=>c=="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",a=e.ref([]),u=c=>{a.value.splice(c,1)},p=c=>{let y=a.value.findIndex(m=>m.id===c);y!==-1&&u(y)};return t.on("vf-toast-clear",()=>{a.value=[]}),t.on("vf-toast-push",c=>{let y=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");c.id=y,a.value.push(c),setTimeout(()=>{p(y)},5e3)}),(c,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([i.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(a.value,(m,b)=>(e.openBlock(),e.createElementBlock("div",{onClick:S=>u(b),key:m,class:e.normalizeClass([l(m.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(m.label),11,go))),128))]),_:1})],2))}}),Ce=n=>Object.entries(n).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:bo}=ue(),_t=(n,t)=>bo.value+"?"+Ce({q:"preview",adapter:n,path:t}),we=typeof window<"u",ar=we&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),lr=we&&"IntersectionObserver"in window,cr=we&&"classList"in document.createElement("p"),dr=we&&window.devicePixelRatio>1,vo={elements_selector:".lazy",container:ar||we?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},hr=n=>Object.assign({},vo,n),ur=function(n,t){let o;const i="LazyLoad::Initialized",l=new n(t);try{o=new CustomEvent(i,{detail:{instance:l}})}catch{o=document.createEvent("CustomEvent"),o.initCustomEvent(i,!1,!1,{instance:l})}window.dispatchEvent(o)},So=(n,t)=>{if(t)if(!t.length)ur(n,t);else for(let o=0,i;i=t[o];o+=1)ur(n,i)},Se="src",kt="srcset",xt="sizes",fr="poster",He="llOriginalAttrs",mr="data",Dt="loading",pr="loaded",gr="applied",wo="entered",Et="error",yr="native",br="data-",vr="ll-status",J=(n,t)=>n.getAttribute(br+t),_o=(n,t,o)=>{var i=br+t;if(o===null){n.removeAttribute(i);return}n.setAttribute(i,o)},Fe=n=>J(n,vr),Ve=(n,t)=>_o(n,vr,t),st=n=>Ve(n,null),Nt=n=>Fe(n)===null,ko=n=>Fe(n)===Dt,xo=n=>Fe(n)===Et,Ct=n=>Fe(n)===yr,Do=[Dt,pr,gr,Et],Eo=n=>Do.indexOf(Fe(n))>=0,_e=(n,t,o,i)=>{if(n){if(i!==void 0){n(t,o,i);return}if(o!==void 0){n(t,o);return}n(t)}},Ae=(n,t)=>{if(cr){n.classList.add(t);return}n.className+=(n.className?" ":"")+t},fe=(n,t)=>{if(cr){n.classList.remove(t);return}n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},No=n=>{n.llTempImage=document.createElement("IMG")},Co=n=>{delete n.llTempImage},Sr=n=>n.llTempImage,at=(n,t)=>{if(!t)return;const o=t._observer;o&&o.unobserve(n)},Vo=n=>{n.disconnect()},Mo=(n,t,o)=>{t.unobserve_entered&&at(n,o)},Vt=(n,t)=>{n&&(n.loadingCount+=t)},To=n=>{n&&(n.toLoadCount-=1)},wr=(n,t)=>{n&&(n.toLoadCount=t)},Bo=n=>n.loadingCount>0,$o=n=>n.toLoadCount>0,_r=n=>{let t=[];for(let o=0,i;i=n.children[o];o+=1)i.tagName==="SOURCE"&&t.push(i);return t},Mt=(n,t)=>{const o=n.parentNode;if(!o||o.tagName!=="PICTURE")return;_r(o).forEach(t)},kr=(n,t)=>{_r(n).forEach(t)},lt=[Se],xr=[Se,fr],Ue=[Se,kt,xt],Dr=[mr],ct=n=>!!n[He],Er=n=>n[He],Nr=n=>delete n[He],Ie=(n,t)=>{if(ct(n))return;const o={};t.forEach(i=>{o[i]=n.getAttribute(i)}),n[He]=o},Ao=n=>{ct(n)||(n[He]={backgroundImage:n.style.backgroundImage})},Io=(n,t,o)=>{if(!o){n.removeAttribute(t);return}n.setAttribute(t,o)},Me=(n,t)=>{if(!ct(n))return;const o=Er(n);t.forEach(i=>{Io(n,i,o[i])})},Lo=n=>{if(!ct(n))return;const t=Er(n);n.style.backgroundImage=t.backgroundImage},Cr=(n,t,o)=>{Ae(n,t.class_applied),Ve(n,gr),o&&(t.unobserve_completed&&at(n,t),_e(t.callback_applied,n,o))},Vr=(n,t,o)=>{Ae(n,t.class_loading),Ve(n,Dt),o&&(Vt(o,1),_e(t.callback_loading,n,o))},ke=(n,t,o)=>{o&&n.setAttribute(t,o)},Mr=(n,t)=>{ke(n,xt,J(n,t.data_sizes)),ke(n,kt,J(n,t.data_srcset)),ke(n,Se,J(n,t.data_src))},Oo=(n,t)=>{Mt(n,o=>{Ie(o,Ue),Mr(o,t)}),Ie(n,Ue),Mr(n,t)},jo=(n,t)=>{Ie(n,lt),ke(n,Se,J(n,t.data_src))},Po=(n,t)=>{kr(n,o=>{Ie(o,lt),ke(o,Se,J(o,t.data_src))}),Ie(n,xr),ke(n,fr,J(n,t.data_poster)),ke(n,Se,J(n,t.data_src)),n.load()},zo=(n,t)=>{Ie(n,Dr),ke(n,mr,J(n,t.data_src))},Ro=(n,t,o)=>{const i=J(n,t.data_bg),l=J(n,t.data_bg_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=`url("${a}")`,Sr(n).setAttribute(Se,a),Vr(n,t,o))},Ho=(n,t,o)=>{const i=J(n,t.data_bg_multi),l=J(n,t.data_bg_multi_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=a,Cr(n,t,o))},Fo=(n,t,o)=>{const i=J(n,t.data_bg_set);if(!i)return;const l=i.split("|");let a=l.map(u=>`image-set(${u})`);n.style.backgroundImage=a.join(),n.style.backgroundImage===""&&(a=l.map(u=>`-webkit-image-set(${u})`),n.style.backgroundImage=a.join()),Cr(n,t,o)},Tr={IMG:Oo,IFRAME:jo,VIDEO:Po,OBJECT:zo},Uo=(n,t)=>{const o=Tr[n.tagName];o&&o(n,t)},Yo=(n,t,o)=>{const i=Tr[n.tagName];i&&(i(n,t),Vr(n,t,o))},Ko=["IMG","IFRAME","VIDEO","OBJECT"],Wo=n=>Ko.indexOf(n.tagName)>-1,Br=(n,t)=>{t&&!Bo(t)&&!$o(t)&&_e(n.callback_finish,t)},$r=(n,t,o)=>{n.addEventListener(t,o),n.llEvLisnrs[t]=o},Xo=(n,t,o)=>{n.removeEventListener(t,o)},Tt=n=>!!n.llEvLisnrs,Zo=(n,t,o)=>{Tt(n)||(n.llEvLisnrs={});const i=n.tagName==="VIDEO"?"loadeddata":"load";$r(n,i,t),$r(n,"error",o)},Bt=n=>{if(!Tt(n))return;const t=n.llEvLisnrs;for(let o in t){const i=t[o];Xo(n,o,i)}delete n.llEvLisnrs},Ar=(n,t,o)=>{Co(n),Vt(o,-1),To(o),fe(n,t.class_loading),t.unobserve_completed&&at(n,o)},qo=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_loaded),Ve(t,pr),_e(o.callback_loaded,t,i),l||Br(o,i)},Go=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_error),Ve(t,Et),_e(o.callback_error,t,i),o.restore_on_error&&Me(t,Ue),l||Br(o,i)},$t=(n,t,o)=>{const i=Sr(n)||n;if(Tt(i))return;Zo(i,u=>{qo(u,n,t,o),Bt(i)},u=>{Go(u,n,t,o),Bt(i)})},Jo=(n,t,o)=>{No(n),$t(n,t,o),Ao(n),Ro(n,t,o),Ho(n,t,o),Fo(n,t,o)},Qo=(n,t,o)=>{$t(n,t,o),Yo(n,t,o)},At=(n,t,o)=>{Wo(n)?Qo(n,t,o):Jo(n,t,o)},ei=(n,t,o)=>{n.setAttribute("loading","lazy"),$t(n,t,o),Uo(n,t),Ve(n,yr)},Ir=n=>{n.removeAttribute(Se),n.removeAttribute(kt),n.removeAttribute(xt)},ti=n=>{Mt(n,t=>{Ir(t)}),Ir(n)},Lr=n=>{Mt(n,t=>{Me(t,Ue)}),Me(n,Ue)},ri={IMG:Lr,IFRAME:n=>{Me(n,lt)},VIDEO:n=>{kr(n,t=>{Me(t,lt)}),Me(n,xr),n.load()},OBJECT:n=>{Me(n,Dr)}},ni=n=>{const t=ri[n.tagName];if(!t){Lo(n);return}t(n)},oi=(n,t)=>{Nt(n)||Ct(n)||(fe(n,t.class_entered),fe(n,t.class_exited),fe(n,t.class_applied),fe(n,t.class_loading),fe(n,t.class_loaded),fe(n,t.class_error))},ii=(n,t)=>{ni(n),oi(n,t),st(n),Nr(n)},si=(n,t,o,i)=>{o.cancel_on_exit&&ko(n)&&n.tagName==="IMG"&&(Bt(n),ti(n),Lr(n),fe(n,o.class_loading),Vt(i,-1),st(n),_e(o.callback_cancel,n,t,i))},ai=(n,t,o,i)=>{const l=Eo(n);Ve(n,wo),Ae(n,o.class_entered),fe(n,o.class_exited),Mo(n,o,i),_e(o.callback_enter,n,t,i),!l&&At(n,o,i)},li=(n,t,o,i)=>{Nt(n)||(Ae(n,o.class_exited),si(n,t,o,i),_e(o.callback_exit,n,t,i))},ci=["IMG","IFRAME","VIDEO"],Or=n=>n.use_native&&"loading"in HTMLImageElement.prototype,di=(n,t,o)=>{n.forEach(i=>{ci.indexOf(i.tagName)!==-1&&ei(i,t,o)}),wr(o,0)},hi=n=>n.isIntersecting||n.intersectionRatio>0,ui=n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}),fi=(n,t,o)=>{n.forEach(i=>hi(i)?ai(i.target,i,t,o):li(i.target,i,t,o))},mi=(n,t)=>{t.forEach(o=>{n.observe(o)})},pi=(n,t)=>{Vo(n),mi(n,t)},gi=(n,t)=>{!lr||Or(n)||(t._observer=new IntersectionObserver(o=>{fi(o,n,t)},ui(n)))},jr=n=>Array.prototype.slice.call(n),dt=n=>n.container.querySelectorAll(n.elements_selector),yi=n=>jr(n).filter(Nt),bi=n=>xo(n),vi=n=>jr(n).filter(bi),Pr=(n,t)=>yi(n||dt(t)),Si=(n,t)=>{vi(dt(n)).forEach(i=>{fe(i,n.class_error),st(i)}),t.update()},wi=(n,t)=>{we&&(t._onlineHandler=()=>{Si(n,t)},window.addEventListener("online",t._onlineHandler))},_i=n=>{we&&window.removeEventListener("online",n._onlineHandler)},Ye=function(n,t){const o=hr(n);this._settings=o,this.loadingCount=0,gi(o,this),wi(o,this),this.update(t)};Ye.prototype={update:function(n){const t=this._settings,o=Pr(n,t);if(wr(this,o.length),ar||!lr){this.loadAll(o);return}if(Or(t)){di(o,t,this);return}pi(this._observer,o)},destroy:function(){this._observer&&this._observer.disconnect(),_i(this),dt(this._settings).forEach(n=>{Nr(n)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(n){const t=this._settings;Pr(n,t).forEach(i=>{at(i,this),At(i,t,this)})},restoreAll:function(){const n=this._settings;dt(n).forEach(t=>{ii(t,n)})}},Ye.load=(n,t)=>{const o=hr(t);At(n,o)},Ye.resetStatus=n=>{st(n)},we&&So(Ye,window.lazyLoadOptions);const ki={class:"relative flex-auto flex flex-col overflow-hidden"},xi={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Di={class:"absolute"},Ei=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),Ni={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"},Ci=["onDblclick","onContextmenu","data-type","data-item","data-index"],Vi={class:"grid grid-cols-12 items-center"},Mi={class:"flex col-span-7 items-center"},Ti={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"},Bi=[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)],$i={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"},Ai=[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)],Ii={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Li={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Oi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],ji={class:"grid grid-cols-12 items-center"},Pi={class:"flex col-span-7 items-center"},zi={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"},Ri=[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)],Hi={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"},Fi=[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)],Ui={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Yi={class:"col-span-2 text-center"},Ki={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Wi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Xi={class:"relative"},Zi={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"},qi=[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)],Gi=["data-src","alt"],Ji={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"},Qi=[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)],es={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},ts={class:"break-all"},rs=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(n){const t=n,o=e.inject("emitter"),{setStore:i,getStore:l}=e.inject("storage"),a=e.inject("adapter"),u=C=>C==null?void 0:C.substring(0,3),p=C=>C.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),c=e.ref(null),y=e.ref(null),m=e.ref(0),b=e.ref(null),{t:S}=e.inject("i18n"),E=Math.floor(Math.random()*2**32),_=e.ref(l("full-screen",!1)),N=new Ye;o.on("vf-fullscreen-toggle",()=>{c.value.style.height=null,_.value=!_.value,i("full-screen",_.value)});const D=e.ref("");o.on("vf-search-query",({newQuery:C})=>{D.value=C,C?o.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:C},onSuccess:B=>{B.files.length||o.emit("vf-toast-push",{label:S("No search result found.")})}}):o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let L=null;const $=()=>{L&&clearTimeout(L)},T=e.ref(!0),I=C=>{C.touches.length>1&&(T.value?(b.value.stop(),o.emit("vf-toast-push",{label:S("Drag&Drop: off")})):(b.value.start(),o.emit("vf-toast-push",{label:S("Drag&Drop: on")}),o.emit("vf-explorer-update")),T.value=!T.value)},R=C=>{L=setTimeout(()=>{const B=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:C.target.getBoundingClientRect().x,clientY:C.target.getBoundingClientRect().y});C.target.dispatchEvent(B)},500)},k=C=>{C.type=="dir"?(o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:C.path}})):o.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:C})},M=e.reactive({active:!1,column:"",order:""}),H=(C=!0)=>{let B=[...t.data.files],V=M.column,Y=M.order=="asc"?1:-1;if(!C)return B;const O=(ce,ae)=>typeof ce=="string"&&typeof ae=="string"?ce.toLowerCase().localeCompare(ae.toLowerCase()):ceae?1:0;return M.active&&(B=B.slice().sort((ce,ae)=>O(ce[V],ae[V])*Y)),B},X=C=>{M.active&&M.column==C?(M.active=M.order=="asc",M.column=C,M.order="desc"):(M.active=!0,M.column=C,M.order="asc")},W=()=>b.value.getSelection().map(C=>JSON.parse(C.dataset.item)),te=(C,B)=>{if(C.altKey||C.ctrlKey||C.metaKey)return C.preventDefault(),!1;C.dataTransfer.setDragImage(y.value,0,15),C.dataTransfer.effectAllowed="all",C.dataTransfer.dropEffect="copy",C.dataTransfer.setData("items",JSON.stringify(W()))},se=(C,B)=>{C.preventDefault();let V=JSON.parse(C.dataTransfer.getData("items"));if(V.find(Y=>Y.storage!=a.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:V,to:B}})},ne=(C,B)=>{C.preventDefault(),!B||B.type!=="dir"||b.value.getSelection().find(V=>V==C.currentTarget)?(C.dataTransfer.dropEffect="none",C.dataTransfer.effectAllowed="none"):C.dataTransfer.dropEffect="copy"},re=()=>{b.value=new ho({area:c.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),o.on("vf-explorer-update",()=>e.nextTick(()=>{b.value.clearSelection(),b.value.setSelectables(document.getElementsByClassName("vf-item-"+E))})),b.value.subscribe("predragstart",({event:C,isDragging:B})=>{if(B)m.value=b.value.getSelection().length,b.value.break();else{const V=C.target.offsetWidth-C.offsetX,Y=C.target.offsetHeight-C.offsetY;V<15&&Y<15&&(b.value.clearSelection(),b.value.break())}}),b.value.subscribe("predragmove",({isDragging:C})=>{C&&b.value.break()}),b.value.subscribe("callback",({items:C,event:B,isDragging:V})=>{o.emit("vf-nodes-selected",W()),m.value=b.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{b.value.Area.reset(),b.value.SelectorArea.updatePos(),N.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>o.emit("vf-explorer-update"))}),(C,B)=>(e.openBlock(),e.createElementBlock("div",ki,[n.view=="list"||D.value.length?(e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("div",{onClick:B[0]||(B[0]=V=>X("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(S)("Name"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="basename"]])]),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:B[1]||(B[1]=V=>X("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(S)("Size"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="file_size"]])])),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:B[2]||(B[2]=V=>X("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(S)("Date"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="last_modified"]])])),D.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:B[3]||(B[3]=V=>X("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(S)("Filepath"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("div",{ref_key:"dragImage",ref:y,class:"absolute -z-50 -top-96"},[Ei,e.createElementVNode("div",Ni,e.toDisplayString(m.value),1)],512)]),e.createElementVNode("div",{onTouchstart:I,onContextmenu:B[10]||(B[10]=e.withModifiers(V=>e.unref(o).emit("vf-contextmenu-show",{event:V,area:c.value,items:W()}),["self","prevent"])),class:e.normalizeClass([_.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:c},[D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:O=>k(V),onTouchstart:B[4]||(B[4]=O=>R(O)),onTouchend:B[5]||(B[5]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Mi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ti,Bi)):(e.openBlock(),e.createElementBlock("svg",$i,Ai)),e.createElementVNode("span",Ii,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Li,e.toDisplayString(V.path),1)])],42,Ci))),256)):e.createCommentVNode("",!0),n.view=="list"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[6]||(B[6]=O=>R(O)),onTouchend:B[7]||(B[7]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",ji,[e.createElementVNode("div",Pi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",zi,Ri)):(e.openBlock(),e.createElementBlock("svg",Hi,Fi)),e.createElementVNode("span",Ui,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Yi,e.toDisplayString(V.file_size?e.unref(ir)(V.file_size):""),1),e.createElementVNode("div",Ki,e.toDisplayString(e.unref(sr)(V.last_modified)),1)])],42,Oi))),256)):e.createCommentVNode("",!0),n.view=="grid"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H(!1),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[8]||(B[8]=O=>R(O)),onTouchend:B[9]||(B[9]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",null,[e.createElementVNode("div",Xi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Zi,qi)):(V.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)(e.unref(a).value,V.path),alt:V.basename},null,8,Gi)):(e.openBlock(),e.createElementBlock("svg",Ji,Qi)),!(V.mime_type??"").startsWith("image")&&V.type!="dir"?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(u(V.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ts,e.toDisplayString(p(V.basename)),1)])],42,Wi))),256)):e.createCommentVNode("",!0)],34),e.createVNode(yo)]))}}),ns="1.2.3",os={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},is={class:"flex leading-5 items-center"},ss=["aria-label"],as=[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)],ls=["value"],cs={class:"ml-3"},ds={key:0},hs={class:"ml-1"},us={class:"flex leading-5 items-center"},fs={value:"",disabled:""},ms=e.createStaticVNode('',7),ps=["aria-label"],gs=[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)],ys=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),{getStore:o,setStore:i}=e.inject("storage"),l=e.ref(0),a=e.inject("adapter"),{t:u,changeLocale:p}=e.inject("i18n"),c=e.ref(o("locale","")),y=()=>{t.emit("vf-search-exit"),t.emit("vf-fetch",{params:{q:"index",adapter:a.value}}),i("adapter",a.value)};t.on("vf-nodes-selected",b=>{l.value=b.length});const m=e.ref("");return t.on("vf-search-query",({newQuery:b})=>{m.value=b}),(b,S)=>(e.openBlock(),e.createElementBlock("div",os,[e.createElementVNode("div",is,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(u)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},as,8,ss),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=E=>e.isRef(a)?a.value=E:null),onChange:y,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data.storages,E=>(e.openBlock(),e.createElementBlock("option",{value:E},e.toDisplayString(E),9,ls))),256))],544),[[e.vModelSelect,e.unref(a)]]),e.createElementVNode("div",cs,[m.value.length?(e.openBlock(),e.createElementBlock("span",ds,e.toDisplayString(n.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",hs,e.toDisplayString(l.value>0?l.value+" "+e.unref(u)("item(s) selected."):""),1)])]),e.createElementVNode("div",us,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=E=>c.value=E),onChange:S[2]||(S[2]=E=>e.unref(p)(E.target.value)),class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8 mr-3"},[e.createElementVNode("option",fs,e.toDisplayString(e.unref(u)("Language")),1),ms],544),[[e.vModelSelect,c.value]]),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(u)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=E=>e.unref(t).emit("vf-modal-show",{type:"message",title:"Vuefinder "+e.unref(ns),message:e.unref(u)("Vuefinder is a file manager component for vue 3.")}))},gs,8,ps)])]))}}),bs=(n,t=0,o=!1)=>{let i;return(...l)=>{o&&!i&&n(...l),clearTimeout(i),i=setTimeout(()=>{n(...l)},t)}},vs=(n,t,o)=>{const i=e.ref(n);return e.customRef((a,u)=>({get(){return a(),i.value},set:bs(p=>{i.value=p,u()},t,o)}))},Ss={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-xs"},ws=["aria-label"],_s=[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)],ks=["aria-label"],xs=[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)],Ds=["aria-label"],Es=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ns=["onClick"],Cs=[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)],Vs={class:"flex leading-5"},Ms=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),Ts=["title","onClick"],Bs={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"},$s=[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),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)],As={key:3,class:"relative flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Is=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),Ls=e.createElementVNode("div",{class:"w-full"},null,-1),Os=["onKeydown","placeholder"],js=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ps=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),l=e.ref(null),a=e.ref([]),u=e.ref(!1),p=e.ref(null),{t:c}=e.inject("i18n"),y=e.inject("loadingState");o.on("vf-explorer-update",()=>{let $=[],T=[];l.value=t.data.dirname??i.value+"://",l.value.length==0&&(a.value=[]),l.value.replace(i.value+"://","").split("/").forEach(function(I){$.push(I),$.join("/")!=""&&T.push({basename:I,name:I,path:i.value+"://"+$.join("/"),type:"dir"})}),T.length>4&&(T=T.slice(-5),T[0].name=".."),a.value=T});const m=()=>{u.value=!1,S.value=""};o.on("vf-search-exit",()=>{m()});const b=()=>{u.value=!0,e.nextTick(()=>p.value.focus())},S=vs("",400),E=()=>y.value;e.watch(S,$=>{o.emit("vf-toast-clear"),o.emit("vf-search-query",{newQuery:$})});const _=()=>a.value.length&&!u.value,N=$=>{$.preventDefault();let T=JSON.parse($.dataTransfer.getData("items"));if(T.find(I=>I.storage!=i.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:T,to:a.value[a.value.length-2]??{path:i.value+"://"}}})},D=$=>{$.preventDefault(),_()?$.dataTransfer.dropEffect="copy":($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none")},L=()=>{S.value==""&&m()};return($,T)=>(e.openBlock(),e.createElementBlock("div",Ss,[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:T[0]||(T[0]=I=>D(I)),onDrop:T[1]||(T[1]=I=>N(I)),onClick:T[2]||(T[2]=I=>{var R;return!_()||e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:((R=a.value[a.value.length-2])==null?void 0:R.path)??e.unref(i)+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",_()?"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"},_s,34))],8,ws),E()?(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:T[4]||(T[4]=I=>e.unref(o).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"},Es))],8,Ds)):(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:T[3]||(T[3]=I=>{e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:n.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"},xs))],8,ks)),u.value?(e.openBlock(),e.createElementBlock("div",As,[Is,Ls,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:p,onKeydown:e.withKeys(m,["esc"]),onBlur:L,"onUpdate:modelValue":T[6]||(T[6]=I=>e.isRef(S)?S.value=I:null),placeholder:e.unref(c)("Search anything.."),class:"absolute ml-4 pt-1 pb-0 px-2 border-0 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,Os),[[e.vModelText,e.unref(S)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:m,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},js))])):(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(b,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[5]||(T[5]=I=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.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"},Cs)),e.createElementVNode("div",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(I,R)=>(e.openBlock(),e.createElementBlock("div",{key:R},[Ms,e.createElementVNode("span",{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:I.basename,onClick:k=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:I.path}})},e.toDisplayString(I.name),9,Ts)]))),128))]),E()?(e.openBlock(),e.createElementBlock("svg",Bs,$s)):e.createCommentVNode("",!0)],8,Ns))]))}}),zs=["onClick"],Rs=e.createElementVNode("span",{class:"px-1"},null,-1),Hs=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(n){const t=n,o=e.inject("emitter"),i=e.ref(null),{apiUrl:l}=ue(),a=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),u=e.ref([]);o.on("vf-context-selected",S=>{u.value=S});const{t:p}=e.inject("i18n"),c={newfolder:{title:()=>p("New Folder"),action:()=>{o.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>p("Delete"),action:()=>{o.emit("vf-modal-show",{type:"delete",items:u})}},refresh:{title:()=>p("Refresh"),action:()=>{o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>p("Preview"),action:()=>{o.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:u.value[0]})}},open:{title:()=>p("Open"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].path}})}},openDir:{title:()=>p("Open containing folder"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].dir}})}},download:{title:()=>p("Download"),action:()=>{const S=l.value+"?"+Ce({q:"download",adapter:t.current.adapter,path:u.value[0].path});o.emit("vf-download",S)}},archive:{title:()=>p("Archive"),action:()=>{o.emit("vf-modal-show",{type:"archive",items:u})}},unarchive:{title:()=>p("Unarchive"),action:()=>{o.emit("vf-modal-show",{type:"unarchive",items:u})}},rename:{title:()=>p("Rename"),action:()=>{o.emit("vf-modal-show",{type:"rename",items:u})}}},y=S=>{o.emit("vf-contextmenu-hide"),S.action()},m=e.ref("");o.on("vf-search-query",({newQuery:S})=>{m.value=S}),o.on("vf-contextmenu-show",({event:S,area:E,items:_,target:N=null})=>{if(a.items=[],m.value)if(N)a.items.push(c.openDir),o.emit("vf-context-selected",[N]);else return;else!N&&!m.value?(a.items.push(c.refresh),a.items.push(c.newfolder),o.emit("vf-context-selected",[])):_.length>1&&_.some(D=>D.path===N.path)?(a.items.push(c.refresh),a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",_)):(N.type=="dir"?a.items.push(c.open):(a.items.push(c.preview),a.items.push(c.download)),a.items.push(c.rename),N.mime_type=="application/zip"?a.items.push(c.unarchive):a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",[N]));b(S,E)}),o.on("vf-contextmenu-hide",()=>{a.active=!1});const b=(S,E)=>{a.active=!0,e.nextTick(()=>{let _=E.getBoundingClientRect(),N=S.pageX,D=S.pageY,L=i.value.offsetHeight,$=i.value.offsetWidth;N=_.right-S.pageX+window.scrollX<$?N-$:N,D=_.bottom-S.pageY+window.scrollYa.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:i,style:e.normalizeStyle(a.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,_=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:_.title,onClick:N=>y(_)},[Rs,e.createElementVNode("span",null,e.toDisplayString(_.title()),1)],8,zs))),128))],4)):e.createCommentVNode("",!0)}}),Fs=(n,t)=>{const o=n[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((i,l)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(l.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function Us(n){const t=await Fs(Object.assign({"../locales/de.json":()=>Promise.resolve().then(()=>wd),"../locales/en.json":()=>Promise.resolve().then(()=>_d),"../locales/fa.json":()=>Promise.resolve().then(()=>kd),"../locales/he.json":()=>Promise.resolve().then(()=>xd),"../locales/ru.json":()=>Promise.resolve().then(()=>Dd),"../locales/tr.json":()=>Promise.resolve().then(()=>Ed)}),`../locales/${n}.json`);return JSON.parse(t.default)}function Ys(n,t,o){const{getStore:i,setStore:l}=wt(n),a=e.ref({}),u=y=>{Us(y).then(m=>{a.value=m,l("locale",y),l("translations",m),o.emit("vf-toast-push",{label:"The language is set to "+y})}).catch(m=>{o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),u("en")})};i("locale")?a.value=i("translations"):u(t);const p=(y,...m)=>m.length?p(y=y.replace("%s",m.shift()),...m):y;function c(y,...m){return a.value.hasOwnProperty(y)?p(a.value[y],...m):p(y,...m)}return{t:c,changeLocale:u}}const Ks={class:"vuefinder"},Ws=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Xs=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},usePropDarkMode:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},postData:{type:Object,default:{}}},setup(n){const t=n,o=Cn(),{setStore:i,getStore:l}=wt(t.id),a=e.ref(l("adapter"));e.provide("emitter",o),e.provide("storage",wt(t.id)),e.provide("postData",t.postData),e.provide("adapter",a),e.provide("maxFileSize",t.maxFileSize),e.provide("usePropDarkMode",t.usePropDarkMode);const u=Ys(t.id,t.locale,o);e.provide("i18n",u);const{apiUrl:p,setApiUrl:c}=ue();c(t.url);const y=e.reactive({adapter:a.value,storages:[],dirname:".",files:[]}),m=e.ref(l("viewport","grid")),b=t.usePropDarkMode?e.computed(()=>t.dark):e.ref(l("darkMode",t.dark));o.on("vf-darkMode-toggle",()=>{b.value=!b.value,i("darkMode",b.value)});const S=e.ref(!1);e.provide("loadingState",S);const E=e.ref(l("full-screen",!1));o.on("vf-fullscreen-toggle",()=>{E.value=!E.value,i("full-screen",E.value)}),o.on("vf-view-toggle",L=>{m.value=L});const _=e.reactive({active:!1,type:"delete",data:{}});o.on("vf-modal-close",()=>{_.active=!1}),o.on("vf-modal-show",L=>{_.active=!0,_.type=L.type,_.data=L});const N=L=>{Object.assign(y,L),o.emit("vf-nodes-selected",{}),o.emit("vf-explorer-update")};let D;return o.on("vf-fetch-abort",()=>{D.abort(),S.value=!1}),o.on("vf-fetch",({params:L,onSuccess:$=null,onError:T=null})=>{["index","search"].includes(L.q)&&(D&&D.abort(),S.value=!0),D=new AbortController;const I=D.signal;ot(p.value,{params:L,signal:I}).then(R=>{a.value=R.adapter,["index","search"].includes(L.q)&&(S.value=!1),o.emit("vf-modal-close"),N(R),$(R)}).catch(R=>{T&&T(R)}).finally(()=>{})}),o.on("vf-download",L=>{document.getElementById("download_frame").src=L,o.emit("vf-modal-close")}),e.onMounted(()=>{o.emit("vf-fetch",{params:{q:"index",adapter:a.value}})}),(L,$)=>(e.openBlock(),e.createElementBlock("div",Ks,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b)?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([E.value?"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.value?"":"max-height: "+n.maxHeight),onMousedown:$[0]||($[0]=T=>e.unref(o).emit("vf-contextmenu-hide")),onTouchstart:$[1]||($[1]=T=>e.unref(o).emit("vf-contextmenu-hide"))},[e.createVNode(so,{data:y},null,8,["data"]),e.createVNode(Ps,{data:y},null,8,["data"]),e.createVNode(rs,{view:m.value,data:y},null,8,["view","data"]),e.createVNode(ys,{data:y},null,8,["data"])],38),_.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+_.type),{key:0,selection:_.data,current:y},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Hs,{current:y},null,8,["current"]),Ws],2)]))}}),Zs=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),qs={class:"fixed z-10 inset-0 overflow-hidden"},Gs={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"},Js={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qs={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"},me={__name:"ModalLayout",setup(n){const t=e.inject("emitter");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:i[1]||(i[1]=e.withKeys(l=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Zs,e.createElementVNode("div",qs,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:i[0]||(i[0]=e.withModifiers(l=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Gs,[e.createElementVNode("div",Js,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Qs,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},ea=["aria-label"],ta=[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)],pe=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(n,{emit:t}){var p;const{t:o}=e.inject("i18n"),i=e.ref(!1),l=e.ref(null),a=e.ref((p=l.value)==null?void 0:p.strMessage);e.watch(a,()=>i.value=!1);const u=()=>{t("hidden"),i.value=!0};return(c,y)=>(e.openBlock(),e.createElementBlock("div",null,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:l,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",n.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(c.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:u,"aria-label":e.unref(o)("Close"),"data-microtip-position":"top-left",role:"tooltip"},ta,8,ea)],2))]))}}),ra={class:"sm:flex sm:items-start"},na=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),oa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ia={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},sa={class:"mt-2"},aa={class:"text-sm text-gray-500"},la={class:"flex text-sm text-gray-800 dark:text-gray-400"},ca={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"},da=[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)],ha={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"},ua=[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)],fa={class:"ml-1.5"},ma={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},pa=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(t.selection.items),u=e.ref(""),p=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"delete",adapter:i.value,path:t.current.dirname,items:JSON.stringify(a.value.map(({path:c,type:y})=>({path:c,type:y})))},onSuccess:()=>{o.emit("vf-toast-push",{label:l("Files deleted.")})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:y[1]||(y[1]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1),e.createElementVNode("div",ma,e.toDisplayString(e.unref(l)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ra,[na,e.createElementVNode("div",oa,[e.createElementVNode("h3",ia,e.toDisplayString(e.unref(l)("Delete files")),1),e.createElementVNode("div",sa,[e.createElementVNode("p",aa,e.toDisplayString(e.unref(l)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("p",la,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",ca,da)):(e.openBlock(),e.createElementBlock("svg",ha,ua)),e.createElementVNode("span",fa,e.toDisplayString(m.basename),1)]))),256)),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[0]||(y[0]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ga={class:"sm:flex sm:items-start"},ya=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),ba={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},va={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Sa={class:"mt-2"},wa={class:"text-sm text-gray-500"},_a=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(n){const t=e.inject("emitter"),{t:o}=e.inject("i18n");return(i,l)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l[0]||(l[0]=a=>e.unref(t).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var a,u;return[e.createElementVNode("div",ga,[ya,e.createElementVNode("div",ba,[e.createElementVNode("h3",va,e.toDisplayString(((a=n.selection)==null?void 0:a.title)??"Title"),1),e.createElementVNode("div",Sa,[e.createElementVNode("p",wa,e.toDisplayString(((u=n.selection)==null?void 0:u.message)??"Message")+".",1)])])])]}),_:1}))}}),ka={class:"sm:flex sm:items-start"},xa=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),Da={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ea={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Na={class:"mt-2"},Ca={class:"text-sm text-gray-500"},Va=["onKeyup","placeholder"],Ma=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfolder",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ka,[xa,e.createElementVNode("div",Da,[e.createElementVNode("h3",Ea,e.toDisplayString(e.unref(l)("New Folder")),1),e.createElementVNode("div",Na,[e.createElementVNode("p",Ca,e.toDisplayString(e.unref(l)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["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(l)("Folder Name"),type:"text"},null,40,Va),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ta={class:"sm:flex sm:items-start"},Ba=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),$a={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Aa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ia={class:"mt-2"},La={class:"text-sm text-gray-500"},Oa=["onKeyup","placeholder"],ja=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfile",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ta,[Ba,e.createElementVNode("div",$a,[e.createElementVNode("h3",Aa,e.toDisplayString(e.unref(l)("New File")),1),e.createElementVNode("div",Ia,[e.createElementVNode("p",La,e.toDisplayString(e.unref(l)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["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(l)("File Name"),type:"text"},null,40,Oa),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Pa={class:"flex"},za=["aria-label"],Ra={class:"ml-auto mb-2"},Ha={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"},Fa={key:1},Ua={__name:"Text",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,i=e.ref(""),l=e.ref(""),a=e.ref(null),u=e.ref(!1),{apiUrl:p}=ue(),c=e.ref(""),y=e.ref(!1),{t:m}=e.inject("i18n");e.onMounted(()=>{ot(p.value,{params:{q:"preview",adapter:o.selection.adapter,path:o.selection.item.path},json:!1}).then(_=>{i.value=_,t("load")})});const b=()=>{u.value=!u.value,l.value=i.value,u.value==!0&&e.nextTick(()=>{a.value.focus()})},S=e.inject("postData"),E=()=>{c.value="",y.value=!1,ot(p.value,{method:"POST",params:Object.assign(S,{q:"save",adapter:o.selection.adapter,path:o.selection.item.path,content:l.value}),json:!1}).then(_=>{c.value=m("Updated."),i.value=_,t("load"),u.value=!u.value}).catch(_=>{c.value=m(_.message),y.value=!0})};return(_,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pa,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,za),e.createElementVNode("div",Ra,[u.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:E,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(m)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:N[0]||(N[0]=D=>b())},e.toDisplayString(u.value?e.unref(m)("Cancel"):e.unref(m)("Edit")),1)])]),e.createElementVNode("div",null,[u.value?(e.openBlock(),e.createElementBlock("div",Fa,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:a,"onUpdate:modelValue":N[1]||(N[1]=D=>l.value=D),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,l.value]])])):(e.openBlock(),e.createElementBlock("pre",Ha,e.toDisplayString(i.value),1)),c.value.length?(e.openBlock(),e.createBlock(pe,{key:2,onHidden:N[2]||(N[2]=D=>c.value=""),error:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},qh="";/*! +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,v=!1,w;return{s:function(){r=r.call(d)},n:function(){var x=r.next();return f=x.done,x},e:function(x){v=!0,w=x},f:function(){try{!f&&r.return!=null&&r.return()}finally{if(v)throw w}}}}function C(d,h){if(typeof d!="object"||d===null)return d;var r=d[Symbol.toPrimitive];if(r!==void 0){var g=r.call(d,h||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}function B(d){var h=C(d,"string");return typeof h=="symbol"?h:String(h)}var V=function(h,r,g){var s=h.x,f=h.y,v=g.x,w=g.y,x={"+":{x:s+v,y:f+w},"-":{x:s-v,y:f-w},"*":{x:s*v,y:f*w},"/":{x:s/v,y:f/w}};return x[r]},Y=function(h){return{x:h.left,y:h.top}},O=function(h){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:h.x,top:h.y,right:h.x,bottom:h.y,width:r,height:r}},ce=function(h){return{x:h,y:h}},ae=function(d,h){var r=h;window.addEventListener("resize",r),window.addEventListener("scroll",r);var g=new MutationObserver(r);d.forEach(function(f,v){g.observe(f,{childList:v!==0,attributes:!0})});var s=function(){return jd(g,r)};return{observer:g,callback:r,cleanup:s}},pt=function(d){var h=bt(d);return h.x||h.y?!0:d instanceof Document?d.body?!!(d.body.scrollTop=1):!!(d.documentElement.scrollTop=1):!!(d.scrollTop=1)},gt=function(){var d=document.createElement("div");return d.style.position="fixed",d.style.overflow="hidden",d.style.pointerEvents="none",d.style.zIndex="999999999999999999",d},Qt=function(d){var h=document.createElement("div");return h.style.position="absolute",d||(h.style.background="rgba(0, 175, 255, 0.2)",h.style.border="1px solid rgba(0, 175, 255, 0.8)",h.style.display="none",h.style.pointerEvents="none"),h},yt=function(d,h){var r;return function(){for(var g=arguments.length,s=new Array(g),f=0;f1&&arguments[1]!==void 0?arguments[1]:0,v=(s=g[f])===null||s===void 0?void 0:s.parentNode;return v?(g.push(v),f++,r(g,f)):g};return h([d])},Nd=function(d,h){if(d instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var r=d.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(d.clientWidth||r.width)*h,height:(d.clientHeight||r.height)*h}},Sn=function(d,h){var r={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return Ne(d).forEach(function(g){var s=h.getRect(g);r.top=Math.min(r.top,s.top),r.left=Math.min(r.left,s.left),r.bottom=Math.max(r.bottom,s.bottom),r.right=Math.max(r.right,s.right)}),r.height=r.bottom-r.top,r.width=r.right-r.left,r},bt=function(d){return!d||d instanceof Document?er():{x:d.scrollLeft>=0?d.scrollLeft:er().x,y:d.scrollTop>=0?d.scrollTop:er().y}},wn=function(d){var h=d.elementRect,r=d.containerRect,g=d.tolerance,s=g===void 0?{x:0,y:0}:g,f=[];return h.top-s.yr.bottom&&f.push("bottom"),h.right+s.y>r.right&&f.push("right"),f},Cd=function(d){var h=d.event;return{x:h.clientX,y:h.clientY}},Vd=function(d){var h=d.scrollAmount,r=d.initialPointerPos,g=d.pointerPos,s={};return g.x>r.x-h.x?(s.left=r.x-h.x,s.width=g.x-r.x+h.x):(s.left=g.x,s.width=r.x-g.x-h.x),g.y>r.y-h.y?(s.top=r.y-h.y,s.height=g.y-r.y+h.y):(s.top=g.y,s.height=r.y-g.y-h.y),s},_n=function(h){var r={x:0,y:0},g=window.getComputedStyle(h);if(!g.transform||g.transform==="none")return r;if(g.transform.indexOf("3d")>=0){var s=g.transform.trim().match(/matrix3d\((.*?)\)/);if(s&&s.length){var f,v=(f=s[1])===null||f===void 0?void 0:f.split(",");r.x=parseInt(v[12])||0,r.y=parseInt(v[13])||0}return r}var w=g.transform.trim().match(/matrix\((.*?)\)/);if(w&&w.length){var x,A=(x=w[1])===null||x===void 0?void 0:x.split(",");r.x=parseInt(A[4])||0,r.y=parseInt(A[5])||0}return r},Md=function(h){var r=h.style.transform;if(!r||r.indexOf("translate")<0)return _n(h);var g={x:0,y:0},s=r.trim().match(/translate[3dD]*?\(.*?\)/);if(s){var f,v=(f=s[0])===null||f===void 0?void 0:f.split("(");if(v){var w,x=(w=v[1])===null||w===void 0?void 0:w.split(",");g.x=parseInt(x[0])||0,g.y=parseInt(x[1])||0}}return!g.x&&!g.x?_n(h):g},Td=function(h){var r=h.style,g={x:parseInt(r.left)||0,y:parseInt(r.top)||0};if(!g.x&&!g.x){var s=window.getComputedStyle(h);return{x:parseInt(s.left)||0,y:parseInt(s.top)||0}}return g},Bd=function(d,h){return h?Md(d):Td(d)},$d=function(d){var h=d.element,r=d.edges,g=d.elementRect,s=d.containerRect,f=d.elementPos,v=d.useTransform;r.includes("top")&&et(h,{y:f.y+s.top-g.top,x:f.x},v),r.includes("left")&&et(h,{y:f.y,x:f.x+s.left-g.left},v),r.includes("bottom")&&et(h,{y:f.y+s.bottom-g.bottom,x:f.x},v),r.includes("right")&&et(h,{y:f.y,x:f.x+s.right-g.right},v)},kn=function(d){var h=d.computedStyle,r=d.node,g=h.position,s=g==="absolute"||g==="relative"||g==="fixed";!(r instanceof Document)&&!s&&(r.style.position="relative")},Ad=function(d){var h=d.shiftKey,r=d.keyboardDragSpeed,g=d.zoom,s=d.key,f=d.dragKeys,v=d.scrollDiff,w=d.canScroll,x=d.scrollCallback,A={x:0,y:0},z=h?r*4*g:r*g;return f.left.includes(s)&&(A.x=v.x||-z,!h&&!v.x&&w&&x(["left"],r)),f.right.includes(s)&&(A.x=v.x||z,!h&&!v.x&&w&&x(["right"],r)),f.up.includes(s)&&(A.y=v.y||-z,!h&&!v.y&&w&&x(["top"],r)),f.down.includes(s)&&(A.y=v.y||z,!h&&!v.y&&w&&x(["bottom"],r)),A},Id=function(d){var h=d.element,r=d.force,g=d.multiSelectionToggle,s=d.SelectedSet,f=d.hoverClassName;h.classList.contains(f)&&!r||(s.has(h)?g&&s.delete(h):s.add(h),h.classList.add(f))},Ld=function(d){var h=d.element,r=d.force,g=d.SelectedSet,s=d.PrevSelectedSet,f=d.hoverClassName;if(!h.classList.contains(f)&&!r)return!1;var v=g.has(h),w=s.has(h);v&&!w?g.delete(h):!v&&w&&g.add(h),h.classList.remove(f)},Qe=function(h,r,g){return console.warn('[DragSelect] TypeIssue: setting "'.concat(h,'" is not of type "').concat(r,'".'))},P=function(h,r,g,s){if(r===void 0)return g?c({},h,s):{};if(r===null)return c({},h,null);var f=!0,v=!1,w=typeof s=="string";w&&(f=typeof r=="string"||r instanceof String),w&&!f&&(v=!0,Qe(h,"string"));var x=!Number.isNaN(s)&&typeof s=="number";x&&(f=!Number.isNaN(r)&&typeof r=="number"),x&&!f&&(v=!0,Qe(h,"number"));var A=Object.prototype.toString.call(s)==="[object Object]";A&&(f=Object.prototype.toString.call(r)==="[object Object]"),A&&!f&&(v=!0,Qe(h,"object"));var z=typeof s=="boolean";z&&(f=typeof r=="boolean"),z&&!f&&(v=!0,Qe(h,"boolean"));var G=Array.isArray(s);G&&(f=Array.isArray(r)),G&&!f&&(v=!0,Qe(h,"array"));var de=v||g;return h==="dragKeys"&&f?c({},h,Object.assign(s,r)):h==="dragKeys"&&!f?de?c({},h,s):{}:(h==="dropZones"&&f&&new Set(r.map(function(he){return he.id})).size!==r.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),f?c({},h,r):de?c({},h,s):{})},Od=function(d,h){return l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l({},P("area",d.area,h,document)),P("selectables",d.selectables,h,null)),P("autoScrollSpeed",d.autoScrollSpeed,h,5)),P("overflowTolerance",d.overflowTolerance,h,{x:25,y:25})),P("zoom",d.zoom,h,1)),P("customStyles",d.customStyles,h,!1)),P("multiSelectMode",d.multiSelectMode,h,!1)),P("multiSelectToggling",d.multiSelectToggling,h,!0)),P("multiSelectKeys",d.multiSelectKeys,h,["Control","Shift","Meta"])),P("selector",d.selector,h,null)),P("selectionThreshold",d.selectionThreshold,h,0)),P("draggability",d.draggability,h,!0)),P("immediateDrag",d.immediateDrag,h,!0)),P("keyboardDrag",d.keyboardDrag,h,!0)),P("dragKeys",d.dragKeys,h,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),P("keyboardDragSpeed",d.keyboardDragSpeed,h,10)),P("useTransform",d.useTransform,h,!0)),P("refreshMemoryRate",d.refreshMemoryRate,h,80)),P("dropZones",d.dropZones,h,[])),P("dropInsideThreshold",d.dropInsideThreshold,h,1)),P("dropTargetThreshold",d.dropTargetThreshold,h,0)),P("usePointerEvents",d.usePointerEvents,h,!1)),P("hoverClass",d.hoverClass,h,"ds-hover")),P("selectableClass",d.selectableClass,h,"ds-selectable")),P("selectedClass",d.selectedClass,h,"ds-selected")),P("selectorClass",d.selectorClass,h,"ds-selector")),P("selectorAreaClass",d.selectorAreaClass,h,"ds-selector-area")),P("droppedTargetClass",d.droppedTargetClass,h,"ds-dropped-target")),P("droppedInsideClass",d.droppedInsideClass,h,"ds-dropped-inside")),P("droppableClass",d.droppableClass,h,"ds-droppable")),P("dropZoneClass",d.dropZoneClass,h,"ds-dropzone")),P("dropZoneReadyClass",d.dropZoneReadyClass,h,"ds-dropzone-ready")),P("dropZoneTargetClass",d.dropZoneTargetClass,h,"ds-dropzone-target")),P("dropZoneInsideClass",d.dropZoneInsideClass,h,"ds-dropzone-inside")),P("dragAsBlock",d.dragAsBlock,h,!1))},Re=function(d,h){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=d;if(r>0){var s=(d.right-d.left)*r,f=(d.bottom-d.top)*r;g={left:d.left+s,right:d.right-s,top:d.top+f,bottom:d.bottom-f}}return g.lefth.left&&g.toph.top},xn=function(d){var h=d.element,r=d.posDirection,g=d.containerRect,s=d.useTransform,f=Bd(h,s),v=V(f,"+",r);et(h,v,s);var w=h.getBoundingClientRect(),x=wn({elementRect:w,containerRect:g});$d({element:h,edges:x,elementRect:w,containerRect:g,elementPos:v,useTransform:s})},jd=function(d,h){window.removeEventListener("resize",h),window.removeEventListener("scroll",h),d.disconnect()},Pd=function(d,h,r){if(h.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=d instanceof Document?g||document.body:d,f=h.includes("top")&&s.scrollTop>0,v=h.includes("bottom")&&s.scrollTop0,x=h.includes("right")&&s.scrollLeft0&&(s.y=Math.min(s.y,w.bottom)),s.x>0&&(s.x=Math.min(s.x,w.right)),r._selectionRect.top+=s.y,r._selectionRect.bottom+=s.y,r._selectionRect.left+=s.x,r._selectionRect.right+=s.x),s}),c(this,"handleZIndex",function(s){r._elements.forEach(function(f){return f.style.zIndex="".concat((parseInt(f.style.zIndex)||0)+s?9999:-9998)})}),this.DS=g,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return p(d,[{key:"_cursorDiff",get:function(){var r=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?V(r,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=r,g}},{key:"_scrollDiff",get:function(){var r=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?V(r,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=r,g}}]),d}(),Fd=function(){function d(h){var r=this,g=h.DS,s=h.id,f=h.element,v=h.droppables;a(this,d),c(this,"id",void 0),c(this,"element",void 0),c(this,"_droppables",void 0),c(this,"_rect",void 0),c(this,"_observers",void 0),c(this,"_timeout",void 0),c(this,"_itemsDropped",[]),c(this,"_itemsInside",void 0),c(this,"setReadyClasses",function(w){if(!r.isDestroyed){var x=r.droppables.filter(function(A){return r.DS.SelectedSet.has(A)});x.length&&(x.forEach(function(A){A.classList[w]("".concat(r.Settings.droppableClass)),A.classList[w]("".concat(r.Settings.droppableClass,"-").concat(r.id))}),r.element.classList[w]("".concat(r.Settings.dropZoneReadyClass)))}}),c(this,"handleNoDrop",function(){var w;r.isDestroyed||(r.DS.SelectedSet.forEach(function(x){x.classList.remove(r.Settings.droppedTargetClass),x.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),r._itemsDropped=r._itemsDropped.filter(function(x){return!r.DS.SelectedSet.has(x)}),(w=r._itemsDropped)!==null&&w!==void 0&&w.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleDrop",function(){var w,x,A;r.isDestroyed||(r._itemsDropped=k(new Set([].concat(k(r._itemsDropped),k((w=r.droppables)===null||w===void 0?void 0:w.filter(function(z){return r.DS.SelectedSet.has(z)}))))),(x=r._itemsDropped)===null||x===void 0||x.forEach(function(z){z.classList.add("".concat(r.Settings.droppedTargetClass)),z.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),(A=r._itemsDropped)!==null&&A!==void 0&&A.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleItemsInsideClasses",function(){var w=!1;r.droppables.forEach(function(x){r.itemsInside.includes(x)?(x.classList.add("".concat(r.Settings.droppedInsideClass)),x.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),w=!0):(x.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),x.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||x.classList.remove("".concat(r.Settings.droppedInsideClass)))}),w?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))}),c(this,"start",function(w){var x=w.isDragging;!x||r.isDestroyed||r.setReadyClasses("add")}),c(this,"stop",function(w){var x=w.isDragging;!x||r.isDestroyed||(r.setReadyClasses("remove"),r.handleItemsInsideClasses())}),c(this,"toObject",function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.id=s,this.element=f,v&&(this.droppables=Ne(v)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",function(w){var x=w.settings;r.element&&(r.element.classList.remove(x["dropZoneClass:pre"]),r.element.classList.add(x.dropZoneClass))}),this._observers=ae(this.parentNodes,yt(function(){return r._rect=null},this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return p(d,[{key:"destroy",value:function(){var r=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach(function(g){g.classList.remove("".concat(r.Settings.droppedTargetClass)),g.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id)),g.classList.remove("".concat(r.Settings.droppableClass)),g.classList.remove("".concat(r.Settings.droppableClass,"-").concat(r.id))}),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var r=this;return this.isDestroyed?null:this._itemsInside?this._itemsInside:(this._itemsInside=this.droppables.flatMap(function(g){return Re(r.DS.SelectableSet.rects.get(g),r.rect,r.Settings.dropInsideThreshold)?[g]:[]}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return r._itemsInside=null},this.Settings.refreshMemoryRate),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=vn(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(r){this._droppables=r}}]),d}(),Ud=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"_zoneByElement",new Map),c(this,"_zoneById",new Map),c(this,"_zonesByDroppable",new Map),c(this,"_zones",void 0),c(this,"setDropZones",function(s){var f=s.dropZones;f&&(r._zones&&r._zones.forEach(function(v){return v.destroy()}),r._zones=f.map(function(v){return new Fd(l({DS:r.DS},v))}),r._zones.forEach(function(v){r._zoneByElement.set(v.element,v),r._zoneById.set(v.id,v),v.droppables.forEach(function(w){var x=r._zonesByDroppable.get(w);if(!(x!=null&&x.length))return r._zonesByDroppable.set(w,[v]);r._zonesByDroppable.set(w,k(new Set([].concat(k(x),[v]))))})}))}),c(this,"_handleDrop",function(s){r._zones.forEach(function(f){f!==s&&f.handleNoDrop()}),s&&s.handleDrop()}),c(this,"_getZoneByElementsFromPoint",function(s,f){for(var v=f.x,w=f.y,x=0,A=s.length;x0)){var v=r.DS,w=v.stores,x=w.PointerStore,A=w.KeyStore,z=v.SelectableSet,G=v.SelectedSet;x.start(f);var de=f.target;z.has(de)&&(A.isMultiSelectKeyPressed(f)||G.clear(),G.toggle(de),r.reset())}}),c(this,"stop",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(s.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(s.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),s.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)}),c(this,"update",function(s){var f=s.event,v=s.scroll_directions,w=s.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:f,scroll_directions:v,scroll_multiplier:w,isDragging:r.isDragging})}),c(this,"reset",function(s){return r.DS.publish("Interaction:end:pre",{event:s,isDragging:r.isDragging})}),c(this,"_reset",function(s){var f=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:s,isDragging:f})}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",function(s){var f=s.settings;r.stop(f["area:pre"]),r.init()}),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:start:pre",function(s){var f=s.event;return r._start(f)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(s){var f=s.event;return r._reset(f)}),this.DS.subscribe("Area:scroll",this.update)}return p(d,[{key:"_canInteract",value:function(r){var g=r.clientX===0&&r.clientY===0&&r.detail===0&&r.target;return!(r.button===2||this.isInteracting||r.target&&!this.DS.SelectorArea.isInside(r.target)||!g&&!this.DS.SelectorArea.isClicked(r))}}]),d}(),Kd=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"subscribers",{}),c(this,"subscribe",function(s,f){return Array.isArray(r.subscribers[s])||(r.subscribers[s]=[]),r.subscribers[s].push(f),r.subscribers[s].length-1}),c(this,"unsubscribe",function(s,f,v){v>=0?r.subscribers[s].splice(v,1):f&&(r.subscribers[s]=r.subscribers[s].filter(function(w){return w!==f}))}),c(this,"publish",function(s,f){Array.isArray(s)?s.forEach(function(v){return r._publish(v,f)}):r._publish(s,f)}),c(this,"_publish",function(s,f){var v=r.subscribers[s];Array.isArray(v)&&(s.includes(":pre")?r._handlePrePublish(v,f):r._handlePublish(v,f))}),c(this,"_handlePublish",function(s,f){for(var v=0,w=s.length;v0&&arguments[0]!==void 0?arguments[0]:"append",f=document.body?"body":"documentElement",v="".concat(s,"Child");r.HTMLNode[v](r.DS.Selector.HTMLNode),document[f][v](r.HTMLNode)}),c(this,"updatePos",function(){r._rect=null;var s=r.DS.Area.rect,f=r.DS.Area.computedBorder,v=r.HTMLNode.style,w="".concat(s.top+f.top,"px"),x="".concat(s.left+f.left,"px"),A="".concat(s.width,"px"),z="".concat(s.height,"px");v.top!==w&&(v.top=w),v.left!==x&&(v.left=x),v.width!==A&&(v.width=A),v.height!==z&&(v.height=z)}),c(this,"stop",function(s){r.stopAutoScroll(),s&&r.applyElements("remove")}),c(this,"startAutoScroll",function(){r.currentEdges=[],r._scrollInterval=setInterval(function(){return r.handleAutoScroll()},16)}),c(this,"handleAutoScroll",function(){if(!r.DS.continue){var s=r.DS,f=s.stores.PointerStore,v=s.Area;r.currentEdges=wn({elementRect:O(f.currentVal),containerRect:r.rect,tolerance:r.DS.stores.SettingsStore.s.overflowTolerance}),r.currentEdges.length&&v.scroll(r.currentEdges,r.DS.stores.SettingsStore.s.autoScrollSpeed)}}),c(this,"stopAutoScroll",function(){r.currentEdges=[],clearInterval(r._scrollInterval)}),c(this,"isInside",function(s,f){return r.DS.Area.HTMLNode.contains(s)&&r.DS.stores.ScrollStore.canScroll?!0:Re(r.rect,f||s.getBoundingClientRect())}),this.DS=g,this.HTMLNode=gt(),this.DS.subscribe("Settings:updated:selectorAreaClass",function(s){var f=s.settings;r.HTMLNode.classList.remove(f["selectorAreaClass:pre"]),r.HTMLNode.classList.add(f.selectorAreaClass)}),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){r.updatePos(),r.stopAutoScroll()})}return p(d,[{key:"isClicked",value:function(r){var g=this.DS.stores.PointerStore,s=r?g.getPointerPosition(r):g.initialVal;return Re({left:s.x,top:s.y,right:s.x,bottom:s.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),d}(),Jd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_currentValues",new Set),c(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),c(this,"init",function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)}),c(this,"keydown",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:s,key:f}),r._currentValues.add(f),r.DS.publish("KeyStore:down",{event:s,key:f})}),c(this,"keyup",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:s,key:f}),r._currentValues.delete(f),r.DS.publish("KeyStore:up",{event:s,key:f})}),c(this,"stop",function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()}),c(this,"reset",function(){return r._currentValues.clear()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init)}return p(d,[{key:"isMultiSelectKeyPressed",value:function(r){var g=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var s=this.DS.stores.SettingsStore.s.multiSelectKeys.map(function(f){return f.toLocaleLowerCase()});return!!(this.currentValues.some(function(f){return s.includes(f.toLocaleLowerCase())})||r&&s.some(function(f){return r[g._keyMapping[f]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),d}(),Qd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_isMouseInteraction",!1),c(this,"_initialValArea",void 0),c(this,"_currentValArea",void 0),c(this,"_lastValArea",void 0),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_lastVal",void 0),c(this,"_lastTouch",void 0),c(this,"init",function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})}),c(this,"getPointerPosition",function(s){return Cd({event:r._normalizedEvent(s)})}),c(this,"update",function(s){s&&(r.DS.publish("PointerStore:updated:pre",{event:s}),r.currentVal=r.getPointerPosition(s),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:s}))}),c(this,"stop",function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout(function(){return r._isMouseInteraction=!1},100)}),c(this,"reset",function(s){s&&(r.currentVal=r.lastVal=r.getPointerPosition(s),r.stop(),r.init())}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:end",function(s){var f=s.event;return r.reset(f)})}return p(d,[{key:"start",value:function(r){r&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(r))}},{key:"_normalizedEvent",value:function(r){return"touches"in r&&r.type!=="touchend"&&(this._lastTouch=r),"touches"in r?this._lastTouch.touches[0]:r}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(r){this._initialVal=r,this._initialValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(r){this._currentVal=r,this._currentValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(r){this._lastVal=r,this._lastValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}}]),d}(),eh=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_canScroll",void 0),c(this,"init",function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"start",function(){r._currentVal=r._initialVal=bt(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"update",function(){return r._currentVal=bt(r.DS.stores.SettingsStore.s.area)}),c(this,"stop",function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null}),c(this,"reset",function(){r.stop(),r.start()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return r.start()}),this.DS.subscribe("Interaction:end",function(){return r.reset()})}return p(d,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=pt(this.DS.stores.SettingsStore.s.area)}},{key:"scrollAmount",get:function(){var r=V(this.currentVal,"-",this.initialVal),g=ce(this.DS.stores.SettingsStore.s.zoom),s=V(V(r,"*",g),"-",r);return{x:r.x+s.x,y:r.y+s.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=bt(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),d}(),th=p(function d(h){var r=this,g=h.DS,s=h.settings;a(this,d),c(this,"_settings",{}),c(this,"s",{}),c(this,"update",function(f){var v=f.settings,w=f.init;return r.DS.publish("Settings:updated:pre",l({settings:v},w?{init:w}:{}))}),c(this,"_update",function(f){for(var v=f.settings,w=f.init,x=Od(v,w),A=function(){var he,be=R(G[z],2),Z=be[0],oe=be[1];Z in r._settings||Object.defineProperty(r.s,Z,{get:function(){return r._settings[Z]},set:function(rt){return r.update({settings:c({},Z,rt)})}}),r._settings["".concat(Z,":pre")]=r._settings[Z],r._settings[Z]=oe;var tt={settings:(he={},c(he,Z,r._settings[Z]),c(he,"".concat(Z,":pre"),r._settings["".concat(Z,":pre")]),he)};r.DS.publish("Settings:updated",tt),r.DS.publish("Settings:updated:".concat(Z),tt)},z=0,G=Object.entries(x);z0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(r),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),r&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ne(r)),s||this.addSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ne(r)),s&&this.removeSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(r){var g=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ne(r).forEach(function(v){return g.SelectedSet.has(v)?g.removeSelection(r,s,f):g.addSelection(r,s,f)}),s&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(r,g,s),this.getSelection()}},{key:"clearSelection",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),r&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(r,g,s){var f=Ne(r);return this.SelectableSet.addAll(f),g&&this.SelectedSet.addAll(f),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}},{key:"setSelectables",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(r,g),this.addSelectables(r,s)}},{key:"removeSelectables",value:function(r,g,s){return this.SelectableSet.deleteAll(Ne(r)),g&&this.removeSelection(r),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}}]),d}();return En.isCollision=Re,En})})(or);var co=or.exports;const ho=lo(co),ir=(n,t,o,i,l)=>(t=Math,o=t.log,i=1024,l=o(n)/o(i)|0,n/t.pow(i,l)).toFixed(0)+" "+(l?"KMGTPEZY"[--l]+"iB":"B"),sr=(n,t=null)=>new Date(n*1e3).toLocaleString(t??navigator.language??"en-US"),uo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},fo=[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)],mo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},po=[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)],it=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(n){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[n.direction=="down"?(e.openBlock(),e.createElementBlock("svg",uo,fo)):e.createCommentVNode("",!0),n.direction=="up"?(e.openBlock(),e.createElementBlock("svg",mo,po)):e.createCommentVNode("",!0)]))}}),go=["onClick"],yo=Object.assign({name:"VFToast.vue"},{setup(n){const t=e.inject("emitter"),{getStore:o}=e.inject("storage"),i=e.ref(o("full-screen",!1)),l=c=>c=="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",a=e.ref([]),u=c=>{a.value.splice(c,1)},p=c=>{let y=a.value.findIndex(m=>m.id===c);y!==-1&&u(y)};return t.on("vf-toast-clear",()=>{a.value=[]}),t.on("vf-toast-push",c=>{let y=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");c.id=y,a.value.push(c),setTimeout(()=>{p(y)},5e3)}),(c,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([i.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(a.value,(m,b)=>(e.openBlock(),e.createElementBlock("div",{onClick:S=>u(b),key:m,class:e.normalizeClass([l(m.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(m.label),11,go))),128))]),_:1})],2))}}),Ce=n=>Object.entries(n).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:bo}=ue(),_t=(n,t)=>bo.value+"?"+Ce({q:"preview",adapter:n,path:t}),we=typeof window<"u",ar=we&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),lr=we&&"IntersectionObserver"in window,cr=we&&"classList"in document.createElement("p"),dr=we&&window.devicePixelRatio>1,vo={elements_selector:".lazy",container:ar||we?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},hr=n=>Object.assign({},vo,n),ur=function(n,t){let o;const i="LazyLoad::Initialized",l=new n(t);try{o=new CustomEvent(i,{detail:{instance:l}})}catch{o=document.createEvent("CustomEvent"),o.initCustomEvent(i,!1,!1,{instance:l})}window.dispatchEvent(o)},So=(n,t)=>{if(t)if(!t.length)ur(n,t);else for(let o=0,i;i=t[o];o+=1)ur(n,i)},Se="src",kt="srcset",xt="sizes",fr="poster",He="llOriginalAttrs",mr="data",Dt="loading",pr="loaded",gr="applied",wo="entered",Et="error",yr="native",br="data-",vr="ll-status",J=(n,t)=>n.getAttribute(br+t),_o=(n,t,o)=>{var i=br+t;if(o===null){n.removeAttribute(i);return}n.setAttribute(i,o)},Fe=n=>J(n,vr),Ve=(n,t)=>_o(n,vr,t),st=n=>Ve(n,null),Nt=n=>Fe(n)===null,ko=n=>Fe(n)===Dt,xo=n=>Fe(n)===Et,Ct=n=>Fe(n)===yr,Do=[Dt,pr,gr,Et],Eo=n=>Do.indexOf(Fe(n))>=0,_e=(n,t,o,i)=>{if(n){if(i!==void 0){n(t,o,i);return}if(o!==void 0){n(t,o);return}n(t)}},Ae=(n,t)=>{if(cr){n.classList.add(t);return}n.className+=(n.className?" ":"")+t},fe=(n,t)=>{if(cr){n.classList.remove(t);return}n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},No=n=>{n.llTempImage=document.createElement("IMG")},Co=n=>{delete n.llTempImage},Sr=n=>n.llTempImage,at=(n,t)=>{if(!t)return;const o=t._observer;o&&o.unobserve(n)},Vo=n=>{n.disconnect()},Mo=(n,t,o)=>{t.unobserve_entered&&at(n,o)},Vt=(n,t)=>{n&&(n.loadingCount+=t)},To=n=>{n&&(n.toLoadCount-=1)},wr=(n,t)=>{n&&(n.toLoadCount=t)},Bo=n=>n.loadingCount>0,$o=n=>n.toLoadCount>0,_r=n=>{let t=[];for(let o=0,i;i=n.children[o];o+=1)i.tagName==="SOURCE"&&t.push(i);return t},Mt=(n,t)=>{const o=n.parentNode;if(!o||o.tagName!=="PICTURE")return;_r(o).forEach(t)},kr=(n,t)=>{_r(n).forEach(t)},lt=[Se],xr=[Se,fr],Ue=[Se,kt,xt],Dr=[mr],ct=n=>!!n[He],Er=n=>n[He],Nr=n=>delete n[He],Ie=(n,t)=>{if(ct(n))return;const o={};t.forEach(i=>{o[i]=n.getAttribute(i)}),n[He]=o},Ao=n=>{ct(n)||(n[He]={backgroundImage:n.style.backgroundImage})},Io=(n,t,o)=>{if(!o){n.removeAttribute(t);return}n.setAttribute(t,o)},Me=(n,t)=>{if(!ct(n))return;const o=Er(n);t.forEach(i=>{Io(n,i,o[i])})},Lo=n=>{if(!ct(n))return;const t=Er(n);n.style.backgroundImage=t.backgroundImage},Cr=(n,t,o)=>{Ae(n,t.class_applied),Ve(n,gr),o&&(t.unobserve_completed&&at(n,t),_e(t.callback_applied,n,o))},Vr=(n,t,o)=>{Ae(n,t.class_loading),Ve(n,Dt),o&&(Vt(o,1),_e(t.callback_loading,n,o))},ke=(n,t,o)=>{o&&n.setAttribute(t,o)},Mr=(n,t)=>{ke(n,xt,J(n,t.data_sizes)),ke(n,kt,J(n,t.data_srcset)),ke(n,Se,J(n,t.data_src))},Oo=(n,t)=>{Mt(n,o=>{Ie(o,Ue),Mr(o,t)}),Ie(n,Ue),Mr(n,t)},jo=(n,t)=>{Ie(n,lt),ke(n,Se,J(n,t.data_src))},Po=(n,t)=>{kr(n,o=>{Ie(o,lt),ke(o,Se,J(o,t.data_src))}),Ie(n,xr),ke(n,fr,J(n,t.data_poster)),ke(n,Se,J(n,t.data_src)),n.load()},zo=(n,t)=>{Ie(n,Dr),ke(n,mr,J(n,t.data_src))},Ro=(n,t,o)=>{const i=J(n,t.data_bg),l=J(n,t.data_bg_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=`url("${a}")`,Sr(n).setAttribute(Se,a),Vr(n,t,o))},Ho=(n,t,o)=>{const i=J(n,t.data_bg_multi),l=J(n,t.data_bg_multi_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=a,Cr(n,t,o))},Fo=(n,t,o)=>{const i=J(n,t.data_bg_set);if(!i)return;const l=i.split("|");let a=l.map(u=>`image-set(${u})`);n.style.backgroundImage=a.join(),n.style.backgroundImage===""&&(a=l.map(u=>`-webkit-image-set(${u})`),n.style.backgroundImage=a.join()),Cr(n,t,o)},Tr={IMG:Oo,IFRAME:jo,VIDEO:Po,OBJECT:zo},Uo=(n,t)=>{const o=Tr[n.tagName];o&&o(n,t)},Yo=(n,t,o)=>{const i=Tr[n.tagName];i&&(i(n,t),Vr(n,t,o))},Ko=["IMG","IFRAME","VIDEO","OBJECT"],Wo=n=>Ko.indexOf(n.tagName)>-1,Br=(n,t)=>{t&&!Bo(t)&&!$o(t)&&_e(n.callback_finish,t)},$r=(n,t,o)=>{n.addEventListener(t,o),n.llEvLisnrs[t]=o},Xo=(n,t,o)=>{n.removeEventListener(t,o)},Tt=n=>!!n.llEvLisnrs,Zo=(n,t,o)=>{Tt(n)||(n.llEvLisnrs={});const i=n.tagName==="VIDEO"?"loadeddata":"load";$r(n,i,t),$r(n,"error",o)},Bt=n=>{if(!Tt(n))return;const t=n.llEvLisnrs;for(let o in t){const i=t[o];Xo(n,o,i)}delete n.llEvLisnrs},Ar=(n,t,o)=>{Co(n),Vt(o,-1),To(o),fe(n,t.class_loading),t.unobserve_completed&&at(n,o)},qo=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_loaded),Ve(t,pr),_e(o.callback_loaded,t,i),l||Br(o,i)},Go=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_error),Ve(t,Et),_e(o.callback_error,t,i),o.restore_on_error&&Me(t,Ue),l||Br(o,i)},$t=(n,t,o)=>{const i=Sr(n)||n;if(Tt(i))return;Zo(i,u=>{qo(u,n,t,o),Bt(i)},u=>{Go(u,n,t,o),Bt(i)})},Jo=(n,t,o)=>{No(n),$t(n,t,o),Ao(n),Ro(n,t,o),Ho(n,t,o),Fo(n,t,o)},Qo=(n,t,o)=>{$t(n,t,o),Yo(n,t,o)},At=(n,t,o)=>{Wo(n)?Qo(n,t,o):Jo(n,t,o)},ei=(n,t,o)=>{n.setAttribute("loading","lazy"),$t(n,t,o),Uo(n,t),Ve(n,yr)},Ir=n=>{n.removeAttribute(Se),n.removeAttribute(kt),n.removeAttribute(xt)},ti=n=>{Mt(n,t=>{Ir(t)}),Ir(n)},Lr=n=>{Mt(n,t=>{Me(t,Ue)}),Me(n,Ue)},ri={IMG:Lr,IFRAME:n=>{Me(n,lt)},VIDEO:n=>{kr(n,t=>{Me(t,lt)}),Me(n,xr),n.load()},OBJECT:n=>{Me(n,Dr)}},ni=n=>{const t=ri[n.tagName];if(!t){Lo(n);return}t(n)},oi=(n,t)=>{Nt(n)||Ct(n)||(fe(n,t.class_entered),fe(n,t.class_exited),fe(n,t.class_applied),fe(n,t.class_loading),fe(n,t.class_loaded),fe(n,t.class_error))},ii=(n,t)=>{ni(n),oi(n,t),st(n),Nr(n)},si=(n,t,o,i)=>{o.cancel_on_exit&&ko(n)&&n.tagName==="IMG"&&(Bt(n),ti(n),Lr(n),fe(n,o.class_loading),Vt(i,-1),st(n),_e(o.callback_cancel,n,t,i))},ai=(n,t,o,i)=>{const l=Eo(n);Ve(n,wo),Ae(n,o.class_entered),fe(n,o.class_exited),Mo(n,o,i),_e(o.callback_enter,n,t,i),!l&&At(n,o,i)},li=(n,t,o,i)=>{Nt(n)||(Ae(n,o.class_exited),si(n,t,o,i),_e(o.callback_exit,n,t,i))},ci=["IMG","IFRAME","VIDEO"],Or=n=>n.use_native&&"loading"in HTMLImageElement.prototype,di=(n,t,o)=>{n.forEach(i=>{ci.indexOf(i.tagName)!==-1&&ei(i,t,o)}),wr(o,0)},hi=n=>n.isIntersecting||n.intersectionRatio>0,ui=n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}),fi=(n,t,o)=>{n.forEach(i=>hi(i)?ai(i.target,i,t,o):li(i.target,i,t,o))},mi=(n,t)=>{t.forEach(o=>{n.observe(o)})},pi=(n,t)=>{Vo(n),mi(n,t)},gi=(n,t)=>{!lr||Or(n)||(t._observer=new IntersectionObserver(o=>{fi(o,n,t)},ui(n)))},jr=n=>Array.prototype.slice.call(n),dt=n=>n.container.querySelectorAll(n.elements_selector),yi=n=>jr(n).filter(Nt),bi=n=>xo(n),vi=n=>jr(n).filter(bi),Pr=(n,t)=>yi(n||dt(t)),Si=(n,t)=>{vi(dt(n)).forEach(i=>{fe(i,n.class_error),st(i)}),t.update()},wi=(n,t)=>{we&&(t._onlineHandler=()=>{Si(n,t)},window.addEventListener("online",t._onlineHandler))},_i=n=>{we&&window.removeEventListener("online",n._onlineHandler)},Ye=function(n,t){const o=hr(n);this._settings=o,this.loadingCount=0,gi(o,this),wi(o,this),this.update(t)};Ye.prototype={update:function(n){const t=this._settings,o=Pr(n,t);if(wr(this,o.length),ar||!lr){this.loadAll(o);return}if(Or(t)){di(o,t,this);return}pi(this._observer,o)},destroy:function(){this._observer&&this._observer.disconnect(),_i(this),dt(this._settings).forEach(n=>{Nr(n)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(n){const t=this._settings;Pr(n,t).forEach(i=>{at(i,this),At(i,t,this)})},restoreAll:function(){const n=this._settings;dt(n).forEach(t=>{ii(t,n)})}},Ye.load=(n,t)=>{const o=hr(t);At(n,o)},Ye.resetStatus=n=>{st(n)},we&&So(Ye,window.lazyLoadOptions);const ki={class:"relative flex-auto flex flex-col overflow-hidden"},xi={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Di={class:"absolute"},Ei=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),Ni={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"},Ci=["onDblclick","onContextmenu","data-type","data-item","data-index"],Vi={class:"grid grid-cols-12 items-center"},Mi={class:"flex col-span-7 items-center"},Ti={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"},Bi=[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)],$i={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"},Ai=[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)],Ii={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Li={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Oi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],ji={class:"grid grid-cols-12 items-center"},Pi={class:"flex col-span-7 items-center"},zi={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"},Ri=[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)],Hi={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"},Fi=[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)],Ui={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Yi={class:"col-span-2 text-center"},Ki={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Wi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Xi={class:"relative"},Zi={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"},qi=[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)],Gi=["data-src","alt"],Ji={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"},Qi=[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)],es={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},ts={class:"break-all"},rs=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(n){const t=n,o=e.inject("emitter"),{setStore:i,getStore:l}=e.inject("storage"),a=e.inject("adapter"),u=C=>C==null?void 0:C.substring(0,3),p=C=>C.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),c=e.ref(null),y=e.ref(null),m=e.ref(0),b=e.ref(null),{t:S}=e.inject("i18n"),E=Math.floor(Math.random()*2**32),_=e.ref(l("full-screen",!1)),N=new Ye;o.on("vf-fullscreen-toggle",()=>{c.value.style.height=null,_.value=!_.value,i("full-screen",_.value)});const D=e.ref("");o.on("vf-search-query",({newQuery:C})=>{D.value=C,C?o.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:C},onSuccess:B=>{B.files.length||o.emit("vf-toast-push",{label:S("No search result found.")})}}):o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let L=null;const $=()=>{L&&clearTimeout(L)},T=e.ref(!0),I=C=>{C.touches.length>1&&(T.value?(b.value.stop(),o.emit("vf-toast-push",{label:S("Drag&Drop: off")})):(b.value.start(),o.emit("vf-toast-push",{label:S("Drag&Drop: on")}),o.emit("vf-explorer-update")),T.value=!T.value)},R=C=>{L=setTimeout(()=>{const B=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:C.target.getBoundingClientRect().x,clientY:C.target.getBoundingClientRect().y});C.target.dispatchEvent(B)},500)},k=C=>{C.type=="dir"?(o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:C.path}})):o.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:C})},M=e.reactive({active:!1,column:"",order:""}),H=(C=!0)=>{let B=[...t.data.files],V=M.column,Y=M.order=="asc"?1:-1;if(!C)return B;const O=(ce,ae)=>typeof ce=="string"&&typeof ae=="string"?ce.toLowerCase().localeCompare(ae.toLowerCase()):ceae?1:0;return M.active&&(B=B.slice().sort((ce,ae)=>O(ce[V],ae[V])*Y)),B},X=C=>{M.active&&M.column==C?(M.active=M.order=="asc",M.column=C,M.order="desc"):(M.active=!0,M.column=C,M.order="asc")},W=()=>b.value.getSelection().map(C=>JSON.parse(C.dataset.item)),te=(C,B)=>{if(C.altKey||C.ctrlKey||C.metaKey)return C.preventDefault(),!1;C.dataTransfer.setDragImage(y.value,0,15),C.dataTransfer.effectAllowed="all",C.dataTransfer.dropEffect="copy",C.dataTransfer.setData("items",JSON.stringify(W()))},se=(C,B)=>{C.preventDefault();let V=JSON.parse(C.dataTransfer.getData("items"));if(V.find(Y=>Y.storage!=a.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:V,to:B}})},ne=(C,B)=>{C.preventDefault(),!B||B.type!=="dir"||b.value.getSelection().find(V=>V==C.currentTarget)?(C.dataTransfer.dropEffect="none",C.dataTransfer.effectAllowed="none"):C.dataTransfer.dropEffect="copy"},re=()=>{b.value=new ho({area:c.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),o.on("vf-explorer-update",()=>e.nextTick(()=>{b.value.clearSelection(),b.value.setSelectables(document.getElementsByClassName("vf-item-"+E))})),b.value.subscribe("predragstart",({event:C,isDragging:B})=>{if(B)m.value=b.value.getSelection().length,b.value.break();else{const V=C.target.offsetWidth-C.offsetX,Y=C.target.offsetHeight-C.offsetY;V<15&&Y<15&&(b.value.clearSelection(),b.value.break())}}),b.value.subscribe("predragmove",({isDragging:C})=>{C&&b.value.break()}),b.value.subscribe("callback",({items:C,event:B,isDragging:V})=>{o.emit("vf-nodes-selected",W()),m.value=b.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{b.value.Area.reset(),b.value.SelectorArea.updatePos(),N.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>o.emit("vf-explorer-update"))}),(C,B)=>(e.openBlock(),e.createElementBlock("div",ki,[n.view=="list"||D.value.length?(e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("div",{onClick:B[0]||(B[0]=V=>X("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(S)("Name"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="basename"]])]),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:B[1]||(B[1]=V=>X("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(S)("Size"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="file_size"]])])),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:B[2]||(B[2]=V=>X("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(S)("Date"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="last_modified"]])])),D.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:B[3]||(B[3]=V=>X("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(S)("Filepath"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("div",{ref_key:"dragImage",ref:y,class:"absolute -z-50 -top-96"},[Ei,e.createElementVNode("div",Ni,e.toDisplayString(m.value),1)],512)]),e.createElementVNode("div",{onTouchstart:I,onContextmenu:B[10]||(B[10]=e.withModifiers(V=>e.unref(o).emit("vf-contextmenu-show",{event:V,area:c.value,items:W()}),["self","prevent"])),class:e.normalizeClass([_.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:c},[D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:O=>k(V),onTouchstart:B[4]||(B[4]=O=>R(O)),onTouchend:B[5]||(B[5]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Mi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ti,Bi)):(e.openBlock(),e.createElementBlock("svg",$i,Ai)),e.createElementVNode("span",Ii,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Li,e.toDisplayString(V.path),1)])],42,Ci))),256)):e.createCommentVNode("",!0),n.view=="list"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[6]||(B[6]=O=>R(O)),onTouchend:B[7]||(B[7]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",ji,[e.createElementVNode("div",Pi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",zi,Ri)):(e.openBlock(),e.createElementBlock("svg",Hi,Fi)),e.createElementVNode("span",Ui,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Yi,e.toDisplayString(V.file_size?e.unref(ir)(V.file_size):""),1),e.createElementVNode("div",Ki,e.toDisplayString(e.unref(sr)(V.last_modified)),1)])],42,Oi))),256)):e.createCommentVNode("",!0),n.view=="grid"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H(!1),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[8]||(B[8]=O=>R(O)),onTouchend:B[9]||(B[9]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",null,[e.createElementVNode("div",Xi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Zi,qi)):(V.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)(e.unref(a).value,V.path),alt:V.basename},null,8,Gi)):(e.openBlock(),e.createElementBlock("svg",Ji,Qi)),!(V.mime_type??"").startsWith("image")&&V.type!="dir"?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(u(V.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ts,e.toDisplayString(p(V.basename)),1)])],42,Wi))),256)):e.createCommentVNode("",!0)],34),e.createVNode(yo)]))}}),ns="1.2.4",os={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},is={class:"flex leading-5 items-center"},ss=["aria-label"],as=[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)],ls=["value"],cs={class:"ml-3"},ds={key:0},hs={class:"ml-1"},us={class:"flex leading-5 items-center"},fs={value:"",disabled:""},ms=e.createStaticVNode('',7),ps=["aria-label"],gs=[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)],ys=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),{getStore:o,setStore:i}=e.inject("storage"),l=e.ref(0),a=e.inject("adapter"),{t:u,changeLocale:p}=e.inject("i18n"),c=e.ref(o("locale","")),y=()=>{t.emit("vf-search-exit"),t.emit("vf-fetch",{params:{q:"index",adapter:a.value}}),i("adapter",a.value)};t.on("vf-nodes-selected",b=>{l.value=b.length});const m=e.ref("");return t.on("vf-search-query",({newQuery:b})=>{m.value=b}),(b,S)=>(e.openBlock(),e.createElementBlock("div",os,[e.createElementVNode("div",is,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(u)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},as,8,ss),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=E=>e.isRef(a)?a.value=E:null),onChange:y,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data.storages,E=>(e.openBlock(),e.createElementBlock("option",{value:E},e.toDisplayString(E),9,ls))),256))],544),[[e.vModelSelect,e.unref(a)]]),e.createElementVNode("div",cs,[m.value.length?(e.openBlock(),e.createElementBlock("span",ds,e.toDisplayString(n.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",hs,e.toDisplayString(l.value>0?l.value+" "+e.unref(u)("item(s) selected."):""),1)])]),e.createElementVNode("div",us,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=E=>c.value=E),onChange:S[2]||(S[2]=E=>e.unref(p)(E.target.value)),class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8 mr-3"},[e.createElementVNode("option",fs,e.toDisplayString(e.unref(u)("Language")),1),ms],544),[[e.vModelSelect,c.value]]),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(u)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=E=>e.unref(t).emit("vf-modal-show",{type:"message",title:"Vuefinder "+e.unref(ns),message:e.unref(u)("Vuefinder is a file manager component for vue 3.")}))},gs,8,ps)])]))}}),bs=(n,t=0,o=!1)=>{let i;return(...l)=>{o&&!i&&n(...l),clearTimeout(i),i=setTimeout(()=>{n(...l)},t)}},vs=(n,t,o)=>{const i=e.ref(n);return e.customRef((a,u)=>({get(){return a(),i.value},set:bs(p=>{i.value=p,u()},t,o)}))},Ss={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-xs"},ws=["aria-label"],_s=[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)],ks=["aria-label"],xs=[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)],Ds=["aria-label"],Es=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ns=["onClick"],Cs=[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)],Vs={class:"flex leading-5"},Ms=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),Ts=["title","onClick"],Bs={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"},$s=[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),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)],As={key:3,class:"relative flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Is=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),Ls=e.createElementVNode("div",{class:"w-full"},null,-1),Os=["onKeydown","placeholder"],js=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ps=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),l=e.ref(null),a=e.ref([]),u=e.ref(!1),p=e.ref(null),{t:c}=e.inject("i18n"),y=e.inject("loadingState");o.on("vf-explorer-update",()=>{let $=[],T=[];l.value=t.data.dirname??i.value+"://",l.value.length==0&&(a.value=[]),l.value.replace(i.value+"://","").split("/").forEach(function(I){$.push(I),$.join("/")!=""&&T.push({basename:I,name:I,path:i.value+"://"+$.join("/"),type:"dir"})}),T.length>4&&(T=T.slice(-5),T[0].name=".."),a.value=T});const m=()=>{u.value=!1,S.value=""};o.on("vf-search-exit",()=>{m()});const b=()=>{u.value=!0,e.nextTick(()=>p.value.focus())},S=vs("",400),E=()=>y.value;e.watch(S,$=>{o.emit("vf-toast-clear"),o.emit("vf-search-query",{newQuery:$})});const _=()=>a.value.length&&!u.value,N=$=>{$.preventDefault();let T=JSON.parse($.dataTransfer.getData("items"));if(T.find(I=>I.storage!=i.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:T,to:a.value[a.value.length-2]??{path:i.value+"://"}}})},D=$=>{$.preventDefault(),_()?$.dataTransfer.dropEffect="copy":($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none")},L=()=>{S.value==""&&m()};return($,T)=>(e.openBlock(),e.createElementBlock("div",Ss,[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:T[0]||(T[0]=I=>D(I)),onDrop:T[1]||(T[1]=I=>N(I)),onClick:T[2]||(T[2]=I=>{var R;return!_()||e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:((R=a.value[a.value.length-2])==null?void 0:R.path)??e.unref(i)+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",_()?"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"},_s,34))],8,ws),E()?(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:T[4]||(T[4]=I=>e.unref(o).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"},Es))],8,Ds)):(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:T[3]||(T[3]=I=>{e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:n.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"},xs))],8,ks)),u.value?(e.openBlock(),e.createElementBlock("div",As,[Is,Ls,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:p,onKeydown:e.withKeys(m,["esc"]),onBlur:L,"onUpdate:modelValue":T[6]||(T[6]=I=>e.isRef(S)?S.value=I:null),placeholder:e.unref(c)("Search anything.."),class:"absolute ml-4 pt-1 pb-0 px-2 border-0 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,Os),[[e.vModelText,e.unref(S)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:m,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},js))])):(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(b,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[5]||(T[5]=I=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.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"},Cs)),e.createElementVNode("div",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(I,R)=>(e.openBlock(),e.createElementBlock("div",{key:R},[Ms,e.createElementVNode("span",{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:I.basename,onClick:k=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:I.path}})},e.toDisplayString(I.name),9,Ts)]))),128))]),E()?(e.openBlock(),e.createElementBlock("svg",Bs,$s)):e.createCommentVNode("",!0)],8,Ns))]))}}),zs=["onClick"],Rs=e.createElementVNode("span",{class:"px-1"},null,-1),Hs=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(n){const t=n,o=e.inject("emitter"),i=e.ref(null),{apiUrl:l}=ue(),a=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),u=e.ref([]);o.on("vf-context-selected",S=>{u.value=S});const{t:p}=e.inject("i18n"),c={newfolder:{title:()=>p("New Folder"),action:()=>{o.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>p("Delete"),action:()=>{o.emit("vf-modal-show",{type:"delete",items:u})}},refresh:{title:()=>p("Refresh"),action:()=>{o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>p("Preview"),action:()=>{o.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:u.value[0]})}},open:{title:()=>p("Open"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].path}})}},openDir:{title:()=>p("Open containing folder"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].dir}})}},download:{title:()=>p("Download"),action:()=>{const S=l.value+"?"+Ce({q:"download",adapter:t.current.adapter,path:u.value[0].path});o.emit("vf-download",S)}},archive:{title:()=>p("Archive"),action:()=>{o.emit("vf-modal-show",{type:"archive",items:u})}},unarchive:{title:()=>p("Unarchive"),action:()=>{o.emit("vf-modal-show",{type:"unarchive",items:u})}},rename:{title:()=>p("Rename"),action:()=>{o.emit("vf-modal-show",{type:"rename",items:u})}}},y=S=>{o.emit("vf-contextmenu-hide"),S.action()},m=e.ref("");o.on("vf-search-query",({newQuery:S})=>{m.value=S}),o.on("vf-contextmenu-show",({event:S,area:E,items:_,target:N=null})=>{if(a.items=[],m.value)if(N)a.items.push(c.openDir),o.emit("vf-context-selected",[N]);else return;else!N&&!m.value?(a.items.push(c.refresh),a.items.push(c.newfolder),o.emit("vf-context-selected",[])):_.length>1&&_.some(D=>D.path===N.path)?(a.items.push(c.refresh),a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",_)):(N.type=="dir"?a.items.push(c.open):(a.items.push(c.preview),a.items.push(c.download)),a.items.push(c.rename),N.mime_type=="application/zip"?a.items.push(c.unarchive):a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",[N]));b(S,E)}),o.on("vf-contextmenu-hide",()=>{a.active=!1});const b=(S,E)=>{a.active=!0,e.nextTick(()=>{let _=E.getBoundingClientRect(),N=S.pageX,D=S.pageY,L=i.value.offsetHeight,$=i.value.offsetWidth;N=_.right-S.pageX+window.scrollX<$?N-$:N,D=_.bottom-S.pageY+window.scrollYa.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:i,style:e.normalizeStyle(a.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,_=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:_.title,onClick:N=>y(_)},[Rs,e.createElementVNode("span",null,e.toDisplayString(_.title()),1)],8,zs))),128))],4)):e.createCommentVNode("",!0)}}),Fs=(n,t)=>{const o=n[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((i,l)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(l.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function Us(n){const t=await Fs(Object.assign({"../locales/de.json":()=>Promise.resolve().then(()=>wd),"../locales/en.json":()=>Promise.resolve().then(()=>_d),"../locales/fa.json":()=>Promise.resolve().then(()=>kd),"../locales/he.json":()=>Promise.resolve().then(()=>xd),"../locales/ru.json":()=>Promise.resolve().then(()=>Dd),"../locales/tr.json":()=>Promise.resolve().then(()=>Ed)}),`../locales/${n}.json`);return JSON.parse(t.default)}function Ys(n,t,o){const{getStore:i,setStore:l}=wt(n),a=e.ref({}),u=y=>{Us(y).then(m=>{a.value=m,l("locale",y),l("translations",m),o.emit("vf-toast-push",{label:"The language is set to "+y})}).catch(m=>{o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),u("en")})};i("locale")?a.value=i("translations"):u(t);const p=(y,...m)=>m.length?p(y=y.replace("%s",m.shift()),...m):y;function c(y,...m){return a.value.hasOwnProperty(y)?p(a.value[y],...m):p(y,...m)}return{t:c,changeLocale:u}}const Ks={class:"vuefinder"},Ws=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Xs=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},usePropDarkMode:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},postData:{type:Object,default:{}}},setup(n){const t=n,o=Cn(),{setStore:i,getStore:l}=wt(t.id),a=e.ref(l("adapter"));e.provide("emitter",o),e.provide("storage",wt(t.id)),e.provide("postData",t.postData),e.provide("adapter",a),e.provide("maxFileSize",t.maxFileSize),e.provide("usePropDarkMode",t.usePropDarkMode);const u=Ys(t.id,t.locale,o);e.provide("i18n",u);const{apiUrl:p,setApiUrl:c}=ue();c(t.url);const y=e.reactive({adapter:a.value,storages:[],dirname:".",files:[]}),m=e.ref(l("viewport","grid")),b=t.usePropDarkMode?e.computed(()=>t.dark):e.ref(l("darkMode",t.dark));o.on("vf-darkMode-toggle",()=>{b.value=!b.value,i("darkMode",b.value)});const S=e.ref(!1);e.provide("loadingState",S);const E=e.ref(l("full-screen",!1));o.on("vf-fullscreen-toggle",()=>{E.value=!E.value,i("full-screen",E.value)}),o.on("vf-view-toggle",L=>{m.value=L});const _=e.reactive({active:!1,type:"delete",data:{}});o.on("vf-modal-close",()=>{_.active=!1}),o.on("vf-modal-show",L=>{_.active=!0,_.type=L.type,_.data=L});const N=L=>{Object.assign(y,L),o.emit("vf-nodes-selected",{}),o.emit("vf-explorer-update")};let D;return o.on("vf-fetch-abort",()=>{D.abort(),S.value=!1}),o.on("vf-fetch",({params:L,onSuccess:$=null,onError:T=null})=>{["index","search"].includes(L.q)&&(D&&D.abort(),S.value=!0),D=new AbortController;const I=D.signal;ot(p.value,{params:L,signal:I}).then(R=>{a.value=R.adapter,["index","search"].includes(L.q)&&(S.value=!1),o.emit("vf-modal-close"),N(R),$(R)}).catch(R=>{T&&T(R)}).finally(()=>{})}),o.on("vf-download",L=>{document.getElementById("download_frame").src=L,o.emit("vf-modal-close")}),e.onMounted(()=>{o.emit("vf-fetch",{params:{q:"index",adapter:a.value}})}),(L,$)=>(e.openBlock(),e.createElementBlock("div",Ks,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b)?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([E.value?"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.value?"":"max-height: "+n.maxHeight),onMousedown:$[0]||($[0]=T=>e.unref(o).emit("vf-contextmenu-hide")),onTouchstart:$[1]||($[1]=T=>e.unref(o).emit("vf-contextmenu-hide"))},[e.createVNode(so,{data:y},null,8,["data"]),e.createVNode(Ps,{data:y},null,8,["data"]),e.createVNode(rs,{view:m.value,data:y},null,8,["view","data"]),e.createVNode(ys,{data:y},null,8,["data"])],38),_.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+_.type),{key:0,selection:_.data,current:y},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Hs,{current:y},null,8,["current"]),Ws],2)]))}}),Zs=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),qs={class:"fixed z-10 inset-0 overflow-hidden"},Gs={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"},Js={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qs={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"},me={__name:"ModalLayout",setup(n){const t=e.inject("emitter");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:i[1]||(i[1]=e.withKeys(l=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Zs,e.createElementVNode("div",qs,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:i[0]||(i[0]=e.withModifiers(l=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Gs,[e.createElementVNode("div",Js,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Qs,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},ea=["aria-label"],ta=[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)],pe=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(n,{emit:t}){var p;const{t:o}=e.inject("i18n"),i=e.ref(!1),l=e.ref(null),a=e.ref((p=l.value)==null?void 0:p.strMessage);e.watch(a,()=>i.value=!1);const u=()=>{t("hidden"),i.value=!0};return(c,y)=>(e.openBlock(),e.createElementBlock("div",null,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:l,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",n.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(c.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:u,"aria-label":e.unref(o)("Close"),"data-microtip-position":"top-left",role:"tooltip"},ta,8,ea)],2))]))}}),ra={class:"sm:flex sm:items-start"},na=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),oa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ia={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},sa={class:"mt-2"},aa={class:"text-sm text-gray-500"},la={class:"flex text-sm text-gray-800 dark:text-gray-400"},ca={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"},da=[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)],ha={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"},ua=[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)],fa={class:"ml-1.5"},ma={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},pa=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(t.selection.items),u=e.ref(""),p=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"delete",adapter:i.value,path:t.current.dirname,items:JSON.stringify(a.value.map(({path:c,type:y})=>({path:c,type:y})))},onSuccess:()=>{o.emit("vf-toast-push",{label:l("Files deleted.")})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:y[1]||(y[1]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1),e.createElementVNode("div",ma,e.toDisplayString(e.unref(l)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ra,[na,e.createElementVNode("div",oa,[e.createElementVNode("h3",ia,e.toDisplayString(e.unref(l)("Delete files")),1),e.createElementVNode("div",sa,[e.createElementVNode("p",aa,e.toDisplayString(e.unref(l)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("p",la,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",ca,da)):(e.openBlock(),e.createElementBlock("svg",ha,ua)),e.createElementVNode("span",fa,e.toDisplayString(m.basename),1)]))),256)),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[0]||(y[0]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ga={class:"sm:flex sm:items-start"},ya=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),ba={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},va={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Sa={class:"mt-2"},wa={class:"text-sm text-gray-500"},_a=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(n){const t=e.inject("emitter"),{t:o}=e.inject("i18n");return(i,l)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l[0]||(l[0]=a=>e.unref(t).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var a,u;return[e.createElementVNode("div",ga,[ya,e.createElementVNode("div",ba,[e.createElementVNode("h3",va,e.toDisplayString(((a=n.selection)==null?void 0:a.title)??"Title"),1),e.createElementVNode("div",Sa,[e.createElementVNode("p",wa,e.toDisplayString(((u=n.selection)==null?void 0:u.message)??"Message")+".",1)])])])]}),_:1}))}}),ka={class:"sm:flex sm:items-start"},xa=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),Da={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ea={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Na={class:"mt-2"},Ca={class:"text-sm text-gray-500"},Va=["onKeyup","placeholder"],Ma=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfolder",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ka,[xa,e.createElementVNode("div",Da,[e.createElementVNode("h3",Ea,e.toDisplayString(e.unref(l)("New Folder")),1),e.createElementVNode("div",Na,[e.createElementVNode("p",Ca,e.toDisplayString(e.unref(l)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["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(l)("Folder Name"),type:"text"},null,40,Va),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ta={class:"sm:flex sm:items-start"},Ba=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),$a={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Aa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ia={class:"mt-2"},La={class:"text-sm text-gray-500"},Oa=["onKeyup","placeholder"],ja=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfile",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ta,[Ba,e.createElementVNode("div",$a,[e.createElementVNode("h3",Aa,e.toDisplayString(e.unref(l)("New File")),1),e.createElementVNode("div",Ia,[e.createElementVNode("p",La,e.toDisplayString(e.unref(l)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["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(l)("File Name"),type:"text"},null,40,Oa),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Pa={class:"flex"},za=["aria-label"],Ra={class:"ml-auto mb-2"},Ha={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"},Fa={key:1},Ua={__name:"Text",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,i=e.ref(""),l=e.ref(""),a=e.ref(null),u=e.ref(!1),{apiUrl:p}=ue(),c=e.ref(""),y=e.ref(!1),{t:m}=e.inject("i18n");e.onMounted(()=>{ot(p.value,{params:{q:"preview",adapter:o.selection.adapter,path:o.selection.item.path},json:!1}).then(_=>{i.value=_,t("load")})});const b=()=>{u.value=!u.value,l.value=i.value,u.value==!0&&e.nextTick(()=>{a.value.focus()})},S=e.inject("postData"),E=()=>{c.value="",y.value=!1,ot(p.value,{method:"POST",params:Object.assign(S,{q:"save",adapter:o.selection.adapter,path:o.selection.item.path,content:l.value}),json:!1}).then(_=>{c.value=m("Updated."),i.value=_,t("load"),u.value=!u.value}).catch(_=>{c.value=m(_.message),y.value=!0})};return(_,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pa,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,za),e.createElementVNode("div",Ra,[u.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:E,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(m)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:N[0]||(N[0]=D=>b())},e.toDisplayString(u.value?e.unref(m)("Cancel"):e.unref(m)("Edit")),1)])]),e.createElementVNode("div",null,[u.value?(e.openBlock(),e.createElementBlock("div",Fa,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:a,"onUpdate:modelValue":N[1]||(N[1]=D=>l.value=D),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,l.value]])])):(e.openBlock(),e.createElementBlock("pre",Ha,e.toDisplayString(i.value),1)),c.value.length?(e.openBlock(),e.createBlock(pe,{key:2,onHidden:N[2]||(N[2]=D=>c.value=""),error:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},qh="";/*! * Cropper.js v1.5.13 * https://fengyuanchen.github.io/cropperjs * From 290da1a273225575070085577a0c346315d1325b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C3=96zdemir?= Date: Thu, 27 Jul 2023 19:56:56 +0300 Subject: [PATCH 02/22] update --- dist/vuefinder.js | 2 +- dist/vuefinder.umd.cjs | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/vuefinder.js b/dist/vuefinder.js index 2c74a885..72d1cd2b 100644 --- a/dist/vuefinder.js +++ b/dist/vuefinder.js @@ -3139,7 +3139,7 @@ const Ji = { class: "relative flex-auto flex flex-col overflow-hidden" }, Qi = { Ce(Un) ])); } -}), Va = "1.2.4", Ba = { class: "p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none" }, za = { class: "flex leading-5 items-center" }, Ha = ["aria-label"], Ua = /* @__PURE__ */ f("svg", { +}), Va = "1.2.5", Ba = { class: "p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none" }, za = { class: "flex leading-5 items-center" }, Ha = ["aria-label"], Ua = /* @__PURE__ */ f("svg", { xmlns: "http://www.w3.org/2000/svg", class: "h-5 w-5", fill: "none", diff --git a/dist/vuefinder.umd.cjs b/dist/vuefinder.umd.cjs index 49b5b804..ac121109 100644 --- a/dist/vuefinder.umd.cjs +++ b/dist/vuefinder.umd.cjs @@ -1,7 +1,7 @@ (function(e,ve){typeof exports=="object"&&typeof module<"u"?module.exports=ve(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],ve):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=ve(e.Vue,e.plupload))})(this,function(e,ve){var bn;"use strict";const nt=(bn=document.querySelector('meta[name="csrf-token"]'))==null?void 0:bn.getAttribute("content"),ot=(n,{method:t="get",params:o={},json:i=!0,signal:l=null})=>{const a={method:t};if(a.signal=l,t=="get")n+="?"+new URLSearchParams(o);else{a.headers={},nt&&(a.headers["X-CSRF-Token"]=nt);let u=new FormData;for(const[p,c]of Object.entries(o))u.append(p,c);a.body=u}return fetch(n,a).then(u=>u.ok?i?u.json():u.text():u.json().then(Promise.reject.bind(Promise)))};function Cn(n){return{all:n=n||new Map,on:function(t,o){var i=n.get(t);i?i.push(o):n.set(t,[o])},off:function(t,o){var i=n.get(t);i&&(o?i.splice(i.indexOf(o)>>>0,1):n.set(t,[]))},emit:function(t,o){var i=n.get(t);i&&i.slice().map(function(l){l(o)}),(i=n.get("*"))&&i.slice().map(function(l){l(t,o)})}}}function wt(n){let t=localStorage.getItem(n+"_storage");const o=e.ref(JSON.parse(t));e.watch(o,i);function i(){o.value===null||o.value===""?localStorage.removeItem(n+"_storage"):localStorage.setItem(n+"_storage",JSON.stringify(o.value))}function l(p,c){o.value=Object.assign({...o.value},{[p]:c})}function a(){o.value=null}return{getStore:(p,c=null)=>o.value===null||o.value===""?c:o.value.hasOwnProperty(p)?o.value[p]:c,setStore:l,clearStore:a}}const nr=e.ref("");function ue(){function n(t){nr.value=t}return{apiUrl:nr,setApiUrl:n}}const Vn={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Mn={key:0,class:"flex text-center"},Tn=["aria-label"],Bn=[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)],$n=["aria-label"],An=[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)],In=["aria-label"],Ln=[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)],On=["aria-label"],jn=[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)],Pn=["aria-label"],zn=[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)],Rn=["aria-label"],Hn=[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)],Fn=["aria-label"],Un=[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)],Yn={key:1,class:"flex text-center"},Kn={class:"pl-2"},Wn={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Xn={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"},Zn=[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),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)],qn={class:"flex text-center items-center justify-end"},Gn=["aria-label"],Jn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"},null,-1)],Qn=["aria-label"],eo={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"},to={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"},ro={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"},no=["aria-label"],oo={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"},io={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"},so=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),o=e.inject("usePropDarkMode"),{getStore:i,setStore:l}=e.inject("storage"),{t:a}=e.inject("i18n"),u=e.ref(i("viewport","grid")),p=e.ref([]),c=e.ref(i("full-screen",!1)),y=e.ref("");t.on("vf-search-query",({newQuery:E})=>{y.value=E});const m=e.inject("loadingState"),b=()=>m.value,S=()=>{c.value=!c.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",E=>{p.value=E}),t.on("vf-view-toggle",E=>{l("viewport",E),u.value=E}),(E,_)=>(e.openBlock(),e.createElementBlock("div",Vn,[y.value.length?(e.openBlock(),e.createElementBlock("div",Yn,[e.createElementVNode("div",Kn,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Wn,e.toDisplayString(y.value),1)]),b()?(e.openBlock(),e.createElementBlock("svg",Xn,Zn)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Mn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:_[0]||(_[0]=N=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:p.value}))},Bn,8,Tn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[1]||(_[1]=N=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:p.value}))},An,8,$n),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[2]||(_[2]=N=>p.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},Ln,2))],8,In),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[3]||(_[3]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},jn,2))],8,On),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[4]||(_[4]=N=>e.unref(t).emit("vf-modal-show",{type:"upload",items:p.value}))},zn,8,Pn),p.value.length==1&&p.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Unarchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[5]||(_[5]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},Hn,2))],8,Rn)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[6]||(_[6]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},Un,2))],8,Fn))])),e.createElementVNode("div",qn,[e.withDirectives(e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:_[7]||(_[7]=N=>e.unref(t).emit("vf-darkMode-toggle")),viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-6 w-6 m-auto cursor-pointer stroke-sky-500 fill-sky-100 hover:stroke-sky-600 dark:stroke-gray-400 dark:fill-gray-400/20 dark:hover:stroke-gray-300"},Jn))],8,Gn),[[e.vShow,!e.unref(o)]]),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:S},[(e.openBlock(),e.createElementBlock("svg",eo,[c.value?(e.openBlock(),e.createElementBlock("path",to)):(e.openBlock(),e.createElementBlock("path",ro))]))],8,Qn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:_[8]||(_[8]=N=>y.value.length||e.unref(t).emit("vf-view-toggle",u.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([y.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"},[u.value=="grid"?(e.openBlock(),e.createElementBlock("path",oo)):e.createCommentVNode("",!0),u.value=="list"?(e.openBlock(),e.createElementBlock("path",io)):e.createCommentVNode("",!0)],2))],8,no)])]))}});var ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var or={exports:{}};(function(n,t){(function(o,i){n.exports=i()})(ao,function(){function o(d,h){var r=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(r!=null){var g,s,f,v,w=[],x=!0,A=!1;try{if(f=(r=r.call(d)).next,h===0){if(Object(r)!==r)return;x=!1}else for(;!(x=(g=f.call(r)).done)&&(w.push(g.value),w.length!==h);x=!0);}catch(z){A=!0,s=z}finally{try{if(!x&&r.return!=null&&(v=r.return(),Object(v)!==v))return}finally{if(A)throw s}}return w}}function i(d,h){var r=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);h&&(g=g.filter(function(s){return Object.getOwnPropertyDescriptor(d,s).enumerable})),r.push.apply(r,g)}return r}function l(d){for(var h=1;h"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function E(d,h,r){return S()?E=Reflect.construct.bind():E=function(s,f,v){var w=[null];w.push.apply(w,f);var x=Function.bind.apply(s,w),A=new x;return v&&b(A,v.prototype),A},E.apply(null,arguments)}function _(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function N(d){var h=typeof Map=="function"?new Map:void 0;return N=function(g){if(g===null||!_(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h<"u"){if(h.has(g))return h.get(g);h.set(g,s)}function s(){return E(g,arguments,m(this).constructor)}return s.prototype=Object.create(g.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),b(s,g)},N(d)}function D(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function L(d,h){if(h&&(typeof h=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(d)}function $(d){var h=S();return function(){var g=m(d),s;if(h){var f=m(this).constructor;s=Reflect.construct(g,arguments,f)}else s=g.apply(this,arguments);return L(this,s)}}function T(d,h){for(;!Object.prototype.hasOwnProperty.call(d,h)&&(d=m(d),d!==null););return d}function I(){return typeof Reflect<"u"&&Reflect.get?I=Reflect.get.bind():I=function(h,r,g){var s=T(h,r);if(s){var f=Object.getOwnPropertyDescriptor(s,r);return f.get?f.get.call(arguments.length<3?h:g):f.value}},I.apply(this,arguments)}function R(d,h){return H(d)||o(d,h)||W(d,h)||ne()}function k(d){return M(d)||X(d)||W(d)||se()}function M(d){if(Array.isArray(d))return te(d)}function H(d){if(Array.isArray(d))return d}function X(d){if(typeof Symbol<"u"&&d[Symbol.iterator]!=null||d["@@iterator"]!=null)return Array.from(d)}function W(d,h){if(d){if(typeof d=="string")return te(d,h);var r=Object.prototype.toString.call(d).slice(8,-1);if(r==="Object"&&d.constructor&&(r=d.constructor.name),r==="Map"||r==="Set")return Array.from(d);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(d,h)}}function te(d,h){(h==null||h>d.length)&&(h=d.length);for(var r=0,g=new Array(h);r=d.length?{done:!0}:{done:!1,value:d[g++]}},e:function(x){throw x},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,v=!1,w;return{s:function(){r=r.call(d)},n:function(){var x=r.next();return f=x.done,x},e:function(x){v=!0,w=x},f:function(){try{!f&&r.return!=null&&r.return()}finally{if(v)throw w}}}}function C(d,h){if(typeof d!="object"||d===null)return d;var r=d[Symbol.toPrimitive];if(r!==void 0){var g=r.call(d,h||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}function B(d){var h=C(d,"string");return typeof h=="symbol"?h:String(h)}var V=function(h,r,g){var s=h.x,f=h.y,v=g.x,w=g.y,x={"+":{x:s+v,y:f+w},"-":{x:s-v,y:f-w},"*":{x:s*v,y:f*w},"/":{x:s/v,y:f/w}};return x[r]},Y=function(h){return{x:h.left,y:h.top}},O=function(h){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:h.x,top:h.y,right:h.x,bottom:h.y,width:r,height:r}},ce=function(h){return{x:h,y:h}},ae=function(d,h){var r=h;window.addEventListener("resize",r),window.addEventListener("scroll",r);var g=new MutationObserver(r);d.forEach(function(f,v){g.observe(f,{childList:v!==0,attributes:!0})});var s=function(){return jd(g,r)};return{observer:g,callback:r,cleanup:s}},pt=function(d){var h=bt(d);return h.x||h.y?!0:d instanceof Document?d.body?!!(d.body.scrollTop=1):!!(d.documentElement.scrollTop=1):!!(d.scrollTop=1)},gt=function(){var d=document.createElement("div");return d.style.position="fixed",d.style.overflow="hidden",d.style.pointerEvents="none",d.style.zIndex="999999999999999999",d},Qt=function(d){var h=document.createElement("div");return h.style.position="absolute",d||(h.style.background="rgba(0, 175, 255, 0.2)",h.style.border="1px solid rgba(0, 175, 255, 0.8)",h.style.display="none",h.style.pointerEvents="none"),h},yt=function(d,h){var r;return function(){for(var g=arguments.length,s=new Array(g),f=0;f1&&arguments[1]!==void 0?arguments[1]:0,v=(s=g[f])===null||s===void 0?void 0:s.parentNode;return v?(g.push(v),f++,r(g,f)):g};return h([d])},Nd=function(d,h){if(d instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var r=d.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(d.clientWidth||r.width)*h,height:(d.clientHeight||r.height)*h}},Sn=function(d,h){var r={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return Ne(d).forEach(function(g){var s=h.getRect(g);r.top=Math.min(r.top,s.top),r.left=Math.min(r.left,s.left),r.bottom=Math.max(r.bottom,s.bottom),r.right=Math.max(r.right,s.right)}),r.height=r.bottom-r.top,r.width=r.right-r.left,r},bt=function(d){return!d||d instanceof Document?er():{x:d.scrollLeft>=0?d.scrollLeft:er().x,y:d.scrollTop>=0?d.scrollTop:er().y}},wn=function(d){var h=d.elementRect,r=d.containerRect,g=d.tolerance,s=g===void 0?{x:0,y:0}:g,f=[];return h.top-s.yr.bottom&&f.push("bottom"),h.right+s.y>r.right&&f.push("right"),f},Cd=function(d){var h=d.event;return{x:h.clientX,y:h.clientY}},Vd=function(d){var h=d.scrollAmount,r=d.initialPointerPos,g=d.pointerPos,s={};return g.x>r.x-h.x?(s.left=r.x-h.x,s.width=g.x-r.x+h.x):(s.left=g.x,s.width=r.x-g.x-h.x),g.y>r.y-h.y?(s.top=r.y-h.y,s.height=g.y-r.y+h.y):(s.top=g.y,s.height=r.y-g.y-h.y),s},_n=function(h){var r={x:0,y:0},g=window.getComputedStyle(h);if(!g.transform||g.transform==="none")return r;if(g.transform.indexOf("3d")>=0){var s=g.transform.trim().match(/matrix3d\((.*?)\)/);if(s&&s.length){var f,v=(f=s[1])===null||f===void 0?void 0:f.split(",");r.x=parseInt(v[12])||0,r.y=parseInt(v[13])||0}return r}var w=g.transform.trim().match(/matrix\((.*?)\)/);if(w&&w.length){var x,A=(x=w[1])===null||x===void 0?void 0:x.split(",");r.x=parseInt(A[4])||0,r.y=parseInt(A[5])||0}return r},Md=function(h){var r=h.style.transform;if(!r||r.indexOf("translate")<0)return _n(h);var g={x:0,y:0},s=r.trim().match(/translate[3dD]*?\(.*?\)/);if(s){var f,v=(f=s[0])===null||f===void 0?void 0:f.split("(");if(v){var w,x=(w=v[1])===null||w===void 0?void 0:w.split(",");g.x=parseInt(x[0])||0,g.y=parseInt(x[1])||0}}return!g.x&&!g.x?_n(h):g},Td=function(h){var r=h.style,g={x:parseInt(r.left)||0,y:parseInt(r.top)||0};if(!g.x&&!g.x){var s=window.getComputedStyle(h);return{x:parseInt(s.left)||0,y:parseInt(s.top)||0}}return g},Bd=function(d,h){return h?Md(d):Td(d)},$d=function(d){var h=d.element,r=d.edges,g=d.elementRect,s=d.containerRect,f=d.elementPos,v=d.useTransform;r.includes("top")&&et(h,{y:f.y+s.top-g.top,x:f.x},v),r.includes("left")&&et(h,{y:f.y,x:f.x+s.left-g.left},v),r.includes("bottom")&&et(h,{y:f.y+s.bottom-g.bottom,x:f.x},v),r.includes("right")&&et(h,{y:f.y,x:f.x+s.right-g.right},v)},kn=function(d){var h=d.computedStyle,r=d.node,g=h.position,s=g==="absolute"||g==="relative"||g==="fixed";!(r instanceof Document)&&!s&&(r.style.position="relative")},Ad=function(d){var h=d.shiftKey,r=d.keyboardDragSpeed,g=d.zoom,s=d.key,f=d.dragKeys,v=d.scrollDiff,w=d.canScroll,x=d.scrollCallback,A={x:0,y:0},z=h?r*4*g:r*g;return f.left.includes(s)&&(A.x=v.x||-z,!h&&!v.x&&w&&x(["left"],r)),f.right.includes(s)&&(A.x=v.x||z,!h&&!v.x&&w&&x(["right"],r)),f.up.includes(s)&&(A.y=v.y||-z,!h&&!v.y&&w&&x(["top"],r)),f.down.includes(s)&&(A.y=v.y||z,!h&&!v.y&&w&&x(["bottom"],r)),A},Id=function(d){var h=d.element,r=d.force,g=d.multiSelectionToggle,s=d.SelectedSet,f=d.hoverClassName;h.classList.contains(f)&&!r||(s.has(h)?g&&s.delete(h):s.add(h),h.classList.add(f))},Ld=function(d){var h=d.element,r=d.force,g=d.SelectedSet,s=d.PrevSelectedSet,f=d.hoverClassName;if(!h.classList.contains(f)&&!r)return!1;var v=g.has(h),w=s.has(h);v&&!w?g.delete(h):!v&&w&&g.add(h),h.classList.remove(f)},Qe=function(h,r,g){return console.warn('[DragSelect] TypeIssue: setting "'.concat(h,'" is not of type "').concat(r,'".'))},P=function(h,r,g,s){if(r===void 0)return g?c({},h,s):{};if(r===null)return c({},h,null);var f=!0,v=!1,w=typeof s=="string";w&&(f=typeof r=="string"||r instanceof String),w&&!f&&(v=!0,Qe(h,"string"));var x=!Number.isNaN(s)&&typeof s=="number";x&&(f=!Number.isNaN(r)&&typeof r=="number"),x&&!f&&(v=!0,Qe(h,"number"));var A=Object.prototype.toString.call(s)==="[object Object]";A&&(f=Object.prototype.toString.call(r)==="[object Object]"),A&&!f&&(v=!0,Qe(h,"object"));var z=typeof s=="boolean";z&&(f=typeof r=="boolean"),z&&!f&&(v=!0,Qe(h,"boolean"));var G=Array.isArray(s);G&&(f=Array.isArray(r)),G&&!f&&(v=!0,Qe(h,"array"));var de=v||g;return h==="dragKeys"&&f?c({},h,Object.assign(s,r)):h==="dragKeys"&&!f?de?c({},h,s):{}:(h==="dropZones"&&f&&new Set(r.map(function(he){return he.id})).size!==r.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),f?c({},h,r):de?c({},h,s):{})},Od=function(d,h){return l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l({},P("area",d.area,h,document)),P("selectables",d.selectables,h,null)),P("autoScrollSpeed",d.autoScrollSpeed,h,5)),P("overflowTolerance",d.overflowTolerance,h,{x:25,y:25})),P("zoom",d.zoom,h,1)),P("customStyles",d.customStyles,h,!1)),P("multiSelectMode",d.multiSelectMode,h,!1)),P("multiSelectToggling",d.multiSelectToggling,h,!0)),P("multiSelectKeys",d.multiSelectKeys,h,["Control","Shift","Meta"])),P("selector",d.selector,h,null)),P("selectionThreshold",d.selectionThreshold,h,0)),P("draggability",d.draggability,h,!0)),P("immediateDrag",d.immediateDrag,h,!0)),P("keyboardDrag",d.keyboardDrag,h,!0)),P("dragKeys",d.dragKeys,h,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),P("keyboardDragSpeed",d.keyboardDragSpeed,h,10)),P("useTransform",d.useTransform,h,!0)),P("refreshMemoryRate",d.refreshMemoryRate,h,80)),P("dropZones",d.dropZones,h,[])),P("dropInsideThreshold",d.dropInsideThreshold,h,1)),P("dropTargetThreshold",d.dropTargetThreshold,h,0)),P("usePointerEvents",d.usePointerEvents,h,!1)),P("hoverClass",d.hoverClass,h,"ds-hover")),P("selectableClass",d.selectableClass,h,"ds-selectable")),P("selectedClass",d.selectedClass,h,"ds-selected")),P("selectorClass",d.selectorClass,h,"ds-selector")),P("selectorAreaClass",d.selectorAreaClass,h,"ds-selector-area")),P("droppedTargetClass",d.droppedTargetClass,h,"ds-dropped-target")),P("droppedInsideClass",d.droppedInsideClass,h,"ds-dropped-inside")),P("droppableClass",d.droppableClass,h,"ds-droppable")),P("dropZoneClass",d.dropZoneClass,h,"ds-dropzone")),P("dropZoneReadyClass",d.dropZoneReadyClass,h,"ds-dropzone-ready")),P("dropZoneTargetClass",d.dropZoneTargetClass,h,"ds-dropzone-target")),P("dropZoneInsideClass",d.dropZoneInsideClass,h,"ds-dropzone-inside")),P("dragAsBlock",d.dragAsBlock,h,!1))},Re=function(d,h){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=d;if(r>0){var s=(d.right-d.left)*r,f=(d.bottom-d.top)*r;g={left:d.left+s,right:d.right-s,top:d.top+f,bottom:d.bottom-f}}return g.lefth.left&&g.toph.top},xn=function(d){var h=d.element,r=d.posDirection,g=d.containerRect,s=d.useTransform,f=Bd(h,s),v=V(f,"+",r);et(h,v,s);var w=h.getBoundingClientRect(),x=wn({elementRect:w,containerRect:g});$d({element:h,edges:x,elementRect:w,containerRect:g,elementPos:v,useTransform:s})},jd=function(d,h){window.removeEventListener("resize",h),window.removeEventListener("scroll",h),d.disconnect()},Pd=function(d,h,r){if(h.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=d instanceof Document?g||document.body:d,f=h.includes("top")&&s.scrollTop>0,v=h.includes("bottom")&&s.scrollTop0,x=h.includes("right")&&s.scrollLeft0&&(s.y=Math.min(s.y,w.bottom)),s.x>0&&(s.x=Math.min(s.x,w.right)),r._selectionRect.top+=s.y,r._selectionRect.bottom+=s.y,r._selectionRect.left+=s.x,r._selectionRect.right+=s.x),s}),c(this,"handleZIndex",function(s){r._elements.forEach(function(f){return f.style.zIndex="".concat((parseInt(f.style.zIndex)||0)+s?9999:-9998)})}),this.DS=g,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return p(d,[{key:"_cursorDiff",get:function(){var r=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?V(r,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=r,g}},{key:"_scrollDiff",get:function(){var r=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?V(r,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=r,g}}]),d}(),Fd=function(){function d(h){var r=this,g=h.DS,s=h.id,f=h.element,v=h.droppables;a(this,d),c(this,"id",void 0),c(this,"element",void 0),c(this,"_droppables",void 0),c(this,"_rect",void 0),c(this,"_observers",void 0),c(this,"_timeout",void 0),c(this,"_itemsDropped",[]),c(this,"_itemsInside",void 0),c(this,"setReadyClasses",function(w){if(!r.isDestroyed){var x=r.droppables.filter(function(A){return r.DS.SelectedSet.has(A)});x.length&&(x.forEach(function(A){A.classList[w]("".concat(r.Settings.droppableClass)),A.classList[w]("".concat(r.Settings.droppableClass,"-").concat(r.id))}),r.element.classList[w]("".concat(r.Settings.dropZoneReadyClass)))}}),c(this,"handleNoDrop",function(){var w;r.isDestroyed||(r.DS.SelectedSet.forEach(function(x){x.classList.remove(r.Settings.droppedTargetClass),x.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),r._itemsDropped=r._itemsDropped.filter(function(x){return!r.DS.SelectedSet.has(x)}),(w=r._itemsDropped)!==null&&w!==void 0&&w.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleDrop",function(){var w,x,A;r.isDestroyed||(r._itemsDropped=k(new Set([].concat(k(r._itemsDropped),k((w=r.droppables)===null||w===void 0?void 0:w.filter(function(z){return r.DS.SelectedSet.has(z)}))))),(x=r._itemsDropped)===null||x===void 0||x.forEach(function(z){z.classList.add("".concat(r.Settings.droppedTargetClass)),z.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),(A=r._itemsDropped)!==null&&A!==void 0&&A.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleItemsInsideClasses",function(){var w=!1;r.droppables.forEach(function(x){r.itemsInside.includes(x)?(x.classList.add("".concat(r.Settings.droppedInsideClass)),x.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),w=!0):(x.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),x.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||x.classList.remove("".concat(r.Settings.droppedInsideClass)))}),w?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))}),c(this,"start",function(w){var x=w.isDragging;!x||r.isDestroyed||r.setReadyClasses("add")}),c(this,"stop",function(w){var x=w.isDragging;!x||r.isDestroyed||(r.setReadyClasses("remove"),r.handleItemsInsideClasses())}),c(this,"toObject",function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.id=s,this.element=f,v&&(this.droppables=Ne(v)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",function(w){var x=w.settings;r.element&&(r.element.classList.remove(x["dropZoneClass:pre"]),r.element.classList.add(x.dropZoneClass))}),this._observers=ae(this.parentNodes,yt(function(){return r._rect=null},this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return p(d,[{key:"destroy",value:function(){var r=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach(function(g){g.classList.remove("".concat(r.Settings.droppedTargetClass)),g.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id)),g.classList.remove("".concat(r.Settings.droppableClass)),g.classList.remove("".concat(r.Settings.droppableClass,"-").concat(r.id))}),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var r=this;return this.isDestroyed?null:this._itemsInside?this._itemsInside:(this._itemsInside=this.droppables.flatMap(function(g){return Re(r.DS.SelectableSet.rects.get(g),r.rect,r.Settings.dropInsideThreshold)?[g]:[]}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return r._itemsInside=null},this.Settings.refreshMemoryRate),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=vn(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(r){this._droppables=r}}]),d}(),Ud=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"_zoneByElement",new Map),c(this,"_zoneById",new Map),c(this,"_zonesByDroppable",new Map),c(this,"_zones",void 0),c(this,"setDropZones",function(s){var f=s.dropZones;f&&(r._zones&&r._zones.forEach(function(v){return v.destroy()}),r._zones=f.map(function(v){return new Fd(l({DS:r.DS},v))}),r._zones.forEach(function(v){r._zoneByElement.set(v.element,v),r._zoneById.set(v.id,v),v.droppables.forEach(function(w){var x=r._zonesByDroppable.get(w);if(!(x!=null&&x.length))return r._zonesByDroppable.set(w,[v]);r._zonesByDroppable.set(w,k(new Set([].concat(k(x),[v]))))})}))}),c(this,"_handleDrop",function(s){r._zones.forEach(function(f){f!==s&&f.handleNoDrop()}),s&&s.handleDrop()}),c(this,"_getZoneByElementsFromPoint",function(s,f){for(var v=f.x,w=f.y,x=0,A=s.length;x0)){var v=r.DS,w=v.stores,x=w.PointerStore,A=w.KeyStore,z=v.SelectableSet,G=v.SelectedSet;x.start(f);var de=f.target;z.has(de)&&(A.isMultiSelectKeyPressed(f)||G.clear(),G.toggle(de),r.reset())}}),c(this,"stop",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(s.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(s.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),s.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)}),c(this,"update",function(s){var f=s.event,v=s.scroll_directions,w=s.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:f,scroll_directions:v,scroll_multiplier:w,isDragging:r.isDragging})}),c(this,"reset",function(s){return r.DS.publish("Interaction:end:pre",{event:s,isDragging:r.isDragging})}),c(this,"_reset",function(s){var f=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:s,isDragging:f})}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",function(s){var f=s.settings;r.stop(f["area:pre"]),r.init()}),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:start:pre",function(s){var f=s.event;return r._start(f)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(s){var f=s.event;return r._reset(f)}),this.DS.subscribe("Area:scroll",this.update)}return p(d,[{key:"_canInteract",value:function(r){var g=r.clientX===0&&r.clientY===0&&r.detail===0&&r.target;return!(r.button===2||this.isInteracting||r.target&&!this.DS.SelectorArea.isInside(r.target)||!g&&!this.DS.SelectorArea.isClicked(r))}}]),d}(),Kd=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"subscribers",{}),c(this,"subscribe",function(s,f){return Array.isArray(r.subscribers[s])||(r.subscribers[s]=[]),r.subscribers[s].push(f),r.subscribers[s].length-1}),c(this,"unsubscribe",function(s,f,v){v>=0?r.subscribers[s].splice(v,1):f&&(r.subscribers[s]=r.subscribers[s].filter(function(w){return w!==f}))}),c(this,"publish",function(s,f){Array.isArray(s)?s.forEach(function(v){return r._publish(v,f)}):r._publish(s,f)}),c(this,"_publish",function(s,f){var v=r.subscribers[s];Array.isArray(v)&&(s.includes(":pre")?r._handlePrePublish(v,f):r._handlePublish(v,f))}),c(this,"_handlePublish",function(s,f){for(var v=0,w=s.length;v0&&arguments[0]!==void 0?arguments[0]:"append",f=document.body?"body":"documentElement",v="".concat(s,"Child");r.HTMLNode[v](r.DS.Selector.HTMLNode),document[f][v](r.HTMLNode)}),c(this,"updatePos",function(){r._rect=null;var s=r.DS.Area.rect,f=r.DS.Area.computedBorder,v=r.HTMLNode.style,w="".concat(s.top+f.top,"px"),x="".concat(s.left+f.left,"px"),A="".concat(s.width,"px"),z="".concat(s.height,"px");v.top!==w&&(v.top=w),v.left!==x&&(v.left=x),v.width!==A&&(v.width=A),v.height!==z&&(v.height=z)}),c(this,"stop",function(s){r.stopAutoScroll(),s&&r.applyElements("remove")}),c(this,"startAutoScroll",function(){r.currentEdges=[],r._scrollInterval=setInterval(function(){return r.handleAutoScroll()},16)}),c(this,"handleAutoScroll",function(){if(!r.DS.continue){var s=r.DS,f=s.stores.PointerStore,v=s.Area;r.currentEdges=wn({elementRect:O(f.currentVal),containerRect:r.rect,tolerance:r.DS.stores.SettingsStore.s.overflowTolerance}),r.currentEdges.length&&v.scroll(r.currentEdges,r.DS.stores.SettingsStore.s.autoScrollSpeed)}}),c(this,"stopAutoScroll",function(){r.currentEdges=[],clearInterval(r._scrollInterval)}),c(this,"isInside",function(s,f){return r.DS.Area.HTMLNode.contains(s)&&r.DS.stores.ScrollStore.canScroll?!0:Re(r.rect,f||s.getBoundingClientRect())}),this.DS=g,this.HTMLNode=gt(),this.DS.subscribe("Settings:updated:selectorAreaClass",function(s){var f=s.settings;r.HTMLNode.classList.remove(f["selectorAreaClass:pre"]),r.HTMLNode.classList.add(f.selectorAreaClass)}),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){r.updatePos(),r.stopAutoScroll()})}return p(d,[{key:"isClicked",value:function(r){var g=this.DS.stores.PointerStore,s=r?g.getPointerPosition(r):g.initialVal;return Re({left:s.x,top:s.y,right:s.x,bottom:s.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),d}(),Jd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_currentValues",new Set),c(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),c(this,"init",function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)}),c(this,"keydown",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:s,key:f}),r._currentValues.add(f),r.DS.publish("KeyStore:down",{event:s,key:f})}),c(this,"keyup",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:s,key:f}),r._currentValues.delete(f),r.DS.publish("KeyStore:up",{event:s,key:f})}),c(this,"stop",function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()}),c(this,"reset",function(){return r._currentValues.clear()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init)}return p(d,[{key:"isMultiSelectKeyPressed",value:function(r){var g=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var s=this.DS.stores.SettingsStore.s.multiSelectKeys.map(function(f){return f.toLocaleLowerCase()});return!!(this.currentValues.some(function(f){return s.includes(f.toLocaleLowerCase())})||r&&s.some(function(f){return r[g._keyMapping[f]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),d}(),Qd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_isMouseInteraction",!1),c(this,"_initialValArea",void 0),c(this,"_currentValArea",void 0),c(this,"_lastValArea",void 0),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_lastVal",void 0),c(this,"_lastTouch",void 0),c(this,"init",function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})}),c(this,"getPointerPosition",function(s){return Cd({event:r._normalizedEvent(s)})}),c(this,"update",function(s){s&&(r.DS.publish("PointerStore:updated:pre",{event:s}),r.currentVal=r.getPointerPosition(s),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:s}))}),c(this,"stop",function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout(function(){return r._isMouseInteraction=!1},100)}),c(this,"reset",function(s){s&&(r.currentVal=r.lastVal=r.getPointerPosition(s),r.stop(),r.init())}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:end",function(s){var f=s.event;return r.reset(f)})}return p(d,[{key:"start",value:function(r){r&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(r))}},{key:"_normalizedEvent",value:function(r){return"touches"in r&&r.type!=="touchend"&&(this._lastTouch=r),"touches"in r?this._lastTouch.touches[0]:r}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(r){this._initialVal=r,this._initialValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(r){this._currentVal=r,this._currentValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(r){this._lastVal=r,this._lastValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}}]),d}(),eh=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_canScroll",void 0),c(this,"init",function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"start",function(){r._currentVal=r._initialVal=bt(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"update",function(){return r._currentVal=bt(r.DS.stores.SettingsStore.s.area)}),c(this,"stop",function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null}),c(this,"reset",function(){r.stop(),r.start()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return r.start()}),this.DS.subscribe("Interaction:end",function(){return r.reset()})}return p(d,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=pt(this.DS.stores.SettingsStore.s.area)}},{key:"scrollAmount",get:function(){var r=V(this.currentVal,"-",this.initialVal),g=ce(this.DS.stores.SettingsStore.s.zoom),s=V(V(r,"*",g),"-",r);return{x:r.x+s.x,y:r.y+s.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=bt(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),d}(),th=p(function d(h){var r=this,g=h.DS,s=h.settings;a(this,d),c(this,"_settings",{}),c(this,"s",{}),c(this,"update",function(f){var v=f.settings,w=f.init;return r.DS.publish("Settings:updated:pre",l({settings:v},w?{init:w}:{}))}),c(this,"_update",function(f){for(var v=f.settings,w=f.init,x=Od(v,w),A=function(){var he,be=R(G[z],2),Z=be[0],oe=be[1];Z in r._settings||Object.defineProperty(r.s,Z,{get:function(){return r._settings[Z]},set:function(rt){return r.update({settings:c({},Z,rt)})}}),r._settings["".concat(Z,":pre")]=r._settings[Z],r._settings[Z]=oe;var tt={settings:(he={},c(he,Z,r._settings[Z]),c(he,"".concat(Z,":pre"),r._settings["".concat(Z,":pre")]),he)};r.DS.publish("Settings:updated",tt),r.DS.publish("Settings:updated:".concat(Z),tt)},z=0,G=Object.entries(x);z0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(r),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),r&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ne(r)),s||this.addSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ne(r)),s&&this.removeSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(r){var g=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ne(r).forEach(function(v){return g.SelectedSet.has(v)?g.removeSelection(r,s,f):g.addSelection(r,s,f)}),s&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(r,g,s),this.getSelection()}},{key:"clearSelection",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),r&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(r,g,s){var f=Ne(r);return this.SelectableSet.addAll(f),g&&this.SelectedSet.addAll(f),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}},{key:"setSelectables",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(r,g),this.addSelectables(r,s)}},{key:"removeSelectables",value:function(r,g,s){return this.SelectableSet.deleteAll(Ne(r)),g&&this.removeSelection(r),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}}]),d}();return En.isCollision=Re,En})})(or);var co=or.exports;const ho=lo(co),ir=(n,t,o,i,l)=>(t=Math,o=t.log,i=1024,l=o(n)/o(i)|0,n/t.pow(i,l)).toFixed(0)+" "+(l?"KMGTPEZY"[--l]+"iB":"B"),sr=(n,t=null)=>new Date(n*1e3).toLocaleString(t??navigator.language??"en-US"),uo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},fo=[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)],mo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},po=[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)],it=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(n){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[n.direction=="down"?(e.openBlock(),e.createElementBlock("svg",uo,fo)):e.createCommentVNode("",!0),n.direction=="up"?(e.openBlock(),e.createElementBlock("svg",mo,po)):e.createCommentVNode("",!0)]))}}),go=["onClick"],yo=Object.assign({name:"VFToast.vue"},{setup(n){const t=e.inject("emitter"),{getStore:o}=e.inject("storage"),i=e.ref(o("full-screen",!1)),l=c=>c=="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",a=e.ref([]),u=c=>{a.value.splice(c,1)},p=c=>{let y=a.value.findIndex(m=>m.id===c);y!==-1&&u(y)};return t.on("vf-toast-clear",()=>{a.value=[]}),t.on("vf-toast-push",c=>{let y=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");c.id=y,a.value.push(c),setTimeout(()=>{p(y)},5e3)}),(c,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([i.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(a.value,(m,b)=>(e.openBlock(),e.createElementBlock("div",{onClick:S=>u(b),key:m,class:e.normalizeClass([l(m.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(m.label),11,go))),128))]),_:1})],2))}}),Ce=n=>Object.entries(n).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:bo}=ue(),_t=(n,t)=>bo.value+"?"+Ce({q:"preview",adapter:n,path:t}),we=typeof window<"u",ar=we&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),lr=we&&"IntersectionObserver"in window,cr=we&&"classList"in document.createElement("p"),dr=we&&window.devicePixelRatio>1,vo={elements_selector:".lazy",container:ar||we?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},hr=n=>Object.assign({},vo,n),ur=function(n,t){let o;const i="LazyLoad::Initialized",l=new n(t);try{o=new CustomEvent(i,{detail:{instance:l}})}catch{o=document.createEvent("CustomEvent"),o.initCustomEvent(i,!1,!1,{instance:l})}window.dispatchEvent(o)},So=(n,t)=>{if(t)if(!t.length)ur(n,t);else for(let o=0,i;i=t[o];o+=1)ur(n,i)},Se="src",kt="srcset",xt="sizes",fr="poster",He="llOriginalAttrs",mr="data",Dt="loading",pr="loaded",gr="applied",wo="entered",Et="error",yr="native",br="data-",vr="ll-status",J=(n,t)=>n.getAttribute(br+t),_o=(n,t,o)=>{var i=br+t;if(o===null){n.removeAttribute(i);return}n.setAttribute(i,o)},Fe=n=>J(n,vr),Ve=(n,t)=>_o(n,vr,t),st=n=>Ve(n,null),Nt=n=>Fe(n)===null,ko=n=>Fe(n)===Dt,xo=n=>Fe(n)===Et,Ct=n=>Fe(n)===yr,Do=[Dt,pr,gr,Et],Eo=n=>Do.indexOf(Fe(n))>=0,_e=(n,t,o,i)=>{if(n){if(i!==void 0){n(t,o,i);return}if(o!==void 0){n(t,o);return}n(t)}},Ae=(n,t)=>{if(cr){n.classList.add(t);return}n.className+=(n.className?" ":"")+t},fe=(n,t)=>{if(cr){n.classList.remove(t);return}n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},No=n=>{n.llTempImage=document.createElement("IMG")},Co=n=>{delete n.llTempImage},Sr=n=>n.llTempImage,at=(n,t)=>{if(!t)return;const o=t._observer;o&&o.unobserve(n)},Vo=n=>{n.disconnect()},Mo=(n,t,o)=>{t.unobserve_entered&&at(n,o)},Vt=(n,t)=>{n&&(n.loadingCount+=t)},To=n=>{n&&(n.toLoadCount-=1)},wr=(n,t)=>{n&&(n.toLoadCount=t)},Bo=n=>n.loadingCount>0,$o=n=>n.toLoadCount>0,_r=n=>{let t=[];for(let o=0,i;i=n.children[o];o+=1)i.tagName==="SOURCE"&&t.push(i);return t},Mt=(n,t)=>{const o=n.parentNode;if(!o||o.tagName!=="PICTURE")return;_r(o).forEach(t)},kr=(n,t)=>{_r(n).forEach(t)},lt=[Se],xr=[Se,fr],Ue=[Se,kt,xt],Dr=[mr],ct=n=>!!n[He],Er=n=>n[He],Nr=n=>delete n[He],Ie=(n,t)=>{if(ct(n))return;const o={};t.forEach(i=>{o[i]=n.getAttribute(i)}),n[He]=o},Ao=n=>{ct(n)||(n[He]={backgroundImage:n.style.backgroundImage})},Io=(n,t,o)=>{if(!o){n.removeAttribute(t);return}n.setAttribute(t,o)},Me=(n,t)=>{if(!ct(n))return;const o=Er(n);t.forEach(i=>{Io(n,i,o[i])})},Lo=n=>{if(!ct(n))return;const t=Er(n);n.style.backgroundImage=t.backgroundImage},Cr=(n,t,o)=>{Ae(n,t.class_applied),Ve(n,gr),o&&(t.unobserve_completed&&at(n,t),_e(t.callback_applied,n,o))},Vr=(n,t,o)=>{Ae(n,t.class_loading),Ve(n,Dt),o&&(Vt(o,1),_e(t.callback_loading,n,o))},ke=(n,t,o)=>{o&&n.setAttribute(t,o)},Mr=(n,t)=>{ke(n,xt,J(n,t.data_sizes)),ke(n,kt,J(n,t.data_srcset)),ke(n,Se,J(n,t.data_src))},Oo=(n,t)=>{Mt(n,o=>{Ie(o,Ue),Mr(o,t)}),Ie(n,Ue),Mr(n,t)},jo=(n,t)=>{Ie(n,lt),ke(n,Se,J(n,t.data_src))},Po=(n,t)=>{kr(n,o=>{Ie(o,lt),ke(o,Se,J(o,t.data_src))}),Ie(n,xr),ke(n,fr,J(n,t.data_poster)),ke(n,Se,J(n,t.data_src)),n.load()},zo=(n,t)=>{Ie(n,Dr),ke(n,mr,J(n,t.data_src))},Ro=(n,t,o)=>{const i=J(n,t.data_bg),l=J(n,t.data_bg_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=`url("${a}")`,Sr(n).setAttribute(Se,a),Vr(n,t,o))},Ho=(n,t,o)=>{const i=J(n,t.data_bg_multi),l=J(n,t.data_bg_multi_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=a,Cr(n,t,o))},Fo=(n,t,o)=>{const i=J(n,t.data_bg_set);if(!i)return;const l=i.split("|");let a=l.map(u=>`image-set(${u})`);n.style.backgroundImage=a.join(),n.style.backgroundImage===""&&(a=l.map(u=>`-webkit-image-set(${u})`),n.style.backgroundImage=a.join()),Cr(n,t,o)},Tr={IMG:Oo,IFRAME:jo,VIDEO:Po,OBJECT:zo},Uo=(n,t)=>{const o=Tr[n.tagName];o&&o(n,t)},Yo=(n,t,o)=>{const i=Tr[n.tagName];i&&(i(n,t),Vr(n,t,o))},Ko=["IMG","IFRAME","VIDEO","OBJECT"],Wo=n=>Ko.indexOf(n.tagName)>-1,Br=(n,t)=>{t&&!Bo(t)&&!$o(t)&&_e(n.callback_finish,t)},$r=(n,t,o)=>{n.addEventListener(t,o),n.llEvLisnrs[t]=o},Xo=(n,t,o)=>{n.removeEventListener(t,o)},Tt=n=>!!n.llEvLisnrs,Zo=(n,t,o)=>{Tt(n)||(n.llEvLisnrs={});const i=n.tagName==="VIDEO"?"loadeddata":"load";$r(n,i,t),$r(n,"error",o)},Bt=n=>{if(!Tt(n))return;const t=n.llEvLisnrs;for(let o in t){const i=t[o];Xo(n,o,i)}delete n.llEvLisnrs},Ar=(n,t,o)=>{Co(n),Vt(o,-1),To(o),fe(n,t.class_loading),t.unobserve_completed&&at(n,o)},qo=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_loaded),Ve(t,pr),_e(o.callback_loaded,t,i),l||Br(o,i)},Go=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_error),Ve(t,Et),_e(o.callback_error,t,i),o.restore_on_error&&Me(t,Ue),l||Br(o,i)},$t=(n,t,o)=>{const i=Sr(n)||n;if(Tt(i))return;Zo(i,u=>{qo(u,n,t,o),Bt(i)},u=>{Go(u,n,t,o),Bt(i)})},Jo=(n,t,o)=>{No(n),$t(n,t,o),Ao(n),Ro(n,t,o),Ho(n,t,o),Fo(n,t,o)},Qo=(n,t,o)=>{$t(n,t,o),Yo(n,t,o)},At=(n,t,o)=>{Wo(n)?Qo(n,t,o):Jo(n,t,o)},ei=(n,t,o)=>{n.setAttribute("loading","lazy"),$t(n,t,o),Uo(n,t),Ve(n,yr)},Ir=n=>{n.removeAttribute(Se),n.removeAttribute(kt),n.removeAttribute(xt)},ti=n=>{Mt(n,t=>{Ir(t)}),Ir(n)},Lr=n=>{Mt(n,t=>{Me(t,Ue)}),Me(n,Ue)},ri={IMG:Lr,IFRAME:n=>{Me(n,lt)},VIDEO:n=>{kr(n,t=>{Me(t,lt)}),Me(n,xr),n.load()},OBJECT:n=>{Me(n,Dr)}},ni=n=>{const t=ri[n.tagName];if(!t){Lo(n);return}t(n)},oi=(n,t)=>{Nt(n)||Ct(n)||(fe(n,t.class_entered),fe(n,t.class_exited),fe(n,t.class_applied),fe(n,t.class_loading),fe(n,t.class_loaded),fe(n,t.class_error))},ii=(n,t)=>{ni(n),oi(n,t),st(n),Nr(n)},si=(n,t,o,i)=>{o.cancel_on_exit&&ko(n)&&n.tagName==="IMG"&&(Bt(n),ti(n),Lr(n),fe(n,o.class_loading),Vt(i,-1),st(n),_e(o.callback_cancel,n,t,i))},ai=(n,t,o,i)=>{const l=Eo(n);Ve(n,wo),Ae(n,o.class_entered),fe(n,o.class_exited),Mo(n,o,i),_e(o.callback_enter,n,t,i),!l&&At(n,o,i)},li=(n,t,o,i)=>{Nt(n)||(Ae(n,o.class_exited),si(n,t,o,i),_e(o.callback_exit,n,t,i))},ci=["IMG","IFRAME","VIDEO"],Or=n=>n.use_native&&"loading"in HTMLImageElement.prototype,di=(n,t,o)=>{n.forEach(i=>{ci.indexOf(i.tagName)!==-1&&ei(i,t,o)}),wr(o,0)},hi=n=>n.isIntersecting||n.intersectionRatio>0,ui=n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}),fi=(n,t,o)=>{n.forEach(i=>hi(i)?ai(i.target,i,t,o):li(i.target,i,t,o))},mi=(n,t)=>{t.forEach(o=>{n.observe(o)})},pi=(n,t)=>{Vo(n),mi(n,t)},gi=(n,t)=>{!lr||Or(n)||(t._observer=new IntersectionObserver(o=>{fi(o,n,t)},ui(n)))},jr=n=>Array.prototype.slice.call(n),dt=n=>n.container.querySelectorAll(n.elements_selector),yi=n=>jr(n).filter(Nt),bi=n=>xo(n),vi=n=>jr(n).filter(bi),Pr=(n,t)=>yi(n||dt(t)),Si=(n,t)=>{vi(dt(n)).forEach(i=>{fe(i,n.class_error),st(i)}),t.update()},wi=(n,t)=>{we&&(t._onlineHandler=()=>{Si(n,t)},window.addEventListener("online",t._onlineHandler))},_i=n=>{we&&window.removeEventListener("online",n._onlineHandler)},Ye=function(n,t){const o=hr(n);this._settings=o,this.loadingCount=0,gi(o,this),wi(o,this),this.update(t)};Ye.prototype={update:function(n){const t=this._settings,o=Pr(n,t);if(wr(this,o.length),ar||!lr){this.loadAll(o);return}if(Or(t)){di(o,t,this);return}pi(this._observer,o)},destroy:function(){this._observer&&this._observer.disconnect(),_i(this),dt(this._settings).forEach(n=>{Nr(n)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(n){const t=this._settings;Pr(n,t).forEach(i=>{at(i,this),At(i,t,this)})},restoreAll:function(){const n=this._settings;dt(n).forEach(t=>{ii(t,n)})}},Ye.load=(n,t)=>{const o=hr(t);At(n,o)},Ye.resetStatus=n=>{st(n)},we&&So(Ye,window.lazyLoadOptions);const ki={class:"relative flex-auto flex flex-col overflow-hidden"},xi={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Di={class:"absolute"},Ei=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),Ni={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"},Ci=["onDblclick","onContextmenu","data-type","data-item","data-index"],Vi={class:"grid grid-cols-12 items-center"},Mi={class:"flex col-span-7 items-center"},Ti={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"},Bi=[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)],$i={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"},Ai=[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)],Ii={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Li={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Oi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],ji={class:"grid grid-cols-12 items-center"},Pi={class:"flex col-span-7 items-center"},zi={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"},Ri=[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)],Hi={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"},Fi=[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)],Ui={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Yi={class:"col-span-2 text-center"},Ki={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Wi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Xi={class:"relative"},Zi={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"},qi=[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)],Gi=["data-src","alt"],Ji={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"},Qi=[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)],es={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},ts={class:"break-all"},rs=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(n){const t=n,o=e.inject("emitter"),{setStore:i,getStore:l}=e.inject("storage"),a=e.inject("adapter"),u=C=>C==null?void 0:C.substring(0,3),p=C=>C.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),c=e.ref(null),y=e.ref(null),m=e.ref(0),b=e.ref(null),{t:S}=e.inject("i18n"),E=Math.floor(Math.random()*2**32),_=e.ref(l("full-screen",!1)),N=new Ye;o.on("vf-fullscreen-toggle",()=>{c.value.style.height=null,_.value=!_.value,i("full-screen",_.value)});const D=e.ref("");o.on("vf-search-query",({newQuery:C})=>{D.value=C,C?o.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:C},onSuccess:B=>{B.files.length||o.emit("vf-toast-push",{label:S("No search result found.")})}}):o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let L=null;const $=()=>{L&&clearTimeout(L)},T=e.ref(!0),I=C=>{C.touches.length>1&&(T.value?(b.value.stop(),o.emit("vf-toast-push",{label:S("Drag&Drop: off")})):(b.value.start(),o.emit("vf-toast-push",{label:S("Drag&Drop: on")}),o.emit("vf-explorer-update")),T.value=!T.value)},R=C=>{L=setTimeout(()=>{const B=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:C.target.getBoundingClientRect().x,clientY:C.target.getBoundingClientRect().y});C.target.dispatchEvent(B)},500)},k=C=>{C.type=="dir"?(o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:C.path}})):o.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:C})},M=e.reactive({active:!1,column:"",order:""}),H=(C=!0)=>{let B=[...t.data.files],V=M.column,Y=M.order=="asc"?1:-1;if(!C)return B;const O=(ce,ae)=>typeof ce=="string"&&typeof ae=="string"?ce.toLowerCase().localeCompare(ae.toLowerCase()):ceae?1:0;return M.active&&(B=B.slice().sort((ce,ae)=>O(ce[V],ae[V])*Y)),B},X=C=>{M.active&&M.column==C?(M.active=M.order=="asc",M.column=C,M.order="desc"):(M.active=!0,M.column=C,M.order="asc")},W=()=>b.value.getSelection().map(C=>JSON.parse(C.dataset.item)),te=(C,B)=>{if(C.altKey||C.ctrlKey||C.metaKey)return C.preventDefault(),!1;C.dataTransfer.setDragImage(y.value,0,15),C.dataTransfer.effectAllowed="all",C.dataTransfer.dropEffect="copy",C.dataTransfer.setData("items",JSON.stringify(W()))},se=(C,B)=>{C.preventDefault();let V=JSON.parse(C.dataTransfer.getData("items"));if(V.find(Y=>Y.storage!=a.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:V,to:B}})},ne=(C,B)=>{C.preventDefault(),!B||B.type!=="dir"||b.value.getSelection().find(V=>V==C.currentTarget)?(C.dataTransfer.dropEffect="none",C.dataTransfer.effectAllowed="none"):C.dataTransfer.dropEffect="copy"},re=()=>{b.value=new ho({area:c.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),o.on("vf-explorer-update",()=>e.nextTick(()=>{b.value.clearSelection(),b.value.setSelectables(document.getElementsByClassName("vf-item-"+E))})),b.value.subscribe("predragstart",({event:C,isDragging:B})=>{if(B)m.value=b.value.getSelection().length,b.value.break();else{const V=C.target.offsetWidth-C.offsetX,Y=C.target.offsetHeight-C.offsetY;V<15&&Y<15&&(b.value.clearSelection(),b.value.break())}}),b.value.subscribe("predragmove",({isDragging:C})=>{C&&b.value.break()}),b.value.subscribe("callback",({items:C,event:B,isDragging:V})=>{o.emit("vf-nodes-selected",W()),m.value=b.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{b.value.Area.reset(),b.value.SelectorArea.updatePos(),N.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>o.emit("vf-explorer-update"))}),(C,B)=>(e.openBlock(),e.createElementBlock("div",ki,[n.view=="list"||D.value.length?(e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("div",{onClick:B[0]||(B[0]=V=>X("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(S)("Name"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="basename"]])]),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:B[1]||(B[1]=V=>X("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(S)("Size"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="file_size"]])])),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:B[2]||(B[2]=V=>X("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(S)("Date"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="last_modified"]])])),D.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:B[3]||(B[3]=V=>X("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(S)("Filepath"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("div",{ref_key:"dragImage",ref:y,class:"absolute -z-50 -top-96"},[Ei,e.createElementVNode("div",Ni,e.toDisplayString(m.value),1)],512)]),e.createElementVNode("div",{onTouchstart:I,onContextmenu:B[10]||(B[10]=e.withModifiers(V=>e.unref(o).emit("vf-contextmenu-show",{event:V,area:c.value,items:W()}),["self","prevent"])),class:e.normalizeClass([_.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:c},[D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:O=>k(V),onTouchstart:B[4]||(B[4]=O=>R(O)),onTouchend:B[5]||(B[5]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Mi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ti,Bi)):(e.openBlock(),e.createElementBlock("svg",$i,Ai)),e.createElementVNode("span",Ii,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Li,e.toDisplayString(V.path),1)])],42,Ci))),256)):e.createCommentVNode("",!0),n.view=="list"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[6]||(B[6]=O=>R(O)),onTouchend:B[7]||(B[7]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",ji,[e.createElementVNode("div",Pi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",zi,Ri)):(e.openBlock(),e.createElementBlock("svg",Hi,Fi)),e.createElementVNode("span",Ui,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Yi,e.toDisplayString(V.file_size?e.unref(ir)(V.file_size):""),1),e.createElementVNode("div",Ki,e.toDisplayString(e.unref(sr)(V.last_modified)),1)])],42,Oi))),256)):e.createCommentVNode("",!0),n.view=="grid"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H(!1),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[8]||(B[8]=O=>R(O)),onTouchend:B[9]||(B[9]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",null,[e.createElementVNode("div",Xi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Zi,qi)):(V.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)(e.unref(a).value,V.path),alt:V.basename},null,8,Gi)):(e.openBlock(),e.createElementBlock("svg",Ji,Qi)),!(V.mime_type??"").startsWith("image")&&V.type!="dir"?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(u(V.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ts,e.toDisplayString(p(V.basename)),1)])],42,Wi))),256)):e.createCommentVNode("",!0)],34),e.createVNode(yo)]))}}),ns="1.2.4",os={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},is={class:"flex leading-5 items-center"},ss=["aria-label"],as=[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)],ls=["value"],cs={class:"ml-3"},ds={key:0},hs={class:"ml-1"},us={class:"flex leading-5 items-center"},fs={value:"",disabled:""},ms=e.createStaticVNode('',7),ps=["aria-label"],gs=[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)],ys=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),{getStore:o,setStore:i}=e.inject("storage"),l=e.ref(0),a=e.inject("adapter"),{t:u,changeLocale:p}=e.inject("i18n"),c=e.ref(o("locale","")),y=()=>{t.emit("vf-search-exit"),t.emit("vf-fetch",{params:{q:"index",adapter:a.value}}),i("adapter",a.value)};t.on("vf-nodes-selected",b=>{l.value=b.length});const m=e.ref("");return t.on("vf-search-query",({newQuery:b})=>{m.value=b}),(b,S)=>(e.openBlock(),e.createElementBlock("div",os,[e.createElementVNode("div",is,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(u)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},as,8,ss),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=E=>e.isRef(a)?a.value=E:null),onChange:y,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data.storages,E=>(e.openBlock(),e.createElementBlock("option",{value:E},e.toDisplayString(E),9,ls))),256))],544),[[e.vModelSelect,e.unref(a)]]),e.createElementVNode("div",cs,[m.value.length?(e.openBlock(),e.createElementBlock("span",ds,e.toDisplayString(n.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",hs,e.toDisplayString(l.value>0?l.value+" "+e.unref(u)("item(s) selected."):""),1)])]),e.createElementVNode("div",us,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=E=>c.value=E),onChange:S[2]||(S[2]=E=>e.unref(p)(E.target.value)),class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8 mr-3"},[e.createElementVNode("option",fs,e.toDisplayString(e.unref(u)("Language")),1),ms],544),[[e.vModelSelect,c.value]]),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(u)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=E=>e.unref(t).emit("vf-modal-show",{type:"message",title:"Vuefinder "+e.unref(ns),message:e.unref(u)("Vuefinder is a file manager component for vue 3.")}))},gs,8,ps)])]))}}),bs=(n,t=0,o=!1)=>{let i;return(...l)=>{o&&!i&&n(...l),clearTimeout(i),i=setTimeout(()=>{n(...l)},t)}},vs=(n,t,o)=>{const i=e.ref(n);return e.customRef((a,u)=>({get(){return a(),i.value},set:bs(p=>{i.value=p,u()},t,o)}))},Ss={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-xs"},ws=["aria-label"],_s=[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)],ks=["aria-label"],xs=[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)],Ds=["aria-label"],Es=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ns=["onClick"],Cs=[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)],Vs={class:"flex leading-5"},Ms=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),Ts=["title","onClick"],Bs={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"},$s=[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),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)],As={key:3,class:"relative flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Is=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),Ls=e.createElementVNode("div",{class:"w-full"},null,-1),Os=["onKeydown","placeholder"],js=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ps=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),l=e.ref(null),a=e.ref([]),u=e.ref(!1),p=e.ref(null),{t:c}=e.inject("i18n"),y=e.inject("loadingState");o.on("vf-explorer-update",()=>{let $=[],T=[];l.value=t.data.dirname??i.value+"://",l.value.length==0&&(a.value=[]),l.value.replace(i.value+"://","").split("/").forEach(function(I){$.push(I),$.join("/")!=""&&T.push({basename:I,name:I,path:i.value+"://"+$.join("/"),type:"dir"})}),T.length>4&&(T=T.slice(-5),T[0].name=".."),a.value=T});const m=()=>{u.value=!1,S.value=""};o.on("vf-search-exit",()=>{m()});const b=()=>{u.value=!0,e.nextTick(()=>p.value.focus())},S=vs("",400),E=()=>y.value;e.watch(S,$=>{o.emit("vf-toast-clear"),o.emit("vf-search-query",{newQuery:$})});const _=()=>a.value.length&&!u.value,N=$=>{$.preventDefault();let T=JSON.parse($.dataTransfer.getData("items"));if(T.find(I=>I.storage!=i.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:T,to:a.value[a.value.length-2]??{path:i.value+"://"}}})},D=$=>{$.preventDefault(),_()?$.dataTransfer.dropEffect="copy":($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none")},L=()=>{S.value==""&&m()};return($,T)=>(e.openBlock(),e.createElementBlock("div",Ss,[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:T[0]||(T[0]=I=>D(I)),onDrop:T[1]||(T[1]=I=>N(I)),onClick:T[2]||(T[2]=I=>{var R;return!_()||e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:((R=a.value[a.value.length-2])==null?void 0:R.path)??e.unref(i)+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",_()?"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"},_s,34))],8,ws),E()?(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:T[4]||(T[4]=I=>e.unref(o).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"},Es))],8,Ds)):(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:T[3]||(T[3]=I=>{e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:n.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"},xs))],8,ks)),u.value?(e.openBlock(),e.createElementBlock("div",As,[Is,Ls,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:p,onKeydown:e.withKeys(m,["esc"]),onBlur:L,"onUpdate:modelValue":T[6]||(T[6]=I=>e.isRef(S)?S.value=I:null),placeholder:e.unref(c)("Search anything.."),class:"absolute ml-4 pt-1 pb-0 px-2 border-0 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,Os),[[e.vModelText,e.unref(S)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:m,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},js))])):(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(b,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[5]||(T[5]=I=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.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"},Cs)),e.createElementVNode("div",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(I,R)=>(e.openBlock(),e.createElementBlock("div",{key:R},[Ms,e.createElementVNode("span",{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:I.basename,onClick:k=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:I.path}})},e.toDisplayString(I.name),9,Ts)]))),128))]),E()?(e.openBlock(),e.createElementBlock("svg",Bs,$s)):e.createCommentVNode("",!0)],8,Ns))]))}}),zs=["onClick"],Rs=e.createElementVNode("span",{class:"px-1"},null,-1),Hs=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(n){const t=n,o=e.inject("emitter"),i=e.ref(null),{apiUrl:l}=ue(),a=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),u=e.ref([]);o.on("vf-context-selected",S=>{u.value=S});const{t:p}=e.inject("i18n"),c={newfolder:{title:()=>p("New Folder"),action:()=>{o.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>p("Delete"),action:()=>{o.emit("vf-modal-show",{type:"delete",items:u})}},refresh:{title:()=>p("Refresh"),action:()=>{o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>p("Preview"),action:()=>{o.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:u.value[0]})}},open:{title:()=>p("Open"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].path}})}},openDir:{title:()=>p("Open containing folder"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].dir}})}},download:{title:()=>p("Download"),action:()=>{const S=l.value+"?"+Ce({q:"download",adapter:t.current.adapter,path:u.value[0].path});o.emit("vf-download",S)}},archive:{title:()=>p("Archive"),action:()=>{o.emit("vf-modal-show",{type:"archive",items:u})}},unarchive:{title:()=>p("Unarchive"),action:()=>{o.emit("vf-modal-show",{type:"unarchive",items:u})}},rename:{title:()=>p("Rename"),action:()=>{o.emit("vf-modal-show",{type:"rename",items:u})}}},y=S=>{o.emit("vf-contextmenu-hide"),S.action()},m=e.ref("");o.on("vf-search-query",({newQuery:S})=>{m.value=S}),o.on("vf-contextmenu-show",({event:S,area:E,items:_,target:N=null})=>{if(a.items=[],m.value)if(N)a.items.push(c.openDir),o.emit("vf-context-selected",[N]);else return;else!N&&!m.value?(a.items.push(c.refresh),a.items.push(c.newfolder),o.emit("vf-context-selected",[])):_.length>1&&_.some(D=>D.path===N.path)?(a.items.push(c.refresh),a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",_)):(N.type=="dir"?a.items.push(c.open):(a.items.push(c.preview),a.items.push(c.download)),a.items.push(c.rename),N.mime_type=="application/zip"?a.items.push(c.unarchive):a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",[N]));b(S,E)}),o.on("vf-contextmenu-hide",()=>{a.active=!1});const b=(S,E)=>{a.active=!0,e.nextTick(()=>{let _=E.getBoundingClientRect(),N=S.pageX,D=S.pageY,L=i.value.offsetHeight,$=i.value.offsetWidth;N=_.right-S.pageX+window.scrollX<$?N-$:N,D=_.bottom-S.pageY+window.scrollYa.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:i,style:e.normalizeStyle(a.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,_=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:_.title,onClick:N=>y(_)},[Rs,e.createElementVNode("span",null,e.toDisplayString(_.title()),1)],8,zs))),128))],4)):e.createCommentVNode("",!0)}}),Fs=(n,t)=>{const o=n[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((i,l)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(l.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function Us(n){const t=await Fs(Object.assign({"../locales/de.json":()=>Promise.resolve().then(()=>wd),"../locales/en.json":()=>Promise.resolve().then(()=>_d),"../locales/fa.json":()=>Promise.resolve().then(()=>kd),"../locales/he.json":()=>Promise.resolve().then(()=>xd),"../locales/ru.json":()=>Promise.resolve().then(()=>Dd),"../locales/tr.json":()=>Promise.resolve().then(()=>Ed)}),`../locales/${n}.json`);return JSON.parse(t.default)}function Ys(n,t,o){const{getStore:i,setStore:l}=wt(n),a=e.ref({}),u=y=>{Us(y).then(m=>{a.value=m,l("locale",y),l("translations",m),o.emit("vf-toast-push",{label:"The language is set to "+y})}).catch(m=>{o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),u("en")})};i("locale")?a.value=i("translations"):u(t);const p=(y,...m)=>m.length?p(y=y.replace("%s",m.shift()),...m):y;function c(y,...m){return a.value.hasOwnProperty(y)?p(a.value[y],...m):p(y,...m)}return{t:c,changeLocale:u}}const Ks={class:"vuefinder"},Ws=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Xs=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},usePropDarkMode:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},postData:{type:Object,default:{}}},setup(n){const t=n,o=Cn(),{setStore:i,getStore:l}=wt(t.id),a=e.ref(l("adapter"));e.provide("emitter",o),e.provide("storage",wt(t.id)),e.provide("postData",t.postData),e.provide("adapter",a),e.provide("maxFileSize",t.maxFileSize),e.provide("usePropDarkMode",t.usePropDarkMode);const u=Ys(t.id,t.locale,o);e.provide("i18n",u);const{apiUrl:p,setApiUrl:c}=ue();c(t.url);const y=e.reactive({adapter:a.value,storages:[],dirname:".",files:[]}),m=e.ref(l("viewport","grid")),b=t.usePropDarkMode?e.computed(()=>t.dark):e.ref(l("darkMode",t.dark));o.on("vf-darkMode-toggle",()=>{b.value=!b.value,i("darkMode",b.value)});const S=e.ref(!1);e.provide("loadingState",S);const E=e.ref(l("full-screen",!1));o.on("vf-fullscreen-toggle",()=>{E.value=!E.value,i("full-screen",E.value)}),o.on("vf-view-toggle",L=>{m.value=L});const _=e.reactive({active:!1,type:"delete",data:{}});o.on("vf-modal-close",()=>{_.active=!1}),o.on("vf-modal-show",L=>{_.active=!0,_.type=L.type,_.data=L});const N=L=>{Object.assign(y,L),o.emit("vf-nodes-selected",{}),o.emit("vf-explorer-update")};let D;return o.on("vf-fetch-abort",()=>{D.abort(),S.value=!1}),o.on("vf-fetch",({params:L,onSuccess:$=null,onError:T=null})=>{["index","search"].includes(L.q)&&(D&&D.abort(),S.value=!0),D=new AbortController;const I=D.signal;ot(p.value,{params:L,signal:I}).then(R=>{a.value=R.adapter,["index","search"].includes(L.q)&&(S.value=!1),o.emit("vf-modal-close"),N(R),$(R)}).catch(R=>{T&&T(R)}).finally(()=>{})}),o.on("vf-download",L=>{document.getElementById("download_frame").src=L,o.emit("vf-modal-close")}),e.onMounted(()=>{o.emit("vf-fetch",{params:{q:"index",adapter:a.value}})}),(L,$)=>(e.openBlock(),e.createElementBlock("div",Ks,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b)?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([E.value?"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.value?"":"max-height: "+n.maxHeight),onMousedown:$[0]||($[0]=T=>e.unref(o).emit("vf-contextmenu-hide")),onTouchstart:$[1]||($[1]=T=>e.unref(o).emit("vf-contextmenu-hide"))},[e.createVNode(so,{data:y},null,8,["data"]),e.createVNode(Ps,{data:y},null,8,["data"]),e.createVNode(rs,{view:m.value,data:y},null,8,["view","data"]),e.createVNode(ys,{data:y},null,8,["data"])],38),_.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+_.type),{key:0,selection:_.data,current:y},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Hs,{current:y},null,8,["current"]),Ws],2)]))}}),Zs=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),qs={class:"fixed z-10 inset-0 overflow-hidden"},Gs={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"},Js={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qs={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"},me={__name:"ModalLayout",setup(n){const t=e.inject("emitter");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:i[1]||(i[1]=e.withKeys(l=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Zs,e.createElementVNode("div",qs,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:i[0]||(i[0]=e.withModifiers(l=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Gs,[e.createElementVNode("div",Js,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Qs,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},ea=["aria-label"],ta=[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)],pe=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(n,{emit:t}){var p;const{t:o}=e.inject("i18n"),i=e.ref(!1),l=e.ref(null),a=e.ref((p=l.value)==null?void 0:p.strMessage);e.watch(a,()=>i.value=!1);const u=()=>{t("hidden"),i.value=!0};return(c,y)=>(e.openBlock(),e.createElementBlock("div",null,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:l,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",n.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(c.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:u,"aria-label":e.unref(o)("Close"),"data-microtip-position":"top-left",role:"tooltip"},ta,8,ea)],2))]))}}),ra={class:"sm:flex sm:items-start"},na=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),oa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ia={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},sa={class:"mt-2"},aa={class:"text-sm text-gray-500"},la={class:"flex text-sm text-gray-800 dark:text-gray-400"},ca={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"},da=[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)],ha={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"},ua=[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)],fa={class:"ml-1.5"},ma={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},pa=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(t.selection.items),u=e.ref(""),p=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"delete",adapter:i.value,path:t.current.dirname,items:JSON.stringify(a.value.map(({path:c,type:y})=>({path:c,type:y})))},onSuccess:()=>{o.emit("vf-toast-push",{label:l("Files deleted.")})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:y[1]||(y[1]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1),e.createElementVNode("div",ma,e.toDisplayString(e.unref(l)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ra,[na,e.createElementVNode("div",oa,[e.createElementVNode("h3",ia,e.toDisplayString(e.unref(l)("Delete files")),1),e.createElementVNode("div",sa,[e.createElementVNode("p",aa,e.toDisplayString(e.unref(l)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("p",la,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",ca,da)):(e.openBlock(),e.createElementBlock("svg",ha,ua)),e.createElementVNode("span",fa,e.toDisplayString(m.basename),1)]))),256)),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[0]||(y[0]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ga={class:"sm:flex sm:items-start"},ya=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),ba={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},va={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Sa={class:"mt-2"},wa={class:"text-sm text-gray-500"},_a=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(n){const t=e.inject("emitter"),{t:o}=e.inject("i18n");return(i,l)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l[0]||(l[0]=a=>e.unref(t).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var a,u;return[e.createElementVNode("div",ga,[ya,e.createElementVNode("div",ba,[e.createElementVNode("h3",va,e.toDisplayString(((a=n.selection)==null?void 0:a.title)??"Title"),1),e.createElementVNode("div",Sa,[e.createElementVNode("p",wa,e.toDisplayString(((u=n.selection)==null?void 0:u.message)??"Message")+".",1)])])])]}),_:1}))}}),ka={class:"sm:flex sm:items-start"},xa=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),Da={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ea={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Na={class:"mt-2"},Ca={class:"text-sm text-gray-500"},Va=["onKeyup","placeholder"],Ma=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfolder",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ka,[xa,e.createElementVNode("div",Da,[e.createElementVNode("h3",Ea,e.toDisplayString(e.unref(l)("New Folder")),1),e.createElementVNode("div",Na,[e.createElementVNode("p",Ca,e.toDisplayString(e.unref(l)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["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(l)("Folder Name"),type:"text"},null,40,Va),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ta={class:"sm:flex sm:items-start"},Ba=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),$a={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Aa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ia={class:"mt-2"},La={class:"text-sm text-gray-500"},Oa=["onKeyup","placeholder"],ja=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfile",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ta,[Ba,e.createElementVNode("div",$a,[e.createElementVNode("h3",Aa,e.toDisplayString(e.unref(l)("New File")),1),e.createElementVNode("div",Ia,[e.createElementVNode("p",La,e.toDisplayString(e.unref(l)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["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(l)("File Name"),type:"text"},null,40,Oa),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Pa={class:"flex"},za=["aria-label"],Ra={class:"ml-auto mb-2"},Ha={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"},Fa={key:1},Ua={__name:"Text",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,i=e.ref(""),l=e.ref(""),a=e.ref(null),u=e.ref(!1),{apiUrl:p}=ue(),c=e.ref(""),y=e.ref(!1),{t:m}=e.inject("i18n");e.onMounted(()=>{ot(p.value,{params:{q:"preview",adapter:o.selection.adapter,path:o.selection.item.path},json:!1}).then(_=>{i.value=_,t("load")})});const b=()=>{u.value=!u.value,l.value=i.value,u.value==!0&&e.nextTick(()=>{a.value.focus()})},S=e.inject("postData"),E=()=>{c.value="",y.value=!1,ot(p.value,{method:"POST",params:Object.assign(S,{q:"save",adapter:o.selection.adapter,path:o.selection.item.path,content:l.value}),json:!1}).then(_=>{c.value=m("Updated."),i.value=_,t("load"),u.value=!u.value}).catch(_=>{c.value=m(_.message),y.value=!0})};return(_,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pa,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,za),e.createElementVNode("div",Ra,[u.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:E,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(m)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:N[0]||(N[0]=D=>b())},e.toDisplayString(u.value?e.unref(m)("Cancel"):e.unref(m)("Edit")),1)])]),e.createElementVNode("div",null,[u.value?(e.openBlock(),e.createElementBlock("div",Fa,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:a,"onUpdate:modelValue":N[1]||(N[1]=D=>l.value=D),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,l.value]])])):(e.openBlock(),e.createElementBlock("pre",Ha,e.toDisplayString(i.value),1)),c.value.length?(e.openBlock(),e.createBlock(pe,{key:2,onHidden:N[2]||(N[2]=D=>c.value=""),error:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},qh="";/*! +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,v=!1,w;return{s:function(){r=r.call(d)},n:function(){var x=r.next();return f=x.done,x},e:function(x){v=!0,w=x},f:function(){try{!f&&r.return!=null&&r.return()}finally{if(v)throw w}}}}function C(d,h){if(typeof d!="object"||d===null)return d;var r=d[Symbol.toPrimitive];if(r!==void 0){var g=r.call(d,h||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}function B(d){var h=C(d,"string");return typeof h=="symbol"?h:String(h)}var V=function(h,r,g){var s=h.x,f=h.y,v=g.x,w=g.y,x={"+":{x:s+v,y:f+w},"-":{x:s-v,y:f-w},"*":{x:s*v,y:f*w},"/":{x:s/v,y:f/w}};return x[r]},Y=function(h){return{x:h.left,y:h.top}},O=function(h){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:h.x,top:h.y,right:h.x,bottom:h.y,width:r,height:r}},ce=function(h){return{x:h,y:h}},ae=function(d,h){var r=h;window.addEventListener("resize",r),window.addEventListener("scroll",r);var g=new MutationObserver(r);d.forEach(function(f,v){g.observe(f,{childList:v!==0,attributes:!0})});var s=function(){return jd(g,r)};return{observer:g,callback:r,cleanup:s}},pt=function(d){var h=bt(d);return h.x||h.y?!0:d instanceof Document?d.body?!!(d.body.scrollTop=1):!!(d.documentElement.scrollTop=1):!!(d.scrollTop=1)},gt=function(){var d=document.createElement("div");return d.style.position="fixed",d.style.overflow="hidden",d.style.pointerEvents="none",d.style.zIndex="999999999999999999",d},Qt=function(d){var h=document.createElement("div");return h.style.position="absolute",d||(h.style.background="rgba(0, 175, 255, 0.2)",h.style.border="1px solid rgba(0, 175, 255, 0.8)",h.style.display="none",h.style.pointerEvents="none"),h},yt=function(d,h){var r;return function(){for(var g=arguments.length,s=new Array(g),f=0;f1&&arguments[1]!==void 0?arguments[1]:0,v=(s=g[f])===null||s===void 0?void 0:s.parentNode;return v?(g.push(v),f++,r(g,f)):g};return h([d])},Nd=function(d,h){if(d instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var r=d.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(d.clientWidth||r.width)*h,height:(d.clientHeight||r.height)*h}},Sn=function(d,h){var r={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return Ne(d).forEach(function(g){var s=h.getRect(g);r.top=Math.min(r.top,s.top),r.left=Math.min(r.left,s.left),r.bottom=Math.max(r.bottom,s.bottom),r.right=Math.max(r.right,s.right)}),r.height=r.bottom-r.top,r.width=r.right-r.left,r},bt=function(d){return!d||d instanceof Document?er():{x:d.scrollLeft>=0?d.scrollLeft:er().x,y:d.scrollTop>=0?d.scrollTop:er().y}},wn=function(d){var h=d.elementRect,r=d.containerRect,g=d.tolerance,s=g===void 0?{x:0,y:0}:g,f=[];return h.top-s.yr.bottom&&f.push("bottom"),h.right+s.y>r.right&&f.push("right"),f},Cd=function(d){var h=d.event;return{x:h.clientX,y:h.clientY}},Vd=function(d){var h=d.scrollAmount,r=d.initialPointerPos,g=d.pointerPos,s={};return g.x>r.x-h.x?(s.left=r.x-h.x,s.width=g.x-r.x+h.x):(s.left=g.x,s.width=r.x-g.x-h.x),g.y>r.y-h.y?(s.top=r.y-h.y,s.height=g.y-r.y+h.y):(s.top=g.y,s.height=r.y-g.y-h.y),s},_n=function(h){var r={x:0,y:0},g=window.getComputedStyle(h);if(!g.transform||g.transform==="none")return r;if(g.transform.indexOf("3d")>=0){var s=g.transform.trim().match(/matrix3d\((.*?)\)/);if(s&&s.length){var f,v=(f=s[1])===null||f===void 0?void 0:f.split(",");r.x=parseInt(v[12])||0,r.y=parseInt(v[13])||0}return r}var w=g.transform.trim().match(/matrix\((.*?)\)/);if(w&&w.length){var x,A=(x=w[1])===null||x===void 0?void 0:x.split(",");r.x=parseInt(A[4])||0,r.y=parseInt(A[5])||0}return r},Md=function(h){var r=h.style.transform;if(!r||r.indexOf("translate")<0)return _n(h);var g={x:0,y:0},s=r.trim().match(/translate[3dD]*?\(.*?\)/);if(s){var f,v=(f=s[0])===null||f===void 0?void 0:f.split("(");if(v){var w,x=(w=v[1])===null||w===void 0?void 0:w.split(",");g.x=parseInt(x[0])||0,g.y=parseInt(x[1])||0}}return!g.x&&!g.x?_n(h):g},Td=function(h){var r=h.style,g={x:parseInt(r.left)||0,y:parseInt(r.top)||0};if(!g.x&&!g.x){var s=window.getComputedStyle(h);return{x:parseInt(s.left)||0,y:parseInt(s.top)||0}}return g},Bd=function(d,h){return h?Md(d):Td(d)},$d=function(d){var h=d.element,r=d.edges,g=d.elementRect,s=d.containerRect,f=d.elementPos,v=d.useTransform;r.includes("top")&&et(h,{y:f.y+s.top-g.top,x:f.x},v),r.includes("left")&&et(h,{y:f.y,x:f.x+s.left-g.left},v),r.includes("bottom")&&et(h,{y:f.y+s.bottom-g.bottom,x:f.x},v),r.includes("right")&&et(h,{y:f.y,x:f.x+s.right-g.right},v)},kn=function(d){var h=d.computedStyle,r=d.node,g=h.position,s=g==="absolute"||g==="relative"||g==="fixed";!(r instanceof Document)&&!s&&(r.style.position="relative")},Ad=function(d){var h=d.shiftKey,r=d.keyboardDragSpeed,g=d.zoom,s=d.key,f=d.dragKeys,v=d.scrollDiff,w=d.canScroll,x=d.scrollCallback,A={x:0,y:0},z=h?r*4*g:r*g;return f.left.includes(s)&&(A.x=v.x||-z,!h&&!v.x&&w&&x(["left"],r)),f.right.includes(s)&&(A.x=v.x||z,!h&&!v.x&&w&&x(["right"],r)),f.up.includes(s)&&(A.y=v.y||-z,!h&&!v.y&&w&&x(["top"],r)),f.down.includes(s)&&(A.y=v.y||z,!h&&!v.y&&w&&x(["bottom"],r)),A},Id=function(d){var h=d.element,r=d.force,g=d.multiSelectionToggle,s=d.SelectedSet,f=d.hoverClassName;h.classList.contains(f)&&!r||(s.has(h)?g&&s.delete(h):s.add(h),h.classList.add(f))},Ld=function(d){var h=d.element,r=d.force,g=d.SelectedSet,s=d.PrevSelectedSet,f=d.hoverClassName;if(!h.classList.contains(f)&&!r)return!1;var v=g.has(h),w=s.has(h);v&&!w?g.delete(h):!v&&w&&g.add(h),h.classList.remove(f)},Qe=function(h,r,g){return console.warn('[DragSelect] TypeIssue: setting "'.concat(h,'" is not of type "').concat(r,'".'))},P=function(h,r,g,s){if(r===void 0)return g?c({},h,s):{};if(r===null)return c({},h,null);var f=!0,v=!1,w=typeof s=="string";w&&(f=typeof r=="string"||r instanceof String),w&&!f&&(v=!0,Qe(h,"string"));var x=!Number.isNaN(s)&&typeof s=="number";x&&(f=!Number.isNaN(r)&&typeof r=="number"),x&&!f&&(v=!0,Qe(h,"number"));var A=Object.prototype.toString.call(s)==="[object Object]";A&&(f=Object.prototype.toString.call(r)==="[object Object]"),A&&!f&&(v=!0,Qe(h,"object"));var z=typeof s=="boolean";z&&(f=typeof r=="boolean"),z&&!f&&(v=!0,Qe(h,"boolean"));var G=Array.isArray(s);G&&(f=Array.isArray(r)),G&&!f&&(v=!0,Qe(h,"array"));var de=v||g;return h==="dragKeys"&&f?c({},h,Object.assign(s,r)):h==="dragKeys"&&!f?de?c({},h,s):{}:(h==="dropZones"&&f&&new Set(r.map(function(he){return he.id})).size!==r.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),f?c({},h,r):de?c({},h,s):{})},Od=function(d,h){return l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l({},P("area",d.area,h,document)),P("selectables",d.selectables,h,null)),P("autoScrollSpeed",d.autoScrollSpeed,h,5)),P("overflowTolerance",d.overflowTolerance,h,{x:25,y:25})),P("zoom",d.zoom,h,1)),P("customStyles",d.customStyles,h,!1)),P("multiSelectMode",d.multiSelectMode,h,!1)),P("multiSelectToggling",d.multiSelectToggling,h,!0)),P("multiSelectKeys",d.multiSelectKeys,h,["Control","Shift","Meta"])),P("selector",d.selector,h,null)),P("selectionThreshold",d.selectionThreshold,h,0)),P("draggability",d.draggability,h,!0)),P("immediateDrag",d.immediateDrag,h,!0)),P("keyboardDrag",d.keyboardDrag,h,!0)),P("dragKeys",d.dragKeys,h,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),P("keyboardDragSpeed",d.keyboardDragSpeed,h,10)),P("useTransform",d.useTransform,h,!0)),P("refreshMemoryRate",d.refreshMemoryRate,h,80)),P("dropZones",d.dropZones,h,[])),P("dropInsideThreshold",d.dropInsideThreshold,h,1)),P("dropTargetThreshold",d.dropTargetThreshold,h,0)),P("usePointerEvents",d.usePointerEvents,h,!1)),P("hoverClass",d.hoverClass,h,"ds-hover")),P("selectableClass",d.selectableClass,h,"ds-selectable")),P("selectedClass",d.selectedClass,h,"ds-selected")),P("selectorClass",d.selectorClass,h,"ds-selector")),P("selectorAreaClass",d.selectorAreaClass,h,"ds-selector-area")),P("droppedTargetClass",d.droppedTargetClass,h,"ds-dropped-target")),P("droppedInsideClass",d.droppedInsideClass,h,"ds-dropped-inside")),P("droppableClass",d.droppableClass,h,"ds-droppable")),P("dropZoneClass",d.dropZoneClass,h,"ds-dropzone")),P("dropZoneReadyClass",d.dropZoneReadyClass,h,"ds-dropzone-ready")),P("dropZoneTargetClass",d.dropZoneTargetClass,h,"ds-dropzone-target")),P("dropZoneInsideClass",d.dropZoneInsideClass,h,"ds-dropzone-inside")),P("dragAsBlock",d.dragAsBlock,h,!1))},Re=function(d,h){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=d;if(r>0){var s=(d.right-d.left)*r,f=(d.bottom-d.top)*r;g={left:d.left+s,right:d.right-s,top:d.top+f,bottom:d.bottom-f}}return g.lefth.left&&g.toph.top},xn=function(d){var h=d.element,r=d.posDirection,g=d.containerRect,s=d.useTransform,f=Bd(h,s),v=V(f,"+",r);et(h,v,s);var w=h.getBoundingClientRect(),x=wn({elementRect:w,containerRect:g});$d({element:h,edges:x,elementRect:w,containerRect:g,elementPos:v,useTransform:s})},jd=function(d,h){window.removeEventListener("resize",h),window.removeEventListener("scroll",h),d.disconnect()},Pd=function(d,h,r){if(h.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=d instanceof Document?g||document.body:d,f=h.includes("top")&&s.scrollTop>0,v=h.includes("bottom")&&s.scrollTop0,x=h.includes("right")&&s.scrollLeft0&&(s.y=Math.min(s.y,w.bottom)),s.x>0&&(s.x=Math.min(s.x,w.right)),r._selectionRect.top+=s.y,r._selectionRect.bottom+=s.y,r._selectionRect.left+=s.x,r._selectionRect.right+=s.x),s}),c(this,"handleZIndex",function(s){r._elements.forEach(function(f){return f.style.zIndex="".concat((parseInt(f.style.zIndex)||0)+s?9999:-9998)})}),this.DS=g,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return p(d,[{key:"_cursorDiff",get:function(){var r=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?V(r,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=r,g}},{key:"_scrollDiff",get:function(){var r=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?V(r,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=r,g}}]),d}(),Fd=function(){function d(h){var r=this,g=h.DS,s=h.id,f=h.element,v=h.droppables;a(this,d),c(this,"id",void 0),c(this,"element",void 0),c(this,"_droppables",void 0),c(this,"_rect",void 0),c(this,"_observers",void 0),c(this,"_timeout",void 0),c(this,"_itemsDropped",[]),c(this,"_itemsInside",void 0),c(this,"setReadyClasses",function(w){if(!r.isDestroyed){var x=r.droppables.filter(function(A){return r.DS.SelectedSet.has(A)});x.length&&(x.forEach(function(A){A.classList[w]("".concat(r.Settings.droppableClass)),A.classList[w]("".concat(r.Settings.droppableClass,"-").concat(r.id))}),r.element.classList[w]("".concat(r.Settings.dropZoneReadyClass)))}}),c(this,"handleNoDrop",function(){var w;r.isDestroyed||(r.DS.SelectedSet.forEach(function(x){x.classList.remove(r.Settings.droppedTargetClass),x.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),r._itemsDropped=r._itemsDropped.filter(function(x){return!r.DS.SelectedSet.has(x)}),(w=r._itemsDropped)!==null&&w!==void 0&&w.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleDrop",function(){var w,x,A;r.isDestroyed||(r._itemsDropped=k(new Set([].concat(k(r._itemsDropped),k((w=r.droppables)===null||w===void 0?void 0:w.filter(function(z){return r.DS.SelectedSet.has(z)}))))),(x=r._itemsDropped)===null||x===void 0||x.forEach(function(z){z.classList.add("".concat(r.Settings.droppedTargetClass)),z.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),(A=r._itemsDropped)!==null&&A!==void 0&&A.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleItemsInsideClasses",function(){var w=!1;r.droppables.forEach(function(x){r.itemsInside.includes(x)?(x.classList.add("".concat(r.Settings.droppedInsideClass)),x.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),w=!0):(x.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),x.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||x.classList.remove("".concat(r.Settings.droppedInsideClass)))}),w?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))}),c(this,"start",function(w){var x=w.isDragging;!x||r.isDestroyed||r.setReadyClasses("add")}),c(this,"stop",function(w){var x=w.isDragging;!x||r.isDestroyed||(r.setReadyClasses("remove"),r.handleItemsInsideClasses())}),c(this,"toObject",function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.id=s,this.element=f,v&&(this.droppables=Ne(v)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",function(w){var x=w.settings;r.element&&(r.element.classList.remove(x["dropZoneClass:pre"]),r.element.classList.add(x.dropZoneClass))}),this._observers=ae(this.parentNodes,yt(function(){return r._rect=null},this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return p(d,[{key:"destroy",value:function(){var r=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach(function(g){g.classList.remove("".concat(r.Settings.droppedTargetClass)),g.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id)),g.classList.remove("".concat(r.Settings.droppableClass)),g.classList.remove("".concat(r.Settings.droppableClass,"-").concat(r.id))}),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var r=this;return this.isDestroyed?null:this._itemsInside?this._itemsInside:(this._itemsInside=this.droppables.flatMap(function(g){return Re(r.DS.SelectableSet.rects.get(g),r.rect,r.Settings.dropInsideThreshold)?[g]:[]}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return r._itemsInside=null},this.Settings.refreshMemoryRate),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=vn(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(r){this._droppables=r}}]),d}(),Ud=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"_zoneByElement",new Map),c(this,"_zoneById",new Map),c(this,"_zonesByDroppable",new Map),c(this,"_zones",void 0),c(this,"setDropZones",function(s){var f=s.dropZones;f&&(r._zones&&r._zones.forEach(function(v){return v.destroy()}),r._zones=f.map(function(v){return new Fd(l({DS:r.DS},v))}),r._zones.forEach(function(v){r._zoneByElement.set(v.element,v),r._zoneById.set(v.id,v),v.droppables.forEach(function(w){var x=r._zonesByDroppable.get(w);if(!(x!=null&&x.length))return r._zonesByDroppable.set(w,[v]);r._zonesByDroppable.set(w,k(new Set([].concat(k(x),[v]))))})}))}),c(this,"_handleDrop",function(s){r._zones.forEach(function(f){f!==s&&f.handleNoDrop()}),s&&s.handleDrop()}),c(this,"_getZoneByElementsFromPoint",function(s,f){for(var v=f.x,w=f.y,x=0,A=s.length;x0)){var v=r.DS,w=v.stores,x=w.PointerStore,A=w.KeyStore,z=v.SelectableSet,G=v.SelectedSet;x.start(f);var de=f.target;z.has(de)&&(A.isMultiSelectKeyPressed(f)||G.clear(),G.toggle(de),r.reset())}}),c(this,"stop",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(s.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(s.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),s.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)}),c(this,"update",function(s){var f=s.event,v=s.scroll_directions,w=s.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:f,scroll_directions:v,scroll_multiplier:w,isDragging:r.isDragging})}),c(this,"reset",function(s){return r.DS.publish("Interaction:end:pre",{event:s,isDragging:r.isDragging})}),c(this,"_reset",function(s){var f=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:s,isDragging:f})}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",function(s){var f=s.settings;r.stop(f["area:pre"]),r.init()}),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:start:pre",function(s){var f=s.event;return r._start(f)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(s){var f=s.event;return r._reset(f)}),this.DS.subscribe("Area:scroll",this.update)}return p(d,[{key:"_canInteract",value:function(r){var g=r.clientX===0&&r.clientY===0&&r.detail===0&&r.target;return!(r.button===2||this.isInteracting||r.target&&!this.DS.SelectorArea.isInside(r.target)||!g&&!this.DS.SelectorArea.isClicked(r))}}]),d}(),Kd=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"subscribers",{}),c(this,"subscribe",function(s,f){return Array.isArray(r.subscribers[s])||(r.subscribers[s]=[]),r.subscribers[s].push(f),r.subscribers[s].length-1}),c(this,"unsubscribe",function(s,f,v){v>=0?r.subscribers[s].splice(v,1):f&&(r.subscribers[s]=r.subscribers[s].filter(function(w){return w!==f}))}),c(this,"publish",function(s,f){Array.isArray(s)?s.forEach(function(v){return r._publish(v,f)}):r._publish(s,f)}),c(this,"_publish",function(s,f){var v=r.subscribers[s];Array.isArray(v)&&(s.includes(":pre")?r._handlePrePublish(v,f):r._handlePublish(v,f))}),c(this,"_handlePublish",function(s,f){for(var v=0,w=s.length;v0&&arguments[0]!==void 0?arguments[0]:"append",f=document.body?"body":"documentElement",v="".concat(s,"Child");r.HTMLNode[v](r.DS.Selector.HTMLNode),document[f][v](r.HTMLNode)}),c(this,"updatePos",function(){r._rect=null;var s=r.DS.Area.rect,f=r.DS.Area.computedBorder,v=r.HTMLNode.style,w="".concat(s.top+f.top,"px"),x="".concat(s.left+f.left,"px"),A="".concat(s.width,"px"),z="".concat(s.height,"px");v.top!==w&&(v.top=w),v.left!==x&&(v.left=x),v.width!==A&&(v.width=A),v.height!==z&&(v.height=z)}),c(this,"stop",function(s){r.stopAutoScroll(),s&&r.applyElements("remove")}),c(this,"startAutoScroll",function(){r.currentEdges=[],r._scrollInterval=setInterval(function(){return r.handleAutoScroll()},16)}),c(this,"handleAutoScroll",function(){if(!r.DS.continue){var s=r.DS,f=s.stores.PointerStore,v=s.Area;r.currentEdges=wn({elementRect:O(f.currentVal),containerRect:r.rect,tolerance:r.DS.stores.SettingsStore.s.overflowTolerance}),r.currentEdges.length&&v.scroll(r.currentEdges,r.DS.stores.SettingsStore.s.autoScrollSpeed)}}),c(this,"stopAutoScroll",function(){r.currentEdges=[],clearInterval(r._scrollInterval)}),c(this,"isInside",function(s,f){return r.DS.Area.HTMLNode.contains(s)&&r.DS.stores.ScrollStore.canScroll?!0:Re(r.rect,f||s.getBoundingClientRect())}),this.DS=g,this.HTMLNode=gt(),this.DS.subscribe("Settings:updated:selectorAreaClass",function(s){var f=s.settings;r.HTMLNode.classList.remove(f["selectorAreaClass:pre"]),r.HTMLNode.classList.add(f.selectorAreaClass)}),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){r.updatePos(),r.stopAutoScroll()})}return p(d,[{key:"isClicked",value:function(r){var g=this.DS.stores.PointerStore,s=r?g.getPointerPosition(r):g.initialVal;return Re({left:s.x,top:s.y,right:s.x,bottom:s.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),d}(),Jd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_currentValues",new Set),c(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),c(this,"init",function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)}),c(this,"keydown",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:s,key:f}),r._currentValues.add(f),r.DS.publish("KeyStore:down",{event:s,key:f})}),c(this,"keyup",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:s,key:f}),r._currentValues.delete(f),r.DS.publish("KeyStore:up",{event:s,key:f})}),c(this,"stop",function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()}),c(this,"reset",function(){return r._currentValues.clear()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init)}return p(d,[{key:"isMultiSelectKeyPressed",value:function(r){var g=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var s=this.DS.stores.SettingsStore.s.multiSelectKeys.map(function(f){return f.toLocaleLowerCase()});return!!(this.currentValues.some(function(f){return s.includes(f.toLocaleLowerCase())})||r&&s.some(function(f){return r[g._keyMapping[f]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),d}(),Qd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_isMouseInteraction",!1),c(this,"_initialValArea",void 0),c(this,"_currentValArea",void 0),c(this,"_lastValArea",void 0),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_lastVal",void 0),c(this,"_lastTouch",void 0),c(this,"init",function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})}),c(this,"getPointerPosition",function(s){return Cd({event:r._normalizedEvent(s)})}),c(this,"update",function(s){s&&(r.DS.publish("PointerStore:updated:pre",{event:s}),r.currentVal=r.getPointerPosition(s),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:s}))}),c(this,"stop",function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout(function(){return r._isMouseInteraction=!1},100)}),c(this,"reset",function(s){s&&(r.currentVal=r.lastVal=r.getPointerPosition(s),r.stop(),r.init())}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:end",function(s){var f=s.event;return r.reset(f)})}return p(d,[{key:"start",value:function(r){r&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(r))}},{key:"_normalizedEvent",value:function(r){return"touches"in r&&r.type!=="touchend"&&(this._lastTouch=r),"touches"in r?this._lastTouch.touches[0]:r}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(r){this._initialVal=r,this._initialValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(r){this._currentVal=r,this._currentValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(r){this._lastVal=r,this._lastValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}}]),d}(),eh=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_canScroll",void 0),c(this,"init",function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"start",function(){r._currentVal=r._initialVal=bt(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"update",function(){return r._currentVal=bt(r.DS.stores.SettingsStore.s.area)}),c(this,"stop",function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null}),c(this,"reset",function(){r.stop(),r.start()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return r.start()}),this.DS.subscribe("Interaction:end",function(){return r.reset()})}return p(d,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=pt(this.DS.stores.SettingsStore.s.area)}},{key:"scrollAmount",get:function(){var r=V(this.currentVal,"-",this.initialVal),g=ce(this.DS.stores.SettingsStore.s.zoom),s=V(V(r,"*",g),"-",r);return{x:r.x+s.x,y:r.y+s.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=bt(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),d}(),th=p(function d(h){var r=this,g=h.DS,s=h.settings;a(this,d),c(this,"_settings",{}),c(this,"s",{}),c(this,"update",function(f){var v=f.settings,w=f.init;return r.DS.publish("Settings:updated:pre",l({settings:v},w?{init:w}:{}))}),c(this,"_update",function(f){for(var v=f.settings,w=f.init,x=Od(v,w),A=function(){var he,be=R(G[z],2),Z=be[0],oe=be[1];Z in r._settings||Object.defineProperty(r.s,Z,{get:function(){return r._settings[Z]},set:function(rt){return r.update({settings:c({},Z,rt)})}}),r._settings["".concat(Z,":pre")]=r._settings[Z],r._settings[Z]=oe;var tt={settings:(he={},c(he,Z,r._settings[Z]),c(he,"".concat(Z,":pre"),r._settings["".concat(Z,":pre")]),he)};r.DS.publish("Settings:updated",tt),r.DS.publish("Settings:updated:".concat(Z),tt)},z=0,G=Object.entries(x);z0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(r),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),r&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ne(r)),s||this.addSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ne(r)),s&&this.removeSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(r){var g=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ne(r).forEach(function(v){return g.SelectedSet.has(v)?g.removeSelection(r,s,f):g.addSelection(r,s,f)}),s&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(r,g,s),this.getSelection()}},{key:"clearSelection",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),r&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(r,g,s){var f=Ne(r);return this.SelectableSet.addAll(f),g&&this.SelectedSet.addAll(f),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}},{key:"setSelectables",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(r,g),this.addSelectables(r,s)}},{key:"removeSelectables",value:function(r,g,s){return this.SelectableSet.deleteAll(Ne(r)),g&&this.removeSelection(r),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}}]),d}();return En.isCollision=Re,En})})(or);var co=or.exports;const ho=lo(co),ir=(n,t,o,i,l)=>(t=Math,o=t.log,i=1024,l=o(n)/o(i)|0,n/t.pow(i,l)).toFixed(0)+" "+(l?"KMGTPEZY"[--l]+"iB":"B"),sr=(n,t=null)=>new Date(n*1e3).toLocaleString(t??navigator.language??"en-US"),uo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},fo=[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)],mo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},po=[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)],it=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(n){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[n.direction=="down"?(e.openBlock(),e.createElementBlock("svg",uo,fo)):e.createCommentVNode("",!0),n.direction=="up"?(e.openBlock(),e.createElementBlock("svg",mo,po)):e.createCommentVNode("",!0)]))}}),go=["onClick"],yo=Object.assign({name:"VFToast.vue"},{setup(n){const t=e.inject("emitter"),{getStore:o}=e.inject("storage"),i=e.ref(o("full-screen",!1)),l=c=>c=="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",a=e.ref([]),u=c=>{a.value.splice(c,1)},p=c=>{let y=a.value.findIndex(m=>m.id===c);y!==-1&&u(y)};return t.on("vf-toast-clear",()=>{a.value=[]}),t.on("vf-toast-push",c=>{let y=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");c.id=y,a.value.push(c),setTimeout(()=>{p(y)},5e3)}),(c,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([i.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(a.value,(m,b)=>(e.openBlock(),e.createElementBlock("div",{onClick:S=>u(b),key:m,class:e.normalizeClass([l(m.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(m.label),11,go))),128))]),_:1})],2))}}),Ce=n=>Object.entries(n).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:bo}=ue(),_t=(n,t)=>bo.value+"?"+Ce({q:"preview",adapter:n,path:t}),we=typeof window<"u",ar=we&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),lr=we&&"IntersectionObserver"in window,cr=we&&"classList"in document.createElement("p"),dr=we&&window.devicePixelRatio>1,vo={elements_selector:".lazy",container:ar||we?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},hr=n=>Object.assign({},vo,n),ur=function(n,t){let o;const i="LazyLoad::Initialized",l=new n(t);try{o=new CustomEvent(i,{detail:{instance:l}})}catch{o=document.createEvent("CustomEvent"),o.initCustomEvent(i,!1,!1,{instance:l})}window.dispatchEvent(o)},So=(n,t)=>{if(t)if(!t.length)ur(n,t);else for(let o=0,i;i=t[o];o+=1)ur(n,i)},Se="src",kt="srcset",xt="sizes",fr="poster",He="llOriginalAttrs",mr="data",Dt="loading",pr="loaded",gr="applied",wo="entered",Et="error",yr="native",br="data-",vr="ll-status",J=(n,t)=>n.getAttribute(br+t),_o=(n,t,o)=>{var i=br+t;if(o===null){n.removeAttribute(i);return}n.setAttribute(i,o)},Fe=n=>J(n,vr),Ve=(n,t)=>_o(n,vr,t),st=n=>Ve(n,null),Nt=n=>Fe(n)===null,ko=n=>Fe(n)===Dt,xo=n=>Fe(n)===Et,Ct=n=>Fe(n)===yr,Do=[Dt,pr,gr,Et],Eo=n=>Do.indexOf(Fe(n))>=0,_e=(n,t,o,i)=>{if(n){if(i!==void 0){n(t,o,i);return}if(o!==void 0){n(t,o);return}n(t)}},Ae=(n,t)=>{if(cr){n.classList.add(t);return}n.className+=(n.className?" ":"")+t},fe=(n,t)=>{if(cr){n.classList.remove(t);return}n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},No=n=>{n.llTempImage=document.createElement("IMG")},Co=n=>{delete n.llTempImage},Sr=n=>n.llTempImage,at=(n,t)=>{if(!t)return;const o=t._observer;o&&o.unobserve(n)},Vo=n=>{n.disconnect()},Mo=(n,t,o)=>{t.unobserve_entered&&at(n,o)},Vt=(n,t)=>{n&&(n.loadingCount+=t)},To=n=>{n&&(n.toLoadCount-=1)},wr=(n,t)=>{n&&(n.toLoadCount=t)},Bo=n=>n.loadingCount>0,$o=n=>n.toLoadCount>0,_r=n=>{let t=[];for(let o=0,i;i=n.children[o];o+=1)i.tagName==="SOURCE"&&t.push(i);return t},Mt=(n,t)=>{const o=n.parentNode;if(!o||o.tagName!=="PICTURE")return;_r(o).forEach(t)},kr=(n,t)=>{_r(n).forEach(t)},lt=[Se],xr=[Se,fr],Ue=[Se,kt,xt],Dr=[mr],ct=n=>!!n[He],Er=n=>n[He],Nr=n=>delete n[He],Ie=(n,t)=>{if(ct(n))return;const o={};t.forEach(i=>{o[i]=n.getAttribute(i)}),n[He]=o},Ao=n=>{ct(n)||(n[He]={backgroundImage:n.style.backgroundImage})},Io=(n,t,o)=>{if(!o){n.removeAttribute(t);return}n.setAttribute(t,o)},Me=(n,t)=>{if(!ct(n))return;const o=Er(n);t.forEach(i=>{Io(n,i,o[i])})},Lo=n=>{if(!ct(n))return;const t=Er(n);n.style.backgroundImage=t.backgroundImage},Cr=(n,t,o)=>{Ae(n,t.class_applied),Ve(n,gr),o&&(t.unobserve_completed&&at(n,t),_e(t.callback_applied,n,o))},Vr=(n,t,o)=>{Ae(n,t.class_loading),Ve(n,Dt),o&&(Vt(o,1),_e(t.callback_loading,n,o))},ke=(n,t,o)=>{o&&n.setAttribute(t,o)},Mr=(n,t)=>{ke(n,xt,J(n,t.data_sizes)),ke(n,kt,J(n,t.data_srcset)),ke(n,Se,J(n,t.data_src))},Oo=(n,t)=>{Mt(n,o=>{Ie(o,Ue),Mr(o,t)}),Ie(n,Ue),Mr(n,t)},jo=(n,t)=>{Ie(n,lt),ke(n,Se,J(n,t.data_src))},Po=(n,t)=>{kr(n,o=>{Ie(o,lt),ke(o,Se,J(o,t.data_src))}),Ie(n,xr),ke(n,fr,J(n,t.data_poster)),ke(n,Se,J(n,t.data_src)),n.load()},zo=(n,t)=>{Ie(n,Dr),ke(n,mr,J(n,t.data_src))},Ro=(n,t,o)=>{const i=J(n,t.data_bg),l=J(n,t.data_bg_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=`url("${a}")`,Sr(n).setAttribute(Se,a),Vr(n,t,o))},Ho=(n,t,o)=>{const i=J(n,t.data_bg_multi),l=J(n,t.data_bg_multi_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=a,Cr(n,t,o))},Fo=(n,t,o)=>{const i=J(n,t.data_bg_set);if(!i)return;const l=i.split("|");let a=l.map(u=>`image-set(${u})`);n.style.backgroundImage=a.join(),n.style.backgroundImage===""&&(a=l.map(u=>`-webkit-image-set(${u})`),n.style.backgroundImage=a.join()),Cr(n,t,o)},Tr={IMG:Oo,IFRAME:jo,VIDEO:Po,OBJECT:zo},Uo=(n,t)=>{const o=Tr[n.tagName];o&&o(n,t)},Yo=(n,t,o)=>{const i=Tr[n.tagName];i&&(i(n,t),Vr(n,t,o))},Ko=["IMG","IFRAME","VIDEO","OBJECT"],Wo=n=>Ko.indexOf(n.tagName)>-1,Br=(n,t)=>{t&&!Bo(t)&&!$o(t)&&_e(n.callback_finish,t)},$r=(n,t,o)=>{n.addEventListener(t,o),n.llEvLisnrs[t]=o},Xo=(n,t,o)=>{n.removeEventListener(t,o)},Tt=n=>!!n.llEvLisnrs,Zo=(n,t,o)=>{Tt(n)||(n.llEvLisnrs={});const i=n.tagName==="VIDEO"?"loadeddata":"load";$r(n,i,t),$r(n,"error",o)},Bt=n=>{if(!Tt(n))return;const t=n.llEvLisnrs;for(let o in t){const i=t[o];Xo(n,o,i)}delete n.llEvLisnrs},Ar=(n,t,o)=>{Co(n),Vt(o,-1),To(o),fe(n,t.class_loading),t.unobserve_completed&&at(n,o)},qo=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_loaded),Ve(t,pr),_e(o.callback_loaded,t,i),l||Br(o,i)},Go=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_error),Ve(t,Et),_e(o.callback_error,t,i),o.restore_on_error&&Me(t,Ue),l||Br(o,i)},$t=(n,t,o)=>{const i=Sr(n)||n;if(Tt(i))return;Zo(i,u=>{qo(u,n,t,o),Bt(i)},u=>{Go(u,n,t,o),Bt(i)})},Jo=(n,t,o)=>{No(n),$t(n,t,o),Ao(n),Ro(n,t,o),Ho(n,t,o),Fo(n,t,o)},Qo=(n,t,o)=>{$t(n,t,o),Yo(n,t,o)},At=(n,t,o)=>{Wo(n)?Qo(n,t,o):Jo(n,t,o)},ei=(n,t,o)=>{n.setAttribute("loading","lazy"),$t(n,t,o),Uo(n,t),Ve(n,yr)},Ir=n=>{n.removeAttribute(Se),n.removeAttribute(kt),n.removeAttribute(xt)},ti=n=>{Mt(n,t=>{Ir(t)}),Ir(n)},Lr=n=>{Mt(n,t=>{Me(t,Ue)}),Me(n,Ue)},ri={IMG:Lr,IFRAME:n=>{Me(n,lt)},VIDEO:n=>{kr(n,t=>{Me(t,lt)}),Me(n,xr),n.load()},OBJECT:n=>{Me(n,Dr)}},ni=n=>{const t=ri[n.tagName];if(!t){Lo(n);return}t(n)},oi=(n,t)=>{Nt(n)||Ct(n)||(fe(n,t.class_entered),fe(n,t.class_exited),fe(n,t.class_applied),fe(n,t.class_loading),fe(n,t.class_loaded),fe(n,t.class_error))},ii=(n,t)=>{ni(n),oi(n,t),st(n),Nr(n)},si=(n,t,o,i)=>{o.cancel_on_exit&&ko(n)&&n.tagName==="IMG"&&(Bt(n),ti(n),Lr(n),fe(n,o.class_loading),Vt(i,-1),st(n),_e(o.callback_cancel,n,t,i))},ai=(n,t,o,i)=>{const l=Eo(n);Ve(n,wo),Ae(n,o.class_entered),fe(n,o.class_exited),Mo(n,o,i),_e(o.callback_enter,n,t,i),!l&&At(n,o,i)},li=(n,t,o,i)=>{Nt(n)||(Ae(n,o.class_exited),si(n,t,o,i),_e(o.callback_exit,n,t,i))},ci=["IMG","IFRAME","VIDEO"],Or=n=>n.use_native&&"loading"in HTMLImageElement.prototype,di=(n,t,o)=>{n.forEach(i=>{ci.indexOf(i.tagName)!==-1&&ei(i,t,o)}),wr(o,0)},hi=n=>n.isIntersecting||n.intersectionRatio>0,ui=n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}),fi=(n,t,o)=>{n.forEach(i=>hi(i)?ai(i.target,i,t,o):li(i.target,i,t,o))},mi=(n,t)=>{t.forEach(o=>{n.observe(o)})},pi=(n,t)=>{Vo(n),mi(n,t)},gi=(n,t)=>{!lr||Or(n)||(t._observer=new IntersectionObserver(o=>{fi(o,n,t)},ui(n)))},jr=n=>Array.prototype.slice.call(n),dt=n=>n.container.querySelectorAll(n.elements_selector),yi=n=>jr(n).filter(Nt),bi=n=>xo(n),vi=n=>jr(n).filter(bi),Pr=(n,t)=>yi(n||dt(t)),Si=(n,t)=>{vi(dt(n)).forEach(i=>{fe(i,n.class_error),st(i)}),t.update()},wi=(n,t)=>{we&&(t._onlineHandler=()=>{Si(n,t)},window.addEventListener("online",t._onlineHandler))},_i=n=>{we&&window.removeEventListener("online",n._onlineHandler)},Ye=function(n,t){const o=hr(n);this._settings=o,this.loadingCount=0,gi(o,this),wi(o,this),this.update(t)};Ye.prototype={update:function(n){const t=this._settings,o=Pr(n,t);if(wr(this,o.length),ar||!lr){this.loadAll(o);return}if(Or(t)){di(o,t,this);return}pi(this._observer,o)},destroy:function(){this._observer&&this._observer.disconnect(),_i(this),dt(this._settings).forEach(n=>{Nr(n)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(n){const t=this._settings;Pr(n,t).forEach(i=>{at(i,this),At(i,t,this)})},restoreAll:function(){const n=this._settings;dt(n).forEach(t=>{ii(t,n)})}},Ye.load=(n,t)=>{const o=hr(t);At(n,o)},Ye.resetStatus=n=>{st(n)},we&&So(Ye,window.lazyLoadOptions);const ki={class:"relative flex-auto flex flex-col overflow-hidden"},xi={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Di={class:"absolute"},Ei=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),Ni={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"},Ci=["onDblclick","onContextmenu","data-type","data-item","data-index"],Vi={class:"grid grid-cols-12 items-center"},Mi={class:"flex col-span-7 items-center"},Ti={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"},Bi=[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)],$i={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"},Ai=[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)],Ii={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Li={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Oi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],ji={class:"grid grid-cols-12 items-center"},Pi={class:"flex col-span-7 items-center"},zi={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"},Ri=[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)],Hi={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"},Fi=[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)],Ui={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Yi={class:"col-span-2 text-center"},Ki={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Wi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Xi={class:"relative"},Zi={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"},qi=[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)],Gi=["data-src","alt"],Ji={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"},Qi=[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)],es={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},ts={class:"break-all"},rs=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(n){const t=n,o=e.inject("emitter"),{setStore:i,getStore:l}=e.inject("storage"),a=e.inject("adapter"),u=C=>C==null?void 0:C.substring(0,3),p=C=>C.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),c=e.ref(null),y=e.ref(null),m=e.ref(0),b=e.ref(null),{t:S}=e.inject("i18n"),E=Math.floor(Math.random()*2**32),_=e.ref(l("full-screen",!1)),N=new Ye;o.on("vf-fullscreen-toggle",()=>{c.value.style.height=null,_.value=!_.value,i("full-screen",_.value)});const D=e.ref("");o.on("vf-search-query",({newQuery:C})=>{D.value=C,C?o.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:C},onSuccess:B=>{B.files.length||o.emit("vf-toast-push",{label:S("No search result found.")})}}):o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let L=null;const $=()=>{L&&clearTimeout(L)},T=e.ref(!0),I=C=>{C.touches.length>1&&(T.value?(b.value.stop(),o.emit("vf-toast-push",{label:S("Drag&Drop: off")})):(b.value.start(),o.emit("vf-toast-push",{label:S("Drag&Drop: on")}),o.emit("vf-explorer-update")),T.value=!T.value)},R=C=>{L=setTimeout(()=>{const B=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:C.target.getBoundingClientRect().x,clientY:C.target.getBoundingClientRect().y});C.target.dispatchEvent(B)},500)},k=C=>{C.type=="dir"?(o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:C.path}})):o.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:C})},M=e.reactive({active:!1,column:"",order:""}),H=(C=!0)=>{let B=[...t.data.files],V=M.column,Y=M.order=="asc"?1:-1;if(!C)return B;const O=(ce,ae)=>typeof ce=="string"&&typeof ae=="string"?ce.toLowerCase().localeCompare(ae.toLowerCase()):ceae?1:0;return M.active&&(B=B.slice().sort((ce,ae)=>O(ce[V],ae[V])*Y)),B},X=C=>{M.active&&M.column==C?(M.active=M.order=="asc",M.column=C,M.order="desc"):(M.active=!0,M.column=C,M.order="asc")},W=()=>b.value.getSelection().map(C=>JSON.parse(C.dataset.item)),te=(C,B)=>{if(C.altKey||C.ctrlKey||C.metaKey)return C.preventDefault(),!1;C.dataTransfer.setDragImage(y.value,0,15),C.dataTransfer.effectAllowed="all",C.dataTransfer.dropEffect="copy",C.dataTransfer.setData("items",JSON.stringify(W()))},se=(C,B)=>{C.preventDefault();let V=JSON.parse(C.dataTransfer.getData("items"));if(V.find(Y=>Y.storage!=a.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:V,to:B}})},ne=(C,B)=>{C.preventDefault(),!B||B.type!=="dir"||b.value.getSelection().find(V=>V==C.currentTarget)?(C.dataTransfer.dropEffect="none",C.dataTransfer.effectAllowed="none"):C.dataTransfer.dropEffect="copy"},re=()=>{b.value=new ho({area:c.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),o.on("vf-explorer-update",()=>e.nextTick(()=>{b.value.clearSelection(),b.value.setSelectables(document.getElementsByClassName("vf-item-"+E))})),b.value.subscribe("predragstart",({event:C,isDragging:B})=>{if(B)m.value=b.value.getSelection().length,b.value.break();else{const V=C.target.offsetWidth-C.offsetX,Y=C.target.offsetHeight-C.offsetY;V<15&&Y<15&&(b.value.clearSelection(),b.value.break())}}),b.value.subscribe("predragmove",({isDragging:C})=>{C&&b.value.break()}),b.value.subscribe("callback",({items:C,event:B,isDragging:V})=>{o.emit("vf-nodes-selected",W()),m.value=b.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{b.value.Area.reset(),b.value.SelectorArea.updatePos(),N.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>o.emit("vf-explorer-update"))}),(C,B)=>(e.openBlock(),e.createElementBlock("div",ki,[n.view=="list"||D.value.length?(e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("div",{onClick:B[0]||(B[0]=V=>X("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(S)("Name"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="basename"]])]),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:B[1]||(B[1]=V=>X("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(S)("Size"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="file_size"]])])),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:B[2]||(B[2]=V=>X("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(S)("Date"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="last_modified"]])])),D.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:B[3]||(B[3]=V=>X("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(S)("Filepath"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("div",{ref_key:"dragImage",ref:y,class:"absolute -z-50 -top-96"},[Ei,e.createElementVNode("div",Ni,e.toDisplayString(m.value),1)],512)]),e.createElementVNode("div",{onTouchstart:I,onContextmenu:B[10]||(B[10]=e.withModifiers(V=>e.unref(o).emit("vf-contextmenu-show",{event:V,area:c.value,items:W()}),["self","prevent"])),class:e.normalizeClass([_.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:c},[D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:O=>k(V),onTouchstart:B[4]||(B[4]=O=>R(O)),onTouchend:B[5]||(B[5]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Mi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ti,Bi)):(e.openBlock(),e.createElementBlock("svg",$i,Ai)),e.createElementVNode("span",Ii,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Li,e.toDisplayString(V.path),1)])],42,Ci))),256)):e.createCommentVNode("",!0),n.view=="list"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[6]||(B[6]=O=>R(O)),onTouchend:B[7]||(B[7]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",ji,[e.createElementVNode("div",Pi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",zi,Ri)):(e.openBlock(),e.createElementBlock("svg",Hi,Fi)),e.createElementVNode("span",Ui,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Yi,e.toDisplayString(V.file_size?e.unref(ir)(V.file_size):""),1),e.createElementVNode("div",Ki,e.toDisplayString(e.unref(sr)(V.last_modified)),1)])],42,Oi))),256)):e.createCommentVNode("",!0),n.view=="grid"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H(!1),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[8]||(B[8]=O=>R(O)),onTouchend:B[9]||(B[9]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"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":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",null,[e.createElementVNode("div",Xi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Zi,qi)):(V.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)(e.unref(a).value,V.path),alt:V.basename},null,8,Gi)):(e.openBlock(),e.createElementBlock("svg",Ji,Qi)),!(V.mime_type??"").startsWith("image")&&V.type!="dir"?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(u(V.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ts,e.toDisplayString(p(V.basename)),1)])],42,Wi))),256)):e.createCommentVNode("",!0)],34),e.createVNode(yo)]))}}),ns="1.2.5",os={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},is={class:"flex leading-5 items-center"},ss=["aria-label"],as=[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)],ls=["value"],cs={class:"ml-3"},ds={key:0},hs={class:"ml-1"},us={class:"flex leading-5 items-center"},fs={value:"",disabled:""},ms=e.createStaticVNode('',7),ps=["aria-label"],gs=[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)],ys=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),{getStore:o,setStore:i}=e.inject("storage"),l=e.ref(0),a=e.inject("adapter"),{t:u,changeLocale:p}=e.inject("i18n"),c=e.ref(o("locale","")),y=()=>{t.emit("vf-search-exit"),t.emit("vf-fetch",{params:{q:"index",adapter:a.value}}),i("adapter",a.value)};t.on("vf-nodes-selected",b=>{l.value=b.length});const m=e.ref("");return t.on("vf-search-query",({newQuery:b})=>{m.value=b}),(b,S)=>(e.openBlock(),e.createElementBlock("div",os,[e.createElementVNode("div",is,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(u)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},as,8,ss),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=E=>e.isRef(a)?a.value=E:null),onChange:y,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data.storages,E=>(e.openBlock(),e.createElementBlock("option",{value:E},e.toDisplayString(E),9,ls))),256))],544),[[e.vModelSelect,e.unref(a)]]),e.createElementVNode("div",cs,[m.value.length?(e.openBlock(),e.createElementBlock("span",ds,e.toDisplayString(n.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",hs,e.toDisplayString(l.value>0?l.value+" "+e.unref(u)("item(s) selected."):""),1)])]),e.createElementVNode("div",us,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=E=>c.value=E),onChange:S[2]||(S[2]=E=>e.unref(p)(E.target.value)),class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8 mr-3"},[e.createElementVNode("option",fs,e.toDisplayString(e.unref(u)("Language")),1),ms],544),[[e.vModelSelect,c.value]]),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(u)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=E=>e.unref(t).emit("vf-modal-show",{type:"message",title:"Vuefinder "+e.unref(ns),message:e.unref(u)("Vuefinder is a file manager component for vue 3.")}))},gs,8,ps)])]))}}),bs=(n,t=0,o=!1)=>{let i;return(...l)=>{o&&!i&&n(...l),clearTimeout(i),i=setTimeout(()=>{n(...l)},t)}},vs=(n,t,o)=>{const i=e.ref(n);return e.customRef((a,u)=>({get(){return a(),i.value},set:bs(p=>{i.value=p,u()},t,o)}))},Ss={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-xs"},ws=["aria-label"],_s=[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)],ks=["aria-label"],xs=[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)],Ds=["aria-label"],Es=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ns=["onClick"],Cs=[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)],Vs={class:"flex leading-5"},Ms=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),Ts=["title","onClick"],Bs={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"},$s=[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),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)],As={key:3,class:"relative flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Is=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),Ls=e.createElementVNode("div",{class:"w-full"},null,-1),Os=["onKeydown","placeholder"],js=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ps=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),l=e.ref(null),a=e.ref([]),u=e.ref(!1),p=e.ref(null),{t:c}=e.inject("i18n"),y=e.inject("loadingState");o.on("vf-explorer-update",()=>{let $=[],T=[];l.value=t.data.dirname??i.value+"://",l.value.length==0&&(a.value=[]),l.value.replace(i.value+"://","").split("/").forEach(function(I){$.push(I),$.join("/")!=""&&T.push({basename:I,name:I,path:i.value+"://"+$.join("/"),type:"dir"})}),T.length>4&&(T=T.slice(-5),T[0].name=".."),a.value=T});const m=()=>{u.value=!1,S.value=""};o.on("vf-search-exit",()=>{m()});const b=()=>{u.value=!0,e.nextTick(()=>p.value.focus())},S=vs("",400),E=()=>y.value;e.watch(S,$=>{o.emit("vf-toast-clear"),o.emit("vf-search-query",{newQuery:$})});const _=()=>a.value.length&&!u.value,N=$=>{$.preventDefault();let T=JSON.parse($.dataTransfer.getData("items"));if(T.find(I=>I.storage!=i.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:T,to:a.value[a.value.length-2]??{path:i.value+"://"}}})},D=$=>{$.preventDefault(),_()?$.dataTransfer.dropEffect="copy":($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none")},L=()=>{S.value==""&&m()};return($,T)=>(e.openBlock(),e.createElementBlock("div",Ss,[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:T[0]||(T[0]=I=>D(I)),onDrop:T[1]||(T[1]=I=>N(I)),onClick:T[2]||(T[2]=I=>{var R;return!_()||e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:((R=a.value[a.value.length-2])==null?void 0:R.path)??e.unref(i)+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",_()?"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"},_s,34))],8,ws),E()?(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:T[4]||(T[4]=I=>e.unref(o).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"},Es))],8,Ds)):(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:T[3]||(T[3]=I=>{e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:n.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"},xs))],8,ks)),u.value?(e.openBlock(),e.createElementBlock("div",As,[Is,Ls,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:p,onKeydown:e.withKeys(m,["esc"]),onBlur:L,"onUpdate:modelValue":T[6]||(T[6]=I=>e.isRef(S)?S.value=I:null),placeholder:e.unref(c)("Search anything.."),class:"absolute ml-4 pt-1 pb-0 px-2 border-0 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,Os),[[e.vModelText,e.unref(S)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:m,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},js))])):(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(b,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[5]||(T[5]=I=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.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"},Cs)),e.createElementVNode("div",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(I,R)=>(e.openBlock(),e.createElementBlock("div",{key:R},[Ms,e.createElementVNode("span",{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:I.basename,onClick:k=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:I.path}})},e.toDisplayString(I.name),9,Ts)]))),128))]),E()?(e.openBlock(),e.createElementBlock("svg",Bs,$s)):e.createCommentVNode("",!0)],8,Ns))]))}}),zs=["onClick"],Rs=e.createElementVNode("span",{class:"px-1"},null,-1),Hs=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(n){const t=n,o=e.inject("emitter"),i=e.ref(null),{apiUrl:l}=ue(),a=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),u=e.ref([]);o.on("vf-context-selected",S=>{u.value=S});const{t:p}=e.inject("i18n"),c={newfolder:{title:()=>p("New Folder"),action:()=>{o.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>p("Delete"),action:()=>{o.emit("vf-modal-show",{type:"delete",items:u})}},refresh:{title:()=>p("Refresh"),action:()=>{o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>p("Preview"),action:()=>{o.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:u.value[0]})}},open:{title:()=>p("Open"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].path}})}},openDir:{title:()=>p("Open containing folder"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].dir}})}},download:{title:()=>p("Download"),action:()=>{const S=l.value+"?"+Ce({q:"download",adapter:t.current.adapter,path:u.value[0].path});o.emit("vf-download",S)}},archive:{title:()=>p("Archive"),action:()=>{o.emit("vf-modal-show",{type:"archive",items:u})}},unarchive:{title:()=>p("Unarchive"),action:()=>{o.emit("vf-modal-show",{type:"unarchive",items:u})}},rename:{title:()=>p("Rename"),action:()=>{o.emit("vf-modal-show",{type:"rename",items:u})}}},y=S=>{o.emit("vf-contextmenu-hide"),S.action()},m=e.ref("");o.on("vf-search-query",({newQuery:S})=>{m.value=S}),o.on("vf-contextmenu-show",({event:S,area:E,items:_,target:N=null})=>{if(a.items=[],m.value)if(N)a.items.push(c.openDir),o.emit("vf-context-selected",[N]);else return;else!N&&!m.value?(a.items.push(c.refresh),a.items.push(c.newfolder),o.emit("vf-context-selected",[])):_.length>1&&_.some(D=>D.path===N.path)?(a.items.push(c.refresh),a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",_)):(N.type=="dir"?a.items.push(c.open):(a.items.push(c.preview),a.items.push(c.download)),a.items.push(c.rename),N.mime_type=="application/zip"?a.items.push(c.unarchive):a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",[N]));b(S,E)}),o.on("vf-contextmenu-hide",()=>{a.active=!1});const b=(S,E)=>{a.active=!0,e.nextTick(()=>{let _=E.getBoundingClientRect(),N=S.pageX,D=S.pageY,L=i.value.offsetHeight,$=i.value.offsetWidth;N=_.right-S.pageX+window.scrollX<$?N-$:N,D=_.bottom-S.pageY+window.scrollYa.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:i,style:e.normalizeStyle(a.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,_=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:_.title,onClick:N=>y(_)},[Rs,e.createElementVNode("span",null,e.toDisplayString(_.title()),1)],8,zs))),128))],4)):e.createCommentVNode("",!0)}}),Fs=(n,t)=>{const o=n[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((i,l)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(l.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function Us(n){const t=await Fs(Object.assign({"../locales/de.json":()=>Promise.resolve().then(()=>wd),"../locales/en.json":()=>Promise.resolve().then(()=>_d),"../locales/fa.json":()=>Promise.resolve().then(()=>kd),"../locales/he.json":()=>Promise.resolve().then(()=>xd),"../locales/ru.json":()=>Promise.resolve().then(()=>Dd),"../locales/tr.json":()=>Promise.resolve().then(()=>Ed)}),`../locales/${n}.json`);return JSON.parse(t.default)}function Ys(n,t,o){const{getStore:i,setStore:l}=wt(n),a=e.ref({}),u=y=>{Us(y).then(m=>{a.value=m,l("locale",y),l("translations",m),o.emit("vf-toast-push",{label:"The language is set to "+y})}).catch(m=>{o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),u("en")})};i("locale")?a.value=i("translations"):u(t);const p=(y,...m)=>m.length?p(y=y.replace("%s",m.shift()),...m):y;function c(y,...m){return a.value.hasOwnProperty(y)?p(a.value[y],...m):p(y,...m)}return{t:c,changeLocale:u}}const Ks={class:"vuefinder"},Ws=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Xs=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},usePropDarkMode:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},postData:{type:Object,default:{}}},setup(n){const t=n,o=Cn(),{setStore:i,getStore:l}=wt(t.id),a=e.ref(l("adapter"));e.provide("emitter",o),e.provide("storage",wt(t.id)),e.provide("postData",t.postData),e.provide("adapter",a),e.provide("maxFileSize",t.maxFileSize),e.provide("usePropDarkMode",t.usePropDarkMode);const u=Ys(t.id,t.locale,o);e.provide("i18n",u);const{apiUrl:p,setApiUrl:c}=ue();c(t.url);const y=e.reactive({adapter:a.value,storages:[],dirname:".",files:[]}),m=e.ref(l("viewport","grid")),b=t.usePropDarkMode?e.computed(()=>t.dark):e.ref(l("darkMode",t.dark));o.on("vf-darkMode-toggle",()=>{b.value=!b.value,i("darkMode",b.value)});const S=e.ref(!1);e.provide("loadingState",S);const E=e.ref(l("full-screen",!1));o.on("vf-fullscreen-toggle",()=>{E.value=!E.value,i("full-screen",E.value)}),o.on("vf-view-toggle",L=>{m.value=L});const _=e.reactive({active:!1,type:"delete",data:{}});o.on("vf-modal-close",()=>{_.active=!1}),o.on("vf-modal-show",L=>{_.active=!0,_.type=L.type,_.data=L});const N=L=>{Object.assign(y,L),o.emit("vf-nodes-selected",{}),o.emit("vf-explorer-update")};let D;return o.on("vf-fetch-abort",()=>{D.abort(),S.value=!1}),o.on("vf-fetch",({params:L,onSuccess:$=null,onError:T=null})=>{["index","search"].includes(L.q)&&(D&&D.abort(),S.value=!0),D=new AbortController;const I=D.signal;ot(p.value,{params:L,signal:I}).then(R=>{a.value=R.adapter,["index","search"].includes(L.q)&&(S.value=!1),o.emit("vf-modal-close"),N(R),$(R)}).catch(R=>{T&&T(R)}).finally(()=>{})}),o.on("vf-download",L=>{document.getElementById("download_frame").src=L,o.emit("vf-modal-close")}),e.onMounted(()=>{o.emit("vf-fetch",{params:{q:"index",adapter:a.value}})}),(L,$)=>(e.openBlock(),e.createElementBlock("div",Ks,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b)?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([E.value?"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.value?"":"max-height: "+n.maxHeight),onMousedown:$[0]||($[0]=T=>e.unref(o).emit("vf-contextmenu-hide")),onTouchstart:$[1]||($[1]=T=>e.unref(o).emit("vf-contextmenu-hide"))},[e.createVNode(so,{data:y},null,8,["data"]),e.createVNode(Ps,{data:y},null,8,["data"]),e.createVNode(rs,{view:m.value,data:y},null,8,["view","data"]),e.createVNode(ys,{data:y},null,8,["data"])],38),_.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+_.type),{key:0,selection:_.data,current:y},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Hs,{current:y},null,8,["current"]),Ws],2)]))}}),Zs=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),qs={class:"fixed z-10 inset-0 overflow-hidden"},Gs={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"},Js={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qs={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"},me={__name:"ModalLayout",setup(n){const t=e.inject("emitter");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:i[1]||(i[1]=e.withKeys(l=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Zs,e.createElementVNode("div",qs,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:i[0]||(i[0]=e.withModifiers(l=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Gs,[e.createElementVNode("div",Js,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Qs,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},ea=["aria-label"],ta=[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)],pe=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(n,{emit:t}){var p;const{t:o}=e.inject("i18n"),i=e.ref(!1),l=e.ref(null),a=e.ref((p=l.value)==null?void 0:p.strMessage);e.watch(a,()=>i.value=!1);const u=()=>{t("hidden"),i.value=!0};return(c,y)=>(e.openBlock(),e.createElementBlock("div",null,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:l,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",n.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(c.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:u,"aria-label":e.unref(o)("Close"),"data-microtip-position":"top-left",role:"tooltip"},ta,8,ea)],2))]))}}),ra={class:"sm:flex sm:items-start"},na=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),oa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ia={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},sa={class:"mt-2"},aa={class:"text-sm text-gray-500"},la={class:"flex text-sm text-gray-800 dark:text-gray-400"},ca={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"},da=[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)],ha={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"},ua=[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)],fa={class:"ml-1.5"},ma={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},pa=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(t.selection.items),u=e.ref(""),p=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"delete",adapter:i.value,path:t.current.dirname,items:JSON.stringify(a.value.map(({path:c,type:y})=>({path:c,type:y})))},onSuccess:()=>{o.emit("vf-toast-push",{label:l("Files deleted.")})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:y[1]||(y[1]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1),e.createElementVNode("div",ma,e.toDisplayString(e.unref(l)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ra,[na,e.createElementVNode("div",oa,[e.createElementVNode("h3",ia,e.toDisplayString(e.unref(l)("Delete files")),1),e.createElementVNode("div",sa,[e.createElementVNode("p",aa,e.toDisplayString(e.unref(l)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("p",la,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",ca,da)):(e.openBlock(),e.createElementBlock("svg",ha,ua)),e.createElementVNode("span",fa,e.toDisplayString(m.basename),1)]))),256)),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[0]||(y[0]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ga={class:"sm:flex sm:items-start"},ya=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),ba={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},va={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Sa={class:"mt-2"},wa={class:"text-sm text-gray-500"},_a=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(n){const t=e.inject("emitter"),{t:o}=e.inject("i18n");return(i,l)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l[0]||(l[0]=a=>e.unref(t).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var a,u;return[e.createElementVNode("div",ga,[ya,e.createElementVNode("div",ba,[e.createElementVNode("h3",va,e.toDisplayString(((a=n.selection)==null?void 0:a.title)??"Title"),1),e.createElementVNode("div",Sa,[e.createElementVNode("p",wa,e.toDisplayString(((u=n.selection)==null?void 0:u.message)??"Message")+".",1)])])])]}),_:1}))}}),ka={class:"sm:flex sm:items-start"},xa=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),Da={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ea={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Na={class:"mt-2"},Ca={class:"text-sm text-gray-500"},Va=["onKeyup","placeholder"],Ma=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfolder",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ka,[xa,e.createElementVNode("div",Da,[e.createElementVNode("h3",Ea,e.toDisplayString(e.unref(l)("New Folder")),1),e.createElementVNode("div",Na,[e.createElementVNode("p",Ca,e.toDisplayString(e.unref(l)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["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(l)("Folder Name"),type:"text"},null,40,Va),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ta={class:"sm:flex sm:items-start"},Ba=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),$a={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Aa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ia={class:"mt-2"},La={class:"text-sm text-gray-500"},Oa=["onKeyup","placeholder"],ja=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfile",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ta,[Ba,e.createElementVNode("div",$a,[e.createElementVNode("h3",Aa,e.toDisplayString(e.unref(l)("New File")),1),e.createElementVNode("div",Ia,[e.createElementVNode("p",La,e.toDisplayString(e.unref(l)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["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(l)("File Name"),type:"text"},null,40,Oa),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Pa={class:"flex"},za=["aria-label"],Ra={class:"ml-auto mb-2"},Ha={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"},Fa={key:1},Ua={__name:"Text",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,i=e.ref(""),l=e.ref(""),a=e.ref(null),u=e.ref(!1),{apiUrl:p}=ue(),c=e.ref(""),y=e.ref(!1),{t:m}=e.inject("i18n");e.onMounted(()=>{ot(p.value,{params:{q:"preview",adapter:o.selection.adapter,path:o.selection.item.path},json:!1}).then(_=>{i.value=_,t("load")})});const b=()=>{u.value=!u.value,l.value=i.value,u.value==!0&&e.nextTick(()=>{a.value.focus()})},S=e.inject("postData"),E=()=>{c.value="",y.value=!1,ot(p.value,{method:"POST",params:Object.assign(S,{q:"save",adapter:o.selection.adapter,path:o.selection.item.path,content:l.value}),json:!1}).then(_=>{c.value=m("Updated."),i.value=_,t("load"),u.value=!u.value}).catch(_=>{c.value=m(_.message),y.value=!0})};return(_,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pa,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,za),e.createElementVNode("div",Ra,[u.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:E,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(m)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:N[0]||(N[0]=D=>b())},e.toDisplayString(u.value?e.unref(m)("Cancel"):e.unref(m)("Edit")),1)])]),e.createElementVNode("div",null,[u.value?(e.openBlock(),e.createElementBlock("div",Fa,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:a,"onUpdate:modelValue":N[1]||(N[1]=D=>l.value=D),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,l.value]])])):(e.openBlock(),e.createElementBlock("pre",Ha,e.toDisplayString(i.value),1)),c.value.length?(e.openBlock(),e.createBlock(pe,{key:2,onHidden:N[2]||(N[2]=D=>c.value=""),error:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},qh="";/*! * Cropper.js v1.5.13 * https://fengyuanchen.github.io/cropperjs * diff --git a/package.json b/package.json index 1b04b221..e541b43c 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuefinder", - "version": "1.2.4", + "version": "1.2.5", "description": "Vuefinder is a file manager component for vuejs.", "type": "module", "files": [ From c6a9e802d707ce4b15971a31b55ecc78baf82437 Mon Sep 17 00:00:00 2001 From: DreamlandOwO <90253151+DreamlandOwO@users.noreply.github.com> Date: Tue, 23 Jan 2024 10:10:55 +0800 Subject: [PATCH 03/22] Request transform support, easy backend integration --- src/components/VueFinder.vue | 13 +++++++++-- src/components/previews/Image.vue | 5 +++- src/components/previews/Text.vue | 6 ++++- src/utils/ajax.js | 39 +++++++++++++++++++++++++++++-- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/src/components/VueFinder.vue b/src/components/VueFinder.vue index ebe606d0..4fc7147e 100644 --- a/src/components/VueFinder.vue +++ b/src/components/VueFinder.vue @@ -69,7 +69,11 @@ const props = defineProps({ postData: { type: Object, default: {} - } + }, + requestTransformer: { + type: Function, + default: null, + }, }); const emitter = mitt(); const {setStore, getStore} = useStorage(props.id); @@ -84,6 +88,7 @@ provide('postData', props.postData); provide('adapter', adapter); provide('maxFileSize', props.maxFileSize); provide('usePropDarkMode', props.usePropDarkMode); +provide('requestTransformer', props.requestTransformer); // Lang Management const i18n = useI18n(props.id, props.locale, emitter); @@ -158,7 +163,11 @@ emitter.on('vf-fetch', ({params, onSuccess = null, onError = null, noCloseModal controller = new AbortController(); const signal = controller.signal; - ajax(apiUrl.value, {params, signal}) + ajax(apiUrl.value, { + params, + signal, + requestTransformer: props.requestTransformer + }) .then(data => { adapter.value = data.adapter; if (['index', 'search'].includes(params.q)) { diff --git a/src/components/previews/Image.vue b/src/components/previews/Image.vue index b216faa8..583ec0dc 100644 --- a/src/components/previews/Image.vue +++ b/src/components/previews/Image.vue @@ -32,6 +32,8 @@ const props = defineProps({ selection: Object }); +const requestTransformer = inject('requestTransformer'); + const {t} = inject('i18n'); const {apiUrl} = useApiUrl(); @@ -74,7 +76,8 @@ const crop = () => { file: blob }), name: props.selection.item.basename, - json: false + json: false, + requestTransformer, }) .then(data => { message.value = t('Updated.'); diff --git a/src/components/previews/Text.vue b/src/components/previews/Text.vue index b2c3e0f3..e26ae060 100644 --- a/src/components/previews/Text.vue +++ b/src/components/previews/Text.vue @@ -42,12 +42,15 @@ const props = defineProps({ const message = ref(''); const isError = ref(false); +const requestTransformer = inject('requestTransformer'); + const {t} = inject('i18n'); onMounted(() => { ajax(apiUrl.value, { params: {q: 'preview', adapter: props.selection.adapter, path: props.selection.item.path}, - json: false + json: false, + requestTransformer }) .then(data => { content.value = data; @@ -80,6 +83,7 @@ const save = () => { content: contentTemp.value }), json: false, + requestTransformer }) .then(data => { message.value = t('Updated.'); diff --git a/src/utils/ajax.js b/src/utils/ajax.js index 05cd94f6..93324e48 100644 --- a/src/utils/ajax.js +++ b/src/utils/ajax.js @@ -1,10 +1,45 @@ export const csrf = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content'); -export default (url, {method = 'get', params = {}, json = true, signal = null}) => { +/** + * @typedef RequestTransformParams + * @property {String} url + * @property {String} method + * @property {*} params + */ +/** + * @typedef RequestTransformResult + * @property {?String} url + * @property {?Object} params + */ +/** + * @callback RequestTransformer + * @param {RequestTransformParams} request + * @returns {RequestTransformResult} + */ +/** + * Requester + * @param {String} url + * @param {Object} config + * @param {String} config.method + * @param {?Object} config.params + * @param {?Boolean} config.json + * @param {?AbortSignal} config.signal + * @param {?RequestTransformer} config.requestTransformer + */ +export default (url, { method = 'get', params = {}, json = true, signal = null, requestTransformer = null }) => { + if (requestTransformer != null) { + const transformResult = requestTransformer({ url, method, params: params || {} }); + if (transformResult.url != null) { + url = transformResult.url + } + if (transformResult.params != null) { + params = transformResult.params + } + } const init = {method: method}; init.signal = signal; - if (method == 'get') { + if (method === 'get') { url += '?' + new URLSearchParams(params); } else { init.headers = {}; From c106fd03fc6f8044b3dc8a7d58abc17e8290c9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C3=96zdemir?= Date: Tue, 23 Jan 2024 20:27:43 +0300 Subject: [PATCH 04/22] add select event to main library --- src/components/VueFinder.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/VueFinder.vue b/src/components/VueFinder.vue index f1045e90..2b592a74 100644 --- a/src/components/VueFinder.vue +++ b/src/components/VueFinder.vue @@ -26,7 +26,7 @@ export default { + +// an example how to show selected files, outside of vuefinder +// you can create a ref object and assign the items to it, +// then with a button click, you can get the selected items easily +const handleSelect = (selection) => { + console.log(selection) +} + From 8814ee68a0a84c157e7906dfc3494bb06ab6be78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C3=96zdemir?= Date: Sat, 27 Jan 2024 14:05:43 +0300 Subject: [PATCH 15/22] fix width --- src/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index bf057e67..6d065610 100644 --- a/src/App.vue +++ b/src/App.vue @@ -49,7 +49,7 @@ body { background: #eeeeee; } .wrapper { - width: 800px; + max-width: 800px; margin: 100px auto; } .btn{ From 4a13f57a7eaaf5c319f84017112016b5483a08b8 Mon Sep 17 00:00:00 2001 From: DreamlandOwO <90253151+DreamlandOwO@users.noreply.github.com> Date: Sun, 28 Jan 2024 00:06:48 +0800 Subject: [PATCH 16/22] dev --- src/App.vue | 14 ++++-- src/components/Breadcrumb.vue | 5 +-- src/components/ContextMenu.vue | 4 +- src/components/Statusbar.vue | 6 ++- src/components/Toolbar.vue | 3 +- src/components/VueFinder.vue | 23 ++++++---- src/components/features.js | 3 +- src/components/modals/ModalPreview.vue | 4 +- src/components/previews/Image.vue | 2 +- src/components/previews/Text.vue | 2 +- src/composables/useStorage.js | 9 ++++ src/index.js | 7 +-- src/utils/ajax.js | 61 +++++++++++++------------- 13 files changed, 86 insertions(+), 57 deletions(-) diff --git a/src/App.vue b/src/App.vue index 723459f0..60f46a7c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,8 +2,9 @@
@@ -11,9 +12,13 @@ +const features = [ + ...FEATURE_ALL_NAMES +] +