vuefinder 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- (function(e,Ne){typeof exports=="object"&&typeof module<"u"?module.exports=Ne(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],Ne):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=Ne(e.Vue,e.plupload))})(this,function(e,Ne){"use strict";const qe=(a=>a&&typeof a=="object"&&"default"in a?a:{default:a})(Ne),Ie=(a,{method:t="get",params:r={},json:i=!0})=>{const s={method:t};if(t=="get")a+="?"+new URLSearchParams(r);else{s.headers={};let o=new FormData;for(const[c,m]of Object.entries(r))o.append(c,m);s.body=o}return fetch(a,s).then(o=>o.ok?i?o.json():o.text():Promise.reject(o))};function yr(a){return{all:a=a||new Map,on:function(t,r){var i=a.get(t);i?i.push(r):a.set(t,[r])},off:function(t,r){var i=a.get(t);i&&(r?i.splice(i.indexOf(r)>>>0,1):a.set(t,[]))},emit:function(t,r){var i=a.get(t);i&&i.slice().map(function(s){s(r)}),(i=a.get("*"))&&i.slice().map(function(s){s(t,r)})}}}function Ge(a){let t=localStorage.getItem(a+"_storage");const r=e.ref(JSON.parse(t));e.watch(r,i);function i(){r.value===null||r.value===""?localStorage.removeItem(a+"_storage"):localStorage.setItem(a+"_storage",JSON.stringify(r.value))}function s(m,f){r.value=Object.assign({...r.value},{[m]:f})}function o(){r.value=null}return{getStore:(m,f=null)=>r.value===null||r.value===""?f:r.value.hasOwnProperty(m)?r.value[m]:f,setStore:s,clearStore:o}}const bt=e.ref("");function ce(){function a(t){bt.value=t}return{apiUrl:bt,setApiUrl:a}}const br={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},vr={key:0,class:"flex text-center"},wr=["aria-label"],_r=[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)],kr=["aria-label"],xr=[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)],Sr=["aria-label"],Dr=[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)],Er=["aria-label"],Nr=[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)],Vr=["aria-label"],Cr=[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)],Mr=["aria-label"],$r=[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)],Br=["aria-label"],Tr=[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)],Ar={key:1,class:"flex text-center"},Or={class:"pl-2"},Pr={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},jr={class:"flex text-center items-center justify-end"},Ir=["aria-label"],Lr=[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)],zr=["aria-label"],Rr={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"},Hr={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"},Ur={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"},Kr=["aria-label"],Fr={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"},Yr={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"},Wr=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(a){const t=inject("emitter"),{getStore:r,setStore:i}=inject("storage"),{t:s}=inject("i18n"),o=e.ref(r("viewport","grid")),c=e.ref([]),m=e.ref(r("full-screen",!1)),f=e.ref("");t.on("vf-search-query",({newQuery:u})=>{f.value=u});const p=()=>{m.value=!m.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",u=>{c.value=u}),t.on("vf-view-toggle",u=>{i("viewport",u),o.value=u}),(u,y)=>(e.openBlock(),e.createElementBlock("div",br,[f.value.length?(e.openBlock(),e.createElementBlock("div",Ar,[e.createElementVNode("div",Or,[e.createTextVNode(e.toDisplayString(e.unref(s)("Search results for"))+" ",1),e.createElementVNode("span",Pr,e.toDisplayString(f.value),1)])])):(e.openBlock(),e.createElementBlock("div",vr,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:y[0]||(y[0]=b=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:c.value}))},_r,8,wr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[1]||(y[1]=b=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:c.value}))},xr,8,kr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[2]||(y[2]=b=>c.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},Dr,2))],8,Sr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[3]||(y[3]=b=>!c.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},Nr,2))],8,Er),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[4]||(y[4]=b=>e.unref(t).emit("vf-modal-show",{type:"upload",items:c.value}))},Cr,8,Vr),c.value.length==1&&c.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(s)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[5]||(y[5]=b=>!c.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},$r,2))],8,Mr)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(s)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[6]||(y[6]=b=>!c.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},Tr,2))],8,Br))])),e.createElementVNode("div",jr,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:y[7]||(y[7]=b=>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"},Lr))],8,Ir),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Toggle Full Screen"),"data-microtip-position":"bottom",role:"tooltip",onClick:p},[(e.openBlock(),e.createElementBlock("svg",Rr,[m.value?(e.openBlock(),e.createElementBlock("path",Hr)):(e.openBlock(),e.createElementBlock("path",Ur))]))],8,zr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:y[8]||(y[8]=b=>f.value.length||e.unref(t).emit("vf-view-toggle",o.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([f.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"},[o.value=="grid"?(e.openBlock(),e.createElementBlock("path",Fr)):e.createCommentVNode("",!0),o.value=="list"?(e.openBlock(),e.createElementBlock("path",Yr)):e.createCommentVNode("",!0)],2))],8,Kr)])]))}});var Xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vt={exports:{}};(function(a,t){(function(r,i){a.exports=i()})(Xr,function(){function r(h,l){if(!(h instanceof l))throw new TypeError("Cannot call a class as a function")}function i(h,l){for(var n=0;n<l.length;n++){var g=l[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}function s(h,l,n){return l&&i(h.prototype,l),n&&i(h,n),h}function o(h,l,n){return l in h?Object.defineProperty(h,l,{value:n,enumerable:!0,configurable:!0,writable:!0}):h[l]=n,h}function c(h,l){var n=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);l&&(g=g.filter(function(d){return Object.getOwnPropertyDescriptor(h,d).enumerable})),n.push.apply(n,g)}return n}function m(h){for(var l=1;l<arguments.length;l++){var n=arguments[l]!=null?arguments[l]:{};l%2?c(Object(n),!0).forEach(function(g){o(h,g,n[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(n,g))})}return h}function f(h,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(l&&l.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),l&&u(h,l)}function p(h){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},p(h)}function u(h,l){return u=Object.setPrototypeOf||function(g,d){return g.__proto__=d,g},u(h,l)}function y(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(h,l,n){return y()?b=Reflect.construct:b=function(d,v,w){var _=[null];_.push.apply(_,v);var k=Function.bind.apply(d,_),V=new k;return w&&u(V,w.prototype),V},b.apply(null,arguments)}function N(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function S(h){var l=typeof Map=="function"?new Map:void 0;return S=function(g){if(g===null||!N(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l<"u"){if(l.has(g))return l.get(g);l.set(g,d)}function d(){return b(g,arguments,p(this).constructor)}return d.prototype=Object.create(g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),u(d,g)},S(h)}function E(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function B(h,l){return l&&(typeof l=="object"||typeof l=="function")?l:E(h)}function A(h){var l=y();return function(){var g=p(h),d;if(l){var v=p(this).constructor;d=Reflect.construct(g,arguments,v)}else d=g.apply(this,arguments);return B(this,d)}}function O(h,l){for(;!Object.prototype.hasOwnProperty.call(h,l)&&(h=p(h),h!==null););return h}function C(h,l,n){return typeof Reflect<"u"&&Reflect.get?C=Reflect.get:C=function(d,v,w){var _=O(d,v);if(!!_){var k=Object.getOwnPropertyDescriptor(_,v);return k.get?k.get.call(w):k.value}},C(h,l,n||h)}function J(h,l){return R(h)||Q(h,l)||re(h,l)||M()}function K(h){return x(h)||F(h)||re(h)||j()}function x(h){if(Array.isArray(h))return $(h)}function R(h){if(Array.isArray(h))return h}function F(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}function Q(h,l){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(h)))){var n=[],g=!0,d=!1,v=void 0;try{for(var w=h[Symbol.iterator](),_;!(g=(_=w.next()).done)&&(n.push(_.value),!(l&&n.length===l));g=!0);}catch(k){d=!0,v=k}finally{try{!g&&w.return!=null&&w.return()}finally{if(d)throw v}}return n}}function re(h,l){if(!!h){if(typeof h=="string")return $(h,l);var n=Object.prototype.toString.call(h).slice(8,-1);if(n==="Object"&&h.constructor&&(n=h.constructor.name),n==="Map"||n==="Set")return Array.from(h);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(h,l)}}function $(h,l){(l==null||l>h.length)&&(l=h.length);for(var n=0,g=new Array(l);n<l;n++)g[n]=h[n];return g}function j(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ (function(e,Ne){typeof exports=="object"&&typeof module<"u"?module.exports=Ne(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],Ne):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=Ne(e.Vue,e.plupload))})(this,function(e,Ne){"use strict";const qe=(a=>a&&typeof a=="object"&&"default"in a?a:{default:a})(Ne),Ie=(a,{method:t="get",params:r={},json:i=!0})=>{const s={method:t};if(t=="get")a+="?"+new URLSearchParams(r);else{s.headers={};let o=new FormData;for(const[c,m]of Object.entries(r))o.append(c,m);s.body=o}return fetch(a,s).then(o=>o.ok?i?o.json():o.text():Promise.reject(o))};function yr(a){return{all:a=a||new Map,on:function(t,r){var i=a.get(t);i?i.push(r):a.set(t,[r])},off:function(t,r){var i=a.get(t);i&&(r?i.splice(i.indexOf(r)>>>0,1):a.set(t,[]))},emit:function(t,r){var i=a.get(t);i&&i.slice().map(function(s){s(r)}),(i=a.get("*"))&&i.slice().map(function(s){s(t,r)})}}}function Ge(a){let t=localStorage.getItem(a+"_storage");const r=e.ref(JSON.parse(t));e.watch(r,i);function i(){r.value===null||r.value===""?localStorage.removeItem(a+"_storage"):localStorage.setItem(a+"_storage",JSON.stringify(r.value))}function s(m,f){r.value=Object.assign({...r.value},{[m]:f})}function o(){r.value=null}return{getStore:(m,f=null)=>r.value===null||r.value===""?f:r.value.hasOwnProperty(m)?r.value[m]:f,setStore:s,clearStore:o}}const bt=e.ref("");function ce(){function a(t){bt.value=t}return{apiUrl:bt,setApiUrl:a}}const br={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},vr={key:0,class:"flex text-center"},wr=["aria-label"],_r=[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)],kr=["aria-label"],xr=[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)],Sr=["aria-label"],Dr=[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)],Er=["aria-label"],Nr=[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)],Vr=["aria-label"],Cr=[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)],Mr=["aria-label"],$r=[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)],Br=["aria-label"],Tr=[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)],Ar={key:1,class:"flex text-center"},Or={class:"pl-2"},Pr={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},jr={class:"flex text-center items-center justify-end"},Ir=["aria-label"],Lr=[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)],zr=["aria-label"],Rr={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"},Hr={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"},Ur={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"},Kr=["aria-label"],Fr={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"},Yr={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"},Wr=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(a){const t=e.inject("emitter"),{getStore:r,setStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(r("viewport","grid")),c=e.ref([]),m=e.ref(r("full-screen",!1)),f=e.ref("");t.on("vf-search-query",({newQuery:u})=>{f.value=u});const p=()=>{m.value=!m.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",u=>{c.value=u}),t.on("vf-view-toggle",u=>{i("viewport",u),o.value=u}),(u,y)=>(e.openBlock(),e.createElementBlock("div",br,[f.value.length?(e.openBlock(),e.createElementBlock("div",Ar,[e.createElementVNode("div",Or,[e.createTextVNode(e.toDisplayString(e.unref(s)("Search results for"))+" ",1),e.createElementVNode("span",Pr,e.toDisplayString(f.value),1)])])):(e.openBlock(),e.createElementBlock("div",vr,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:y[0]||(y[0]=b=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:c.value}))},_r,8,wr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[1]||(y[1]=b=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:c.value}))},xr,8,kr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[2]||(y[2]=b=>c.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},Dr,2))],8,Sr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[3]||(y[3]=b=>!c.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},Nr,2))],8,Er),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[4]||(y[4]=b=>e.unref(t).emit("vf-modal-show",{type:"upload",items:c.value}))},Cr,8,Vr),c.value.length==1&&c.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(s)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[5]||(y[5]=b=>!c.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},$r,2))],8,Mr)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(s)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[6]||(y[6]=b=>!c.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},Tr,2))],8,Br))])),e.createElementVNode("div",jr,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:y[7]||(y[7]=b=>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"},Lr))],8,Ir),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Toggle Full Screen"),"data-microtip-position":"bottom",role:"tooltip",onClick:p},[(e.openBlock(),e.createElementBlock("svg",Rr,[m.value?(e.openBlock(),e.createElementBlock("path",Hr)):(e.openBlock(),e.createElementBlock("path",Ur))]))],8,zr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:y[8]||(y[8]=b=>f.value.length||e.unref(t).emit("vf-view-toggle",o.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([f.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"},[o.value=="grid"?(e.openBlock(),e.createElementBlock("path",Fr)):e.createCommentVNode("",!0),o.value=="list"?(e.openBlock(),e.createElementBlock("path",Yr)):e.createCommentVNode("",!0)],2))],8,Kr)])]))}});var Xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vt={exports:{}};(function(a,t){(function(r,i){a.exports=i()})(Xr,function(){function r(h,l){if(!(h instanceof l))throw new TypeError("Cannot call a class as a function")}function i(h,l){for(var n=0;n<l.length;n++){var g=l[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}function s(h,l,n){return l&&i(h.prototype,l),n&&i(h,n),h}function o(h,l,n){return l in h?Object.defineProperty(h,l,{value:n,enumerable:!0,configurable:!0,writable:!0}):h[l]=n,h}function c(h,l){var n=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);l&&(g=g.filter(function(d){return Object.getOwnPropertyDescriptor(h,d).enumerable})),n.push.apply(n,g)}return n}function m(h){for(var l=1;l<arguments.length;l++){var n=arguments[l]!=null?arguments[l]:{};l%2?c(Object(n),!0).forEach(function(g){o(h,g,n[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(n,g))})}return h}function f(h,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(l&&l.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),l&&u(h,l)}function p(h){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},p(h)}function u(h,l){return u=Object.setPrototypeOf||function(g,d){return g.__proto__=d,g},u(h,l)}function y(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(h,l,n){return y()?b=Reflect.construct:b=function(d,v,w){var _=[null];_.push.apply(_,v);var k=Function.bind.apply(d,_),V=new k;return w&&u(V,w.prototype),V},b.apply(null,arguments)}function N(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function S(h){var l=typeof Map=="function"?new Map:void 0;return S=function(g){if(g===null||!N(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l<"u"){if(l.has(g))return l.get(g);l.set(g,d)}function d(){return b(g,arguments,p(this).constructor)}return d.prototype=Object.create(g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),u(d,g)},S(h)}function E(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function B(h,l){return l&&(typeof l=="object"||typeof l=="function")?l:E(h)}function A(h){var l=y();return function(){var g=p(h),d;if(l){var v=p(this).constructor;d=Reflect.construct(g,arguments,v)}else d=g.apply(this,arguments);return B(this,d)}}function O(h,l){for(;!Object.prototype.hasOwnProperty.call(h,l)&&(h=p(h),h!==null););return h}function C(h,l,n){return typeof Reflect<"u"&&Reflect.get?C=Reflect.get:C=function(d,v,w){var _=O(d,v);if(!!_){var k=Object.getOwnPropertyDescriptor(_,v);return k.get?k.get.call(w):k.value}},C(h,l,n||h)}function J(h,l){return R(h)||Q(h,l)||re(h,l)||M()}function K(h){return x(h)||F(h)||re(h)||j()}function x(h){if(Array.isArray(h))return $(h)}function R(h){if(Array.isArray(h))return h}function F(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}function Q(h,l){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(h)))){var n=[],g=!0,d=!1,v=void 0;try{for(var w=h[Symbol.iterator](),_;!(g=(_=w.next()).done)&&(n.push(_.value),!(l&&n.length===l));g=!0);}catch(k){d=!0,v=k}finally{try{!g&&w.return!=null&&w.return()}finally{if(d)throw v}}return n}}function re(h,l){if(!!h){if(typeof h=="string")return $(h,l);var n=Object.prototype.toString.call(h).slice(8,-1);if(n==="Object"&&h.constructor&&(n=h.constructor.name),n==="Map"||n==="Set")return Array.from(h);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(h,l)}}function $(h,l){(l==null||l>h.length)&&(l=h.length);for(var n=0,g=new Array(l);n<l;n++)g[n]=h[n];return g}function j(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L=function(l,n,g){var d=l.x,v=l.y,w=g.x,_=g.y,k={"+":{x:d+w,y:v+_},"-":{x:d-w,y:v-_},"*":{x:d*w,y:v*_},"/":{x:d/w,y:v/_}};return k[n]},P=function(l){return{x:l.left,y:l.top}},q=function(l){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:l.x,top:l.y,right:l.x,bottom:l.y,width:n,height:n}},Y=function(l){return{x:l,y:l}},Oe=function(h,l,n){window.addEventListener("resize",l),window.addEventListener("scroll",l),h.forEach(function(g,d){n.observe(g,{childList:d!==0,attributes:!0})})},Pe=function(h){var l=Se(h);return l.x||l.y?!0:h instanceof HTMLDocument?h.body?!!(h.body.scrollTop=1):!!(h.documentElement.scrollTop=1):!!(h.scrollTop=1)},Fe=function(h){var l=document.createElement("div");return l.style.position="fixed",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="999999999999999999",l.classList.add(h),l},Ye=function(h){var l=document.createElement("div");return l.style.position="absolute",h||(l.style.background="rgba(0, 0, 255, 0.1)",l.style.border="1px solid rgba(0, 0, 255, 0.45)",l.style.display="none",l.style.pointerEvents="none"),l},We=function(h,l){var n;return function(){for(var g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];var w=function(){n=null,h.apply(void 0,d)};clearTimeout(n),n=setTimeout(w,l)}},xe=function(){var h,l,n,g;return{y:((h=document.body)===null||h===void 0?void 0:h.scrollTop)||((l=document.documentElement)===null||l===void 0?void 0:l.scrollTop)||0,x:((n=document.body)===null||n===void 0?void 0:n.scrollLeft)||((g=document.documentElement)===null||g===void 0?void 0:g.scrollLeft)||0}},pt=function(h,l){if(h instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=h.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(h.clientWidth||n.width)*l,height:(h.clientHeight||n.height)*l}},Se=function(h){return!h||h instanceof Document?xe():{x:h.scrollLeft>=0?h.scrollLeft:xe().x,y:h.scrollTop>=0?h.scrollTop:xe().y}},Jt=function(h){var l=h.elementRect,n=h.containerRect,g=h.tolerance,d=g===void 0?{x:0,y:0}:g,v=[];return l.top-d.y<n.top&&v.push("top"),l.left-d.x<n.left&&v.push("left"),l.bottom+d.y>n.bottom&&v.push("bottom"),l.right+d.y>n.right&&v.push("right"),v},Gs=function(h){var l=h.event;return{x:l.clientX,y:l.clientY}},Js=function(h){var l=h.scrollAmount,n=h.initialPointerPos,g=h.pointerPos,d={};return g.x>n.x-l.x?(d.left=n.x-l.x,d.width=g.x-n.x+l.x):(d.left=g.x,d.width=n.x-g.x-l.x),g.y>n.y-l.y?(d.top=n.y-l.y,d.height=g.y-n.y+l.y):(d.top=g.y,d.height=n.y-g.y-l.y),d},Zt=function(l){var n={x:0,y:0},g=window.getComputedStyle(l);if(!g.transform||g.transform==="none")return n;if(g.transform.indexOf("3d")>=0){var d=g.transform.trim().match(/matrix3d\((.*?)\)/);if(d&&d.length){var v,w=(v=d[1])===null||v===void 0?void 0:v.split(",");n.x=parseInt(w[12])||0,n.y=parseInt(w[13])||0}return n}else{var _=g.transform.trim().match(/matrix\((.*?)\)/);if(_&&_.length){var k,V=(k=_[1])===null||k===void 0?void 0:k.split(",");n.x=parseInt(V[4])||0,n.y=parseInt(V[5])||0}return n}},Zs=function(l){var n=l.style.transform;if(!n||n.indexOf("translate")<0)return Zt(l);var g={x:0,y:0},d=n.trim().match(/translate[3dD]*?\(.*?\)/);if(d){var v,w=(v=d[0])===null||v===void 0?void 0:v.split("(");if(w){var _,k=(_=w[1])===null||_===void 0?void 0:_.split(",");g.x=parseInt(k[0])||0,g.y=parseInt(k[1])||0}}return!g.x&&!g.x?Zt(l):g},Qs=function(l){var n=l.style,g={x:parseInt(n.left)||0,y:parseInt(n.top)||0};if(!g.x&&!g.x){var d=window.getComputedStyle(l);return{x:parseInt(d.left)||0,y:parseInt(d.top)||0}}return g},el=function(h,l){return l?Zs(h):Qs(h)},tl=function(h){var l=h.element,n=h.edges,g=h.elementRect,d=h.containerRect,v=h.elementPos,w=h.useTransform;n.includes("top")&&je(l,{y:v.y+d.top-g.top,x:v.x},w),n.includes("left")&&je(l,{y:v.y,x:v.x+d.left-g.left},w),n.includes("bottom")&&je(l,{y:v.y+d.bottom-g.bottom,x:v.x},w),n.includes("right")&&je(l,{y:v.y,x:v.x+d.right-g.right},w)},Qt=function(h){var l=h.computedStyle,n=h.node,g=l.position,d=g==="absolute"||g==="relative"||g==="fixed";!(n instanceof HTMLDocument)&&!d&&(n.style.position="relative")},rl=function(h){var l=h.shiftKey,n=h.keyboardDragSpeed,g=h.zoom,d=h.key,v=h.dragKeys,w=h.scrollDiff,_=h.canScroll,k=h.scrollCallback,V={x:0,y:0},D=l?n*4*g:n*g;return v.left.includes(d)&&(V.x=w.x||-D,!l&&!w.x&&_&&k(["left"],n)),v.right.includes(d)&&(V.x=w.x||D,!l&&!w.x&&_&&k(["right"],n)),v.up.includes(d)&&(V.y=w.y||-D,!l&&!w.y&&_&&k(["top"],n)),v.down.includes(d)&&(V.y=w.y||D,!l&&!w.y&&_&&k(["bottom"],n)),V},nl=function(h){var l=h.element,n=h.force,g=h.multiSelectionToggle,d=h.SelectedSet,v=h.hoverClassName;l.classList.contains(v)&&!n||(d.has(l)?g&&d.delete(l):d.add(l),l.classList.add(v))},ol=function(h){var l=h.element,n=h.force,g=h.SelectedSet,d=h.PrevSelectedSet,v=h.hoverClassName;if(!l.classList.contains(v)&&!n)return!1;var w=g.has(l),_=d.has(l);w&&!_?g.delete(l):!w&&_&&g.add(l),l.classList.remove(v)},gt=function(h,l){return h.left<l.right&&h.right>l.left&&h.top<l.bottom&&h.bottom>l.top},er=function(h){var l=h.element,n=h.posDirection,g=h.containerRect,d=h.useTransform,v=el(l,d),w=L(v,"+",n);je(l,w,d);var _=l.getBoundingClientRect(),k=Jt({elementRect:_,containerRect:g});tl({element:l,edges:k,elementRect:_,containerRect:g,elementPos:w,useTransform:d})},il=function(h,l){window.removeEventListener("resize",l),window.removeEventListener("scroll",l),h.disconnect()},al=function(h,l,n){if(!!l.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,d=h instanceof HTMLDocument?g||document.body:h,v=l.includes("top")&&d.scrollTop>0,w=l.includes("bottom")&&d.scrollTop<d.scrollHeight,_=l.includes("left")&&d.scrollLeft>0,k=l.includes("right")&&d.scrollLeft<d.scrollWidth;v&&(d.scrollTop-=1*n),w&&(d.scrollTop+=1*n),_&&(d.scrollLeft-=1*n),k&&(d.scrollLeft+=1*n)}},je=function(h,l,n){if(n){var g=h.style.transform;h.style.transform="translate3d(".concat(l.x,"px,").concat(l.y,"px,1px) ").concat(g.replace(/translate.*?\)/g,""))}else h.style.left="".concat(l.x,"px"),h.style.top="".concat(l.y,"px");return h},sl=function(h){for(var l=h.subscribe,n=h.publish,g=h.Interaction,d=h.SelectedSet,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(D){return D.event}}],"Interaction:end":[{name:"callback"}]},w=function(){var D=J(k[_],2),T=D[0],I=D[1];["pre",!1].forEach(function(W){return l(W?"".concat(T,":").concat(W):T,function(ne){return I.forEach(function(G){return(!G.condition||G.condition(ne))&&n(W?"".concat(W).concat(G.name):G.name,m({items:d.elements,isDragging:g.isDragging},ne))})})})},_=0,k=Object.entries(v);_<k.length;_++)w()},De=function(h){return h?!Array.isArray(h)&&(h instanceof HTMLElement||h instanceof SVGElement)?[h]:K(h):[]},tr=function(h,l){h.style.left="".concat(l.left,"px"),h.style.top="".concat(l.top,"px"),h.style.width="".concat(l.width,"px"),h.style.height="".concat(l.height,"px")},ll=function(){function h(l){var n=this,g=l.area,d=l.PS,v=l.zoom;r(this,h),o(this,"_modificationCallback",void 0),o(this,"_modificationObserver",void 0),o(this,"_zoom",void 0),o(this,"_node",void 0),o(this,"_parentNodes",void 0),o(this,"_computedStyle",void 0),o(this,"_computedBorder",void 0),o(this,"_rect",void 0),o(this,"setArea",function(w){n._node=w,Qt({computedStyle:n.computedStyle,node:n._node}),setTimeout(function(){n.PubSub.publish("Area:modified:pre",{item:n}),n.reset(),n.PubSub.publish("Area:modified",{item:n})})}),o(this,"start",function(){Oe(n.parentNodes,n._modificationCallback,n._modificationObserver)}),o(this,"reset",function(){n._computedStyle=void 0,n._rect=void 0,n._computedBorder=void 0,n._parentNodes=void 0}),o(this,"stop",function(){il(n._modificationObserver,n._modificationCallback),n.reset()}),o(this,"scroll",function(w,_){var k={scroll_directions:w,scroll_multiplier:_};n.PubSub.publish("Area:scroll:pre",k),al(n._node,w,_),n.PubSub.publish("Area:scroll",k)}),this._zoom=v,this.PubSub=d,this.setArea(g),this._modificationCallback=We(function(w){n.PubSub.publish("Area:modified:pre",{event:w,item:n}),n.reset(),n.PubSub.publish("Area:modified",{event:w,item:n})},60),this._modificationObserver=new MutationObserver(this._modificationCallback),this.PubSub.subscribe("Interaction:init",this.start),this.PubSub.subscribe("Interaction:end",this.reset)}return s(h,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof HTMLDocument?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=pt(this.HTMLNode,this._zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;var n=function g(d){var v,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=(v=d[w])===null||v===void 0?void 0:v.parentNode;return _?(d.push(_),w++,g(d,w)):d};return this._parentNodes=n([this.HTMLNode]),this._parentNodes}}]),h}(),cl=function(){function h(l){var n=this,g=l.DS,d=l.dragKeys,v=l.draggability,w=l.keyboardDrag,_=l.keyboardDragSpeed,k=l.useTransform,V=l.zoom;r(this,h),o(this,"_useTransform",void 0),o(this,"_prevCursorPos",void 0),o(this,"_prevScrollPos",void 0),o(this,"_elements",[]),o(this,"_draggability",void 0),o(this,"_dragKeys",void 0),o(this,"_dragKeysFlat",void 0),o(this,"_keyboardDrag",void 0),o(this,"_keyboardDragSpeed",void 0),o(this,"_zoom",void 0),o(this,"keyboardDrag",function(D){var T=D.event,I=D.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability||n.DS.continue)){var W={event:T,isDragging:!0,isDraggingKeyboard:!0};n.DS.publish(["Interaction:start:pre","Interaction:start"],W),n._elements=n.DS.getSelection(),n.handleZIndex(!0);var ne=rl({shiftKey:n.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:n._keyboardDragSpeed,zoom:n._zoom,key:I,scrollCallback:n.DS.Area.scroll,scrollDiff:n._scrollDiff,canScroll:n.DS.stores.ScrollStore.canScroll,dragKeys:n._dragKeys});n._elements.forEach(function(G){return er({element:G,posDirection:ne,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})}),n.DS.publish(["Interaction:update:pre","Interaction:update"],W)}}),o(this,"keyboardEnd",function(D){var T=D.event,I=D.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability)){var W={event:T,isDragging:n._draggability,isDraggingKeyboard:!0};n.DS.publish(["Interaction:end:pre","Interaction:end"],W)}}),o(this,"start",function(D){var T=D.isDragging,I=D.isDraggingKeyboard;!T||I||(n._prevCursorPos=null,n._prevScrollPos=null,n._elements=n.DS.getSelection(),n.handleZIndex(!0))}),o(this,"stop",function(D){D!=null&&D.isKeyboard||(n._prevCursorPos=null,n._prevScrollPos=null,n.handleZIndex(!1),n._elements=[])}),o(this,"update",function(D){var T=D.isDragging,I=D.isDraggingKeyboard;if(!(!T||!n._elements.length||I||n.DS.continue)){var W=L(n._cursorDiff,"+",n._scrollDiff);n._elements.forEach(function(ne){return er({element:ne,posDirection:W,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})})}}),o(this,"handleZIndex",function(D){n._elements.forEach(function(T){return T.style.zIndex="".concat((parseInt(T.style.zIndex)||0)+D?9999:-9998)})}),this.DS=g,this._useTransform=k,this._keyboardDragSpeed=_,this._keyboardDrag=w,this._zoom=V,this._draggability=v,this._dragKeys={up:d.up.map(function(D){return D.toLowerCase()}),down:d.down.map(function(D){return D.toLowerCase()}),left:d.left.map(function(D){return D.toLowerCase()}),right:d.right.map(function(D){return D.toLowerCase()})},this._dragKeysFlat=[].concat(K(this._dragKeys.up),K(this._dragKeys.down),K(this._dragKeys.left),K(this._dragKeys.right)),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 s(h,[{key:"_cursorDiff",get:function(){var n=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?L(n,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=n,g}},{key:"_scrollDiff",get:function(){var n=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?L(n,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=n,g}}]),h}(),dl=function(){function h(l){var n=this,g=l.DS,d=l.areaElement,v=l.draggability,w=l.immediateDrag,_=l.selectableClass;r(this,h),o(this,"_areaElement",void 0),o(this,"_draggability",void 0),o(this,"_immediateDrag",void 0),o(this,"_selectableClass",void 0),o(this,"isInteracting",void 0),o(this,"isDragging",void 0),o(this,"init",function(){return n.DS.publish("Interaction:init:pre",{})}),o(this,"_init",function(){n.stop(),n._areaElement.addEventListener("mousedown",n.start),n._areaElement.addEventListener("touchstart",n.start,{passive:!1}),n.DS.publish("Interaction:init",{})}),o(this,"start",function(k){return n.DS.publish("Interaction:start:pre",{event:k,isDragging:n.isDragging})}),o(this,"_start",function(k){k.type==="touchstart"&&k.preventDefault(),n._canInteract(k)&&(n.isInteracting=!0,n.isDragging=n.isDragEvent(k),n.DS.publish("Interaction:start",{event:k,isDragging:n.isDragging}),document.addEventListener("mouseup",n.reset),document.addEventListener("touchend",n.reset))}),o(this,"isDragEvent",function(k){var V=k.target.closest(".".concat(n._selectableClass));return!n._draggability||n.DS.stores.KeyStore.isMultiSelectKeyPressed(k)||!V?!1:(n._immediateDrag&&(n.DS.SelectedSet.size?n.DS.SelectedSet.has(V)||(n.DS.SelectedSet.clear(),n.DS.SelectedSet.add(V)):n.DS.SelectedSet.add(V)),!!n.DS.SelectedSet.has(V))}),o(this,"onClick",function(k){var V=k.event;if(!!n._canInteract(V)&&!(V.detail>0)){var D=n.DS,T=D.stores,I=T.PointerStore,W=T.KeyStore,ne=D.SelectableSet,G=D.SelectedSet;I.start(V);var Ee=V.target;!ne.has(Ee)||(W.isMultiSelectKeyPressed(V)||G.clear(),G.toggle(Ee),n.reset())}}),o(this,"stop",function(){n.isInteracting=!1,n.isDragging=!1,n._areaElement.removeEventListener("mousedown",n.start),n._areaElement.removeEventListener("touchstart",n.start,{passive:!1}),document.removeEventListener("mouseup",n.reset),document.removeEventListener("touchend",n.reset)}),o(this,"update",function(k){var V=k.event,D=k.scroll_directions,T=k.scroll_multiplier;n.isInteracting&&n.DS.publish(["Interaction:update:pre","Interaction:update"],{event:V,scroll_directions:D,scroll_multiplier:T,isDragging:n.isDragging})}),o(this,"reset",function(k){return n.DS.publish("Interaction:end:pre",{event:k,isDragging:n.isDragging})}),o(this,"_reset",function(k){var V=n.isDragging;n.stop(),n.init(),n.DS.publish("Interaction:end",{event:k,isDragging:V})}),this._areaElement=d,this._draggability=v,this._immediateDrag=w,this._selectableClass=_,this.DS=g,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(k){var V=k.event;return n.start(V)}),this.DS.subscribe("Interaction:start:pre",function(k){var V=k.event;return n._start(V)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(k){var V=k.event;return n._reset(V)}),this.DS.subscribe("Area:scroll",this.update)}return s(h,[{key:"_canInteract",value:function(n){var g=n.clientX===0&&n.clientY===0&&n.detail===0&&n.target;return!(n.button===2||this.isInteracting||n.target&&!this.DS.SelectorArea.isInside(n.target)||!g&&!this.DS.SelectorArea.isClicked(n))}}]),h}(),hl=function h(l){var n=this,g=l.DS;r(this,h),o(this,"subscribers",{}),o(this,"subscribe",function(d,v){return Array.isArray(n.subscribers[d])||(n.subscribers[d]=[]),n.subscribers[d].push(v),n.subscribers[d].length-1}),o(this,"unsubscribe",function(d,v,w){w>=0?n.subscribers[d].splice(w,1):v&&(n.subscribers[d]=n.subscribers[d].filter(function(_){return _!==v}))}),o(this,"publish",function(d,v){Array.isArray(d)?d.forEach(function(w){return n._publish(w,v)}):n._publish(d,v)}),o(this,"_publish",function(d,v){var w=n.subscribers[d];!Array.isArray(w)||(d.includes(":pre")?n._handlePrePublish(w,v):n._handlePublish(w,v))}),o(this,"_handlePublish",function(d,v){for(var w=0,_=d.length;w<_;w++){if(n.DS.stopped)return;d[w](v)}}),o(this,"_handlePrePublish",function(d,v){for(var w=d.length;w--;){if(n.DS.stopped)return;d[w](v)}}),this.DS=g},ul=function(h){f(n,h);var l=A(n);function n(g){var d,v=g.elements,w=g.className,_=g.hoverClassName,k=g.draggability,V=g.useTransform,D=g.DS;return r(this,n),d=l.call(this),o(E(d),"_initElements",void 0),o(E(d),"_className",void 0),o(E(d),"_hoverClassName",void 0),o(E(d),"_useTransform",void 0),o(E(d),"_draggability",void 0),o(E(d),"init",function(){return d._initElements.forEach(function(T){return d.add(T)})}),o(E(d),"clear",function(){return d.forEach(function(T){return d.delete(T)})}),o(E(d),"_onClick",function(T){return d.DS.publish(["Selectable:click:pre","Selectable:click"],{event:T})}),o(E(d),"_onPointer",function(T){return d.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:T})}),o(E(d),"addAll",function(T){return T.forEach(function(I){return d.add(I)})}),o(E(d),"deleteAll",function(T){return T.forEach(function(I){return d.delete(I)})}),d.DS=D,d._initElements=De(v),d._className=w,d._hoverClassName=_,d._useTransform=V,d._draggability=k,d.DS.subscribe("Interaction:init",d.init),d}return s(n,[{key:"add",value:function(d){return d.classList.add(this._className),d.addEventListener("click",this._onClick),d.addEventListener("mousedown",this._onPointer),d.addEventListener("touchstart",this._onPointer,{passive:!1}),this._draggability&&!this._useTransform&&Qt({computedStyle:window.getComputedStyle(d),node:d}),C(p(n.prototype),"add",this).call(this,d)}},{key:"delete",value:function(d){return d.classList.remove(this._className),d.classList.remove(this._hoverClassName),d.removeEventListener("click",this._onClick),d.removeEventListener("mousedown",this._onPointer),d.removeEventListener("touchstart",this._onPointer,{passive:!1}),C(p(n.prototype),"delete",this).call(this,d)}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(S(Set)),ml=function(h){f(n,h);var l=A(n);function n(g){var d,v=g.className,w=g.DS;return r(this,n),d=l.call(this),o(E(d),"_className",void 0),o(E(d),"clear",function(){return d.forEach(function(_){return d.delete(_)})}),o(E(d),"addAll",function(_){return _.forEach(function(k){return d.add(k)})}),o(E(d),"deleteAll",function(_){return _.forEach(function(k){return d.delete(k)})}),d.DS=w,d._className=v,d}return s(n,[{key:"add",value:function(d){if(!C(p(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};return this.DS.publish("Selected:added:pre",v),C(p(n.prototype),"add",this).call(this,d),d.classList.add(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)+1),this.DS.publish("Selected:added",v),this}}},{key:"delete",value:function(d){if(!!C(p(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};this.DS.publish("Selected:removed:pre",v);var w=C(p(n.prototype),"delete",this).call(this,d);return d.classList.remove(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)-1),this.DS.publish("Selected:removed",v),w}}},{key:"toggle",value:function(d){return this.has(d)?this.delete(d):this.add(d),d}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(S(Set)),fl=function(){function h(l){var n=this,g=l.DS,d=l.hoverClassName,v=l.multiSelectToggling;r(this,h),o(this,"_prevSelectedSet",void 0),o(this,"_hoverClassName",void 0),o(this,"_multiSelectToggling",void 0),o(this,"start",function(w){var _=w.event,k=w.isDragging;k||(n._storePrevious(_),n._handleInsideSelection(!0,_))}),o(this,"update",function(w){var _=w.isDragging;_||n.DS.continue||n._handleInsideSelection()}),o(this,"_handleInsideSelection",function(w,_){for(var k=n.DS,V=k.SelectableSet,D=k.SelectorArea,T=k.Selector,I=V.elements.map(function(me){return[me,me.getBoundingClientRect()]}),W=[],ne=[],G=0,Ee=I.length;G<Ee;G++)!D.isInside(I[G][0],I[G][1])||(gt(I[G][1],T.rect)?W.push(I[G][0]):ne.push(I[G][0]));var Xe=n.DS.stores.KeyStore.isMultiSelectKeyPressed(_)&&n._multiSelectToggling;n.DS.continue||(W.forEach(function(me){return nl({element:me,force:w,multiSelectionToggle:Xe,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName})}),ne.forEach(function(me){return ol({element:me,force:w,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName,PrevSelectedSet:n._prevSelectedSet})}))}),this._hoverClassName=d,this._multiSelectToggling=v,this.DS=g,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(h,[{key:"_storePrevious",value:function(n){var g=this.DS,d=g.stores.KeyStore,v=g.SelectedSet;d.isMultiSelectKeyPressed(n)?this._prevSelectedSet=new Set(v):this._prevSelectedSet=new Set}}]),h}(),pl=function(){function h(l){var n=this,g=l.DS,d=l.selector,v=l.selectorClass,w=l.customStyles;r(this,h),o(this,"_rect",void 0),o(this,"start",function(_){var k=_.isDragging;if(!k){var V=n.DS.stores.PointerStore,D=V.initialValArea;tr(n.HTMLNode,q(D,1)),n.HTMLNode.style.display="block",n._rect=null}}),o(this,"stop",function(){n.HTMLNode.style.width="0",n.HTMLNode.style.height="0",n.HTMLNode.style.display="none"}),o(this,"update",function(_){var k=_.isDragging;if(!(k||n.DS.continue)){var V=n.DS.stores,D=V.ScrollStore,T=V.PointerStore,I=Js({scrollAmount:D.scrollAmount,initialPointerPos:T.initialValArea,pointerPos:T.currentValArea});tr(n.HTMLNode,I),n._rect=null}}),this.DS=g,this.HTMLNode=d||Ye(w),this.HTMLNode.classList.add(v),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(h,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),gl=function(){function h(l){var n=this,g=l.DS,d=l.selectorAreaClass,v=l.autoScrollSpeed,w=l.overflowTolerance;r(this,h),o(this,"_autoScrollSpeed",void 0),o(this,"_scrollInterval",void 0),o(this,"_rect",void 0),o(this,"currentEdges",[]),o(this,"_overflowTolerance",void 0),o(this,"start",function(){return n.applyElements("append")}),o(this,"applyElements",function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",k=document.body?"body":"documentElement",V="".concat(_,"Child");n.HTMLNode[V](n.DS.Selector.HTMLNode),document[k][V](n.HTMLNode)}),o(this,"updatePos",function(){n._rect=null;var _=n.DS.Area.rect,k=n.DS.Area.computedBorder,V=n.HTMLNode.style,D="".concat(_.top+k.top,"px"),T="".concat(_.left+k.left,"px"),I="".concat(_.width,"px"),W="".concat(_.height,"px");V.top!==D&&(V.top=D),V.left!==T&&(V.left=T),V.width!==I&&(V.width=I),V.height!==W&&(V.height=W)}),o(this,"stop",function(_){n.stopAutoScroll(),_&&n.applyElements("remove")}),o(this,"startAutoScroll",function(){n.currentEdges=[],n._scrollInterval=setInterval(function(){return n.handleAutoScroll()},16)}),o(this,"handleAutoScroll",function(){if(!n.DS.continue){var _=n.DS,k=_.stores.PointerStore,V=_.Area;n.currentEdges=Jt({elementRect:q(k.currentVal),containerRect:n.rect,tolerance:n._overflowTolerance}),n.currentEdges.length&&V.scroll(n.currentEdges,n._autoScrollSpeed)}}),o(this,"stopAutoScroll",function(){n.currentEdges=[],clearInterval(n._scrollInterval)}),o(this,"isInside",function(_,k){return n.DS.Area.HTMLNode.contains(_)&&n.DS.stores.ScrollStore.canScroll?!0:gt(n.rect,k||_.getBoundingClientRect())}),this._autoScrollSpeed=v,this._overflowTolerance=w,this.DS=g,this.HTMLNode=Fe(d),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(){n.updatePos(),n.stopAutoScroll()})}return s(h,[{key:"isClicked",value:function(n){var g=this.DS.stores.PointerStore,d=n?g.getPointerPosition(n):g.initialVal;return gt({left:d.x,top:d.y,right:d.x,bottom:d.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),yl=function(){function h(l){var n=this,g=l.DS,d=l.multiSelectKeys,v=l.multiSelectMode;r(this,h),o(this,"_multiSelectMode",void 0),o(this,"_multiSelectKeys",void 0),o(this,"_currentValues",new Set),o(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),o(this,"init",function(){document.addEventListener("keydown",n.keydown),document.addEventListener("keyup",n.keyup),window.addEventListener("blur",n.reset)}),o(this,"keydown",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:down:pre",{event:w,key:_}),n._currentValues.add(_),n.DS.publish("KeyStore:down",{event:w,key:_})}),o(this,"keyup",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:up:pre",{event:w,key:_}),n._currentValues.delete(_),n.DS.publish("KeyStore:up",{event:w,key:_})}),o(this,"stop",function(){document.removeEventListener("keydown",n.keydown),document.removeEventListener("keyup",n.reset),window.removeEventListener("blur",n.reset),n.reset()}),o(this,"reset",function(){return n._currentValues.clear()}),this.DS=g,this._multiSelectMode=v,this._multiSelectKeys=d.map(function(w){var _={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"},k=_[w];return k?(console.warn("[DragSelect] ".concat(w,' is deprecated. Use "').concat(k,'" instead. Act Now!. See docs for more info')),k.toLowerCase()):w.toLowerCase()}),this.DS.subscribe("Interaction:init",this.init)}return s(h,[{key:"isMultiSelectKeyPressed",value:function(n){var g=this;return!!(this._multiSelectMode||this.currentValues.some(function(d){return g._multiSelectKeys.includes(d)})||n&&this._multiSelectKeys.some(function(d){return n[g._keyMapping[d]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),h}(),bl=function(){function h(l){var n=this,g=l.DS;r(this,h),o(this,"_isMouseInteraction",!1),o(this,"_initialValArea",void 0),o(this,"_currentValArea",void 0),o(this,"_lastValArea",void 0),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_lastVal",void 0),o(this,"_lastTouch",void 0),o(this,"init",function(){document.addEventListener("mousemove",n.update),document.addEventListener("touchmove",n.update,{passive:!1})}),o(this,"getPointerPosition",function(d){return Gs({event:n._normalizedEvent(d)})}),o(this,"update",function(d){!d||(n.DS.publish("PointerStore:updated:pre",{event:d}),n.currentVal=n.getPointerPosition(d),n._isMouseInteraction&&n.DS.publish("PointerStore:updated",{event:d}))}),o(this,"stop",function(){document.removeEventListener("mousemove",n.update),document.removeEventListener("touchmove",n.update,{passive:!1}),setTimeout(function(){return n._isMouseInteraction=!1},100)}),o(this,"reset",function(d){!d||(n.currentVal=n.lastVal=n.getPointerPosition(d),n.stop(),n.init())}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(d){var v=d.event;return n.start(v)}),this.DS.subscribe("Interaction:end",function(d){var v=d.event;return n.reset(v)})}return s(h,[{key:"start",value:function(n){!n||(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(n))}},{key:"_normalizedEvent",value:function(n){return"touches"in n&&n.type!=="touchend"&&(this._lastTouch=n),"touches"in n?this._lastTouch.touches[0]:n}},{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(n){this._initialVal=n,this._initialValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(n){this._currentVal=n,this._currentValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(n){this._lastVal=n,this._lastValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}}]),h}(),vl=function(){function h(l){var n=this,g=l.DS,d=l.areaElement,v=l.zoom;r(this,h),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_areaElement",void 0),o(this,"_canScroll",void 0),o(this,"init",function(){return n._areaElement.addEventListener("scroll",n.update)}),o(this,"start",function(){n._currentVal=n._initialVal=Se(n._areaElement),n._areaElement.addEventListener("scroll",n.update)}),o(this,"update",function(){return n._currentVal=Se(n._areaElement)}),o(this,"stop",function(){n._areaElement.removeEventListener("scroll",n.update),n._initialVal={x:0,y:0},n._canScroll=null}),o(this,"reset",function(){n.stop(),n.start()}),this._areaElement=d,this.DS=g,this.zoom=v,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return n.start()}),this.DS.subscribe("Interaction:end",function(){return n.reset()})}return s(h,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=Pe(this._areaElement)}},{key:"scrollAmount",get:function(){var n=L(this.currentVal,"-",this.initialVal),g=Y(this.zoom),d=L(L(n,"*",g),"-",n);return{x:n.x+d.x,y:n.y+d.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=Se(this._areaElement)),this._currentVal}}]),h}(),wl=function(){function h(l){var n=this,g=l.area,d=g===void 0?document:g,v=l.selectables,w=v===void 0?[]:v,_=l.autoScrollSpeed,k=_===void 0?5:_,V=l.overflowTolerance,D=V===void 0?{x:25,y:25}:V,T=l.zoom,I=T===void 0?1:T,W=l.customStyles,ne=W===void 0?!1:W,G=l.multiSelectMode,Ee=G===void 0?!1:G,Xe=l.multiSelectToggling,me=Xe===void 0?!0:Xe,rr=l.multiSelectKeys,_l=rr===void 0?["Control","Shift","Meta"]:rr,nr=l.selector,kl=nr===void 0?void 0:nr,or=l.draggability,yt=or===void 0?!0:or,ir=l.immediateDrag,xl=ir===void 0?!0:ir,ar=l.keyboardDrag,Sl=ar===void 0?!0:ar,Dl=l.dragKeys,sr=l.keyboardDragSpeed,El=sr===void 0?10:sr,lr=l.useTransform,cr=lr===void 0?!0:lr,dr=l.hoverClass,hr=dr===void 0?"ds-hover":dr,ur=l.selectableClass,mr=ur===void 0?"ds-selectable":ur,fr=l.selectedClass,Nl=fr===void 0?"ds-selected":fr,pr=l.selectorClass,Vl=pr===void 0?"ds-selector":pr,gr=l.selectorAreaClass,Cl=gr===void 0?"ds-selector-area":gr,Ml=l.callback,$l=l.onDragMove,Bl=l.onDragStartBegin,Tl=l.onDragStart,Al=l.onElementSelect,Ol=l.onElementUnselect;r(this,h),o(this,"continue",!1),o(this,"start",function(){n.stopped=!1,n.Interaction.init()}),o(this,"break",function(){return n.continue=!0}),o(this,"getSelection",function(){return n.SelectedSet.elements}),o(this,"getSelectables",function(){return n.SelectableSet.elements}),o(this,"getInitialCursorPosition",function(){return n.stores.PointerStore.initialVal}),o(this,"getCurrentCursorPosition",function(){return n.stores.PointerStore.currentVal}),o(this,"getPreviousCursorPosition",function(){return n.stores.PointerStore.lastVal}),o(this,"getInitialCursorPositionArea",function(){return n.stores.PointerStore.initialValArea}),o(this,"getCurrentCursorPositionArea",function(){return n.stores.PointerStore.currentValArea}),o(this,"getPreviousCursorPositionArea",function(){return n.stores.PointerStore.lastValArea}),o(this,"isMultiSelect",function(Pl){return n.stores.KeyStore.isMultiSelectKeyPressed(Pl)}),o(this,"isDragging",function(){return n.Interaction.isDragging}),this.PubSub=new hl({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:Ml,onDragMove:$l,onDragStart:Tl,onDragStartBegin:Bl,onElementSelect:Al,onElementUnselect:Ol}),this.stores={PointerStore:new bl({DS:this}),ScrollStore:new vl({DS:this,areaElement:d,zoom:I}),KeyStore:new yl({DS:this,multiSelectKeys:_l,multiSelectMode:Ee})},this.Area=new ll({area:d,PS:this.PubSub,zoom:I}),this.Selector=new pl({DS:this,selector:kl,selectorClass:Vl,customStyles:ne}),this.SelectorArea=new gl({DS:this,selectorAreaClass:Cl,autoScrollSpeed:k,overflowTolerance:D}),this.SelectableSet=new ul({elements:w,DS:this,className:mr,hoverClassName:hr,useTransform:cr,draggability:yt}),this.SelectedSet=new ml({DS:this,className:Nl}),this.Selection=new fl({DS:this,hoverClassName:hr,multiSelectToggling:me}),this.Drag=new cl({DS:this,draggability:yt,useTransform:cr,keyboardDrag:Sl,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},Dl),zoom:I,keyboardDragSpeed:El}),this.Interaction=new dl({areaElement:d,DS:this,draggability:yt,immediateDrag:xl,selectableClass:mr}),sl({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",function(){return n.continue=!1}),this.start()}return s(h,[{key:"_callbacksTemp",value:function(n){var g=n.callback,d=n.onDragMove,v=n.onDragStart,w=n.onDragStartBegin,_=n.onElementSelect,k=n.onElementUnselect,V=function(T,I){return console.warn("[DragSelect] ".concat(T,' is deprecated. Use DragSelect.subscribe("').concat(I,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};g&&(V("callback","callback"),this.subscribe("callback",function(D){var T=D.items;D.item;var I=D.event;return g(T,I)})),d&&(V("onDragMove","dragmove"),this.subscribe("dragmove",function(D){D.items,D.item;var T=D.event;return d(T)})),v&&(V("onDragStart","dragstart"),this.subscribe("dragstart",function(D){D.items,D.item;var T=D.event;return v(T)})),w&&(V("onDragStartBegin","dragstart"),this.subscribe("dragstart",function(D){D.items,D.item;var T=D.event;return w(T)})),_&&(V("onElementSelect","elementselect"),this.subscribe("elementselect",function(D){D.items;var T=D.item,I=D.event;return _(T,I)})),k&&(V("onElementUnselect","elementunselect"),this.subscribe("elementunselect",function(D){D.items;var T=D.item,I=D.event;return k(T,I)}))}},{key:"stop",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;d&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(n),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),n&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(De(n)),d||this.addSelectables(n),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(De(n)),d&&this.removeSelectables(n),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(n){var g=this,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return De(n).forEach(function(w){return g.SelectedSet.has(w)?g.removeSelection(n,d,v):g.addSelection(n,d,v)}),d&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(n,g,d),this.getSelection()}},{key:"clearSelection",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=De(n);return this.SelectableSet.addAll(d),g&&this.SelectedSet.addAll(d),n}},{key:"setSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.removeSelectables(n,g),this.addSelectables(n,d)}},{key:"removeSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.SelectableSet.deleteAll(De(n)),g&&this.removeSelection(n),n}},{key:"getCursorPositionDifference",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");var d=g?this.getCurrentCursorPositionArea():this.getCurrentCursorPosition(),v=n?g?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():g?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return L(d,"-",v)}}]),h}();return wl})})(vt);const qr=vt.exports,Gr=(a,t,r,i,s)=>(t=Math,r=t.log,i=1024,s=r(a)/r(i)|0,a/t.pow(i,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B"),Jr=(a,t="en-US")=>new Date(a*1e3).toLocaleString(t),Zr={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Qr=[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)],en={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},tn=[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)],Le=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(a){return(t,r)=>(e.openBlock(),e.createElementBlock("div",null,[a.direction=="down"?(e.openBlock(),e.createElementBlock("svg",Zr,Qr)):e.createCommentVNode("",!0),a.direction=="up"?(e.openBlock(),e.createElementBlock("svg",en,tn)):e.createCommentVNode("",!0)]))}}),rn=["onClick"],nn=Object.assign({name:"VFToast.vue"},{setup(a){const t=inject("emitter"),{getStore:r}=inject("storage"),i=e.ref(r("full-screen",!1)),s=f=>f=="error"?"text-red-400 border-red-400":"text-lime-600 border-lime-600",o=e.ref([]),c=f=>{o.value.splice(f,1)},m=f=>{let p=o.value.findIndex(u=>u.id===f);p!==-1&&c(p)};return t.on("vf-toast-push",f=>{let p=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");f.id=p,o.value.push(f),setTimeout(()=>{m(p)},5e3)}),(f,p)=>(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(o.value,(u,y)=>(e.openBlock(),e.createElementBlock("div",{onClick:b=>c(y),key:u,class:e.normalizeClass([s(u.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 border text-xs rounded cursor-pointer"])},e.toDisplayString(u.label),11,rn))),128))]),_:1})],2))}}),fe=a=>Object.entries(a).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:on}=ce(),Je=(a,t)=>on.value+"?"+fe({q:"preview",adapter:a,path:t}),an={class:"relative flex-auto flex flex-col overflow-hidden"},sn={key:0,class:"grid grid-cols-12 border-b border-neutral-300 dark:border-gray-700 text-xs select-none"},ln={class:"absolute"},cn=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),dn={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"},hn=["onDblclick","onTouchstart","onContextmenu","data-type","data-item","data-index"],un={class:"grid grid-cols-12 items-center"},mn={class:"flex col-span-7 items-center"},fn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},pn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],gn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},yn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],bn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},vn={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},wn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],_n={class:"grid grid-cols-12 items-center"},kn={class:"flex col-span-7 items-center"},xn={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"},Sn=[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)],Dn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},En=[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)],Nn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Vn={class:"col-span-2 text-center"},Cn={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Mn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],$n={class:"relative"},Bn={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"},Tn=[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)],An=["src"],On={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"},Pn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],jn={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},In={class:"break-all"},Ln=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(a){const t=a,r=inject("emitter"),{setStore:i,getStore:s}=inject("storage"),o=$=>$==null?void 0:$.substring(0,3),c=$=>$.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),m=e.ref(null),f=e.ref(null),p=e.ref(0),u=e.ref(null),{t:y}=inject("i18n"),b=Math.floor(Math.random()*2**32),N=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{N.value=!N.value,i("full-screen",N.value)});const S=e.ref("");r.on("vf-search-query",({newQuery:$})=>{S.value=$,$?r.emit("vf-fetch",{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:$}):r.emit("vf-fetch",{q:"index",adapter:t.data.adapter,path:t.data.dirname})});let E=null;const B=()=>{E&&clearTimeout(E)},A=$=>{E=setTimeout(()=>{O($)},500)},O=$=>{$.type=="dir"?(r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.data.adapter,path:$.path})):r.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:$})},C=e.reactive({active:!1,column:"",order:""}),J=($=!0)=>{let j=[...t.data.files],M=C.column,L=C.order=="asc"?1:-1;if(!$)return j;const P=(q,Y)=>typeof q=="string"&&typeof Y=="string"?q.toLowerCase().localeCompare(Y.toLowerCase()):q<Y?-1:q>Y?1:0;return C.active&&(j=j.slice().sort((q,Y)=>P(q[M],Y[M])*L)),j},K=$=>{C.active&&C.column==$?(C.active=C.order=="asc",C.column=$,C.order="desc"):(C.active=!0,C.column=$,C.order="asc")},x=()=>u.value.getSelection().map($=>JSON.parse($.dataset.item)),R=($,j)=>{if($.altKey||$.ctrlKey||$.metaKey)return $.preventDefault(),!1;$.dataTransfer.setDragImage(f.value,0,15),$.dataTransfer.effectAllowed="all",$.dataTransfer.dropEffect="copy",$.dataTransfer.setData("items",JSON.stringify(x()))},F=($,j)=>{$.preventDefault();let M=JSON.parse($.dataTransfer.getData("items"));if(M.find(L=>L.storage!=s("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:M,to:j}})},Q=($,j)=>{$.preventDefault(),!j||j.type!=="dir"||u.value.getSelection().find(M=>M==$.currentTarget)?($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none"):$.dataTransfer.dropEffect="copy"},re=()=>{u.value=new qr({area:m.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),r.on("vf-explorer-update",()=>e.nextTick(()=>{u.value.clearSelection(),u.value.setSelectables(document.getElementsByClassName("vf-item-"+b))})),u.value.subscribe("predragstart",({event:$,isDragging:j})=>{if(j)p.value=u.value.getSelection().length,u.value.break();else{const M=$.target.offsetWidth-$.offsetX,L=$.target.offsetHeight-$.offsetY;M<15&&L<15&&(u.value.clearSelection(),u.value.break())}}),u.value.subscribe("predragmove",({isDragging:$})=>{$&&u.value.break()}),u.value.subscribe("callback",({items:$,event:j,isDragging:M})=>{r.emit("vf-nodes-selected",x()),p.value=u.value.getSelection().length})};return e.onMounted(re),e.onMounted(()=>{e.watch(()=>t.view,()=>r.emit("vf-explorer-update"))}),($,j)=>(e.openBlock(),e.createElementBlock("div",an,[a.view=="list"||S.value.length?(e.openBlock(),e.createElementBlock("div",sn,[e.createElementVNode("div",{onClick:j[0]||(j[0]=M=>K("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(y)("Name"))+" ",1),e.withDirectives(e.createVNode(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="basename"]])]),S.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:j[1]||(j[1]=M=>K("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(y)("Size"))+" ",1),e.withDirectives(e.createVNode(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="file_size"]])])),S.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:j[2]||(j[2]=M=>K("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(y)("Date"))+" ",1),e.withDirectives(e.createVNode(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="last_modified"]])])),S.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:j[3]||(j[3]=M=>K("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(y)("Filepath"))+" ",1),e.withDirectives(e.createVNode(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ln,[e.createElementVNode("div",{ref_key:"dragImage",ref:f,class:"absolute -z-50 -top-96"},[cn,e.createElementVNode("div",dn,e.toDisplayString(p.value),1)],512)]),e.createElementVNode("div",{style:e.normalizeStyle(N.value?"height: 100%;":""),class:e.normalizeClass([N.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:m,onContextmenu:j[7]||(j[7]=e.withModifiers(M=>e.unref(r).emit("vf-contextmenu-show",{event:M,area:m.value,items:x()}),["self","prevent"]))},[S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(J(),(M,L)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:P=>O(M),onTouchstart:P=>A(M),onTouchend:j[4]||(j[4]=P=>B()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:x(),target:M}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",un,[e.createElementVNode("div",mn,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",fn,pn)):(e.openBlock(),e.createElementBlock("svg",gn,yn)),e.createElementVNode("span",bn,e.toDisplayString(M.basename),1)]),e.createElementVNode("div",vn,e.toDisplayString(M.path),1)])],42,hn))),256)):e.createCommentVNode("",!0),a.view=="list"&&!S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(J(),(M,L)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:P=>O(M),onTouchstart:P=>A(M),onTouchend:j[5]||(j[5]=P=>B()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:x(),target:M}),["prevent"]),onDragstart:P=>R(P),onDragover:P=>Q(P,M),onDrop:P=>F(P,M),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",_n,[e.createElementVNode("div",kn,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",xn,Sn)):(e.openBlock(),e.createElementBlock("svg",Dn,En)),e.createElementVNode("span",Nn,e.toDisplayString(M.basename),1)]),e.createElementVNode("div",Vn,e.toDisplayString(M.file_size?e.unref(Gr)(M.file_size):""),1),e.createElementVNode("div",Cn,e.toDisplayString(e.unref(Jr)(M.last_modified)),1)])],42,wn))),256)):e.createCommentVNode("",!0),a.view=="grid"&&!S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(J(!1),(M,L)=>{var P,q;return e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:Y=>O(M),onTouchstart:Y=>A(M),onTouchend:j[6]||(j[6]=Y=>B()),onContextmenu:e.withModifiers(Y=>e.unref(r).emit("vf-contextmenu-show",{event:Y,area:m.value,items:x(),target:M}),["prevent"]),onDragstart:Y=>R(Y),onDragover:Y=>Q(Y,M),onDrop:Y=>F(Y,M),class:e.normalizeClass(["vf-item-"+e.unref(b),"border border-transparent hover:bg-neutral-50 m-0.5 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 md:h-24 text-center justify-center select-none"]),"data-type":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",null,[e.createElementVNode("div",$n,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Bn,Tn)):((P=M.mime_type)!=null?P:"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"h-10 md:h-12 m-auto",src:e.unref(Je)(e.unref(s)("adapter",t.data.adapter),M.path),alt:""},null,8,An)):(e.openBlock(),e.createElementBlock("svg",On,Pn)),((q=M.mime_type)!=null?q:"").startsWith("image")?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",jn,e.toDisplayString(o(M.extension)),1))]),e.createElementVNode("span",In,e.toDisplayString(c(M.basename)),1)])],42,Mn)}),256)):e.createCommentVNode("",!0)],38),e.createVNode(nn)]))}}),zn={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Rn={class:"flex leading-5 items-center"},Hn=["aria-label"],Un=[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)],Kn=["value"],Fn={class:"ml-3"},Yn={key:0},Wn={class:"ml-1"},Xn={class:"flex leading-5 items-center"},qn={value:"",disabled:""},Gn=e.createElementVNode("option",{value:"tr"},"Turkish",-1),Jn=e.createElementVNode("option",{value:"en"},"English",-1),Zn=e.createElementVNode("option",{value:"fr"},"French",-1),Qn=["aria-label"],eo=[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)],to=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(a){var b;const t=a,r=inject("emitter"),{getStore:i,setStore:s}=inject("storage"),o=e.ref(0),c=e.ref((b=i("adapter"))!=null?b:t.data.adapter),{t:m,changeLocale:f}=inject("i18n"),p=e.ref(i("locale","")),u=()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:c.value}),s("adapter",c.value)};r.on("vf-nodes-selected",N=>{o.value=N.length});const y=e.ref("");return r.on("vf-search-query",({newQuery:N})=>{y.value=N}),(N,S)=>(e.openBlock(),e.createElementBlock("div",zn,[e.createElementVNode("div",Rn,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(m)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},Un,8,Hn),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=E=>c.value=E),onChange:u,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(a.data.storages,E=>(e.openBlock(),e.createElementBlock("option",{value:E},e.toDisplayString(E),9,Kn))),256))],544),[[e.vModelSelect,c.value]]),e.createElementVNode("div",Fn,[y.value.length?(e.openBlock(),e.createElementBlock("span",Yn,e.toDisplayString(a.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Wn,e.toDisplayString(o.value>0?o.value+" "+e.unref(m)("item(s) selected."):""),1)])]),e.createElementVNode("div",Xn,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=E=>p.value=E),onChange:S[2]||(S[2]=E=>e.unref(f)(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",qn,e.toDisplayString(e.unref(m)("Language")),1),Gn,Jn,Zn],544),[[e.vModelSelect,p.value]]),e.createElementVNode("span",{"aria-label":e.unref(m)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=E=>e.unref(r).emit("vf-modal-show",{type:"message",title:"Vuefinder 1.0",message:e.unref(m)("Vuefinder is a file manager component for vue 3.")}))},eo,8,Qn)])]))}}),ro=(a,t=0,r=!1)=>{let i;return(...s)=>{r&&!i&&a(...s),clearTimeout(i),i=setTimeout(()=>{a(...s)},t)}},no=(a,t,r)=>{const i=e.ref(a);return e.customRef((o,c)=>({get(){return o(),i.value},set:ro(m=>{i.value=m,c()},t,r)}))},oo={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"},io=["aria-label"],ao=[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)],so=["onClick"],lo=[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)],co={class:"flex leading-5"},ho=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),uo=["title","onClick"],mo={key:1,class:"flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},fo=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),po=["onKeydown","placeholder"],go=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],yo=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(a){const t=a,r=inject("emitter"),{getStore:i}=inject("storage"),s=e.ref(null),o=e.ref([]),c=e.ref(!1),m=e.ref(null),{t:f}=inject("i18n");r.on("vf-explorer-update",()=>{var O;let B=[],A=[];s.value=(O=t.data.dirname)!=null?O:i("adapter","local")+"://",s.value.length==0&&(o.value=[]),s.value.replace(i("adapter","local")+"://","").split("/").forEach(function(C){B.push(C),B.join("/")!=""&&A.push({basename:C,name:C,path:i("adapter","local")+"://"+B.join("/"),type:"dir"})}),A.length>4&&(A=A.slice(-5),A[0].name=".."),o.value=A});const p=()=>{c.value=!1,y.value=""};r.on("vf-search-exit",()=>{p()});const u=()=>{c.value=!0,e.nextTick(()=>m.value.focus())},y=no("",400);e.watch(y,B=>{r.emit("vf-search-query",{newQuery:B})});const b=()=>o.value.length&&!c.value,N=B=>{var O;B.preventDefault();let A=JSON.parse(B.dataTransfer.getData("items"));if(A.find(C=>C.storage!=i("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:A,to:(O=o.value[o.value.length-2])!=null?O:{path:i("adapter","local")+"://"}}})},S=B=>{B.preventDefault(),b()?B.dataTransfer.dropEffect="copy":(B.dataTransfer.dropEffect="none",B.dataTransfer.effectAllowed="none")},E=()=>{y.value==""&&p()};return(B,A)=>(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("span",{"aria-label":e.unref(f)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:A[0]||(A[0]=O=>S(O)),onDrop:A[1]||(A[1]=O=>N(O)),onClick:A[2]||(A[2]=O=>{var C,J;return!b()||e.unref(r).emit("vf-fetch",{q:"index",adapter:a.data.adapter,path:(J=(C=o.value[o.value.length-2])==null?void 0:C.path)!=null?J:e.unref(i)("adapter","local")+"://"})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",b()?"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"},ao,34))],8,io),c.value?(e.openBlock(),e.createElementBlock("div",mo,[fo,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,onKeydown:e.withKeys(p,["esc"]),onBlur:E,"onUpdate:modelValue":A[4]||(A[4]=O=>e.isRef(y)?y.value=O:null),placeholder:e.unref(f)("Search anything.."),class:"py-0 px-2 w-full border-0 ring-0 outline-0 text-sm 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,po),[[e.vModelText,e.unref(y)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:p,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},go))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(u,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:A[3]||(A[3]=O=>e.unref(r).emit("vf-fetch",{q:"index",adapter:a.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"},lo)),e.createElementVNode("div",co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(O,C)=>(e.openBlock(),e.createElementBlock("div",{key:C},[ho,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:O.basename,onClick:J=>e.unref(r).emit("vf-fetch",{q:"index",adapter:a.data.adapter,path:O.path})},e.toDisplayString(O.name),9,uo)]))),128))])],8,so))]))}}),bo=["onClick"],vo=e.createElementVNode("span",{class:"px-1"},null,-1),wo=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(a){const t=a,r=inject("emitter"),i=e.ref(null),{apiUrl:s}=ce(),o=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),c=e.ref([]);r.on("vf-context-selected",b=>{c.value=b});const{t:m}=inject("i18n"),f={newfolder:{title:()=>m("New Folder"),action:()=>{r.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>m("Delete"),action:()=>{r.emit("vf-modal-show",{type:"delete",items:c})}},refresh:{title:()=>m("Refresh"),action:()=>{r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:t.current.dirname})}},preview:{title:()=>m("Preview"),action:()=>{r.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:c.value[0]})}},open:{title:()=>m("Open"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:c.value[0].path})}},openDir:{title:()=>m("Open containing folder"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:c.value[0].dir})}},download:{title:()=>m("Download"),action:()=>{const b=s.value+"?"+fe({q:"download",adapter:c.value[0].adapter,path:c.value[0].path});r.emit("vf-download",b)}},archive:{title:()=>m("Archive"),action:()=>{r.emit("vf-modal-show",{type:"archive",items:c})}},unarchive:{title:()=>m("Unarchive"),action:()=>{r.emit("vf-modal-show",{type:"unarchive",items:c})}},rename:{title:()=>m("Rename"),action:()=>{r.emit("vf-modal-show",{type:"rename",items:c})}}},p=b=>{r.emit("vf-contextmenu-hide"),b.action()},u=e.ref("");r.on("vf-search-query",({newQuery:b})=>{u.value=b}),r.on("vf-contextmenu-show",({event:b,area:N,items:S,target:E=null})=>{if(o.items=[],u.value)if(E)o.items.push(f.openDir),r.emit("vf-context-selected",[E]);else return;else!E&&!u.value?(o.items.push(f.refresh),o.items.push(f.newfolder),r.emit("vf-context-selected",[]),console.log("no files selected")):S.length>1&&S.some(B=>B.path===E.path)?(o.items.push(f.refresh),o.items.push(f.archive),o.items.push(f.delete),r.emit("vf-context-selected",S),console.log(S.length+" selected (more than 1 item.)")):(E.type=="dir"?o.items.push(f.open):o.items.push(f.preview),o.items.push(f.rename),o.items.push(f.download),E.mime_type=="application/zip"?o.items.push(f.unarchive):o.items.push(f.archive),o.items.push(f.delete),r.emit("vf-context-selected",[E]),console.log(E.type+" is selected"));y(b,N)}),r.on("vf-contextmenu-hide",()=>{o.active=!1});const y=(b,N)=>{o.active=!0,e.nextTick(()=>{let S=N.getBoundingClientRect(),E=b.pageX,B=b.pageY,A=i.value.offsetHeight,O=i.value.offsetWidth;E=S.right-b.pageX+window.scrollX<O?E-O:E,B=S.bottom-b.pageY+window.scrollY<A?B-A:B,o.positions={left:E+"px",top:B+"px"}})};return(b,N)=>o.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:i,style:e.normalizeStyle(o.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,S=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:S.title,onClick:E=>p(S)},[vo,e.createElementVNode("span",null,e.toDisplayString(S.title()),1)],8,bo))),128))],4)):e.createCommentVNode("",!0)}}),_o=(a,t)=>{const r=a[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((i,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function ko(a){const t=await _o(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>Xs),"../locales/tr.json":()=>Promise.resolve().then(()=>qs)}),`../locales/${a}.json`);return JSON.parse(t.default)}function xo(a,t){const{getStore:r,setStore:i}=Ge(a),s=["en","tr"],o=e.ref({}),c=f=>{s.includes(f)||(console.log("The selected locale is not yet supported. The fallback language is set as 'en'"),f="en"),ko(f).then(p=>{o.value=p,i("locale",f),i("translations",p),console.log(f+" is loaded.")})};r("locale")?o.value=r("translations"):c(t);function m(f){return o.value.hasOwnProperty(f)?o.value[f]:""}return{t:m,support_locales:s,changeLocale:c}}const So=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Do=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"}},setup(a){const t=a,r=yr(),{setStore:i,getStore:s}=Ge(t.id);e.provide("emitter",r),e.provide("storage",Ge(t.id));const o=xo(t.id,t.locale);e.provide("i18n",o);const{apiUrl:c,setApiUrl:m}=ce();m(t.url);const f=e.reactive({adapter:"local",storages:[],dirname:".",files:[]}),p=e.ref(s("viewport","grid")),u=e.ref(s("darkMode",t.dark));r.on("vf-darkMode-toggle",()=>{u.value=!u.value,i("darkMode",u.value)});const y=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{y.value=!y.value,i("full-screen",y.value)}),r.on("vf-view-toggle",S=>{p.value=S});const b=e.reactive({active:!1,type:"delete",data:{}});r.on("vf-modal-close",()=>{b.active=!1}),r.on("vf-modal-show",S=>{b.active=!0,b.type=S.type,b.data=S});const N=S=>{Object.assign(f,S),r.emit("vf-nodes-selected",{}),r.emit("vf-explorer-update")};return r.on("vf-fetch",S=>{Ie(c.value,{params:S}).then(E=>{r.emit("vf-modal-close"),N(E)})}),r.on("vf-download",S=>{document.getElementById("download_frame").src=S,r.emit("vf-modal-close")}),e.onMounted(()=>{r.emit("vf-fetch",{q:"index",adapter:s("adapter",f.adapter)})}),(S,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(u.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([y.value?"fixed w-screen inset-0 z-20":"relative","border flex flex-col rounded-md 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(y.value?"":"max-height: "+a.maxHeight),onMousedown:E[0]||(E[0]=B=>e.unref(r).emit("vf-contextmenu-hide"))},[e.createVNode(Wr,{data:f},null,8,["data"]),e.createVNode(yo,{data:f},null,8,["data"]),e.createVNode(Ln,{view:p.value,data:f},null,8,["view","data"]),e.createVNode(to,{data:f},null,8,["data"])],38),b.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+b.type),{key:0,selection:b.data,current:f},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(wo,{current:f},null,8,["current"]),So],2))}}),Eo=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1),No={class:"fixed z-10 inset-0 overflow-y-auto"},Vo={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 sm:w-full"},Co={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Mo={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"},ae={__name:"ModalLayout",setup(a){const t=inject("emitter");return e.onMounted(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus()}),(r,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(s=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Eo,e.createElementVNode("div",No,[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(s=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Vo,[e.createElementVNode("div",Co,[e.renderSlot(r.$slots,"default")]),e.createElementVNode("div",Mo,[e.renderSlot(r.$slots,"buttons")])])],32)])],32))}},$o={class:"sm:flex sm:items-start"},Bo=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),To={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Ao={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Oo={class:"mt-2"},Po={class:"text-sm text-gray-500"},jo={class:"flex text-sm text-gray-800 dark:text-gray-400"},Io={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"},Lo=[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)],zo={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"},Ro=[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)],Ho={class:"ml-1.5"},Uo={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},Ko=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(a){const t=a,r=inject("emitter"),{getStore:i}=inject("storage"),{t:s}=inject("i18n"),o=e.ref(t.selection.items),c=()=>{o.value.length&&r.emit("vf-fetch",{q:"delete",adapter:i("adapter","local"),path:t.current.dirname,items:JSON.stringify(o.value.map(({path:m,type:f})=>({path:m,type:f})))})};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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(s)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:f[0]||(f[0]=p=>e.unref(r).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(s)("Cancel")),1),e.createElementVNode("div",Uo,e.toDisplayString(e.unref(s)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$o,[Bo,e.createElementVNode("div",To,[e.createElementVNode("h3",Ao,e.toDisplayString(e.unref(s)("Delete files")),1),e.createElementVNode("div",Oo,[e.createElementVNode("p",Po,e.toDisplayString(e.unref(s)("Are you sure you want to delete these files ?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,p=>(e.openBlock(),e.createElementBlock("p",jo,[p.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Io,Lo)):(e.openBlock(),e.createElementBlock("svg",zo,Ro)),e.createElementVNode("span",Ho,e.toDisplayString(p.basename),1)]))),256))])])])]),_:1}))}}),Fo={class:"sm:flex sm:items-start"},Yo=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),Wo={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Xo={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},qo={class:"mt-2"},Go={class:"text-sm text-gray-500"},Jo=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(a){const t=inject("emitter"),{t:r}=inject("i18n");return(i,s)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[0]||(s[0]=o=>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(r)("Close")),1)]),default:e.withCtx(()=>{var o,c,m,f;return[e.createElementVNode("div",Fo,[Yo,e.createElementVNode("div",Wo,[e.createElementVNode("h3",Xo,e.toDisplayString((c=(o=a.selection)==null?void 0:o.title)!=null?c:"Title"),1),e.createElementVNode("div",qo,[e.createElementVNode("p",Go,e.toDisplayString((f=(m=a.selection)==null?void 0:m.message)!=null?f:"Message")+".",1)])])])]}),_:1}))}}),Zo={class:"sm:flex sm:items-start"},Qo=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),ei={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ti={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ri={class:"mt-2"},ni={class:"text-sm text-gray-500"},oi=["onKeyup","placeholder"],ii=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(a){const t=a,r=inject("emitter"),{getStore:i}=inject("storage"),{t:s}=inject("i18n"),o=e.ref(""),c=()=>{o.value!=""&&(r.emit("vf-fetch",{q:"newfolder",adapter:i("adapter","local"),path:t.current.dirname,name:o.value}),r.emit("vf-toast-push",{label:"New Folder is created successfully",type:"success"}))};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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(s)("Create")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=p=>e.unref(r).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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Zo,[Qo,e.createElementVNode("div",ei,[e.createElementVNode("h3",ti,e.toDisplayString(e.unref(s)("New Folder")),1),e.createElementVNode("div",ri,[e.createElementVNode("p",ni,e.toDisplayString(e.unref(s)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=p=>o.value=p),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("Folder Name"),type:"text"},null,40,oi),[[e.vModelText,o.value]])])])])]),_:1}))}}),ai={class:"sm:flex sm:items-start"},si=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),li={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ci={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},di={class:"mt-2"},hi={class:"text-sm text-gray-500"},ui=["onKeyup","placeholder"],mi=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(a){const t=a,r=inject("emitter"),{getStore:i}=inject("storage"),{t:s}=inject("i18n"),o=e.ref(""),c=()=>{o.value!=""&&r.emit("vf-fetch",{q:"newfile",adapter:i("adapter","local"),path:t.current.dirname,name:o.value})};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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"},"Create!"),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=p=>e.unref(r).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"},"Cancel")]),default:e.withCtx(()=>[e.createElementVNode("div",ai,[si,e.createElementVNode("div",li,[e.createElementVNode("h3",ci,e.toDisplayString(e.unref(s)("New File")),1),e.createElementVNode("div",di,[e.createElementVNode("p",hi,e.toDisplayString(e.unref(s)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=p=>o.value=p),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("File Name"),type:"text"},null,40,ui),[[e.vModelText,o.value]])])])])]),_:1}))}}),fi={class:"flex"},pi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},gi={class:"ml-auto mb-2"},yi={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"},bi={key:1},vi={__name:"Text",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,i=e.ref(""),s=e.ref(""),o=e.ref(null),c=e.ref(!1),{apiUrl:m}=ce(),{t:f}=e.inject("i18n");e.onMounted(()=>{Ie(m.value,{params:{q:"preview",adapter:r.selection.adapter,path:r.selection.item.path},json:!1}).then(y=>{i.value=y,t("load")})});const p=()=>{c.value=!c.value,s.value=i.value,c.value==!0&&e.nextTick(()=>{o.value.focus()})},u=()=>{Ie(m.value,{method:"POST",params:{q:"save",adapter:r.selection.adapter,path:r.selection.item.path,content:s.value},json:!1}).then(y=>{i.value=y,t("load"),c.value=!c.value}).catch(y=>console.log(y.statusText))};return(y,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",fi,[e.createElementVNode("div",pi,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",gi,[c.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:u,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(f)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:b[0]||(b[0]=N=>p())},e.toDisplayString(c.value?e.unref(f)("Cancel"):e.unref(f)("Edit")),1)])]),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",bi,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:o,"onUpdate:modelValue":b[1]||(b[1]=N=>s.value=N),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] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,s.value]])])):(e.openBlock(),e.createElementBlock("pre",yi,e.toDisplayString(i.value),1))])],64))}},vc="";/*!
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L=function(l,n,g){var d=l.x,v=l.y,w=g.x,_=g.y,k={"+":{x:d+w,y:v+_},"-":{x:d-w,y:v-_},"*":{x:d*w,y:v*_},"/":{x:d/w,y:v/_}};return k[n]},P=function(l){return{x:l.left,y:l.top}},q=function(l){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:l.x,top:l.y,right:l.x,bottom:l.y,width:n,height:n}},Y=function(l){return{x:l,y:l}},Oe=function(h,l,n){window.addEventListener("resize",l),window.addEventListener("scroll",l),h.forEach(function(g,d){n.observe(g,{childList:d!==0,attributes:!0})})},Pe=function(h){var l=Se(h);return l.x||l.y?!0:h instanceof HTMLDocument?h.body?!!(h.body.scrollTop=1):!!(h.documentElement.scrollTop=1):!!(h.scrollTop=1)},Fe=function(h){var l=document.createElement("div");return l.style.position="fixed",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="999999999999999999",l.classList.add(h),l},Ye=function(h){var l=document.createElement("div");return l.style.position="absolute",h||(l.style.background="rgba(0, 0, 255, 0.1)",l.style.border="1px solid rgba(0, 0, 255, 0.45)",l.style.display="none",l.style.pointerEvents="none"),l},We=function(h,l){var n;return function(){for(var g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];var w=function(){n=null,h.apply(void 0,d)};clearTimeout(n),n=setTimeout(w,l)}},xe=function(){var h,l,n,g;return{y:((h=document.body)===null||h===void 0?void 0:h.scrollTop)||((l=document.documentElement)===null||l===void 0?void 0:l.scrollTop)||0,x:((n=document.body)===null||n===void 0?void 0:n.scrollLeft)||((g=document.documentElement)===null||g===void 0?void 0:g.scrollLeft)||0}},pt=function(h,l){if(h instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=h.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(h.clientWidth||n.width)*l,height:(h.clientHeight||n.height)*l}},Se=function(h){return!h||h instanceof Document?xe():{x:h.scrollLeft>=0?h.scrollLeft:xe().x,y:h.scrollTop>=0?h.scrollTop:xe().y}},Jt=function(h){var l=h.elementRect,n=h.containerRect,g=h.tolerance,d=g===void 0?{x:0,y:0}:g,v=[];return l.top-d.y<n.top&&v.push("top"),l.left-d.x<n.left&&v.push("left"),l.bottom+d.y>n.bottom&&v.push("bottom"),l.right+d.y>n.right&&v.push("right"),v},Gs=function(h){var l=h.event;return{x:l.clientX,y:l.clientY}},Js=function(h){var l=h.scrollAmount,n=h.initialPointerPos,g=h.pointerPos,d={};return g.x>n.x-l.x?(d.left=n.x-l.x,d.width=g.x-n.x+l.x):(d.left=g.x,d.width=n.x-g.x-l.x),g.y>n.y-l.y?(d.top=n.y-l.y,d.height=g.y-n.y+l.y):(d.top=g.y,d.height=n.y-g.y-l.y),d},Zt=function(l){var n={x:0,y:0},g=window.getComputedStyle(l);if(!g.transform||g.transform==="none")return n;if(g.transform.indexOf("3d")>=0){var d=g.transform.trim().match(/matrix3d\((.*?)\)/);if(d&&d.length){var v,w=(v=d[1])===null||v===void 0?void 0:v.split(",");n.x=parseInt(w[12])||0,n.y=parseInt(w[13])||0}return n}else{var _=g.transform.trim().match(/matrix\((.*?)\)/);if(_&&_.length){var k,V=(k=_[1])===null||k===void 0?void 0:k.split(",");n.x=parseInt(V[4])||0,n.y=parseInt(V[5])||0}return n}},Zs=function(l){var n=l.style.transform;if(!n||n.indexOf("translate")<0)return Zt(l);var g={x:0,y:0},d=n.trim().match(/translate[3dD]*?\(.*?\)/);if(d){var v,w=(v=d[0])===null||v===void 0?void 0:v.split("(");if(w){var _,k=(_=w[1])===null||_===void 0?void 0:_.split(",");g.x=parseInt(k[0])||0,g.y=parseInt(k[1])||0}}return!g.x&&!g.x?Zt(l):g},Qs=function(l){var n=l.style,g={x:parseInt(n.left)||0,y:parseInt(n.top)||0};if(!g.x&&!g.x){var d=window.getComputedStyle(l);return{x:parseInt(d.left)||0,y:parseInt(d.top)||0}}return g},el=function(h,l){return l?Zs(h):Qs(h)},tl=function(h){var l=h.element,n=h.edges,g=h.elementRect,d=h.containerRect,v=h.elementPos,w=h.useTransform;n.includes("top")&&je(l,{y:v.y+d.top-g.top,x:v.x},w),n.includes("left")&&je(l,{y:v.y,x:v.x+d.left-g.left},w),n.includes("bottom")&&je(l,{y:v.y+d.bottom-g.bottom,x:v.x},w),n.includes("right")&&je(l,{y:v.y,x:v.x+d.right-g.right},w)},Qt=function(h){var l=h.computedStyle,n=h.node,g=l.position,d=g==="absolute"||g==="relative"||g==="fixed";!(n instanceof HTMLDocument)&&!d&&(n.style.position="relative")},rl=function(h){var l=h.shiftKey,n=h.keyboardDragSpeed,g=h.zoom,d=h.key,v=h.dragKeys,w=h.scrollDiff,_=h.canScroll,k=h.scrollCallback,V={x:0,y:0},D=l?n*4*g:n*g;return v.left.includes(d)&&(V.x=w.x||-D,!l&&!w.x&&_&&k(["left"],n)),v.right.includes(d)&&(V.x=w.x||D,!l&&!w.x&&_&&k(["right"],n)),v.up.includes(d)&&(V.y=w.y||-D,!l&&!w.y&&_&&k(["top"],n)),v.down.includes(d)&&(V.y=w.y||D,!l&&!w.y&&_&&k(["bottom"],n)),V},nl=function(h){var l=h.element,n=h.force,g=h.multiSelectionToggle,d=h.SelectedSet,v=h.hoverClassName;l.classList.contains(v)&&!n||(d.has(l)?g&&d.delete(l):d.add(l),l.classList.add(v))},ol=function(h){var l=h.element,n=h.force,g=h.SelectedSet,d=h.PrevSelectedSet,v=h.hoverClassName;if(!l.classList.contains(v)&&!n)return!1;var w=g.has(l),_=d.has(l);w&&!_?g.delete(l):!w&&_&&g.add(l),l.classList.remove(v)},gt=function(h,l){return h.left<l.right&&h.right>l.left&&h.top<l.bottom&&h.bottom>l.top},er=function(h){var l=h.element,n=h.posDirection,g=h.containerRect,d=h.useTransform,v=el(l,d),w=L(v,"+",n);je(l,w,d);var _=l.getBoundingClientRect(),k=Jt({elementRect:_,containerRect:g});tl({element:l,edges:k,elementRect:_,containerRect:g,elementPos:w,useTransform:d})},il=function(h,l){window.removeEventListener("resize",l),window.removeEventListener("scroll",l),h.disconnect()},al=function(h,l,n){if(!!l.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,d=h instanceof HTMLDocument?g||document.body:h,v=l.includes("top")&&d.scrollTop>0,w=l.includes("bottom")&&d.scrollTop<d.scrollHeight,_=l.includes("left")&&d.scrollLeft>0,k=l.includes("right")&&d.scrollLeft<d.scrollWidth;v&&(d.scrollTop-=1*n),w&&(d.scrollTop+=1*n),_&&(d.scrollLeft-=1*n),k&&(d.scrollLeft+=1*n)}},je=function(h,l,n){if(n){var g=h.style.transform;h.style.transform="translate3d(".concat(l.x,"px,").concat(l.y,"px,1px) ").concat(g.replace(/translate.*?\)/g,""))}else h.style.left="".concat(l.x,"px"),h.style.top="".concat(l.y,"px");return h},sl=function(h){for(var l=h.subscribe,n=h.publish,g=h.Interaction,d=h.SelectedSet,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(D){return D.event}}],"Interaction:end":[{name:"callback"}]},w=function(){var D=J(k[_],2),T=D[0],I=D[1];["pre",!1].forEach(function(W){return l(W?"".concat(T,":").concat(W):T,function(ne){return I.forEach(function(G){return(!G.condition||G.condition(ne))&&n(W?"".concat(W).concat(G.name):G.name,m({items:d.elements,isDragging:g.isDragging},ne))})})})},_=0,k=Object.entries(v);_<k.length;_++)w()},De=function(h){return h?!Array.isArray(h)&&(h instanceof HTMLElement||h instanceof SVGElement)?[h]:K(h):[]},tr=function(h,l){h.style.left="".concat(l.left,"px"),h.style.top="".concat(l.top,"px"),h.style.width="".concat(l.width,"px"),h.style.height="".concat(l.height,"px")},ll=function(){function h(l){var n=this,g=l.area,d=l.PS,v=l.zoom;r(this,h),o(this,"_modificationCallback",void 0),o(this,"_modificationObserver",void 0),o(this,"_zoom",void 0),o(this,"_node",void 0),o(this,"_parentNodes",void 0),o(this,"_computedStyle",void 0),o(this,"_computedBorder",void 0),o(this,"_rect",void 0),o(this,"setArea",function(w){n._node=w,Qt({computedStyle:n.computedStyle,node:n._node}),setTimeout(function(){n.PubSub.publish("Area:modified:pre",{item:n}),n.reset(),n.PubSub.publish("Area:modified",{item:n})})}),o(this,"start",function(){Oe(n.parentNodes,n._modificationCallback,n._modificationObserver)}),o(this,"reset",function(){n._computedStyle=void 0,n._rect=void 0,n._computedBorder=void 0,n._parentNodes=void 0}),o(this,"stop",function(){il(n._modificationObserver,n._modificationCallback),n.reset()}),o(this,"scroll",function(w,_){var k={scroll_directions:w,scroll_multiplier:_};n.PubSub.publish("Area:scroll:pre",k),al(n._node,w,_),n.PubSub.publish("Area:scroll",k)}),this._zoom=v,this.PubSub=d,this.setArea(g),this._modificationCallback=We(function(w){n.PubSub.publish("Area:modified:pre",{event:w,item:n}),n.reset(),n.PubSub.publish("Area:modified",{event:w,item:n})},60),this._modificationObserver=new MutationObserver(this._modificationCallback),this.PubSub.subscribe("Interaction:init",this.start),this.PubSub.subscribe("Interaction:end",this.reset)}return s(h,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof HTMLDocument?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=pt(this.HTMLNode,this._zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;var n=function g(d){var v,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=(v=d[w])===null||v===void 0?void 0:v.parentNode;return _?(d.push(_),w++,g(d,w)):d};return this._parentNodes=n([this.HTMLNode]),this._parentNodes}}]),h}(),cl=function(){function h(l){var n=this,g=l.DS,d=l.dragKeys,v=l.draggability,w=l.keyboardDrag,_=l.keyboardDragSpeed,k=l.useTransform,V=l.zoom;r(this,h),o(this,"_useTransform",void 0),o(this,"_prevCursorPos",void 0),o(this,"_prevScrollPos",void 0),o(this,"_elements",[]),o(this,"_draggability",void 0),o(this,"_dragKeys",void 0),o(this,"_dragKeysFlat",void 0),o(this,"_keyboardDrag",void 0),o(this,"_keyboardDragSpeed",void 0),o(this,"_zoom",void 0),o(this,"keyboardDrag",function(D){var T=D.event,I=D.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability||n.DS.continue)){var W={event:T,isDragging:!0,isDraggingKeyboard:!0};n.DS.publish(["Interaction:start:pre","Interaction:start"],W),n._elements=n.DS.getSelection(),n.handleZIndex(!0);var ne=rl({shiftKey:n.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:n._keyboardDragSpeed,zoom:n._zoom,key:I,scrollCallback:n.DS.Area.scroll,scrollDiff:n._scrollDiff,canScroll:n.DS.stores.ScrollStore.canScroll,dragKeys:n._dragKeys});n._elements.forEach(function(G){return er({element:G,posDirection:ne,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})}),n.DS.publish(["Interaction:update:pre","Interaction:update"],W)}}),o(this,"keyboardEnd",function(D){var T=D.event,I=D.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability)){var W={event:T,isDragging:n._draggability,isDraggingKeyboard:!0};n.DS.publish(["Interaction:end:pre","Interaction:end"],W)}}),o(this,"start",function(D){var T=D.isDragging,I=D.isDraggingKeyboard;!T||I||(n._prevCursorPos=null,n._prevScrollPos=null,n._elements=n.DS.getSelection(),n.handleZIndex(!0))}),o(this,"stop",function(D){D!=null&&D.isKeyboard||(n._prevCursorPos=null,n._prevScrollPos=null,n.handleZIndex(!1),n._elements=[])}),o(this,"update",function(D){var T=D.isDragging,I=D.isDraggingKeyboard;if(!(!T||!n._elements.length||I||n.DS.continue)){var W=L(n._cursorDiff,"+",n._scrollDiff);n._elements.forEach(function(ne){return er({element:ne,posDirection:W,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})})}}),o(this,"handleZIndex",function(D){n._elements.forEach(function(T){return T.style.zIndex="".concat((parseInt(T.style.zIndex)||0)+D?9999:-9998)})}),this.DS=g,this._useTransform=k,this._keyboardDragSpeed=_,this._keyboardDrag=w,this._zoom=V,this._draggability=v,this._dragKeys={up:d.up.map(function(D){return D.toLowerCase()}),down:d.down.map(function(D){return D.toLowerCase()}),left:d.left.map(function(D){return D.toLowerCase()}),right:d.right.map(function(D){return D.toLowerCase()})},this._dragKeysFlat=[].concat(K(this._dragKeys.up),K(this._dragKeys.down),K(this._dragKeys.left),K(this._dragKeys.right)),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 s(h,[{key:"_cursorDiff",get:function(){var n=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?L(n,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=n,g}},{key:"_scrollDiff",get:function(){var n=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?L(n,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=n,g}}]),h}(),dl=function(){function h(l){var n=this,g=l.DS,d=l.areaElement,v=l.draggability,w=l.immediateDrag,_=l.selectableClass;r(this,h),o(this,"_areaElement",void 0),o(this,"_draggability",void 0),o(this,"_immediateDrag",void 0),o(this,"_selectableClass",void 0),o(this,"isInteracting",void 0),o(this,"isDragging",void 0),o(this,"init",function(){return n.DS.publish("Interaction:init:pre",{})}),o(this,"_init",function(){n.stop(),n._areaElement.addEventListener("mousedown",n.start),n._areaElement.addEventListener("touchstart",n.start,{passive:!1}),n.DS.publish("Interaction:init",{})}),o(this,"start",function(k){return n.DS.publish("Interaction:start:pre",{event:k,isDragging:n.isDragging})}),o(this,"_start",function(k){k.type==="touchstart"&&k.preventDefault(),n._canInteract(k)&&(n.isInteracting=!0,n.isDragging=n.isDragEvent(k),n.DS.publish("Interaction:start",{event:k,isDragging:n.isDragging}),document.addEventListener("mouseup",n.reset),document.addEventListener("touchend",n.reset))}),o(this,"isDragEvent",function(k){var V=k.target.closest(".".concat(n._selectableClass));return!n._draggability||n.DS.stores.KeyStore.isMultiSelectKeyPressed(k)||!V?!1:(n._immediateDrag&&(n.DS.SelectedSet.size?n.DS.SelectedSet.has(V)||(n.DS.SelectedSet.clear(),n.DS.SelectedSet.add(V)):n.DS.SelectedSet.add(V)),!!n.DS.SelectedSet.has(V))}),o(this,"onClick",function(k){var V=k.event;if(!!n._canInteract(V)&&!(V.detail>0)){var D=n.DS,T=D.stores,I=T.PointerStore,W=T.KeyStore,ne=D.SelectableSet,G=D.SelectedSet;I.start(V);var Ee=V.target;!ne.has(Ee)||(W.isMultiSelectKeyPressed(V)||G.clear(),G.toggle(Ee),n.reset())}}),o(this,"stop",function(){n.isInteracting=!1,n.isDragging=!1,n._areaElement.removeEventListener("mousedown",n.start),n._areaElement.removeEventListener("touchstart",n.start,{passive:!1}),document.removeEventListener("mouseup",n.reset),document.removeEventListener("touchend",n.reset)}),o(this,"update",function(k){var V=k.event,D=k.scroll_directions,T=k.scroll_multiplier;n.isInteracting&&n.DS.publish(["Interaction:update:pre","Interaction:update"],{event:V,scroll_directions:D,scroll_multiplier:T,isDragging:n.isDragging})}),o(this,"reset",function(k){return n.DS.publish("Interaction:end:pre",{event:k,isDragging:n.isDragging})}),o(this,"_reset",function(k){var V=n.isDragging;n.stop(),n.init(),n.DS.publish("Interaction:end",{event:k,isDragging:V})}),this._areaElement=d,this._draggability=v,this._immediateDrag=w,this._selectableClass=_,this.DS=g,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(k){var V=k.event;return n.start(V)}),this.DS.subscribe("Interaction:start:pre",function(k){var V=k.event;return n._start(V)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(k){var V=k.event;return n._reset(V)}),this.DS.subscribe("Area:scroll",this.update)}return s(h,[{key:"_canInteract",value:function(n){var g=n.clientX===0&&n.clientY===0&&n.detail===0&&n.target;return!(n.button===2||this.isInteracting||n.target&&!this.DS.SelectorArea.isInside(n.target)||!g&&!this.DS.SelectorArea.isClicked(n))}}]),h}(),hl=function h(l){var n=this,g=l.DS;r(this,h),o(this,"subscribers",{}),o(this,"subscribe",function(d,v){return Array.isArray(n.subscribers[d])||(n.subscribers[d]=[]),n.subscribers[d].push(v),n.subscribers[d].length-1}),o(this,"unsubscribe",function(d,v,w){w>=0?n.subscribers[d].splice(w,1):v&&(n.subscribers[d]=n.subscribers[d].filter(function(_){return _!==v}))}),o(this,"publish",function(d,v){Array.isArray(d)?d.forEach(function(w){return n._publish(w,v)}):n._publish(d,v)}),o(this,"_publish",function(d,v){var w=n.subscribers[d];!Array.isArray(w)||(d.includes(":pre")?n._handlePrePublish(w,v):n._handlePublish(w,v))}),o(this,"_handlePublish",function(d,v){for(var w=0,_=d.length;w<_;w++){if(n.DS.stopped)return;d[w](v)}}),o(this,"_handlePrePublish",function(d,v){for(var w=d.length;w--;){if(n.DS.stopped)return;d[w](v)}}),this.DS=g},ul=function(h){f(n,h);var l=A(n);function n(g){var d,v=g.elements,w=g.className,_=g.hoverClassName,k=g.draggability,V=g.useTransform,D=g.DS;return r(this,n),d=l.call(this),o(E(d),"_initElements",void 0),o(E(d),"_className",void 0),o(E(d),"_hoverClassName",void 0),o(E(d),"_useTransform",void 0),o(E(d),"_draggability",void 0),o(E(d),"init",function(){return d._initElements.forEach(function(T){return d.add(T)})}),o(E(d),"clear",function(){return d.forEach(function(T){return d.delete(T)})}),o(E(d),"_onClick",function(T){return d.DS.publish(["Selectable:click:pre","Selectable:click"],{event:T})}),o(E(d),"_onPointer",function(T){return d.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:T})}),o(E(d),"addAll",function(T){return T.forEach(function(I){return d.add(I)})}),o(E(d),"deleteAll",function(T){return T.forEach(function(I){return d.delete(I)})}),d.DS=D,d._initElements=De(v),d._className=w,d._hoverClassName=_,d._useTransform=V,d._draggability=k,d.DS.subscribe("Interaction:init",d.init),d}return s(n,[{key:"add",value:function(d){return d.classList.add(this._className),d.addEventListener("click",this._onClick),d.addEventListener("mousedown",this._onPointer),d.addEventListener("touchstart",this._onPointer,{passive:!1}),this._draggability&&!this._useTransform&&Qt({computedStyle:window.getComputedStyle(d),node:d}),C(p(n.prototype),"add",this).call(this,d)}},{key:"delete",value:function(d){return d.classList.remove(this._className),d.classList.remove(this._hoverClassName),d.removeEventListener("click",this._onClick),d.removeEventListener("mousedown",this._onPointer),d.removeEventListener("touchstart",this._onPointer,{passive:!1}),C(p(n.prototype),"delete",this).call(this,d)}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(S(Set)),ml=function(h){f(n,h);var l=A(n);function n(g){var d,v=g.className,w=g.DS;return r(this,n),d=l.call(this),o(E(d),"_className",void 0),o(E(d),"clear",function(){return d.forEach(function(_){return d.delete(_)})}),o(E(d),"addAll",function(_){return _.forEach(function(k){return d.add(k)})}),o(E(d),"deleteAll",function(_){return _.forEach(function(k){return d.delete(k)})}),d.DS=w,d._className=v,d}return s(n,[{key:"add",value:function(d){if(!C(p(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};return this.DS.publish("Selected:added:pre",v),C(p(n.prototype),"add",this).call(this,d),d.classList.add(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)+1),this.DS.publish("Selected:added",v),this}}},{key:"delete",value:function(d){if(!!C(p(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};this.DS.publish("Selected:removed:pre",v);var w=C(p(n.prototype),"delete",this).call(this,d);return d.classList.remove(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)-1),this.DS.publish("Selected:removed",v),w}}},{key:"toggle",value:function(d){return this.has(d)?this.delete(d):this.add(d),d}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(S(Set)),fl=function(){function h(l){var n=this,g=l.DS,d=l.hoverClassName,v=l.multiSelectToggling;r(this,h),o(this,"_prevSelectedSet",void 0),o(this,"_hoverClassName",void 0),o(this,"_multiSelectToggling",void 0),o(this,"start",function(w){var _=w.event,k=w.isDragging;k||(n._storePrevious(_),n._handleInsideSelection(!0,_))}),o(this,"update",function(w){var _=w.isDragging;_||n.DS.continue||n._handleInsideSelection()}),o(this,"_handleInsideSelection",function(w,_){for(var k=n.DS,V=k.SelectableSet,D=k.SelectorArea,T=k.Selector,I=V.elements.map(function(me){return[me,me.getBoundingClientRect()]}),W=[],ne=[],G=0,Ee=I.length;G<Ee;G++)!D.isInside(I[G][0],I[G][1])||(gt(I[G][1],T.rect)?W.push(I[G][0]):ne.push(I[G][0]));var Xe=n.DS.stores.KeyStore.isMultiSelectKeyPressed(_)&&n._multiSelectToggling;n.DS.continue||(W.forEach(function(me){return nl({element:me,force:w,multiSelectionToggle:Xe,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName})}),ne.forEach(function(me){return ol({element:me,force:w,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName,PrevSelectedSet:n._prevSelectedSet})}))}),this._hoverClassName=d,this._multiSelectToggling=v,this.DS=g,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(h,[{key:"_storePrevious",value:function(n){var g=this.DS,d=g.stores.KeyStore,v=g.SelectedSet;d.isMultiSelectKeyPressed(n)?this._prevSelectedSet=new Set(v):this._prevSelectedSet=new Set}}]),h}(),pl=function(){function h(l){var n=this,g=l.DS,d=l.selector,v=l.selectorClass,w=l.customStyles;r(this,h),o(this,"_rect",void 0),o(this,"start",function(_){var k=_.isDragging;if(!k){var V=n.DS.stores.PointerStore,D=V.initialValArea;tr(n.HTMLNode,q(D,1)),n.HTMLNode.style.display="block",n._rect=null}}),o(this,"stop",function(){n.HTMLNode.style.width="0",n.HTMLNode.style.height="0",n.HTMLNode.style.display="none"}),o(this,"update",function(_){var k=_.isDragging;if(!(k||n.DS.continue)){var V=n.DS.stores,D=V.ScrollStore,T=V.PointerStore,I=Js({scrollAmount:D.scrollAmount,initialPointerPos:T.initialValArea,pointerPos:T.currentValArea});tr(n.HTMLNode,I),n._rect=null}}),this.DS=g,this.HTMLNode=d||Ye(w),this.HTMLNode.classList.add(v),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(h,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),gl=function(){function h(l){var n=this,g=l.DS,d=l.selectorAreaClass,v=l.autoScrollSpeed,w=l.overflowTolerance;r(this,h),o(this,"_autoScrollSpeed",void 0),o(this,"_scrollInterval",void 0),o(this,"_rect",void 0),o(this,"currentEdges",[]),o(this,"_overflowTolerance",void 0),o(this,"start",function(){return n.applyElements("append")}),o(this,"applyElements",function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",k=document.body?"body":"documentElement",V="".concat(_,"Child");n.HTMLNode[V](n.DS.Selector.HTMLNode),document[k][V](n.HTMLNode)}),o(this,"updatePos",function(){n._rect=null;var _=n.DS.Area.rect,k=n.DS.Area.computedBorder,V=n.HTMLNode.style,D="".concat(_.top+k.top,"px"),T="".concat(_.left+k.left,"px"),I="".concat(_.width,"px"),W="".concat(_.height,"px");V.top!==D&&(V.top=D),V.left!==T&&(V.left=T),V.width!==I&&(V.width=I),V.height!==W&&(V.height=W)}),o(this,"stop",function(_){n.stopAutoScroll(),_&&n.applyElements("remove")}),o(this,"startAutoScroll",function(){n.currentEdges=[],n._scrollInterval=setInterval(function(){return n.handleAutoScroll()},16)}),o(this,"handleAutoScroll",function(){if(!n.DS.continue){var _=n.DS,k=_.stores.PointerStore,V=_.Area;n.currentEdges=Jt({elementRect:q(k.currentVal),containerRect:n.rect,tolerance:n._overflowTolerance}),n.currentEdges.length&&V.scroll(n.currentEdges,n._autoScrollSpeed)}}),o(this,"stopAutoScroll",function(){n.currentEdges=[],clearInterval(n._scrollInterval)}),o(this,"isInside",function(_,k){return n.DS.Area.HTMLNode.contains(_)&&n.DS.stores.ScrollStore.canScroll?!0:gt(n.rect,k||_.getBoundingClientRect())}),this._autoScrollSpeed=v,this._overflowTolerance=w,this.DS=g,this.HTMLNode=Fe(d),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(){n.updatePos(),n.stopAutoScroll()})}return s(h,[{key:"isClicked",value:function(n){var g=this.DS.stores.PointerStore,d=n?g.getPointerPosition(n):g.initialVal;return gt({left:d.x,top:d.y,right:d.x,bottom:d.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),yl=function(){function h(l){var n=this,g=l.DS,d=l.multiSelectKeys,v=l.multiSelectMode;r(this,h),o(this,"_multiSelectMode",void 0),o(this,"_multiSelectKeys",void 0),o(this,"_currentValues",new Set),o(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),o(this,"init",function(){document.addEventListener("keydown",n.keydown),document.addEventListener("keyup",n.keyup),window.addEventListener("blur",n.reset)}),o(this,"keydown",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:down:pre",{event:w,key:_}),n._currentValues.add(_),n.DS.publish("KeyStore:down",{event:w,key:_})}),o(this,"keyup",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:up:pre",{event:w,key:_}),n._currentValues.delete(_),n.DS.publish("KeyStore:up",{event:w,key:_})}),o(this,"stop",function(){document.removeEventListener("keydown",n.keydown),document.removeEventListener("keyup",n.reset),window.removeEventListener("blur",n.reset),n.reset()}),o(this,"reset",function(){return n._currentValues.clear()}),this.DS=g,this._multiSelectMode=v,this._multiSelectKeys=d.map(function(w){var _={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"},k=_[w];return k?(console.warn("[DragSelect] ".concat(w,' is deprecated. Use "').concat(k,'" instead. Act Now!. See docs for more info')),k.toLowerCase()):w.toLowerCase()}),this.DS.subscribe("Interaction:init",this.init)}return s(h,[{key:"isMultiSelectKeyPressed",value:function(n){var g=this;return!!(this._multiSelectMode||this.currentValues.some(function(d){return g._multiSelectKeys.includes(d)})||n&&this._multiSelectKeys.some(function(d){return n[g._keyMapping[d]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),h}(),bl=function(){function h(l){var n=this,g=l.DS;r(this,h),o(this,"_isMouseInteraction",!1),o(this,"_initialValArea",void 0),o(this,"_currentValArea",void 0),o(this,"_lastValArea",void 0),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_lastVal",void 0),o(this,"_lastTouch",void 0),o(this,"init",function(){document.addEventListener("mousemove",n.update),document.addEventListener("touchmove",n.update,{passive:!1})}),o(this,"getPointerPosition",function(d){return Gs({event:n._normalizedEvent(d)})}),o(this,"update",function(d){!d||(n.DS.publish("PointerStore:updated:pre",{event:d}),n.currentVal=n.getPointerPosition(d),n._isMouseInteraction&&n.DS.publish("PointerStore:updated",{event:d}))}),o(this,"stop",function(){document.removeEventListener("mousemove",n.update),document.removeEventListener("touchmove",n.update,{passive:!1}),setTimeout(function(){return n._isMouseInteraction=!1},100)}),o(this,"reset",function(d){!d||(n.currentVal=n.lastVal=n.getPointerPosition(d),n.stop(),n.init())}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(d){var v=d.event;return n.start(v)}),this.DS.subscribe("Interaction:end",function(d){var v=d.event;return n.reset(v)})}return s(h,[{key:"start",value:function(n){!n||(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(n))}},{key:"_normalizedEvent",value:function(n){return"touches"in n&&n.type!=="touchend"&&(this._lastTouch=n),"touches"in n?this._lastTouch.touches[0]:n}},{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(n){this._initialVal=n,this._initialValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(n){this._currentVal=n,this._currentValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(n){this._lastVal=n,this._lastValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}}]),h}(),vl=function(){function h(l){var n=this,g=l.DS,d=l.areaElement,v=l.zoom;r(this,h),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_areaElement",void 0),o(this,"_canScroll",void 0),o(this,"init",function(){return n._areaElement.addEventListener("scroll",n.update)}),o(this,"start",function(){n._currentVal=n._initialVal=Se(n._areaElement),n._areaElement.addEventListener("scroll",n.update)}),o(this,"update",function(){return n._currentVal=Se(n._areaElement)}),o(this,"stop",function(){n._areaElement.removeEventListener("scroll",n.update),n._initialVal={x:0,y:0},n._canScroll=null}),o(this,"reset",function(){n.stop(),n.start()}),this._areaElement=d,this.DS=g,this.zoom=v,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return n.start()}),this.DS.subscribe("Interaction:end",function(){return n.reset()})}return s(h,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=Pe(this._areaElement)}},{key:"scrollAmount",get:function(){var n=L(this.currentVal,"-",this.initialVal),g=Y(this.zoom),d=L(L(n,"*",g),"-",n);return{x:n.x+d.x,y:n.y+d.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=Se(this._areaElement)),this._currentVal}}]),h}(),wl=function(){function h(l){var n=this,g=l.area,d=g===void 0?document:g,v=l.selectables,w=v===void 0?[]:v,_=l.autoScrollSpeed,k=_===void 0?5:_,V=l.overflowTolerance,D=V===void 0?{x:25,y:25}:V,T=l.zoom,I=T===void 0?1:T,W=l.customStyles,ne=W===void 0?!1:W,G=l.multiSelectMode,Ee=G===void 0?!1:G,Xe=l.multiSelectToggling,me=Xe===void 0?!0:Xe,rr=l.multiSelectKeys,_l=rr===void 0?["Control","Shift","Meta"]:rr,nr=l.selector,kl=nr===void 0?void 0:nr,or=l.draggability,yt=or===void 0?!0:or,ir=l.immediateDrag,xl=ir===void 0?!0:ir,ar=l.keyboardDrag,Sl=ar===void 0?!0:ar,Dl=l.dragKeys,sr=l.keyboardDragSpeed,El=sr===void 0?10:sr,lr=l.useTransform,cr=lr===void 0?!0:lr,dr=l.hoverClass,hr=dr===void 0?"ds-hover":dr,ur=l.selectableClass,mr=ur===void 0?"ds-selectable":ur,fr=l.selectedClass,Nl=fr===void 0?"ds-selected":fr,pr=l.selectorClass,Vl=pr===void 0?"ds-selector":pr,gr=l.selectorAreaClass,Cl=gr===void 0?"ds-selector-area":gr,Ml=l.callback,$l=l.onDragMove,Bl=l.onDragStartBegin,Tl=l.onDragStart,Al=l.onElementSelect,Ol=l.onElementUnselect;r(this,h),o(this,"continue",!1),o(this,"start",function(){n.stopped=!1,n.Interaction.init()}),o(this,"break",function(){return n.continue=!0}),o(this,"getSelection",function(){return n.SelectedSet.elements}),o(this,"getSelectables",function(){return n.SelectableSet.elements}),o(this,"getInitialCursorPosition",function(){return n.stores.PointerStore.initialVal}),o(this,"getCurrentCursorPosition",function(){return n.stores.PointerStore.currentVal}),o(this,"getPreviousCursorPosition",function(){return n.stores.PointerStore.lastVal}),o(this,"getInitialCursorPositionArea",function(){return n.stores.PointerStore.initialValArea}),o(this,"getCurrentCursorPositionArea",function(){return n.stores.PointerStore.currentValArea}),o(this,"getPreviousCursorPositionArea",function(){return n.stores.PointerStore.lastValArea}),o(this,"isMultiSelect",function(Pl){return n.stores.KeyStore.isMultiSelectKeyPressed(Pl)}),o(this,"isDragging",function(){return n.Interaction.isDragging}),this.PubSub=new hl({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:Ml,onDragMove:$l,onDragStart:Tl,onDragStartBegin:Bl,onElementSelect:Al,onElementUnselect:Ol}),this.stores={PointerStore:new bl({DS:this}),ScrollStore:new vl({DS:this,areaElement:d,zoom:I}),KeyStore:new yl({DS:this,multiSelectKeys:_l,multiSelectMode:Ee})},this.Area=new ll({area:d,PS:this.PubSub,zoom:I}),this.Selector=new pl({DS:this,selector:kl,selectorClass:Vl,customStyles:ne}),this.SelectorArea=new gl({DS:this,selectorAreaClass:Cl,autoScrollSpeed:k,overflowTolerance:D}),this.SelectableSet=new ul({elements:w,DS:this,className:mr,hoverClassName:hr,useTransform:cr,draggability:yt}),this.SelectedSet=new ml({DS:this,className:Nl}),this.Selection=new fl({DS:this,hoverClassName:hr,multiSelectToggling:me}),this.Drag=new cl({DS:this,draggability:yt,useTransform:cr,keyboardDrag:Sl,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},Dl),zoom:I,keyboardDragSpeed:El}),this.Interaction=new dl({areaElement:d,DS:this,draggability:yt,immediateDrag:xl,selectableClass:mr}),sl({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",function(){return n.continue=!1}),this.start()}return s(h,[{key:"_callbacksTemp",value:function(n){var g=n.callback,d=n.onDragMove,v=n.onDragStart,w=n.onDragStartBegin,_=n.onElementSelect,k=n.onElementUnselect,V=function(T,I){return console.warn("[DragSelect] ".concat(T,' is deprecated. Use DragSelect.subscribe("').concat(I,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};g&&(V("callback","callback"),this.subscribe("callback",function(D){var T=D.items;D.item;var I=D.event;return g(T,I)})),d&&(V("onDragMove","dragmove"),this.subscribe("dragmove",function(D){D.items,D.item;var T=D.event;return d(T)})),v&&(V("onDragStart","dragstart"),this.subscribe("dragstart",function(D){D.items,D.item;var T=D.event;return v(T)})),w&&(V("onDragStartBegin","dragstart"),this.subscribe("dragstart",function(D){D.items,D.item;var T=D.event;return w(T)})),_&&(V("onElementSelect","elementselect"),this.subscribe("elementselect",function(D){D.items;var T=D.item,I=D.event;return _(T,I)})),k&&(V("onElementUnselect","elementunselect"),this.subscribe("elementunselect",function(D){D.items;var T=D.item,I=D.event;return k(T,I)}))}},{key:"stop",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;d&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(n),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),n&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(De(n)),d||this.addSelectables(n),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(De(n)),d&&this.removeSelectables(n),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(n){var g=this,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return De(n).forEach(function(w){return g.SelectedSet.has(w)?g.removeSelection(n,d,v):g.addSelection(n,d,v)}),d&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(n,g,d),this.getSelection()}},{key:"clearSelection",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=De(n);return this.SelectableSet.addAll(d),g&&this.SelectedSet.addAll(d),n}},{key:"setSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.removeSelectables(n,g),this.addSelectables(n,d)}},{key:"removeSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.SelectableSet.deleteAll(De(n)),g&&this.removeSelection(n),n}},{key:"getCursorPositionDifference",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");var d=g?this.getCurrentCursorPositionArea():this.getCurrentCursorPosition(),v=n?g?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():g?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return L(d,"-",v)}}]),h}();return wl})})(vt);const qr=vt.exports,Gr=(a,t,r,i,s)=>(t=Math,r=t.log,i=1024,s=r(a)/r(i)|0,a/t.pow(i,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B"),Jr=(a,t="en-US")=>new Date(a*1e3).toLocaleString(t),Zr={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Qr=[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)],en={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},tn=[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)],Le=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(a){return(t,r)=>(e.openBlock(),e.createElementBlock("div",null,[a.direction=="down"?(e.openBlock(),e.createElementBlock("svg",Zr,Qr)):e.createCommentVNode("",!0),a.direction=="up"?(e.openBlock(),e.createElementBlock("svg",en,tn)):e.createCommentVNode("",!0)]))}}),rn=["onClick"],nn=Object.assign({name:"VFToast.vue"},{setup(a){const t=e.inject("emitter"),{getStore:r}=e.inject("storage"),i=e.ref(r("full-screen",!1)),s=f=>f=="error"?"text-red-400 border-red-400":"text-lime-600 border-lime-600",o=e.ref([]),c=f=>{o.value.splice(f,1)},m=f=>{let p=o.value.findIndex(u=>u.id===f);p!==-1&&c(p)};return t.on("vf-toast-push",f=>{let p=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");f.id=p,o.value.push(f),setTimeout(()=>{m(p)},5e3)}),(f,p)=>(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(o.value,(u,y)=>(e.openBlock(),e.createElementBlock("div",{onClick:b=>c(y),key:u,class:e.normalizeClass([s(u.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 border text-xs rounded cursor-pointer"])},e.toDisplayString(u.label),11,rn))),128))]),_:1})],2))}}),fe=a=>Object.entries(a).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:on}=ce(),Je=(a,t)=>on.value+"?"+fe({q:"preview",adapter:a,path:t}),an={class:"relative flex-auto flex flex-col overflow-hidden"},sn={key:0,class:"grid grid-cols-12 border-b border-neutral-300 dark:border-gray-700 text-xs select-none"},ln={class:"absolute"},cn=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),dn={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"},hn=["onDblclick","onTouchstart","onContextmenu","data-type","data-item","data-index"],un={class:"grid grid-cols-12 items-center"},mn={class:"flex col-span-7 items-center"},fn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},pn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],gn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},yn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],bn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},vn={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},wn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],_n={class:"grid grid-cols-12 items-center"},kn={class:"flex col-span-7 items-center"},xn={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"},Sn=[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)],Dn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},En=[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)],Nn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Vn={class:"col-span-2 text-center"},Cn={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Mn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],$n={class:"relative"},Bn={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"},Tn=[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)],An=["src"],On={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"},Pn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],jn={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},In={class:"break-all"},Ln=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(a){const t=a,r=e.inject("emitter"),{setStore:i,getStore:s}=e.inject("storage"),o=$=>$==null?void 0:$.substring(0,3),c=$=>$.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),m=e.ref(null),f=e.ref(null),p=e.ref(0),u=e.ref(null),{t:y}=e.inject("i18n"),b=Math.floor(Math.random()*2**32),N=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{N.value=!N.value,i("full-screen",N.value)});const S=e.ref("");r.on("vf-search-query",({newQuery:$})=>{S.value=$,$?r.emit("vf-fetch",{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:$}):r.emit("vf-fetch",{q:"index",adapter:t.data.adapter,path:t.data.dirname})});let E=null;const B=()=>{E&&clearTimeout(E)},A=$=>{E=setTimeout(()=>{O($)},500)},O=$=>{$.type=="dir"?(r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.data.adapter,path:$.path})):r.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:$})},C=e.reactive({active:!1,column:"",order:""}),J=($=!0)=>{let j=[...t.data.files],M=C.column,L=C.order=="asc"?1:-1;if(!$)return j;const P=(q,Y)=>typeof q=="string"&&typeof Y=="string"?q.toLowerCase().localeCompare(Y.toLowerCase()):q<Y?-1:q>Y?1:0;return C.active&&(j=j.slice().sort((q,Y)=>P(q[M],Y[M])*L)),j},K=$=>{C.active&&C.column==$?(C.active=C.order=="asc",C.column=$,C.order="desc"):(C.active=!0,C.column=$,C.order="asc")},x=()=>u.value.getSelection().map($=>JSON.parse($.dataset.item)),R=($,j)=>{if($.altKey||$.ctrlKey||$.metaKey)return $.preventDefault(),!1;$.dataTransfer.setDragImage(f.value,0,15),$.dataTransfer.effectAllowed="all",$.dataTransfer.dropEffect="copy",$.dataTransfer.setData("items",JSON.stringify(x()))},F=($,j)=>{$.preventDefault();let M=JSON.parse($.dataTransfer.getData("items"));if(M.find(L=>L.storage!=s("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:M,to:j}})},Q=($,j)=>{$.preventDefault(),!j||j.type!=="dir"||u.value.getSelection().find(M=>M==$.currentTarget)?($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none"):$.dataTransfer.dropEffect="copy"},re=()=>{u.value=new qr({area:m.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),r.on("vf-explorer-update",()=>e.nextTick(()=>{u.value.clearSelection(),u.value.setSelectables(document.getElementsByClassName("vf-item-"+b))})),u.value.subscribe("predragstart",({event:$,isDragging:j})=>{if(j)p.value=u.value.getSelection().length,u.value.break();else{const M=$.target.offsetWidth-$.offsetX,L=$.target.offsetHeight-$.offsetY;M<15&&L<15&&(u.value.clearSelection(),u.value.break())}}),u.value.subscribe("predragmove",({isDragging:$})=>{$&&u.value.break()}),u.value.subscribe("callback",({items:$,event:j,isDragging:M})=>{r.emit("vf-nodes-selected",x()),p.value=u.value.getSelection().length})};return e.onMounted(re),e.onMounted(()=>{e.watch(()=>t.view,()=>r.emit("vf-explorer-update"))}),($,j)=>(e.openBlock(),e.createElementBlock("div",an,[a.view=="list"||S.value.length?(e.openBlock(),e.createElementBlock("div",sn,[e.createElementVNode("div",{onClick:j[0]||(j[0]=M=>K("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(y)("Name"))+" ",1),e.withDirectives(e.createVNode(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="basename"]])]),S.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:j[1]||(j[1]=M=>K("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(y)("Size"))+" ",1),e.withDirectives(e.createVNode(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="file_size"]])])),S.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:j[2]||(j[2]=M=>K("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(y)("Date"))+" ",1),e.withDirectives(e.createVNode(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="last_modified"]])])),S.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:j[3]||(j[3]=M=>K("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(y)("Filepath"))+" ",1),e.withDirectives(e.createVNode(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ln,[e.createElementVNode("div",{ref_key:"dragImage",ref:f,class:"absolute -z-50 -top-96"},[cn,e.createElementVNode("div",dn,e.toDisplayString(p.value),1)],512)]),e.createElementVNode("div",{style:e.normalizeStyle(N.value?"height: 100%;":""),class:e.normalizeClass([N.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:m,onContextmenu:j[7]||(j[7]=e.withModifiers(M=>e.unref(r).emit("vf-contextmenu-show",{event:M,area:m.value,items:x()}),["self","prevent"]))},[S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(J(),(M,L)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:P=>O(M),onTouchstart:P=>A(M),onTouchend:j[4]||(j[4]=P=>B()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:x(),target:M}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",un,[e.createElementVNode("div",mn,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",fn,pn)):(e.openBlock(),e.createElementBlock("svg",gn,yn)),e.createElementVNode("span",bn,e.toDisplayString(M.basename),1)]),e.createElementVNode("div",vn,e.toDisplayString(M.path),1)])],42,hn))),256)):e.createCommentVNode("",!0),a.view=="list"&&!S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(J(),(M,L)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:P=>O(M),onTouchstart:P=>A(M),onTouchend:j[5]||(j[5]=P=>B()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:x(),target:M}),["prevent"]),onDragstart:P=>R(P),onDragover:P=>Q(P,M),onDrop:P=>F(P,M),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",_n,[e.createElementVNode("div",kn,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",xn,Sn)):(e.openBlock(),e.createElementBlock("svg",Dn,En)),e.createElementVNode("span",Nn,e.toDisplayString(M.basename),1)]),e.createElementVNode("div",Vn,e.toDisplayString(M.file_size?e.unref(Gr)(M.file_size):""),1),e.createElementVNode("div",Cn,e.toDisplayString(e.unref(Jr)(M.last_modified)),1)])],42,wn))),256)):e.createCommentVNode("",!0),a.view=="grid"&&!S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(J(!1),(M,L)=>{var P,q;return e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:Y=>O(M),onTouchstart:Y=>A(M),onTouchend:j[6]||(j[6]=Y=>B()),onContextmenu:e.withModifiers(Y=>e.unref(r).emit("vf-contextmenu-show",{event:Y,area:m.value,items:x(),target:M}),["prevent"]),onDragstart:Y=>R(Y),onDragover:Y=>Q(Y,M),onDrop:Y=>F(Y,M),class:e.normalizeClass(["vf-item-"+e.unref(b),"border border-transparent hover:bg-neutral-50 m-0.5 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 md:h-24 text-center justify-center select-none"]),"data-type":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",null,[e.createElementVNode("div",$n,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Bn,Tn)):((P=M.mime_type)!=null?P:"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"h-10 md:h-12 m-auto",src:e.unref(Je)(e.unref(s)("adapter",t.data.adapter),M.path),alt:""},null,8,An)):(e.openBlock(),e.createElementBlock("svg",On,Pn)),((q=M.mime_type)!=null?q:"").startsWith("image")?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",jn,e.toDisplayString(o(M.extension)),1))]),e.createElementVNode("span",In,e.toDisplayString(c(M.basename)),1)])],42,Mn)}),256)):e.createCommentVNode("",!0)],38),e.createVNode(nn)]))}}),zn={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Rn={class:"flex leading-5 items-center"},Hn=["aria-label"],Un=[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)],Kn=["value"],Fn={class:"ml-3"},Yn={key:0},Wn={class:"ml-1"},Xn={class:"flex leading-5 items-center"},qn={value:"",disabled:""},Gn=e.createElementVNode("option",{value:"tr"},"Turkish",-1),Jn=e.createElementVNode("option",{value:"en"},"English",-1),Zn=e.createElementVNode("option",{value:"fr"},"French",-1),Qn=["aria-label"],eo=[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)],to=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(a){var b;const t=a,r=e.inject("emitter"),{getStore:i,setStore:s}=e.inject("storage"),o=e.ref(0),c=e.ref((b=i("adapter"))!=null?b:t.data.adapter),{t:m,changeLocale:f}=e.inject("i18n"),p=e.ref(i("locale","")),u=()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:c.value}),s("adapter",c.value)};r.on("vf-nodes-selected",N=>{o.value=N.length});const y=e.ref("");return r.on("vf-search-query",({newQuery:N})=>{y.value=N}),(N,S)=>(e.openBlock(),e.createElementBlock("div",zn,[e.createElementVNode("div",Rn,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(m)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},Un,8,Hn),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=E=>c.value=E),onChange:u,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(a.data.storages,E=>(e.openBlock(),e.createElementBlock("option",{value:E},e.toDisplayString(E),9,Kn))),256))],544),[[e.vModelSelect,c.value]]),e.createElementVNode("div",Fn,[y.value.length?(e.openBlock(),e.createElementBlock("span",Yn,e.toDisplayString(a.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Wn,e.toDisplayString(o.value>0?o.value+" "+e.unref(m)("item(s) selected."):""),1)])]),e.createElementVNode("div",Xn,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=E=>p.value=E),onChange:S[2]||(S[2]=E=>e.unref(f)(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",qn,e.toDisplayString(e.unref(m)("Language")),1),Gn,Jn,Zn],544),[[e.vModelSelect,p.value]]),e.createElementVNode("span",{"aria-label":e.unref(m)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=E=>e.unref(r).emit("vf-modal-show",{type:"message",title:"Vuefinder 1.0",message:e.unref(m)("Vuefinder is a file manager component for vue 3.")}))},eo,8,Qn)])]))}}),ro=(a,t=0,r=!1)=>{let i;return(...s)=>{r&&!i&&a(...s),clearTimeout(i),i=setTimeout(()=>{a(...s)},t)}},no=(a,t,r)=>{const i=e.ref(a);return e.customRef((o,c)=>({get(){return o(),i.value},set:ro(m=>{i.value=m,c()},t,r)}))},oo={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"},io=["aria-label"],ao=[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)],so=["onClick"],lo=[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)],co={class:"flex leading-5"},ho=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),uo=["title","onClick"],mo={key:1,class:"flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},fo=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),po=["onKeydown","placeholder"],go=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],yo=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),s=e.ref(null),o=e.ref([]),c=e.ref(!1),m=e.ref(null),{t:f}=e.inject("i18n");r.on("vf-explorer-update",()=>{var O;let B=[],A=[];s.value=(O=t.data.dirname)!=null?O:i("adapter","local")+"://",s.value.length==0&&(o.value=[]),s.value.replace(i("adapter","local")+"://","").split("/").forEach(function(C){B.push(C),B.join("/")!=""&&A.push({basename:C,name:C,path:i("adapter","local")+"://"+B.join("/"),type:"dir"})}),A.length>4&&(A=A.slice(-5),A[0].name=".."),o.value=A});const p=()=>{c.value=!1,y.value=""};r.on("vf-search-exit",()=>{p()});const u=()=>{c.value=!0,e.nextTick(()=>m.value.focus())},y=no("",400);e.watch(y,B=>{r.emit("vf-search-query",{newQuery:B})});const b=()=>o.value.length&&!c.value,N=B=>{var O;B.preventDefault();let A=JSON.parse(B.dataTransfer.getData("items"));if(A.find(C=>C.storage!=i("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:A,to:(O=o.value[o.value.length-2])!=null?O:{path:i("adapter","local")+"://"}}})},S=B=>{B.preventDefault(),b()?B.dataTransfer.dropEffect="copy":(B.dataTransfer.dropEffect="none",B.dataTransfer.effectAllowed="none")},E=()=>{y.value==""&&p()};return(B,A)=>(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("span",{"aria-label":e.unref(f)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:A[0]||(A[0]=O=>S(O)),onDrop:A[1]||(A[1]=O=>N(O)),onClick:A[2]||(A[2]=O=>{var C,J;return!b()||e.unref(r).emit("vf-fetch",{q:"index",adapter:a.data.adapter,path:(J=(C=o.value[o.value.length-2])==null?void 0:C.path)!=null?J:e.unref(i)("adapter","local")+"://"})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",b()?"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"},ao,34))],8,io),c.value?(e.openBlock(),e.createElementBlock("div",mo,[fo,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,onKeydown:e.withKeys(p,["esc"]),onBlur:E,"onUpdate:modelValue":A[4]||(A[4]=O=>e.isRef(y)?y.value=O:null),placeholder:e.unref(f)("Search anything.."),class:"py-0 px-2 w-full border-0 ring-0 outline-0 text-sm 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,po),[[e.vModelText,e.unref(y)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:p,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},go))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(u,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:A[3]||(A[3]=O=>e.unref(r).emit("vf-fetch",{q:"index",adapter:a.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"},lo)),e.createElementVNode("div",co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(O,C)=>(e.openBlock(),e.createElementBlock("div",{key:C},[ho,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:O.basename,onClick:J=>e.unref(r).emit("vf-fetch",{q:"index",adapter:a.data.adapter,path:O.path})},e.toDisplayString(O.name),9,uo)]))),128))])],8,so))]))}}),bo=["onClick"],vo=e.createElementVNode("span",{class:"px-1"},null,-1),wo=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(a){const t=a,r=e.inject("emitter"),i=e.ref(null),{apiUrl:s}=ce(),o=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),c=e.ref([]);r.on("vf-context-selected",b=>{c.value=b});const{t:m}=e.inject("i18n"),f={newfolder:{title:()=>m("New Folder"),action:()=>{r.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>m("Delete"),action:()=>{r.emit("vf-modal-show",{type:"delete",items:c})}},refresh:{title:()=>m("Refresh"),action:()=>{r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:t.current.dirname})}},preview:{title:()=>m("Preview"),action:()=>{r.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:c.value[0]})}},open:{title:()=>m("Open"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:c.value[0].path})}},openDir:{title:()=>m("Open containing folder"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:c.value[0].dir})}},download:{title:()=>m("Download"),action:()=>{const b=s.value+"?"+fe({q:"download",adapter:c.value[0].adapter,path:c.value[0].path});r.emit("vf-download",b)}},archive:{title:()=>m("Archive"),action:()=>{r.emit("vf-modal-show",{type:"archive",items:c})}},unarchive:{title:()=>m("Unarchive"),action:()=>{r.emit("vf-modal-show",{type:"unarchive",items:c})}},rename:{title:()=>m("Rename"),action:()=>{r.emit("vf-modal-show",{type:"rename",items:c})}}},p=b=>{r.emit("vf-contextmenu-hide"),b.action()},u=e.ref("");r.on("vf-search-query",({newQuery:b})=>{u.value=b}),r.on("vf-contextmenu-show",({event:b,area:N,items:S,target:E=null})=>{if(o.items=[],u.value)if(E)o.items.push(f.openDir),r.emit("vf-context-selected",[E]);else return;else!E&&!u.value?(o.items.push(f.refresh),o.items.push(f.newfolder),r.emit("vf-context-selected",[]),console.log("no files selected")):S.length>1&&S.some(B=>B.path===E.path)?(o.items.push(f.refresh),o.items.push(f.archive),o.items.push(f.delete),r.emit("vf-context-selected",S),console.log(S.length+" selected (more than 1 item.)")):(E.type=="dir"?o.items.push(f.open):o.items.push(f.preview),o.items.push(f.rename),o.items.push(f.download),E.mime_type=="application/zip"?o.items.push(f.unarchive):o.items.push(f.archive),o.items.push(f.delete),r.emit("vf-context-selected",[E]),console.log(E.type+" is selected"));y(b,N)}),r.on("vf-contextmenu-hide",()=>{o.active=!1});const y=(b,N)=>{o.active=!0,e.nextTick(()=>{let S=N.getBoundingClientRect(),E=b.pageX,B=b.pageY,A=i.value.offsetHeight,O=i.value.offsetWidth;E=S.right-b.pageX+window.scrollX<O?E-O:E,B=S.bottom-b.pageY+window.scrollY<A?B-A:B,o.positions={left:E+"px",top:B+"px"}})};return(b,N)=>o.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:i,style:e.normalizeStyle(o.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,S=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:S.title,onClick:E=>p(S)},[vo,e.createElementVNode("span",null,e.toDisplayString(S.title()),1)],8,bo))),128))],4)):e.createCommentVNode("",!0)}}),_o=(a,t)=>{const r=a[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((i,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function ko(a){const t=await _o(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>Xs),"../locales/tr.json":()=>Promise.resolve().then(()=>qs)}),`../locales/${a}.json`);return JSON.parse(t.default)}function xo(a,t){const{getStore:r,setStore:i}=Ge(a),s=["en","tr"],o=e.ref({}),c=f=>{s.includes(f)||(console.log("The selected locale is not yet supported. The fallback language is set as 'en'"),f="en"),ko(f).then(p=>{o.value=p,i("locale",f),i("translations",p),console.log(f+" is loaded.")})};r("locale")?o.value=r("translations"):c(t);function m(f){return o.value.hasOwnProperty(f)?o.value[f]:""}return{t:m,support_locales:s,changeLocale:c}}const So=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Do=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"}},setup(a){const t=a,r=yr(),{setStore:i,getStore:s}=Ge(t.id);e.provide("emitter",r),e.provide("storage",Ge(t.id));const o=xo(t.id,t.locale);e.provide("i18n",o);const{apiUrl:c,setApiUrl:m}=ce();m(t.url);const f=e.reactive({adapter:"local",storages:[],dirname:".",files:[]}),p=e.ref(s("viewport","grid")),u=e.ref(s("darkMode",t.dark));r.on("vf-darkMode-toggle",()=>{u.value=!u.value,i("darkMode",u.value)});const y=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{y.value=!y.value,i("full-screen",y.value)}),r.on("vf-view-toggle",S=>{p.value=S});const b=e.reactive({active:!1,type:"delete",data:{}});r.on("vf-modal-close",()=>{b.active=!1}),r.on("vf-modal-show",S=>{b.active=!0,b.type=S.type,b.data=S});const N=S=>{Object.assign(f,S),r.emit("vf-nodes-selected",{}),r.emit("vf-explorer-update")};return r.on("vf-fetch",S=>{Ie(c.value,{params:S}).then(E=>{r.emit("vf-modal-close"),N(E)})}),r.on("vf-download",S=>{document.getElementById("download_frame").src=S,r.emit("vf-modal-close")}),e.onMounted(()=>{r.emit("vf-fetch",{q:"index",adapter:s("adapter",f.adapter)})}),(S,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(u.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([y.value?"fixed w-screen inset-0 z-20":"relative","border flex flex-col rounded-md 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(y.value?"":"max-height: "+a.maxHeight),onMousedown:E[0]||(E[0]=B=>e.unref(r).emit("vf-contextmenu-hide"))},[e.createVNode(Wr,{data:f},null,8,["data"]),e.createVNode(yo,{data:f},null,8,["data"]),e.createVNode(Ln,{view:p.value,data:f},null,8,["view","data"]),e.createVNode(to,{data:f},null,8,["data"])],38),b.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+b.type),{key:0,selection:b.data,current:f},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(wo,{current:f},null,8,["current"]),So],2))}}),Eo=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1),No={class:"fixed z-10 inset-0 overflow-y-auto"},Vo={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 sm:w-full"},Co={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Mo={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"},ae={__name:"ModalLayout",setup(a){const t=e.inject("emitter");return e.onMounted(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus()}),(r,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(s=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Eo,e.createElementVNode("div",No,[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(s=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Vo,[e.createElementVNode("div",Co,[e.renderSlot(r.$slots,"default")]),e.createElementVNode("div",Mo,[e.renderSlot(r.$slots,"buttons")])])],32)])],32))}},$o={class:"sm:flex sm:items-start"},Bo=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),To={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Ao={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Oo={class:"mt-2"},Po={class:"text-sm text-gray-500"},jo={class:"flex text-sm text-gray-800 dark:text-gray-400"},Io={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"},Lo=[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)],zo={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"},Ro=[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)],Ho={class:"ml-1.5"},Uo={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},Ko=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(t.selection.items),c=()=>{o.value.length&&r.emit("vf-fetch",{q:"delete",adapter:i("adapter","local"),path:t.current.dirname,items:JSON.stringify(o.value.map(({path:m,type:f})=>({path:m,type:f})))})};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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(s)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:f[0]||(f[0]=p=>e.unref(r).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(s)("Cancel")),1),e.createElementVNode("div",Uo,e.toDisplayString(e.unref(s)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$o,[Bo,e.createElementVNode("div",To,[e.createElementVNode("h3",Ao,e.toDisplayString(e.unref(s)("Delete files")),1),e.createElementVNode("div",Oo,[e.createElementVNode("p",Po,e.toDisplayString(e.unref(s)("Are you sure you want to delete these files ?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,p=>(e.openBlock(),e.createElementBlock("p",jo,[p.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Io,Lo)):(e.openBlock(),e.createElementBlock("svg",zo,Ro)),e.createElementVNode("span",Ho,e.toDisplayString(p.basename),1)]))),256))])])])]),_:1}))}}),Fo={class:"sm:flex sm:items-start"},Yo=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),Wo={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Xo={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},qo={class:"mt-2"},Go={class:"text-sm text-gray-500"},Jo=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(a){const t=e.inject("emitter"),{t:r}=e.inject("i18n");return(i,s)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[0]||(s[0]=o=>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(r)("Close")),1)]),default:e.withCtx(()=>{var o,c,m,f;return[e.createElementVNode("div",Fo,[Yo,e.createElementVNode("div",Wo,[e.createElementVNode("h3",Xo,e.toDisplayString((c=(o=a.selection)==null?void 0:o.title)!=null?c:"Title"),1),e.createElementVNode("div",qo,[e.createElementVNode("p",Go,e.toDisplayString((f=(m=a.selection)==null?void 0:m.message)!=null?f:"Message")+".",1)])])])]}),_:1}))}}),Zo={class:"sm:flex sm:items-start"},Qo=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),ei={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ti={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ri={class:"mt-2"},ni={class:"text-sm text-gray-500"},oi=["onKeyup","placeholder"],ii=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),c=()=>{o.value!=""&&(r.emit("vf-fetch",{q:"newfolder",adapter:i("adapter","local"),path:t.current.dirname,name:o.value}),r.emit("vf-toast-push",{label:"New Folder is created successfully",type:"success"}))};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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(s)("Create")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=p=>e.unref(r).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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Zo,[Qo,e.createElementVNode("div",ei,[e.createElementVNode("h3",ti,e.toDisplayString(e.unref(s)("New Folder")),1),e.createElementVNode("div",ri,[e.createElementVNode("p",ni,e.toDisplayString(e.unref(s)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=p=>o.value=p),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("Folder Name"),type:"text"},null,40,oi),[[e.vModelText,o.value]])])])])]),_:1}))}}),ai={class:"sm:flex sm:items-start"},si=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),li={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ci={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},di={class:"mt-2"},hi={class:"text-sm text-gray-500"},ui=["onKeyup","placeholder"],mi=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),c=()=>{o.value!=""&&r.emit("vf-fetch",{q:"newfile",adapter:i("adapter","local"),path:t.current.dirname,name:o.value})};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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"},"Create!"),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=p=>e.unref(r).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"},"Cancel")]),default:e.withCtx(()=>[e.createElementVNode("div",ai,[si,e.createElementVNode("div",li,[e.createElementVNode("h3",ci,e.toDisplayString(e.unref(s)("New File")),1),e.createElementVNode("div",di,[e.createElementVNode("p",hi,e.toDisplayString(e.unref(s)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=p=>o.value=p),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("File Name"),type:"text"},null,40,ui),[[e.vModelText,o.value]])])])])]),_:1}))}}),fi={class:"flex"},pi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},gi={class:"ml-auto mb-2"},yi={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"},bi={key:1},vi={__name:"Text",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,i=e.ref(""),s=e.ref(""),o=e.ref(null),c=e.ref(!1),{apiUrl:m}=ce(),{t:f}=e.inject("i18n");e.onMounted(()=>{Ie(m.value,{params:{q:"preview",adapter:r.selection.adapter,path:r.selection.item.path},json:!1}).then(y=>{i.value=y,t("load")})});const p=()=>{c.value=!c.value,s.value=i.value,c.value==!0&&e.nextTick(()=>{o.value.focus()})},u=()=>{Ie(m.value,{method:"POST",params:{q:"save",adapter:r.selection.adapter,path:r.selection.item.path,content:s.value},json:!1}).then(y=>{i.value=y,t("load"),c.value=!c.value}).catch(y=>console.log(y.statusText))};return(y,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",fi,[e.createElementVNode("div",pi,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",gi,[c.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:u,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(f)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:b[0]||(b[0]=N=>p())},e.toDisplayString(c.value?e.unref(f)("Cancel"):e.unref(f)("Edit")),1)])]),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",bi,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:o,"onUpdate:modelValue":b[1]||(b[1]=N=>s.value=N),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] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,s.value]])])):(e.openBlock(),e.createElementBlock("pre",yi,e.toDisplayString(i.value),1))])],64))}},vc="";/*!
4
4
  * Cropper.js v1.5.12
5
5
  * https://fengyuanchen.github.io/cropperjs
6
6
  *
@@ -9,13 +9,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
9
9
  *
10
10
  * Date: 2021-06-12T08:00:17.411Z
11
11
  */function wt(a,t){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable})),r.push.apply(r,i)}return r}function _t(a){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wt(Object(r),!0).forEach(function(i){ki(a,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(i){Object.defineProperty(a,i,Object.getOwnPropertyDescriptor(r,i))})}return a}function ze(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ze=function(t){return typeof t}:ze=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ze(a)}function wi(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function kt(a,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function _i(a,t,r){return t&&kt(a.prototype,t),r&&kt(a,r),a}function ki(a,t,r){return t in a?Object.defineProperty(a,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[t]=r,a}function xt(a){return xi(a)||Si(a)||Di(a)||Ei()}function xi(a){if(Array.isArray(a))return Ze(a)}function Si(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Di(a,t){if(!!a){if(typeof a=="string")return Ze(a,t);var r=Object.prototype.toString.call(a).slice(8,-1);if(r==="Object"&&a.constructor&&(r=a.constructor.name),r==="Map"||r==="Set")return Array.from(a);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ze(a,t)}}function Ze(a,t){(t==null||t>a.length)&&(t=a.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=a[r];return i}function Ei(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Re=typeof window<"u"&&typeof window.document<"u",se=Re?window:{},Qe=Re&&se.document.documentElement?"ontouchstart"in se.document.documentElement:!1,et=Re?"PointerEvent"in se:!1,H="cropper",tt="all",St="crop",Dt="move",Et="zoom",pe="e",ge="w",be="s",de="n",Ve="ne",Ce="nw",Me="se",$e="sw",rt="".concat(H,"-crop"),Nt="".concat(H,"-disabled"),ee="".concat(H,"-hidden"),Vt="".concat(H,"-hide"),Ni="".concat(H,"-invisible"),He="".concat(H,"-modal"),nt="".concat(H,"-move"),Be="".concat(H,"Action"),Ue="".concat(H,"Preview"),ot="crop",Ct="move",Mt="none",it="crop",at="cropend",st="cropmove",lt="cropstart",$t="dblclick",Vi=Qe?"touchstart":"mousedown",Ci=Qe?"touchmove":"mousemove",Mi=Qe?"touchend touchcancel":"mouseup",Bt=et?"pointerdown":Vi,Tt=et?"pointermove":Ci,At=et?"pointerup pointercancel":Mi,Ot="ready",Pt="resize",jt="wheel",ct="zoom",It="image/jpeg",$i=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Bi=/^data:/,Ti=/^data:image\/jpeg;base64,/,Ai=/^img|canvas$/i,Lt=200,zt=100,Rt={viewMode:0,dragMode:ot,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:Lt,minContainerHeight:zt,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Oi='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Pi=Number.isNaN||se.isNaN;function z(a){return typeof a=="number"&&!Pi(a)}var Ht=function(t){return t>0&&t<1/0};function dt(a){return typeof a>"u"}function ye(a){return ze(a)==="object"&&a!==null}var ji=Object.prototype.hasOwnProperty;function ve(a){if(!ye(a))return!1;try{var t=a.constructor,r=t.prototype;return t&&r&&ji.call(r,"isPrototypeOf")}catch{return!1}}function te(a){return typeof a=="function"}var Ii=Array.prototype.slice;function Ut(a){return Array.from?Array.from(a):Ii.call(a)}function X(a,t){return a&&te(t)&&(Array.isArray(a)||z(a.length)?Ut(a).forEach(function(r,i){t.call(a,r,i,a)}):ye(a)&&Object.keys(a).forEach(function(r){t.call(a,a[r],r,a)})),a}var U=Object.assign||function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return ye(t)&&i.length>0&&i.forEach(function(o){ye(o)&&Object.keys(o).forEach(function(c){t[c]=o[c]})}),t},Li=/\.\d*(?:0|9){12}\d*$/;function we(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Li.test(a)?Math.round(a*t)/t:a}var zi=/^width|height|left|top|marginLeft|marginTop$/;function he(a,t){var r=a.style;X(t,function(i,s){zi.test(s)&&z(i)&&(i="".concat(i,"px")),r[s]=i})}function Ri(a,t){return a.classList?a.classList.contains(t):a.className.indexOf(t)>-1}function Z(a,t){if(!!t){if(z(a.length)){X(a,function(i){Z(i,t)});return}if(a.classList){a.classList.add(t);return}var r=a.className.trim();r?r.indexOf(t)<0&&(a.className="".concat(r," ").concat(t)):a.className=t}}function le(a,t){if(!!t){if(z(a.length)){X(a,function(r){le(r,t)});return}if(a.classList){a.classList.remove(t);return}a.className.indexOf(t)>=0&&(a.className=a.className.replace(t,""))}}function _e(a,t,r){if(!!t){if(z(a.length)){X(a,function(i){_e(i,t,r)});return}r?Z(a,t):le(a,t)}}var Hi=/([a-z\d])([A-Z])/g;function ht(a){return a.replace(Hi,"$1-$2").toLowerCase()}function ut(a,t){return ye(a[t])?a[t]:a.dataset?a.dataset[t]:a.getAttribute("data-".concat(ht(t)))}function Te(a,t,r){ye(r)?a[t]=r:a.dataset?a.dataset[t]=r:a.setAttribute("data-".concat(ht(t)),r)}function Ui(a,t){if(ye(a[t]))try{delete a[t]}catch{a[t]=void 0}else if(a.dataset)try{delete a.dataset[t]}catch{a.dataset[t]=void 0}else a.removeAttribute("data-".concat(ht(t)))}var Kt=/\s\s*/,Ft=function(){var a=!1;if(Re){var t=!1,r=function(){},i=Object.defineProperty({},"once",{get:function(){return a=!0,t},set:function(o){t=o}});se.addEventListener("test",r,i),se.removeEventListener("test",r,i)}return a}();function ie(a,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r;t.trim().split(Kt).forEach(function(o){if(!Ft){var c=a.listeners;c&&c[o]&&c[o][r]&&(s=c[o][r],delete c[o][r],Object.keys(c[o]).length===0&&delete c[o],Object.keys(c).length===0&&delete a.listeners)}a.removeEventListener(o,s,i)})}function oe(a,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r;t.trim().split(Kt).forEach(function(o){if(i.once&&!Ft){var c=a.listeners,m=c===void 0?{}:c;s=function(){delete m[o][r],a.removeEventListener(o,s,i);for(var p=arguments.length,u=new Array(p),y=0;y<p;y++)u[y]=arguments[y];r.apply(a,u)},m[o]||(m[o]={}),m[o][r]&&a.removeEventListener(o,m[o][r],i),m[o][r]=s,a.listeners=m}a.addEventListener(o,s,i)})}function ke(a,t,r){var i;return te(Event)&&te(CustomEvent)?i=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,!0,!0,r)),a.dispatchEvent(i)}function Yt(a){var t=a.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var mt=se.location,Ki=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Wt(a){var t=a.match(Ki);return t!==null&&(t[1]!==mt.protocol||t[2]!==mt.hostname||t[3]!==mt.port)}function Xt(a){var t="timestamp=".concat(new Date().getTime());return a+(a.indexOf("?")===-1?"?":"&")+t}function Ae(a){var t=a.rotate,r=a.scaleX,i=a.scaleY,s=a.translateX,o=a.translateY,c=[];z(s)&&s!==0&&c.push("translateX(".concat(s,"px)")),z(o)&&o!==0&&c.push("translateY(".concat(o,"px)")),z(t)&&t!==0&&c.push("rotate(".concat(t,"deg)")),z(r)&&r!==1&&c.push("scaleX(".concat(r,")")),z(i)&&i!==1&&c.push("scaleY(".concat(i,")"));var m=c.length?c.join(" "):"none";return{WebkitTransform:m,msTransform:m,transform:m}}function Fi(a){var t=_t({},a),r=0;return X(a,function(i,s){delete t[s],X(t,function(o){var c=Math.abs(i.startX-o.startX),m=Math.abs(i.startY-o.startY),f=Math.abs(i.endX-o.endX),p=Math.abs(i.endY-o.endY),u=Math.sqrt(c*c+m*m),y=Math.sqrt(f*f+p*p),b=(y-u)/u;Math.abs(b)>Math.abs(r)&&(r=b)})}),r}function Ke(a,t){var r=a.pageX,i=a.pageY,s={endX:r,endY:i};return t?s:_t({startX:r,startY:i},s)}function Yi(a){var t=0,r=0,i=0;return X(a,function(s){var o=s.startX,c=s.startY;t+=o,r+=c,i+=1}),t/=i,r/=i,{pageX:t,pageY:r}}function ue(a){var t=a.aspectRatio,r=a.height,i=a.width,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=Ht(i),c=Ht(r);if(o&&c){var m=r*t;s==="contain"&&m>i||s==="cover"&&m<i?r=i/t:i=r*t}else o?r=i/t:c&&(i=r*t);return{width:i,height:r}}function Wi(a){var t=a.width,r=a.height,i=a.degree;if(i=Math.abs(i)%180,i===90)return{width:r,height:t};var s=i%90*Math.PI/180,o=Math.sin(s),c=Math.cos(s),m=t*c+r*o,f=t*o+r*c;return i>90?{width:f,height:m}:{width:m,height:f}}function Xi(a,t,r,i){var s=t.aspectRatio,o=t.naturalWidth,c=t.naturalHeight,m=t.rotate,f=m===void 0?0:m,p=t.scaleX,u=p===void 0?1:p,y=t.scaleY,b=y===void 0?1:y,N=r.aspectRatio,S=r.naturalWidth,E=r.naturalHeight,B=i.fillColor,A=B===void 0?"transparent":B,O=i.imageSmoothingEnabled,C=O===void 0?!0:O,J=i.imageSmoothingQuality,K=J===void 0?"low":J,x=i.maxWidth,R=x===void 0?1/0:x,F=i.maxHeight,Q=F===void 0?1/0:F,re=i.minWidth,$=re===void 0?0:re,j=i.minHeight,M=j===void 0?0:j,L=document.createElement("canvas"),P=L.getContext("2d"),q=ue({aspectRatio:N,width:R,height:Q}),Y=ue({aspectRatio:N,width:$,height:M},"cover"),Oe=Math.min(q.width,Math.max(Y.width,S)),Pe=Math.min(q.height,Math.max(Y.height,E)),Fe=ue({aspectRatio:s,width:R,height:Q}),Ye=ue({aspectRatio:s,width:$,height:M},"cover"),We=Math.min(Fe.width,Math.max(Ye.width,o)),xe=Math.min(Fe.height,Math.max(Ye.height,c)),pt=[-We/2,-xe/2,We,xe];return L.width=we(Oe),L.height=we(Pe),P.fillStyle=A,P.fillRect(0,0,Oe,Pe),P.save(),P.translate(Oe/2,Pe/2),P.rotate(f*Math.PI/180),P.scale(u,b),P.imageSmoothingEnabled=C,P.imageSmoothingQuality=K,P.drawImage.apply(P,[a].concat(xt(pt.map(function(Se){return Math.floor(we(Se))})))),P.restore(),L}var qt=String.fromCharCode;function qi(a,t,r){var i="";r+=t;for(var s=t;s<r;s+=1)i+=qt(a.getUint8(s));return i}var Gi=/^data:.*,/;function Ji(a){var t=a.replace(Gi,""),r=atob(t),i=new ArrayBuffer(r.length),s=new Uint8Array(i);return X(s,function(o,c){s[c]=r.charCodeAt(c)}),i}function Zi(a,t){for(var r=[],i=8192,s=new Uint8Array(a);s.length>0;)r.push(qt.apply(null,Ut(s.subarray(0,i)))),s=s.subarray(i);return"data:".concat(t,";base64,").concat(btoa(r.join("")))}function Qi(a){var t=new DataView(a),r;try{var i,s,o;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var c=t.byteLength,m=2;m+1<c;){if(t.getUint8(m)===255&&t.getUint8(m+1)===225){s=m;break}m+=1}if(s){var f=s+4,p=s+10;if(qi(t,f,4)==="Exif"){var u=t.getUint16(p);if(i=u===18761,(i||u===19789)&&t.getUint16(p+2,i)===42){var y=t.getUint32(p+4,i);y>=8&&(o=p+y)}}}if(o){var b=t.getUint16(o,i),N,S;for(S=0;S<b;S+=1)if(N=o+S*12+2,t.getUint16(N,i)===274){N+=8,r=t.getUint16(N,i),t.setUint16(N,1,i);break}}}catch{r=1}return r}function ea(a){var t=0,r=1,i=1;switch(a){case 2:r=-1;break;case 3:t=-180;break;case 4:i=-1;break;case 5:t=90,i=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:r,scaleY:i}}var ta={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,r=this.options,i=this.container,s=this.cropper,o=Number(r.minContainerWidth),c=Number(r.minContainerHeight);Z(s,ee),le(t,ee);var m={width:Math.max(i.offsetWidth,o>=0?o:Lt),height:Math.max(i.offsetHeight,c>=0?c:zt)};this.containerData=m,he(s,{width:m.width,height:m.height}),Z(t,ee),le(s,ee)},initCanvas:function(){var t=this.containerData,r=this.imageData,i=this.options.viewMode,s=Math.abs(r.rotate)%180===90,o=s?r.naturalHeight:r.naturalWidth,c=s?r.naturalWidth:r.naturalHeight,m=o/c,f=t.width,p=t.height;t.height*m>t.width?i===3?f=t.height*m:p=t.width/m:i===3?p=t.width/m:f=t.height*m;var u={aspectRatio:m,naturalWidth:o,naturalHeight:c,width:f,height:p};this.canvasData=u,this.limited=i===1||i===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(t.width-u.width)/2,u.top=(t.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=U({},u)},limitCanvas:function(t,r){var i=this.options,s=this.containerData,o=this.canvasData,c=this.cropBoxData,m=i.viewMode,f=o.aspectRatio,p=this.cropped&&c;if(t){var u=Number(i.minCanvasWidth)||0,y=Number(i.minCanvasHeight)||0;m>1?(u=Math.max(u,s.width),y=Math.max(y,s.height),m===3&&(y*f>u?u=y*f:y=u/f)):m>0&&(u?u=Math.max(u,p?c.width:0):y?y=Math.max(y,p?c.height:0):p&&(u=c.width,y=c.height,y*f>u?u=y*f:y=u/f));var b=ue({aspectRatio:f,width:u,height:y});u=b.width,y=b.height,o.minWidth=u,o.minHeight=y,o.maxWidth=1/0,o.maxHeight=1/0}if(r)if(m>(p?0:1)){var N=s.width-o.width,S=s.height-o.height;o.minLeft=Math.min(0,N),o.minTop=Math.min(0,S),o.maxLeft=Math.max(0,N),o.maxTop=Math.max(0,S),p&&this.limited&&(o.minLeft=Math.min(c.left,c.left+(c.width-o.width)),o.minTop=Math.min(c.top,c.top+(c.height-o.height)),o.maxLeft=c.left,o.maxTop=c.top,m===2&&(o.width>=s.width&&(o.minLeft=Math.min(0,N),o.maxLeft=Math.max(0,N)),o.height>=s.height&&(o.minTop=Math.min(0,S),o.maxTop=Math.max(0,S))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=s.width,o.maxTop=s.height},renderCanvas:function(t,r){var i=this.canvasData,s=this.imageData;if(r){var o=Wi({width:s.naturalWidth*Math.abs(s.scaleX||1),height:s.naturalHeight*Math.abs(s.scaleY||1),degree:s.rotate||0}),c=o.width,m=o.height,f=i.width*(c/i.naturalWidth),p=i.height*(m/i.naturalHeight);i.left-=(f-i.width)/2,i.top-=(p-i.height)/2,i.width=f,i.height=p,i.aspectRatio=c/m,i.naturalWidth=c,i.naturalHeight=m,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,he(this.canvas,U({width:i.width,height:i.height},Ae({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var r=this.canvasData,i=this.imageData,s=i.naturalWidth*(r.width/r.naturalWidth),o=i.naturalHeight*(r.height/r.naturalHeight);U(i,{width:s,height:o,left:(r.width-s)/2,top:(r.height-o)/2}),he(this.image,U({width:i.width,height:i.height},Ae(U({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,r=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,s=Number(t.autoCropArea)||.8,o={width:r.width,height:r.height};i&&(r.height*i>r.width?o.height=o.width/i:o.width=o.height*i),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*s),o.height=Math.max(o.minHeight,o.height*s),o.left=r.left+(r.width-o.width)/2,o.top=r.top+(r.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=U({},o)},limitCropBox:function(t,r){var i=this.options,s=this.containerData,o=this.canvasData,c=this.cropBoxData,m=this.limited,f=i.aspectRatio;if(t){var p=Number(i.minCropBoxWidth)||0,u=Number(i.minCropBoxHeight)||0,y=m?Math.min(s.width,o.width,o.width+o.left,s.width-o.left):s.width,b=m?Math.min(s.height,o.height,o.height+o.top,s.height-o.top):s.height;p=Math.min(p,s.width),u=Math.min(u,s.height),f&&(p&&u?u*f>p?u=p/f:p=u*f:p?u=p/f:u&&(p=u*f),b*f>y?b=y/f:y=b*f),c.minWidth=Math.min(p,y),c.minHeight=Math.min(u,b),c.maxWidth=y,c.maxHeight=b}r&&(m?(c.minLeft=Math.max(0,o.left),c.minTop=Math.max(0,o.top),c.maxLeft=Math.min(s.width,o.left+o.width)-c.width,c.maxTop=Math.min(s.height,o.top+o.height)-c.height):(c.minLeft=0,c.minTop=0,c.maxLeft=s.width-c.width,c.maxTop=s.height-c.height))},renderCropBox:function(){var t=this.options,r=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&Te(this.face,Be,i.width>=r.width&&i.height>=r.height?Dt:tt),he(this.cropBox,U({width:i.width,height:i.height},Ae({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ke(this.element,it,this.getData())}},ra={initPreview:function(){var t=this.element,r=this.crossOrigin,i=this.options.preview,s=r?this.crossOriginUrl:this.url,o=t.alt||"The image to preview",c=document.createElement("img");if(r&&(c.crossOrigin=r),c.src=s,c.alt=o,this.viewBox.appendChild(c),this.viewBoxImage=c,!!i){var m=i;typeof i=="string"?m=t.ownerDocument.querySelectorAll(i):i.querySelector&&(m=[i]),this.previews=m,X(m,function(f){var p=document.createElement("img");Te(f,Ue,{width:f.offsetWidth,height:f.offsetHeight,html:f.innerHTML}),r&&(p.crossOrigin=r),p.src=s,p.alt=o,p.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',f.innerHTML="",f.appendChild(p)})}},resetPreview:function(){X(this.previews,function(t){var r=ut(t,Ue);he(t,{width:r.width,height:r.height}),t.innerHTML=r.html,Ui(t,Ue)})},preview:function(){var t=this.imageData,r=this.canvasData,i=this.cropBoxData,s=i.width,o=i.height,c=t.width,m=t.height,f=i.left-r.left-t.left,p=i.top-r.top-t.top;!this.cropped||this.disabled||(he(this.viewBoxImage,U({width:c,height:m},Ae(U({translateX:-f,translateY:-p},t)))),X(this.previews,function(u){var y=ut(u,Ue),b=y.width,N=y.height,S=b,E=N,B=1;s&&(B=b/s,E=o*B),o&&E>N&&(B=N/o,S=s*B,E=N),he(u,{width:S,height:E}),he(u.getElementsByTagName("img")[0],U({width:c*B,height:m*B},Ae(U({translateX:-f*B,translateY:-p*B},t))))}))}},na={bind:function(){var t=this.element,r=this.options,i=this.cropper;te(r.cropstart)&&oe(t,lt,r.cropstart),te(r.cropmove)&&oe(t,st,r.cropmove),te(r.cropend)&&oe(t,at,r.cropend),te(r.crop)&&oe(t,it,r.crop),te(r.zoom)&&oe(t,ct,r.zoom),oe(i,Bt,this.onCropStart=this.cropStart.bind(this)),r.zoomable&&r.zoomOnWheel&&oe(i,jt,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&oe(i,$t,this.onDblclick=this.dblclick.bind(this)),oe(t.ownerDocument,Tt,this.onCropMove=this.cropMove.bind(this)),oe(t.ownerDocument,At,this.onCropEnd=this.cropEnd.bind(this)),r.responsive&&oe(window,Pt,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,r=this.options,i=this.cropper;te(r.cropstart)&&ie(t,lt,r.cropstart),te(r.cropmove)&&ie(t,st,r.cropmove),te(r.cropend)&&ie(t,at,r.cropend),te(r.crop)&&ie(t,it,r.crop),te(r.zoom)&&ie(t,ct,r.zoom),ie(i,Bt,this.onCropStart),r.zoomable&&r.zoomOnWheel&&ie(i,jt,this.onWheel,{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&ie(i,$t,this.onDblclick),ie(t.ownerDocument,Tt,this.onCropMove),ie(t.ownerDocument,At,this.onCropEnd),r.responsive&&ie(window,Pt,this.onResize)}},oa={resize:function(){if(!this.disabled){var t=this.options,r=this.container,i=this.containerData,s=r.offsetWidth/i.width,o=r.offsetHeight/i.height,c=Math.abs(s-1)>Math.abs(o-1)?s:o;if(c!==1){var m,f;t.restore&&(m=this.getCanvasData(),f=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(X(m,function(p,u){m[u]=p*c})),this.setCropBoxData(X(f,function(p,u){f[u]=p*c})))}}},dblclick:function(){this.disabled||this.options.dragMode===Mt||this.setDragMode(Ri(this.dragBox,rt)?Ct:ot)},wheel:function(t){var r=this,i=Number(this.options.wheelZoomRatio)||.1,s=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){r.wheeling=!1},50),t.deltaY?s=t.deltaY>0?1:-1:t.wheelDelta?s=-t.wheelDelta/120:t.detail&&(s=t.detail>0?1:-1),this.zoom(-s*i,t)))},cropStart:function(t){var r=t.buttons,i=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(z(r)&&r!==1||z(i)&&i!==0||t.ctrlKey))){var s=this.options,o=this.pointers,c;t.changedTouches?X(t.changedTouches,function(m){o[m.identifier]=Ke(m)}):o[t.pointerId||0]=Ke(t),Object.keys(o).length>1&&s.zoomable&&s.zoomOnTouch?c=Et:c=ut(t.target,Be),!!$i.test(c)&&ke(this.element,lt,{originalEvent:t,action:c})!==!1&&(t.preventDefault(),this.action=c,this.cropping=!1,c===St&&(this.cropping=!0,Z(this.dragBox,He)))}},cropMove:function(t){var r=this.action;if(!(this.disabled||!r)){var i=this.pointers;t.preventDefault(),ke(this.element,st,{originalEvent:t,action:r})!==!1&&(t.changedTouches?X(t.changedTouches,function(s){U(i[s.identifier]||{},Ke(s,!0))}):U(i[t.pointerId||0]||{},Ke(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var r=this.action,i=this.pointers;t.changedTouches?X(t.changedTouches,function(s){delete i[s.identifier]}):delete i[t.pointerId||0],r&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,_e(this.dragBox,He,this.cropped&&this.options.modal)),ke(this.element,at,{originalEvent:t,action:r}))}}},ia={change:function(t){var r=this.options,i=this.canvasData,s=this.containerData,o=this.cropBoxData,c=this.pointers,m=this.action,f=r.aspectRatio,p=o.left,u=o.top,y=o.width,b=o.height,N=p+y,S=u+b,E=0,B=0,A=s.width,O=s.height,C=!0,J;!f&&t.shiftKey&&(f=y&&b?y/b:1),this.limited&&(E=o.minLeft,B=o.minTop,A=E+Math.min(s.width,i.width,i.left+i.width),O=B+Math.min(s.height,i.height,i.top+i.height));var K=c[Object.keys(c)[0]],x={x:K.endX-K.startX,y:K.endY-K.startY},R=function(Q){switch(Q){case pe:N+x.x>A&&(x.x=A-N);break;case ge:p+x.x<E&&(x.x=E-p);break;case de:u+x.y<B&&(x.y=B-u);break;case be:S+x.y>O&&(x.y=O-S);break}};switch(m){case tt:p+=x.x,u+=x.y;break;case pe:if(x.x>=0&&(N>=A||f&&(u<=B||S>=O))){C=!1;break}R(pe),y+=x.x,y<0&&(m=ge,y=-y,p-=y),f&&(b=y/f,u+=(o.height-b)/2);break;case de:if(x.y<=0&&(u<=B||f&&(p<=E||N>=A))){C=!1;break}R(de),b-=x.y,u+=x.y,b<0&&(m=be,b=-b,u-=b),f&&(y=b*f,p+=(o.width-y)/2);break;case ge:if(x.x<=0&&(p<=E||f&&(u<=B||S>=O))){C=!1;break}R(ge),y-=x.x,p+=x.x,y<0&&(m=pe,y=-y,p-=y),f&&(b=y/f,u+=(o.height-b)/2);break;case be:if(x.y>=0&&(S>=O||f&&(p<=E||N>=A))){C=!1;break}R(be),b+=x.y,b<0&&(m=de,b=-b,u-=b),f&&(y=b*f,p+=(o.width-y)/2);break;case Ve:if(f){if(x.y<=0&&(u<=B||N>=A)){C=!1;break}R(de),b-=x.y,u+=x.y,y=b*f}else R(de),R(pe),x.x>=0?N<A?y+=x.x:x.y<=0&&u<=B&&(C=!1):y+=x.x,x.y<=0?u>B&&(b-=x.y,u+=x.y):(b-=x.y,u+=x.y);y<0&&b<0?(m=$e,b=-b,y=-y,u-=b,p-=y):y<0?(m=Ce,y=-y,p-=y):b<0&&(m=Me,b=-b,u-=b);break;case Ce:if(f){if(x.y<=0&&(u<=B||p<=E)){C=!1;break}R(de),b-=x.y,u+=x.y,y=b*f,p+=o.width-y}else R(de),R(ge),x.x<=0?p>E?(y-=x.x,p+=x.x):x.y<=0&&u<=B&&(C=!1):(y-=x.x,p+=x.x),x.y<=0?u>B&&(b-=x.y,u+=x.y):(b-=x.y,u+=x.y);y<0&&b<0?(m=Me,b=-b,y=-y,u-=b,p-=y):y<0?(m=Ve,y=-y,p-=y):b<0&&(m=$e,b=-b,u-=b);break;case $e:if(f){if(x.x<=0&&(p<=E||S>=O)){C=!1;break}R(ge),y-=x.x,p+=x.x,b=y/f}else R(be),R(ge),x.x<=0?p>E?(y-=x.x,p+=x.x):x.y>=0&&S>=O&&(C=!1):(y-=x.x,p+=x.x),x.y>=0?S<O&&(b+=x.y):b+=x.y;y<0&&b<0?(m=Ve,b=-b,y=-y,u-=b,p-=y):y<0?(m=Me,y=-y,p-=y):b<0&&(m=Ce,b=-b,u-=b);break;case Me:if(f){if(x.x>=0&&(N>=A||S>=O)){C=!1;break}R(pe),y+=x.x,b=y/f}else R(be),R(pe),x.x>=0?N<A?y+=x.x:x.y>=0&&S>=O&&(C=!1):y+=x.x,x.y>=0?S<O&&(b+=x.y):b+=x.y;y<0&&b<0?(m=Ce,b=-b,y=-y,u-=b,p-=y):y<0?(m=$e,y=-y,p-=y):b<0&&(m=Ve,b=-b,u-=b);break;case Dt:this.move(x.x,x.y),C=!1;break;case Et:this.zoom(Fi(c),t),C=!1;break;case St:if(!x.x||!x.y){C=!1;break}J=Yt(this.cropper),p=K.startX-J.left,u=K.startY-J.top,y=o.minWidth,b=o.minHeight,x.x>0?m=x.y>0?Me:Ve:x.x<0&&(p-=y,m=x.y>0?$e:Ce),x.y<0&&(u-=b),this.cropped||(le(this.cropBox,ee),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}C&&(o.width=y,o.height=b,o.left=p,o.top=u,this.action=m,this.renderCropBox()),X(c,function(F){F.startX=F.endX,F.startY=F.endY})}},aa={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Z(this.dragBox,He),le(this.cropBox,ee),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=U({},this.initialImageData),this.canvasData=U({},this.initialCanvasData),this.cropBoxData=U({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(U(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),le(this.dragBox,He),Z(this.cropBox,ee)),this},replace:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),r?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,X(this.previews,function(i){i.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,le(this.cropper,Nt)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Z(this.cropper,Nt)),this},destroy:function(){var t=this.element;return t[H]?(t[H]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,s=i.left,o=i.top;return this.moveTo(dt(t)?t:s+Number(t),dt(r)?r:o+Number(r))},moveTo:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,s=!1;return t=Number(t),r=Number(r),this.ready&&!this.disabled&&this.options.movable&&(z(t)&&(i.left=t,s=!0),z(r)&&(i.top=r,s=!0),s&&this.renderCanvas(!0)),this},zoom:function(t,r){var i=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(i.width*t/i.naturalWidth,null,r)},zoomTo:function(t,r,i){var s=this.options,o=this.canvasData,c=o.width,m=o.height,f=o.naturalWidth,p=o.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&s.zoomable){var u=f*t,y=p*t;if(ke(this.element,ct,{ratio:t,oldRatio:c/f,originalEvent:i})===!1)return this;if(i){var b=this.pointers,N=Yt(this.cropper),S=b&&Object.keys(b).length?Yi(b):{pageX:i.pageX,pageY:i.pageY};o.left-=(u-c)*((S.pageX-N.left-o.left)/c),o.top-=(y-m)*((S.pageY-N.top-o.top)/m)}else ve(r)&&z(r.x)&&z(r.y)?(o.left-=(u-c)*((r.x-o.left)/c),o.top-=(y-m)*((r.y-o.top)/m)):(o.left-=(u-c)/2,o.top-=(y-m)/2);o.width=u,o.height=y,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),z(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var r=this.imageData.scaleY;return this.scale(t,z(r)?r:1)},scaleY:function(t){var r=this.imageData.scaleX;return this.scale(z(r)?r:1,t)},scale:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.imageData,s=!1;return t=Number(t),r=Number(r),this.ready&&!this.disabled&&this.options.scalable&&(z(t)&&(i.scaleX=t,s=!0),z(r)&&(i.scaleY=r,s=!0),s&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.options,i=this.imageData,s=this.canvasData,o=this.cropBoxData,c;if(this.ready&&this.cropped){c={x:o.left-s.left,y:o.top-s.top,width:o.width,height:o.height};var m=i.width/i.naturalWidth;if(X(c,function(u,y){c[y]=u/m}),t){var f=Math.round(c.y+c.height),p=Math.round(c.x+c.width);c.x=Math.round(c.x),c.y=Math.round(c.y),c.width=p-c.x,c.height=f-c.y}}else c={x:0,y:0,width:0,height:0};return r.rotatable&&(c.rotate=i.rotate||0),r.scalable&&(c.scaleX=i.scaleX||1,c.scaleY=i.scaleY||1),c},setData:function(t){var r=this.options,i=this.imageData,s=this.canvasData,o={};if(this.ready&&!this.disabled&&ve(t)){var c=!1;r.rotatable&&z(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,c=!0),r.scalable&&(z(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,c=!0),z(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,c=!0)),c&&this.renderCanvas(!0,!0);var m=i.width/i.naturalWidth;z(t.x)&&(o.left=t.x*m+s.left),z(t.y)&&(o.top=t.y*m+s.top),z(t.width)&&(o.width=t.width*m),z(t.height)&&(o.height=t.height*m),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?U({},this.containerData):{}},getImageData:function(){return this.sized?U({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,r={};return this.ready&&X(["left","top","width","height","naturalWidth","naturalHeight"],function(i){r[i]=t[i]}),r},setCanvasData:function(t){var r=this.canvasData,i=r.aspectRatio;return this.ready&&!this.disabled&&ve(t)&&(z(t.left)&&(r.left=t.left),z(t.top)&&(r.top=t.top),z(t.width)?(r.width=t.width,r.height=t.width/i):z(t.height)&&(r.height=t.height,r.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,r;return this.ready&&this.cropped&&(r={left:t.left,top:t.top,width:t.width,height:t.height}),r||{}},setCropBoxData:function(t){var r=this.cropBoxData,i=this.options.aspectRatio,s,o;return this.ready&&this.cropped&&!this.disabled&&ve(t)&&(z(t.left)&&(r.left=t.left),z(t.top)&&(r.top=t.top),z(t.width)&&t.width!==r.width&&(s=!0,r.width=t.width),z(t.height)&&t.height!==r.height&&(o=!0,r.height=t.height),i&&(s?r.height=r.width/i:o&&(r.width=r.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var r=this.canvasData,i=Xi(this.image,this.imageData,r,t);if(!this.cropped)return i;var s=this.getData(),o=s.x,c=s.y,m=s.width,f=s.height,p=i.width/Math.floor(r.naturalWidth);p!==1&&(o*=p,c*=p,m*=p,f*=p);var u=m/f,y=ue({aspectRatio:u,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),b=ue({aspectRatio:u,width:t.minWidth||0,height:t.minHeight||0},"cover"),N=ue({aspectRatio:u,width:t.width||(p!==1?i.width:m),height:t.height||(p!==1?i.height:f)}),S=N.width,E=N.height;S=Math.min(y.width,Math.max(b.width,S)),E=Math.min(y.height,Math.max(b.height,E));var B=document.createElement("canvas"),A=B.getContext("2d");B.width=we(S),B.height=we(E),A.fillStyle=t.fillColor||"transparent",A.fillRect(0,0,S,E);var O=t.imageSmoothingEnabled,C=O===void 0?!0:O,J=t.imageSmoothingQuality;A.imageSmoothingEnabled=C,J&&(A.imageSmoothingQuality=J);var K=i.width,x=i.height,R=o,F=c,Q,re,$,j,M,L;R<=-m||R>K?(R=0,Q=0,$=0,M=0):R<=0?($=-R,R=0,Q=Math.min(K,m+R),M=Q):R<=K&&($=0,Q=Math.min(m,K-R),M=Q),Q<=0||F<=-f||F>x?(F=0,re=0,j=0,L=0):F<=0?(j=-F,F=0,re=Math.min(x,f+F),L=re):F<=x&&(j=0,re=Math.min(f,x-F),L=re);var P=[R,F,Q,re];if(M>0&&L>0){var q=S/m;P.push($*q,j*q,M*q,L*q)}return A.drawImage.apply(A,[i].concat(xt(P.map(function(Y){return Math.floor(we(Y))})))),B},setAspectRatio:function(t){var r=this.options;return!this.disabled&&!dt(t)&&(r.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var r=this.options,i=this.dragBox,s=this.face;if(this.ready&&!this.disabled){var o=t===ot,c=r.movable&&t===Ct;t=o||c?t:Mt,r.dragMode=t,Te(i,Be,t),_e(i,rt,o),_e(i,nt,c),r.cropBoxMovable||(Te(s,Be,t),_e(s,rt,o),_e(s,nt,c))}return this}},sa=se.Cropper,Gt=function(){function a(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(wi(this,a),!t||!Ai.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=U({},Rt,ve(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return _i(a,[{key:"init",value:function(){var r=this.element,i=r.tagName.toLowerCase(),s;if(!r[H]){if(r[H]=this,i==="img"){if(this.isImg=!0,s=r.getAttribute("src")||"",this.originalUrl=s,!s)return;s=r.src}else i==="canvas"&&window.HTMLCanvasElement&&(s=r.toDataURL());this.load(s)}}},{key:"load",value:function(r){var i=this;if(!!r){this.url=r,this.imageData={};var s=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Bi.test(r)){Ti.test(r)?this.read(Ji(r)):this.clone();return}var c=new XMLHttpRequest,m=this.clone.bind(this);this.reloading=!0,this.xhr=c,c.onabort=m,c.onerror=m,c.ontimeout=m,c.onprogress=function(){c.getResponseHeader("content-type")!==It&&c.abort()},c.onload=function(){i.read(c.response)},c.onloadend=function(){i.reloading=!1,i.xhr=null},o.checkCrossOrigin&&Wt(r)&&s.crossOrigin&&(r=Xt(r)),c.open("GET",r,!0),c.responseType="arraybuffer",c.withCredentials=s.crossOrigin==="use-credentials",c.send()}}},{key:"read",value:function(r){var i=this.options,s=this.imageData,o=Qi(r),c=0,m=1,f=1;if(o>1){this.url=Zi(r,It);var p=ea(o);c=p.rotate,m=p.scaleX,f=p.scaleY}i.rotatable&&(s.rotate=c),i.scalable&&(s.scaleX=m,s.scaleY=f),this.clone()}},{key:"clone",value:function(){var r=this.element,i=this.url,s=r.crossOrigin,o=i;this.options.checkCrossOrigin&&Wt(i)&&(s||(s="anonymous"),o=Xt(i)),this.crossOrigin=s,this.crossOriginUrl=o;var c=document.createElement("img");s&&(c.crossOrigin=s),c.src=o||i,c.alt=r.alt||"The image to crop",this.image=c,c.onload=this.start.bind(this),c.onerror=this.stop.bind(this),Z(c,Vt),r.parentNode.insertBefore(c,r.nextSibling)}},{key:"start",value:function(){var r=this,i=this.image;i.onload=null,i.onerror=null,this.sizing=!0;var s=se.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(se.navigator.userAgent),o=function(p,u){U(r.imageData,{naturalWidth:p,naturalHeight:u,aspectRatio:p/u}),r.initialImageData=U({},r.imageData),r.sizing=!1,r.sized=!0,r.build()};if(i.naturalWidth&&!s){o(i.naturalWidth,i.naturalHeight);return}var c=document.createElement("img"),m=document.body||document.documentElement;this.sizingImage=c,c.onload=function(){o(c.width,c.height),s||m.removeChild(c)},c.src=i.src,s||(c.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",m.appendChild(c))}},{key:"stop",value:function(){var r=this.image;r.onload=null,r.onerror=null,r.parentNode.removeChild(r),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var r=this.element,i=this.options,s=this.image,o=r.parentNode,c=document.createElement("div");c.innerHTML=Oi;var m=c.querySelector(".".concat(H,"-container")),f=m.querySelector(".".concat(H,"-canvas")),p=m.querySelector(".".concat(H,"-drag-box")),u=m.querySelector(".".concat(H,"-crop-box")),y=u.querySelector(".".concat(H,"-face"));this.container=o,this.cropper=m,this.canvas=f,this.dragBox=p,this.cropBox=u,this.viewBox=m.querySelector(".".concat(H,"-view-box")),this.face=y,f.appendChild(s),Z(r,ee),o.insertBefore(m,r.nextSibling),this.isImg||le(s,Vt),this.initPreview(),this.bind(),i.initialAspectRatio=Math.max(0,i.initialAspectRatio)||NaN,i.aspectRatio=Math.max(0,i.aspectRatio)||NaN,i.viewMode=Math.max(0,Math.min(3,Math.round(i.viewMode)))||0,Z(u,ee),i.guides||Z(u.getElementsByClassName("".concat(H,"-dashed")),ee),i.center||Z(u.getElementsByClassName("".concat(H,"-center")),ee),i.background&&Z(m,"".concat(H,"-bg")),i.highlight||Z(y,Ni),i.cropBoxMovable&&(Z(y,nt),Te(y,Be,tt)),i.cropBoxResizable||(Z(u.getElementsByClassName("".concat(H,"-line")),ee),Z(u.getElementsByClassName("".concat(H,"-point")),ee)),this.render(),this.ready=!0,this.setDragMode(i.dragMode),i.autoCrop&&this.crop(),this.setData(i.data),te(i.ready)&&oe(r,Ot,i.ready,{once:!0}),ke(r,Ot)}}},{key:"unbuild",value:function(){!this.ready||(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),le(this.element,ee))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=sa,a}},{key:"setDefaults",value:function(r){U(Rt,ve(r)&&r)}}]),a}();U(Gt.prototype,ta,ra,na,oa,ia,aa);const la={class:"flex"},ca={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},da={class:"ml-auto mb-2"},ha={class:"w-full flex justify-center"},ua=["src"],ma={__name:"Image",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,{t:i}=inject("i18n"),s=e.ref(null),o=e.ref(null),c=e.ref(!1),m=()=>{c.value=!c.value,c.value?o.value=new Gt(s.value,{crop(p){}}):o.value.destroy()},f=()=>{o.value.getCroppedCanvas({width:795,height:341}).toBlob(p=>{Ie(apiUrl.value,{method:"POST",params:{q:"upload",adapter:r.selection.adapter,path:r.selection.item.path,file:p},name:r.selection.item.basename,json:!1}).then(u=>{s.value.src=Je(r.selection.adapter,r.selection.item.path),m(),t("load")}).catch(u=>console.log(u.statusText))})};return onMounted(()=>{t("load")}),(p,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",la,[e.createElementVNode("h3",ca,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",da,[c.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(i)("Crop")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:u[0]||(u[0]=y=>m())},e.toDisplayString(c.value?e.unref(i)("Cancel"):e.unref(i)("Edit")),1)])]),e.createElementVNode("div",ha,[e.createElementVNode("img",{ref_key:"image",ref:s,class:"max-w-[60vh] max-h-[60vh]",src:e.unref(Je)(r.selection.adapter,r.selection.item.path),alt:""},null,8,ua)])],64))}},fa={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},pa=e.createElementVNode("div",null," Default view.. ",-1),ga={__name:"Default",props:{selection:Object},emits:["load"],setup(a,{emit:t}){return e.onMounted(()=>{t("load")}),(r,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",fa,e.toDisplayString(a.selection.item.basename),1),pa],64))}},ya={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ba={class:"w-full",preload:"",controls:""},va=["src"],wa=e.createTextVNode(" Your browser does not support the video tag. "),_a={__name:"Video",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,{apiUrl:i}=ce(),s=()=>i.value+"?"+fe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",ya,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("video",ba,[e.createElementVNode("source",{src:s(),type:"video/mp4"},null,8,va),wa])])],64))}},ka={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},xa={class:"w-full",controls:""},Sa=["src"],Da=e.createTextVNode(" Your browser does not support the audio element. "),Ea={__name:"Audio",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,{apiUrl:i}=ce(),s=()=>i.value+"?"+fe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",ka,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("audio",xa,[e.createElementVNode("source",{src:s(),type:"audio/mpeg"},null,8,Sa),Da])])],64))}},Na={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Va=["data"],Ca=["src"],Ma={__name:"Pdf",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,{apiUrl:i}=ce(),s=()=>i.value+"?"+fe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",Na,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:s(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:s(),width:"100%",height:"100%"},`
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Re=typeof window<"u"&&typeof window.document<"u",se=Re?window:{},Qe=Re&&se.document.documentElement?"ontouchstart"in se.document.documentElement:!1,et=Re?"PointerEvent"in se:!1,H="cropper",tt="all",St="crop",Dt="move",Et="zoom",pe="e",ge="w",be="s",de="n",Ve="ne",Ce="nw",Me="se",$e="sw",rt="".concat(H,"-crop"),Nt="".concat(H,"-disabled"),ee="".concat(H,"-hidden"),Vt="".concat(H,"-hide"),Ni="".concat(H,"-invisible"),He="".concat(H,"-modal"),nt="".concat(H,"-move"),Be="".concat(H,"Action"),Ue="".concat(H,"Preview"),ot="crop",Ct="move",Mt="none",it="crop",at="cropend",st="cropmove",lt="cropstart",$t="dblclick",Vi=Qe?"touchstart":"mousedown",Ci=Qe?"touchmove":"mousemove",Mi=Qe?"touchend touchcancel":"mouseup",Bt=et?"pointerdown":Vi,Tt=et?"pointermove":Ci,At=et?"pointerup pointercancel":Mi,Ot="ready",Pt="resize",jt="wheel",ct="zoom",It="image/jpeg",$i=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Bi=/^data:/,Ti=/^data:image\/jpeg;base64,/,Ai=/^img|canvas$/i,Lt=200,zt=100,Rt={viewMode:0,dragMode:ot,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:Lt,minContainerHeight:zt,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Oi='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Pi=Number.isNaN||se.isNaN;function z(a){return typeof a=="number"&&!Pi(a)}var Ht=function(t){return t>0&&t<1/0};function dt(a){return typeof a>"u"}function ye(a){return ze(a)==="object"&&a!==null}var ji=Object.prototype.hasOwnProperty;function ve(a){if(!ye(a))return!1;try{var t=a.constructor,r=t.prototype;return t&&r&&ji.call(r,"isPrototypeOf")}catch{return!1}}function te(a){return typeof a=="function"}var Ii=Array.prototype.slice;function Ut(a){return Array.from?Array.from(a):Ii.call(a)}function X(a,t){return a&&te(t)&&(Array.isArray(a)||z(a.length)?Ut(a).forEach(function(r,i){t.call(a,r,i,a)}):ye(a)&&Object.keys(a).forEach(function(r){t.call(a,a[r],r,a)})),a}var U=Object.assign||function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return ye(t)&&i.length>0&&i.forEach(function(o){ye(o)&&Object.keys(o).forEach(function(c){t[c]=o[c]})}),t},Li=/\.\d*(?:0|9){12}\d*$/;function we(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Li.test(a)?Math.round(a*t)/t:a}var zi=/^width|height|left|top|marginLeft|marginTop$/;function he(a,t){var r=a.style;X(t,function(i,s){zi.test(s)&&z(i)&&(i="".concat(i,"px")),r[s]=i})}function Ri(a,t){return a.classList?a.classList.contains(t):a.className.indexOf(t)>-1}function Z(a,t){if(!!t){if(z(a.length)){X(a,function(i){Z(i,t)});return}if(a.classList){a.classList.add(t);return}var r=a.className.trim();r?r.indexOf(t)<0&&(a.className="".concat(r," ").concat(t)):a.className=t}}function le(a,t){if(!!t){if(z(a.length)){X(a,function(r){le(r,t)});return}if(a.classList){a.classList.remove(t);return}a.className.indexOf(t)>=0&&(a.className=a.className.replace(t,""))}}function _e(a,t,r){if(!!t){if(z(a.length)){X(a,function(i){_e(i,t,r)});return}r?Z(a,t):le(a,t)}}var Hi=/([a-z\d])([A-Z])/g;function ht(a){return a.replace(Hi,"$1-$2").toLowerCase()}function ut(a,t){return ye(a[t])?a[t]:a.dataset?a.dataset[t]:a.getAttribute("data-".concat(ht(t)))}function Te(a,t,r){ye(r)?a[t]=r:a.dataset?a.dataset[t]=r:a.setAttribute("data-".concat(ht(t)),r)}function Ui(a,t){if(ye(a[t]))try{delete a[t]}catch{a[t]=void 0}else if(a.dataset)try{delete a.dataset[t]}catch{a.dataset[t]=void 0}else a.removeAttribute("data-".concat(ht(t)))}var Kt=/\s\s*/,Ft=function(){var a=!1;if(Re){var t=!1,r=function(){},i=Object.defineProperty({},"once",{get:function(){return a=!0,t},set:function(o){t=o}});se.addEventListener("test",r,i),se.removeEventListener("test",r,i)}return a}();function ie(a,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r;t.trim().split(Kt).forEach(function(o){if(!Ft){var c=a.listeners;c&&c[o]&&c[o][r]&&(s=c[o][r],delete c[o][r],Object.keys(c[o]).length===0&&delete c[o],Object.keys(c).length===0&&delete a.listeners)}a.removeEventListener(o,s,i)})}function oe(a,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r;t.trim().split(Kt).forEach(function(o){if(i.once&&!Ft){var c=a.listeners,m=c===void 0?{}:c;s=function(){delete m[o][r],a.removeEventListener(o,s,i);for(var p=arguments.length,u=new Array(p),y=0;y<p;y++)u[y]=arguments[y];r.apply(a,u)},m[o]||(m[o]={}),m[o][r]&&a.removeEventListener(o,m[o][r],i),m[o][r]=s,a.listeners=m}a.addEventListener(o,s,i)})}function ke(a,t,r){var i;return te(Event)&&te(CustomEvent)?i=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,!0,!0,r)),a.dispatchEvent(i)}function Yt(a){var t=a.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var mt=se.location,Ki=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Wt(a){var t=a.match(Ki);return t!==null&&(t[1]!==mt.protocol||t[2]!==mt.hostname||t[3]!==mt.port)}function Xt(a){var t="timestamp=".concat(new Date().getTime());return a+(a.indexOf("?")===-1?"?":"&")+t}function Ae(a){var t=a.rotate,r=a.scaleX,i=a.scaleY,s=a.translateX,o=a.translateY,c=[];z(s)&&s!==0&&c.push("translateX(".concat(s,"px)")),z(o)&&o!==0&&c.push("translateY(".concat(o,"px)")),z(t)&&t!==0&&c.push("rotate(".concat(t,"deg)")),z(r)&&r!==1&&c.push("scaleX(".concat(r,")")),z(i)&&i!==1&&c.push("scaleY(".concat(i,")"));var m=c.length?c.join(" "):"none";return{WebkitTransform:m,msTransform:m,transform:m}}function Fi(a){var t=_t({},a),r=0;return X(a,function(i,s){delete t[s],X(t,function(o){var c=Math.abs(i.startX-o.startX),m=Math.abs(i.startY-o.startY),f=Math.abs(i.endX-o.endX),p=Math.abs(i.endY-o.endY),u=Math.sqrt(c*c+m*m),y=Math.sqrt(f*f+p*p),b=(y-u)/u;Math.abs(b)>Math.abs(r)&&(r=b)})}),r}function Ke(a,t){var r=a.pageX,i=a.pageY,s={endX:r,endY:i};return t?s:_t({startX:r,startY:i},s)}function Yi(a){var t=0,r=0,i=0;return X(a,function(s){var o=s.startX,c=s.startY;t+=o,r+=c,i+=1}),t/=i,r/=i,{pageX:t,pageY:r}}function ue(a){var t=a.aspectRatio,r=a.height,i=a.width,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=Ht(i),c=Ht(r);if(o&&c){var m=r*t;s==="contain"&&m>i||s==="cover"&&m<i?r=i/t:i=r*t}else o?r=i/t:c&&(i=r*t);return{width:i,height:r}}function Wi(a){var t=a.width,r=a.height,i=a.degree;if(i=Math.abs(i)%180,i===90)return{width:r,height:t};var s=i%90*Math.PI/180,o=Math.sin(s),c=Math.cos(s),m=t*c+r*o,f=t*o+r*c;return i>90?{width:f,height:m}:{width:m,height:f}}function Xi(a,t,r,i){var s=t.aspectRatio,o=t.naturalWidth,c=t.naturalHeight,m=t.rotate,f=m===void 0?0:m,p=t.scaleX,u=p===void 0?1:p,y=t.scaleY,b=y===void 0?1:y,N=r.aspectRatio,S=r.naturalWidth,E=r.naturalHeight,B=i.fillColor,A=B===void 0?"transparent":B,O=i.imageSmoothingEnabled,C=O===void 0?!0:O,J=i.imageSmoothingQuality,K=J===void 0?"low":J,x=i.maxWidth,R=x===void 0?1/0:x,F=i.maxHeight,Q=F===void 0?1/0:F,re=i.minWidth,$=re===void 0?0:re,j=i.minHeight,M=j===void 0?0:j,L=document.createElement("canvas"),P=L.getContext("2d"),q=ue({aspectRatio:N,width:R,height:Q}),Y=ue({aspectRatio:N,width:$,height:M},"cover"),Oe=Math.min(q.width,Math.max(Y.width,S)),Pe=Math.min(q.height,Math.max(Y.height,E)),Fe=ue({aspectRatio:s,width:R,height:Q}),Ye=ue({aspectRatio:s,width:$,height:M},"cover"),We=Math.min(Fe.width,Math.max(Ye.width,o)),xe=Math.min(Fe.height,Math.max(Ye.height,c)),pt=[-We/2,-xe/2,We,xe];return L.width=we(Oe),L.height=we(Pe),P.fillStyle=A,P.fillRect(0,0,Oe,Pe),P.save(),P.translate(Oe/2,Pe/2),P.rotate(f*Math.PI/180),P.scale(u,b),P.imageSmoothingEnabled=C,P.imageSmoothingQuality=K,P.drawImage.apply(P,[a].concat(xt(pt.map(function(Se){return Math.floor(we(Se))})))),P.restore(),L}var qt=String.fromCharCode;function qi(a,t,r){var i="";r+=t;for(var s=t;s<r;s+=1)i+=qt(a.getUint8(s));return i}var Gi=/^data:.*,/;function Ji(a){var t=a.replace(Gi,""),r=atob(t),i=new ArrayBuffer(r.length),s=new Uint8Array(i);return X(s,function(o,c){s[c]=r.charCodeAt(c)}),i}function Zi(a,t){for(var r=[],i=8192,s=new Uint8Array(a);s.length>0;)r.push(qt.apply(null,Ut(s.subarray(0,i)))),s=s.subarray(i);return"data:".concat(t,";base64,").concat(btoa(r.join("")))}function Qi(a){var t=new DataView(a),r;try{var i,s,o;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var c=t.byteLength,m=2;m+1<c;){if(t.getUint8(m)===255&&t.getUint8(m+1)===225){s=m;break}m+=1}if(s){var f=s+4,p=s+10;if(qi(t,f,4)==="Exif"){var u=t.getUint16(p);if(i=u===18761,(i||u===19789)&&t.getUint16(p+2,i)===42){var y=t.getUint32(p+4,i);y>=8&&(o=p+y)}}}if(o){var b=t.getUint16(o,i),N,S;for(S=0;S<b;S+=1)if(N=o+S*12+2,t.getUint16(N,i)===274){N+=8,r=t.getUint16(N,i),t.setUint16(N,1,i);break}}}catch{r=1}return r}function ea(a){var t=0,r=1,i=1;switch(a){case 2:r=-1;break;case 3:t=-180;break;case 4:i=-1;break;case 5:t=90,i=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:r,scaleY:i}}var ta={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,r=this.options,i=this.container,s=this.cropper,o=Number(r.minContainerWidth),c=Number(r.minContainerHeight);Z(s,ee),le(t,ee);var m={width:Math.max(i.offsetWidth,o>=0?o:Lt),height:Math.max(i.offsetHeight,c>=0?c:zt)};this.containerData=m,he(s,{width:m.width,height:m.height}),Z(t,ee),le(s,ee)},initCanvas:function(){var t=this.containerData,r=this.imageData,i=this.options.viewMode,s=Math.abs(r.rotate)%180===90,o=s?r.naturalHeight:r.naturalWidth,c=s?r.naturalWidth:r.naturalHeight,m=o/c,f=t.width,p=t.height;t.height*m>t.width?i===3?f=t.height*m:p=t.width/m:i===3?p=t.width/m:f=t.height*m;var u={aspectRatio:m,naturalWidth:o,naturalHeight:c,width:f,height:p};this.canvasData=u,this.limited=i===1||i===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(t.width-u.width)/2,u.top=(t.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=U({},u)},limitCanvas:function(t,r){var i=this.options,s=this.containerData,o=this.canvasData,c=this.cropBoxData,m=i.viewMode,f=o.aspectRatio,p=this.cropped&&c;if(t){var u=Number(i.minCanvasWidth)||0,y=Number(i.minCanvasHeight)||0;m>1?(u=Math.max(u,s.width),y=Math.max(y,s.height),m===3&&(y*f>u?u=y*f:y=u/f)):m>0&&(u?u=Math.max(u,p?c.width:0):y?y=Math.max(y,p?c.height:0):p&&(u=c.width,y=c.height,y*f>u?u=y*f:y=u/f));var b=ue({aspectRatio:f,width:u,height:y});u=b.width,y=b.height,o.minWidth=u,o.minHeight=y,o.maxWidth=1/0,o.maxHeight=1/0}if(r)if(m>(p?0:1)){var N=s.width-o.width,S=s.height-o.height;o.minLeft=Math.min(0,N),o.minTop=Math.min(0,S),o.maxLeft=Math.max(0,N),o.maxTop=Math.max(0,S),p&&this.limited&&(o.minLeft=Math.min(c.left,c.left+(c.width-o.width)),o.minTop=Math.min(c.top,c.top+(c.height-o.height)),o.maxLeft=c.left,o.maxTop=c.top,m===2&&(o.width>=s.width&&(o.minLeft=Math.min(0,N),o.maxLeft=Math.max(0,N)),o.height>=s.height&&(o.minTop=Math.min(0,S),o.maxTop=Math.max(0,S))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=s.width,o.maxTop=s.height},renderCanvas:function(t,r){var i=this.canvasData,s=this.imageData;if(r){var o=Wi({width:s.naturalWidth*Math.abs(s.scaleX||1),height:s.naturalHeight*Math.abs(s.scaleY||1),degree:s.rotate||0}),c=o.width,m=o.height,f=i.width*(c/i.naturalWidth),p=i.height*(m/i.naturalHeight);i.left-=(f-i.width)/2,i.top-=(p-i.height)/2,i.width=f,i.height=p,i.aspectRatio=c/m,i.naturalWidth=c,i.naturalHeight=m,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,he(this.canvas,U({width:i.width,height:i.height},Ae({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var r=this.canvasData,i=this.imageData,s=i.naturalWidth*(r.width/r.naturalWidth),o=i.naturalHeight*(r.height/r.naturalHeight);U(i,{width:s,height:o,left:(r.width-s)/2,top:(r.height-o)/2}),he(this.image,U({width:i.width,height:i.height},Ae(U({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,r=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,s=Number(t.autoCropArea)||.8,o={width:r.width,height:r.height};i&&(r.height*i>r.width?o.height=o.width/i:o.width=o.height*i),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*s),o.height=Math.max(o.minHeight,o.height*s),o.left=r.left+(r.width-o.width)/2,o.top=r.top+(r.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=U({},o)},limitCropBox:function(t,r){var i=this.options,s=this.containerData,o=this.canvasData,c=this.cropBoxData,m=this.limited,f=i.aspectRatio;if(t){var p=Number(i.minCropBoxWidth)||0,u=Number(i.minCropBoxHeight)||0,y=m?Math.min(s.width,o.width,o.width+o.left,s.width-o.left):s.width,b=m?Math.min(s.height,o.height,o.height+o.top,s.height-o.top):s.height;p=Math.min(p,s.width),u=Math.min(u,s.height),f&&(p&&u?u*f>p?u=p/f:p=u*f:p?u=p/f:u&&(p=u*f),b*f>y?b=y/f:y=b*f),c.minWidth=Math.min(p,y),c.minHeight=Math.min(u,b),c.maxWidth=y,c.maxHeight=b}r&&(m?(c.minLeft=Math.max(0,o.left),c.minTop=Math.max(0,o.top),c.maxLeft=Math.min(s.width,o.left+o.width)-c.width,c.maxTop=Math.min(s.height,o.top+o.height)-c.height):(c.minLeft=0,c.minTop=0,c.maxLeft=s.width-c.width,c.maxTop=s.height-c.height))},renderCropBox:function(){var t=this.options,r=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&Te(this.face,Be,i.width>=r.width&&i.height>=r.height?Dt:tt),he(this.cropBox,U({width:i.width,height:i.height},Ae({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ke(this.element,it,this.getData())}},ra={initPreview:function(){var t=this.element,r=this.crossOrigin,i=this.options.preview,s=r?this.crossOriginUrl:this.url,o=t.alt||"The image to preview",c=document.createElement("img");if(r&&(c.crossOrigin=r),c.src=s,c.alt=o,this.viewBox.appendChild(c),this.viewBoxImage=c,!!i){var m=i;typeof i=="string"?m=t.ownerDocument.querySelectorAll(i):i.querySelector&&(m=[i]),this.previews=m,X(m,function(f){var p=document.createElement("img");Te(f,Ue,{width:f.offsetWidth,height:f.offsetHeight,html:f.innerHTML}),r&&(p.crossOrigin=r),p.src=s,p.alt=o,p.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',f.innerHTML="",f.appendChild(p)})}},resetPreview:function(){X(this.previews,function(t){var r=ut(t,Ue);he(t,{width:r.width,height:r.height}),t.innerHTML=r.html,Ui(t,Ue)})},preview:function(){var t=this.imageData,r=this.canvasData,i=this.cropBoxData,s=i.width,o=i.height,c=t.width,m=t.height,f=i.left-r.left-t.left,p=i.top-r.top-t.top;!this.cropped||this.disabled||(he(this.viewBoxImage,U({width:c,height:m},Ae(U({translateX:-f,translateY:-p},t)))),X(this.previews,function(u){var y=ut(u,Ue),b=y.width,N=y.height,S=b,E=N,B=1;s&&(B=b/s,E=o*B),o&&E>N&&(B=N/o,S=s*B,E=N),he(u,{width:S,height:E}),he(u.getElementsByTagName("img")[0],U({width:c*B,height:m*B},Ae(U({translateX:-f*B,translateY:-p*B},t))))}))}},na={bind:function(){var t=this.element,r=this.options,i=this.cropper;te(r.cropstart)&&oe(t,lt,r.cropstart),te(r.cropmove)&&oe(t,st,r.cropmove),te(r.cropend)&&oe(t,at,r.cropend),te(r.crop)&&oe(t,it,r.crop),te(r.zoom)&&oe(t,ct,r.zoom),oe(i,Bt,this.onCropStart=this.cropStart.bind(this)),r.zoomable&&r.zoomOnWheel&&oe(i,jt,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&oe(i,$t,this.onDblclick=this.dblclick.bind(this)),oe(t.ownerDocument,Tt,this.onCropMove=this.cropMove.bind(this)),oe(t.ownerDocument,At,this.onCropEnd=this.cropEnd.bind(this)),r.responsive&&oe(window,Pt,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,r=this.options,i=this.cropper;te(r.cropstart)&&ie(t,lt,r.cropstart),te(r.cropmove)&&ie(t,st,r.cropmove),te(r.cropend)&&ie(t,at,r.cropend),te(r.crop)&&ie(t,it,r.crop),te(r.zoom)&&ie(t,ct,r.zoom),ie(i,Bt,this.onCropStart),r.zoomable&&r.zoomOnWheel&&ie(i,jt,this.onWheel,{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&ie(i,$t,this.onDblclick),ie(t.ownerDocument,Tt,this.onCropMove),ie(t.ownerDocument,At,this.onCropEnd),r.responsive&&ie(window,Pt,this.onResize)}},oa={resize:function(){if(!this.disabled){var t=this.options,r=this.container,i=this.containerData,s=r.offsetWidth/i.width,o=r.offsetHeight/i.height,c=Math.abs(s-1)>Math.abs(o-1)?s:o;if(c!==1){var m,f;t.restore&&(m=this.getCanvasData(),f=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(X(m,function(p,u){m[u]=p*c})),this.setCropBoxData(X(f,function(p,u){f[u]=p*c})))}}},dblclick:function(){this.disabled||this.options.dragMode===Mt||this.setDragMode(Ri(this.dragBox,rt)?Ct:ot)},wheel:function(t){var r=this,i=Number(this.options.wheelZoomRatio)||.1,s=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){r.wheeling=!1},50),t.deltaY?s=t.deltaY>0?1:-1:t.wheelDelta?s=-t.wheelDelta/120:t.detail&&(s=t.detail>0?1:-1),this.zoom(-s*i,t)))},cropStart:function(t){var r=t.buttons,i=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(z(r)&&r!==1||z(i)&&i!==0||t.ctrlKey))){var s=this.options,o=this.pointers,c;t.changedTouches?X(t.changedTouches,function(m){o[m.identifier]=Ke(m)}):o[t.pointerId||0]=Ke(t),Object.keys(o).length>1&&s.zoomable&&s.zoomOnTouch?c=Et:c=ut(t.target,Be),!!$i.test(c)&&ke(this.element,lt,{originalEvent:t,action:c})!==!1&&(t.preventDefault(),this.action=c,this.cropping=!1,c===St&&(this.cropping=!0,Z(this.dragBox,He)))}},cropMove:function(t){var r=this.action;if(!(this.disabled||!r)){var i=this.pointers;t.preventDefault(),ke(this.element,st,{originalEvent:t,action:r})!==!1&&(t.changedTouches?X(t.changedTouches,function(s){U(i[s.identifier]||{},Ke(s,!0))}):U(i[t.pointerId||0]||{},Ke(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var r=this.action,i=this.pointers;t.changedTouches?X(t.changedTouches,function(s){delete i[s.identifier]}):delete i[t.pointerId||0],r&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,_e(this.dragBox,He,this.cropped&&this.options.modal)),ke(this.element,at,{originalEvent:t,action:r}))}}},ia={change:function(t){var r=this.options,i=this.canvasData,s=this.containerData,o=this.cropBoxData,c=this.pointers,m=this.action,f=r.aspectRatio,p=o.left,u=o.top,y=o.width,b=o.height,N=p+y,S=u+b,E=0,B=0,A=s.width,O=s.height,C=!0,J;!f&&t.shiftKey&&(f=y&&b?y/b:1),this.limited&&(E=o.minLeft,B=o.minTop,A=E+Math.min(s.width,i.width,i.left+i.width),O=B+Math.min(s.height,i.height,i.top+i.height));var K=c[Object.keys(c)[0]],x={x:K.endX-K.startX,y:K.endY-K.startY},R=function(Q){switch(Q){case pe:N+x.x>A&&(x.x=A-N);break;case ge:p+x.x<E&&(x.x=E-p);break;case de:u+x.y<B&&(x.y=B-u);break;case be:S+x.y>O&&(x.y=O-S);break}};switch(m){case tt:p+=x.x,u+=x.y;break;case pe:if(x.x>=0&&(N>=A||f&&(u<=B||S>=O))){C=!1;break}R(pe),y+=x.x,y<0&&(m=ge,y=-y,p-=y),f&&(b=y/f,u+=(o.height-b)/2);break;case de:if(x.y<=0&&(u<=B||f&&(p<=E||N>=A))){C=!1;break}R(de),b-=x.y,u+=x.y,b<0&&(m=be,b=-b,u-=b),f&&(y=b*f,p+=(o.width-y)/2);break;case ge:if(x.x<=0&&(p<=E||f&&(u<=B||S>=O))){C=!1;break}R(ge),y-=x.x,p+=x.x,y<0&&(m=pe,y=-y,p-=y),f&&(b=y/f,u+=(o.height-b)/2);break;case be:if(x.y>=0&&(S>=O||f&&(p<=E||N>=A))){C=!1;break}R(be),b+=x.y,b<0&&(m=de,b=-b,u-=b),f&&(y=b*f,p+=(o.width-y)/2);break;case Ve:if(f){if(x.y<=0&&(u<=B||N>=A)){C=!1;break}R(de),b-=x.y,u+=x.y,y=b*f}else R(de),R(pe),x.x>=0?N<A?y+=x.x:x.y<=0&&u<=B&&(C=!1):y+=x.x,x.y<=0?u>B&&(b-=x.y,u+=x.y):(b-=x.y,u+=x.y);y<0&&b<0?(m=$e,b=-b,y=-y,u-=b,p-=y):y<0?(m=Ce,y=-y,p-=y):b<0&&(m=Me,b=-b,u-=b);break;case Ce:if(f){if(x.y<=0&&(u<=B||p<=E)){C=!1;break}R(de),b-=x.y,u+=x.y,y=b*f,p+=o.width-y}else R(de),R(ge),x.x<=0?p>E?(y-=x.x,p+=x.x):x.y<=0&&u<=B&&(C=!1):(y-=x.x,p+=x.x),x.y<=0?u>B&&(b-=x.y,u+=x.y):(b-=x.y,u+=x.y);y<0&&b<0?(m=Me,b=-b,y=-y,u-=b,p-=y):y<0?(m=Ve,y=-y,p-=y):b<0&&(m=$e,b=-b,u-=b);break;case $e:if(f){if(x.x<=0&&(p<=E||S>=O)){C=!1;break}R(ge),y-=x.x,p+=x.x,b=y/f}else R(be),R(ge),x.x<=0?p>E?(y-=x.x,p+=x.x):x.y>=0&&S>=O&&(C=!1):(y-=x.x,p+=x.x),x.y>=0?S<O&&(b+=x.y):b+=x.y;y<0&&b<0?(m=Ve,b=-b,y=-y,u-=b,p-=y):y<0?(m=Me,y=-y,p-=y):b<0&&(m=Ce,b=-b,u-=b);break;case Me:if(f){if(x.x>=0&&(N>=A||S>=O)){C=!1;break}R(pe),y+=x.x,b=y/f}else R(be),R(pe),x.x>=0?N<A?y+=x.x:x.y>=0&&S>=O&&(C=!1):y+=x.x,x.y>=0?S<O&&(b+=x.y):b+=x.y;y<0&&b<0?(m=Ce,b=-b,y=-y,u-=b,p-=y):y<0?(m=$e,y=-y,p-=y):b<0&&(m=Ve,b=-b,u-=b);break;case Dt:this.move(x.x,x.y),C=!1;break;case Et:this.zoom(Fi(c),t),C=!1;break;case St:if(!x.x||!x.y){C=!1;break}J=Yt(this.cropper),p=K.startX-J.left,u=K.startY-J.top,y=o.minWidth,b=o.minHeight,x.x>0?m=x.y>0?Me:Ve:x.x<0&&(p-=y,m=x.y>0?$e:Ce),x.y<0&&(u-=b),this.cropped||(le(this.cropBox,ee),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}C&&(o.width=y,o.height=b,o.left=p,o.top=u,this.action=m,this.renderCropBox()),X(c,function(F){F.startX=F.endX,F.startY=F.endY})}},aa={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Z(this.dragBox,He),le(this.cropBox,ee),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=U({},this.initialImageData),this.canvasData=U({},this.initialCanvasData),this.cropBoxData=U({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(U(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),le(this.dragBox,He),Z(this.cropBox,ee)),this},replace:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),r?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,X(this.previews,function(i){i.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,le(this.cropper,Nt)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Z(this.cropper,Nt)),this},destroy:function(){var t=this.element;return t[H]?(t[H]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,s=i.left,o=i.top;return this.moveTo(dt(t)?t:s+Number(t),dt(r)?r:o+Number(r))},moveTo:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,s=!1;return t=Number(t),r=Number(r),this.ready&&!this.disabled&&this.options.movable&&(z(t)&&(i.left=t,s=!0),z(r)&&(i.top=r,s=!0),s&&this.renderCanvas(!0)),this},zoom:function(t,r){var i=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(i.width*t/i.naturalWidth,null,r)},zoomTo:function(t,r,i){var s=this.options,o=this.canvasData,c=o.width,m=o.height,f=o.naturalWidth,p=o.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&s.zoomable){var u=f*t,y=p*t;if(ke(this.element,ct,{ratio:t,oldRatio:c/f,originalEvent:i})===!1)return this;if(i){var b=this.pointers,N=Yt(this.cropper),S=b&&Object.keys(b).length?Yi(b):{pageX:i.pageX,pageY:i.pageY};o.left-=(u-c)*((S.pageX-N.left-o.left)/c),o.top-=(y-m)*((S.pageY-N.top-o.top)/m)}else ve(r)&&z(r.x)&&z(r.y)?(o.left-=(u-c)*((r.x-o.left)/c),o.top-=(y-m)*((r.y-o.top)/m)):(o.left-=(u-c)/2,o.top-=(y-m)/2);o.width=u,o.height=y,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),z(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var r=this.imageData.scaleY;return this.scale(t,z(r)?r:1)},scaleY:function(t){var r=this.imageData.scaleX;return this.scale(z(r)?r:1,t)},scale:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.imageData,s=!1;return t=Number(t),r=Number(r),this.ready&&!this.disabled&&this.options.scalable&&(z(t)&&(i.scaleX=t,s=!0),z(r)&&(i.scaleY=r,s=!0),s&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.options,i=this.imageData,s=this.canvasData,o=this.cropBoxData,c;if(this.ready&&this.cropped){c={x:o.left-s.left,y:o.top-s.top,width:o.width,height:o.height};var m=i.width/i.naturalWidth;if(X(c,function(u,y){c[y]=u/m}),t){var f=Math.round(c.y+c.height),p=Math.round(c.x+c.width);c.x=Math.round(c.x),c.y=Math.round(c.y),c.width=p-c.x,c.height=f-c.y}}else c={x:0,y:0,width:0,height:0};return r.rotatable&&(c.rotate=i.rotate||0),r.scalable&&(c.scaleX=i.scaleX||1,c.scaleY=i.scaleY||1),c},setData:function(t){var r=this.options,i=this.imageData,s=this.canvasData,o={};if(this.ready&&!this.disabled&&ve(t)){var c=!1;r.rotatable&&z(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,c=!0),r.scalable&&(z(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,c=!0),z(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,c=!0)),c&&this.renderCanvas(!0,!0);var m=i.width/i.naturalWidth;z(t.x)&&(o.left=t.x*m+s.left),z(t.y)&&(o.top=t.y*m+s.top),z(t.width)&&(o.width=t.width*m),z(t.height)&&(o.height=t.height*m),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?U({},this.containerData):{}},getImageData:function(){return this.sized?U({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,r={};return this.ready&&X(["left","top","width","height","naturalWidth","naturalHeight"],function(i){r[i]=t[i]}),r},setCanvasData:function(t){var r=this.canvasData,i=r.aspectRatio;return this.ready&&!this.disabled&&ve(t)&&(z(t.left)&&(r.left=t.left),z(t.top)&&(r.top=t.top),z(t.width)?(r.width=t.width,r.height=t.width/i):z(t.height)&&(r.height=t.height,r.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,r;return this.ready&&this.cropped&&(r={left:t.left,top:t.top,width:t.width,height:t.height}),r||{}},setCropBoxData:function(t){var r=this.cropBoxData,i=this.options.aspectRatio,s,o;return this.ready&&this.cropped&&!this.disabled&&ve(t)&&(z(t.left)&&(r.left=t.left),z(t.top)&&(r.top=t.top),z(t.width)&&t.width!==r.width&&(s=!0,r.width=t.width),z(t.height)&&t.height!==r.height&&(o=!0,r.height=t.height),i&&(s?r.height=r.width/i:o&&(r.width=r.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var r=this.canvasData,i=Xi(this.image,this.imageData,r,t);if(!this.cropped)return i;var s=this.getData(),o=s.x,c=s.y,m=s.width,f=s.height,p=i.width/Math.floor(r.naturalWidth);p!==1&&(o*=p,c*=p,m*=p,f*=p);var u=m/f,y=ue({aspectRatio:u,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),b=ue({aspectRatio:u,width:t.minWidth||0,height:t.minHeight||0},"cover"),N=ue({aspectRatio:u,width:t.width||(p!==1?i.width:m),height:t.height||(p!==1?i.height:f)}),S=N.width,E=N.height;S=Math.min(y.width,Math.max(b.width,S)),E=Math.min(y.height,Math.max(b.height,E));var B=document.createElement("canvas"),A=B.getContext("2d");B.width=we(S),B.height=we(E),A.fillStyle=t.fillColor||"transparent",A.fillRect(0,0,S,E);var O=t.imageSmoothingEnabled,C=O===void 0?!0:O,J=t.imageSmoothingQuality;A.imageSmoothingEnabled=C,J&&(A.imageSmoothingQuality=J);var K=i.width,x=i.height,R=o,F=c,Q,re,$,j,M,L;R<=-m||R>K?(R=0,Q=0,$=0,M=0):R<=0?($=-R,R=0,Q=Math.min(K,m+R),M=Q):R<=K&&($=0,Q=Math.min(m,K-R),M=Q),Q<=0||F<=-f||F>x?(F=0,re=0,j=0,L=0):F<=0?(j=-F,F=0,re=Math.min(x,f+F),L=re):F<=x&&(j=0,re=Math.min(f,x-F),L=re);var P=[R,F,Q,re];if(M>0&&L>0){var q=S/m;P.push($*q,j*q,M*q,L*q)}return A.drawImage.apply(A,[i].concat(xt(P.map(function(Y){return Math.floor(we(Y))})))),B},setAspectRatio:function(t){var r=this.options;return!this.disabled&&!dt(t)&&(r.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var r=this.options,i=this.dragBox,s=this.face;if(this.ready&&!this.disabled){var o=t===ot,c=r.movable&&t===Ct;t=o||c?t:Mt,r.dragMode=t,Te(i,Be,t),_e(i,rt,o),_e(i,nt,c),r.cropBoxMovable||(Te(s,Be,t),_e(s,rt,o),_e(s,nt,c))}return this}},sa=se.Cropper,Gt=function(){function a(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(wi(this,a),!t||!Ai.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=U({},Rt,ve(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return _i(a,[{key:"init",value:function(){var r=this.element,i=r.tagName.toLowerCase(),s;if(!r[H]){if(r[H]=this,i==="img"){if(this.isImg=!0,s=r.getAttribute("src")||"",this.originalUrl=s,!s)return;s=r.src}else i==="canvas"&&window.HTMLCanvasElement&&(s=r.toDataURL());this.load(s)}}},{key:"load",value:function(r){var i=this;if(!!r){this.url=r,this.imageData={};var s=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Bi.test(r)){Ti.test(r)?this.read(Ji(r)):this.clone();return}var c=new XMLHttpRequest,m=this.clone.bind(this);this.reloading=!0,this.xhr=c,c.onabort=m,c.onerror=m,c.ontimeout=m,c.onprogress=function(){c.getResponseHeader("content-type")!==It&&c.abort()},c.onload=function(){i.read(c.response)},c.onloadend=function(){i.reloading=!1,i.xhr=null},o.checkCrossOrigin&&Wt(r)&&s.crossOrigin&&(r=Xt(r)),c.open("GET",r,!0),c.responseType="arraybuffer",c.withCredentials=s.crossOrigin==="use-credentials",c.send()}}},{key:"read",value:function(r){var i=this.options,s=this.imageData,o=Qi(r),c=0,m=1,f=1;if(o>1){this.url=Zi(r,It);var p=ea(o);c=p.rotate,m=p.scaleX,f=p.scaleY}i.rotatable&&(s.rotate=c),i.scalable&&(s.scaleX=m,s.scaleY=f),this.clone()}},{key:"clone",value:function(){var r=this.element,i=this.url,s=r.crossOrigin,o=i;this.options.checkCrossOrigin&&Wt(i)&&(s||(s="anonymous"),o=Xt(i)),this.crossOrigin=s,this.crossOriginUrl=o;var c=document.createElement("img");s&&(c.crossOrigin=s),c.src=o||i,c.alt=r.alt||"The image to crop",this.image=c,c.onload=this.start.bind(this),c.onerror=this.stop.bind(this),Z(c,Vt),r.parentNode.insertBefore(c,r.nextSibling)}},{key:"start",value:function(){var r=this,i=this.image;i.onload=null,i.onerror=null,this.sizing=!0;var s=se.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(se.navigator.userAgent),o=function(p,u){U(r.imageData,{naturalWidth:p,naturalHeight:u,aspectRatio:p/u}),r.initialImageData=U({},r.imageData),r.sizing=!1,r.sized=!0,r.build()};if(i.naturalWidth&&!s){o(i.naturalWidth,i.naturalHeight);return}var c=document.createElement("img"),m=document.body||document.documentElement;this.sizingImage=c,c.onload=function(){o(c.width,c.height),s||m.removeChild(c)},c.src=i.src,s||(c.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",m.appendChild(c))}},{key:"stop",value:function(){var r=this.image;r.onload=null,r.onerror=null,r.parentNode.removeChild(r),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var r=this.element,i=this.options,s=this.image,o=r.parentNode,c=document.createElement("div");c.innerHTML=Oi;var m=c.querySelector(".".concat(H,"-container")),f=m.querySelector(".".concat(H,"-canvas")),p=m.querySelector(".".concat(H,"-drag-box")),u=m.querySelector(".".concat(H,"-crop-box")),y=u.querySelector(".".concat(H,"-face"));this.container=o,this.cropper=m,this.canvas=f,this.dragBox=p,this.cropBox=u,this.viewBox=m.querySelector(".".concat(H,"-view-box")),this.face=y,f.appendChild(s),Z(r,ee),o.insertBefore(m,r.nextSibling),this.isImg||le(s,Vt),this.initPreview(),this.bind(),i.initialAspectRatio=Math.max(0,i.initialAspectRatio)||NaN,i.aspectRatio=Math.max(0,i.aspectRatio)||NaN,i.viewMode=Math.max(0,Math.min(3,Math.round(i.viewMode)))||0,Z(u,ee),i.guides||Z(u.getElementsByClassName("".concat(H,"-dashed")),ee),i.center||Z(u.getElementsByClassName("".concat(H,"-center")),ee),i.background&&Z(m,"".concat(H,"-bg")),i.highlight||Z(y,Ni),i.cropBoxMovable&&(Z(y,nt),Te(y,Be,tt)),i.cropBoxResizable||(Z(u.getElementsByClassName("".concat(H,"-line")),ee),Z(u.getElementsByClassName("".concat(H,"-point")),ee)),this.render(),this.ready=!0,this.setDragMode(i.dragMode),i.autoCrop&&this.crop(),this.setData(i.data),te(i.ready)&&oe(r,Ot,i.ready,{once:!0}),ke(r,Ot)}}},{key:"unbuild",value:function(){!this.ready||(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),le(this.element,ee))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=sa,a}},{key:"setDefaults",value:function(r){U(Rt,ve(r)&&r)}}]),a}();U(Gt.prototype,ta,ra,na,oa,ia,aa);const la={class:"flex"},ca={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},da={class:"ml-auto mb-2"},ha={class:"w-full flex justify-center"},ua=["src"],ma={__name:"Image",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,{t:i}=e.inject("i18n"),s=e.ref(null),o=e.ref(null),c=e.ref(!1),m=()=>{c.value=!c.value,c.value?o.value=new Gt(s.value,{crop(p){}}):o.value.destroy()},f=()=>{o.value.getCroppedCanvas({width:795,height:341}).toBlob(p=>{Ie(apiUrl.value,{method:"POST",params:{q:"upload",adapter:r.selection.adapter,path:r.selection.item.path,file:p},name:r.selection.item.basename,json:!1}).then(u=>{s.value.src=Je(r.selection.adapter,r.selection.item.path),m(),t("load")}).catch(u=>console.log(u.statusText))})};return onMounted(()=>{t("load")}),(p,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",la,[e.createElementVNode("h3",ca,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",da,[c.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(i)("Crop")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:u[0]||(u[0]=y=>m())},e.toDisplayString(c.value?e.unref(i)("Cancel"):e.unref(i)("Edit")),1)])]),e.createElementVNode("div",ha,[e.createElementVNode("img",{ref_key:"image",ref:s,class:"max-w-[60vh] max-h-[60vh]",src:e.unref(Je)(r.selection.adapter,r.selection.item.path),alt:""},null,8,ua)])],64))}},fa={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},pa=e.createElementVNode("div",null," Default view.. ",-1),ga={__name:"Default",props:{selection:Object},emits:["load"],setup(a,{emit:t}){return e.onMounted(()=>{t("load")}),(r,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",fa,e.toDisplayString(a.selection.item.basename),1),pa],64))}},ya={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ba={class:"w-full",preload:"",controls:""},va=["src"],wa=e.createTextVNode(" Your browser does not support the video tag. "),_a={__name:"Video",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,{apiUrl:i}=ce(),s=()=>i.value+"?"+fe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",ya,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("video",ba,[e.createElementVNode("source",{src:s(),type:"video/mp4"},null,8,va),wa])])],64))}},ka={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},xa={class:"w-full",controls:""},Sa=["src"],Da=e.createTextVNode(" Your browser does not support the audio element. "),Ea={__name:"Audio",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,{apiUrl:i}=ce(),s=()=>i.value+"?"+fe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",ka,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("audio",xa,[e.createElementVNode("source",{src:s(),type:"audio/mpeg"},null,8,Sa),Da])])],64))}},Na={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Va=["data"],Ca=["src"],Ma={__name:"Pdf",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,{apiUrl:i}=ce(),s=()=>i.value+"?"+fe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",Na,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:s(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:s(),width:"100%",height:"100%"},`
13
13
  <p>
14
14
  Your browser does not support PDFs.
15
15
  <a href="https://example.com/test.pdf">Download the PDF</a>
16
16
  .
17
17
  </p>
18
- `,8,Ca)],8,Va)])],64))}},$a={class:"sm:flex sm:items-start"},Ba={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},Ta={class:"text-gray-700 dark:text-gray-200 text-sm"},Aa={key:0,class:"flex leading-5"},Oa=e.createElementVNode("svg",{class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),Pa=Object.assign({name:"VFModalPreview"},{props:{selection:Object},setup(a){const t=a,{apiUrl:r}=ce(),i=inject("emitter"),{t:s}=inject("i18n"),o=e.ref(!1),c=p=>o.value=p,m=p=>{var u;return((u=t.selection.item.mime_type)!=null?u:"").startsWith(p)},f=()=>{const p=r.value+"?"+fe({q:"download",adapter:t.selection.adapter,path:t.selection.item.path});i.emit("vf-download",p)};return(p,u)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u[6]||(u[6]=y=>e.unref(i).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(s)("Close")),1),e.createElementVNode("button",{type:"button",onClick:u[7]||(u[7]=y=>f()),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(s)("Download")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$a,[e.createElementVNode("div",Ba,[e.createElementVNode("div",null,[m("text")?(e.openBlock(),e.createBlock(vi,{key:0,selection:a.selection,onLoad:u[0]||(u[0]=y=>c(!0))},null,8,["selection"])):m("image")?(e.openBlock(),e.createBlock(ma,{key:1,selection:a.selection,onLoad:u[1]||(u[1]=y=>c(!0))},null,8,["selection"])):m("video")?(e.openBlock(),e.createBlock(_a,{key:2,selection:a.selection,onLoad:u[2]||(u[2]=y=>c(!0))},null,8,["selection"])):m("audio")?(e.openBlock(),e.createBlock(Ea,{key:3,selection:a.selection,onLoad:u[3]||(u[3]=y=>c(!0))},null,8,["selection"])):m("application/pdf")?(e.openBlock(),e.createBlock(Ma,{key:4,selection:a.selection,onLoad:u[4]||(u[4]=y=>c(!0))},null,8,["selection"])):(e.openBlock(),e.createBlock(ga,{key:5,selection:a.selection,onLoad:u[5]||(u[5]=y=>c(!0))},null,8,["selection"]))]),e.createElementVNode("div",Ta,[e.createElementVNode("p",null,e.toDisplayString(a.selection.item.path),1),e.createElementVNode("p",null,"mime_type: "+e.toDisplayString(a.selection.item.mime_type),1),o.value==!1?(e.openBlock(),e.createElementBlock("div",Aa,[Oa,e.createElementVNode("span",null,e.toDisplayString(e.unref(s)("Loading")),1)])):e.createCommentVNode("",!0)])])])]),_:1}))}}),ja={class:"sm:flex sm:items-start"},Ia=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})])],-1),La={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},za={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ra={class:"mt-2"},Ha={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},Ua={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"},Ka=[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)],Fa={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"},Ya=[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)],Wa={class:"ml-1.5"},Xa=["onKeyup"],qa=Object.assign({name:"VFModalRename"},{props:{selection:Object,current:Object},setup(a){const t=a,r=inject("emitter"),{getStore:i}=inject("storage"),{t:s}=inject("i18n"),o=e.ref(t.selection.items[0]),c=e.ref(t.selection.items[0].basename),m=()=>{c.value!=""&&r.emit("vf-fetch",{q:"rename",adapter:i("adapter","local"),path:t.current.dirname,item:o.value.path,name:c.value})};return(f,p)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,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(s)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:p[1]||(p[1]=u=>e.unref(r).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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ja,[Ia,e.createElementVNode("div",La,[e.createElementVNode("h3",za,e.toDisplayString(e.unref(s)("Rename")),1),e.createElementVNode("div",Ra,[e.createElementVNode("p",Ha,[o.value.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ua,Ka)):(e.openBlock(),e.createElementBlock("svg",Fa,Ya)),e.createElementVNode("span",Wa,e.toDisplayString(o.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=u=>c.value=u),onKeyup:e.withKeys(m,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,40,Xa),[[e.vModelText,c.value]])])])])]),_:1}))}}),Ga={class:"sm:flex sm:items-start"},Ja=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})])],-1),Za={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Qa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},es={class:"mt-2"},ts={class:"text-gray-500 mb-1"},rs=["id"],ns={key:0,class:"py-2"},os=["disabled","onClick"],is=Object.assign({name:"VFModalUpload"},{props:{current:Object},setup(a){const t=a,r=inject("emitter"),{apiUrl:i}=ce(),{t:s}=inject("i18n"),o=e.ref(null),c=e.ref(null),m=e.ref(null),f=e.ref([]),p=e.ref(!0),u=()=>{o.value.start()};return e.onMounted(()=>{o.value=new qe.default.Uploader({runtimes:"html5",browse_button:m.value,container:c.value,max_file_size:"10mb",multiple_queues:!0,file_data_name:"file",url:i.value+"?"+fe({q:"upload",adapter:t.current.adapter,path:t.current.dirname}),init:{PostInit:function(){},FilesAdded:function(y,b){p.value=!1,qe.default.each(b,function(N){f.value.push({id:N.id,name:N.name,size:qe.default.formatSize(N.size),percent:""})})},UploadProgress:function(y,b){f.value[f.value.findIndex(N=>N.id==b.id)].percent=b.percent+"%"},UploadComplete:function(){p.value=!0,r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:t.current.dirname})},Error:function(y,b){}}}),o.value.init()}),(y,b)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{disabled:p.value,onClick:e.withModifiers(u,["prevent"]),type:"button",class:e.normalizeClass([p.value?"bg-red-200 hover:bg-red-200":"bg-red-600 hover:bg-red-700","w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white 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(s)("Upload")),11,os),e.createElementVNode("button",{type:"button",onClick:b[0]||(b[0]=N=>e.unref(r).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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ga,[Ja,e.createElementVNode("div",Za,[e.createElementVNode("h3",Qa,e.toDisplayString(e.unref(s)("Upload files")),1),e.createElementVNode("div",es,[e.createElementVNode("div",ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,N=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{id:N.id},[e.createTextVNode(e.toDisplayString(N.name)+" ( "+e.toDisplayString(N.size)+") ",1),e.createElementVNode("b",null,e.toDisplayString(N.percent),1)],8,rs)]))),256)),f.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ns,e.toDisplayString(e.unref(s)("No files selected!")),1))]),e.createElementVNode("div",{class:"text-gray-500",ref_key:"container",ref:c},[e.createElementVNode("button",{ref_key:"pickFiles",ref:m,type:"button",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(s)("Select Files")),513)],512)])])])]),_:1}))}}),as={class:"sm:flex sm:items-start"},ss=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),ls={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},cs={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ds={class:"mt-2"},hs={class:"flex text-sm text-gray-800 dark:text-gray-400"},us={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"},ms=[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)],fs={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"},ps=[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)],gs={class:"ml-1.5"},ys=["onKeyup","placeholder"],bs=Object.assign({name:"VFModalArchive"},{props:{selection:Object,current:Object},setup(a){const t=a,r=inject("emitter"),{getStore:i}=inject("storage"),{t:s}=inject("i18n"),o=e.ref(""),c=e.ref(t.selection.items),m=()=>{c.value.length&&r.emit("vf-fetch",{q:"archive",adapter:i("adapter","local"),path:t.current.dirname,items:JSON.stringify(c.value.map(({path:f,type:p})=>({path:f,type:p}))),name:o.value})};return(f,p)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,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(s)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:p[1]||(p[1]=u=>e.unref(r).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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",as,[ss,e.createElementVNode("div",ls,[e.createElementVNode("h3",cs,e.toDisplayString(e.unref(s)("Archive the files")),1),e.createElementVNode("div",ds,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,u=>(e.openBlock(),e.createElementBlock("p",hs,[u.type=="dir"?(e.openBlock(),e.createElementBlock("svg",us,ms)):(e.openBlock(),e.createElementBlock("svg",fs,ps)),e.createElementVNode("span",gs,e.toDisplayString(u.basename),1)]))),256)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=u=>o.value=u),onKeyup:e.withKeys(m,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("Archive name. (.zip file will be created)"),type:"text"},null,40,ys),[[e.vModelText,o.value]])])])])]),_:1}))}}),vs={class:"sm:flex sm:items-start"},ws=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),_s={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ks={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},xs={class:"mt-2"},Ss={class:"flex text-sm text-gray-800 dark:text-gray-400"},Ds={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"},Es=[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)],Ns={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"},Vs=[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)],Cs={class:"ml-1.5"},Ms={class:"my-1 text-sm text-gray-500"},$s=Object.assign({name:"VFModalUnarchive"},{props:{selection:Object,current:Object},setup(a){const t=a,r=inject("emitter"),{getStore:i}=inject("storage"),{t:s}=inject("i18n");e.ref("");const o=e.ref(t.selection.items[0]),c=e.ref([]),m=()=>{r.emit("vf-fetch",{q:"unarchive",adapter:i("adapter","local"),path:t.current.dirname,item:o.value.path})};return(f,p)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,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(s)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:p[0]||(p[0]=u=>e.unref(r).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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",vs,[ws,e.createElementVNode("div",_s,[e.createElementVNode("h3",ks,e.toDisplayString(e.unref(s)("Unarchive")),1),e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,u=>(e.openBlock(),e.createElementBlock("p",Ss,[u.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ds,Es)):(e.openBlock(),e.createElementBlock("svg",Ns,Vs)),e.createElementVNode("span",Cs,e.toDisplayString(u.basename),1)]))),256)),e.createElementVNode("p",Ms,e.toDisplayString(e.unref(s)("The archive will be unarchived at"))+" ("+e.toDisplayString(a.current.dirname)+")",1)])])])]),_:1}))}}),Bs={class:"sm:flex sm:items-start"},Ts=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",{class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1),As={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Os={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ps={class:"mt-2"},js={class:"flex text-sm text-gray-800 dark:text-gray-400"},Is={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"},Ls=[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)],zs={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"},Rs=[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)],Hs={class:"ml-1.5"},Us=e.createElementVNode("p",{class:"text-sm text-gray-500 pb-1 pt-3"},"Bu dosyalar\u0131 ta\u015F\u0131mak istedi\u011Finizden emin misiniz?",-1),Ks={class:"flex text-sm text-gray-800 dark:text-gray-400"},Fs=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),Ys={class:"ml-1.5 overflow-auto"},ft={VueFinder:Do,...Object.freeze(Object.defineProperty({__proto__:null,ModalDelete:Ko,ModalMessage:Jo,ModalNewFolder:ii,ModalNewFile:mi,ModalPreview:Pa,ModalRename:qa,ModalUpload:is,ModalArchive:bs,ModalUnarchive:$s,ModalMove:Object.assign({name:"VFModalMove"},{props:{selection:Object,current:Object},setup(a){const t=a,r=inject("emitter"),{t:i}=inject("i18n"),{getStore:s}=inject("storage"),o=e.ref(t.selection.items.from),c=()=>{o.value.length&&r.emit("vf-fetch",{q:"move",adapter:s("adapter","local"),path:t.current.dirname,items:JSON.stringify(o.value.map(({path:m,type:f})=>({path:m,type:f}))),item:t.selection.items.to.path})};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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(i)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:f[0]||(f[0]=p=>e.unref(r).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(i)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Bs,[Ts,e.createElementVNode("div",As,[e.createElementVNode("h3",Os,e.toDisplayString(e.unref(i)("Move files")),1),e.createElementVNode("div",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,p=>(e.openBlock(),e.createElementBlock("p",js,[p.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Is,Ls)):(e.openBlock(),e.createElementBlock("svg",zs,Rs)),e.createElementVNode("span",Hs,e.toDisplayString(p.path),1)]))),256)),Us,e.createElementVNode("p",Ks,[Fs,e.createElementVNode("span",Ys,e.toDisplayString(a.selection.items.to.path),1)])])])])]),_:1}))}})},Symbol.toStringTag,{value:"Module"}))},Pc="",jc="",Ws={install(a){for(const t in ft)if(ft.hasOwnProperty(t)){const r=ft[t];a.component(r.name,r)}}},Xs=Object.freeze(Object.defineProperty({__proto__:null,default:`{
18
+ `,8,Ca)],8,Va)])],64))}},$a={class:"sm:flex sm:items-start"},Ba={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},Ta={class:"text-gray-700 dark:text-gray-200 text-sm"},Aa={key:0,class:"flex leading-5"},Oa=e.createElementVNode("svg",{class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),Pa=Object.assign({name:"VFModalPreview"},{props:{selection:Object},setup(a){const t=a,{apiUrl:r}=ce(),i=e.inject("emitter"),{t:s}=e.inject("i18n"),o=e.ref(!1),c=p=>o.value=p,m=p=>{var u;return((u=t.selection.item.mime_type)!=null?u:"").startsWith(p)},f=()=>{const p=r.value+"?"+fe({q:"download",adapter:t.selection.adapter,path:t.selection.item.path});i.emit("vf-download",p)};return(p,u)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u[6]||(u[6]=y=>e.unref(i).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(s)("Close")),1),e.createElementVNode("button",{type:"button",onClick:u[7]||(u[7]=y=>f()),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(s)("Download")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$a,[e.createElementVNode("div",Ba,[e.createElementVNode("div",null,[m("text")?(e.openBlock(),e.createBlock(vi,{key:0,selection:a.selection,onLoad:u[0]||(u[0]=y=>c(!0))},null,8,["selection"])):m("image")?(e.openBlock(),e.createBlock(ma,{key:1,selection:a.selection,onLoad:u[1]||(u[1]=y=>c(!0))},null,8,["selection"])):m("video")?(e.openBlock(),e.createBlock(_a,{key:2,selection:a.selection,onLoad:u[2]||(u[2]=y=>c(!0))},null,8,["selection"])):m("audio")?(e.openBlock(),e.createBlock(Ea,{key:3,selection:a.selection,onLoad:u[3]||(u[3]=y=>c(!0))},null,8,["selection"])):m("application/pdf")?(e.openBlock(),e.createBlock(Ma,{key:4,selection:a.selection,onLoad:u[4]||(u[4]=y=>c(!0))},null,8,["selection"])):(e.openBlock(),e.createBlock(ga,{key:5,selection:a.selection,onLoad:u[5]||(u[5]=y=>c(!0))},null,8,["selection"]))]),e.createElementVNode("div",Ta,[e.createElementVNode("p",null,e.toDisplayString(a.selection.item.path),1),e.createElementVNode("p",null,"mime_type: "+e.toDisplayString(a.selection.item.mime_type),1),o.value==!1?(e.openBlock(),e.createElementBlock("div",Aa,[Oa,e.createElementVNode("span",null,e.toDisplayString(e.unref(s)("Loading")),1)])):e.createCommentVNode("",!0)])])])]),_:1}))}}),ja={class:"sm:flex sm:items-start"},Ia=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})])],-1),La={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},za={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ra={class:"mt-2"},Ha={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},Ua={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"},Ka=[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)],Fa={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"},Ya=[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)],Wa={class:"ml-1.5"},Xa=["onKeyup"],qa=Object.assign({name:"VFModalRename"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(t.selection.items[0]),c=e.ref(t.selection.items[0].basename),m=()=>{c.value!=""&&r.emit("vf-fetch",{q:"rename",adapter:i("adapter","local"),path:t.current.dirname,item:o.value.path,name:c.value})};return(f,p)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,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(s)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:p[1]||(p[1]=u=>e.unref(r).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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ja,[Ia,e.createElementVNode("div",La,[e.createElementVNode("h3",za,e.toDisplayString(e.unref(s)("Rename")),1),e.createElementVNode("div",Ra,[e.createElementVNode("p",Ha,[o.value.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ua,Ka)):(e.openBlock(),e.createElementBlock("svg",Fa,Ya)),e.createElementVNode("span",Wa,e.toDisplayString(o.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=u=>c.value=u),onKeyup:e.withKeys(m,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,40,Xa),[[e.vModelText,c.value]])])])])]),_:1}))}}),Ga={class:"sm:flex sm:items-start"},Ja=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})])],-1),Za={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Qa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},es={class:"mt-2"},ts={class:"text-gray-500 mb-1"},rs=["id"],ns={key:0,class:"py-2"},os=["disabled","onClick"],is=Object.assign({name:"VFModalUpload"},{props:{current:Object},setup(a){const t=a,r=e.inject("emitter"),{apiUrl:i}=ce(),{t:s}=e.inject("i18n"),o=e.ref(null),c=e.ref(null),m=e.ref(null),f=e.ref([]),p=e.ref(!0),u=()=>{o.value.start()};return e.onMounted(()=>{o.value=new qe.default.Uploader({runtimes:"html5",browse_button:m.value,container:c.value,max_file_size:"10mb",multiple_queues:!0,file_data_name:"file",url:i.value+"?"+fe({q:"upload",adapter:t.current.adapter,path:t.current.dirname}),init:{PostInit:function(){},FilesAdded:function(y,b){p.value=!1,qe.default.each(b,function(N){f.value.push({id:N.id,name:N.name,size:qe.default.formatSize(N.size),percent:""})})},UploadProgress:function(y,b){f.value[f.value.findIndex(N=>N.id==b.id)].percent=b.percent+"%"},UploadComplete:function(){p.value=!0,r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:t.current.dirname})},Error:function(y,b){}}}),o.value.init()}),(y,b)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{disabled:p.value,onClick:e.withModifiers(u,["prevent"]),type:"button",class:e.normalizeClass([p.value?"bg-red-200 hover:bg-red-200":"bg-red-600 hover:bg-red-700","w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white 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(s)("Upload")),11,os),e.createElementVNode("button",{type:"button",onClick:b[0]||(b[0]=N=>e.unref(r).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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ga,[Ja,e.createElementVNode("div",Za,[e.createElementVNode("h3",Qa,e.toDisplayString(e.unref(s)("Upload files")),1),e.createElementVNode("div",es,[e.createElementVNode("div",ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,N=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{id:N.id},[e.createTextVNode(e.toDisplayString(N.name)+" ( "+e.toDisplayString(N.size)+") ",1),e.createElementVNode("b",null,e.toDisplayString(N.percent),1)],8,rs)]))),256)),f.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ns,e.toDisplayString(e.unref(s)("No files selected!")),1))]),e.createElementVNode("div",{class:"text-gray-500",ref_key:"container",ref:c},[e.createElementVNode("button",{ref_key:"pickFiles",ref:m,type:"button",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(s)("Select Files")),513)],512)])])])]),_:1}))}}),as={class:"sm:flex sm:items-start"},ss=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),ls={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},cs={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ds={class:"mt-2"},hs={class:"flex text-sm text-gray-800 dark:text-gray-400"},us={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"},ms=[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)],fs={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"},ps=[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)],gs={class:"ml-1.5"},ys=["onKeyup","placeholder"],bs=Object.assign({name:"VFModalArchive"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),c=e.ref(t.selection.items),m=()=>{c.value.length&&r.emit("vf-fetch",{q:"archive",adapter:i("adapter","local"),path:t.current.dirname,items:JSON.stringify(c.value.map(({path:f,type:p})=>({path:f,type:p}))),name:o.value})};return(f,p)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,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(s)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:p[1]||(p[1]=u=>e.unref(r).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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",as,[ss,e.createElementVNode("div",ls,[e.createElementVNode("h3",cs,e.toDisplayString(e.unref(s)("Archive the files")),1),e.createElementVNode("div",ds,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,u=>(e.openBlock(),e.createElementBlock("p",hs,[u.type=="dir"?(e.openBlock(),e.createElementBlock("svg",us,ms)):(e.openBlock(),e.createElementBlock("svg",fs,ps)),e.createElementVNode("span",gs,e.toDisplayString(u.basename),1)]))),256)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=u=>o.value=u),onKeyup:e.withKeys(m,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("Archive name. (.zip file will be created)"),type:"text"},null,40,ys),[[e.vModelText,o.value]])])])])]),_:1}))}}),vs={class:"sm:flex sm:items-start"},ws=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),_s={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ks={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},xs={class:"mt-2"},Ss={class:"flex text-sm text-gray-800 dark:text-gray-400"},Ds={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"},Es=[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)],Ns={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"},Vs=[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)],Cs={class:"ml-1.5"},Ms={class:"my-1 text-sm text-gray-500"},$s=Object.assign({name:"VFModalUnarchive"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n");e.ref("");const o=e.ref(t.selection.items[0]),c=e.ref([]),m=()=>{r.emit("vf-fetch",{q:"unarchive",adapter:i("adapter","local"),path:t.current.dirname,item:o.value.path})};return(f,p)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,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(s)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:p[0]||(p[0]=u=>e.unref(r).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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",vs,[ws,e.createElementVNode("div",_s,[e.createElementVNode("h3",ks,e.toDisplayString(e.unref(s)("Unarchive")),1),e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,u=>(e.openBlock(),e.createElementBlock("p",Ss,[u.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ds,Es)):(e.openBlock(),e.createElementBlock("svg",Ns,Vs)),e.createElementVNode("span",Cs,e.toDisplayString(u.basename),1)]))),256)),e.createElementVNode("p",Ms,e.toDisplayString(e.unref(s)("The archive will be unarchived at"))+" ("+e.toDisplayString(a.current.dirname)+")",1)])])])]),_:1}))}}),Bs={class:"sm:flex sm:items-start"},Ts=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",{class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1),As={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Os={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ps={class:"mt-2"},js={class:"flex text-sm text-gray-800 dark:text-gray-400"},Is={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"},Ls=[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)],zs={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"},Rs=[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)],Hs={class:"ml-1.5"},Us=e.createElementVNode("p",{class:"text-sm text-gray-500 pb-1 pt-3"},"Bu dosyalar\u0131 ta\u015F\u0131mak istedi\u011Finizden emin misiniz?",-1),Ks={class:"flex text-sm text-gray-800 dark:text-gray-400"},Fs=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),Ys={class:"ml-1.5 overflow-auto"},ft={VueFinder:Do,...Object.freeze(Object.defineProperty({__proto__:null,ModalDelete:Ko,ModalMessage:Jo,ModalNewFolder:ii,ModalNewFile:mi,ModalPreview:Pa,ModalRename:qa,ModalUpload:is,ModalArchive:bs,ModalUnarchive:$s,ModalMove:Object.assign({name:"VFModalMove"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{t:i}=e.inject("i18n"),{getStore:s}=e.inject("storage"),o=e.ref(t.selection.items.from),c=()=>{o.value.length&&r.emit("vf-fetch",{q:"move",adapter:s("adapter","local"),path:t.current.dirname,items:JSON.stringify(o.value.map(({path:m,type:f})=>({path:m,type:f}))),item:t.selection.items.to.path})};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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(i)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:f[0]||(f[0]=p=>e.unref(r).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(i)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Bs,[Ts,e.createElementVNode("div",As,[e.createElementVNode("h3",Os,e.toDisplayString(e.unref(i)("Move files")),1),e.createElementVNode("div",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,p=>(e.openBlock(),e.createElementBlock("p",js,[p.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Is,Ls)):(e.openBlock(),e.createElementBlock("svg",zs,Rs)),e.createElementVNode("span",Hs,e.toDisplayString(p.path),1)]))),256)),Us,e.createElementVNode("p",Ks,[Fs,e.createElementVNode("span",Ys,e.toDisplayString(a.selection.items.to.path),1)])])])])]),_:1}))}})},Symbol.toStringTag,{value:"Module"}))},Pc="",jc="",Ws={install(a){for(const t in ft)if(ft.hasOwnProperty(t)){const r=ft[t];a.component(r.name,r)}}},Xs=Object.freeze(Object.defineProperty({__proto__:null,default:`{
19
19
  "Language": "Language",
20
20
  "Create": "Create",
21
21
  "Close": "Close",