vuefinder 1.2.0 → 1.2.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,7 +1,7 @@
1
- (function(e,ve){typeof exports=="object"&&typeof module<"u"?module.exports=ve(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],ve):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=ve(e.Vue,e.plupload))})(this,function(e,ve){var mn;"use strict";const st=(mn=document.querySelector('meta[name="csrf-token"]'))==null?void 0:mn.getAttribute("content"),it=(r,{method:t="get",params:n={},json:s=!0,signal:l=null})=>{const i={method:t};if(i.signal=l,t=="get")r+="?"+new URLSearchParams(n);else{i.headers={},st&&(i.headers["X-CSRF-Token"]=st);let c=new FormData;for(const[u,y]of Object.entries(n))c.append(u,y);i.body=c}return fetch(r,i).then(c=>c.ok?s?c.json():c.text():c.json().then(Promise.reject.bind(Promise)))};function Sn(r){return{all:r=r||new Map,on:function(t,n){var s=r.get(t);s?s.push(n):r.set(t,[n])},off:function(t,n){var s=r.get(t);s&&(n?s.splice(s.indexOf(n)>>>0,1):r.set(t,[]))},emit:function(t,n){var s=r.get(t);s&&s.slice().map(function(l){l(n)}),(s=r.get("*"))&&s.slice().map(function(l){l(t,n)})}}}function St(r){let t=localStorage.getItem(r+"_storage");const n=e.ref(JSON.parse(t));e.watch(n,s);function s(){n.value===null||n.value===""?localStorage.removeItem(r+"_storage"):localStorage.setItem(r+"_storage",JSON.stringify(n.value))}function l(u,y){n.value=Object.assign({...n.value},{[u]:y})}function i(){n.value=null}return{getStore:(u,y=null)=>n.value===null||n.value===""?y:n.value.hasOwnProperty(u)?n.value[u]:y,setStore:l,clearStore:i}}const Qt=e.ref("");function ue(){function r(t){Qt.value=t}return{apiUrl:Qt,setApiUrl:r}}const _n={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},wn={key:0,class:"flex text-center"},kn=["aria-label"],xn=[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)],Dn=["aria-label"],En=[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)],Nn=["aria-label"],Cn=[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)],Vn=["aria-label"],Mn=[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)],Bn=["aria-label"],$n=[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)],Tn=["aria-label"],An=[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)],Ln=["aria-label"],In=[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)],On={key:1,class:"flex text-center"},jn={class:"pl-2"},Pn={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},zn={key:0,class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Rn=[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)],Hn={class:"flex text-center items-center justify-end"},Fn=["aria-label"],Un=[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)],Kn=["aria-label"],Yn={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"},Wn={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"},Xn={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"},Zn=["aria-label"],qn={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"},Gn={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"},Jn=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(r){const t=e.inject("emitter"),{getStore:n,setStore:s}=e.inject("storage"),{t:l}=e.inject("i18n"),i=e.ref(n("viewport","grid")),c=e.ref([]),u=e.ref(n("full-screen",!1)),y=e.ref("");t.on("vf-search-query",({newQuery:S})=>{y.value=S});const g=e.inject("loadingState"),m=()=>g.value,b=()=>{u.value=!u.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",S=>{c.value=S}),t.on("vf-view-toggle",S=>{s("viewport",S),i.value=S}),(S,x)=>(e.openBlock(),e.createElementBlock("div",_n,[y.value.length?(e.openBlock(),e.createElementBlock("div",On,[e.createElementVNode("div",jn,[e.createTextVNode(e.toDisplayString(e.unref(l)("Search results for"))+" ",1),e.createElementVNode("span",Pn,e.toDisplayString(y.value),1)]),m()?(e.openBlock(),e.createElementBlock("svg",zn,Rn)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",wn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(l)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:x[0]||(x[0]=k=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:c.value}))},xn,8,kn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(l)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[1]||(x[1]=k=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:c.value}))},En,8,Dn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(l)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[2]||(x[2]=k=>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"},Cn,2))],8,Nn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(l)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[3]||(x[3]=k=>!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"},Mn,2))],8,Vn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(l)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[4]||(x[4]=k=>e.unref(t).emit("vf-modal-show",{type:"upload",items:c.value}))},$n,8,Bn),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(l)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[5]||(x[5]=k=>!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"},An,2))],8,Tn)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(l)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[6]||(x[6]=k=>!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"},In,2))],8,Ln))])),e.createElementVNode("div",Hn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(l)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:x[7]||(x[7]=k=>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"},Un))],8,Fn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(l)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:b},[(e.openBlock(),e.createElementBlock("svg",Yn,[u.value?(e.openBlock(),e.createElementBlock("path",Wn)):(e.openBlock(),e.createElementBlock("path",Xn))]))],8,Kn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(l)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:x[8]||(x[8]=k=>y.value.length||e.unref(t).emit("vf-view-toggle",i.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([y.value.length?"stroke-gray-200 dark:stroke-gray-700":"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[i.value=="grid"?(e.openBlock(),e.createElementBlock("path",qn)):e.createCommentVNode("",!0),i.value=="list"?(e.openBlock(),e.createElementBlock("path",Gn)):e.createCommentVNode("",!0)],2))],8,Zn)])]))}});var Qn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},er={exports:{}};(function(r,t){(function(n,s){r.exports=s()})(Qn,function(){function n(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")}function s(h,d){for(var o=0;o<d.length;o++){var p=d[o];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}function l(h,d,o){return d&&s(h.prototype,d),o&&s(h,o),h}function i(h,d,o){return d in h?Object.defineProperty(h,d,{value:o,enumerable:!0,configurable:!0,writable:!0}):h[d]=o,h}function c(h,d){var o=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);d&&(p=p.filter(function(a){return Object.getOwnPropertyDescriptor(h,a).enumerable})),o.push.apply(o,p)}return o}function u(h){for(var d=1;d<arguments.length;d++){var o=arguments[d]!=null?arguments[d]:{};d%2?c(Object(o),!0).forEach(function(p){i(h,p,o[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(o)):c(Object(o)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(o,p))})}return h}function y(h,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(d&&d.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),d&&m(h,d)}function g(h){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},g(h)}function m(h,d){return m=Object.setPrototypeOf||function(p,a){return p.__proto__=a,p},m(h,d)}function b(){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 S(h,d,o){return b()?S=Reflect.construct:S=function(a,f,v){var _=[null];_.push.apply(_,f);var w=Function.bind.apply(a,_),L=new w;return v&&m(L,v.prototype),L},S.apply(null,arguments)}function x(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function k(h){var d=typeof Map=="function"?new Map:void 0;return k=function(p){if(p===null||!x(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(typeof d<"u"){if(d.has(p))return d.get(p);d.set(p,a)}function a(){return S(p,arguments,g(this).constructor)}return a.prototype=Object.create(p.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),m(a,p)},k(h)}function N(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function C(h,d){return d&&(typeof d=="object"||typeof d=="function")?d:N(h)}function A(h){var d=b();return function(){var p=g(h),a;if(d){var f=g(this).constructor;a=Reflect.construct(p,arguments,f)}else a=p.apply(this,arguments);return C(this,a)}}function T(h,d){for(;!Object.prototype.hasOwnProperty.call(h,d)&&(h=g(h),h!==null););return h}function V(h,d,o){return typeof Reflect<"u"&&Reflect.get?V=Reflect.get:V=function(a,f,v){var _=T(a,f);if(_){var w=Object.getOwnPropertyDescriptor(_,f);return w.get?w.get.call(v):w.value}},V(h,d,o||h)}function j(h,d){return B(h)||W(h,d)||Y(h,d)||ne()}function I(h){return D(h)||H(h)||Y(h)||ie()}function D(h){if(Array.isArray(h))return te(h)}function B(h){if(Array.isArray(h))return h}function H(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}function W(h,d){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(h)))){var o=[],p=!0,a=!1,f=void 0;try{for(var v=h[Symbol.iterator](),_;!(p=(_=v.next()).done)&&(o.push(_.value),!(d&&o.length===d));p=!0);}catch(w){a=!0,f=w}finally{try{!p&&v.return!=null&&v.return()}finally{if(a)throw f}}return o}}function Y(h,d){if(h){if(typeof h=="string")return te(h,d);var o=Object.prototype.toString.call(h).slice(8,-1);if(o==="Object"&&h.constructor&&(o=h.constructor.name),o==="Map"||o==="Set")return Array.from(h);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return te(h,d)}}function te(h,d){(d==null||d>h.length)&&(d=h.length);for(var o=0,p=new Array(d);o<d;o++)p[o]=h[o];return p}function ie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ (function(e,ve){typeof exports=="object"&&typeof module<"u"?module.exports=ve(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],ve):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=ve(e.Vue,e.plupload))})(this,function(e,ve){var bn;"use strict";const nt=(bn=document.querySelector('meta[name="csrf-token"]'))==null?void 0:bn.getAttribute("content"),ot=(n,{method:t="get",params:o={},json:i=!0,signal:l=null})=>{const a={method:t};if(a.signal=l,t=="get")n+="?"+new URLSearchParams(o);else{a.headers={},nt&&(a.headers["X-CSRF-Token"]=nt);let u=new FormData;for(const[p,c]of Object.entries(o))u.append(p,c);a.body=u}return fetch(n,a).then(u=>u.ok?i?u.json():u.text():u.json().then(Promise.reject.bind(Promise)))};function Cn(n){return{all:n=n||new Map,on:function(t,o){var i=n.get(t);i?i.push(o):n.set(t,[o])},off:function(t,o){var i=n.get(t);i&&(o?i.splice(i.indexOf(o)>>>0,1):n.set(t,[]))},emit:function(t,o){var i=n.get(t);i&&i.slice().map(function(l){l(o)}),(i=n.get("*"))&&i.slice().map(function(l){l(t,o)})}}}function wt(n){let t=localStorage.getItem(n+"_storage");const o=e.ref(JSON.parse(t));e.watch(o,i);function i(){o.value===null||o.value===""?localStorage.removeItem(n+"_storage"):localStorage.setItem(n+"_storage",JSON.stringify(o.value))}function l(p,c){o.value=Object.assign({...o.value},{[p]:c})}function a(){o.value=null}return{getStore:(p,c=null)=>o.value===null||o.value===""?c:o.value.hasOwnProperty(p)?o.value[p]:c,setStore:l,clearStore:a}}const nr=e.ref("");function ue(){function n(t){nr.value=t}return{apiUrl:nr,setApiUrl:n}}const Vn={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Mn={key:0,class:"flex text-center"},Tn=["aria-label"],Bn=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})],-1)],$n=["aria-label"],An=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})],-1)],In=["aria-label"],Ln=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1)],On=["aria-label"],jn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1)],Pn=["aria-label"],zn=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})],-1)],Rn=["aria-label"],Hn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1)],Fn=["aria-label"],Un=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1)],Yn={key:1,class:"flex text-center"},Kn={class:"pl-2"},Wn={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Xn={key:0,class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Zn=[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)],qn={class:"flex text-center items-center justify-end"},Gn=["aria-label"],Jn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"},null,-1)],Qn=["aria-label"],eo={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},to={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"},ro={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},no=["aria-label"],oo={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"},io={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"},so=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),o=e.inject("usePropDarkMode"),{getStore:i,setStore:l}=e.inject("storage"),{t:a}=e.inject("i18n"),u=e.ref(i("viewport","grid")),p=e.ref([]),c=e.ref(i("full-screen",!1)),y=e.ref("");t.on("vf-search-query",({newQuery:E})=>{y.value=E});const m=e.inject("loadingState"),b=()=>m.value,S=()=>{c.value=!c.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",E=>{p.value=E}),t.on("vf-view-toggle",E=>{l("viewport",E),u.value=E}),(E,_)=>(e.openBlock(),e.createElementBlock("div",Vn,[y.value.length?(e.openBlock(),e.createElementBlock("div",Yn,[e.createElementVNode("div",Kn,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Wn,e.toDisplayString(y.value),1)]),b()?(e.openBlock(),e.createElementBlock("svg",Xn,Zn)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Mn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:_[0]||(_[0]=N=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:p.value}))},Bn,8,Tn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[1]||(_[1]=N=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:p.value}))},An,8,$n),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[2]||(_[2]=N=>p.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.value.length==1?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ln,2))],8,In),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[3]||(_[3]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},jn,2))],8,On),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[4]||(_[4]=N=>e.unref(t).emit("vf-modal-show",{type:"upload",items:p.value}))},zn,8,Pn),p.value.length==1&&p.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[5]||(_[5]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Hn,2))],8,Rn)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[6]||(_[6]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Un,2))],8,Fn))])),e.createElementVNode("div",qn,[e.withDirectives(e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:_[7]||(_[7]=N=>e.unref(t).emit("vf-darkMode-toggle")),viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-6 w-6 m-auto cursor-pointer stroke-sky-500 fill-sky-100 hover:stroke-sky-600 dark:stroke-gray-400 dark:fill-gray-400/20 dark:hover:stroke-gray-300"},Jn))],8,Gn),[[e.vShow,!e.unref(o)]]),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:S},[(e.openBlock(),e.createElementBlock("svg",eo,[c.value?(e.openBlock(),e.createElementBlock("path",to)):(e.openBlock(),e.createElementBlock("path",ro))]))],8,Qn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:_[8]||(_[8]=N=>y.value.length||e.unref(t).emit("vf-view-toggle",u.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([y.value.length?"stroke-gray-200 dark:stroke-gray-700":"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[u.value=="grid"?(e.openBlock(),e.createElementBlock("path",oo)):e.createCommentVNode("",!0),u.value=="list"?(e.openBlock(),e.createElementBlock("path",io)):e.createCommentVNode("",!0)],2))],8,no)])]))}});var ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var or={exports:{}};(function(n,t){(function(o,i){n.exports=i()})(ao,function(){function o(d,h){var r=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(r!=null){var g,s,f,v,w=[],x=!0,A=!1;try{if(f=(r=r.call(d)).next,h===0){if(Object(r)!==r)return;x=!1}else for(;!(x=(g=f.call(r)).done)&&(w.push(g.value),w.length!==h);x=!0);}catch(z){A=!0,s=z}finally{try{if(!x&&r.return!=null&&(v=r.return(),Object(v)!==v))return}finally{if(A)throw s}}return w}}function i(d,h){var r=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);h&&(g=g.filter(function(s){return Object.getOwnPropertyDescriptor(d,s).enumerable})),r.push.apply(r,g)}return r}function l(d){for(var h=1;h<arguments.length;h++){var r=arguments[h]!=null?arguments[h]:{};h%2?i(Object(r),!0).forEach(function(g){c(d,g,r[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(g){Object.defineProperty(d,g,Object.getOwnPropertyDescriptor(r,g))})}return d}function a(d,h){if(!(d instanceof h))throw new TypeError("Cannot call a class as a function")}function u(d,h){for(var r=0;r<h.length;r++){var g=h[r];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(d,B(g.key),g)}}function p(d,h,r){return h&&u(d.prototype,h),r&&u(d,r),Object.defineProperty(d,"prototype",{writable:!1}),d}function c(d,h,r){return h=B(h),h in d?Object.defineProperty(d,h,{value:r,enumerable:!0,configurable:!0,writable:!0}):d[h]=r,d}function y(d,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(h&&h.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),h&&b(d,h)}function m(d){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},m(d)}function b(d,h){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,s){return g.__proto__=s,g},b(d,h)}function S(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function E(d,h,r){return S()?E=Reflect.construct.bind():E=function(s,f,v){var w=[null];w.push.apply(w,f);var x=Function.bind.apply(s,w),A=new x;return v&&b(A,v.prototype),A},E.apply(null,arguments)}function _(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function N(d){var h=typeof Map=="function"?new Map:void 0;return N=function(g){if(g===null||!_(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h<"u"){if(h.has(g))return h.get(g);h.set(g,s)}function s(){return E(g,arguments,m(this).constructor)}return s.prototype=Object.create(g.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),b(s,g)},N(d)}function D(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function L(d,h){if(h&&(typeof h=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(d)}function $(d){var h=S();return function(){var g=m(d),s;if(h){var f=m(this).constructor;s=Reflect.construct(g,arguments,f)}else s=g.apply(this,arguments);return L(this,s)}}function T(d,h){for(;!Object.prototype.hasOwnProperty.call(d,h)&&(d=m(d),d!==null););return d}function I(){return typeof Reflect<"u"&&Reflect.get?I=Reflect.get.bind():I=function(h,r,g){var s=T(h,r);if(s){var f=Object.getOwnPropertyDescriptor(s,r);return f.get?f.get.call(arguments.length<3?h:g):f.value}},I.apply(this,arguments)}function R(d,h){return H(d)||o(d,h)||W(d,h)||ne()}function k(d){return M(d)||X(d)||W(d)||se()}function M(d){if(Array.isArray(d))return te(d)}function H(d){if(Array.isArray(d))return d}function X(d){if(typeof Symbol<"u"&&d[Symbol.iterator]!=null||d["@@iterator"]!=null)return Array.from(d)}function W(d,h){if(d){if(typeof d=="string")return te(d,h);var r=Object.prototype.toString.call(d).slice(8,-1);if(r==="Object"&&d.constructor&&(r=d.constructor.name),r==="Map"||r==="Set")return Array.from(d);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(d,h)}}function te(d,h){(h==null||h>d.length)&&(h=d.length);for(var r=0,g=new Array(h);r<h;r++)g[r]=d[r];return g}function se(){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 ne(){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.`)}function re(h,d){var o;if(typeof Symbol>"u"||h[Symbol.iterator]==null){if(Array.isArray(h)||(o=Y(h))||d&&h&&typeof h.length=="number"){o&&(h=o);var p=0,a=function(){};return{s:a,n:function(){return p>=h.length?{done:!0}:{done:!1,value:h[p++]}},e:function(w){throw w},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,v=!1,_;return{s:function(){o=h[Symbol.iterator]()},n:function(){var w=o.next();return f=w.done,w},e:function(w){v=!0,_=w},f:function(){try{!f&&o.return!=null&&o.return()}finally{if(v)throw _}}}}var E=function(d,o,p){var a=d.x,f=d.y,v=p.x,_=p.y,w={"+":{x:a+v,y:f+_},"-":{x:a-v,y:f-_},"*":{x:a*v,y:f*_},"/":{x:a/v,y:f/_}};return w[o]},$=function(d){return{x:d.left,y:d.top}},M=function(d){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:d.x,top:d.y,right:d.x,bottom:d.y,width:o,height:o}},G=function(d){return{x:d,y:d}},O=function(h,d){var o=d;window.addEventListener("resize",o),window.addEventListener("scroll",o);var p=new MutationObserver(o);h.forEach(function(f,v){p.observe(f,{childList:v!==0,attributes:!0})});var a=function(){return Ed(p,o)};return{observer:p,callback:o,cleanup:a}},de=function(h){var d=vt(h);return d.x||d.y?!0:h instanceof Document?h.body?!!(h.body.scrollTop=1):!!(h.documentElement.scrollTop=1):!!(h.scrollTop=1)},he=function(){var h=document.createElement("div");return h.style.position="fixed",h.style.overflow="hidden",h.style.pointerEvents="none",h.style.zIndex="999999999999999999",h},yt=function(h){var d=document.createElement("div");return d.style.position="absolute",h||(d.style.background="rgba(0, 175, 255, 0.2)",d.style.border="1px solid rgba(0, 175, 255, 0.8)",d.style.display="none",d.style.pointerEvents="none"),d},Qe=function(h,d){var o;return function(){for(var p=arguments.length,a=new Array(p),f=0;f<p;f++)a[f]=arguments[f];var v=function(){o=null,h.apply(void 0,a)};clearTimeout(o),o=setTimeout(v,d)}},et=function(){var h,d,o,p;return{y:((h=document.body)===null||h===void 0?void 0:h.scrollTop)||((d=document.documentElement)===null||d===void 0?void 0:d.scrollTop)||0,x:((o=document.body)===null||o===void 0?void 0:o.scrollLeft)||((p=document.documentElement)===null||p===void 0?void 0:p.scrollLeft)||0}},bt=function(h){var d=function o(p){var a,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,v=(a=p[f])===null||a===void 0?void 0:a.parentNode;return v?(p.push(v),f++,o(p,f)):p};return d([h])},pd=function(h,d){if(h instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var o=h.getBoundingClientRect();return{top:o.top,left:o.left,bottom:o.bottom,right:o.right,width:(h.clientWidth||o.width)*d,height:(h.clientHeight||o.height)*d}},vt=function(h){return!h||h instanceof Document?et():{x:h.scrollLeft>=0?h.scrollLeft:et().x,y:h.scrollTop>=0?h.scrollTop:et().y}},pn=function(h){var d=h.elementRect,o=h.containerRect,p=h.tolerance,a=p===void 0?{x:0,y:0}:p,f=[];return d.top-a.y<o.top&&f.push("top"),d.left-a.x<o.left&&f.push("left"),d.bottom+a.y>o.bottom&&f.push("bottom"),d.right+a.y>o.right&&f.push("right"),f},gd=function(h){var d=h.event;return{x:d.clientX,y:d.clientY}},yd=function(h){var d=h.scrollAmount,o=h.initialPointerPos,p=h.pointerPos,a={};return p.x>o.x-d.x?(a.left=o.x-d.x,a.width=p.x-o.x+d.x):(a.left=p.x,a.width=o.x-p.x-d.x),p.y>o.y-d.y?(a.top=o.y-d.y,a.height=p.y-o.y+d.y):(a.top=p.y,a.height=o.y-p.y-d.y),a},gn=function(d){var o={x:0,y:0},p=window.getComputedStyle(d);if(!p.transform||p.transform==="none")return o;if(p.transform.indexOf("3d")>=0){var a=p.transform.trim().match(/matrix3d\((.*?)\)/);if(a&&a.length){var f,v=(f=a[1])===null||f===void 0?void 0:f.split(",");o.x=parseInt(v[12])||0,o.y=parseInt(v[13])||0}return o}var _=p.transform.trim().match(/matrix\((.*?)\)/);if(_&&_.length){var w,L=(w=_[1])===null||w===void 0?void 0:w.split(",");o.x=parseInt(L[4])||0,o.y=parseInt(L[5])||0}return o},bd=function(d){var o=d.style.transform;if(!o||o.indexOf("translate")<0)return gn(d);var p={x:0,y:0},a=o.trim().match(/translate[3dD]*?\(.*?\)/);if(a){var f,v=(f=a[0])===null||f===void 0?void 0:f.split("(");if(v){var _,w=(_=v[1])===null||_===void 0?void 0:_.split(",");p.x=parseInt(w[0])||0,p.y=parseInt(w[1])||0}}return!p.x&&!p.x?gn(d):p},vd=function(d){var o=d.style,p={x:parseInt(o.left)||0,y:parseInt(o.top)||0};if(!p.x&&!p.x){var a=window.getComputedStyle(d);return{x:parseInt(a.left)||0,y:parseInt(a.top)||0}}return p},Sd=function(h,d){return d?bd(h):vd(h)},_d=function(h){var d=h.element,o=h.edges,p=h.elementRect,a=h.containerRect,f=h.elementPos,v=h.useTransform;o.includes("top")&&nt(d,{y:f.y+a.top-p.top,x:f.x},v),o.includes("left")&&nt(d,{y:f.y,x:f.x+a.left-p.left},v),o.includes("bottom")&&nt(d,{y:f.y+a.bottom-p.bottom,x:f.x},v),o.includes("right")&&nt(d,{y:f.y,x:f.x+a.right-p.right},v)},yn=function(h){var d=h.computedStyle,o=h.node,p=d.position,a=p==="absolute"||p==="relative"||p==="fixed";!(o instanceof Document)&&!a&&(o.style.position="relative")},wd=function(h){var d=h.shiftKey,o=h.keyboardDragSpeed,p=h.zoom,a=h.key,f=h.dragKeys,v=h.scrollDiff,_=h.canScroll,w=h.scrollCallback,L={x:0,y:0},R=d?o*4*p:o*p;return f.left.includes(a)&&(L.x=v.x||-R,!d&&!v.x&&_&&w(["left"],o)),f.right.includes(a)&&(L.x=v.x||R,!d&&!v.x&&_&&w(["right"],o)),f.up.includes(a)&&(L.y=v.y||-R,!d&&!v.y&&_&&w(["top"],o)),f.down.includes(a)&&(L.y=v.y||R,!d&&!v.y&&_&&w(["bottom"],o)),L},kd=function(h){var d=h.element,o=h.force,p=h.multiSelectionToggle,a=h.SelectedSet,f=h.hoverClassName;d.classList.contains(f)&&!o||(a.has(d)?p&&a.delete(d):a.add(d),d.classList.add(f))},xd=function(h){var d=h.element,o=h.force,p=h.SelectedSet,a=h.PrevSelectedSet,f=h.hoverClassName;if(!d.classList.contains(f)&&!o)return!1;var v=p.has(d),_=a.has(d);v&&!_?p.delete(d):!v&&_&&p.add(d),d.classList.remove(f)},tt=function(d,o,p){return console.warn('[DragSelect] TypeIssue: setting "'.concat(d,'" is not of type "').concat(o,'".'))},z=function(d,o,p,a){if(o===void 0)return p?i({},d,a):{};if(o===null)return i({},d,null);var f=!0,v=!1,_=typeof a=="string";_&&(f=typeof o=="string"||o instanceof String),_&&!f&&(v=!0,tt(d,"string"));var w=!Number.isNaN(a)&&typeof a=="number";w&&(f=!Number.isNaN(o)&&typeof o=="number"),w&&!f&&(v=!0,tt(d,"number"));var L=Object.prototype.toString.call(a)==="[object Object]";L&&(f=Object.prototype.toString.call(o)==="[object Object]"),L&&!f&&(v=!0,tt(d,"object"));var R=typeof a=="boolean";R&&(f=typeof o=="boolean"),R&&!f&&(v=!0,tt(d,"boolean"));var X=Array.isArray(a);X&&(f=Array.isArray(o)),X&&!f&&(v=!0,tt(d,"array"));var ae=v||p;return d==="dragKeys"&&f?i({},d,Object.assign(a,o)):d==="dragKeys"&&!f?ae?i({},d,a):{}:(d==="dropZones"&&f&&new Set(o.map(function(oe){return oe.id})).size!==o.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),f?i({},d,o):ae?i({},d,a):{})},Dd=function(h,d){return u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},z("area",h.area,d,document)),z("selectables",h.selectables,d,null)),z("autoScrollSpeed",h.autoScrollSpeed,d,5)),z("overflowTolerance",h.overflowTolerance,d,{x:25,y:25})),z("zoom",h.zoom,d,1)),z("customStyles",h.customStyles,d,!1)),z("multiSelectMode",h.multiSelectMode,d,!1)),z("multiSelectToggling",h.multiSelectToggling,d,!0)),z("multiSelectKeys",h.multiSelectKeys,d,["Control","Shift","Meta"])),z("selector",h.selector,d,null)),z("selectionThreshold",h.selectionThreshold,d,0)),z("draggability",h.draggability,d,!0)),z("immediateDrag",h.immediateDrag,d,!0)),z("keyboardDrag",h.keyboardDrag,d,!0)),z("dragKeys",h.dragKeys,d,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),z("keyboardDragSpeed",h.keyboardDragSpeed,d,10)),z("useTransform",h.useTransform,d,!0)),z("refreshMemoryRate",h.refreshMemoryRate,d,80)),z("dropZones",h.dropZones,d,[])),z("dropInsideThreshold",h.dropInsideThreshold,d,1)),z("dropTargetThreshold",h.dropTargetThreshold,d,0)),z("usePointerEvents",h.usePointerEvents,d,!1)),z("hoverClass",h.hoverClass,d,"ds-hover")),z("selectableClass",h.selectableClass,d,"ds-selectable")),z("selectedClass",h.selectedClass,d,"ds-selected")),z("selectorClass",h.selectorClass,d,"ds-selector")),z("selectorAreaClass",h.selectorAreaClass,d,"ds-selector-area")),z("droppedTargetClass",h.droppedTargetClass,d,"ds-dropped-target")),z("droppedInsideClass",h.droppedInsideClass,d,"ds-dropped-inside")),z("droppableClass",h.droppableClass,d,"ds-droppable")),z("dropZoneClass",h.dropZoneClass,d,"ds-dropzone")),z("dropZoneReadyClass",h.dropZoneReadyClass,d,"ds-dropzone-ready")),z("dropZoneTargetClass",h.dropZoneTargetClass,d,"ds-dropzone-target")),z("dropZoneInsideClass",h.dropZoneInsideClass,d,"ds-dropzone-inside"))},rt=function(h,d){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,p=h;if(o>0){var a=(h.right-h.left)*o,f=(h.bottom-h.top)*o;p={left:h.left+a,right:h.right-a,top:h.top+f,bottom:h.bottom-f}}return p.left<d.right&&p.right>d.left&&p.top<d.bottom&&p.bottom>d.top},bn=function(h){var d=h.element,o=h.posDirection,p=h.containerRect,a=h.useTransform,f=Sd(d,a),v=E(f,"+",o);nt(d,v,a);var _=d.getBoundingClientRect(),w=pn({elementRect:_,containerRect:p});_d({element:d,edges:w,elementRect:_,containerRect:p,elementPos:v,useTransform:a})},Ed=function(h,d){window.removeEventListener("resize",d),window.removeEventListener("scroll",d),h.disconnect()},Nd=function(h,d,o){if(d.length){var p=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,a=h instanceof Document?p||document.body:h,f=d.includes("top")&&a.scrollTop>0,v=d.includes("bottom")&&a.scrollTop<a.scrollHeight,_=d.includes("left")&&a.scrollLeft>0,w=d.includes("right")&&a.scrollLeft<a.scrollWidth;f&&(a.scrollTop-=1*o),v&&(a.scrollTop+=1*o),_&&(a.scrollLeft-=1*o),w&&(a.scrollLeft+=1*o)}},nt=function(h,d,o){if(o){var p=h.style.transform;h.style.transform="translate3d(".concat(d.x,"px,").concat(d.y,"px,1px) ").concat(p.replace(/translate.*?\)/g,""))}else h.style.left="".concat(d.x,"px"),h.style.top="".concat(d.y,"px");return h},Cd=function(h){for(var d=h.subscribe,o=h.publish,p=h.Interaction,a=h.SelectedSet,f=h.DropZones,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(X){return X.event}}],"Interaction:end":[{name:"callback",extraData:function(){var X=f.getTarget();return u({},X?{dropTarget:X.toObject()}:{})}}]},_=function(){var X=j(L[w],2),ae=X[0],oe=X[1];["pre",!1].forEach(function(be){return d(be?"".concat(ae,":").concat(be):ae,function(Z){return oe.forEach(function(le){return(!le.condition||le.condition(Z))&&o(be?"".concat(be).concat(le.name):le.name,u(u({items:a.elements,isDragging:p.isDragging},Z),le.extraData?le.extraData(Z):{}))})})})},w=0,L=Object.entries(v);w<L.length;w++)_()},Te=function(h){return h?!Array.isArray(h)&&(h instanceof HTMLElement||h instanceof SVGElement)?[h]:I(new Set(I(h))):[]},vn=function(h,d){h.style.left="".concat(d.left,"px"),h.style.top="".concat(d.top,"px"),h.style.width="".concat(d.width,"px"),h.style.height="".concat(d.height,"px")},Vd=function(){function h(d){var o=this,p=d.DS;n(this,h),i(this,"DS",void 0),i(this,"_observers",void 0),i(this,"_node",void 0),i(this,"_parentNodes",void 0),i(this,"_computedStyle",void 0),i(this,"_computedBorder",void 0),i(this,"_rect",void 0),i(this,"setArea",function(a){o.reset(),o._node=a,yn({computedStyle:o.computedStyle,node:o._node}),setTimeout(function(){o.DS.PubSub.publish("Area:modified:pre",{item:o}),o.reset(),o.DS.PubSub.publish("Area:modified",{item:o})})}),i(this,"start",function(){o._observers=O(o.parentNodes,Qe(function(a){o.DS.PubSub.publish("Area:modified:pre",{event:a,item:o}),o.reset(),o.DS.PubSub.publish("Area:modified",{event:a,item:o})},60))}),i(this,"reset",function(){o._computedStyle=void 0,o._rect=void 0,o._computedBorder=void 0,o._parentNodes=void 0}),i(this,"stop",function(){o._observers.cleanup(),o.reset()}),i(this,"scroll",function(a,f){var v={scroll_directions:a,scroll_multiplier:f};o.DS.PubSub.publish("Area:scroll:pre",v),Nd(o._node,a,f),o.DS.PubSub.publish("Area:scroll",v)}),this.DS=p,this.setArea(this.DS.stores.SettingsStore.s.area),this.DS.PubSub.subscribe("Settings:updated:area",function(a){var f=a.settings;o.setArea(f.area)}),this.DS.PubSub.subscribe("Interaction:init",this.start),this.DS.PubSub.subscribe("Interaction:end",this.reset)}return l(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 Document?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=pd(this.HTMLNode,this.DS.stores.SettingsStore.s.zoom)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=bt(this.HTMLNode)}}]),h}(),Md=function(){function h(d){var o=this,p=d.DS;n(this,h),i(this,"_prevCursorPos",void 0),i(this,"_prevScrollPos",void 0),i(this,"_elements",[]),i(this,"_dragKeys",void 0),i(this,"_dragKeysFlat",[]),i(this,"assignDragkeys",function(){o._dragKeys={up:o.DS.stores.SettingsStore.s.dragKeys.up.map(function(a){return a.toLowerCase()}),down:o.DS.stores.SettingsStore.s.dragKeys.down.map(function(a){return a.toLowerCase()}),left:o.DS.stores.SettingsStore.s.dragKeys.left.map(function(a){return a.toLowerCase()}),right:o.DS.stores.SettingsStore.s.dragKeys.right.map(function(a){return a.toLowerCase()})},o._dragKeysFlat=[].concat(I(o._dragKeys.up),I(o._dragKeys.down),I(o._dragKeys.left),I(o._dragKeys.right))}),i(this,"keyboardDrag",function(a){var f=a.event,v=a.key,_=v.toLowerCase();if(!(!o.DS.stores.SettingsStore.s.keyboardDrag||!o._dragKeysFlat.includes(_)||!o.DS.SelectedSet.size||!o.DS.stores.SettingsStore.s.draggability||o.DS.continue)){var w={event:f,isDragging:!0,isDraggingKeyboard:!0};o.DS.publish(["Interaction:start:pre","Interaction:start"],w),o._elements=o.DS.getSelection(),o.handleZIndex(!0);var L=wd({shiftKey:o.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:o.DS.stores.SettingsStore.s.keyboardDragSpeed,zoom:o.DS.stores.SettingsStore.s.zoom,key:_,scrollCallback:o.DS.Area.scroll,scrollDiff:o._scrollDiff,canScroll:o.DS.stores.ScrollStore.canScroll,dragKeys:o._dragKeys});o._elements.forEach(function(R){return bn({element:R,posDirection:L,containerRect:o.DS.SelectorArea.rect,useTransform:o.DS.stores.SettingsStore.s.useTransform})}),o.DS.publish(["Interaction:update:pre","Interaction:update"],w)}}),i(this,"keyboardEnd",function(a){var f=a.event,v=a.key,_=v.toLowerCase();if(!(!o.DS.stores.SettingsStore.s.keyboardDrag||!o._dragKeysFlat.includes(_)||!o.DS.SelectedSet.size||!o.DS.stores.SettingsStore.s.draggability)){var w={event:f,isDragging:o.DS.stores.SettingsStore.s.draggability,isDraggingKeyboard:!0};o.DS.publish(["Interaction:end:pre","Interaction:end"],w)}}),i(this,"start",function(a){var f=a.isDragging,v=a.isDraggingKeyboard;!f||v||(o._prevCursorPos=null,o._prevScrollPos=null,o._elements=o.DS.getSelection(),o.handleZIndex(!0))}),i(this,"stop",function(a){a!=null&&a.isKeyboard||(o._prevCursorPos=null,o._prevScrollPos=null,o.handleZIndex(!1),o._elements=[])}),i(this,"update",function(a){var f=a.isDragging,v=a.isDraggingKeyboard;if(!(!f||!o._elements.length||v||o.DS.continue)){var _=E(o._cursorDiff,"+",o._scrollDiff);o._elements.forEach(function(w){return bn({element:w,posDirection:_,containerRect:o.DS.SelectorArea.rect,useTransform:o.DS.stores.SettingsStore.s.useTransform})})}}),i(this,"handleZIndex",function(a){o._elements.forEach(function(f){return f.style.zIndex="".concat((parseInt(f.style.zIndex)||0)+a?9999:-9998)})}),this.DS=p,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return l(h,[{key:"_cursorDiff",get:function(){var o=this.DS.stores.PointerStore.currentVal,p=this._prevCursorPos?E(o,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=o,p}},{key:"_scrollDiff",get:function(){var o=this.DS.stores.ScrollStore.currentVal,p=this._prevScrollPos?E(o,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=o,p}}]),h}(),Bd=function(){function h(d){var o=this,p=d.DS,a=d.id,f=d.element,v=d.droppables;n(this,h),i(this,"id",void 0),i(this,"element",void 0),i(this,"_droppables",void 0),i(this,"_rect",void 0),i(this,"_observers",void 0),i(this,"_timeout",void 0),i(this,"_itemsDropped",[]),i(this,"_itemsInside",void 0),i(this,"setReadyClasses",function(_){if(!o.isDestroyed){var w=o.droppables.filter(function(L){return o.DS.SelectedSet.has(L)});w.length&&(w.forEach(function(L){L.classList[_]("".concat(o.Settings.droppableClass)),L.classList[_]("".concat(o.Settings.droppableClass,"-").concat(o.id))}),o.element.classList[_]("".concat(o.Settings.dropZoneReadyClass)))}}),i(this,"handleNoDrop",function(){var _;o.isDestroyed||(o.DS.SelectedSet.forEach(function(w){w.classList.remove(o.Settings.droppedTargetClass),w.classList.remove("".concat(o.Settings.droppedTargetClass,"-").concat(o.id))}),o._itemsDropped=o._itemsDropped.filter(function(w){return!o.DS.SelectedSet.has(w)}),(_=o._itemsDropped)!==null&&_!==void 0&&_.length||o.element.classList.remove("".concat(o.Settings.dropZoneTargetClass)))}),i(this,"handleDrop",function(){var _,w,L;o.isDestroyed||(o._itemsDropped=I(new Set([].concat(I(o._itemsDropped),I((_=o.droppables)===null||_===void 0?void 0:_.filter(function(R){return o.DS.SelectedSet.has(R)}))))),(w=o._itemsDropped)===null||w===void 0||w.forEach(function(R){R.classList.add("".concat(o.Settings.droppedTargetClass)),R.classList.add("".concat(o.Settings.droppedTargetClass,"-").concat(o.id))}),(L=o._itemsDropped)!==null&&L!==void 0&&L.length&&o.element.classList.add("".concat(o.Settings.dropZoneTargetClass)))}),i(this,"handleItemsInsideClasses",function(){var _=!1;o.droppables.forEach(function(w){o.itemsInside.includes(w)?(w.classList.add("".concat(o.Settings.droppedInsideClass)),w.classList.add("".concat(o.Settings.droppedInsideClass,"-").concat(o.id)),_=!0):(w.classList.remove("".concat(o.Settings.droppedInsideClass,"-").concat(o.id)),w.className.includes("".concat(o.Settings.droppedInsideClass,"-"))||w.classList.remove("".concat(o.Settings.droppedInsideClass)))}),_?o.element.classList.add("".concat(o.Settings.dropZoneInsideClass)):o.element.classList.remove("".concat(o.Settings.dropZoneInsideClass))}),i(this,"start",function(_){var w=_.isDragging;!w||o.isDestroyed||o.setReadyClasses("add")}),i(this,"stop",function(_){var w=_.isDragging;!w||o.isDestroyed||(o.setReadyClasses("remove"),o.handleItemsInsideClasses())}),i(this,"toObject",function(){return{id:o.id,element:o.element,droppables:o.droppables,itemsDropped:o.itemsDropped,itemsInside:o.itemsInside}}),this.DS=p,this.Settings=p.stores.SettingsStore.s,this.id=a,this.element=f,v&&(this.droppables=Te(v)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",function(_){var w=_.settings;o.element.classList.remove(w["dropZoneClass:pre"]),o.element.classList.add(w.dropZoneClass)}),this._observers=O(this.parentNodes,Qe(function(){return o._rect=null},this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return l(h,[{key:"destroy",value:function(){var o=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach(function(p){p.classList.remove("".concat(o.Settings.droppedTargetClass)),p.classList.remove("".concat(o.Settings.droppedTargetClass,"-").concat(o.id)),p.classList.remove("".concat(o.Settings.droppableClass)),p.classList.remove("".concat(o.Settings.droppableClass,"-").concat(o.id))}),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var o=this;return this.isDestroyed?null:this._itemsInside?this._itemsInside:(this._itemsInside=this.droppables.flatMap(function(p){return rt(o.DS.SelectableSet.rects.get(p),o.rect,o.Settings.dropInsideThreshold)?[p]:[]}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return o._itemsInside=null},this.Settings.refreshMemoryRate),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=bt(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(o){this._droppables=o}}]),h}(),$d=function h(d){var o=this,p=d.DS;n(this,h),i(this,"_zoneByElement",new Map),i(this,"_zoneById",new Map),i(this,"_zonesByDroppable",new Map),i(this,"_zones",void 0),i(this,"setDropZones",function(a){var f=a.dropZones;f&&(o._zones&&o._zones.forEach(function(v){return v.destroy()}),o._zones=f.map(function(v){return new Bd(u({DS:o.DS},v))}),o._zones.forEach(function(v){o._zoneByElement.set(v.element,v),o._zoneById.set(v.id,v),v.droppables.forEach(function(_){var w=o._zonesByDroppable.get(_);if(!(w!=null&&w.length))return o._zonesByDroppable.set(_,[v]);o._zonesByDroppable.set(_,I(new Set([].concat(I(w),[v]))))})}))}),i(this,"_handleDrop",function(a){o._zones.forEach(function(f){f!==a&&f.handleNoDrop()}),a&&a.handleDrop()}),i(this,"_getZoneByElementsFromPoint",function(a,f){for(var v=f.x,_=f.y,w=0,L=a.length;w<L;w++){var R=o._zoneByElement.get(a[w]);if(R&&rt(R.rect,{left:v,right:v,top:_,bottom:_},Math.min(o.Settings.dropTargetThreshold,.5)))return R}}),i(this,"stop",function(a){var f=a.isDragging;if(f){var v=o.getTarget();o._handleDrop(v)}}),i(this,"getItemsDroppedById",function(a){var f=o._zoneById.get(a);return f?f.itemsDropped:console.warn("[DragSelect] No zone found (id: ".concat(a,")"))}),i(this,"getItemsInsideById",function(a,f){var v=o._zoneById.get(a);if(!v)return console.warn("[DragSelect] No zone found (id: ".concat(a,")"));var _=v.itemsInside;return f&&v.handleItemsInsideClasses(),_}),i(this,"getTarget",function(a){var f;if((f=o._zones)!==null&&f!==void 0&&f.length){var v=(a==null?void 0:a.x)||o.DS.stores.PointerStore.currentVal.x,_=(a==null?void 0:a.y)||o.DS.stores.PointerStore.currentVal.y,w=document.elementsFromPoint(v,_);return o._getZoneByElementsFromPoint(w,{x:v,y:_})}}),this.DS=p,this.Settings=p.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:dropZones",function(a){var f=a.settings;return o.setDropZones(f)}),this.setDropZones({dropZones:this.DS.stores.SettingsStore.s.dropZones}),this.DS.subscribe("Interaction:end",this.stop)},Td=function(){function h(d){var o=this,p=d.DS;n(this,h),i(this,"isInteracting",void 0),i(this,"isDragging",void 0),i(this,"init",function(){return o.DS.publish("Interaction:init:pre",{})}),i(this,"_init",function(){o.stop(),o.Settings.usePointerEvents?o.DS.Area.HTMLNode.addEventListener("pointerdown",o.start,{passive:!1}):o.DS.Area.HTMLNode.addEventListener("mousedown",o.start),o.DS.Area.HTMLNode.addEventListener("touchstart",o.start,{passive:!1}),o.DS.publish("Interaction:init",{})}),i(this,"start",function(a){return o.DS.publish("Interaction:start:pre",{event:a,isDragging:o.isDragging})}),i(this,"_start",function(a){a.type==="touchstart"&&a.preventDefault(),o._canInteract(a)&&(o.isInteracting=!0,o.isDragging=o.isDragEvent(a),o.DS.publish("Interaction:start",{event:a,isDragging:o.isDragging}),o.Settings.usePointerEvents?(document.addEventListener("pointerup",o.reset),document.addEventListener("pointercancel",o.reset)):document.addEventListener("mouseup",o.reset),document.addEventListener("touchend",o.reset))}),i(this,"isDragEvent",function(a){var f=a.target.closest(".".concat(o.Settings.selectableClass));return!o.Settings.draggability||o.DS.stores.KeyStore.isMultiSelectKeyPressed(a)||!f?!1:(o.Settings.immediateDrag&&(o.DS.SelectedSet.size?o.DS.SelectedSet.has(f)||(o.DS.SelectedSet.clear(),o.DS.SelectedSet.add(f)):o.DS.SelectedSet.add(f)),!!o.DS.SelectedSet.has(f))}),i(this,"onClick",function(a){var f=a.event;if(o._canInteract(f)&&!(f.detail>0)){var v=o.DS,_=v.stores,w=_.PointerStore,L=_.KeyStore,R=v.SelectableSet,X=v.SelectedSet;w.start(f);var ae=f.target;R.has(ae)&&(L.isMultiSelectKeyPressed(f)||X.clear(),X.toggle(ae),o.reset())}}),i(this,"stop",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o.DS.Area.HTMLNode;o.isInteracting=!1,o.isDragging=!1,o.Settings.usePointerEvents?(a.removeEventListener("pointerdown",o.start,{passive:!1}),document.removeEventListener("pointerup",o.reset),document.removeEventListener("pointercancel",o.reset)):(a.removeEventListener("mousedown",o.start),document.removeEventListener("mouseup",o.reset)),a.removeEventListener("touchstart",o.start,{passive:!1}),document.removeEventListener("touchend",o.reset)}),i(this,"update",function(a){var f=a.event,v=a.scroll_directions,_=a.scroll_multiplier;o.isInteracting&&o.DS.publish(["Interaction:update:pre","Interaction:update"],{event:f,scroll_directions:v,scroll_multiplier:_,isDragging:o.isDragging})}),i(this,"reset",function(a){return o.DS.publish("Interaction:end:pre",{event:a,isDragging:o.isDragging})}),i(this,"_reset",function(a){var f=o.isDragging;o.stop(),o.init(),o.DS.publish("Interaction:end",{event:a,isDragging:f})}),this.DS=p,this.Settings=p.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",function(a){var f=a.settings;o.stop(f["area:pre"]),o.init()}),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(a){var f=a.event;return o.start(f)}),this.DS.subscribe("Interaction:start:pre",function(a){var f=a.event;return o._start(f)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(a){var f=a.event;return o._reset(f)}),this.DS.subscribe("Area:scroll",this.update)}return l(h,[{key:"_canInteract",value:function(o){var p=o.clientX===0&&o.clientY===0&&o.detail===0&&o.target;return!(o.button===2||this.isInteracting||o.target&&!this.DS.SelectorArea.isInside(o.target)||!p&&!this.DS.SelectorArea.isClicked(o))}}]),h}(),Ad=function h(d){var o=this,p=d.DS;n(this,h),i(this,"subscribers",{}),i(this,"subscribe",function(a,f){return Array.isArray(o.subscribers[a])||(o.subscribers[a]=[]),o.subscribers[a].push(f),o.subscribers[a].length-1}),i(this,"unsubscribe",function(a,f,v){v>=0?o.subscribers[a].splice(v,1):f&&(o.subscribers[a]=o.subscribers[a].filter(function(_){return _!==f}))}),i(this,"publish",function(a,f){Array.isArray(a)?a.forEach(function(v){return o._publish(v,f)}):o._publish(a,f)}),i(this,"_publish",function(a,f){var v=o.subscribers[a];Array.isArray(v)&&(a.includes(":pre")?o._handlePrePublish(v,f):o._handlePublish(v,f))}),i(this,"_handlePublish",function(a,f){for(var v=0,_=a.length;v<_;v++){if(o.DS.stopped)return;a[v](f)}}),i(this,"_handlePrePublish",function(a,f){for(var v=a.length;v--;){if(o.DS.stopped)return;a[v](f)}}),this.DS=p},Ld=function(h){y(o,h);var d=A(o);function o(p){var a,f=p.DS;return n(this,o),a=d.call(this),i(N(a),"_rects",void 0),i(N(a),"_timeout",void 0),i(N(a),"init",function(){return Te(a.Settings.selectables).forEach(function(v){return a.add(v)})}),i(N(a),"clear",function(){return a.forEach(function(v){return a.delete(v)})}),i(N(a),"_onClick",function(v){return a.DS.publish(["Selectable:click:pre","Selectable:click"],{event:v})}),i(N(a),"_onPointer",function(v){return a.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:v})}),i(N(a),"addAll",function(v){return v.forEach(function(_){return a.add(_)})}),i(N(a),"deleteAll",function(v){return v.forEach(function(_){return a.delete(_)})}),a.DS=f,a.Settings=f.stores.SettingsStore.s,a.DS.subscribe("Interaction:init",a.init),a.DS.PubSub.subscribe("Settings:updated:selectables",function(){a.clear(),a.init()}),a.DS.subscribe("Settings:updated:selectableClass",function(v){var _=v.settings;a.forEach(function(w){w.classList.remove(_["selectableClass:pre"]),w.classList.add(_.selectableClass)})}),a}return l(o,[{key:"add",value:function(a){if(!V(g(o.prototype),"has",this).call(this,a)){var f={items:this.elements,item:a};return this.DS.publish("Selectable:added:pre",f),a.classList.add(this.Settings.selectableClass),a.addEventListener("click",this._onClick),this.Settings.usePointerEvents?a.addEventListener("pointerdown",this._onPointer,{passive:!1}):a.addEventListener("mousedown",this._onPointer),a.addEventListener("touchstart",this._onPointer,{passive:!1}),this.Settings.draggability&&!this.Settings.useTransform&&yn({computedStyle:window.getComputedStyle(a),node:a}),this.DS.publish("Selectable:added",f),V(g(o.prototype),"add",this).call(this,a)}}},{key:"delete",value:function(a){if(V(g(o.prototype),"has",this).call(this,a)){var f={items:this.elements,item:a};return this.DS.publish("Selectable:removed:pre",f),a.classList.remove(this.Settings.selectableClass),a.classList.remove(this.Settings.hoverClass),a.removeEventListener("click",this._onClick),this.Settings.usePointerEvents?a.removeEventListener("pointerdown",this._onPointer,{passive:!1}):a.removeEventListener("mousedown",this._onPointer),a.removeEventListener("touchstart",this._onPointer,{passive:!1}),this.DS.publish("Selectable:removed",f),V(g(o.prototype),"delete",this).call(this,a)}}},{key:"elements",get:function(){return Array.from(this.values())}},{key:"rects",get:function(){var a=this;return this._rects?this._rects:(this._rects=new Map,this.forEach(function(f){return a._rects.set(f,f.getBoundingClientRect())}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return a._rects=null},this.Settings.refreshMemoryRate),this._rects)}}]),o}(k(Set)),Id=function(h){y(o,h);var d=A(o);function o(p){var a,f=p.DS;return n(this,o),a=d.call(this),i(N(a),"clear",function(){return a.forEach(function(v){return a.delete(v)})}),i(N(a),"addAll",function(v){return v.forEach(function(_){return a.add(_)})}),i(N(a),"deleteAll",function(v){return v.forEach(function(_){return a.delete(_)})}),a.DS=f,a}return l(o,[{key:"add",value:function(a){if(!V(g(o.prototype),"has",this).call(this,a)){var f={items:this.elements,item:a};return this.DS.publish("Selected:added:pre",f),V(g(o.prototype),"add",this).call(this,a),a.classList.add(this.DS.stores.SettingsStore.s.selectedClass),a.style.zIndex="".concat((parseInt(a.style.zIndex)||0)+1),this.DS.publish("Selected:added",f),this}}},{key:"delete",value:function(a){if(V(g(o.prototype),"has",this).call(this,a)){var f={items:this.elements,item:a};this.DS.publish("Selected:removed:pre",f);var v=V(g(o.prototype),"delete",this).call(this,a);return a.classList.remove(this.DS.stores.SettingsStore.s.selectedClass),a.style.zIndex="".concat((parseInt(a.style.zIndex)||0)-1),this.DS.publish("Selected:removed",f),v}}},{key:"toggle",value:function(a){return this.has(a)?this.delete(a):this.add(a),a}},{key:"elements",get:function(){return Array.from(this.values())}}]),o}(k(Set)),Od=function(){function h(d){var o=this,p=d.DS;n(this,h),i(this,"_prevSelectedSet",void 0),i(this,"start",function(a){var f=a.event,v=a.isDragging;v||(o._storePrevious(f),o._handleInsideSelection(!0,f))}),i(this,"update",function(a){var f=a.isDragging;f||o.DS.continue||o._handleInsideSelection()}),i(this,"_handleInsideSelection",function(a,f){var v=o.DS,_=v.SelectableSet,w=v.SelectorArea,L=v.Selector,R=_.rects,X=[],ae=[],oe=re(R),be;try{for(oe.s();!(be=oe.n()).done;){var Z=j(be.value,2),le=Z[0],ot=Z[1];w.isInside(le,ot)&&(rt(ot,L.rect,o.Settings.selectionThreshold)?X.push(le):ae.push(le))}}catch(Ae){oe.e(Ae)}finally{oe.f()}var Jt=o.DS.stores.KeyStore.isMultiSelectKeyPressed(f)&&o.Settings.multiSelectToggling;o.DS.continue||(X.forEach(function(Ae){return kd({element:Ae,force:a,multiSelectionToggle:Jt,SelectedSet:o.DS.SelectedSet,hoverClassName:o.Settings.hoverClass})}),ae.forEach(function(Ae){return xd({element:Ae,force:a,SelectedSet:o.DS.SelectedSet,hoverClassName:o.Settings.hoverClass,PrevSelectedSet:o._prevSelectedSet})}))}),this.DS=p,this.Settings=this.DS.stores.SettingsStore.s,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return l(h,[{key:"_storePrevious",value:function(o){var p=this.DS,a=p.stores.KeyStore,f=p.SelectedSet;a.isMultiSelectKeyPressed(o)?this._prevSelectedSet=new Set(f):this._prevSelectedSet=new Set}}]),h}(),jd=function(){function h(d){var o=this,p=d.DS;n(this,h),i(this,"_rect",void 0),i(this,"attachSelector",function(){var a,f;o.HTMLNode&&(a=o.DS.SelectorArea)!==null&&a!==void 0&&a.HTMLNode&&o.DS.SelectorArea.HTMLNode.removeChild(o.HTMLNode),o.HTMLNode=o.DS.stores.SettingsStore.s.selector||yt(o.DS.stores.SettingsStore.s.customStyles),o.HTMLNode.classList.add(o.DS.stores.SettingsStore.s.selectorClass),o.HTMLNode&&(f=o.DS.SelectorArea)!==null&&f!==void 0&&f.HTMLNode&&o.DS.SelectorArea.HTMLNode.appendChild(o.HTMLNode)}),i(this,"start",function(a){var f=a.isDragging;if(!f){var v=o.DS.stores.PointerStore,_=v.initialValArea;vn(o.HTMLNode,M(_,1)),o.HTMLNode.style.display="block",o._rect=null}}),i(this,"stop",function(){o.HTMLNode.style.width="0",o.HTMLNode.style.height="0",o.HTMLNode.style.display="none"}),i(this,"update",function(a){var f=a.isDragging;if(!(f||o.DS.continue)){var v=o.DS.stores,_=v.ScrollStore,w=v.PointerStore,L=yd({scrollAmount:_.scrollAmount,initialPointerPos:w.initialValArea,pointerPos:w.currentValArea});vn(o.HTMLNode,L),o._rect=null}}),this.DS=p,this.DS.subscribe("Settings:updated:selectorClass",function(a){var f=a.settings;o.HTMLNode.classList.remove(f["selectorClass:pre"]),o.HTMLNode.classList.add(f.selectorClass)}),this.DS.subscribe("Settings:updated:selector",this.attachSelector),this.DS.subscribe("Settings:updated:customStyles",this.attachSelector),this.attachSelector(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return l(h,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),Pd=function(){function h(d){var o=this,p=d.DS;n(this,h),i(this,"_scrollInterval",void 0),i(this,"_rect",void 0),i(this,"currentEdges",[]),i(this,"start",function(){return o.applyElements("append")}),i(this,"applyElements",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",f=document.body?"body":"documentElement",v="".concat(a,"Child");o.HTMLNode[v](o.DS.Selector.HTMLNode),document[f][v](o.HTMLNode)}),i(this,"updatePos",function(){o._rect=null;var a=o.DS.Area.rect,f=o.DS.Area.computedBorder,v=o.HTMLNode.style,_="".concat(a.top+f.top,"px"),w="".concat(a.left+f.left,"px"),L="".concat(a.width,"px"),R="".concat(a.height,"px");v.top!==_&&(v.top=_),v.left!==w&&(v.left=w),v.width!==L&&(v.width=L),v.height!==R&&(v.height=R)}),i(this,"stop",function(a){o.stopAutoScroll(),a&&o.applyElements("remove")}),i(this,"startAutoScroll",function(){o.currentEdges=[],o._scrollInterval=setInterval(function(){return o.handleAutoScroll()},16)}),i(this,"handleAutoScroll",function(){if(!o.DS.continue){var a=o.DS,f=a.stores.PointerStore,v=a.Area;o.currentEdges=pn({elementRect:M(f.currentVal),containerRect:o.rect,tolerance:o.DS.stores.SettingsStore.s.overflowTolerance}),o.currentEdges.length&&v.scroll(o.currentEdges,o.DS.stores.SettingsStore.s.autoScrollSpeed)}}),i(this,"stopAutoScroll",function(){o.currentEdges=[],clearInterval(o._scrollInterval)}),i(this,"isInside",function(a,f){return o.DS.Area.HTMLNode.contains(a)&&o.DS.stores.ScrollStore.canScroll?!0:rt(o.rect,f||a.getBoundingClientRect())}),this.DS=p,this.HTMLNode=he(),this.DS.subscribe("Settings:updated:selectorAreaClass",function(a){var f=a.settings;o.HTMLNode.classList.remove(f["selectorAreaClass:pre"]),o.HTMLNode.classList.add(f.selectorAreaClass)}),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){o.updatePos(),o.stopAutoScroll()})}return l(h,[{key:"isClicked",value:function(o){var p=this.DS.stores.PointerStore,a=o?p.getPointerPosition(o):p.initialVal;return rt({left:a.x,top:a.y,right:a.x,bottom:a.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),zd=function(){function h(d){var o=this,p=d.DS;n(this,h),i(this,"_currentValues",new Set),i(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),i(this,"init",function(){document.addEventListener("keydown",o.keydown),document.addEventListener("keyup",o.keyup),window.addEventListener("blur",o.reset)}),i(this,"keydown",function(a){var f=a.key.toLowerCase();o.DS.publish("KeyStore:down:pre",{event:a,key:f}),o._currentValues.add(f),o.DS.publish("KeyStore:down",{event:a,key:f})}),i(this,"keyup",function(a){var f=a.key.toLowerCase();o.DS.publish("KeyStore:up:pre",{event:a,key:f}),o._currentValues.delete(f),o.DS.publish("KeyStore:up",{event:a,key:f})}),i(this,"stop",function(){document.removeEventListener("keydown",o.keydown),document.removeEventListener("keyup",o.reset),window.removeEventListener("blur",o.reset),o.reset()}),i(this,"reset",function(){return o._currentValues.clear()}),this.DS=p,this.DS.subscribe("Interaction:init",this.init)}return l(h,[{key:"isMultiSelectKeyPressed",value:function(o){var p=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var a=this.DS.stores.SettingsStore.s.multiSelectKeys.map(function(f){return f.toLocaleLowerCase()});return!!(this.currentValues.some(function(f){return a.includes(f.toLocaleLowerCase())})||o&&a.some(function(f){return o[p._keyMapping[f]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),h}(),Rd=function(){function h(d){var o=this,p=d.DS;n(this,h),i(this,"_isMouseInteraction",!1),i(this,"_initialValArea",void 0),i(this,"_currentValArea",void 0),i(this,"_lastValArea",void 0),i(this,"_initialVal",void 0),i(this,"_currentVal",void 0),i(this,"_lastVal",void 0),i(this,"_lastTouch",void 0),i(this,"init",function(){o.Settings.usePointerEvents?document.addEventListener("pointermove",o.update,{passive:!1}):document.addEventListener("mousemove",o.update),document.addEventListener("touchmove",o.update,{passive:!1})}),i(this,"getPointerPosition",function(a){return gd({event:o._normalizedEvent(a)})}),i(this,"update",function(a){a&&(o.DS.publish("PointerStore:updated:pre",{event:a}),o.currentVal=o.getPointerPosition(a),o._isMouseInteraction&&o.DS.publish("PointerStore:updated",{event:a}))}),i(this,"stop",function(){o.Settings.usePointerEvents?document.removeEventListener("pointermove",o.update,{passive:!1}):document.removeEventListener("mousemove",o.update),document.removeEventListener("touchmove",o.update,{passive:!1}),setTimeout(function(){return o._isMouseInteraction=!1},100)}),i(this,"reset",function(a){a&&(o.currentVal=o.lastVal=o.getPointerPosition(a),o.stop(),o.init())}),this.DS=p,this.Settings=p.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(a){var f=a.event;return o.start(f)}),this.DS.subscribe("Interaction:end",function(a){var f=a.event;return o.reset(f)})}return l(h,[{key:"start",value:function(o){o&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(o))}},{key:"_normalizedEvent",value:function(o){return"touches"in o&&o.type!=="touchend"&&(this._lastTouch=o),"touches"in o?this._lastTouch.touches[0]:o}},{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(o){this._initialVal=o,this._initialValArea=o&&E(o,"-",E($(this.DS.Area.rect),"+",$(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(o){this._currentVal=o,this._currentValArea=o&&E(o,"-",E($(this.DS.Area.rect),"+",$(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(o){this._lastVal=o,this._lastValArea=o&&E(o,"-",E($(this.DS.Area.rect),"+",$(this.DS.Area.computedBorder)))}}]),h}(),Hd=function(){function h(d){var o=this,p=d.DS;n(this,h),i(this,"_initialVal",void 0),i(this,"_currentVal",void 0),i(this,"_canScroll",void 0),i(this,"init",function(){return o.DS.stores.SettingsStore.s.area.addEventListener("scroll",o.update)}),i(this,"start",function(){o._currentVal=o._initialVal=vt(o.DS.stores.SettingsStore.s.area),o.DS.stores.SettingsStore.s.area.addEventListener("scroll",o.update)}),i(this,"update",function(){return o._currentVal=vt(o.DS.stores.SettingsStore.s.area)}),i(this,"stop",function(){o.DS.stores.SettingsStore.s.area.removeEventListener("scroll",o.update),o._initialVal={x:0,y:0},o._canScroll=null}),i(this,"reset",function(){o.stop(),o.start()}),this.DS=p,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return o.start()}),this.DS.subscribe("Interaction:end",function(){return o.reset()})}return l(h,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=de(this.DS.stores.SettingsStore.s.area)}},{key:"scrollAmount",get:function(){var o=E(this.currentVal,"-",this.initialVal),p=G(this.DS.stores.SettingsStore.s.zoom),a=E(E(o,"*",p),"-",o);return{x:o.x+a.x,y:o.y+a.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=vt(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),h}(),Fd=function h(d){var o=this,p=d.DS,a=d.settings;n(this,h),i(this,"_settings",{}),i(this,"s",{}),i(this,"update",function(f){var v=f.settings,_=f.init;return o.DS.publish("Settings:updated:pre",u({settings:v},_?{init:_}:{}))}),i(this,"_update",function(f){for(var v=f.settings,_=f.init,w=Dd(v,_),L=function(){var oe,be=j(X[R],2),Z=be[0],le=be[1];Z in o._settings||Object.defineProperty(o.s,Z,{get:function(){return o._settings[Z]},set:function(Ae){return o.update({settings:i({},Z,Ae)})}}),o._settings["".concat(Z,":pre")]=o._settings[Z],o._settings[Z]=le;var ot={settings:(oe={},i(oe,Z,o._settings[Z]),i(oe,"".concat(Z,":pre"),o._settings["".concat(Z,":pre")]),oe)};o.DS.publish("Settings:updated",ot),o.DS.publish("Settings:updated:".concat(Z),ot)},R=0,X=Object.entries(w);R<X.length;R++)L()}),this.DS=p,this.DS.subscribe("Settings:updated:pre",this._update),this.update({settings:a,init:!0})},Ud=function(){function h(d){var o=this;n(this,h),i(this,"continue",!1),i(this,"start",function(){o.stopped=!1,o.Interaction.init()}),i(this,"break",function(){return o.continue=!0}),i(this,"setSettings",function(p){return o.stores.SettingsStore.update({settings:p})}),i(this,"getSelection",function(){return o.SelectedSet.elements}),i(this,"getSelectables",function(){return o.SelectableSet.elements}),i(this,"getInitialCursorPosition",function(){return o.stores.PointerStore.initialVal}),i(this,"getCurrentCursorPosition",function(){return o.stores.PointerStore.currentVal}),i(this,"getPreviousCursorPosition",function(){return o.stores.PointerStore.lastVal}),i(this,"getInitialCursorPositionArea",function(){return o.stores.PointerStore.initialValArea}),i(this,"getCurrentCursorPositionArea",function(){return o.stores.PointerStore.currentValArea}),i(this,"getPreviousCursorPositionArea",function(){return o.stores.PointerStore.lastValArea}),i(this,"isMultiSelect",function(p){return o.stores.KeyStore.isMultiSelectKeyPressed(p)}),i(this,"isDragging",function(){return o.Interaction.isDragging}),i(this,"getZoneByCoordinates",function(p){var a;return(a=o.DropZones.getTarget(p))===null||a===void 0?void 0:a.toObject()}),i(this,"getItemsDroppedByZoneId",function(p){return o.DropZones.getItemsDroppedById(p)}),i(this,"getItemsInsideByZoneId",function(p,a){return o.DropZones.getItemsInsideById(p,a)}),this.PubSub=new Ad({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this.stores={},this.stores.SettingsStore=new Fd({DS:this,settings:d}),this.stores.PointerStore=new Rd({DS:this}),this.stores.ScrollStore=new Hd({DS:this}),this.stores.KeyStore=new zd({DS:this}),this.Area=new Vd({DS:this}),this.Selector=new jd({DS:this}),this.SelectorArea=new Pd({DS:this}),this.SelectableSet=new Ld({DS:this}),this.SelectedSet=new Id({DS:this}),this.Selection=new Od({DS:this}),this.Drag=new Md({DS:this}),this.DropZones=new $d({DS:this}),this.Interaction=new Td({DS:this}),Cd({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction,DropZones:this.DropZones}),this.subscribe("Interaction:end",function(){return o.continue=!1}),this.start()}return l(h,[{key:"stop",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;a&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(o),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),o&&this.SelectableSet.clear(),p&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(o){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Te(o)),a||this.addSelectables(o),p&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(o){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Te(o)),a&&this.removeSelectables(o),p&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(o){var p=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Te(o).forEach(function(v){return p.SelectedSet.has(v)?p.removeSelection(o,a,f):p.addSelection(o,a,f)}),a&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(o){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(o,p,a),this.getSelection()}},{key:"clearSelection",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),o&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(o,p,a){var f=Te(o);return this.SelectableSet.addAll(f),p&&this.SelectedSet.addAll(f),a&&this.PubSub.publish("callback",{items:this.getSelection()}),o}},{key:"setSelectables",value:function(o){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(o,p),this.addSelectables(o,a)}},{key:"removeSelectables",value:function(o,p,a){return this.SelectableSet.deleteAll(Te(o)),p&&this.removeSelection(o),a&&this.PubSub.publish("callback",{items:this.getSelection()}),o}}]),h}();return Ud})})(er);const eo=er.exports,tr=(r,t,n,s,l)=>(t=Math,n=t.log,s=1024,l=n(r)/n(s)|0,r/t.pow(s,l)).toFixed(0)+" "+(l?"KMGTPEZY"[--l]+"iB":"B"),rr=(r,t=null)=>new Date(r*1e3).toLocaleString(t??navigator.language??"en-US"),to={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},ro=[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)],no={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},oo=[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)],at=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(r){return(t,n)=>(e.openBlock(),e.createElementBlock("div",null,[r.direction=="down"?(e.openBlock(),e.createElementBlock("svg",to,ro)):e.createCommentVNode("",!0),r.direction=="up"?(e.openBlock(),e.createElementBlock("svg",no,oo)):e.createCommentVNode("",!0)]))}}),so=["onClick"],io=Object.assign({name:"VFToast.vue"},{setup(r){const t=e.inject("emitter"),{getStore:n}=e.inject("storage"),s=e.ref(n("full-screen",!1)),l=y=>y=="error"?"text-red-400 border-red-400 dark:text-red-300 dark:border-red-300":"text-lime-600 border-lime-600 dark:text-lime-300 dark:border-lime-1300",i=e.ref([]),c=y=>{i.value.splice(y,1)},u=y=>{let g=i.value.findIndex(m=>m.id===y);g!==-1&&c(g)};return t.on("vf-toast-clear",()=>{i.value=[]}),t.on("vf-toast-push",y=>{let g=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");y.id=g,i.value.push(y),setTimeout(()=>{u(g)},5e3)}),(y,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([s.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(i.value,(m,b)=>(e.openBlock(),e.createElementBlock("div",{onClick:S=>c(b),key:m,class:e.normalizeClass([l(m.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 dark:bg-gray-600 border text-xs sm:text-sm rounded cursor-pointer"])},e.toDisplayString(m.label),11,so))),128))]),_:1})],2))}}),Ne=r=>Object.entries(r).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:ao}=ue(),_t=(r,t)=>ao.value+"?"+Ne({q:"preview",adapter:r,path:t}),_e=typeof window<"u",nr=_e&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),or=_e&&"IntersectionObserver"in window,sr=_e&&"classList"in document.createElement("p"),ir=_e&&window.devicePixelRatio>1,lo={elements_selector:".lazy",container:nr||_e?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},ar=r=>Object.assign({},lo,r),lr=function(r,t){let n;const s="LazyLoad::Initialized",l=new r(t);try{n=new CustomEvent(s,{detail:{instance:l}})}catch{n=document.createEvent("CustomEvent"),n.initCustomEvent(s,!1,!1,{instance:l})}window.dispatchEvent(n)},co=(r,t)=>{if(t)if(!t.length)lr(r,t);else for(let n=0,s;s=t[n];n+=1)lr(r,s)},Se="src",wt="srcset",kt="sizes",cr="poster",He="llOriginalAttrs",dr="data",xt="loading",hr="loaded",ur="applied",ho="entered",Dt="error",fr="native",mr="data-",pr="ll-status",J=(r,t)=>r.getAttribute(mr+t),uo=(r,t,n)=>{var s=mr+t;if(n===null){r.removeAttribute(s);return}r.setAttribute(s,n)},Fe=r=>J(r,pr),Ce=(r,t)=>uo(r,pr,t),lt=r=>Ce(r,null),Et=r=>Fe(r)===null,fo=r=>Fe(r)===xt,mo=r=>Fe(r)===Dt,Nt=r=>Fe(r)===fr,po=[xt,hr,ur,Dt],go=r=>po.indexOf(Fe(r))>=0,we=(r,t,n,s)=>{if(r){if(s!==void 0){r(t,n,s);return}if(n!==void 0){r(t,n);return}r(t)}},Le=(r,t)=>{if(sr){r.classList.add(t);return}r.className+=(r.className?" ":"")+t},fe=(r,t)=>{if(sr){r.classList.remove(t);return}r.className=r.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},yo=r=>{r.llTempImage=document.createElement("IMG")},bo=r=>{delete r.llTempImage},gr=r=>r.llTempImage,ct=(r,t)=>{if(!t)return;const n=t._observer;n&&n.unobserve(r)},vo=r=>{r.disconnect()},So=(r,t,n)=>{t.unobserve_entered&&ct(r,n)},Ct=(r,t)=>{r&&(r.loadingCount+=t)},_o=r=>{r&&(r.toLoadCount-=1)},yr=(r,t)=>{r&&(r.toLoadCount=t)},wo=r=>r.loadingCount>0,ko=r=>r.toLoadCount>0,br=r=>{let t=[];for(let n=0,s;s=r.children[n];n+=1)s.tagName==="SOURCE"&&t.push(s);return t},Vt=(r,t)=>{const n=r.parentNode;if(!n||n.tagName!=="PICTURE")return;br(n).forEach(t)},vr=(r,t)=>{br(r).forEach(t)},dt=[Se],Sr=[Se,cr],Ue=[Se,wt,kt],_r=[dr],ht=r=>!!r[He],wr=r=>r[He],kr=r=>delete r[He],Ie=(r,t)=>{if(ht(r))return;const n={};t.forEach(s=>{n[s]=r.getAttribute(s)}),r[He]=n},xo=r=>{ht(r)||(r[He]={backgroundImage:r.style.backgroundImage})},Do=(r,t,n)=>{if(!n){r.removeAttribute(t);return}r.setAttribute(t,n)},Ve=(r,t)=>{if(!ht(r))return;const n=wr(r);t.forEach(s=>{Do(r,s,n[s])})},Eo=r=>{if(!ht(r))return;const t=wr(r);r.style.backgroundImage=t.backgroundImage},xr=(r,t,n)=>{Le(r,t.class_applied),Ce(r,ur),n&&(t.unobserve_completed&&ct(r,t),we(t.callback_applied,r,n))},Dr=(r,t,n)=>{Le(r,t.class_loading),Ce(r,xt),n&&(Ct(n,1),we(t.callback_loading,r,n))},ke=(r,t,n)=>{n&&r.setAttribute(t,n)},Er=(r,t)=>{ke(r,kt,J(r,t.data_sizes)),ke(r,wt,J(r,t.data_srcset)),ke(r,Se,J(r,t.data_src))},No=(r,t)=>{Vt(r,n=>{Ie(n,Ue),Er(n,t)}),Ie(r,Ue),Er(r,t)},Co=(r,t)=>{Ie(r,dt),ke(r,Se,J(r,t.data_src))},Vo=(r,t)=>{vr(r,n=>{Ie(n,dt),ke(n,Se,J(n,t.data_src))}),Ie(r,Sr),ke(r,cr,J(r,t.data_poster)),ke(r,Se,J(r,t.data_src)),r.load()},Mo=(r,t)=>{Ie(r,_r),ke(r,dr,J(r,t.data_src))},Bo=(r,t,n)=>{const s=J(r,t.data_bg),l=J(r,t.data_bg_hidpi),i=ir&&l?l:s;i&&(r.style.backgroundImage=`url("${i}")`,gr(r).setAttribute(Se,i),Dr(r,t,n))},$o=(r,t,n)=>{const s=J(r,t.data_bg_multi),l=J(r,t.data_bg_multi_hidpi),i=ir&&l?l:s;i&&(r.style.backgroundImage=i,xr(r,t,n))},To=(r,t,n)=>{const s=J(r,t.data_bg_set);if(!s)return;const l=s.split("|");let i=l.map(c=>`image-set(${c})`);r.style.backgroundImage=i.join(),r.style.backgroundImage===""&&(i=l.map(c=>`-webkit-image-set(${c})`),r.style.backgroundImage=i.join()),xr(r,t,n)},Nr={IMG:No,IFRAME:Co,VIDEO:Vo,OBJECT:Mo},Ao=(r,t)=>{const n=Nr[r.tagName];n&&n(r,t)},Lo=(r,t,n)=>{const s=Nr[r.tagName];s&&(s(r,t),Dr(r,t,n))},Io=["IMG","IFRAME","VIDEO","OBJECT"],Oo=r=>Io.indexOf(r.tagName)>-1,Cr=(r,t)=>{t&&!wo(t)&&!ko(t)&&we(r.callback_finish,t)},Vr=(r,t,n)=>{r.addEventListener(t,n),r.llEvLisnrs[t]=n},jo=(r,t,n)=>{r.removeEventListener(t,n)},Mt=r=>!!r.llEvLisnrs,Po=(r,t,n)=>{Mt(r)||(r.llEvLisnrs={});const s=r.tagName==="VIDEO"?"loadeddata":"load";Vr(r,s,t),Vr(r,"error",n)},Bt=r=>{if(!Mt(r))return;const t=r.llEvLisnrs;for(let n in t){const s=t[n];jo(r,n,s)}delete r.llEvLisnrs},Mr=(r,t,n)=>{bo(r),Ct(n,-1),_o(n),fe(r,t.class_loading),t.unobserve_completed&&ct(r,n)},zo=(r,t,n,s)=>{const l=Nt(t);Mr(t,n,s),Le(t,n.class_loaded),Ce(t,hr),we(n.callback_loaded,t,s),l||Cr(n,s)},Ro=(r,t,n,s)=>{const l=Nt(t);Mr(t,n,s),Le(t,n.class_error),Ce(t,Dt),we(n.callback_error,t,s),n.restore_on_error&&Ve(t,Ue),l||Cr(n,s)},$t=(r,t,n)=>{const s=gr(r)||r;if(Mt(s))return;Po(s,c=>{zo(c,r,t,n),Bt(s)},c=>{Ro(c,r,t,n),Bt(s)})},Ho=(r,t,n)=>{yo(r),$t(r,t,n),xo(r),Bo(r,t,n),$o(r,t,n),To(r,t,n)},Fo=(r,t,n)=>{$t(r,t,n),Lo(r,t,n)},Tt=(r,t,n)=>{Oo(r)?Fo(r,t,n):Ho(r,t,n)},Uo=(r,t,n)=>{r.setAttribute("loading","lazy"),$t(r,t,n),Ao(r,t),Ce(r,fr)},Br=r=>{r.removeAttribute(Se),r.removeAttribute(wt),r.removeAttribute(kt)},Ko=r=>{Vt(r,t=>{Br(t)}),Br(r)},$r=r=>{Vt(r,t=>{Ve(t,Ue)}),Ve(r,Ue)},Yo={IMG:$r,IFRAME:r=>{Ve(r,dt)},VIDEO:r=>{vr(r,t=>{Ve(t,dt)}),Ve(r,Sr),r.load()},OBJECT:r=>{Ve(r,_r)}},Wo=r=>{const t=Yo[r.tagName];if(!t){Eo(r);return}t(r)},Xo=(r,t)=>{Et(r)||Nt(r)||(fe(r,t.class_entered),fe(r,t.class_exited),fe(r,t.class_applied),fe(r,t.class_loading),fe(r,t.class_loaded),fe(r,t.class_error))},Zo=(r,t)=>{Wo(r),Xo(r,t),lt(r),kr(r)},qo=(r,t,n,s)=>{n.cancel_on_exit&&fo(r)&&r.tagName==="IMG"&&(Bt(r),Ko(r),$r(r),fe(r,n.class_loading),Ct(s,-1),lt(r),we(n.callback_cancel,r,t,s))},Go=(r,t,n,s)=>{const l=go(r);Ce(r,ho),Le(r,n.class_entered),fe(r,n.class_exited),So(r,n,s),we(n.callback_enter,r,t,s),!l&&Tt(r,n,s)},Jo=(r,t,n,s)=>{Et(r)||(Le(r,n.class_exited),qo(r,t,n,s),we(n.callback_exit,r,t,s))},Qo=["IMG","IFRAME","VIDEO"],Tr=r=>r.use_native&&"loading"in HTMLImageElement.prototype,es=(r,t,n)=>{r.forEach(s=>{Qo.indexOf(s.tagName)!==-1&&Uo(s,t,n)}),yr(n,0)},ts=r=>r.isIntersecting||r.intersectionRatio>0,rs=r=>({root:r.container===document?null:r.container,rootMargin:r.thresholds||r.threshold+"px"}),ns=(r,t,n)=>{r.forEach(s=>ts(s)?Go(s.target,s,t,n):Jo(s.target,s,t,n))},os=(r,t)=>{t.forEach(n=>{r.observe(n)})},ss=(r,t)=>{vo(r),os(r,t)},is=(r,t)=>{!or||Tr(r)||(t._observer=new IntersectionObserver(n=>{ns(n,r,t)},rs(r)))},Ar=r=>Array.prototype.slice.call(r),ut=r=>r.container.querySelectorAll(r.elements_selector),as=r=>Ar(r).filter(Et),ls=r=>mo(r),cs=r=>Ar(r).filter(ls),Lr=(r,t)=>as(r||ut(t)),ds=(r,t)=>{cs(ut(r)).forEach(s=>{fe(s,r.class_error),lt(s)}),t.update()},hs=(r,t)=>{_e&&(t._onlineHandler=()=>{ds(r,t)},window.addEventListener("online",t._onlineHandler))},us=r=>{_e&&window.removeEventListener("online",r._onlineHandler)},Ke=function(r,t){const n=ar(r);this._settings=n,this.loadingCount=0,is(n,this),hs(n,this),this.update(t)};Ke.prototype={update:function(r){const t=this._settings,n=Lr(r,t);if(yr(this,n.length),nr||!or){this.loadAll(n);return}if(Tr(t)){es(n,t,this);return}ss(this._observer,n)},destroy:function(){this._observer&&this._observer.disconnect(),us(this),ut(this._settings).forEach(r=>{kr(r)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(r){const t=this._settings;Lr(r,t).forEach(s=>{ct(s,this),Tt(s,t,this)})},restoreAll:function(){const r=this._settings;ut(r).forEach(t=>{Zo(t,r)})}},Ke.load=(r,t)=>{const n=ar(t);Tt(r,n)},Ke.resetStatus=r=>{lt(r)},_e&&co(Ke,window.lazyLoadOptions);const fs={class:"relative flex-auto flex flex-col overflow-hidden"},ms={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},ps={class:"absolute"},gs=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),ys={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"},bs=["onDblclick","onContextmenu","data-type","data-item","data-index"],vs={class:"grid grid-cols-12 items-center"},Ss={class:"flex col-span-7 items-center"},_s={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"},ws=[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)],ks={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"},xs=[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)],Ds={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Es={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Ns=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Cs={class:"grid grid-cols-12 items-center"},Vs={class:"flex col-span-7 items-center"},Ms={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"},Bs=[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)],$s={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"},Ts=[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)],As={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Ls={class:"col-span-2 text-center"},Is={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Os=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],js={class:"relative"},Ps={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"},zs=[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)],Rs=["data-src","alt"],Hs={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"},Fs=[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)],Us={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},Ks={class:"break-all"},Ys=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(r){const t=r,n=e.inject("emitter"),{setStore:s,getStore:l}=e.inject("storage"),i=e.inject("adapter"),c=E=>E==null?void 0:E.substring(0,3),u=E=>E.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),y=e.ref(null),g=e.ref(null),m=e.ref(0),b=e.ref(null),{t:S}=e.inject("i18n"),x=Math.floor(Math.random()*2**32),k=e.ref(l("full-screen",!1)),N=new Ke;n.on("vf-fullscreen-toggle",()=>{y.value.style.height=null,k.value=!k.value,s("full-screen",k.value)});const C=e.ref("");n.on("vf-search-query",({newQuery:E})=>{C.value=E,E?n.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:E},onSuccess:$=>{$.files.length||n.emit("vf-toast-push",{label:S("No search result found.")})}}):n.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let A=null;const T=()=>{A&&clearTimeout(A)},V=e.ref(!0),j=E=>{E.touches.length>1&&(V.value?(b.value.stop(),n.emit("vf-toast-push",{label:S("Drag&Drop: off")})):(b.value.start(),n.emit("vf-toast-push",{label:S("Drag&Drop: on")}),n.emit("vf-explorer-update")),V.value=!V.value)},I=E=>{A=setTimeout(()=>{const $=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:E.target.getBoundingClientRect().x,clientY:E.target.getBoundingClientRect().y});E.target.dispatchEvent($)},500)},D=E=>{E.type=="dir"?(n.emit("vf-search-exit"),n.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:E.path}})):n.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:E})},B=e.reactive({active:!1,column:"",order:""}),H=(E=!0)=>{let $=[...t.data.files],M=B.column,G=B.order=="asc"?1:-1;if(!E)return $;const O=(de,he)=>typeof de=="string"&&typeof he=="string"?de.toLowerCase().localeCompare(he.toLowerCase()):de<he?-1:de>he?1:0;return B.active&&($=$.slice().sort((de,he)=>O(de[M],he[M])*G)),$},W=E=>{B.active&&B.column==E?(B.active=B.order=="asc",B.column=E,B.order="desc"):(B.active=!0,B.column=E,B.order="asc")},Y=()=>b.value.getSelection().map(E=>JSON.parse(E.dataset.item)),te=(E,$)=>{if(E.altKey||E.ctrlKey||E.metaKey)return E.preventDefault(),!1;E.dataTransfer.setDragImage(g.value,0,15),E.dataTransfer.effectAllowed="all",E.dataTransfer.dropEffect="copy",E.dataTransfer.setData("items",JSON.stringify(Y()))},ie=(E,$)=>{E.preventDefault();let M=JSON.parse(E.dataTransfer.getData("items"));if(M.find(G=>G.storage!=i.value)){alert("Moving items between different storages is not supported yet.");return}n.emit("vf-modal-show",{type:"move",items:{from:M,to:$}})},ne=(E,$)=>{E.preventDefault(),!$||$.type!=="dir"||b.value.getSelection().find(M=>M==E.currentTarget)?(E.dataTransfer.dropEffect="none",E.dataTransfer.effectAllowed="none"):E.dataTransfer.dropEffect="copy"},re=()=>{b.value=new eo({area:y.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),n.on("vf-explorer-update",()=>e.nextTick(()=>{b.value.clearSelection(),b.value.setSelectables(document.getElementsByClassName("vf-item-"+x))})),b.value.subscribe("predragstart",({event:E,isDragging:$})=>{if($)m.value=b.value.getSelection().length,b.value.break();else{const M=E.target.offsetWidth-E.offsetX,G=E.target.offsetHeight-E.offsetY;M<15&&G<15&&(b.value.clearSelection(),b.value.break())}}),b.value.subscribe("predragmove",({isDragging:E})=>{E&&b.value.break()}),b.value.subscribe("callback",({items:E,event:$,isDragging:M})=>{n.emit("vf-nodes-selected",Y()),m.value=b.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{b.value.Area.reset(),b.value.SelectorArea.updatePos(),N.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>n.emit("vf-explorer-update"))}),(E,$)=>(e.openBlock(),e.createElementBlock("div",fs,[r.view=="list"||C.value.length?(e.openBlock(),e.createElementBlock("div",ms,[e.createElementVNode("div",{onClick:$[0]||($[0]=M=>W("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Name"))+" ",1),e.withDirectives(e.createVNode(at,{direction:B.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,B.active&&B.column=="basename"]])]),C.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:$[1]||($[1]=M=>W("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Size"))+" ",1),e.withDirectives(e.createVNode(at,{direction:B.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,B.active&&B.column=="file_size"]])])),C.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:$[2]||($[2]=M=>W("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Date"))+" ",1),e.withDirectives(e.createVNode(at,{direction:B.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,B.active&&B.column=="last_modified"]])])),C.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:$[3]||($[3]=M=>W("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Filepath"))+" ",1),e.withDirectives(e.createVNode(at,{direction:B.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,B.active&&B.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ps,[e.createElementVNode("div",{ref_key:"dragImage",ref:g,class:"absolute -z-50 -top-96"},[gs,e.createElementVNode("div",ys,e.toDisplayString(m.value),1)],512)]),e.createElementVNode("div",{onTouchstart:j,onContextmenu:$[10]||($[10]=e.withModifiers(M=>e.unref(n).emit("vf-contextmenu-show",{event:M,area:y.value,items:Y()}),["self","prevent"])),class:e.normalizeClass([k.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:y},[C.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H(),(M,G)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:O=>D(M),onTouchstart:$[4]||($[4]=O=>I(O)),onTouchend:$[5]||($[5]=O=>T()),onContextmenu:e.withModifiers(O=>e.unref(n).emit("vf-contextmenu-show",{event:O,area:y.value,items:Y(),target:M}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(x),"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":G},[e.createElementVNode("div",vs,[e.createElementVNode("div",Ss,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",_s,ws)):(e.openBlock(),e.createElementBlock("svg",ks,xs)),e.createElementVNode("span",Ds,e.toDisplayString(M.basename),1)]),e.createElementVNode("div",Es,e.toDisplayString(M.path),1)])],42,bs))),256)):e.createCommentVNode("",!0),r.view=="list"&&!C.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H(),(M,G)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>D(M),onTouchstart:$[6]||($[6]=O=>I(O)),onTouchend:$[7]||($[7]=O=>T()),onContextmenu:e.withModifiers(O=>e.unref(n).emit("vf-contextmenu-show",{event:O,area:y.value,items:Y(),target:M}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,M),onDrop:O=>ie(O,M),class:e.normalizeClass(["vf-item-"+e.unref(x),"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":G},[e.createElementVNode("div",Cs,[e.createElementVNode("div",Vs,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ms,Bs)):(e.openBlock(),e.createElementBlock("svg",$s,Ts)),e.createElementVNode("span",As,e.toDisplayString(M.basename),1)]),e.createElementVNode("div",Ls,e.toDisplayString(M.file_size?e.unref(tr)(M.file_size):""),1),e.createElementVNode("div",Is,e.toDisplayString(e.unref(rr)(M.last_modified)),1)])],42,Ns))),256)):e.createCommentVNode("",!0),r.view=="grid"&&!C.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H(!1),(M,G)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>D(M),onTouchstart:$[8]||($[8]=O=>I(O)),onTouchend:$[9]||($[9]=O=>T()),onContextmenu:e.withModifiers(O=>e.unref(n).emit("vf-contextmenu-show",{event:O,area:y.value,items:Y(),target:M}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,M),onDrop:O=>ie(O,M),class:e.normalizeClass(["vf-item-"+e.unref(x),"border border-transparent hover:bg-neutral-50 m-1 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 text-center justify-center select-none"]),"data-type":M.type,"data-item":JSON.stringify(M),"data-index":G},[e.createElementVNode("div",null,[e.createElementVNode("div",js,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ps,zs)):(M.mime_type??"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(_t)(e.unref(i).value,M.path),alt:M.basename},null,8,Rs)):(e.openBlock(),e.createElementBlock("svg",Hs,Fs)),!(M.mime_type??"").startsWith("image")&&M.type!="dir"?(e.openBlock(),e.createElementBlock("div",Us,e.toDisplayString(c(M.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",Ks,e.toDisplayString(u(M.basename)),1)])],42,Os))),256)):e.createCommentVNode("",!0)],34),e.createVNode(io)]))}}),Ws="1.2.0",Xs={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Zs={class:"flex leading-5 items-center"},qs=["aria-label"],Gs=[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)],Js=["value"],Qs={class:"ml-3"},ei={key:0},ti={class:"ml-1"},ri={class:"flex leading-5 items-center"},ni={value:"",disabled:""},oi=e.createStaticVNode('<option value="en">English</option><option value="fr">French</option><option value="fa">Persian</option><option value="ru">Russian</option><option value="tr">Turkish</option>',5),si=["aria-label"],ii=[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)],ai=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(r){const t=e.inject("emitter"),{getStore:n,setStore:s}=e.inject("storage"),l=e.ref(0),i=e.inject("adapter"),{t:c,changeLocale:u}=e.inject("i18n"),y=e.ref(n("locale","")),g=()=>{t.emit("vf-search-exit"),t.emit("vf-fetch",{params:{q:"index",adapter:i.value}}),s("adapter",i.value)};t.on("vf-nodes-selected",b=>{l.value=b.length});const m=e.ref("");return t.on("vf-search-query",({newQuery:b})=>{m.value=b}),(b,S)=>(e.openBlock(),e.createElementBlock("div",Xs,[e.createElementVNode("div",Zs,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(c)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},Gs,8,qs),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=x=>e.isRef(i)?i.value=x:null),onChange:g,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(r.data.storages,x=>(e.openBlock(),e.createElementBlock("option",{value:x},e.toDisplayString(x),9,Js))),256))],544),[[e.vModelSelect,e.unref(i)]]),e.createElementVNode("div",Qs,[m.value.length?(e.openBlock(),e.createElementBlock("span",ei,e.toDisplayString(r.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",ti,e.toDisplayString(l.value>0?l.value+" "+e.unref(c)("item(s) selected."):""),1)])]),e.createElementVNode("div",ri,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=x=>y.value=x),onChange:S[2]||(S[2]=x=>e.unref(u)(x.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",ni,e.toDisplayString(e.unref(c)("Language")),1),oi],544),[[e.vModelSelect,y.value]]),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(c)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=x=>e.unref(t).emit("vf-modal-show",{type:"message",title:"Vuefinder "+e.unref(Ws),message:e.unref(c)("Vuefinder is a file manager component for vue 3.")}))},ii,8,si)])]))}}),li=(r,t=0,n=!1)=>{let s;return(...l)=>{n&&!s&&r(...l),clearTimeout(s),s=setTimeout(()=>{r(...l)},t)}},ci=(r,t,n)=>{const s=e.ref(r);return e.customRef((i,c)=>({get(){return i(),s.value},set:li(u=>{s.value=u,c()},t,n)}))},di={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"},hi=["aria-label"],ui=[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)],fi=["aria-label"],mi=[e.createElementVNode("path",{d:"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z"},null,-1)],pi=["aria-label"],gi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],yi=["onClick"],bi=[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)],vi={class:"flex leading-5"},Si=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),_i=["title","onClick"],wi={key:0,class:"animate-spin p-1 h-6 w-6 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},ki=[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)],xi={key:3,class:"relative flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Di=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),Ei=e.createElementVNode("div",{class:"w-full"},null,-1),Ni=["onKeydown","placeholder"],Ci=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Vi=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(r){const t=r,n=e.inject("emitter");e.inject("storage");const s=e.inject("adapter"),l=e.ref(null),i=e.ref([]),c=e.ref(!1),u=e.ref(null),{t:y}=e.inject("i18n"),g=e.inject("loadingState");n.on("vf-explorer-update",()=>{let T=[],V=[];l.value=t.data.dirname??s.value+"://",l.value.length==0&&(i.value=[]),l.value.replace(s.value+"://","").split("/").forEach(function(j){T.push(j),T.join("/")!=""&&V.push({basename:j,name:j,path:s.value+"://"+T.join("/"),type:"dir"})}),V.length>4&&(V=V.slice(-5),V[0].name=".."),i.value=V});const m=()=>{c.value=!1,S.value=""};n.on("vf-search-exit",()=>{m()});const b=()=>{c.value=!0,e.nextTick(()=>u.value.focus())},S=ci("",400),x=()=>g.value;e.watch(S,T=>{n.emit("vf-toast-clear"),n.emit("vf-search-query",{newQuery:T})});const k=()=>i.value.length&&!c.value,N=T=>{T.preventDefault();let V=JSON.parse(T.dataTransfer.getData("items"));if(V.find(j=>j.storage!=s.value)){alert("Moving items between different storages is not supported yet.");return}n.emit("vf-modal-show",{type:"move",items:{from:V,to:i.value[i.value.length-2]??{path:s.value+"://"}}})},C=T=>{T.preventDefault(),k()?T.dataTransfer.dropEffect="copy":(T.dataTransfer.dropEffect="none",T.dataTransfer.effectAllowed="none")},A=()=>{S.value==""&&m()};return(T,V)=>(e.openBlock(),e.createElementBlock("div",di,[e.createElementVNode("span",{"aria-label":e.unref(y)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:V[0]||(V[0]=j=>C(j)),onDrop:V[1]||(V[1]=j=>N(j)),onClick:V[2]||(V[2]=j=>{var I;return!k()||e.unref(n).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:((I=i.value[i.value.length-2])==null?void 0:I.path)??e.unref(s)+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",k()?"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"},ui,34))],8,hi),x()?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(y)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:V[4]||(V[4]=j=>e.unref(n).emit("vf-fetch-abort")),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer"},gi))],8,pi)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(y)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:V[3]||(V[3]=j=>{e.unref(n).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:r.data.dirname}})}),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"-40 -40 580 580",fill:"currentColor"},mi))],8,fi)),c.value?(e.openBlock(),e.createElementBlock("div",xi,[Di,Ei,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:u,onKeydown:e.withKeys(m,["esc"]),onBlur:A,"onUpdate:modelValue":V[6]||(V[6]=j=>e.isRef(S)?S.value=j:null),placeholder:e.unref(y)("Search anything.."),class:"absolute ml-4 pt-1 pb-0 px-2 border-0 ring-0 outline-0 text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,Ni),[[e.vModelText,e.unref(S)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:m,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Ci))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(b,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:V[5]||(V[5]=j=>e.unref(n).emit("vf-fetch",{params:{q:"index",adapter:r.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"},bi)),e.createElementVNode("div",vi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(j,I)=>(e.openBlock(),e.createElementBlock("div",{key:I},[Si,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:j.basename,onClick:D=>e.unref(n).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:j.path}})},e.toDisplayString(j.name),9,_i)]))),128))]),x()?(e.openBlock(),e.createElementBlock("svg",wi,ki)):e.createCommentVNode("",!0)],8,yi))]))}}),Mi=["onClick"],Bi=e.createElementVNode("span",{class:"px-1"},null,-1),$i=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(r){const t=r,n=e.inject("emitter"),s=e.ref(null),{apiUrl:l}=ue(),i=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),c=e.ref([]);n.on("vf-context-selected",S=>{c.value=S});const{t:u}=e.inject("i18n"),y={newfolder:{title:()=>u("New Folder"),action:()=>{n.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>u("Delete"),action:()=>{n.emit("vf-modal-show",{type:"delete",items:c})}},refresh:{title:()=>u("Refresh"),action:()=>{n.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>u("Preview"),action:()=>{n.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:c.value[0]})}},open:{title:()=>u("Open"),action:()=>{n.emit("vf-search-exit"),n.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:c.value[0].path}})}},openDir:{title:()=>u("Open containing folder"),action:()=>{n.emit("vf-search-exit"),n.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:c.value[0].dir}})}},download:{title:()=>u("Download"),action:()=>{const S=l.value+"?"+Ne({q:"download",adapter:t.current.adapter,path:c.value[0].path});n.emit("vf-download",S)}},archive:{title:()=>u("Archive"),action:()=>{n.emit("vf-modal-show",{type:"archive",items:c})}},unarchive:{title:()=>u("Unarchive"),action:()=>{n.emit("vf-modal-show",{type:"unarchive",items:c})}},rename:{title:()=>u("Rename"),action:()=>{n.emit("vf-modal-show",{type:"rename",items:c})}}},g=S=>{n.emit("vf-contextmenu-hide"),S.action()},m=e.ref("");n.on("vf-search-query",({newQuery:S})=>{m.value=S}),n.on("vf-contextmenu-show",({event:S,area:x,items:k,target:N=null})=>{if(i.items=[],m.value)if(N)i.items.push(y.openDir),n.emit("vf-context-selected",[N]);else return;else!N&&!m.value?(i.items.push(y.refresh),i.items.push(y.newfolder),n.emit("vf-context-selected",[])):k.length>1&&k.some(C=>C.path===N.path)?(i.items.push(y.refresh),i.items.push(y.archive),i.items.push(y.delete),n.emit("vf-context-selected",k)):(N.type=="dir"?i.items.push(y.open):(i.items.push(y.preview),i.items.push(y.download)),i.items.push(y.rename),N.mime_type=="application/zip"?i.items.push(y.unarchive):i.items.push(y.archive),i.items.push(y.delete),n.emit("vf-context-selected",[N]));b(S,x)}),n.on("vf-contextmenu-hide",()=>{i.active=!1});const b=(S,x)=>{i.active=!0,e.nextTick(()=>{let k=x.getBoundingClientRect(),N=S.pageX,C=S.pageY,A=s.value.offsetHeight,T=s.value.offsetWidth;N=k.right-S.pageX+window.scrollX<T?N-T:N,C=k.bottom-S.pageY+window.scrollY<A?C-A:C,i.positions={left:N+"px",top:C+"px"}})};return(S,x)=>i.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:s,style:e.normalizeStyle(i.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.items,k=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:k.title,onClick:N=>g(k)},[Bi,e.createElementVNode("span",null,e.toDisplayString(k.title()),1)],8,Mi))),128))],4)):e.createCommentVNode("",!0)}}),Ti=(r,t)=>{const n=r[t];return n?typeof n=="function"?n():Promise.resolve(n):new Promise((s,l)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(l.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function Ai(r){const t=await Ti(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>hd),"../locales/fa.json":()=>Promise.resolve().then(()=>ud),"../locales/ru.json":()=>Promise.resolve().then(()=>fd),"../locales/tr.json":()=>Promise.resolve().then(()=>md)}),`../locales/${r}.json`);return JSON.parse(t.default)}function Li(r,t,n){const{getStore:s,setStore:l}=St(r),i=e.ref({}),c=g=>{Ai(g).then(m=>{i.value=m,l("locale",g),l("translations",m),n.emit("vf-toast-push",{label:"The language is set to "+g})}).catch(m=>{n.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),c("en")})};s("locale")?i.value=s("translations"):c(t);const u=(g,...m)=>m.length?u(g=g.replace("%s",m.shift()),...m):g;function y(g,...m){return i.value.hasOwnProperty(g)?u(i.value[g],...m):u(g,...m)}return{t:y,changeLocale:c}}const Ii={class:"vuefinder"},Oi=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),ji=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"},maxFileSize:{type:String,default:"10mb"},postData:{type:Object,default:{}}},setup(r){const t=r,n=Sn(),{setStore:s,getStore:l}=St(t.id),i=e.ref(l("adapter"));e.provide("emitter",n),e.provide("storage",St(t.id)),e.provide("postData",t.postData),e.provide("adapter",i),e.provide("maxFileSize",t.maxFileSize);const c=Li(t.id,t.locale,n);e.provide("i18n",c);const{apiUrl:u,setApiUrl:y}=ue();y(t.url);const g=e.reactive({adapter:i.value,storages:[],dirname:".",files:[]}),m=e.ref(l("viewport","grid")),b=e.ref(l("darkMode",t.dark));n.on("vf-darkMode-toggle",()=>{b.value=!b.value,s("darkMode",b.value)});const S=e.ref(!1);e.provide("loadingState",S);const x=e.ref(l("full-screen",!1));n.on("vf-fullscreen-toggle",()=>{x.value=!x.value,s("full-screen",x.value)}),n.on("vf-view-toggle",A=>{m.value=A});const k=e.reactive({active:!1,type:"delete",data:{}});n.on("vf-modal-close",()=>{k.active=!1}),n.on("vf-modal-show",A=>{k.active=!0,k.type=A.type,k.data=A});const N=A=>{Object.assign(g,A),n.emit("vf-nodes-selected",{}),n.emit("vf-explorer-update")};let C;return n.on("vf-fetch-abort",()=>{C.abort(),S.value=!1}),n.on("vf-fetch",({params:A,onSuccess:T=null,onError:V=null})=>{["index","search"].includes(A.q)&&(C&&C.abort(),S.value=!0),C=new AbortController;const j=C.signal;it(u.value,{params:A,signal:j}).then(I=>{i.value=I.adapter,["index","search"].includes(A.q)&&(S.value=!1),n.emit("vf-modal-close"),N(I),T(I)}).catch(I=>{V&&V(I)}).finally(()=>{})}),n.on("vf-download",A=>{document.getElementById("download_frame").src=A,n.emit("vf-modal-close")}),e.onMounted(()=>{n.emit("vf-fetch",{params:{q:"index",adapter:i.value}})}),(A,T)=>(e.openBlock(),e.createElementBlock("div",Ii,[e.createElementVNode("div",{class:e.normalizeClass(b.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([x.value?"fixed w-screen inset-0 z-20":"relative rounded-md","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(x.value?"":"max-height: "+r.maxHeight),onMousedown:T[0]||(T[0]=V=>e.unref(n).emit("vf-contextmenu-hide")),onTouchstart:T[1]||(T[1]=V=>e.unref(n).emit("vf-contextmenu-hide"))},[e.createVNode(Jn,{data:g},null,8,["data"]),e.createVNode(Vi,{data:g},null,8,["data"]),e.createVNode(Ys,{view:m.value,data:g},null,8,["view","data"]),e.createVNode(ai,{data:g},null,8,["data"])],38),k.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+k.type),{key:0,selection:k.data,current:g},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode($i,{current:g},null,8,["current"]),Oi],2)]))}}),Pi=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 dark:bg-gray-600 dark:bg-opacity-75 bg-opacity-75 transition-opacity"},null,-1),zi={class:"fixed z-10 inset-0 overflow-hidden"},Ri={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl w-full"},Hi={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Fi={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},me={__name:"ModalLayout",setup(r){const t=e.inject("emitter");return e.onMounted(()=>{const n=document.querySelector(".v-f-modal input");n&&n.focus()}),(n,s)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:s[1]||(s[1]=e.withKeys(l=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Pi,e.createElementVNode("div",zi,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:s[0]||(s[0]=e.withModifiers(l=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Ri,[e.createElementVNode("div",Hi,[e.renderSlot(n.$slots,"default")]),e.createElementVNode("div",Fi,[e.renderSlot(n.$slots,"buttons")])])],32)])],32))}},Ui=["aria-label"],Ki=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)],pe=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(r,{emit:t}){var u;const{t:n}=e.inject("i18n"),s=e.ref(!1),l=e.ref(null),i=e.ref((u=l.value)==null?void 0:u.strMessage);e.watch(i,()=>s.value=!1);const c=()=>{t("hidden"),s.value=!0};return(y,g)=>(e.openBlock(),e.createElementBlock("div",null,[s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:l,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",r.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(y.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:c,"aria-label":e.unref(n)("Close"),"data-microtip-position":"top-left",role:"tooltip"},Ki,8,Ui)],2))]))}}),Yi={class:"sm:flex sm:items-start"},Wi=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),Xi={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Zi={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},qi={class:"mt-2"},Gi={class:"text-sm text-gray-500"},Ji={class:"flex text-sm text-gray-800 dark:text-gray-400"},Qi={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"},ea=[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)],ta={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"},ra=[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)],na={class:"ml-1.5"},oa={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},sa=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(r){const t=r,n=e.inject("emitter");e.inject("storage");const s=e.inject("adapter"),{t:l}=e.inject("i18n"),i=e.ref(t.selection.items),c=e.ref(""),u=()=>{i.value.length&&n.emit("vf-fetch",{params:{q:"delete",adapter:s.value,path:t.current.dirname,items:JSON.stringify(i.value.map(({path:y,type:g})=>({path:y,type:g})))},onSuccess:()=>{n.emit("vf-toast-push",{label:l("Files deleted.")})},onError:y=>{c.value=l(y.message)}})};return(y,g)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:g[1]||(g[1]=m=>e.unref(n).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1),e.createElementVNode("div",oa,e.toDisplayString(e.unref(l)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Yi,[Wi,e.createElementVNode("div",Xi,[e.createElementVNode("h3",Zi,e.toDisplayString(e.unref(l)("Delete files")),1),e.createElementVNode("div",qi,[e.createElementVNode("p",Gi,e.toDisplayString(e.unref(l)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,m=>(e.openBlock(),e.createElementBlock("p",Ji,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Qi,ea)):(e.openBlock(),e.createElementBlock("svg",ta,ra)),e.createElementVNode("span",na,e.toDisplayString(m.basename),1)]))),256)),c.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:g[0]||(g[0]=m=>c.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ia={class:"sm:flex sm:items-start"},aa=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),la={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ca={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},da={class:"mt-2"},ha={class:"text-sm text-gray-500"},ua=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(r){const t=e.inject("emitter"),{t:n}=e.inject("i18n");return(s,l)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l[0]||(l[0]=i=>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(n)("Close")),1)]),default:e.withCtx(()=>{var i,c;return[e.createElementVNode("div",ia,[aa,e.createElementVNode("div",la,[e.createElementVNode("h3",ca,e.toDisplayString(((i=r.selection)==null?void 0:i.title)??"Title"),1),e.createElementVNode("div",da,[e.createElementVNode("p",ha,e.toDisplayString(((c=r.selection)==null?void 0:c.message)??"Message")+".",1)])])])]}),_:1}))}}),fa={class:"sm:flex sm:items-start"},ma=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),pa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ga={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ya={class:"mt-2"},ba={class:"text-sm text-gray-500"},va=["onKeyup","placeholder"],Sa=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(r){const t=r,n=e.inject("emitter");e.inject("storage");const s=e.inject("adapter"),{t:l}=e.inject("i18n"),i=e.ref(""),c=e.ref(""),u=()=>{i.value!=""&&n.emit("vf-fetch",{params:{q:"newfolder",adapter:s.value,path:t.current.dirname,name:i.value},onSuccess:()=>{n.emit("vf-toast-push",{label:l("%s is created.",i.value)})},onError:y=>{c.value=l(y.message)}})};return(y,g)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:g[2]||(g[2]=m=>e.unref(n).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",fa,[ma,e.createElementVNode("div",pa,[e.createElementVNode("h3",ga,e.toDisplayString(e.unref(l)("New Folder")),1),e.createElementVNode("div",ya,[e.createElementVNode("p",ba,e.toDisplayString(e.unref(l)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[0]||(g[0]=m=>i.value=m),onKeyup:e.withKeys(u,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(l)("Folder Name"),type:"text"},null,40,va),[[e.vModelText,i.value]]),c.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:g[1]||(g[1]=m=>c.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),_a={class:"sm:flex sm:items-start"},wa=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),ka={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},xa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Da={class:"mt-2"},Ea={class:"text-sm text-gray-500"},Na=["onKeyup","placeholder"],Ca=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(r){const t=r,n=e.inject("emitter");e.inject("storage");const s=e.inject("adapter"),{t:l}=e.inject("i18n"),i=e.ref(""),c=e.ref(""),u=()=>{i.value!=""&&n.emit("vf-fetch",{params:{q:"newfile",adapter:s.value,path:t.current.dirname,name:i.value},onSuccess:()=>{n.emit("vf-toast-push",{label:l("%s is created.",i.value)})},onError:y=>{c.value=l(y.message)}})};return(y,g)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:g[2]||(g[2]=m=>e.unref(n).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",_a,[wa,e.createElementVNode("div",ka,[e.createElementVNode("h3",xa,e.toDisplayString(e.unref(l)("New File")),1),e.createElementVNode("div",Da,[e.createElementVNode("p",Ea,e.toDisplayString(e.unref(l)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[0]||(g[0]=m=>i.value=m),onKeyup:e.withKeys(u,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(l)("File Name"),type:"text"},null,40,Na),[[e.vModelText,i.value]]),c.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:g[1]||(g[1]=m=>c.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Va={class:"flex"},Ma=["aria-label"],Ba={class:"ml-auto mb-2"},$a={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"},Ta={key:1},Aa={__name:"Text",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const n=r,s=e.ref(""),l=e.ref(""),i=e.ref(null),c=e.ref(!1),{apiUrl:u}=ue(),y=e.ref(""),g=e.ref(!1),{t:m}=e.inject("i18n");e.onMounted(()=>{it(u.value,{params:{q:"preview",adapter:n.selection.adapter,path:n.selection.item.path},json:!1}).then(k=>{s.value=k,t("load")})});const b=()=>{c.value=!c.value,l.value=s.value,c.value==!0&&e.nextTick(()=>{i.value.focus()})},S=e.inject("postData"),x=()=>{y.value="",g.value=!1,it(u.value,{method:"POST",params:Object.assign(S,{q:"save",adapter:n.selection.adapter,path:n.selection.item.path,content:l.value}),json:!1}).then(k=>{y.value=m("Updated."),s.value=k,t("load"),c.value=!c.value}).catch(k=>{y.value=m(k.message),g.value=!0})};return(k,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Va,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":r.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(r.selection.item.basename),9,Ma),e.createElementVNode("div",Ba,[c.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:x,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(m)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:N[0]||(N[0]=C=>b())},e.toDisplayString(c.value?e.unref(m)("Cancel"):e.unref(m)("Edit")),1)])]),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",Ta,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:i,"onUpdate:modelValue":N[1]||(N[1]=C=>l.value=C),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] max-h-[60vh] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,l.value]])])):(e.openBlock(),e.createElementBlock("pre",$a,e.toDisplayString(s.value),1)),y.value.length?(e.openBlock(),e.createBlock(pe,{key:2,onHidden:N[2]||(N[2]=C=>y.value=""),error:g.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},Oh="";/*!
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(d,h){var r=typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(!r){if(Array.isArray(d)||(r=W(d))||h&&d&&typeof d.length=="number"){r&&(d=r);var g=0,s=function(){};return{s,n:function(){return g>=d.length?{done:!0}:{done:!1,value:d[g++]}},e:function(x){throw x},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,v=!1,w;return{s:function(){r=r.call(d)},n:function(){var x=r.next();return f=x.done,x},e:function(x){v=!0,w=x},f:function(){try{!f&&r.return!=null&&r.return()}finally{if(v)throw w}}}}function C(d,h){if(typeof d!="object"||d===null)return d;var r=d[Symbol.toPrimitive];if(r!==void 0){var g=r.call(d,h||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}function B(d){var h=C(d,"string");return typeof h=="symbol"?h:String(h)}var V=function(h,r,g){var s=h.x,f=h.y,v=g.x,w=g.y,x={"+":{x:s+v,y:f+w},"-":{x:s-v,y:f-w},"*":{x:s*v,y:f*w},"/":{x:s/v,y:f/w}};return x[r]},Y=function(h){return{x:h.left,y:h.top}},O=function(h){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:h.x,top:h.y,right:h.x,bottom:h.y,width:r,height:r}},ce=function(h){return{x:h,y:h}},ae=function(d,h){var r=h;window.addEventListener("resize",r),window.addEventListener("scroll",r);var g=new MutationObserver(r);d.forEach(function(f,v){g.observe(f,{childList:v!==0,attributes:!0})});var s=function(){return jd(g,r)};return{observer:g,callback:r,cleanup:s}},pt=function(d){var h=bt(d);return h.x||h.y?!0:d instanceof Document?d.body?!!(d.body.scrollTop=1):!!(d.documentElement.scrollTop=1):!!(d.scrollTop=1)},gt=function(){var d=document.createElement("div");return d.style.position="fixed",d.style.overflow="hidden",d.style.pointerEvents="none",d.style.zIndex="999999999999999999",d},Qt=function(d){var h=document.createElement("div");return h.style.position="absolute",d||(h.style.background="rgba(0, 175, 255, 0.2)",h.style.border="1px solid rgba(0, 175, 255, 0.8)",h.style.display="none",h.style.pointerEvents="none"),h},yt=function(d,h){var r;return function(){for(var g=arguments.length,s=new Array(g),f=0;f<g;f++)s[f]=arguments[f];var v=function(){r=null,d.apply(void 0,s)};clearTimeout(r),r=setTimeout(v,h)}},er=function(){var d,h,r,g;return{y:((d=document.body)===null||d===void 0?void 0:d.scrollTop)||((h=document.documentElement)===null||h===void 0?void 0:h.scrollTop)||0,x:((r=document.body)===null||r===void 0?void 0:r.scrollLeft)||((g=document.documentElement)===null||g===void 0?void 0:g.scrollLeft)||0}},vn=function(d){var h=function r(g){var s,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,v=(s=g[f])===null||s===void 0?void 0:s.parentNode;return v?(g.push(v),f++,r(g,f)):g};return h([d])},Nd=function(d,h){if(d instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var r=d.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(d.clientWidth||r.width)*h,height:(d.clientHeight||r.height)*h}},Sn=function(d,h){var r={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return Ne(d).forEach(function(g){var s=h.getRect(g);r.top=Math.min(r.top,s.top),r.left=Math.min(r.left,s.left),r.bottom=Math.max(r.bottom,s.bottom),r.right=Math.max(r.right,s.right)}),r.height=r.bottom-r.top,r.width=r.right-r.left,r},bt=function(d){return!d||d instanceof Document?er():{x:d.scrollLeft>=0?d.scrollLeft:er().x,y:d.scrollTop>=0?d.scrollTop:er().y}},wn=function(d){var h=d.elementRect,r=d.containerRect,g=d.tolerance,s=g===void 0?{x:0,y:0}:g,f=[];return h.top-s.y<r.top&&f.push("top"),h.left-s.x<r.left&&f.push("left"),h.bottom+s.y>r.bottom&&f.push("bottom"),h.right+s.y>r.right&&f.push("right"),f},Cd=function(d){var h=d.event;return{x:h.clientX,y:h.clientY}},Vd=function(d){var h=d.scrollAmount,r=d.initialPointerPos,g=d.pointerPos,s={};return g.x>r.x-h.x?(s.left=r.x-h.x,s.width=g.x-r.x+h.x):(s.left=g.x,s.width=r.x-g.x-h.x),g.y>r.y-h.y?(s.top=r.y-h.y,s.height=g.y-r.y+h.y):(s.top=g.y,s.height=r.y-g.y-h.y),s},_n=function(h){var r={x:0,y:0},g=window.getComputedStyle(h);if(!g.transform||g.transform==="none")return r;if(g.transform.indexOf("3d")>=0){var s=g.transform.trim().match(/matrix3d\((.*?)\)/);if(s&&s.length){var f,v=(f=s[1])===null||f===void 0?void 0:f.split(",");r.x=parseInt(v[12])||0,r.y=parseInt(v[13])||0}return r}var w=g.transform.trim().match(/matrix\((.*?)\)/);if(w&&w.length){var x,A=(x=w[1])===null||x===void 0?void 0:x.split(",");r.x=parseInt(A[4])||0,r.y=parseInt(A[5])||0}return r},Md=function(h){var r=h.style.transform;if(!r||r.indexOf("translate")<0)return _n(h);var g={x:0,y:0},s=r.trim().match(/translate[3dD]*?\(.*?\)/);if(s){var f,v=(f=s[0])===null||f===void 0?void 0:f.split("(");if(v){var w,x=(w=v[1])===null||w===void 0?void 0:w.split(",");g.x=parseInt(x[0])||0,g.y=parseInt(x[1])||0}}return!g.x&&!g.x?_n(h):g},Td=function(h){var r=h.style,g={x:parseInt(r.left)||0,y:parseInt(r.top)||0};if(!g.x&&!g.x){var s=window.getComputedStyle(h);return{x:parseInt(s.left)||0,y:parseInt(s.top)||0}}return g},Bd=function(d,h){return h?Md(d):Td(d)},$d=function(d){var h=d.element,r=d.edges,g=d.elementRect,s=d.containerRect,f=d.elementPos,v=d.useTransform;r.includes("top")&&et(h,{y:f.y+s.top-g.top,x:f.x},v),r.includes("left")&&et(h,{y:f.y,x:f.x+s.left-g.left},v),r.includes("bottom")&&et(h,{y:f.y+s.bottom-g.bottom,x:f.x},v),r.includes("right")&&et(h,{y:f.y,x:f.x+s.right-g.right},v)},kn=function(d){var h=d.computedStyle,r=d.node,g=h.position,s=g==="absolute"||g==="relative"||g==="fixed";!(r instanceof Document)&&!s&&(r.style.position="relative")},Ad=function(d){var h=d.shiftKey,r=d.keyboardDragSpeed,g=d.zoom,s=d.key,f=d.dragKeys,v=d.scrollDiff,w=d.canScroll,x=d.scrollCallback,A={x:0,y:0},z=h?r*4*g:r*g;return f.left.includes(s)&&(A.x=v.x||-z,!h&&!v.x&&w&&x(["left"],r)),f.right.includes(s)&&(A.x=v.x||z,!h&&!v.x&&w&&x(["right"],r)),f.up.includes(s)&&(A.y=v.y||-z,!h&&!v.y&&w&&x(["top"],r)),f.down.includes(s)&&(A.y=v.y||z,!h&&!v.y&&w&&x(["bottom"],r)),A},Id=function(d){var h=d.element,r=d.force,g=d.multiSelectionToggle,s=d.SelectedSet,f=d.hoverClassName;h.classList.contains(f)&&!r||(s.has(h)?g&&s.delete(h):s.add(h),h.classList.add(f))},Ld=function(d){var h=d.element,r=d.force,g=d.SelectedSet,s=d.PrevSelectedSet,f=d.hoverClassName;if(!h.classList.contains(f)&&!r)return!1;var v=g.has(h),w=s.has(h);v&&!w?g.delete(h):!v&&w&&g.add(h),h.classList.remove(f)},Qe=function(h,r,g){return console.warn('[DragSelect] TypeIssue: setting "'.concat(h,'" is not of type "').concat(r,'".'))},P=function(h,r,g,s){if(r===void 0)return g?c({},h,s):{};if(r===null)return c({},h,null);var f=!0,v=!1,w=typeof s=="string";w&&(f=typeof r=="string"||r instanceof String),w&&!f&&(v=!0,Qe(h,"string"));var x=!Number.isNaN(s)&&typeof s=="number";x&&(f=!Number.isNaN(r)&&typeof r=="number"),x&&!f&&(v=!0,Qe(h,"number"));var A=Object.prototype.toString.call(s)==="[object Object]";A&&(f=Object.prototype.toString.call(r)==="[object Object]"),A&&!f&&(v=!0,Qe(h,"object"));var z=typeof s=="boolean";z&&(f=typeof r=="boolean"),z&&!f&&(v=!0,Qe(h,"boolean"));var G=Array.isArray(s);G&&(f=Array.isArray(r)),G&&!f&&(v=!0,Qe(h,"array"));var de=v||g;return h==="dragKeys"&&f?c({},h,Object.assign(s,r)):h==="dragKeys"&&!f?de?c({},h,s):{}:(h==="dropZones"&&f&&new Set(r.map(function(he){return he.id})).size!==r.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),f?c({},h,r):de?c({},h,s):{})},Od=function(d,h){return l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l({},P("area",d.area,h,document)),P("selectables",d.selectables,h,null)),P("autoScrollSpeed",d.autoScrollSpeed,h,5)),P("overflowTolerance",d.overflowTolerance,h,{x:25,y:25})),P("zoom",d.zoom,h,1)),P("customStyles",d.customStyles,h,!1)),P("multiSelectMode",d.multiSelectMode,h,!1)),P("multiSelectToggling",d.multiSelectToggling,h,!0)),P("multiSelectKeys",d.multiSelectKeys,h,["Control","Shift","Meta"])),P("selector",d.selector,h,null)),P("selectionThreshold",d.selectionThreshold,h,0)),P("draggability",d.draggability,h,!0)),P("immediateDrag",d.immediateDrag,h,!0)),P("keyboardDrag",d.keyboardDrag,h,!0)),P("dragKeys",d.dragKeys,h,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),P("keyboardDragSpeed",d.keyboardDragSpeed,h,10)),P("useTransform",d.useTransform,h,!0)),P("refreshMemoryRate",d.refreshMemoryRate,h,80)),P("dropZones",d.dropZones,h,[])),P("dropInsideThreshold",d.dropInsideThreshold,h,1)),P("dropTargetThreshold",d.dropTargetThreshold,h,0)),P("usePointerEvents",d.usePointerEvents,h,!1)),P("hoverClass",d.hoverClass,h,"ds-hover")),P("selectableClass",d.selectableClass,h,"ds-selectable")),P("selectedClass",d.selectedClass,h,"ds-selected")),P("selectorClass",d.selectorClass,h,"ds-selector")),P("selectorAreaClass",d.selectorAreaClass,h,"ds-selector-area")),P("droppedTargetClass",d.droppedTargetClass,h,"ds-dropped-target")),P("droppedInsideClass",d.droppedInsideClass,h,"ds-dropped-inside")),P("droppableClass",d.droppableClass,h,"ds-droppable")),P("dropZoneClass",d.dropZoneClass,h,"ds-dropzone")),P("dropZoneReadyClass",d.dropZoneReadyClass,h,"ds-dropzone-ready")),P("dropZoneTargetClass",d.dropZoneTargetClass,h,"ds-dropzone-target")),P("dropZoneInsideClass",d.dropZoneInsideClass,h,"ds-dropzone-inside")),P("dragAsBlock",d.dragAsBlock,h,!1))},Re=function(d,h){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=d;if(r>0){var s=(d.right-d.left)*r,f=(d.bottom-d.top)*r;g={left:d.left+s,right:d.right-s,top:d.top+f,bottom:d.bottom-f}}return g.left<h.right&&g.right>h.left&&g.top<h.bottom&&g.bottom>h.top},xn=function(d){var h=d.element,r=d.posDirection,g=d.containerRect,s=d.useTransform,f=Bd(h,s),v=V(f,"+",r);et(h,v,s);var w=h.getBoundingClientRect(),x=wn({elementRect:w,containerRect:g});$d({element:h,edges:x,elementRect:w,containerRect:g,elementPos:v,useTransform:s})},jd=function(d,h){window.removeEventListener("resize",h),window.removeEventListener("scroll",h),d.disconnect()},Pd=function(d,h,r){if(h.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=d instanceof Document?g||document.body:d,f=h.includes("top")&&s.scrollTop>0,v=h.includes("bottom")&&s.scrollTop<s.scrollHeight,w=h.includes("left")&&s.scrollLeft>0,x=h.includes("right")&&s.scrollLeft<s.scrollWidth;f&&(s.scrollTop-=1*r),v&&(s.scrollTop+=1*r),w&&(s.scrollLeft-=1*r),x&&(s.scrollLeft+=1*r)}},et=function(d,h,r){if(r){var g=d.style.transform;d.style.transform="translate3d(".concat(h.x,"px,").concat(h.y,"px,1px) ").concat(g.replace(/translate.*?\)/g,""))}else d.style.left="".concat(h.x,"px"),d.style.top="".concat(h.y,"px");return d},zd=function(d){for(var h=d.subscribe,r=d.publish,g=d.Interaction,s=d.SelectedSet,f=d.DropZones,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(G){return G.event}}],"Interaction:end":[{name:"callback",extraData:function(){var G=f.getTarget();return l({},G?{dropTarget:G.toObject()}:{})}}]},w=function(){var G=R(A[x],2),de=G[0],he=G[1];["pre",!1].forEach(function(be){return h(be?"".concat(de,":").concat(be):de,function(Z){return he.forEach(function(oe){return(!oe.condition||oe.condition(Z))&&r(be?"".concat(be).concat(oe.name):oe.name,l(l({items:s.elements,isDragging:g.isDragging},Z),oe.extraData?oe.extraData(Z):{}))})})})},x=0,A=Object.entries(v);x<A.length;x++)w()},Ne=function(d){return d?!Array.isArray(d)&&(d instanceof HTMLElement||d instanceof SVGElement)?[d]:k(new Set(k(d))):[]},Dn=function(d,h){d.style.left="".concat(h.left,"px"),d.style.top="".concat(h.top,"px"),d.style.width="".concat(h.width,"px"),d.style.height="".concat(h.height,"px")},Rd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"DS",void 0),c(this,"_observers",void 0),c(this,"_node",void 0),c(this,"_parentNodes",void 0),c(this,"_computedStyle",void 0),c(this,"_computedBorder",void 0),c(this,"_rect",void 0),c(this,"setArea",function(s){r.reset(),r._node=s,kn({computedStyle:r.computedStyle,node:r._node}),setTimeout(function(){r.DS.PubSub.publish("Area:modified:pre",{item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{item:r})})}),c(this,"start",function(){r._observers=ae(r.parentNodes,yt(function(s){r.DS.PubSub.publish("Area:modified:pre",{event:s,item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{event:s,item:r})},60))}),c(this,"reset",function(){r._computedStyle=void 0,r._rect=void 0,r._computedBorder=void 0,r._parentNodes=void 0}),c(this,"stop",function(){r._observers.cleanup(),r.reset()}),c(this,"scroll",function(s,f){var v={scroll_directions:s,scroll_multiplier:f};r.DS.PubSub.publish("Area:scroll:pre",v),Pd(r._node,s,f),r.DS.PubSub.publish("Area:scroll",v)}),this.DS=g,this.setArea(this.DS.stores.SettingsStore.s.area),this.DS.PubSub.subscribe("Settings:updated:area",function(s){var f=s.settings;r.setArea(f.area)}),this.DS.PubSub.subscribe("Interaction:init",this.start),this.DS.PubSub.subscribe("Interaction:end",this.reset)}return p(d,[{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 Document?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=Nd(this.HTMLNode,this.DS.stores.SettingsStore.s.zoom)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=vn(this.HTMLNode)}}]),d}(),Hd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_prevCursorPos",void 0),c(this,"_prevScrollPos",void 0),c(this,"_elements",[]),c(this,"_dragKeys",void 0),c(this,"_dragKeysFlat",[]),c(this,"_selectionRect",void 0),c(this,"assignDragkeys",function(){r._dragKeys={up:r.DS.stores.SettingsStore.s.dragKeys.up.map(function(s){return s.toLowerCase()}),down:r.DS.stores.SettingsStore.s.dragKeys.down.map(function(s){return s.toLowerCase()}),left:r.DS.stores.SettingsStore.s.dragKeys.left.map(function(s){return s.toLowerCase()}),right:r.DS.stores.SettingsStore.s.dragKeys.right.map(function(s){return s.toLowerCase()})},r._dragKeysFlat=[].concat(k(r._dragKeys.up),k(r._dragKeys.down),k(r._dragKeys.left),k(r._dragKeys.right))}),c(this,"keyboardDrag",function(s){var f=s.event,v=s.key,w=v.toLowerCase();if(!(!r.DS.stores.SettingsStore.s.keyboardDrag||!r._dragKeysFlat.includes(w)||!r.DS.SelectedSet.size||!r.DS.stores.SettingsStore.s.draggability||r.DS.continue)){var x={event:f,isDragging:!0,isDraggingKeyboard:!0};r.DS.publish(["Interaction:start:pre","Interaction:start"],x),r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=Sn(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0);var A=Ad({shiftKey:r.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:r.DS.stores.SettingsStore.s.keyboardDragSpeed,zoom:r.DS.stores.SettingsStore.s.zoom,key:w,scrollCallback:r.DS.Area.scroll,scrollDiff:r._scrollDiff,canScroll:r.DS.stores.ScrollStore.canScroll,dragKeys:r._dragKeys});r.DS.stores.SettingsStore.s.dragAsBlock&&(A=r.limitDirection(A)),r._elements.forEach(function(z){return xn({element:z,posDirection:A,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})}),r.DS.publish(["Interaction:update:pre","Interaction:update"],x)}}),c(this,"keyboardEnd",function(s){var f=s.event,v=s.key,w=v.toLowerCase();if(!(!r.DS.stores.SettingsStore.s.keyboardDrag||!r._dragKeysFlat.includes(w)||!r.DS.SelectedSet.size||!r.DS.stores.SettingsStore.s.draggability)){var x={event:f,isDragging:r.DS.stores.SettingsStore.s.draggability,isDraggingKeyboard:!0};r.DS.publish(["Interaction:end:pre","Interaction:end"],x)}}),c(this,"start",function(s){var f=s.isDragging,v=s.isDraggingKeyboard;!f||v||(r._prevCursorPos=null,r._prevScrollPos=null,r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=Sn(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0))}),c(this,"stop",function(s){s!=null&&s.isKeyboard||(r._prevCursorPos=null,r._prevScrollPos=null,r.handleZIndex(!1),r._elements=[])}),c(this,"update",function(s){var f=s.isDragging,v=s.isDraggingKeyboard;if(!(!f||!r._elements.length||v||r.DS.continue)){var w=V(r._cursorDiff,"+",r._scrollDiff);r.DS.stores.SettingsStore.s.dragAsBlock&&(w=r.limitDirection(w)),r._elements.forEach(function(x){return xn({element:x,posDirection:w,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})})}}),c(this,"limitDirection",function(s){var f=r.DS.SelectorArea.rect,v=r.DS.stores.ScrollStore.scrollAmount,w={top:f.top-r._selectionRect.top+v.y,left:f.left-r._selectionRect.left+v.x,bottom:f.bottom-r._selectionRect.bottom+v.y,right:f.right-r._selectionRect.right+v.x};return s.x===0&&s.y===0||(s.y<0&&(s.y=Math.max(s.y,w.top)),s.x<0&&(s.x=Math.max(s.x,w.left)),s.y>0&&(s.y=Math.min(s.y,w.bottom)),s.x>0&&(s.x=Math.min(s.x,w.right)),r._selectionRect.top+=s.y,r._selectionRect.bottom+=s.y,r._selectionRect.left+=s.x,r._selectionRect.right+=s.x),s}),c(this,"handleZIndex",function(s){r._elements.forEach(function(f){return f.style.zIndex="".concat((parseInt(f.style.zIndex)||0)+s?9999:-9998)})}),this.DS=g,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return p(d,[{key:"_cursorDiff",get:function(){var r=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?V(r,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=r,g}},{key:"_scrollDiff",get:function(){var r=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?V(r,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=r,g}}]),d}(),Fd=function(){function d(h){var r=this,g=h.DS,s=h.id,f=h.element,v=h.droppables;a(this,d),c(this,"id",void 0),c(this,"element",void 0),c(this,"_droppables",void 0),c(this,"_rect",void 0),c(this,"_observers",void 0),c(this,"_timeout",void 0),c(this,"_itemsDropped",[]),c(this,"_itemsInside",void 0),c(this,"setReadyClasses",function(w){if(!r.isDestroyed){var x=r.droppables.filter(function(A){return r.DS.SelectedSet.has(A)});x.length&&(x.forEach(function(A){A.classList[w]("".concat(r.Settings.droppableClass)),A.classList[w]("".concat(r.Settings.droppableClass,"-").concat(r.id))}),r.element.classList[w]("".concat(r.Settings.dropZoneReadyClass)))}}),c(this,"handleNoDrop",function(){var w;r.isDestroyed||(r.DS.SelectedSet.forEach(function(x){x.classList.remove(r.Settings.droppedTargetClass),x.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),r._itemsDropped=r._itemsDropped.filter(function(x){return!r.DS.SelectedSet.has(x)}),(w=r._itemsDropped)!==null&&w!==void 0&&w.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleDrop",function(){var w,x,A;r.isDestroyed||(r._itemsDropped=k(new Set([].concat(k(r._itemsDropped),k((w=r.droppables)===null||w===void 0?void 0:w.filter(function(z){return r.DS.SelectedSet.has(z)}))))),(x=r._itemsDropped)===null||x===void 0||x.forEach(function(z){z.classList.add("".concat(r.Settings.droppedTargetClass)),z.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),(A=r._itemsDropped)!==null&&A!==void 0&&A.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleItemsInsideClasses",function(){var w=!1;r.droppables.forEach(function(x){r.itemsInside.includes(x)?(x.classList.add("".concat(r.Settings.droppedInsideClass)),x.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),w=!0):(x.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),x.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||x.classList.remove("".concat(r.Settings.droppedInsideClass)))}),w?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))}),c(this,"start",function(w){var x=w.isDragging;!x||r.isDestroyed||r.setReadyClasses("add")}),c(this,"stop",function(w){var x=w.isDragging;!x||r.isDestroyed||(r.setReadyClasses("remove"),r.handleItemsInsideClasses())}),c(this,"toObject",function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.id=s,this.element=f,v&&(this.droppables=Ne(v)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",function(w){var x=w.settings;r.element&&(r.element.classList.remove(x["dropZoneClass:pre"]),r.element.classList.add(x.dropZoneClass))}),this._observers=ae(this.parentNodes,yt(function(){return r._rect=null},this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return p(d,[{key:"destroy",value:function(){var r=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach(function(g){g.classList.remove("".concat(r.Settings.droppedTargetClass)),g.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id)),g.classList.remove("".concat(r.Settings.droppableClass)),g.classList.remove("".concat(r.Settings.droppableClass,"-").concat(r.id))}),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var r=this;return this.isDestroyed?null:this._itemsInside?this._itemsInside:(this._itemsInside=this.droppables.flatMap(function(g){return Re(r.DS.SelectableSet.rects.get(g),r.rect,r.Settings.dropInsideThreshold)?[g]:[]}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return r._itemsInside=null},this.Settings.refreshMemoryRate),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=vn(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(r){this._droppables=r}}]),d}(),Ud=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"_zoneByElement",new Map),c(this,"_zoneById",new Map),c(this,"_zonesByDroppable",new Map),c(this,"_zones",void 0),c(this,"setDropZones",function(s){var f=s.dropZones;f&&(r._zones&&r._zones.forEach(function(v){return v.destroy()}),r._zones=f.map(function(v){return new Fd(l({DS:r.DS},v))}),r._zones.forEach(function(v){r._zoneByElement.set(v.element,v),r._zoneById.set(v.id,v),v.droppables.forEach(function(w){var x=r._zonesByDroppable.get(w);if(!(x!=null&&x.length))return r._zonesByDroppable.set(w,[v]);r._zonesByDroppable.set(w,k(new Set([].concat(k(x),[v]))))})}))}),c(this,"_handleDrop",function(s){r._zones.forEach(function(f){f!==s&&f.handleNoDrop()}),s&&s.handleDrop()}),c(this,"_getZoneByElementsFromPoint",function(s,f){for(var v=f.x,w=f.y,x=0,A=s.length;x<A;x++){var z=r._zoneByElement.get(s[x]);if(z&&Re(z.rect,{left:v,right:v,top:w,bottom:w},Math.min(r.Settings.dropTargetThreshold,.5)))return z}}),c(this,"stop",function(s){var f=s.isDragging;if(f){var v=r.getTarget();r._handleDrop(v)}}),c(this,"getItemsDroppedById",function(s){var f=r._zoneById.get(s);return f?f.itemsDropped:console.warn("[DragSelect] No zone found (id: ".concat(s,")"))}),c(this,"getItemsInsideById",function(s,f){var v=r._zoneById.get(s);if(!v)return console.warn("[DragSelect] No zone found (id: ".concat(s,")"));var w=v.itemsInside;return f&&v.handleItemsInsideClasses(),w}),c(this,"getTarget",function(s){var f;if((f=r._zones)!==null&&f!==void 0&&f.length){var v=(s==null?void 0:s.x)||r.DS.stores.PointerStore.currentVal.x,w=(s==null?void 0:s.y)||r.DS.stores.PointerStore.currentVal.y,x=document.elementsFromPoint(v,w);return r._getZoneByElementsFromPoint(x,{x:v,y:w})}}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:dropZones",function(s){var f=s.settings;return r.setDropZones(f)}),this.setDropZones({dropZones:this.DS.stores.SettingsStore.s.dropZones}),this.DS.subscribe("Interaction:end",this.stop)}),Yd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"isInteracting",void 0),c(this,"isDragging",void 0),c(this,"init",function(){return r.DS.publish("Interaction:init:pre",{})}),c(this,"_init",function(){r.stop(),r.Settings.usePointerEvents?r.DS.Area.HTMLNode.addEventListener("pointerdown",r.start,{passive:!1}):r.DS.Area.HTMLNode.addEventListener("mousedown",r.start),r.DS.Area.HTMLNode.addEventListener("touchstart",r.start,{passive:!1}),r.DS.publish("Interaction:init",{})}),c(this,"start",function(s){return r.DS.publish("Interaction:start:pre",{event:s,isDragging:r.isDragging})}),c(this,"_start",function(s){s.type==="touchstart"&&s.preventDefault(),r._canInteract(s)&&(r.isInteracting=!0,r.isDragging=r.isDragEvent(s),r.DS.publish("Interaction:start",{event:s,isDragging:r.isDragging}),r.Settings.usePointerEvents?(document.addEventListener("pointerup",r.reset),document.addEventListener("pointercancel",r.reset)):document.addEventListener("mouseup",r.reset),document.addEventListener("touchend",r.reset))}),c(this,"isDragEvent",function(s){var f=s.target.closest(".".concat(r.Settings.selectableClass));return!r.Settings.draggability||r.DS.stores.KeyStore.isMultiSelectKeyPressed(s)||!f?!1:(r.Settings.immediateDrag&&(r.DS.SelectedSet.size?r.DS.SelectedSet.has(f)||(r.DS.SelectedSet.clear(),r.DS.SelectedSet.add(f)):r.DS.SelectedSet.add(f)),!!r.DS.SelectedSet.has(f))}),c(this,"onClick",function(s){var f=s.event;if(r._canInteract(f)&&!(f.detail>0)){var v=r.DS,w=v.stores,x=w.PointerStore,A=w.KeyStore,z=v.SelectableSet,G=v.SelectedSet;x.start(f);var de=f.target;z.has(de)&&(A.isMultiSelectKeyPressed(f)||G.clear(),G.toggle(de),r.reset())}}),c(this,"stop",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(s.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(s.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),s.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)}),c(this,"update",function(s){var f=s.event,v=s.scroll_directions,w=s.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:f,scroll_directions:v,scroll_multiplier:w,isDragging:r.isDragging})}),c(this,"reset",function(s){return r.DS.publish("Interaction:end:pre",{event:s,isDragging:r.isDragging})}),c(this,"_reset",function(s){var f=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:s,isDragging:f})}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",function(s){var f=s.settings;r.stop(f["area:pre"]),r.init()}),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:start:pre",function(s){var f=s.event;return r._start(f)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(s){var f=s.event;return r._reset(f)}),this.DS.subscribe("Area:scroll",this.update)}return p(d,[{key:"_canInteract",value:function(r){var g=r.clientX===0&&r.clientY===0&&r.detail===0&&r.target;return!(r.button===2||this.isInteracting||r.target&&!this.DS.SelectorArea.isInside(r.target)||!g&&!this.DS.SelectorArea.isClicked(r))}}]),d}(),Kd=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"subscribers",{}),c(this,"subscribe",function(s,f){return Array.isArray(r.subscribers[s])||(r.subscribers[s]=[]),r.subscribers[s].push(f),r.subscribers[s].length-1}),c(this,"unsubscribe",function(s,f,v){v>=0?r.subscribers[s].splice(v,1):f&&(r.subscribers[s]=r.subscribers[s].filter(function(w){return w!==f}))}),c(this,"publish",function(s,f){Array.isArray(s)?s.forEach(function(v){return r._publish(v,f)}):r._publish(s,f)}),c(this,"_publish",function(s,f){var v=r.subscribers[s];Array.isArray(v)&&(s.includes(":pre")?r._handlePrePublish(v,f):r._handlePublish(v,f))}),c(this,"_handlePublish",function(s,f){for(var v=0,w=s.length;v<w;v++){if(r.DS.stopped)return;s[v](f)}}),c(this,"_handlePrePublish",function(s,f){for(var v=s.length;v--;){if(r.DS.stopped)return;s[v](f)}}),this.DS=g}),Wd=function(d){y(r,d);var h=$(r);function r(g){var s,f=g.DS;return a(this,r),s=h.call(this),c(D(s),"_rects",void 0),c(D(s),"_timeout",void 0),c(D(s),"init",function(){return Ne(s.Settings.selectables).forEach(function(v){return s.add(v)})}),c(D(s),"clear",function(){return s.forEach(function(v){return s.delete(v)})}),c(D(s),"_onClick",function(v){return s.DS.publish(["Selectable:click:pre","Selectable:click"],{event:v})}),c(D(s),"_onPointer",function(v){return s.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:v})}),c(D(s),"addAll",function(v){return v.forEach(function(w){return s.add(w)})}),c(D(s),"deleteAll",function(v){return v.forEach(function(w){return s.delete(w)})}),c(D(s),"getRect",function(v){return s._rects?s.rects.get(v):v.getBoundingClientRect()}),s.DS=f,s.Settings=f.stores.SettingsStore.s,s.DS.subscribe("Interaction:init",s.init),s.DS.PubSub.subscribe("Settings:updated:selectables",function(){s.clear(),s.init()}),s.DS.subscribe("Settings:updated:selectableClass",function(v){var w=v.settings;s.forEach(function(x){x.classList.remove(w["selectableClass:pre"]),x.classList.add(w.selectableClass)})}),s}return p(r,[{key:"add",value:function(s){if(I(m(r.prototype),"has",this).call(this,s))return this;var f={items:this.elements,item:s};return this.DS.publish("Selectable:added:pre",f),s.classList.add(this.Settings.selectableClass),s.addEventListener("click",this._onClick),this.Settings.usePointerEvents?s.addEventListener("pointerdown",this._onPointer,{passive:!1}):s.addEventListener("mousedown",this._onPointer),s.addEventListener("touchstart",this._onPointer,{passive:!1}),this.Settings.draggability&&!this.Settings.useTransform&&kn({computedStyle:window.getComputedStyle(s),node:s}),I(m(r.prototype),"add",this).call(this,s),this.DS.publish("Selectable:added",f),this}},{key:"delete",value:function(s){if(!I(m(r.prototype),"has",this).call(this,s))return!0;var f={items:this.elements,item:s};return this.DS.publish("Selectable:removed:pre",f),s.classList.remove(this.Settings.selectableClass),s.classList.remove(this.Settings.hoverClass),s.removeEventListener("click",this._onClick),this.Settings.usePointerEvents?s.removeEventListener("pointerdown",this._onPointer,{passive:!1}):s.removeEventListener("mousedown",this._onPointer),s.removeEventListener("touchstart",this._onPointer,{passive:!1}),I(m(r.prototype),"delete",this).call(this,s),this.DS.publish("Selectable:removed",f),!0}},{key:"elements",get:function(){return Array.from(this.values())}},{key:"rects",get:function(){var s=this;return this._rects?this._rects:(this._rects=new Map,this.forEach(function(f){return s._rects.set(f,f.getBoundingClientRect())}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return s._rects=null},this.Settings.refreshMemoryRate),this._rects)}}]),r}(N(Set)),Xd=function(d){y(r,d);var h=$(r);function r(g){var s,f=g.DS;return a(this,r),s=h.call(this),c(D(s),"clear",function(){return s.forEach(function(v){return s.delete(v)})}),c(D(s),"addAll",function(v){return v.forEach(function(w){return s.add(w)})}),c(D(s),"deleteAll",function(v){return v.forEach(function(w){return s.delete(w)})}),s.DS=f,s}return p(r,[{key:"add",value:function(s){if(I(m(r.prototype),"has",this).call(this,s))return this;var f={items:this.elements,item:s};return this.DS.publish("Selected:added:pre",f),I(m(r.prototype),"add",this).call(this,s),s.classList.add(this.DS.stores.SettingsStore.s.selectedClass),s.style.zIndex="".concat((parseInt(s.style.zIndex)||0)+1),this.DS.publish("Selected:added",f),this}},{key:"delete",value:function(s){if(!I(m(r.prototype),"has",this).call(this,s))return!0;var f={items:this.elements,item:s};this.DS.publish("Selected:removed:pre",f);var v=I(m(r.prototype),"delete",this).call(this,s);return s.classList.remove(this.DS.stores.SettingsStore.s.selectedClass),s.style.zIndex="".concat((parseInt(s.style.zIndex)||0)-1),this.DS.publish("Selected:removed",f),v}},{key:"toggle",value:function(s){return this.has(s)?this.delete(s):this.add(s),s}},{key:"elements",get:function(){return Array.from(this.values())}}]),r}(N(Set)),Zd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_prevSelectedSet",void 0),c(this,"start",function(s){var f=s.event,v=s.isDragging;v||(r._storePrevious(f),r._handleInsideSelection(!0,f))}),c(this,"update",function(s){var f=s.isDragging;f||r.DS.continue||r._handleInsideSelection()}),c(this,"_handleInsideSelection",function(s,f){var v=r.DS,w=v.SelectableSet,x=v.SelectorArea,A=v.Selector,z=r.DS.stores.KeyStore.isMultiSelectKeyPressed(f)&&r.Settings.multiSelectToggling,G=r.Settings.selectionThreshold,de=w.rects,he=A.rect,be=new Map,Z=new Map,oe=re(de),tt;try{for(oe.s();!(tt=oe.n()).done;){var vt=R(tt.value,2),rt=vt[0],St=vt[1];x.isInside(rt,St)&&(Re(St,he,G)?be.set(rt,St):Z.set(rt,St))}}catch(tr){oe.e(tr)}finally{oe.f()}if(!r.DS.continue){var Nn=r.filterSelected({select:be,unselect:Z,selectorRect:he}),rh=Nn.select,nh=Nn.unselect;rh.forEach(function(tr,rr){return Id({element:rr,force:s,multiSelectionToggle:z,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass})}),nh.forEach(function(tr,rr){return Ld({element:rr,force:s,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass,PrevSelectedSet:r._prevSelectedSet})})}}),c(this,"filterSelected",function(s){var f=s.select,v=s.unselect;return s.selectorRect,{select:f,unselect:v}}),this.DS=g,this.Settings=this.DS.stores.SettingsStore.s,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return p(d,[{key:"_storePrevious",value:function(r){var g=this.DS,s=g.stores.KeyStore,f=g.SelectedSet;s.isMultiSelectKeyPressed(r)?this._prevSelectedSet=new Set(f):this._prevSelectedSet=new Set}}]),d}(),qd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_rect",void 0),c(this,"attachSelector",function(){var s,f;r.HTMLNode&&(s=r.DS.SelectorArea)!==null&&s!==void 0&&s.HTMLNode&&r.DS.SelectorArea.HTMLNode.removeChild(r.HTMLNode),r.HTMLNode=r.DS.stores.SettingsStore.s.selector||Qt(r.DS.stores.SettingsStore.s.customStyles),r.HTMLNode.classList.add(r.DS.stores.SettingsStore.s.selectorClass),r.HTMLNode&&(f=r.DS.SelectorArea)!==null&&f!==void 0&&f.HTMLNode&&r.DS.SelectorArea.HTMLNode.appendChild(r.HTMLNode)}),c(this,"start",function(s){var f=s.isDragging;if(!f){var v=r.DS.stores.PointerStore,w=v.initialValArea;Dn(r.HTMLNode,O(w,1)),r.HTMLNode.style.display="block",r._rect=null}}),c(this,"stop",function(){r.HTMLNode.style.width="0",r.HTMLNode.style.height="0",r.HTMLNode.style.display="none"}),c(this,"update",function(s){var f=s.isDragging;if(!(f||r.DS.continue)){var v=r.DS.stores,w=v.ScrollStore,x=v.PointerStore,A=Vd({scrollAmount:w.scrollAmount,initialPointerPos:x.initialValArea,pointerPos:x.currentValArea});Dn(r.HTMLNode,A),r._rect=null}}),this.DS=g,this.DS.subscribe("Settings:updated:selectorClass",function(s){var f=s.settings;r.HTMLNode.classList.remove(f["selectorClass:pre"]),r.HTMLNode.classList.add(f.selectorClass)}),this.DS.subscribe("Settings:updated:selector",this.attachSelector),this.DS.subscribe("Settings:updated:customStyles",this.attachSelector),this.attachSelector(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return p(d,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),d}(),Gd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_scrollInterval",void 0),c(this,"_rect",void 0),c(this,"currentEdges",[]),c(this,"start",function(){r.applyElements("append"),r.updatePos()}),c(this,"applyElements",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",f=document.body?"body":"documentElement",v="".concat(s,"Child");r.HTMLNode[v](r.DS.Selector.HTMLNode),document[f][v](r.HTMLNode)}),c(this,"updatePos",function(){r._rect=null;var s=r.DS.Area.rect,f=r.DS.Area.computedBorder,v=r.HTMLNode.style,w="".concat(s.top+f.top,"px"),x="".concat(s.left+f.left,"px"),A="".concat(s.width,"px"),z="".concat(s.height,"px");v.top!==w&&(v.top=w),v.left!==x&&(v.left=x),v.width!==A&&(v.width=A),v.height!==z&&(v.height=z)}),c(this,"stop",function(s){r.stopAutoScroll(),s&&r.applyElements("remove")}),c(this,"startAutoScroll",function(){r.currentEdges=[],r._scrollInterval=setInterval(function(){return r.handleAutoScroll()},16)}),c(this,"handleAutoScroll",function(){if(!r.DS.continue){var s=r.DS,f=s.stores.PointerStore,v=s.Area;r.currentEdges=wn({elementRect:O(f.currentVal),containerRect:r.rect,tolerance:r.DS.stores.SettingsStore.s.overflowTolerance}),r.currentEdges.length&&v.scroll(r.currentEdges,r.DS.stores.SettingsStore.s.autoScrollSpeed)}}),c(this,"stopAutoScroll",function(){r.currentEdges=[],clearInterval(r._scrollInterval)}),c(this,"isInside",function(s,f){return r.DS.Area.HTMLNode.contains(s)&&r.DS.stores.ScrollStore.canScroll?!0:Re(r.rect,f||s.getBoundingClientRect())}),this.DS=g,this.HTMLNode=gt(),this.DS.subscribe("Settings:updated:selectorAreaClass",function(s){var f=s.settings;r.HTMLNode.classList.remove(f["selectorAreaClass:pre"]),r.HTMLNode.classList.add(f.selectorAreaClass)}),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){r.updatePos(),r.stopAutoScroll()})}return p(d,[{key:"isClicked",value:function(r){var g=this.DS.stores.PointerStore,s=r?g.getPointerPosition(r):g.initialVal;return Re({left:s.x,top:s.y,right:s.x,bottom:s.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),d}(),Jd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_currentValues",new Set),c(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),c(this,"init",function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)}),c(this,"keydown",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:s,key:f}),r._currentValues.add(f),r.DS.publish("KeyStore:down",{event:s,key:f})}),c(this,"keyup",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:s,key:f}),r._currentValues.delete(f),r.DS.publish("KeyStore:up",{event:s,key:f})}),c(this,"stop",function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()}),c(this,"reset",function(){return r._currentValues.clear()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init)}return p(d,[{key:"isMultiSelectKeyPressed",value:function(r){var g=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var s=this.DS.stores.SettingsStore.s.multiSelectKeys.map(function(f){return f.toLocaleLowerCase()});return!!(this.currentValues.some(function(f){return s.includes(f.toLocaleLowerCase())})||r&&s.some(function(f){return r[g._keyMapping[f]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),d}(),Qd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_isMouseInteraction",!1),c(this,"_initialValArea",void 0),c(this,"_currentValArea",void 0),c(this,"_lastValArea",void 0),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_lastVal",void 0),c(this,"_lastTouch",void 0),c(this,"init",function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})}),c(this,"getPointerPosition",function(s){return Cd({event:r._normalizedEvent(s)})}),c(this,"update",function(s){s&&(r.DS.publish("PointerStore:updated:pre",{event:s}),r.currentVal=r.getPointerPosition(s),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:s}))}),c(this,"stop",function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout(function(){return r._isMouseInteraction=!1},100)}),c(this,"reset",function(s){s&&(r.currentVal=r.lastVal=r.getPointerPosition(s),r.stop(),r.init())}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:end",function(s){var f=s.event;return r.reset(f)})}return p(d,[{key:"start",value:function(r){r&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(r))}},{key:"_normalizedEvent",value:function(r){return"touches"in r&&r.type!=="touchend"&&(this._lastTouch=r),"touches"in r?this._lastTouch.touches[0]:r}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(r){this._initialVal=r,this._initialValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(r){this._currentVal=r,this._currentValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(r){this._lastVal=r,this._lastValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}}]),d}(),eh=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_canScroll",void 0),c(this,"init",function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"start",function(){r._currentVal=r._initialVal=bt(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"update",function(){return r._currentVal=bt(r.DS.stores.SettingsStore.s.area)}),c(this,"stop",function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null}),c(this,"reset",function(){r.stop(),r.start()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return r.start()}),this.DS.subscribe("Interaction:end",function(){return r.reset()})}return p(d,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=pt(this.DS.stores.SettingsStore.s.area)}},{key:"scrollAmount",get:function(){var r=V(this.currentVal,"-",this.initialVal),g=ce(this.DS.stores.SettingsStore.s.zoom),s=V(V(r,"*",g),"-",r);return{x:r.x+s.x,y:r.y+s.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=bt(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),d}(),th=p(function d(h){var r=this,g=h.DS,s=h.settings;a(this,d),c(this,"_settings",{}),c(this,"s",{}),c(this,"update",function(f){var v=f.settings,w=f.init;return r.DS.publish("Settings:updated:pre",l({settings:v},w?{init:w}:{}))}),c(this,"_update",function(f){for(var v=f.settings,w=f.init,x=Od(v,w),A=function(){var he,be=R(G[z],2),Z=be[0],oe=be[1];Z in r._settings||Object.defineProperty(r.s,Z,{get:function(){return r._settings[Z]},set:function(rt){return r.update({settings:c({},Z,rt)})}}),r._settings["".concat(Z,":pre")]=r._settings[Z],r._settings[Z]=oe;var tt={settings:(he={},c(he,Z,r._settings[Z]),c(he,"".concat(Z,":pre"),r._settings["".concat(Z,":pre")]),he)};r.DS.publish("Settings:updated",tt),r.DS.publish("Settings:updated:".concat(Z),tt)},z=0,G=Object.entries(x);z<G.length;z++)A()}),this.DS=g,this.DS.subscribe("Settings:updated:pre",this._update),this.update({settings:s,init:!0})}),En=function(){function d(h){var r=this;a(this,d),c(this,"continue",!1),c(this,"start",function(){r.stopped=!1,r.Interaction.init()}),c(this,"break",function(){return r.continue=!0}),c(this,"setSettings",function(g){return r.stores.SettingsStore.update({settings:g})}),c(this,"getSelection",function(){return r.SelectedSet.elements}),c(this,"getSelectables",function(){return r.SelectableSet.elements}),c(this,"getInitialCursorPosition",function(){return r.stores.PointerStore.initialVal}),c(this,"getCurrentCursorPosition",function(){return r.stores.PointerStore.currentVal}),c(this,"getPreviousCursorPosition",function(){return r.stores.PointerStore.lastVal}),c(this,"getInitialCursorPositionArea",function(){return r.stores.PointerStore.initialValArea}),c(this,"getCurrentCursorPositionArea",function(){return r.stores.PointerStore.currentValArea}),c(this,"getPreviousCursorPositionArea",function(){return r.stores.PointerStore.lastValArea}),c(this,"isMultiSelect",function(g){return r.stores.KeyStore.isMultiSelectKeyPressed(g)}),c(this,"isDragging",function(){return r.Interaction.isDragging}),c(this,"getZoneByCoordinates",function(g){var s;return(s=r.DropZones.getTarget(g))===null||s===void 0?void 0:s.toObject()}),c(this,"getItemsDroppedByZoneId",function(g){return r.DropZones.getItemsDroppedById(g)}),c(this,"getItemsInsideByZoneId",function(g,s){return r.DropZones.getItemsInsideById(g,s)}),this.PubSub=new Kd({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this.stores={},this.stores.SettingsStore=new th({DS:this,settings:h}),this.stores.PointerStore=new Qd({DS:this}),this.stores.ScrollStore=new eh({DS:this}),this.stores.KeyStore=new Jd({DS:this}),this.Area=new Rd({DS:this}),this.Selector=new qd({DS:this}),this.SelectorArea=new Gd({DS:this}),this.SelectableSet=new Wd({DS:this}),this.SelectedSet=new Xd({DS:this}),this.Selection=new Zd({DS:this}),this.Drag=new Hd({DS:this}),this.DropZones=new Ud({DS:this}),this.Interaction=new Yd({DS:this}),zd({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction,DropZones:this.DropZones}),this.subscribe("Interaction:end",function(){return r.continue=!1}),this.start()}return p(d,[{key:"stop",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(r),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),r&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ne(r)),s||this.addSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ne(r)),s&&this.removeSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(r){var g=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ne(r).forEach(function(v){return g.SelectedSet.has(v)?g.removeSelection(r,s,f):g.addSelection(r,s,f)}),s&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(r,g,s),this.getSelection()}},{key:"clearSelection",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),r&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(r,g,s){var f=Ne(r);return this.SelectableSet.addAll(f),g&&this.SelectedSet.addAll(f),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}},{key:"setSelectables",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(r,g),this.addSelectables(r,s)}},{key:"removeSelectables",value:function(r,g,s){return this.SelectableSet.deleteAll(Ne(r)),g&&this.removeSelection(r),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}}]),d}();return En.isCollision=Re,En})})(or);var co=or.exports;const ho=lo(co),ir=(n,t,o,i,l)=>(t=Math,o=t.log,i=1024,l=o(n)/o(i)|0,n/t.pow(i,l)).toFixed(0)+" "+(l?"KMGTPEZY"[--l]+"iB":"B"),sr=(n,t=null)=>new Date(n*1e3).toLocaleString(t??navigator.language??"en-US"),uo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},fo=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)],mo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},po=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1)],it=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(n){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[n.direction=="down"?(e.openBlock(),e.createElementBlock("svg",uo,fo)):e.createCommentVNode("",!0),n.direction=="up"?(e.openBlock(),e.createElementBlock("svg",mo,po)):e.createCommentVNode("",!0)]))}}),go=["onClick"],yo=Object.assign({name:"VFToast.vue"},{setup(n){const t=e.inject("emitter"),{getStore:o}=e.inject("storage"),i=e.ref(o("full-screen",!1)),l=c=>c=="error"?"text-red-400 border-red-400 dark:text-red-300 dark:border-red-300":"text-lime-600 border-lime-600 dark:text-lime-300 dark:border-lime-1300",a=e.ref([]),u=c=>{a.value.splice(c,1)},p=c=>{let y=a.value.findIndex(m=>m.id===c);y!==-1&&u(y)};return t.on("vf-toast-clear",()=>{a.value=[]}),t.on("vf-toast-push",c=>{let y=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");c.id=y,a.value.push(c),setTimeout(()=>{p(y)},5e3)}),(c,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([i.value.value?"fixed":"absolute","bottom-0 max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(m,b)=>(e.openBlock(),e.createElementBlock("div",{onClick:S=>u(b),key:m,class:e.normalizeClass([l(m.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 dark:bg-gray-600 border text-xs sm:text-sm rounded cursor-pointer"])},e.toDisplayString(m.label),11,go))),128))]),_:1})],2))}}),Ce=n=>Object.entries(n).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:bo}=ue(),_t=(n,t)=>bo.value+"?"+Ce({q:"preview",adapter:n,path:t}),we=typeof window<"u",ar=we&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),lr=we&&"IntersectionObserver"in window,cr=we&&"classList"in document.createElement("p"),dr=we&&window.devicePixelRatio>1,vo={elements_selector:".lazy",container:ar||we?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},hr=n=>Object.assign({},vo,n),ur=function(n,t){let o;const i="LazyLoad::Initialized",l=new n(t);try{o=new CustomEvent(i,{detail:{instance:l}})}catch{o=document.createEvent("CustomEvent"),o.initCustomEvent(i,!1,!1,{instance:l})}window.dispatchEvent(o)},So=(n,t)=>{if(t)if(!t.length)ur(n,t);else for(let o=0,i;i=t[o];o+=1)ur(n,i)},Se="src",kt="srcset",xt="sizes",fr="poster",He="llOriginalAttrs",mr="data",Dt="loading",pr="loaded",gr="applied",wo="entered",Et="error",yr="native",br="data-",vr="ll-status",J=(n,t)=>n.getAttribute(br+t),_o=(n,t,o)=>{var i=br+t;if(o===null){n.removeAttribute(i);return}n.setAttribute(i,o)},Fe=n=>J(n,vr),Ve=(n,t)=>_o(n,vr,t),st=n=>Ve(n,null),Nt=n=>Fe(n)===null,ko=n=>Fe(n)===Dt,xo=n=>Fe(n)===Et,Ct=n=>Fe(n)===yr,Do=[Dt,pr,gr,Et],Eo=n=>Do.indexOf(Fe(n))>=0,_e=(n,t,o,i)=>{if(n){if(i!==void 0){n(t,o,i);return}if(o!==void 0){n(t,o);return}n(t)}},Ae=(n,t)=>{if(cr){n.classList.add(t);return}n.className+=(n.className?" ":"")+t},fe=(n,t)=>{if(cr){n.classList.remove(t);return}n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},No=n=>{n.llTempImage=document.createElement("IMG")},Co=n=>{delete n.llTempImage},Sr=n=>n.llTempImage,at=(n,t)=>{if(!t)return;const o=t._observer;o&&o.unobserve(n)},Vo=n=>{n.disconnect()},Mo=(n,t,o)=>{t.unobserve_entered&&at(n,o)},Vt=(n,t)=>{n&&(n.loadingCount+=t)},To=n=>{n&&(n.toLoadCount-=1)},wr=(n,t)=>{n&&(n.toLoadCount=t)},Bo=n=>n.loadingCount>0,$o=n=>n.toLoadCount>0,_r=n=>{let t=[];for(let o=0,i;i=n.children[o];o+=1)i.tagName==="SOURCE"&&t.push(i);return t},Mt=(n,t)=>{const o=n.parentNode;if(!o||o.tagName!=="PICTURE")return;_r(o).forEach(t)},kr=(n,t)=>{_r(n).forEach(t)},lt=[Se],xr=[Se,fr],Ue=[Se,kt,xt],Dr=[mr],ct=n=>!!n[He],Er=n=>n[He],Nr=n=>delete n[He],Ie=(n,t)=>{if(ct(n))return;const o={};t.forEach(i=>{o[i]=n.getAttribute(i)}),n[He]=o},Ao=n=>{ct(n)||(n[He]={backgroundImage:n.style.backgroundImage})},Io=(n,t,o)=>{if(!o){n.removeAttribute(t);return}n.setAttribute(t,o)},Me=(n,t)=>{if(!ct(n))return;const o=Er(n);t.forEach(i=>{Io(n,i,o[i])})},Lo=n=>{if(!ct(n))return;const t=Er(n);n.style.backgroundImage=t.backgroundImage},Cr=(n,t,o)=>{Ae(n,t.class_applied),Ve(n,gr),o&&(t.unobserve_completed&&at(n,t),_e(t.callback_applied,n,o))},Vr=(n,t,o)=>{Ae(n,t.class_loading),Ve(n,Dt),o&&(Vt(o,1),_e(t.callback_loading,n,o))},ke=(n,t,o)=>{o&&n.setAttribute(t,o)},Mr=(n,t)=>{ke(n,xt,J(n,t.data_sizes)),ke(n,kt,J(n,t.data_srcset)),ke(n,Se,J(n,t.data_src))},Oo=(n,t)=>{Mt(n,o=>{Ie(o,Ue),Mr(o,t)}),Ie(n,Ue),Mr(n,t)},jo=(n,t)=>{Ie(n,lt),ke(n,Se,J(n,t.data_src))},Po=(n,t)=>{kr(n,o=>{Ie(o,lt),ke(o,Se,J(o,t.data_src))}),Ie(n,xr),ke(n,fr,J(n,t.data_poster)),ke(n,Se,J(n,t.data_src)),n.load()},zo=(n,t)=>{Ie(n,Dr),ke(n,mr,J(n,t.data_src))},Ro=(n,t,o)=>{const i=J(n,t.data_bg),l=J(n,t.data_bg_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=`url("${a}")`,Sr(n).setAttribute(Se,a),Vr(n,t,o))},Ho=(n,t,o)=>{const i=J(n,t.data_bg_multi),l=J(n,t.data_bg_multi_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=a,Cr(n,t,o))},Fo=(n,t,o)=>{const i=J(n,t.data_bg_set);if(!i)return;const l=i.split("|");let a=l.map(u=>`image-set(${u})`);n.style.backgroundImage=a.join(),n.style.backgroundImage===""&&(a=l.map(u=>`-webkit-image-set(${u})`),n.style.backgroundImage=a.join()),Cr(n,t,o)},Tr={IMG:Oo,IFRAME:jo,VIDEO:Po,OBJECT:zo},Uo=(n,t)=>{const o=Tr[n.tagName];o&&o(n,t)},Yo=(n,t,o)=>{const i=Tr[n.tagName];i&&(i(n,t),Vr(n,t,o))},Ko=["IMG","IFRAME","VIDEO","OBJECT"],Wo=n=>Ko.indexOf(n.tagName)>-1,Br=(n,t)=>{t&&!Bo(t)&&!$o(t)&&_e(n.callback_finish,t)},$r=(n,t,o)=>{n.addEventListener(t,o),n.llEvLisnrs[t]=o},Xo=(n,t,o)=>{n.removeEventListener(t,o)},Tt=n=>!!n.llEvLisnrs,Zo=(n,t,o)=>{Tt(n)||(n.llEvLisnrs={});const i=n.tagName==="VIDEO"?"loadeddata":"load";$r(n,i,t),$r(n,"error",o)},Bt=n=>{if(!Tt(n))return;const t=n.llEvLisnrs;for(let o in t){const i=t[o];Xo(n,o,i)}delete n.llEvLisnrs},Ar=(n,t,o)=>{Co(n),Vt(o,-1),To(o),fe(n,t.class_loading),t.unobserve_completed&&at(n,o)},qo=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_loaded),Ve(t,pr),_e(o.callback_loaded,t,i),l||Br(o,i)},Go=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_error),Ve(t,Et),_e(o.callback_error,t,i),o.restore_on_error&&Me(t,Ue),l||Br(o,i)},$t=(n,t,o)=>{const i=Sr(n)||n;if(Tt(i))return;Zo(i,u=>{qo(u,n,t,o),Bt(i)},u=>{Go(u,n,t,o),Bt(i)})},Jo=(n,t,o)=>{No(n),$t(n,t,o),Ao(n),Ro(n,t,o),Ho(n,t,o),Fo(n,t,o)},Qo=(n,t,o)=>{$t(n,t,o),Yo(n,t,o)},At=(n,t,o)=>{Wo(n)?Qo(n,t,o):Jo(n,t,o)},ei=(n,t,o)=>{n.setAttribute("loading","lazy"),$t(n,t,o),Uo(n,t),Ve(n,yr)},Ir=n=>{n.removeAttribute(Se),n.removeAttribute(kt),n.removeAttribute(xt)},ti=n=>{Mt(n,t=>{Ir(t)}),Ir(n)},Lr=n=>{Mt(n,t=>{Me(t,Ue)}),Me(n,Ue)},ri={IMG:Lr,IFRAME:n=>{Me(n,lt)},VIDEO:n=>{kr(n,t=>{Me(t,lt)}),Me(n,xr),n.load()},OBJECT:n=>{Me(n,Dr)}},ni=n=>{const t=ri[n.tagName];if(!t){Lo(n);return}t(n)},oi=(n,t)=>{Nt(n)||Ct(n)||(fe(n,t.class_entered),fe(n,t.class_exited),fe(n,t.class_applied),fe(n,t.class_loading),fe(n,t.class_loaded),fe(n,t.class_error))},ii=(n,t)=>{ni(n),oi(n,t),st(n),Nr(n)},si=(n,t,o,i)=>{o.cancel_on_exit&&ko(n)&&n.tagName==="IMG"&&(Bt(n),ti(n),Lr(n),fe(n,o.class_loading),Vt(i,-1),st(n),_e(o.callback_cancel,n,t,i))},ai=(n,t,o,i)=>{const l=Eo(n);Ve(n,wo),Ae(n,o.class_entered),fe(n,o.class_exited),Mo(n,o,i),_e(o.callback_enter,n,t,i),!l&&At(n,o,i)},li=(n,t,o,i)=>{Nt(n)||(Ae(n,o.class_exited),si(n,t,o,i),_e(o.callback_exit,n,t,i))},ci=["IMG","IFRAME","VIDEO"],Or=n=>n.use_native&&"loading"in HTMLImageElement.prototype,di=(n,t,o)=>{n.forEach(i=>{ci.indexOf(i.tagName)!==-1&&ei(i,t,o)}),wr(o,0)},hi=n=>n.isIntersecting||n.intersectionRatio>0,ui=n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}),fi=(n,t,o)=>{n.forEach(i=>hi(i)?ai(i.target,i,t,o):li(i.target,i,t,o))},mi=(n,t)=>{t.forEach(o=>{n.observe(o)})},pi=(n,t)=>{Vo(n),mi(n,t)},gi=(n,t)=>{!lr||Or(n)||(t._observer=new IntersectionObserver(o=>{fi(o,n,t)},ui(n)))},jr=n=>Array.prototype.slice.call(n),dt=n=>n.container.querySelectorAll(n.elements_selector),yi=n=>jr(n).filter(Nt),bi=n=>xo(n),vi=n=>jr(n).filter(bi),Pr=(n,t)=>yi(n||dt(t)),Si=(n,t)=>{vi(dt(n)).forEach(i=>{fe(i,n.class_error),st(i)}),t.update()},wi=(n,t)=>{we&&(t._onlineHandler=()=>{Si(n,t)},window.addEventListener("online",t._onlineHandler))},_i=n=>{we&&window.removeEventListener("online",n._onlineHandler)},Ye=function(n,t){const o=hr(n);this._settings=o,this.loadingCount=0,gi(o,this),wi(o,this),this.update(t)};Ye.prototype={update:function(n){const t=this._settings,o=Pr(n,t);if(wr(this,o.length),ar||!lr){this.loadAll(o);return}if(Or(t)){di(o,t,this);return}pi(this._observer,o)},destroy:function(){this._observer&&this._observer.disconnect(),_i(this),dt(this._settings).forEach(n=>{Nr(n)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(n){const t=this._settings;Pr(n,t).forEach(i=>{at(i,this),At(i,t,this)})},restoreAll:function(){const n=this._settings;dt(n).forEach(t=>{ii(t,n)})}},Ye.load=(n,t)=>{const o=hr(t);At(n,o)},Ye.resetStatus=n=>{st(n)},we&&So(Ye,window.lazyLoadOptions);const ki={class:"relative flex-auto flex flex-col overflow-hidden"},xi={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Di={class:"absolute"},Ei=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"absolute h-6 w-6 md:h-12 md:w-12 m-auto stroke-neutral-500 fill-white dark:fill-gray-700 dark:stroke-gray-600 z-10",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})],-1),Ni={class:"text-neutral-700 dark:text-neutral-300 p-1 absolute text-center top-4 right-[-2rem] md:top-5 md:right-[-2.4rem] z-20 text-xs"},Ci=["onDblclick","onContextmenu","data-type","data-item","data-index"],Vi={class:"grid grid-cols-12 items-center"},Mi={class:"flex col-span-7 items-center"},Ti={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Bi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],$i={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Ai=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Ii={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Li={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Oi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],ji={class:"grid grid-cols-12 items-center"},Pi={class:"flex col-span-7 items-center"},zi={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Ri=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],Hi={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Fi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Ui={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Yi={class:"col-span-2 text-center"},Ki={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Wi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Xi={class:"relative"},Zi={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},qi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],Gi=["data-src","alt"],Ji={key:2,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Qi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],es={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},ts={class:"break-all"},rs=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(n){const t=n,o=e.inject("emitter"),{setStore:i,getStore:l}=e.inject("storage"),a=e.inject("adapter"),u=C=>C==null?void 0:C.substring(0,3),p=C=>C.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),c=e.ref(null),y=e.ref(null),m=e.ref(0),b=e.ref(null),{t:S}=e.inject("i18n"),E=Math.floor(Math.random()*2**32),_=e.ref(l("full-screen",!1)),N=new Ye;o.on("vf-fullscreen-toggle",()=>{c.value.style.height=null,_.value=!_.value,i("full-screen",_.value)});const D=e.ref("");o.on("vf-search-query",({newQuery:C})=>{D.value=C,C?o.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:C},onSuccess:B=>{B.files.length||o.emit("vf-toast-push",{label:S("No search result found.")})}}):o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let L=null;const $=()=>{L&&clearTimeout(L)},T=e.ref(!0),I=C=>{C.touches.length>1&&(T.value?(b.value.stop(),o.emit("vf-toast-push",{label:S("Drag&Drop: off")})):(b.value.start(),o.emit("vf-toast-push",{label:S("Drag&Drop: on")}),o.emit("vf-explorer-update")),T.value=!T.value)},R=C=>{L=setTimeout(()=>{const B=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:C.target.getBoundingClientRect().x,clientY:C.target.getBoundingClientRect().y});C.target.dispatchEvent(B)},500)},k=C=>{C.type=="dir"?(o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:C.path}})):o.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:C})},M=e.reactive({active:!1,column:"",order:""}),H=(C=!0)=>{let B=[...t.data.files],V=M.column,Y=M.order=="asc"?1:-1;if(!C)return B;const O=(ce,ae)=>typeof ce=="string"&&typeof ae=="string"?ce.toLowerCase().localeCompare(ae.toLowerCase()):ce<ae?-1:ce>ae?1:0;return M.active&&(B=B.slice().sort((ce,ae)=>O(ce[V],ae[V])*Y)),B},X=C=>{M.active&&M.column==C?(M.active=M.order=="asc",M.column=C,M.order="desc"):(M.active=!0,M.column=C,M.order="asc")},W=()=>b.value.getSelection().map(C=>JSON.parse(C.dataset.item)),te=(C,B)=>{if(C.altKey||C.ctrlKey||C.metaKey)return C.preventDefault(),!1;C.dataTransfer.setDragImage(y.value,0,15),C.dataTransfer.effectAllowed="all",C.dataTransfer.dropEffect="copy",C.dataTransfer.setData("items",JSON.stringify(W()))},se=(C,B)=>{C.preventDefault();let V=JSON.parse(C.dataTransfer.getData("items"));if(V.find(Y=>Y.storage!=a.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:V,to:B}})},ne=(C,B)=>{C.preventDefault(),!B||B.type!=="dir"||b.value.getSelection().find(V=>V==C.currentTarget)?(C.dataTransfer.dropEffect="none",C.dataTransfer.effectAllowed="none"):C.dataTransfer.dropEffect="copy"},re=()=>{b.value=new ho({area:c.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),o.on("vf-explorer-update",()=>e.nextTick(()=>{b.value.clearSelection(),b.value.setSelectables(document.getElementsByClassName("vf-item-"+E))})),b.value.subscribe("predragstart",({event:C,isDragging:B})=>{if(B)m.value=b.value.getSelection().length,b.value.break();else{const V=C.target.offsetWidth-C.offsetX,Y=C.target.offsetHeight-C.offsetY;V<15&&Y<15&&(b.value.clearSelection(),b.value.break())}}),b.value.subscribe("predragmove",({isDragging:C})=>{C&&b.value.break()}),b.value.subscribe("callback",({items:C,event:B,isDragging:V})=>{o.emit("vf-nodes-selected",W()),m.value=b.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{b.value.Area.reset(),b.value.SelectorArea.updatePos(),N.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>o.emit("vf-explorer-update"))}),(C,B)=>(e.openBlock(),e.createElementBlock("div",ki,[n.view=="list"||D.value.length?(e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("div",{onClick:B[0]||(B[0]=V=>X("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Name"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="basename"]])]),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:B[1]||(B[1]=V=>X("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Size"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="file_size"]])])),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:B[2]||(B[2]=V=>X("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Date"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="last_modified"]])])),D.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:B[3]||(B[3]=V=>X("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Filepath"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("div",{ref_key:"dragImage",ref:y,class:"absolute -z-50 -top-96"},[Ei,e.createElementVNode("div",Ni,e.toDisplayString(m.value),1)],512)]),e.createElementVNode("div",{onTouchstart:I,onContextmenu:B[10]||(B[10]=e.withModifiers(V=>e.unref(o).emit("vf-contextmenu-show",{event:V,area:c.value,items:W()}),["self","prevent"])),class:e.normalizeClass([_.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:c},[D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:O=>k(V),onTouchstart:B[4]||(B[4]=O=>R(O)),onTouchend:B[5]||(B[5]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(E),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Mi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ti,Bi)):(e.openBlock(),e.createElementBlock("svg",$i,Ai)),e.createElementVNode("span",Ii,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Li,e.toDisplayString(V.path),1)])],42,Ci))),256)):e.createCommentVNode("",!0),n.view=="list"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[6]||(B[6]=O=>R(O)),onTouchend:B[7]||(B[7]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",ji,[e.createElementVNode("div",Pi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",zi,Ri)):(e.openBlock(),e.createElementBlock("svg",Hi,Fi)),e.createElementVNode("span",Ui,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Yi,e.toDisplayString(V.file_size?e.unref(ir)(V.file_size):""),1),e.createElementVNode("div",Ki,e.toDisplayString(e.unref(sr)(V.last_modified)),1)])],42,Oi))),256)):e.createCommentVNode("",!0),n.view=="grid"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H(!1),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[8]||(B[8]=O=>R(O)),onTouchend:B[9]||(B[9]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"border border-transparent hover:bg-neutral-50 m-1 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 text-center justify-center select-none"]),"data-type":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",null,[e.createElementVNode("div",Xi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Zi,qi)):(V.mime_type??"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(_t)(e.unref(a).value,V.path),alt:V.basename},null,8,Gi)):(e.openBlock(),e.createElementBlock("svg",Ji,Qi)),!(V.mime_type??"").startsWith("image")&&V.type!="dir"?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(u(V.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ts,e.toDisplayString(p(V.basename)),1)])],42,Wi))),256)):e.createCommentVNode("",!0)],34),e.createVNode(yo)]))}}),ns="1.2.2",os={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},is={class:"flex leading-5 items-center"},ss=["aria-label"],as=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})],-1)],ls=["value"],cs={class:"ml-3"},ds={key:0},hs={class:"ml-1"},us={class:"flex leading-5 items-center"},fs={value:"",disabled:""},ms=e.createStaticVNode('<option value="en">English</option><option value="fr">French</option><option value="fa">Persian</option><option value="de">German</option><option value="ru">Russian</option><option value="tr">Turkish</option><option value="tr">Hebrew</option>',7),ps=["aria-label"],gs=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 stroke-slate-500 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)],ys=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),{getStore:o,setStore:i}=e.inject("storage"),l=e.ref(0),a=e.inject("adapter"),{t:u,changeLocale:p}=e.inject("i18n"),c=e.ref(o("locale","")),y=()=>{t.emit("vf-search-exit"),t.emit("vf-fetch",{params:{q:"index",adapter:a.value}}),i("adapter",a.value)};t.on("vf-nodes-selected",b=>{l.value=b.length});const m=e.ref("");return t.on("vf-search-query",({newQuery:b})=>{m.value=b}),(b,S)=>(e.openBlock(),e.createElementBlock("div",os,[e.createElementVNode("div",is,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(u)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},as,8,ss),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=E=>e.isRef(a)?a.value=E:null),onChange:y,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data.storages,E=>(e.openBlock(),e.createElementBlock("option",{value:E},e.toDisplayString(E),9,ls))),256))],544),[[e.vModelSelect,e.unref(a)]]),e.createElementVNode("div",cs,[m.value.length?(e.openBlock(),e.createElementBlock("span",ds,e.toDisplayString(n.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",hs,e.toDisplayString(l.value>0?l.value+" "+e.unref(u)("item(s) selected."):""),1)])]),e.createElementVNode("div",us,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=E=>c.value=E),onChange:S[2]||(S[2]=E=>e.unref(p)(E.target.value)),class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8 mr-3"},[e.createElementVNode("option",fs,e.toDisplayString(e.unref(u)("Language")),1),ms],544),[[e.vModelSelect,c.value]]),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(u)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=E=>e.unref(t).emit("vf-modal-show",{type:"message",title:"Vuefinder "+e.unref(ns),message:e.unref(u)("Vuefinder is a file manager component for vue 3.")}))},gs,8,ps)])]))}}),bs=(n,t=0,o=!1)=>{let i;return(...l)=>{o&&!i&&n(...l),clearTimeout(i),i=setTimeout(()=>{n(...l)},t)}},vs=(n,t,o)=>{const i=e.ref(n);return e.customRef((a,u)=>({get(){return a(),i.value},set:bs(p=>{i.value=p,u()},t,o)}))},Ss={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-xs"},ws=["aria-label"],_s=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1)],ks=["aria-label"],xs=[e.createElementVNode("path",{d:"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z"},null,-1)],Ds=["aria-label"],Es=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ns=["onClick"],Cs=[e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},null,-1)],Vs={class:"flex leading-5"},Ms=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),Ts=["title","onClick"],Bs={key:0,class:"animate-spin p-1 h-6 w-6 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},$s=[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)],As={key:3,class:"relative flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Is=e.createElementVNode("svg",{class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})],-1),Ls=e.createElementVNode("div",{class:"w-full"},null,-1),Os=["onKeydown","placeholder"],js=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ps=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),l=e.ref(null),a=e.ref([]),u=e.ref(!1),p=e.ref(null),{t:c}=e.inject("i18n"),y=e.inject("loadingState");o.on("vf-explorer-update",()=>{let $=[],T=[];l.value=t.data.dirname??i.value+"://",l.value.length==0&&(a.value=[]),l.value.replace(i.value+"://","").split("/").forEach(function(I){$.push(I),$.join("/")!=""&&T.push({basename:I,name:I,path:i.value+"://"+$.join("/"),type:"dir"})}),T.length>4&&(T=T.slice(-5),T[0].name=".."),a.value=T});const m=()=>{u.value=!1,S.value=""};o.on("vf-search-exit",()=>{m()});const b=()=>{u.value=!0,e.nextTick(()=>p.value.focus())},S=vs("",400),E=()=>y.value;e.watch(S,$=>{o.emit("vf-toast-clear"),o.emit("vf-search-query",{newQuery:$})});const _=()=>a.value.length&&!u.value,N=$=>{$.preventDefault();let T=JSON.parse($.dataTransfer.getData("items"));if(T.find(I=>I.storage!=i.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:T,to:a.value[a.value.length-2]??{path:i.value+"://"}}})},D=$=>{$.preventDefault(),_()?$.dataTransfer.dropEffect="copy":($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none")},L=()=>{S.value==""&&m()};return($,T)=>(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("span",{"aria-label":e.unref(c)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:T[0]||(T[0]=I=>D(I)),onDrop:T[1]||(T[1]=I=>N(I)),onClick:T[2]||(T[2]=I=>{var R;return!_()||e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:((R=a.value[a.value.length-2])==null?void 0:R.path)??e.unref(i)+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",_()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},_s,34))],8,ws),E()?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(c)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[4]||(T[4]=I=>e.unref(o).emit("vf-fetch-abort")),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer"},Es))],8,Ds)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(c)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[3]||(T[3]=I=>{e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:n.data.dirname}})}),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"-40 -40 580 580",fill:"currentColor"},xs))],8,ks)),u.value?(e.openBlock(),e.createElementBlock("div",As,[Is,Ls,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:p,onKeydown:e.withKeys(m,["esc"]),onBlur:L,"onUpdate:modelValue":T[6]||(T[6]=I=>e.isRef(S)?S.value=I:null),placeholder:e.unref(c)("Search anything.."),class:"absolute ml-4 pt-1 pb-0 px-2 border-0 ring-0 outline-0 text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,Os),[[e.vModelText,e.unref(S)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:m,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},js))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(b,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[5]||(T[5]=I=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter}})),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Cs)),e.createElementVNode("div",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(I,R)=>(e.openBlock(),e.createElementBlock("div",{key:R},[Ms,e.createElementVNode("span",{class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer",title:I.basename,onClick:k=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:I.path}})},e.toDisplayString(I.name),9,Ts)]))),128))]),E()?(e.openBlock(),e.createElementBlock("svg",Bs,$s)):e.createCommentVNode("",!0)],8,Ns))]))}}),zs=["onClick"],Rs=e.createElementVNode("span",{class:"px-1"},null,-1),Hs=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(n){const t=n,o=e.inject("emitter"),i=e.ref(null),{apiUrl:l}=ue(),a=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),u=e.ref([]);o.on("vf-context-selected",S=>{u.value=S});const{t:p}=e.inject("i18n"),c={newfolder:{title:()=>p("New Folder"),action:()=>{o.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>p("Delete"),action:()=>{o.emit("vf-modal-show",{type:"delete",items:u})}},refresh:{title:()=>p("Refresh"),action:()=>{o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>p("Preview"),action:()=>{o.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:u.value[0]})}},open:{title:()=>p("Open"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].path}})}},openDir:{title:()=>p("Open containing folder"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].dir}})}},download:{title:()=>p("Download"),action:()=>{const S=l.value+"?"+Ce({q:"download",adapter:t.current.adapter,path:u.value[0].path});o.emit("vf-download",S)}},archive:{title:()=>p("Archive"),action:()=>{o.emit("vf-modal-show",{type:"archive",items:u})}},unarchive:{title:()=>p("Unarchive"),action:()=>{o.emit("vf-modal-show",{type:"unarchive",items:u})}},rename:{title:()=>p("Rename"),action:()=>{o.emit("vf-modal-show",{type:"rename",items:u})}}},y=S=>{o.emit("vf-contextmenu-hide"),S.action()},m=e.ref("");o.on("vf-search-query",({newQuery:S})=>{m.value=S}),o.on("vf-contextmenu-show",({event:S,area:E,items:_,target:N=null})=>{if(a.items=[],m.value)if(N)a.items.push(c.openDir),o.emit("vf-context-selected",[N]);else return;else!N&&!m.value?(a.items.push(c.refresh),a.items.push(c.newfolder),o.emit("vf-context-selected",[])):_.length>1&&_.some(D=>D.path===N.path)?(a.items.push(c.refresh),a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",_)):(N.type=="dir"?a.items.push(c.open):(a.items.push(c.preview),a.items.push(c.download)),a.items.push(c.rename),N.mime_type=="application/zip"?a.items.push(c.unarchive):a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",[N]));b(S,E)}),o.on("vf-contextmenu-hide",()=>{a.active=!1});const b=(S,E)=>{a.active=!0,e.nextTick(()=>{let _=E.getBoundingClientRect(),N=S.pageX,D=S.pageY,L=i.value.offsetHeight,$=i.value.offsetWidth;N=_.right-S.pageX+window.scrollX<$?N-$:N,D=_.bottom-S.pageY+window.scrollY<L?D-L:D,a.positions={left:N+"px",top:D+"px"}})};return(S,E)=>a.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:i,style:e.normalizeStyle(a.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,_=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:_.title,onClick:N=>y(_)},[Rs,e.createElementVNode("span",null,e.toDisplayString(_.title()),1)],8,zs))),128))],4)):e.createCommentVNode("",!0)}}),Fs=(n,t)=>{const o=n[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((i,l)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(l.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function Us(n){const t=await Fs(Object.assign({"../locales/de.json":()=>Promise.resolve().then(()=>wd),"../locales/en.json":()=>Promise.resolve().then(()=>_d),"../locales/fa.json":()=>Promise.resolve().then(()=>kd),"../locales/he.json":()=>Promise.resolve().then(()=>xd),"../locales/ru.json":()=>Promise.resolve().then(()=>Dd),"../locales/tr.json":()=>Promise.resolve().then(()=>Ed)}),`../locales/${n}.json`);return JSON.parse(t.default)}function Ys(n,t,o){const{getStore:i,setStore:l}=wt(n),a=e.ref({}),u=y=>{Us(y).then(m=>{a.value=m,l("locale",y),l("translations",m),o.emit("vf-toast-push",{label:"The language is set to "+y})}).catch(m=>{o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),u("en")})};i("locale")?a.value=i("translations"):u(t);const p=(y,...m)=>m.length?p(y=y.replace("%s",m.shift()),...m):y;function c(y,...m){return a.value.hasOwnProperty(y)?p(a.value[y],...m):p(y,...m)}return{t:c,changeLocale:u}}const Ks={class:"vuefinder"},Ws=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Xs=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},usePropDarkMode:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},postData:{type:Object,default:{}}},setup(n){const t=n,o=Cn(),{setStore:i,getStore:l}=wt(t.id),a=e.ref(l("adapter"));e.provide("emitter",o),e.provide("storage",wt(t.id)),e.provide("postData",t.postData),e.provide("adapter",a),e.provide("maxFileSize",t.maxFileSize),e.provide("usePropDarkMode",t.usePropDarkMode);const u=Ys(t.id,t.locale,o);e.provide("i18n",u);const{apiUrl:p,setApiUrl:c}=ue();c(t.url);const y=e.reactive({adapter:a.value,storages:[],dirname:".",files:[]}),m=e.ref(l("viewport","grid")),b=t.usePropDarkMode?e.computed(()=>t.dark):e.ref(l("darkMode",t.dark));console.log(t.usePropDarkMode),o.on("vf-darkMode-toggle",()=>{b.value=!b.value,i("darkMode",b.value)});const S=e.ref(!1);e.provide("loadingState",S);const E=e.ref(l("full-screen",!1));o.on("vf-fullscreen-toggle",()=>{E.value=!E.value,i("full-screen",E.value)}),o.on("vf-view-toggle",L=>{m.value=L});const _=e.reactive({active:!1,type:"delete",data:{}});o.on("vf-modal-close",()=>{_.active=!1}),o.on("vf-modal-show",L=>{_.active=!0,_.type=L.type,_.data=L});const N=L=>{Object.assign(y,L),o.emit("vf-nodes-selected",{}),o.emit("vf-explorer-update")};let D;return o.on("vf-fetch-abort",()=>{D.abort(),S.value=!1}),o.on("vf-fetch",({params:L,onSuccess:$=null,onError:T=null})=>{["index","search"].includes(L.q)&&(D&&D.abort(),S.value=!0),D=new AbortController;const I=D.signal;ot(p.value,{params:L,signal:I}).then(R=>{a.value=R.adapter,["index","search"].includes(L.q)&&(S.value=!1),o.emit("vf-modal-close"),N(R),$(R)}).catch(R=>{T&&T(R)}).finally(()=>{})}),o.on("vf-download",L=>{document.getElementById("download_frame").src=L,o.emit("vf-modal-close")}),e.onMounted(()=>{o.emit("vf-fetch",{params:{q:"index",adapter:a.value}})}),(L,$)=>(e.openBlock(),e.createElementBlock("div",Ks,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b)?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([E.value?"fixed w-screen inset-0 z-20":"relative rounded-md","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(E.value?"":"max-height: "+n.maxHeight),onMousedown:$[0]||($[0]=T=>e.unref(o).emit("vf-contextmenu-hide")),onTouchstart:$[1]||($[1]=T=>e.unref(o).emit("vf-contextmenu-hide"))},[e.createVNode(so,{data:y},null,8,["data"]),e.createVNode(Ps,{data:y},null,8,["data"]),e.createVNode(rs,{view:m.value,data:y},null,8,["view","data"]),e.createVNode(ys,{data:y},null,8,["data"])],38),_.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+_.type),{key:0,selection:_.data,current:y},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Hs,{current:y},null,8,["current"]),Ws],2)]))}}),Zs=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 dark:bg-gray-600 dark:bg-opacity-75 bg-opacity-75 transition-opacity"},null,-1),qs={class:"fixed z-10 inset-0 overflow-hidden"},Gs={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl w-full"},Js={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qs={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},me={__name:"ModalLayout",setup(n){const t=e.inject("emitter");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:i[1]||(i[1]=e.withKeys(l=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Zs,e.createElementVNode("div",qs,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:i[0]||(i[0]=e.withModifiers(l=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Gs,[e.createElementVNode("div",Js,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Qs,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},ea=["aria-label"],ta=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)],pe=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(n,{emit:t}){var p;const{t:o}=e.inject("i18n"),i=e.ref(!1),l=e.ref(null),a=e.ref((p=l.value)==null?void 0:p.strMessage);e.watch(a,()=>i.value=!1);const u=()=>{t("hidden"),i.value=!0};return(c,y)=>(e.openBlock(),e.createElementBlock("div",null,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:l,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",n.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(c.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:u,"aria-label":e.unref(o)("Close"),"data-microtip-position":"top-left",role:"tooltip"},ta,8,ea)],2))]))}}),ra={class:"sm:flex sm:items-start"},na=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})])],-1),oa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ia={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},sa={class:"mt-2"},aa={class:"text-sm text-gray-500"},la={class:"flex text-sm text-gray-800 dark:text-gray-400"},ca={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},da=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],ha={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ua=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],fa={class:"ml-1.5"},ma={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},pa=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(t.selection.items),u=e.ref(""),p=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"delete",adapter:i.value,path:t.current.dirname,items:JSON.stringify(a.value.map(({path:c,type:y})=>({path:c,type:y})))},onSuccess:()=>{o.emit("vf-toast-push",{label:l("Files deleted.")})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:y[1]||(y[1]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1),e.createElementVNode("div",ma,e.toDisplayString(e.unref(l)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ra,[na,e.createElementVNode("div",oa,[e.createElementVNode("h3",ia,e.toDisplayString(e.unref(l)("Delete files")),1),e.createElementVNode("div",sa,[e.createElementVNode("p",aa,e.toDisplayString(e.unref(l)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("p",la,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",ca,da)):(e.openBlock(),e.createElementBlock("svg",ha,ua)),e.createElementVNode("span",fa,e.toDisplayString(m.basename),1)]))),256)),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[0]||(y[0]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ga={class:"sm:flex sm:items-start"},ya=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1),ba={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},va={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Sa={class:"mt-2"},wa={class:"text-sm text-gray-500"},_a=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(n){const t=e.inject("emitter"),{t:o}=e.inject("i18n");return(i,l)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l[0]||(l[0]=a=>e.unref(t).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var a,u;return[e.createElementVNode("div",ga,[ya,e.createElementVNode("div",ba,[e.createElementVNode("h3",va,e.toDisplayString(((a=n.selection)==null?void 0:a.title)??"Title"),1),e.createElementVNode("div",Sa,[e.createElementVNode("p",wa,e.toDisplayString(((u=n.selection)==null?void 0:u.message)??"Message")+".",1)])])])]}),_:1}))}}),ka={class:"sm:flex sm:items-start"},xa=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})])],-1),Da={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ea={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Na={class:"mt-2"},Ca={class:"text-sm text-gray-500"},Va=["onKeyup","placeholder"],Ma=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfolder",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ka,[xa,e.createElementVNode("div",Da,[e.createElementVNode("h3",Ea,e.toDisplayString(e.unref(l)("New Folder")),1),e.createElementVNode("div",Na,[e.createElementVNode("p",Ca,e.toDisplayString(e.unref(l)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(l)("Folder Name"),type:"text"},null,40,Va),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ta={class:"sm:flex sm:items-start"},Ba=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),$a={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Aa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ia={class:"mt-2"},La={class:"text-sm text-gray-500"},Oa=["onKeyup","placeholder"],ja=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfile",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ta,[Ba,e.createElementVNode("div",$a,[e.createElementVNode("h3",Aa,e.toDisplayString(e.unref(l)("New File")),1),e.createElementVNode("div",Ia,[e.createElementVNode("p",La,e.toDisplayString(e.unref(l)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(l)("File Name"),type:"text"},null,40,Oa),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Pa={class:"flex"},za=["aria-label"],Ra={class:"ml-auto mb-2"},Ha={key:0,class:"p-2 border font-normal whitespace-pre-wrap border-gray-200 dark:border-gray-700/50 dark:text-gray-200 rounded min-h-[200px] max-h-[60vh] text-xs overflow-auto"},Fa={key:1},Ua={__name:"Text",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,i=e.ref(""),l=e.ref(""),a=e.ref(null),u=e.ref(!1),{apiUrl:p}=ue(),c=e.ref(""),y=e.ref(!1),{t:m}=e.inject("i18n");e.onMounted(()=>{ot(p.value,{params:{q:"preview",adapter:o.selection.adapter,path:o.selection.item.path},json:!1}).then(_=>{i.value=_,t("load")})});const b=()=>{u.value=!u.value,l.value=i.value,u.value==!0&&e.nextTick(()=>{a.value.focus()})},S=e.inject("postData"),E=()=>{c.value="",y.value=!1,ot(p.value,{method:"POST",params:Object.assign(S,{q:"save",adapter:o.selection.adapter,path:o.selection.item.path,content:l.value}),json:!1}).then(_=>{c.value=m("Updated."),i.value=_,t("load"),u.value=!u.value}).catch(_=>{c.value=m(_.message),y.value=!0})};return(_,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pa,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,za),e.createElementVNode("div",Ra,[u.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:E,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(m)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:N[0]||(N[0]=D=>b())},e.toDisplayString(u.value?e.unref(m)("Cancel"):e.unref(m)("Edit")),1)])]),e.createElementVNode("div",null,[u.value?(e.openBlock(),e.createElementBlock("div",Fa,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:a,"onUpdate:modelValue":N[1]||(N[1]=D=>l.value=D),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] max-h-[60vh] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,l.value]])])):(e.openBlock(),e.createElementBlock("pre",Ha,e.toDisplayString(i.value),1)),c.value.length?(e.openBlock(),e.createBlock(pe,{key:2,onHidden:N[2]||(N[2]=D=>c.value=""),error:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},qh="";/*!
5
5
  * Cropper.js v1.5.13
6
6
  * https://fengyuanchen.github.io/cropperjs
7
7
  *
@@ -9,14 +9,82 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
9
9
  * Released under the MIT license
10
10
  *
11
11
  * Date: 2022-11-20T05:30:46.114Z
12
- */function Ir(r,t){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),n.push.apply(n,s)}return n}function Or(r){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ir(Object(n),!0).forEach(function(s){Oa(r,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):Ir(Object(n)).forEach(function(s){Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(n,s))})}return r}function At(r){return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(r)}function La(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function jr(r,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,s.key,s)}}function Ia(r,t,n){return t&&jr(r.prototype,t),n&&jr(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function Oa(r,t,n){return t in r?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}function Pr(r){return ja(r)||Pa(r)||za(r)||Ra()}function ja(r){if(Array.isArray(r))return Lt(r)}function Pa(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function za(r,t){if(r){if(typeof r=="string")return Lt(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lt(r,t)}}function Lt(r,t){(t==null||t>r.length)&&(t=r.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=r[n];return s}function Ra(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
13
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ft=typeof window<"u"&&typeof window.document<"u",ge=ft?window:{},It=ft&&ge.document.documentElement?"ontouchstart"in ge.document.documentElement:!1,Ot=ft?"PointerEvent"in ge:!1,F="cropper",jt="all",zr="crop",Rr="move",Hr="zoom",Me="e",Be="w",Oe="s",xe="n",Ye="ne",We="nw",Xe="se",Ze="sw",Pt="".concat(F,"-crop"),Fr="".concat(F,"-disabled"),Q="".concat(F,"-hidden"),Ur="".concat(F,"-hide"),Ha="".concat(F,"-invisible"),mt="".concat(F,"-modal"),zt="".concat(F,"-move"),qe="".concat(F,"Action"),pt="".concat(F,"Preview"),Rt="crop",Kr="move",Yr="none",Ht="crop",Ft="cropend",Ut="cropmove",Kt="cropstart",Wr="dblclick",Fa=It?"touchstart":"mousedown",Ua=It?"touchmove":"mousemove",Ka=It?"touchend touchcancel":"mouseup",Xr=Ot?"pointerdown":Fa,Zr=Ot?"pointermove":Ua,qr=Ot?"pointerup pointercancel":Ka,Gr="ready",Jr="resize",Qr="wheel",Yt="zoom",en="image/jpeg",Ya=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Wa=/^data:/,Xa=/^data:image\/jpeg;base64,/,Za=/^img|canvas$/i,tn=200,rn=100,nn={viewMode:0,dragMode:Rt,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:tn,minContainerHeight:rn,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},qa='<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>',Ga=Number.isNaN||ge.isNaN;function P(r){return typeof r=="number"&&!Ga(r)}var on=function(t){return t>0&&t<1/0};function Wt(r){return typeof r>"u"}function $e(r){return At(r)==="object"&&r!==null}var Ja=Object.prototype.hasOwnProperty;function je(r){if(!$e(r))return!1;try{var t=r.constructor,n=t.prototype;return t&&n&&Ja.call(n,"isPrototypeOf")}catch{return!1}}function ee(r){return typeof r=="function"}var Qa=Array.prototype.slice;function sn(r){return Array.from?Array.from(r):Qa.call(r)}function K(r,t){return r&&ee(t)&&(Array.isArray(r)||P(r.length)?sn(r).forEach(function(n,s){t.call(r,n,s,r)}):$e(r)&&Object.keys(r).forEach(function(n){t.call(r,r[n],n,r)})),r}var U=Object.assign||function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),l=1;l<n;l++)s[l-1]=arguments[l];return $e(t)&&s.length>0&&s.forEach(function(i){$e(i)&&Object.keys(i).forEach(function(c){t[c]=i[c]})}),t},el=/\.\d*(?:0|9){12}\d*$/;function Pe(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return el.test(r)?Math.round(r*t)/t:r}var tl=/^width|height|left|top|marginLeft|marginTop$/;function De(r,t){var n=r.style;K(t,function(s,l){tl.test(l)&&P(s)&&(s="".concat(s,"px")),n[l]=s})}function rl(r,t){return r.classList?r.classList.contains(t):r.className.indexOf(t)>-1}function q(r,t){if(t){if(P(r.length)){K(r,function(s){q(s,t)});return}if(r.classList){r.classList.add(t);return}var n=r.className.trim();n?n.indexOf(t)<0&&(r.className="".concat(n," ").concat(t)):r.className=t}}function ye(r,t){if(t){if(P(r.length)){K(r,function(n){ye(n,t)});return}if(r.classList){r.classList.remove(t);return}r.className.indexOf(t)>=0&&(r.className=r.className.replace(t,""))}}function ze(r,t,n){if(t){if(P(r.length)){K(r,function(s){ze(s,t,n)});return}n?q(r,t):ye(r,t)}}var nl=/([a-z\d])([A-Z])/g;function Xt(r){return r.replace(nl,"$1-$2").toLowerCase()}function Zt(r,t){return $e(r[t])?r[t]:r.dataset?r.dataset[t]:r.getAttribute("data-".concat(Xt(t)))}function Ge(r,t,n){$e(n)?r[t]=n:r.dataset?r.dataset[t]=n:r.setAttribute("data-".concat(Xt(t)),n)}function ol(r,t){if($e(r[t]))try{delete r[t]}catch{r[t]=void 0}else if(r.dataset)try{delete r.dataset[t]}catch{r.dataset[t]=void 0}else r.removeAttribute("data-".concat(Xt(t)))}var an=/\s\s*/,ln=function(){var r=!1;if(ft){var t=!1,n=function(){},s=Object.defineProperty({},"once",{get:function(){return r=!0,t},set:function(i){t=i}});ge.addEventListener("test",n,s),ge.removeEventListener("test",n,s)}return r}();function ce(r,t,n){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=n;t.trim().split(an).forEach(function(i){if(!ln){var c=r.listeners;c&&c[i]&&c[i][n]&&(l=c[i][n],delete c[i][n],Object.keys(c[i]).length===0&&delete c[i],Object.keys(c).length===0&&delete r.listeners)}r.removeEventListener(i,l,s)})}function se(r,t,n){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=n;t.trim().split(an).forEach(function(i){if(s.once&&!ln){var c=r.listeners,u=c===void 0?{}:c;l=function(){delete u[i][n],r.removeEventListener(i,l,s);for(var g=arguments.length,m=new Array(g),b=0;b<g;b++)m[b]=arguments[b];n.apply(r,m)},u[i]||(u[i]={}),u[i][n]&&r.removeEventListener(i,u[i][n],s),u[i][n]=l,r.listeners=u}r.addEventListener(i,l,s)})}function Re(r,t,n){var s;return ee(Event)&&ee(CustomEvent)?s=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0}):(s=document.createEvent("CustomEvent"),s.initCustomEvent(t,!0,!0,n)),r.dispatchEvent(s)}function cn(r){var t=r.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var qt=ge.location,sl=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function dn(r){var t=r.match(sl);return t!==null&&(t[1]!==qt.protocol||t[2]!==qt.hostname||t[3]!==qt.port)}function hn(r){var t="timestamp=".concat(new Date().getTime());return r+(r.indexOf("?")===-1?"?":"&")+t}function Je(r){var t=r.rotate,n=r.scaleX,s=r.scaleY,l=r.translateX,i=r.translateY,c=[];P(l)&&l!==0&&c.push("translateX(".concat(l,"px)")),P(i)&&i!==0&&c.push("translateY(".concat(i,"px)")),P(t)&&t!==0&&c.push("rotate(".concat(t,"deg)")),P(n)&&n!==1&&c.push("scaleX(".concat(n,")")),P(s)&&s!==1&&c.push("scaleY(".concat(s,")"));var u=c.length?c.join(" "):"none";return{WebkitTransform:u,msTransform:u,transform:u}}function il(r){var t=Or({},r),n=0;return K(r,function(s,l){delete t[l],K(t,function(i){var c=Math.abs(s.startX-i.startX),u=Math.abs(s.startY-i.startY),y=Math.abs(s.endX-i.endX),g=Math.abs(s.endY-i.endY),m=Math.sqrt(c*c+u*u),b=Math.sqrt(y*y+g*g),S=(b-m)/m;Math.abs(S)>Math.abs(n)&&(n=S)})}),n}function gt(r,t){var n=r.pageX,s=r.pageY,l={endX:n,endY:s};return t?l:Or({startX:n,startY:s},l)}function al(r){var t=0,n=0,s=0;return K(r,function(l){var i=l.startX,c=l.startY;t+=i,n+=c,s+=1}),t/=s,n/=s,{pageX:t,pageY:n}}function Ee(r){var t=r.aspectRatio,n=r.height,s=r.width,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",i=on(s),c=on(n);if(i&&c){var u=n*t;l==="contain"&&u>s||l==="cover"&&u<s?n=s/t:s=n*t}else i?n=s/t:c&&(s=n*t);return{width:s,height:n}}function ll(r){var t=r.width,n=r.height,s=r.degree;if(s=Math.abs(s)%180,s===90)return{width:n,height:t};var l=s%90*Math.PI/180,i=Math.sin(l),c=Math.cos(l),u=t*c+n*i,y=t*i+n*c;return s>90?{width:y,height:u}:{width:u,height:y}}function cl(r,t,n,s){var l=t.aspectRatio,i=t.naturalWidth,c=t.naturalHeight,u=t.rotate,y=u===void 0?0:u,g=t.scaleX,m=g===void 0?1:g,b=t.scaleY,S=b===void 0?1:b,x=n.aspectRatio,k=n.naturalWidth,N=n.naturalHeight,C=s.fillColor,A=C===void 0?"transparent":C,T=s.imageSmoothingEnabled,V=T===void 0?!0:T,j=s.imageSmoothingQuality,I=j===void 0?"low":j,D=s.maxWidth,B=D===void 0?1/0:D,H=s.maxHeight,W=H===void 0?1/0:H,Y=s.minWidth,te=Y===void 0?0:Y,ie=s.minHeight,ne=ie===void 0?0:ie,re=document.createElement("canvas"),E=re.getContext("2d"),$=Ee({aspectRatio:x,width:B,height:W}),M=Ee({aspectRatio:x,width:te,height:ne},"cover"),G=Math.min($.width,Math.max(M.width,k)),O=Math.min($.height,Math.max(M.height,N)),de=Ee({aspectRatio:l,width:B,height:W}),he=Ee({aspectRatio:l,width:te,height:ne},"cover"),yt=Math.min(de.width,Math.max(he.width,i)),Qe=Math.min(de.height,Math.max(he.height,c)),et=[-yt/2,-Qe/2,yt,Qe];return re.width=Pe(G),re.height=Pe(O),E.fillStyle=A,E.fillRect(0,0,G,O),E.save(),E.translate(G/2,O/2),E.rotate(y*Math.PI/180),E.scale(m,S),E.imageSmoothingEnabled=V,E.imageSmoothingQuality=I,E.drawImage.apply(E,[r].concat(Pr(et.map(function(bt){return Math.floor(Pe(bt))})))),E.restore(),re}var un=String.fromCharCode;function dl(r,t,n){var s="";n+=t;for(var l=t;l<n;l+=1)s+=un(r.getUint8(l));return s}var hl=/^data:.*,/;function ul(r){var t=r.replace(hl,""),n=atob(t),s=new ArrayBuffer(n.length),l=new Uint8Array(s);return K(l,function(i,c){l[c]=n.charCodeAt(c)}),s}function fl(r,t){for(var n=[],s=8192,l=new Uint8Array(r);l.length>0;)n.push(un.apply(null,sn(l.subarray(0,s)))),l=l.subarray(s);return"data:".concat(t,";base64,").concat(btoa(n.join("")))}function ml(r){var t=new DataView(r),n;try{var s,l,i;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var c=t.byteLength,u=2;u+1<c;){if(t.getUint8(u)===255&&t.getUint8(u+1)===225){l=u;break}u+=1}if(l){var y=l+4,g=l+10;if(dl(t,y,4)==="Exif"){var m=t.getUint16(g);if(s=m===18761,(s||m===19789)&&t.getUint16(g+2,s)===42){var b=t.getUint32(g+4,s);b>=8&&(i=g+b)}}}if(i){var S=t.getUint16(i,s),x,k;for(k=0;k<S;k+=1)if(x=i+k*12+2,t.getUint16(x,s)===274){x+=8,n=t.getUint16(x,s),t.setUint16(x,1,s);break}}}catch{n=1}return n}function pl(r){var t=0,n=1,s=1;switch(r){case 2:n=-1;break;case 3:t=-180;break;case 4:s=-1;break;case 5:t=90,s=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:n,scaleY:s}}var gl={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,n=this.options,s=this.container,l=this.cropper,i=Number(n.minContainerWidth),c=Number(n.minContainerHeight);q(l,Q),ye(t,Q);var u={width:Math.max(s.offsetWidth,i>=0?i:tn),height:Math.max(s.offsetHeight,c>=0?c:rn)};this.containerData=u,De(l,{width:u.width,height:u.height}),q(t,Q),ye(l,Q)},initCanvas:function(){var t=this.containerData,n=this.imageData,s=this.options.viewMode,l=Math.abs(n.rotate)%180===90,i=l?n.naturalHeight:n.naturalWidth,c=l?n.naturalWidth:n.naturalHeight,u=i/c,y=t.width,g=t.height;t.height*u>t.width?s===3?y=t.height*u:g=t.width/u:s===3?g=t.width/u:y=t.height*u;var m={aspectRatio:u,naturalWidth:i,naturalHeight:c,width:y,height:g};this.canvasData=m,this.limited=s===1||s===2,this.limitCanvas(!0,!0),m.width=Math.min(Math.max(m.width,m.minWidth),m.maxWidth),m.height=Math.min(Math.max(m.height,m.minHeight),m.maxHeight),m.left=(t.width-m.width)/2,m.top=(t.height-m.height)/2,m.oldLeft=m.left,m.oldTop=m.top,this.initialCanvasData=U({},m)},limitCanvas:function(t,n){var s=this.options,l=this.containerData,i=this.canvasData,c=this.cropBoxData,u=s.viewMode,y=i.aspectRatio,g=this.cropped&&c;if(t){var m=Number(s.minCanvasWidth)||0,b=Number(s.minCanvasHeight)||0;u>1?(m=Math.max(m,l.width),b=Math.max(b,l.height),u===3&&(b*y>m?m=b*y:b=m/y)):u>0&&(m?m=Math.max(m,g?c.width:0):b?b=Math.max(b,g?c.height:0):g&&(m=c.width,b=c.height,b*y>m?m=b*y:b=m/y));var S=Ee({aspectRatio:y,width:m,height:b});m=S.width,b=S.height,i.minWidth=m,i.minHeight=b,i.maxWidth=1/0,i.maxHeight=1/0}if(n)if(u>(g?0:1)){var x=l.width-i.width,k=l.height-i.height;i.minLeft=Math.min(0,x),i.minTop=Math.min(0,k),i.maxLeft=Math.max(0,x),i.maxTop=Math.max(0,k),g&&this.limited&&(i.minLeft=Math.min(c.left,c.left+(c.width-i.width)),i.minTop=Math.min(c.top,c.top+(c.height-i.height)),i.maxLeft=c.left,i.maxTop=c.top,u===2&&(i.width>=l.width&&(i.minLeft=Math.min(0,x),i.maxLeft=Math.max(0,x)),i.height>=l.height&&(i.minTop=Math.min(0,k),i.maxTop=Math.max(0,k))))}else i.minLeft=-i.width,i.minTop=-i.height,i.maxLeft=l.width,i.maxTop=l.height},renderCanvas:function(t,n){var s=this.canvasData,l=this.imageData;if(n){var i=ll({width:l.naturalWidth*Math.abs(l.scaleX||1),height:l.naturalHeight*Math.abs(l.scaleY||1),degree:l.rotate||0}),c=i.width,u=i.height,y=s.width*(c/s.naturalWidth),g=s.height*(u/s.naturalHeight);s.left-=(y-s.width)/2,s.top-=(g-s.height)/2,s.width=y,s.height=g,s.aspectRatio=c/u,s.naturalWidth=c,s.naturalHeight=u,this.limitCanvas(!0,!1)}(s.width>s.maxWidth||s.width<s.minWidth)&&(s.left=s.oldLeft),(s.height>s.maxHeight||s.height<s.minHeight)&&(s.top=s.oldTop),s.width=Math.min(Math.max(s.width,s.minWidth),s.maxWidth),s.height=Math.min(Math.max(s.height,s.minHeight),s.maxHeight),this.limitCanvas(!1,!0),s.left=Math.min(Math.max(s.left,s.minLeft),s.maxLeft),s.top=Math.min(Math.max(s.top,s.minTop),s.maxTop),s.oldLeft=s.left,s.oldTop=s.top,De(this.canvas,U({width:s.width,height:s.height},Je({translateX:s.left,translateY:s.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var n=this.canvasData,s=this.imageData,l=s.naturalWidth*(n.width/n.naturalWidth),i=s.naturalHeight*(n.height/n.naturalHeight);U(s,{width:l,height:i,left:(n.width-l)/2,top:(n.height-i)/2}),De(this.image,U({width:s.width,height:s.height},Je(U({translateX:s.left,translateY:s.top},s)))),t&&this.output()},initCropBox:function(){var t=this.options,n=this.canvasData,s=t.aspectRatio||t.initialAspectRatio,l=Number(t.autoCropArea)||.8,i={width:n.width,height:n.height};s&&(n.height*s>n.width?i.height=i.width/s:i.width=i.height*s),this.cropBoxData=i,this.limitCropBox(!0,!0),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),i.width=Math.max(i.minWidth,i.width*l),i.height=Math.max(i.minHeight,i.height*l),i.left=n.left+(n.width-i.width)/2,i.top=n.top+(n.height-i.height)/2,i.oldLeft=i.left,i.oldTop=i.top,this.initialCropBoxData=U({},i)},limitCropBox:function(t,n){var s=this.options,l=this.containerData,i=this.canvasData,c=this.cropBoxData,u=this.limited,y=s.aspectRatio;if(t){var g=Number(s.minCropBoxWidth)||0,m=Number(s.minCropBoxHeight)||0,b=u?Math.min(l.width,i.width,i.width+i.left,l.width-i.left):l.width,S=u?Math.min(l.height,i.height,i.height+i.top,l.height-i.top):l.height;g=Math.min(g,l.width),m=Math.min(m,l.height),y&&(g&&m?m*y>g?m=g/y:g=m*y:g?m=g/y:m&&(g=m*y),S*y>b?S=b/y:b=S*y),c.minWidth=Math.min(g,b),c.minHeight=Math.min(m,S),c.maxWidth=b,c.maxHeight=S}n&&(u?(c.minLeft=Math.max(0,i.left),c.minTop=Math.max(0,i.top),c.maxLeft=Math.min(l.width,i.left+i.width)-c.width,c.maxTop=Math.min(l.height,i.top+i.height)-c.height):(c.minLeft=0,c.minTop=0,c.maxLeft=l.width-c.width,c.maxTop=l.height-c.height))},renderCropBox:function(){var t=this.options,n=this.containerData,s=this.cropBoxData;(s.width>s.maxWidth||s.width<s.minWidth)&&(s.left=s.oldLeft),(s.height>s.maxHeight||s.height<s.minHeight)&&(s.top=s.oldTop),s.width=Math.min(Math.max(s.width,s.minWidth),s.maxWidth),s.height=Math.min(Math.max(s.height,s.minHeight),s.maxHeight),this.limitCropBox(!1,!0),s.left=Math.min(Math.max(s.left,s.minLeft),s.maxLeft),s.top=Math.min(Math.max(s.top,s.minTop),s.maxTop),s.oldLeft=s.left,s.oldTop=s.top,t.movable&&t.cropBoxMovable&&Ge(this.face,qe,s.width>=n.width&&s.height>=n.height?Rr:jt),De(this.cropBox,U({width:s.width,height:s.height},Je({translateX:s.left,translateY:s.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Re(this.element,Ht,this.getData())}},yl={initPreview:function(){var t=this.element,n=this.crossOrigin,s=this.options.preview,l=n?this.crossOriginUrl:this.url,i=t.alt||"The image to preview",c=document.createElement("img");if(n&&(c.crossOrigin=n),c.src=l,c.alt=i,this.viewBox.appendChild(c),this.viewBoxImage=c,!!s){var u=s;typeof s=="string"?u=t.ownerDocument.querySelectorAll(s):s.querySelector&&(u=[s]),this.previews=u,K(u,function(y){var g=document.createElement("img");Ge(y,pt,{width:y.offsetWidth,height:y.offsetHeight,html:y.innerHTML}),n&&(g.crossOrigin=n),g.src=l,g.alt=i,g.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;"',y.innerHTML="",y.appendChild(g)})}},resetPreview:function(){K(this.previews,function(t){var n=Zt(t,pt);De(t,{width:n.width,height:n.height}),t.innerHTML=n.html,ol(t,pt)})},preview:function(){var t=this.imageData,n=this.canvasData,s=this.cropBoxData,l=s.width,i=s.height,c=t.width,u=t.height,y=s.left-n.left-t.left,g=s.top-n.top-t.top;!this.cropped||this.disabled||(De(this.viewBoxImage,U({width:c,height:u},Je(U({translateX:-y,translateY:-g},t)))),K(this.previews,function(m){var b=Zt(m,pt),S=b.width,x=b.height,k=S,N=x,C=1;l&&(C=S/l,N=i*C),i&&N>x&&(C=x/i,k=l*C,N=x),De(m,{width:k,height:N}),De(m.getElementsByTagName("img")[0],U({width:c*C,height:u*C},Je(U({translateX:-y*C,translateY:-g*C},t))))}))}},bl={bind:function(){var t=this.element,n=this.options,s=this.cropper;ee(n.cropstart)&&se(t,Kt,n.cropstart),ee(n.cropmove)&&se(t,Ut,n.cropmove),ee(n.cropend)&&se(t,Ft,n.cropend),ee(n.crop)&&se(t,Ht,n.crop),ee(n.zoom)&&se(t,Yt,n.zoom),se(s,Xr,this.onCropStart=this.cropStart.bind(this)),n.zoomable&&n.zoomOnWheel&&se(s,Qr,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),n.toggleDragModeOnDblclick&&se(s,Wr,this.onDblclick=this.dblclick.bind(this)),se(t.ownerDocument,Zr,this.onCropMove=this.cropMove.bind(this)),se(t.ownerDocument,qr,this.onCropEnd=this.cropEnd.bind(this)),n.responsive&&se(window,Jr,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,n=this.options,s=this.cropper;ee(n.cropstart)&&ce(t,Kt,n.cropstart),ee(n.cropmove)&&ce(t,Ut,n.cropmove),ee(n.cropend)&&ce(t,Ft,n.cropend),ee(n.crop)&&ce(t,Ht,n.crop),ee(n.zoom)&&ce(t,Yt,n.zoom),ce(s,Xr,this.onCropStart),n.zoomable&&n.zoomOnWheel&&ce(s,Qr,this.onWheel,{passive:!1,capture:!0}),n.toggleDragModeOnDblclick&&ce(s,Wr,this.onDblclick),ce(t.ownerDocument,Zr,this.onCropMove),ce(t.ownerDocument,qr,this.onCropEnd),n.responsive&&ce(window,Jr,this.onResize)}},vl={resize:function(){if(!this.disabled){var t=this.options,n=this.container,s=this.containerData,l=n.offsetWidth/s.width,i=n.offsetHeight/s.height,c=Math.abs(l-1)>Math.abs(i-1)?l:i;if(c!==1){var u,y;t.restore&&(u=this.getCanvasData(),y=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(K(u,function(g,m){u[m]=g*c})),this.setCropBoxData(K(y,function(g,m){y[m]=g*c})))}}},dblclick:function(){this.disabled||this.options.dragMode===Yr||this.setDragMode(rl(this.dragBox,Pt)?Kr:Rt)},wheel:function(t){var n=this,s=Number(this.options.wheelZoomRatio)||.1,l=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){n.wheeling=!1},50),t.deltaY?l=t.deltaY>0?1:-1:t.wheelDelta?l=-t.wheelDelta/120:t.detail&&(l=t.detail>0?1:-1),this.zoom(-l*s,t)))},cropStart:function(t){var n=t.buttons,s=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(P(n)&&n!==1||P(s)&&s!==0||t.ctrlKey))){var l=this.options,i=this.pointers,c;t.changedTouches?K(t.changedTouches,function(u){i[u.identifier]=gt(u)}):i[t.pointerId||0]=gt(t),Object.keys(i).length>1&&l.zoomable&&l.zoomOnTouch?c=Hr:c=Zt(t.target,qe),Ya.test(c)&&Re(this.element,Kt,{originalEvent:t,action:c})!==!1&&(t.preventDefault(),this.action=c,this.cropping=!1,c===zr&&(this.cropping=!0,q(this.dragBox,mt)))}},cropMove:function(t){var n=this.action;if(!(this.disabled||!n)){var s=this.pointers;t.preventDefault(),Re(this.element,Ut,{originalEvent:t,action:n})!==!1&&(t.changedTouches?K(t.changedTouches,function(l){U(s[l.identifier]||{},gt(l,!0))}):U(s[t.pointerId||0]||{},gt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var n=this.action,s=this.pointers;t.changedTouches?K(t.changedTouches,function(l){delete s[l.identifier]}):delete s[t.pointerId||0],n&&(t.preventDefault(),Object.keys(s).length||(this.action=""),this.cropping&&(this.cropping=!1,ze(this.dragBox,mt,this.cropped&&this.options.modal)),Re(this.element,Ft,{originalEvent:t,action:n}))}}},Sl={change:function(t){var n=this.options,s=this.canvasData,l=this.containerData,i=this.cropBoxData,c=this.pointers,u=this.action,y=n.aspectRatio,g=i.left,m=i.top,b=i.width,S=i.height,x=g+b,k=m+S,N=0,C=0,A=l.width,T=l.height,V=!0,j;!y&&t.shiftKey&&(y=b&&S?b/S:1),this.limited&&(N=i.minLeft,C=i.minTop,A=N+Math.min(l.width,s.width,s.left+s.width),T=C+Math.min(l.height,s.height,s.top+s.height));var I=c[Object.keys(c)[0]],D={x:I.endX-I.startX,y:I.endY-I.startY},B=function(W){switch(W){case Me:x+D.x>A&&(D.x=A-x);break;case Be:g+D.x<N&&(D.x=N-g);break;case xe:m+D.y<C&&(D.y=C-m);break;case Oe:k+D.y>T&&(D.y=T-k);break}};switch(u){case jt:g+=D.x,m+=D.y;break;case Me:if(D.x>=0&&(x>=A||y&&(m<=C||k>=T))){V=!1;break}B(Me),b+=D.x,b<0&&(u=Be,b=-b,g-=b),y&&(S=b/y,m+=(i.height-S)/2);break;case xe:if(D.y<=0&&(m<=C||y&&(g<=N||x>=A))){V=!1;break}B(xe),S-=D.y,m+=D.y,S<0&&(u=Oe,S=-S,m-=S),y&&(b=S*y,g+=(i.width-b)/2);break;case Be:if(D.x<=0&&(g<=N||y&&(m<=C||k>=T))){V=!1;break}B(Be),b-=D.x,g+=D.x,b<0&&(u=Me,b=-b,g-=b),y&&(S=b/y,m+=(i.height-S)/2);break;case Oe:if(D.y>=0&&(k>=T||y&&(g<=N||x>=A))){V=!1;break}B(Oe),S+=D.y,S<0&&(u=xe,S=-S,m-=S),y&&(b=S*y,g+=(i.width-b)/2);break;case Ye:if(y){if(D.y<=0&&(m<=C||x>=A)){V=!1;break}B(xe),S-=D.y,m+=D.y,b=S*y}else B(xe),B(Me),D.x>=0?x<A?b+=D.x:D.y<=0&&m<=C&&(V=!1):b+=D.x,D.y<=0?m>C&&(S-=D.y,m+=D.y):(S-=D.y,m+=D.y);b<0&&S<0?(u=Ze,S=-S,b=-b,m-=S,g-=b):b<0?(u=We,b=-b,g-=b):S<0&&(u=Xe,S=-S,m-=S);break;case We:if(y){if(D.y<=0&&(m<=C||g<=N)){V=!1;break}B(xe),S-=D.y,m+=D.y,b=S*y,g+=i.width-b}else B(xe),B(Be),D.x<=0?g>N?(b-=D.x,g+=D.x):D.y<=0&&m<=C&&(V=!1):(b-=D.x,g+=D.x),D.y<=0?m>C&&(S-=D.y,m+=D.y):(S-=D.y,m+=D.y);b<0&&S<0?(u=Xe,S=-S,b=-b,m-=S,g-=b):b<0?(u=Ye,b=-b,g-=b):S<0&&(u=Ze,S=-S,m-=S);break;case Ze:if(y){if(D.x<=0&&(g<=N||k>=T)){V=!1;break}B(Be),b-=D.x,g+=D.x,S=b/y}else B(Oe),B(Be),D.x<=0?g>N?(b-=D.x,g+=D.x):D.y>=0&&k>=T&&(V=!1):(b-=D.x,g+=D.x),D.y>=0?k<T&&(S+=D.y):S+=D.y;b<0&&S<0?(u=Ye,S=-S,b=-b,m-=S,g-=b):b<0?(u=Xe,b=-b,g-=b):S<0&&(u=We,S=-S,m-=S);break;case Xe:if(y){if(D.x>=0&&(x>=A||k>=T)){V=!1;break}B(Me),b+=D.x,S=b/y}else B(Oe),B(Me),D.x>=0?x<A?b+=D.x:D.y>=0&&k>=T&&(V=!1):b+=D.x,D.y>=0?k<T&&(S+=D.y):S+=D.y;b<0&&S<0?(u=We,S=-S,b=-b,m-=S,g-=b):b<0?(u=Ze,b=-b,g-=b):S<0&&(u=Ye,S=-S,m-=S);break;case Rr:this.move(D.x,D.y),V=!1;break;case Hr:this.zoom(il(c),t),V=!1;break;case zr:if(!D.x||!D.y){V=!1;break}j=cn(this.cropper),g=I.startX-j.left,m=I.startY-j.top,b=i.minWidth,S=i.minHeight,D.x>0?u=D.y>0?Xe:Ye:D.x<0&&(g-=b,u=D.y>0?Ze:We),D.y<0&&(m-=S),this.cropped||(ye(this.cropBox,Q),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}V&&(i.width=b,i.height=S,i.left=g,i.top=m,this.action=u,this.renderCropBox()),K(c,function(H){H.startX=H.endX,H.startY=H.endY})}},_l={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&q(this.dragBox,mt),ye(this.cropBox,Q),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(),ye(this.dragBox,mt),q(this.cropBox,Q)),this},replace:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),n?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,K(this.previews,function(s){s.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,ye(this.cropper,Fr)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,q(this.cropper,Fr)),this},destroy:function(){var t=this.element;return t[F]?(t[F]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,s=this.canvasData,l=s.left,i=s.top;return this.moveTo(Wt(t)?t:l+Number(t),Wt(n)?n:i+Number(n))},moveTo:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,s=this.canvasData,l=!1;return t=Number(t),n=Number(n),this.ready&&!this.disabled&&this.options.movable&&(P(t)&&(s.left=t,l=!0),P(n)&&(s.top=n,l=!0),l&&this.renderCanvas(!0)),this},zoom:function(t,n){var s=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(s.width*t/s.naturalWidth,null,n)},zoomTo:function(t,n,s){var l=this.options,i=this.canvasData,c=i.width,u=i.height,y=i.naturalWidth,g=i.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&l.zoomable){var m=y*t,b=g*t;if(Re(this.element,Yt,{ratio:t,oldRatio:c/y,originalEvent:s})===!1)return this;if(s){var S=this.pointers,x=cn(this.cropper),k=S&&Object.keys(S).length?al(S):{pageX:s.pageX,pageY:s.pageY};i.left-=(m-c)*((k.pageX-x.left-i.left)/c),i.top-=(b-u)*((k.pageY-x.top-i.top)/u)}else je(n)&&P(n.x)&&P(n.y)?(i.left-=(m-c)*((n.x-i.left)/c),i.top-=(b-u)*((n.y-i.top)/u)):(i.left-=(m-c)/2,i.top-=(b-u)/2);i.width=m,i.height=b,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),P(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var n=this.imageData.scaleY;return this.scale(t,P(n)?n:1)},scaleY:function(t){var n=this.imageData.scaleX;return this.scale(P(n)?n:1,t)},scale:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,s=this.imageData,l=!1;return t=Number(t),n=Number(n),this.ready&&!this.disabled&&this.options.scalable&&(P(t)&&(s.scaleX=t,l=!0),P(n)&&(s.scaleY=n,l=!0),l&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=this.options,s=this.imageData,l=this.canvasData,i=this.cropBoxData,c;if(this.ready&&this.cropped){c={x:i.left-l.left,y:i.top-l.top,width:i.width,height:i.height};var u=s.width/s.naturalWidth;if(K(c,function(m,b){c[b]=m/u}),t){var y=Math.round(c.y+c.height),g=Math.round(c.x+c.width);c.x=Math.round(c.x),c.y=Math.round(c.y),c.width=g-c.x,c.height=y-c.y}}else c={x:0,y:0,width:0,height:0};return n.rotatable&&(c.rotate=s.rotate||0),n.scalable&&(c.scaleX=s.scaleX||1,c.scaleY=s.scaleY||1),c},setData:function(t){var n=this.options,s=this.imageData,l=this.canvasData,i={};if(this.ready&&!this.disabled&&je(t)){var c=!1;n.rotatable&&P(t.rotate)&&t.rotate!==s.rotate&&(s.rotate=t.rotate,c=!0),n.scalable&&(P(t.scaleX)&&t.scaleX!==s.scaleX&&(s.scaleX=t.scaleX,c=!0),P(t.scaleY)&&t.scaleY!==s.scaleY&&(s.scaleY=t.scaleY,c=!0)),c&&this.renderCanvas(!0,!0);var u=s.width/s.naturalWidth;P(t.x)&&(i.left=t.x*u+l.left),P(t.y)&&(i.top=t.y*u+l.top),P(t.width)&&(i.width=t.width*u),P(t.height)&&(i.height=t.height*u),this.setCropBoxData(i)}return this},getContainerData:function(){return this.ready?U({},this.containerData):{}},getImageData:function(){return this.sized?U({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,n={};return this.ready&&K(["left","top","width","height","naturalWidth","naturalHeight"],function(s){n[s]=t[s]}),n},setCanvasData:function(t){var n=this.canvasData,s=n.aspectRatio;return this.ready&&!this.disabled&&je(t)&&(P(t.left)&&(n.left=t.left),P(t.top)&&(n.top=t.top),P(t.width)?(n.width=t.width,n.height=t.width/s):P(t.height)&&(n.height=t.height,n.width=t.height*s),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,n;return this.ready&&this.cropped&&(n={left:t.left,top:t.top,width:t.width,height:t.height}),n||{}},setCropBoxData:function(t){var n=this.cropBoxData,s=this.options.aspectRatio,l,i;return this.ready&&this.cropped&&!this.disabled&&je(t)&&(P(t.left)&&(n.left=t.left),P(t.top)&&(n.top=t.top),P(t.width)&&t.width!==n.width&&(l=!0,n.width=t.width),P(t.height)&&t.height!==n.height&&(i=!0,n.height=t.height),s&&(l?n.height=n.width/s:i&&(n.width=n.height*s)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var n=this.canvasData,s=cl(this.image,this.imageData,n,t);if(!this.cropped)return s;var l=this.getData(),i=l.x,c=l.y,u=l.width,y=l.height,g=s.width/Math.floor(n.naturalWidth);g!==1&&(i*=g,c*=g,u*=g,y*=g);var m=u/y,b=Ee({aspectRatio:m,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),S=Ee({aspectRatio:m,width:t.minWidth||0,height:t.minHeight||0},"cover"),x=Ee({aspectRatio:m,width:t.width||(g!==1?s.width:u),height:t.height||(g!==1?s.height:y)}),k=x.width,N=x.height;k=Math.min(b.width,Math.max(S.width,k)),N=Math.min(b.height,Math.max(S.height,N));var C=document.createElement("canvas"),A=C.getContext("2d");C.width=Pe(k),C.height=Pe(N),A.fillStyle=t.fillColor||"transparent",A.fillRect(0,0,k,N);var T=t.imageSmoothingEnabled,V=T===void 0?!0:T,j=t.imageSmoothingQuality;A.imageSmoothingEnabled=V,j&&(A.imageSmoothingQuality=j);var I=s.width,D=s.height,B=i,H=c,W,Y,te,ie,ne,re;B<=-u||B>I?(B=0,W=0,te=0,ne=0):B<=0?(te=-B,B=0,W=Math.min(I,u+B),ne=W):B<=I&&(te=0,W=Math.min(u,I-B),ne=W),W<=0||H<=-y||H>D?(H=0,Y=0,ie=0,re=0):H<=0?(ie=-H,H=0,Y=Math.min(D,y+H),re=Y):H<=D&&(ie=0,Y=Math.min(y,D-H),re=Y);var E=[B,H,W,Y];if(ne>0&&re>0){var $=k/u;E.push(te*$,ie*$,ne*$,re*$)}return A.drawImage.apply(A,[s].concat(Pr(E.map(function(M){return Math.floor(Pe(M))})))),C},setAspectRatio:function(t){var n=this.options;return!this.disabled&&!Wt(t)&&(n.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var n=this.options,s=this.dragBox,l=this.face;if(this.ready&&!this.disabled){var i=t===Rt,c=n.movable&&t===Kr;t=i||c?t:Yr,n.dragMode=t,Ge(s,qe,t),ze(s,Pt,i),ze(s,zt,c),n.cropBoxMovable||(Ge(l,qe,t),ze(l,Pt,i),ze(l,zt,c))}return this}},wl=ge.Cropper,fn=function(){function r(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(La(this,r),!t||!Za.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({},nn,je(n)&&n),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 Ia(r,[{key:"init",value:function(){var n=this.element,s=n.tagName.toLowerCase(),l;if(!n[F]){if(n[F]=this,s==="img"){if(this.isImg=!0,l=n.getAttribute("src")||"",this.originalUrl=l,!l)return;l=n.src}else s==="canvas"&&window.HTMLCanvasElement&&(l=n.toDataURL());this.load(l)}}},{key:"load",value:function(n){var s=this;if(n){this.url=n,this.imageData={};var l=this.element,i=this.options;if(!i.rotatable&&!i.scalable&&(i.checkOrientation=!1),!i.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Wa.test(n)){Xa.test(n)?this.read(ul(n)):this.clone();return}var c=new XMLHttpRequest,u=this.clone.bind(this);this.reloading=!0,this.xhr=c,c.onabort=u,c.onerror=u,c.ontimeout=u,c.onprogress=function(){c.getResponseHeader("content-type")!==en&&c.abort()},c.onload=function(){s.read(c.response)},c.onloadend=function(){s.reloading=!1,s.xhr=null},i.checkCrossOrigin&&dn(n)&&l.crossOrigin&&(n=hn(n)),c.open("GET",n,!0),c.responseType="arraybuffer",c.withCredentials=l.crossOrigin==="use-credentials",c.send()}}},{key:"read",value:function(n){var s=this.options,l=this.imageData,i=ml(n),c=0,u=1,y=1;if(i>1){this.url=fl(n,en);var g=pl(i);c=g.rotate,u=g.scaleX,y=g.scaleY}s.rotatable&&(l.rotate=c),s.scalable&&(l.scaleX=u,l.scaleY=y),this.clone()}},{key:"clone",value:function(){var n=this.element,s=this.url,l=n.crossOrigin,i=s;this.options.checkCrossOrigin&&dn(s)&&(l||(l="anonymous"),i=hn(s)),this.crossOrigin=l,this.crossOriginUrl=i;var c=document.createElement("img");l&&(c.crossOrigin=l),c.src=i||s,c.alt=n.alt||"The image to crop",this.image=c,c.onload=this.start.bind(this),c.onerror=this.stop.bind(this),q(c,Ur),n.parentNode.insertBefore(c,n.nextSibling)}},{key:"start",value:function(){var n=this,s=this.image;s.onload=null,s.onerror=null,this.sizing=!0;var l=ge.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ge.navigator.userAgent),i=function(g,m){U(n.imageData,{naturalWidth:g,naturalHeight:m,aspectRatio:g/m}),n.initialImageData=U({},n.imageData),n.sizing=!1,n.sized=!0,n.build()};if(s.naturalWidth&&!l){i(s.naturalWidth,s.naturalHeight);return}var c=document.createElement("img"),u=document.body||document.documentElement;this.sizingImage=c,c.onload=function(){i(c.width,c.height),l||u.removeChild(c)},c.src=s.src,l||(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;",u.appendChild(c))}},{key:"stop",value:function(){var n=this.image;n.onload=null,n.onerror=null,n.parentNode.removeChild(n),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var n=this.element,s=this.options,l=this.image,i=n.parentNode,c=document.createElement("div");c.innerHTML=qa;var u=c.querySelector(".".concat(F,"-container")),y=u.querySelector(".".concat(F,"-canvas")),g=u.querySelector(".".concat(F,"-drag-box")),m=u.querySelector(".".concat(F,"-crop-box")),b=m.querySelector(".".concat(F,"-face"));this.container=i,this.cropper=u,this.canvas=y,this.dragBox=g,this.cropBox=m,this.viewBox=u.querySelector(".".concat(F,"-view-box")),this.face=b,y.appendChild(l),q(n,Q),i.insertBefore(u,n.nextSibling),ye(l,Ur),this.initPreview(),this.bind(),s.initialAspectRatio=Math.max(0,s.initialAspectRatio)||NaN,s.aspectRatio=Math.max(0,s.aspectRatio)||NaN,s.viewMode=Math.max(0,Math.min(3,Math.round(s.viewMode)))||0,q(m,Q),s.guides||q(m.getElementsByClassName("".concat(F,"-dashed")),Q),s.center||q(m.getElementsByClassName("".concat(F,"-center")),Q),s.background&&q(u,"".concat(F,"-bg")),s.highlight||q(b,Ha),s.cropBoxMovable&&(q(b,zt),Ge(b,qe,jt)),s.cropBoxResizable||(q(m.getElementsByClassName("".concat(F,"-line")),Q),q(m.getElementsByClassName("".concat(F,"-point")),Q)),this.render(),this.ready=!0,this.setDragMode(s.dragMode),s.autoCrop&&this.crop(),this.setData(s.data),ee(s.ready)&&se(n,Gr,s.ready,{once:!0}),Re(n,Gr)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var n=this.cropper.parentNode;n&&n.removeChild(this.cropper),ye(this.element,Q)}}},{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=wl,r}},{key:"setDefaults",value:function(n){U(nn,je(n)&&n)}}]),r}();U(fn.prototype,gl,yl,bl,vl,Sl,_l);const kl={class:"flex"},xl=["aria-label"],Dl={class:"ml-auto mb-2"},El={class:"w-full flex justify-center"},Nl=["src"],Cl={__name:"Image",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const n=r,{t:s}=e.inject("i18n"),{apiUrl:l}=ue(),i=e.ref(null),c=e.ref(null),u=e.ref(!1),y=e.ref(""),g=e.ref(!1),m=()=>{u.value=!u.value,u.value?c.value=new fn(i.value,{crop(x){}}):c.value.destroy()},b=e.inject("postData"),S=()=>{c.value.getCroppedCanvas({width:795,height:341}).toBlob(x=>{y.value="",g.value=!1,it(l.value,{method:"POST",params:Object.assign(b,{q:"upload",adapter:n.selection.adapter,path:n.selection.item.path,file:x}),name:n.selection.item.basename,json:!1}).then(k=>{y.value=s("Updated."),i.value.src=_t(n.selection.adapter,n.selection.item.path),m(),t("load")}).catch(k=>{y.value=s(k.message),g.value=!0})})};return e.onMounted(()=>{t("load")}),(x,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",kl,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":r.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(r.selection.item.basename),9,xl),e.createElementVNode("div",Dl,[u.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:S,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(s)("Crop")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:k[0]||(k[0]=N=>m())},e.toDisplayString(u.value?e.unref(s)("Cancel"):e.unref(s)("Edit")),1)])]),e.createElementVNode("div",El,[e.createElementVNode("img",{ref_key:"image",ref:i,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(_t)(n.selection.adapter,n.selection.item.path),alt:""},null,8,Nl)]),y.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:k[1]||(k[1]=N=>y.value=""),error:g.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},Vl={class:"flex"},Ml=["aria-label"],Bl=e.createElementVNode("div",null,null,-1),$l={__name:"Default",props:{selection:Object},emits:["load"],setup(r,{emit:t}){return e.onMounted(()=>{t("load")}),(n,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Vl,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":r.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(r.selection.item.basename),9,Ml)]),Bl],64))}},Tl=["aria-label"],Al={class:"w-full",preload:"",controls:""},Ll=["src"],Il={__name:"Video",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const n=r,{apiUrl:s}=ue(),l=()=>s.value+"?"+Ne({q:"preview",adapter:n.selection.adapter,path:n.selection.item.path});return e.onMounted(()=>{t("load")}),(i,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":r.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(r.selection.item.basename),9,Tl),e.createElementVNode("div",null,[e.createElementVNode("video",Al,[e.createElementVNode("source",{src:l(),type:"video/mp4"},null,8,Ll),e.createTextVNode(" Your browser does not support the video tag. ")])])],64))}},Ol=["aria-label"],jl={class:"w-full",controls:""},Pl=["src"],zl={__name:"Audio",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const n=r,{apiUrl:s}=ue(),l=()=>s.value+"?"+Ne({q:"preview",adapter:n.selection.adapter,path:n.selection.item.path});return e.onMounted(()=>{t("load")}),(i,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":r.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(r.selection.item.basename),9,Ol),e.createElementVNode("div",null,[e.createElementVNode("audio",jl,[e.createElementVNode("source",{src:l(),type:"audio/mpeg"},null,8,Pl),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},Rl=["aria-label"],Hl=["data"],Fl=["src"],Ul={__name:"Pdf",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const n=r,{apiUrl:s}=ue(),l=()=>s.value+"?"+Ne({q:"preview",adapter:n.selection.adapter,path:n.selection.item.path});return e.onMounted(()=>{t("load")}),(i,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":r.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(r.selection.item.basename),9,Rl),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:l(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:l(),width:"100%",height:"100%"},`
12
+ */function zr(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),o.push.apply(o,i)}return o}function Rr(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?zr(Object(o),!0).forEach(function(i){Wa(n,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):zr(Object(o)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(o,i))})}return n}function It(n){"@babel/helpers - typeof";return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(n)}function Ya(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Hr(n,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function Ka(n,t,o){return t&&Hr(n.prototype,t),o&&Hr(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n}function Wa(n,t,o){return t in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}function Fr(n){return Xa(n)||Za(n)||qa(n)||Ga()}function Xa(n){if(Array.isArray(n))return Lt(n)}function Za(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function qa(n,t){if(n){if(typeof n=="string")return Lt(n,t);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set")return Array.from(n);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Lt(n,t)}}function Lt(n,t){(t==null||t>n.length)&&(t=n.length);for(var o=0,i=new Array(t);o<t;o++)i[o]=n[o];return i}function Ga(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ht=typeof window<"u"&&typeof window.document<"u",ge=ht?window:{},Ot=ht&&ge.document.documentElement?"ontouchstart"in ge.document.documentElement:!1,jt=ht?"PointerEvent"in ge:!1,F="cropper",Pt="all",Ur="crop",Yr="move",Kr="zoom",Te="e",Be="w",Le="s",xe="n",Ke="ne",We="nw",Xe="se",Ze="sw",zt="".concat(F,"-crop"),Wr="".concat(F,"-disabled"),Q="".concat(F,"-hidden"),Xr="".concat(F,"-hide"),Ja="".concat(F,"-invisible"),ut="".concat(F,"-modal"),Rt="".concat(F,"-move"),qe="".concat(F,"Action"),ft="".concat(F,"Preview"),Ht="crop",Zr="move",qr="none",Ft="crop",Ut="cropend",Yt="cropmove",Kt="cropstart",Gr="dblclick",Qa=Ot?"touchstart":"mousedown",el=Ot?"touchmove":"mousemove",tl=Ot?"touchend touchcancel":"mouseup",Jr=jt?"pointerdown":Qa,Qr=jt?"pointermove":el,en=jt?"pointerup pointercancel":tl,tn="ready",rn="resize",nn="wheel",Wt="zoom",on="image/jpeg",rl=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,nl=/^data:/,ol=/^data:image\/jpeg;base64,/,il=/^img|canvas$/i,sn=200,an=100,ln={viewMode:0,dragMode:Ht,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:sn,minContainerHeight:an,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},sl='<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>',al=Number.isNaN||ge.isNaN;function j(n){return typeof n=="number"&&!al(n)}var cn=function(t){return t>0&&t<1/0};function Xt(n){return typeof n>"u"}function $e(n){return It(n)==="object"&&n!==null}var ll=Object.prototype.hasOwnProperty;function Oe(n){if(!$e(n))return!1;try{var t=n.constructor,o=t.prototype;return t&&o&&ll.call(o,"isPrototypeOf")}catch{return!1}}function ee(n){return typeof n=="function"}var cl=Array.prototype.slice;function dn(n){return Array.from?Array.from(n):cl.call(n)}function K(n,t){return n&&ee(t)&&(Array.isArray(n)||j(n.length)?dn(n).forEach(function(o,i){t.call(n,o,i,n)}):$e(n)&&Object.keys(n).forEach(function(o){t.call(n,n[o],o,n)})),n}var U=Object.assign||function(t){for(var o=arguments.length,i=new Array(o>1?o-1:0),l=1;l<o;l++)i[l-1]=arguments[l];return $e(t)&&i.length>0&&i.forEach(function(a){$e(a)&&Object.keys(a).forEach(function(u){t[u]=a[u]})}),t},dl=/\.\d*(?:0|9){12}\d*$/;function je(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return dl.test(n)?Math.round(n*t)/t:n}var hl=/^width|height|left|top|marginLeft|marginTop$/;function De(n,t){var o=n.style;K(t,function(i,l){hl.test(l)&&j(i)&&(i="".concat(i,"px")),o[l]=i})}function ul(n,t){return n.classList?n.classList.contains(t):n.className.indexOf(t)>-1}function q(n,t){if(t){if(j(n.length)){K(n,function(i){q(i,t)});return}if(n.classList){n.classList.add(t);return}var o=n.className.trim();o?o.indexOf(t)<0&&(n.className="".concat(o," ").concat(t)):n.className=t}}function ye(n,t){if(t){if(j(n.length)){K(n,function(o){ye(o,t)});return}if(n.classList){n.classList.remove(t);return}n.className.indexOf(t)>=0&&(n.className=n.className.replace(t,""))}}function Pe(n,t,o){if(t){if(j(n.length)){K(n,function(i){Pe(i,t,o)});return}o?q(n,t):ye(n,t)}}var fl=/([a-z\d])([A-Z])/g;function Zt(n){return n.replace(fl,"$1-$2").toLowerCase()}function qt(n,t){return $e(n[t])?n[t]:n.dataset?n.dataset[t]:n.getAttribute("data-".concat(Zt(t)))}function Ge(n,t,o){$e(o)?n[t]=o:n.dataset?n.dataset[t]=o:n.setAttribute("data-".concat(Zt(t)),o)}function ml(n,t){if($e(n[t]))try{delete n[t]}catch{n[t]=void 0}else if(n.dataset)try{delete n.dataset[t]}catch{n.dataset[t]=void 0}else n.removeAttribute("data-".concat(Zt(t)))}var hn=/\s\s*/,un=function(){var n=!1;if(ht){var t=!1,o=function(){},i=Object.defineProperty({},"once",{get:function(){return n=!0,t},set:function(a){t=a}});ge.addEventListener("test",o,i),ge.removeEventListener("test",o,i)}return n}();function le(n,t,o){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=o;t.trim().split(hn).forEach(function(a){if(!un){var u=n.listeners;u&&u[a]&&u[a][o]&&(l=u[a][o],delete u[a][o],Object.keys(u[a]).length===0&&delete u[a],Object.keys(u).length===0&&delete n.listeners)}n.removeEventListener(a,l,i)})}function ie(n,t,o){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=o;t.trim().split(hn).forEach(function(a){if(i.once&&!un){var u=n.listeners,p=u===void 0?{}:u;l=function(){delete p[a][o],n.removeEventListener(a,l,i);for(var y=arguments.length,m=new Array(y),b=0;b<y;b++)m[b]=arguments[b];o.apply(n,m)},p[a]||(p[a]={}),p[a][o]&&n.removeEventListener(a,p[a][o],i),p[a][o]=l,n.listeners=p}n.addEventListener(a,l,i)})}function ze(n,t,o){var i;return ee(Event)&&ee(CustomEvent)?i=new CustomEvent(t,{detail:o,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,!0,!0,o)),n.dispatchEvent(i)}function fn(n){var t=n.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Gt=ge.location,pl=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function mn(n){var t=n.match(pl);return t!==null&&(t[1]!==Gt.protocol||t[2]!==Gt.hostname||t[3]!==Gt.port)}function pn(n){var t="timestamp=".concat(new Date().getTime());return n+(n.indexOf("?")===-1?"?":"&")+t}function Je(n){var t=n.rotate,o=n.scaleX,i=n.scaleY,l=n.translateX,a=n.translateY,u=[];j(l)&&l!==0&&u.push("translateX(".concat(l,"px)")),j(a)&&a!==0&&u.push("translateY(".concat(a,"px)")),j(t)&&t!==0&&u.push("rotate(".concat(t,"deg)")),j(o)&&o!==1&&u.push("scaleX(".concat(o,")")),j(i)&&i!==1&&u.push("scaleY(".concat(i,")"));var p=u.length?u.join(" "):"none";return{WebkitTransform:p,msTransform:p,transform:p}}function gl(n){var t=Rr({},n),o=0;return K(n,function(i,l){delete t[l],K(t,function(a){var u=Math.abs(i.startX-a.startX),p=Math.abs(i.startY-a.startY),c=Math.abs(i.endX-a.endX),y=Math.abs(i.endY-a.endY),m=Math.sqrt(u*u+p*p),b=Math.sqrt(c*c+y*y),S=(b-m)/m;Math.abs(S)>Math.abs(o)&&(o=S)})}),o}function mt(n,t){var o=n.pageX,i=n.pageY,l={endX:o,endY:i};return t?l:Rr({startX:o,startY:i},l)}function yl(n){var t=0,o=0,i=0;return K(n,function(l){var a=l.startX,u=l.startY;t+=a,o+=u,i+=1}),t/=i,o/=i,{pageX:t,pageY:o}}function Ee(n){var t=n.aspectRatio,o=n.height,i=n.width,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",a=cn(i),u=cn(o);if(a&&u){var p=o*t;l==="contain"&&p>i||l==="cover"&&p<i?o=i/t:i=o*t}else a?o=i/t:u&&(i=o*t);return{width:i,height:o}}function bl(n){var t=n.width,o=n.height,i=n.degree;if(i=Math.abs(i)%180,i===90)return{width:o,height:t};var l=i%90*Math.PI/180,a=Math.sin(l),u=Math.cos(l),p=t*u+o*a,c=t*a+o*u;return i>90?{width:c,height:p}:{width:p,height:c}}function vl(n,t,o,i){var l=t.aspectRatio,a=t.naturalWidth,u=t.naturalHeight,p=t.rotate,c=p===void 0?0:p,y=t.scaleX,m=y===void 0?1:y,b=t.scaleY,S=b===void 0?1:b,E=o.aspectRatio,_=o.naturalWidth,N=o.naturalHeight,D=i.fillColor,L=D===void 0?"transparent":D,$=i.imageSmoothingEnabled,T=$===void 0?!0:$,I=i.imageSmoothingQuality,R=I===void 0?"low":I,k=i.maxWidth,M=k===void 0?1/0:k,H=i.maxHeight,X=H===void 0?1/0:H,W=i.minWidth,te=W===void 0?0:W,se=i.minHeight,ne=se===void 0?0:se,re=document.createElement("canvas"),C=re.getContext("2d"),B=Ee({aspectRatio:E,width:M,height:X}),V=Ee({aspectRatio:E,width:te,height:ne},"cover"),Y=Math.min(B.width,Math.max(V.width,_)),O=Math.min(B.height,Math.max(V.height,N)),ce=Ee({aspectRatio:l,width:M,height:X}),ae=Ee({aspectRatio:l,width:te,height:ne},"cover"),pt=Math.min(ce.width,Math.max(ae.width,a)),gt=Math.min(ce.height,Math.max(ae.height,u)),Qt=[-pt/2,-gt/2,pt,gt];return re.width=je(Y),re.height=je(O),C.fillStyle=L,C.fillRect(0,0,Y,O),C.save(),C.translate(Y/2,O/2),C.rotate(c*Math.PI/180),C.scale(m,S),C.imageSmoothingEnabled=T,C.imageSmoothingQuality=R,C.drawImage.apply(C,[n].concat(Fr(Qt.map(function(yt){return Math.floor(je(yt))})))),C.restore(),re}var gn=String.fromCharCode;function Sl(n,t,o){var i="";o+=t;for(var l=t;l<o;l+=1)i+=gn(n.getUint8(l));return i}var wl=/^data:.*,/;function _l(n){var t=n.replace(wl,""),o=atob(t),i=new ArrayBuffer(o.length),l=new Uint8Array(i);return K(l,function(a,u){l[u]=o.charCodeAt(u)}),i}function kl(n,t){for(var o=[],i=8192,l=new Uint8Array(n);l.length>0;)o.push(gn.apply(null,dn(l.subarray(0,i)))),l=l.subarray(i);return"data:".concat(t,";base64,").concat(btoa(o.join("")))}function xl(n){var t=new DataView(n),o;try{var i,l,a;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var u=t.byteLength,p=2;p+1<u;){if(t.getUint8(p)===255&&t.getUint8(p+1)===225){l=p;break}p+=1}if(l){var c=l+4,y=l+10;if(Sl(t,c,4)==="Exif"){var m=t.getUint16(y);if(i=m===18761,(i||m===19789)&&t.getUint16(y+2,i)===42){var b=t.getUint32(y+4,i);b>=8&&(a=y+b)}}}if(a){var S=t.getUint16(a,i),E,_;for(_=0;_<S;_+=1)if(E=a+_*12+2,t.getUint16(E,i)===274){E+=8,o=t.getUint16(E,i),t.setUint16(E,1,i);break}}}catch{o=1}return o}function Dl(n){var t=0,o=1,i=1;switch(n){case 2:o=-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,o=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:o,scaleY:i}}var El={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,o=this.options,i=this.container,l=this.cropper,a=Number(o.minContainerWidth),u=Number(o.minContainerHeight);q(l,Q),ye(t,Q);var p={width:Math.max(i.offsetWidth,a>=0?a:sn),height:Math.max(i.offsetHeight,u>=0?u:an)};this.containerData=p,De(l,{width:p.width,height:p.height}),q(t,Q),ye(l,Q)},initCanvas:function(){var t=this.containerData,o=this.imageData,i=this.options.viewMode,l=Math.abs(o.rotate)%180===90,a=l?o.naturalHeight:o.naturalWidth,u=l?o.naturalWidth:o.naturalHeight,p=a/u,c=t.width,y=t.height;t.height*p>t.width?i===3?c=t.height*p:y=t.width/p:i===3?y=t.width/p:c=t.height*p;var m={aspectRatio:p,naturalWidth:a,naturalHeight:u,width:c,height:y};this.canvasData=m,this.limited=i===1||i===2,this.limitCanvas(!0,!0),m.width=Math.min(Math.max(m.width,m.minWidth),m.maxWidth),m.height=Math.min(Math.max(m.height,m.minHeight),m.maxHeight),m.left=(t.width-m.width)/2,m.top=(t.height-m.height)/2,m.oldLeft=m.left,m.oldTop=m.top,this.initialCanvasData=U({},m)},limitCanvas:function(t,o){var i=this.options,l=this.containerData,a=this.canvasData,u=this.cropBoxData,p=i.viewMode,c=a.aspectRatio,y=this.cropped&&u;if(t){var m=Number(i.minCanvasWidth)||0,b=Number(i.minCanvasHeight)||0;p>1?(m=Math.max(m,l.width),b=Math.max(b,l.height),p===3&&(b*c>m?m=b*c:b=m/c)):p>0&&(m?m=Math.max(m,y?u.width:0):b?b=Math.max(b,y?u.height:0):y&&(m=u.width,b=u.height,b*c>m?m=b*c:b=m/c));var S=Ee({aspectRatio:c,width:m,height:b});m=S.width,b=S.height,a.minWidth=m,a.minHeight=b,a.maxWidth=1/0,a.maxHeight=1/0}if(o)if(p>(y?0:1)){var E=l.width-a.width,_=l.height-a.height;a.minLeft=Math.min(0,E),a.minTop=Math.min(0,_),a.maxLeft=Math.max(0,E),a.maxTop=Math.max(0,_),y&&this.limited&&(a.minLeft=Math.min(u.left,u.left+(u.width-a.width)),a.minTop=Math.min(u.top,u.top+(u.height-a.height)),a.maxLeft=u.left,a.maxTop=u.top,p===2&&(a.width>=l.width&&(a.minLeft=Math.min(0,E),a.maxLeft=Math.max(0,E)),a.height>=l.height&&(a.minTop=Math.min(0,_),a.maxTop=Math.max(0,_))))}else a.minLeft=-a.width,a.minTop=-a.height,a.maxLeft=l.width,a.maxTop=l.height},renderCanvas:function(t,o){var i=this.canvasData,l=this.imageData;if(o){var a=bl({width:l.naturalWidth*Math.abs(l.scaleX||1),height:l.naturalHeight*Math.abs(l.scaleY||1),degree:l.rotate||0}),u=a.width,p=a.height,c=i.width*(u/i.naturalWidth),y=i.height*(p/i.naturalHeight);i.left-=(c-i.width)/2,i.top-=(y-i.height)/2,i.width=c,i.height=y,i.aspectRatio=u/p,i.naturalWidth=u,i.naturalHeight=p,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,De(this.canvas,U({width:i.width,height:i.height},Je({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var o=this.canvasData,i=this.imageData,l=i.naturalWidth*(o.width/o.naturalWidth),a=i.naturalHeight*(o.height/o.naturalHeight);U(i,{width:l,height:a,left:(o.width-l)/2,top:(o.height-a)/2}),De(this.image,U({width:i.width,height:i.height},Je(U({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,o=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,l=Number(t.autoCropArea)||.8,a={width:o.width,height:o.height};i&&(o.height*i>o.width?a.height=a.width/i:a.width=a.height*i),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*l),a.height=Math.max(a.minHeight,a.height*l),a.left=o.left+(o.width-a.width)/2,a.top=o.top+(o.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=U({},a)},limitCropBox:function(t,o){var i=this.options,l=this.containerData,a=this.canvasData,u=this.cropBoxData,p=this.limited,c=i.aspectRatio;if(t){var y=Number(i.minCropBoxWidth)||0,m=Number(i.minCropBoxHeight)||0,b=p?Math.min(l.width,a.width,a.width+a.left,l.width-a.left):l.width,S=p?Math.min(l.height,a.height,a.height+a.top,l.height-a.top):l.height;y=Math.min(y,l.width),m=Math.min(m,l.height),c&&(y&&m?m*c>y?m=y/c:y=m*c:y?m=y/c:m&&(y=m*c),S*c>b?S=b/c:b=S*c),u.minWidth=Math.min(y,b),u.minHeight=Math.min(m,S),u.maxWidth=b,u.maxHeight=S}o&&(p?(u.minLeft=Math.max(0,a.left),u.minTop=Math.max(0,a.top),u.maxLeft=Math.min(l.width,a.left+a.width)-u.width,u.maxTop=Math.min(l.height,a.top+a.height)-u.height):(u.minLeft=0,u.minTop=0,u.maxLeft=l.width-u.width,u.maxTop=l.height-u.height))},renderCropBox:function(){var t=this.options,o=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&&Ge(this.face,qe,i.width>=o.width&&i.height>=o.height?Yr:Pt),De(this.cropBox,U({width:i.width,height:i.height},Je({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ze(this.element,Ft,this.getData())}},Nl={initPreview:function(){var t=this.element,o=this.crossOrigin,i=this.options.preview,l=o?this.crossOriginUrl:this.url,a=t.alt||"The image to preview",u=document.createElement("img");if(o&&(u.crossOrigin=o),u.src=l,u.alt=a,this.viewBox.appendChild(u),this.viewBoxImage=u,!!i){var p=i;typeof i=="string"?p=t.ownerDocument.querySelectorAll(i):i.querySelector&&(p=[i]),this.previews=p,K(p,function(c){var y=document.createElement("img");Ge(c,ft,{width:c.offsetWidth,height:c.offsetHeight,html:c.innerHTML}),o&&(y.crossOrigin=o),y.src=l,y.alt=a,y.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;"',c.innerHTML="",c.appendChild(y)})}},resetPreview:function(){K(this.previews,function(t){var o=qt(t,ft);De(t,{width:o.width,height:o.height}),t.innerHTML=o.html,ml(t,ft)})},preview:function(){var t=this.imageData,o=this.canvasData,i=this.cropBoxData,l=i.width,a=i.height,u=t.width,p=t.height,c=i.left-o.left-t.left,y=i.top-o.top-t.top;!this.cropped||this.disabled||(De(this.viewBoxImage,U({width:u,height:p},Je(U({translateX:-c,translateY:-y},t)))),K(this.previews,function(m){var b=qt(m,ft),S=b.width,E=b.height,_=S,N=E,D=1;l&&(D=S/l,N=a*D),a&&N>E&&(D=E/a,_=l*D,N=E),De(m,{width:_,height:N}),De(m.getElementsByTagName("img")[0],U({width:u*D,height:p*D},Je(U({translateX:-c*D,translateY:-y*D},t))))}))}},Cl={bind:function(){var t=this.element,o=this.options,i=this.cropper;ee(o.cropstart)&&ie(t,Kt,o.cropstart),ee(o.cropmove)&&ie(t,Yt,o.cropmove),ee(o.cropend)&&ie(t,Ut,o.cropend),ee(o.crop)&&ie(t,Ft,o.crop),ee(o.zoom)&&ie(t,Wt,o.zoom),ie(i,Jr,this.onCropStart=this.cropStart.bind(this)),o.zoomable&&o.zoomOnWheel&&ie(i,nn,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),o.toggleDragModeOnDblclick&&ie(i,Gr,this.onDblclick=this.dblclick.bind(this)),ie(t.ownerDocument,Qr,this.onCropMove=this.cropMove.bind(this)),ie(t.ownerDocument,en,this.onCropEnd=this.cropEnd.bind(this)),o.responsive&&ie(window,rn,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,o=this.options,i=this.cropper;ee(o.cropstart)&&le(t,Kt,o.cropstart),ee(o.cropmove)&&le(t,Yt,o.cropmove),ee(o.cropend)&&le(t,Ut,o.cropend),ee(o.crop)&&le(t,Ft,o.crop),ee(o.zoom)&&le(t,Wt,o.zoom),le(i,Jr,this.onCropStart),o.zoomable&&o.zoomOnWheel&&le(i,nn,this.onWheel,{passive:!1,capture:!0}),o.toggleDragModeOnDblclick&&le(i,Gr,this.onDblclick),le(t.ownerDocument,Qr,this.onCropMove),le(t.ownerDocument,en,this.onCropEnd),o.responsive&&le(window,rn,this.onResize)}},Vl={resize:function(){if(!this.disabled){var t=this.options,o=this.container,i=this.containerData,l=o.offsetWidth/i.width,a=o.offsetHeight/i.height,u=Math.abs(l-1)>Math.abs(a-1)?l:a;if(u!==1){var p,c;t.restore&&(p=this.getCanvasData(),c=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(K(p,function(y,m){p[m]=y*u})),this.setCropBoxData(K(c,function(y,m){c[m]=y*u})))}}},dblclick:function(){this.disabled||this.options.dragMode===qr||this.setDragMode(ul(this.dragBox,zt)?Zr:Ht)},wheel:function(t){var o=this,i=Number(this.options.wheelZoomRatio)||.1,l=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){o.wheeling=!1},50),t.deltaY?l=t.deltaY>0?1:-1:t.wheelDelta?l=-t.wheelDelta/120:t.detail&&(l=t.detail>0?1:-1),this.zoom(-l*i,t)))},cropStart:function(t){var o=t.buttons,i=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(j(o)&&o!==1||j(i)&&i!==0||t.ctrlKey))){var l=this.options,a=this.pointers,u;t.changedTouches?K(t.changedTouches,function(p){a[p.identifier]=mt(p)}):a[t.pointerId||0]=mt(t),Object.keys(a).length>1&&l.zoomable&&l.zoomOnTouch?u=Kr:u=qt(t.target,qe),rl.test(u)&&ze(this.element,Kt,{originalEvent:t,action:u})!==!1&&(t.preventDefault(),this.action=u,this.cropping=!1,u===Ur&&(this.cropping=!0,q(this.dragBox,ut)))}},cropMove:function(t){var o=this.action;if(!(this.disabled||!o)){var i=this.pointers;t.preventDefault(),ze(this.element,Yt,{originalEvent:t,action:o})!==!1&&(t.changedTouches?K(t.changedTouches,function(l){U(i[l.identifier]||{},mt(l,!0))}):U(i[t.pointerId||0]||{},mt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var o=this.action,i=this.pointers;t.changedTouches?K(t.changedTouches,function(l){delete i[l.identifier]}):delete i[t.pointerId||0],o&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,Pe(this.dragBox,ut,this.cropped&&this.options.modal)),ze(this.element,Ut,{originalEvent:t,action:o}))}}},Ml={change:function(t){var o=this.options,i=this.canvasData,l=this.containerData,a=this.cropBoxData,u=this.pointers,p=this.action,c=o.aspectRatio,y=a.left,m=a.top,b=a.width,S=a.height,E=y+b,_=m+S,N=0,D=0,L=l.width,$=l.height,T=!0,I;!c&&t.shiftKey&&(c=b&&S?b/S:1),this.limited&&(N=a.minLeft,D=a.minTop,L=N+Math.min(l.width,i.width,i.left+i.width),$=D+Math.min(l.height,i.height,i.top+i.height));var R=u[Object.keys(u)[0]],k={x:R.endX-R.startX,y:R.endY-R.startY},M=function(X){switch(X){case Te:E+k.x>L&&(k.x=L-E);break;case Be:y+k.x<N&&(k.x=N-y);break;case xe:m+k.y<D&&(k.y=D-m);break;case Le:_+k.y>$&&(k.y=$-_);break}};switch(p){case Pt:y+=k.x,m+=k.y;break;case Te:if(k.x>=0&&(E>=L||c&&(m<=D||_>=$))){T=!1;break}M(Te),b+=k.x,b<0&&(p=Be,b=-b,y-=b),c&&(S=b/c,m+=(a.height-S)/2);break;case xe:if(k.y<=0&&(m<=D||c&&(y<=N||E>=L))){T=!1;break}M(xe),S-=k.y,m+=k.y,S<0&&(p=Le,S=-S,m-=S),c&&(b=S*c,y+=(a.width-b)/2);break;case Be:if(k.x<=0&&(y<=N||c&&(m<=D||_>=$))){T=!1;break}M(Be),b-=k.x,y+=k.x,b<0&&(p=Te,b=-b,y-=b),c&&(S=b/c,m+=(a.height-S)/2);break;case Le:if(k.y>=0&&(_>=$||c&&(y<=N||E>=L))){T=!1;break}M(Le),S+=k.y,S<0&&(p=xe,S=-S,m-=S),c&&(b=S*c,y+=(a.width-b)/2);break;case Ke:if(c){if(k.y<=0&&(m<=D||E>=L)){T=!1;break}M(xe),S-=k.y,m+=k.y,b=S*c}else M(xe),M(Te),k.x>=0?E<L?b+=k.x:k.y<=0&&m<=D&&(T=!1):b+=k.x,k.y<=0?m>D&&(S-=k.y,m+=k.y):(S-=k.y,m+=k.y);b<0&&S<0?(p=Ze,S=-S,b=-b,m-=S,y-=b):b<0?(p=We,b=-b,y-=b):S<0&&(p=Xe,S=-S,m-=S);break;case We:if(c){if(k.y<=0&&(m<=D||y<=N)){T=!1;break}M(xe),S-=k.y,m+=k.y,b=S*c,y+=a.width-b}else M(xe),M(Be),k.x<=0?y>N?(b-=k.x,y+=k.x):k.y<=0&&m<=D&&(T=!1):(b-=k.x,y+=k.x),k.y<=0?m>D&&(S-=k.y,m+=k.y):(S-=k.y,m+=k.y);b<0&&S<0?(p=Xe,S=-S,b=-b,m-=S,y-=b):b<0?(p=Ke,b=-b,y-=b):S<0&&(p=Ze,S=-S,m-=S);break;case Ze:if(c){if(k.x<=0&&(y<=N||_>=$)){T=!1;break}M(Be),b-=k.x,y+=k.x,S=b/c}else M(Le),M(Be),k.x<=0?y>N?(b-=k.x,y+=k.x):k.y>=0&&_>=$&&(T=!1):(b-=k.x,y+=k.x),k.y>=0?_<$&&(S+=k.y):S+=k.y;b<0&&S<0?(p=Ke,S=-S,b=-b,m-=S,y-=b):b<0?(p=Xe,b=-b,y-=b):S<0&&(p=We,S=-S,m-=S);break;case Xe:if(c){if(k.x>=0&&(E>=L||_>=$)){T=!1;break}M(Te),b+=k.x,S=b/c}else M(Le),M(Te),k.x>=0?E<L?b+=k.x:k.y>=0&&_>=$&&(T=!1):b+=k.x,k.y>=0?_<$&&(S+=k.y):S+=k.y;b<0&&S<0?(p=We,S=-S,b=-b,m-=S,y-=b):b<0?(p=Ze,b=-b,y-=b):S<0&&(p=Ke,S=-S,m-=S);break;case Yr:this.move(k.x,k.y),T=!1;break;case Kr:this.zoom(gl(u),t),T=!1;break;case Ur:if(!k.x||!k.y){T=!1;break}I=fn(this.cropper),y=R.startX-I.left,m=R.startY-I.top,b=a.minWidth,S=a.minHeight,k.x>0?p=k.y>0?Xe:Ke:k.x<0&&(y-=b,p=k.y>0?Ze:We),k.y<0&&(m-=S),this.cropped||(ye(this.cropBox,Q),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(a.width=b,a.height=S,a.left=y,a.top=m,this.action=p,this.renderCropBox()),K(u,function(H){H.startX=H.endX,H.startY=H.endY})}},Tl={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&q(this.dragBox,ut),ye(this.cropBox,Q),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(),ye(this.dragBox,ut),q(this.cropBox,Q)),this},replace:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),o?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,K(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,ye(this.cropper,Wr)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,q(this.cropper,Wr)),this},destroy:function(){var t=this.element;return t[F]?(t[F]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,l=i.left,a=i.top;return this.moveTo(Xt(t)?t:l+Number(t),Xt(o)?o:a+Number(o))},moveTo:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,l=!1;return t=Number(t),o=Number(o),this.ready&&!this.disabled&&this.options.movable&&(j(t)&&(i.left=t,l=!0),j(o)&&(i.top=o,l=!0),l&&this.renderCanvas(!0)),this},zoom:function(t,o){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,o)},zoomTo:function(t,o,i){var l=this.options,a=this.canvasData,u=a.width,p=a.height,c=a.naturalWidth,y=a.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&l.zoomable){var m=c*t,b=y*t;if(ze(this.element,Wt,{ratio:t,oldRatio:u/c,originalEvent:i})===!1)return this;if(i){var S=this.pointers,E=fn(this.cropper),_=S&&Object.keys(S).length?yl(S):{pageX:i.pageX,pageY:i.pageY};a.left-=(m-u)*((_.pageX-E.left-a.left)/u),a.top-=(b-p)*((_.pageY-E.top-a.top)/p)}else Oe(o)&&j(o.x)&&j(o.y)?(a.left-=(m-u)*((o.x-a.left)/u),a.top-=(b-p)*((o.y-a.top)/p)):(a.left-=(m-u)/2,a.top-=(b-p)/2);a.width=m,a.height=b,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),j(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var o=this.imageData.scaleY;return this.scale(t,j(o)?o:1)},scaleY:function(t){var o=this.imageData.scaleX;return this.scale(j(o)?o:1,t)},scale:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.imageData,l=!1;return t=Number(t),o=Number(o),this.ready&&!this.disabled&&this.options.scalable&&(j(t)&&(i.scaleX=t,l=!0),j(o)&&(i.scaleY=o,l=!0),l&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=this.options,i=this.imageData,l=this.canvasData,a=this.cropBoxData,u;if(this.ready&&this.cropped){u={x:a.left-l.left,y:a.top-l.top,width:a.width,height:a.height};var p=i.width/i.naturalWidth;if(K(u,function(m,b){u[b]=m/p}),t){var c=Math.round(u.y+u.height),y=Math.round(u.x+u.width);u.x=Math.round(u.x),u.y=Math.round(u.y),u.width=y-u.x,u.height=c-u.y}}else u={x:0,y:0,width:0,height:0};return o.rotatable&&(u.rotate=i.rotate||0),o.scalable&&(u.scaleX=i.scaleX||1,u.scaleY=i.scaleY||1),u},setData:function(t){var o=this.options,i=this.imageData,l=this.canvasData,a={};if(this.ready&&!this.disabled&&Oe(t)){var u=!1;o.rotatable&&j(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,u=!0),o.scalable&&(j(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,u=!0),j(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,u=!0)),u&&this.renderCanvas(!0,!0);var p=i.width/i.naturalWidth;j(t.x)&&(a.left=t.x*p+l.left),j(t.y)&&(a.top=t.y*p+l.top),j(t.width)&&(a.width=t.width*p),j(t.height)&&(a.height=t.height*p),this.setCropBoxData(a)}return this},getContainerData:function(){return this.ready?U({},this.containerData):{}},getImageData:function(){return this.sized?U({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,o={};return this.ready&&K(["left","top","width","height","naturalWidth","naturalHeight"],function(i){o[i]=t[i]}),o},setCanvasData:function(t){var o=this.canvasData,i=o.aspectRatio;return this.ready&&!this.disabled&&Oe(t)&&(j(t.left)&&(o.left=t.left),j(t.top)&&(o.top=t.top),j(t.width)?(o.width=t.width,o.height=t.width/i):j(t.height)&&(o.height=t.height,o.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,o;return this.ready&&this.cropped&&(o={left:t.left,top:t.top,width:t.width,height:t.height}),o||{}},setCropBoxData:function(t){var o=this.cropBoxData,i=this.options.aspectRatio,l,a;return this.ready&&this.cropped&&!this.disabled&&Oe(t)&&(j(t.left)&&(o.left=t.left),j(t.top)&&(o.top=t.top),j(t.width)&&t.width!==o.width&&(l=!0,o.width=t.width),j(t.height)&&t.height!==o.height&&(a=!0,o.height=t.height),i&&(l?o.height=o.width/i:a&&(o.width=o.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 o=this.canvasData,i=vl(this.image,this.imageData,o,t);if(!this.cropped)return i;var l=this.getData(),a=l.x,u=l.y,p=l.width,c=l.height,y=i.width/Math.floor(o.naturalWidth);y!==1&&(a*=y,u*=y,p*=y,c*=y);var m=p/c,b=Ee({aspectRatio:m,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),S=Ee({aspectRatio:m,width:t.minWidth||0,height:t.minHeight||0},"cover"),E=Ee({aspectRatio:m,width:t.width||(y!==1?i.width:p),height:t.height||(y!==1?i.height:c)}),_=E.width,N=E.height;_=Math.min(b.width,Math.max(S.width,_)),N=Math.min(b.height,Math.max(S.height,N));var D=document.createElement("canvas"),L=D.getContext("2d");D.width=je(_),D.height=je(N),L.fillStyle=t.fillColor||"transparent",L.fillRect(0,0,_,N);var $=t.imageSmoothingEnabled,T=$===void 0?!0:$,I=t.imageSmoothingQuality;L.imageSmoothingEnabled=T,I&&(L.imageSmoothingQuality=I);var R=i.width,k=i.height,M=a,H=u,X,W,te,se,ne,re;M<=-p||M>R?(M=0,X=0,te=0,ne=0):M<=0?(te=-M,M=0,X=Math.min(R,p+M),ne=X):M<=R&&(te=0,X=Math.min(p,R-M),ne=X),X<=0||H<=-c||H>k?(H=0,W=0,se=0,re=0):H<=0?(se=-H,H=0,W=Math.min(k,c+H),re=W):H<=k&&(se=0,W=Math.min(c,k-H),re=W);var C=[M,H,X,W];if(ne>0&&re>0){var B=_/p;C.push(te*B,se*B,ne*B,re*B)}return L.drawImage.apply(L,[i].concat(Fr(C.map(function(V){return Math.floor(je(V))})))),D},setAspectRatio:function(t){var o=this.options;return!this.disabled&&!Xt(t)&&(o.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var o=this.options,i=this.dragBox,l=this.face;if(this.ready&&!this.disabled){var a=t===Ht,u=o.movable&&t===Zr;t=a||u?t:qr,o.dragMode=t,Ge(i,qe,t),Pe(i,zt,a),Pe(i,Rt,u),o.cropBoxMovable||(Ge(l,qe,t),Pe(l,zt,a),Pe(l,Rt,u))}return this}},Bl=ge.Cropper,yn=function(){function n(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ya(this,n),!t||!il.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({},ln,Oe(o)&&o),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 Ka(n,[{key:"init",value:function(){var o=this.element,i=o.tagName.toLowerCase(),l;if(!o[F]){if(o[F]=this,i==="img"){if(this.isImg=!0,l=o.getAttribute("src")||"",this.originalUrl=l,!l)return;l=o.src}else i==="canvas"&&window.HTMLCanvasElement&&(l=o.toDataURL());this.load(l)}}},{key:"load",value:function(o){var i=this;if(o){this.url=o,this.imageData={};var l=this.element,a=this.options;if(!a.rotatable&&!a.scalable&&(a.checkOrientation=!1),!a.checkOrientation||!window.ArrayBuffer){this.clone();return}if(nl.test(o)){ol.test(o)?this.read(_l(o)):this.clone();return}var u=new XMLHttpRequest,p=this.clone.bind(this);this.reloading=!0,this.xhr=u,u.onabort=p,u.onerror=p,u.ontimeout=p,u.onprogress=function(){u.getResponseHeader("content-type")!==on&&u.abort()},u.onload=function(){i.read(u.response)},u.onloadend=function(){i.reloading=!1,i.xhr=null},a.checkCrossOrigin&&mn(o)&&l.crossOrigin&&(o=pn(o)),u.open("GET",o,!0),u.responseType="arraybuffer",u.withCredentials=l.crossOrigin==="use-credentials",u.send()}}},{key:"read",value:function(o){var i=this.options,l=this.imageData,a=xl(o),u=0,p=1,c=1;if(a>1){this.url=kl(o,on);var y=Dl(a);u=y.rotate,p=y.scaleX,c=y.scaleY}i.rotatable&&(l.rotate=u),i.scalable&&(l.scaleX=p,l.scaleY=c),this.clone()}},{key:"clone",value:function(){var o=this.element,i=this.url,l=o.crossOrigin,a=i;this.options.checkCrossOrigin&&mn(i)&&(l||(l="anonymous"),a=pn(i)),this.crossOrigin=l,this.crossOriginUrl=a;var u=document.createElement("img");l&&(u.crossOrigin=l),u.src=a||i,u.alt=o.alt||"The image to crop",this.image=u,u.onload=this.start.bind(this),u.onerror=this.stop.bind(this),q(u,Xr),o.parentNode.insertBefore(u,o.nextSibling)}},{key:"start",value:function(){var o=this,i=this.image;i.onload=null,i.onerror=null,this.sizing=!0;var l=ge.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ge.navigator.userAgent),a=function(y,m){U(o.imageData,{naturalWidth:y,naturalHeight:m,aspectRatio:y/m}),o.initialImageData=U({},o.imageData),o.sizing=!1,o.sized=!0,o.build()};if(i.naturalWidth&&!l){a(i.naturalWidth,i.naturalHeight);return}var u=document.createElement("img"),p=document.body||document.documentElement;this.sizingImage=u,u.onload=function(){a(u.width,u.height),l||p.removeChild(u)},u.src=i.src,l||(u.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;",p.appendChild(u))}},{key:"stop",value:function(){var o=this.image;o.onload=null,o.onerror=null,o.parentNode.removeChild(o),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var o=this.element,i=this.options,l=this.image,a=o.parentNode,u=document.createElement("div");u.innerHTML=sl;var p=u.querySelector(".".concat(F,"-container")),c=p.querySelector(".".concat(F,"-canvas")),y=p.querySelector(".".concat(F,"-drag-box")),m=p.querySelector(".".concat(F,"-crop-box")),b=m.querySelector(".".concat(F,"-face"));this.container=a,this.cropper=p,this.canvas=c,this.dragBox=y,this.cropBox=m,this.viewBox=p.querySelector(".".concat(F,"-view-box")),this.face=b,c.appendChild(l),q(o,Q),a.insertBefore(p,o.nextSibling),ye(l,Xr),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,q(m,Q),i.guides||q(m.getElementsByClassName("".concat(F,"-dashed")),Q),i.center||q(m.getElementsByClassName("".concat(F,"-center")),Q),i.background&&q(p,"".concat(F,"-bg")),i.highlight||q(b,Ja),i.cropBoxMovable&&(q(b,Rt),Ge(b,qe,Pt)),i.cropBoxResizable||(q(m.getElementsByClassName("".concat(F,"-line")),Q),q(m.getElementsByClassName("".concat(F,"-point")),Q)),this.render(),this.ready=!0,this.setDragMode(i.dragMode),i.autoCrop&&this.crop(),this.setData(i.data),ee(i.ready)&&ie(o,tn,i.ready,{once:!0}),ze(o,tn)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var o=this.cropper.parentNode;o&&o.removeChild(this.cropper),ye(this.element,Q)}}},{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=Bl,n}},{key:"setDefaults",value:function(o){U(ln,Oe(o)&&o)}}]),n}();U(yn.prototype,El,Nl,Cl,Vl,Ml,Tl);const $l={class:"flex"},Al=["aria-label"],Il={class:"ml-auto mb-2"},Ll={class:"w-full flex justify-center"},Ol=["src"],jl={__name:"Image",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{t:i}=e.inject("i18n"),{apiUrl:l}=ue(),a=e.ref(null),u=e.ref(null),p=e.ref(!1),c=e.ref(""),y=e.ref(!1),m=()=>{p.value=!p.value,p.value?u.value=new yn(a.value,{crop(E){}}):u.value.destroy()},b=e.inject("postData"),S=()=>{u.value.getCroppedCanvas({width:795,height:341}).toBlob(E=>{c.value="",y.value=!1,ot(l.value,{method:"POST",params:Object.assign(b,{q:"upload",adapter:o.selection.adapter,path:o.selection.item.path,file:E}),name:o.selection.item.basename,json:!1}).then(_=>{c.value=i("Updated."),a.value.src=_t(o.selection.adapter,o.selection.item.path),m(),t("load")}).catch(_=>{c.value=i(_.message),y.value=!0})})};return e.onMounted(()=>{t("load")}),(E,_)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",$l,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Al),e.createElementVNode("div",Il,[p.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:S,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:_[0]||(_[0]=N=>m())},e.toDisplayString(p.value?e.unref(i)("Cancel"):e.unref(i)("Edit")),1)])]),e.createElementVNode("div",Ll,[e.createElementVNode("img",{ref_key:"image",ref:a,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(_t)(o.selection.adapter,o.selection.item.path),alt:""},null,8,Ol)]),c.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:_[1]||(_[1]=N=>c.value=""),error:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},Pl={class:"flex"},zl=["aria-label"],Rl=e.createElementVNode("div",null,null,-1),Hl={__name:"Default",props:{selection:Object},emits:["load"],setup(n,{emit:t}){return e.onMounted(()=>{t("load")}),(o,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pl,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,zl)]),Rl],64))}},Fl=["aria-label"],Ul={class:"w-full",preload:"",controls:""},Yl=["src"],Kl={__name:"Video",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{apiUrl:i}=ue(),l=()=>i.value+"?"+Ce({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(a,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Fl),e.createElementVNode("div",null,[e.createElementVNode("video",Ul,[e.createElementVNode("source",{src:l(),type:"video/mp4"},null,8,Yl),e.createTextVNode(" Your browser does not support the video tag. ")])])],64))}},Wl=["aria-label"],Xl={class:"w-full",controls:""},Zl=["src"],ql={__name:"Audio",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{apiUrl:i}=ue(),l=()=>i.value+"?"+Ce({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(a,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Wl),e.createElementVNode("div",null,[e.createElementVNode("audio",Xl,[e.createElementVNode("source",{src:l(),type:"audio/mpeg"},null,8,Zl),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},Gl=["aria-label"],Jl=["data"],Ql=["src"],ec={__name:"Pdf",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{apiUrl:i}=ue(),l=()=>i.value+"?"+Ce({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(a,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Gl),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:l(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:l(),width:"100%",height:"100%"},`
14
14
  <p>
15
15
  Your browser does not support PDFs.
16
16
  <a href="https://example.com/test.pdf">Download the PDF</a>
17
17
  .
18
18
  </p>
19
- `,8,Fl)],8,Hl)])],64))}},Kl={class:"sm:flex sm:items-start"},Yl={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},Wl={class:"text-gray-700 dark:text-gray-200 text-sm"},Xl={key:0,class:"flex leading-5"},Zl=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),ql={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},Gl={class:"font-bold pl-2"},Jl={class:"font-bold pl-2"},Ql=Object.assign({name:"VFModalPreview"},{props:{selection:Object},setup(r){const t=r,{apiUrl:n}=ue(),s=e.inject("emitter"),{t:l}=e.inject("i18n"),i=e.ref(!1),c=g=>i.value=g,u=g=>(t.selection.item.mime_type??"").startsWith(g),y=()=>{const g=n.value+"?"+Ne({q:"download",adapter:t.selection.adapter,path:t.selection.item.path});s.emit("vf-download",g)};return(g,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m[6]||(m[6]=b=>e.unref(s).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 dark:focus:ring-gray-400 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Close")),1),e.createElementVNode("button",{type:"button",onClick:m[7]||(m[7]=b=>y()),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 dark:focus:ring-gray-400 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Download")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Kl,[e.createElementVNode("div",Yl,[e.createElementVNode("div",null,[u("text")?(e.openBlock(),e.createBlock(Aa,{key:0,selection:r.selection,onLoad:m[0]||(m[0]=b=>c(!0))},null,8,["selection"])):u("image")?(e.openBlock(),e.createBlock(Cl,{key:1,selection:r.selection,onLoad:m[1]||(m[1]=b=>c(!0))},null,8,["selection"])):u("video")?(e.openBlock(),e.createBlock(Il,{key:2,selection:r.selection,onLoad:m[2]||(m[2]=b=>c(!0))},null,8,["selection"])):u("audio")?(e.openBlock(),e.createBlock(zl,{key:3,selection:r.selection,onLoad:m[3]||(m[3]=b=>c(!0))},null,8,["selection"])):u("application/pdf")?(e.openBlock(),e.createBlock(Ul,{key:4,selection:r.selection,onLoad:m[4]||(m[4]=b=>c(!0))},null,8,["selection"])):(e.openBlock(),e.createBlock($l,{key:5,selection:r.selection,onLoad:m[5]||(m[5]=b=>c(!0))},null,8,["selection"]))]),e.createElementVNode("div",Wl,[i.value==!1?(e.openBlock(),e.createElementBlock("div",Xl,[Zl,e.createElementVNode("span",null,e.toDisplayString(e.unref(l)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",ql,[e.createElementVNode("div",null,[e.createElementVNode("span",Gl,e.toDisplayString(e.unref(l)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(tr)(r.selection.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",Jl,e.toDisplayString(e.unref(l)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(rr)(r.selection.item.last_modified)),1)])])]),_:1}))}}),ec={class:"sm:flex sm:items-start"},tc=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),rc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},nc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},oc={class:"mt-2"},sc={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},ic={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"},ac=[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)],lc={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"},cc=[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)],dc={class:"ml-1.5"},hc=["onKeyup"],uc=Object.assign({name:"VFModalRename"},{props:{selection:Object,current:Object},setup(r){const t=r,n=e.inject("emitter");e.inject("storage");const s=e.inject("adapter"),{t:l}=e.inject("i18n"),i=e.ref(t.selection.items[0]),c=e.ref(t.selection.items[0].basename),u=e.ref(""),y=()=>{c.value!=""&&n.emit("vf-fetch",{params:{q:"rename",adapter:s.value,path:t.current.dirname,item:i.value.path,name:c.value},onSuccess:()=>{n.emit("vf-toast-push",{label:l("%s is renamed.",c.value)})},onError:g=>{u.value=l(g.message)}})};return(g,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:y,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:m[2]||(m[2]=b=>e.unref(n).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ec,[tc,e.createElementVNode("div",rc,[e.createElementVNode("h3",nc,e.toDisplayString(e.unref(l)("Rename")),1),e.createElementVNode("div",oc,[e.createElementVNode("p",sc,[i.value.type=="dir"?(e.openBlock(),e.createElementBlock("svg",ic,ac)):(e.openBlock(),e.createElementBlock("svg",lc,cc)),e.createElementVNode("span",dc,e.toDisplayString(i.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>c.value=b),onKeyup:e.withKeys(y,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,40,hc),[[e.vModelText,c.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[1]||(m[1]=b=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),fc={class:"sm:flex sm:items-start"},mc=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),pc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},gc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},yc={class:"mt-2"},bc={class:"text-gray-500 mb-1"},vc=["id"],Sc={key:0,class:"py-2"},_c=["disabled","onClick"],wc=Object.assign({name:"VFModalUpload"},{props:{current:Object},setup(r){const t=r,n=e.inject("emitter"),{apiUrl:s}=ue(),{t:l}=e.inject("i18n"),i=e.inject("maxFileSize"),c=e.ref(null),u=e.ref(null),y=e.ref(null),g=e.ref([]),m=e.ref(""),b=e.ref(!0),S=()=>{m.value="",c.value.start()},x=e.inject("postData");return e.onMounted(()=>{c.value=new ve.Uploader({runtimes:"html5",browse_button:y.value,container:u.value,max_file_size:i,multiple_queues:!0,file_data_name:"file",url:s.value+"?"+Ne(Object.assign(x,{q:"upload",adapter:t.current.adapter,path:t.current.dirname})),headers:{...st&&{"X-CSRF-Token":st}},init:{PostInit:function(){},FilesAdded:function(k,N){b.value=!1,ve.each(N,function(C){g.value.push({id:C.id,name:C.name,size:ve.formatSize(C.size),percent:""})})},UploadProgress:function(k,N){g.value[g.value.findIndex(C=>C.id==N.id)].percent=N.percent+"%"},UploadComplete:function(){b.value=!0,n.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})},Error:function(k,N){c.value.stop(),N.code==ve.HTTP_ERROR?m.value=l(JSON.parse(N.response).message):N.code==ve.FILE_SIZE_ERROR?m.value=l("The selected file exceeds the maximum file size. You cannot upload files greater than %s",[i]):m.value=l(N.message)}}}),c.value.init()}),(k,N)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{disabled:b.value,onClick:e.withModifiers(S,["prevent"]),type:"button",class:e.normalizeClass([b.value?"bg-blue-200 hover:bg-blue-200 dark:bg-gray-700/50 dark:hover:bg-gray-700/50 dark:text-gray-500":"bg-blue-600 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-500","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(l)("Upload")),11,_c),e.createElementVNode("button",{type:"button",onClick:N[1]||(N[1]=C=>e.unref(n).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",fc,[mc,e.createElementVNode("div",pc,[e.createElementVNode("h3",gc,e.toDisplayString(e.unref(l)("Upload files")),1),e.createElementVNode("div",yc,[e.createElementVNode("div",bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,C=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{id:C.id},[e.createTextVNode(e.toDisplayString(C.name)+" ( "+e.toDisplayString(C.size)+") ",1),e.createElementVNode("b",null,e.toDisplayString(C.percent),1)],8,vc)]))),256)),g.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Sc,e.toDisplayString(e.unref(l)("No files selected!")),1))]),e.createElementVNode("div",{class:"text-gray-500",ref_key:"container",ref:u},[e.createElementVNode("button",{ref_key:"pickFiles",ref:y,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(l)("Select Files")),513)],512),m.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:N[0]||(N[0]=C=>m.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),kc={class:"sm:flex sm:items-start"},xc=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),Dc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ec={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Nc={class:"mt-2"},Cc={class:"flex text-sm text-gray-800 dark:text-gray-400"},Vc={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"},Mc=[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)],Bc={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"},$c=[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)],Tc={class:"ml-1.5"},Ac=["onKeyup","placeholder"],Lc=Object.assign({name:"VFModalArchive"},{props:{selection:Object,current:Object},setup(r){const t=r,n=e.inject("emitter");e.inject("storage");const s=e.inject("adapter"),{t:l}=e.inject("i18n"),i=e.ref(""),c=e.ref(""),u=e.ref(t.selection.items),y=()=>{u.value.length&&n.emit("vf-fetch",{params:{q:"archive",adapter:s.value,path:t.current.dirname,items:JSON.stringify(u.value.map(({path:g,type:m})=>({path:g,type:m}))),name:i.value},onSuccess:()=>{n.emit("vf-toast-push",{label:l("The file(s) archived.")})},onError:g=>{c.value=l(g.message)}})};return(g,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:y,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:m[2]||(m[2]=b=>e.unref(n).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",kc,[xc,e.createElementVNode("div",Dc,[e.createElementVNode("h3",Ec,e.toDisplayString(e.unref(l)("Archive the files")),1),e.createElementVNode("div",Nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,b=>(e.openBlock(),e.createElementBlock("p",Cc,[b.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Vc,Mc)):(e.openBlock(),e.createElementBlock("svg",Bc,$c)),e.createElementVNode("span",Tc,e.toDisplayString(b.basename),1)]))),256)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>i.value=b),onKeyup:e.withKeys(y,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(l)("Archive name. (.zip file will be created)"),type:"text"},null,40,Ac),[[e.vModelText,i.value]]),c.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[1]||(m[1]=b=>c.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ic={class:"sm:flex sm:items-start"},Oc=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),jc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Pc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},zc={class:"mt-2"},Rc={class:"flex text-sm text-gray-800 dark:text-gray-400"},Hc={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"},Fc=[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)],Uc={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"},Kc=[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)],Yc={class:"ml-1.5"},Wc={class:"my-1 text-sm text-gray-500"},Xc=Object.assign({name:"VFModalUnarchive"},{props:{selection:Object,current:Object},setup(r){const t=r,n=e.inject("emitter");e.inject("storage");const s=e.inject("adapter"),{t:l}=e.inject("i18n");e.ref("");const i=e.ref(t.selection.items[0]),c=e.ref(""),u=e.ref([]),y=()=>{n.emit("vf-fetch",{params:{q:"unarchive",adapter:s.value,path:t.current.dirname,item:i.value.path},onSuccess:()=>{n.emit("vf-toast-push",{label:l("The file unarchived.")})},onError:g=>{c.value=l(g.message)}})};return(g,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:y,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:m[1]||(m[1]=b=>e.unref(n).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ic,[Oc,e.createElementVNode("div",jc,[e.createElementVNode("h3",Pc,e.toDisplayString(e.unref(l)("Unarchive")),1),e.createElementVNode("div",zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,b=>(e.openBlock(),e.createElementBlock("p",Rc,[b.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Hc,Fc)):(e.openBlock(),e.createElementBlock("svg",Uc,Kc)),e.createElementVNode("span",Yc,e.toDisplayString(b.basename),1)]))),256)),e.createElementVNode("p",Wc,e.toDisplayString(e.unref(l)("The archive will be unarchived at"))+" ("+e.toDisplayString(r.current.dirname)+")",1),c.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[0]||(m[0]=b=>c.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Zc={class:"sm:flex sm:items-start"},qc=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),Gc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Jc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Qc={class:"mt-2"},ed={class:"flex text-sm text-gray-800 dark:text-gray-400"},td={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"},rd=[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)],nd={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"},od=[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)],sd={class:"ml-1.5"},id={class:"text-sm text-gray-500 pb-1 pt-3"},ad={class:"flex text-sm text-gray-800 dark:text-gray-400"},ld=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),cd={class:"ml-1.5 overflow-auto"},Gt={VueFinder:ji,...Object.freeze(Object.defineProperty({__proto__:null,ModalDelete:sa,ModalMessage:ua,ModalNewFolder:Sa,ModalNewFile:Ca,ModalPreview:Ql,ModalRename:uc,ModalUpload:wc,ModalArchive:Lc,ModalUnarchive:Xc,ModalMove:Object.assign({name:"VFModalMove"},{props:{selection:Object,current:Object},setup(r){const t=r,n=e.inject("emitter"),{t:s}=e.inject("i18n");e.inject("storage");const l=e.inject("adapter"),i=e.ref(t.selection.items.from),c=e.ref(""),u=()=>{i.value.length&&n.emit("vf-fetch",{params:{q:"move",adapter:l.value,path:t.current.dirname,items:JSON.stringify(i.value.map(({path:y,type:g})=>({path:y,type:g}))),item:t.selection.items.to.path},onSuccess:()=>{n.emit("vf-toast-push",{label:s("Files moved.",t.selection.items.to.name)})},onError:y=>{c.value=s(y.message)}})};return(y,g)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:g[1]||(g[1]=m=>e.unref(n).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",Zc,[qc,e.createElementVNode("div",Gc,[e.createElementVNode("h3",Jc,e.toDisplayString(e.unref(s)("Move files")),1),e.createElementVNode("div",Qc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,m=>(e.openBlock(),e.createElementBlock("p",ed,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",td,rd)):(e.openBlock(),e.createElementBlock("svg",nd,od)),e.createElementVNode("span",sd,e.toDisplayString(m.path),1)]))),256)),e.createElementVNode("p",id,e.toDisplayString(e.unref(s)("Are you sure you want to move these files?")),1),e.createElementVNode("p",ad,[ld,e.createElementVNode("span",cd,e.toDisplayString(r.selection.items.to.path),1)]),c.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:g[0]||(g[0]=m=>c.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}})},Symbol.toStringTag,{value:"Module"}))},eu="",tu="",dd={install(r){for(const t in Gt)if(Gt.hasOwnProperty(t)){const n=Gt[t];r.component(n.name,n)}}},hd=Object.freeze(Object.defineProperty({__proto__:null,default:`{
19
+ `,8,Ql)],8,Jl)])],64))}},tc={class:"sm:flex sm:items-start"},rc={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},nc={class:"text-gray-700 dark:text-gray-200 text-sm"},oc={key:0,class:"flex leading-5"},ic=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),sc={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},ac={class:"font-bold pl-2"},lc={class:"font-bold pl-2"},cc=Object.assign({name:"VFModalPreview"},{props:{selection:Object},setup(n){const t=n,{apiUrl:o}=ue(),i=e.inject("emitter"),{t:l}=e.inject("i18n"),a=e.ref(!1),u=y=>a.value=y,p=y=>(t.selection.item.mime_type??"").startsWith(y),c=()=>{const y=o.value+"?"+Ce({q:"download",adapter:t.selection.adapter,path:t.selection.item.path});i.emit("vf-download",y)};return(y,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m[6]||(m[6]=b=>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 dark:focus:ring-gray-400 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Close")),1),e.createElementVNode("button",{type:"button",onClick:m[7]||(m[7]=b=>c()),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 dark:focus:ring-gray-400 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Download")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",tc,[e.createElementVNode("div",rc,[e.createElementVNode("div",null,[p("text")?(e.openBlock(),e.createBlock(Ua,{key:0,selection:n.selection,onLoad:m[0]||(m[0]=b=>u(!0))},null,8,["selection"])):p("image")?(e.openBlock(),e.createBlock(jl,{key:1,selection:n.selection,onLoad:m[1]||(m[1]=b=>u(!0))},null,8,["selection"])):p("video")?(e.openBlock(),e.createBlock(Kl,{key:2,selection:n.selection,onLoad:m[2]||(m[2]=b=>u(!0))},null,8,["selection"])):p("audio")?(e.openBlock(),e.createBlock(ql,{key:3,selection:n.selection,onLoad:m[3]||(m[3]=b=>u(!0))},null,8,["selection"])):p("application/pdf")?(e.openBlock(),e.createBlock(ec,{key:4,selection:n.selection,onLoad:m[4]||(m[4]=b=>u(!0))},null,8,["selection"])):(e.openBlock(),e.createBlock(Hl,{key:5,selection:n.selection,onLoad:m[5]||(m[5]=b=>u(!0))},null,8,["selection"]))]),e.createElementVNode("div",nc,[a.value==!1?(e.openBlock(),e.createElementBlock("div",oc,[ic,e.createElementVNode("span",null,e.toDisplayString(e.unref(l)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",sc,[e.createElementVNode("div",null,[e.createElementVNode("span",ac,e.toDisplayString(e.unref(l)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(ir)(n.selection.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",lc,e.toDisplayString(e.unref(l)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(sr)(n.selection.item.last_modified)),1)])])]),_:1}))}}),dc={class:"sm:flex sm:items-start"},hc=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),uc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},fc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},mc={class:"mt-2"},pc={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},gc={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"},yc=[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)],bc={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"},vc=[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)],Sc={class:"ml-1.5"},wc=["onKeyup"],_c=Object.assign({name:"VFModalRename"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(t.selection.items[0]),u=e.ref(t.selection.items[0].basename),p=e.ref(""),c=()=>{u.value!=""&&o.emit("vf-fetch",{params:{q:"rename",adapter:i.value,path:t.current.dirname,item:a.value.path,name:u.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is renamed.",u.value)})},onError:y=>{p.value=l(y.message)}})};return(y,m)=>(e.openBlock(),e.createBlock(me,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-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:m[2]||(m[2]=b=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",dc,[hc,e.createElementVNode("div",uc,[e.createElementVNode("h3",fc,e.toDisplayString(e.unref(l)("Rename")),1),e.createElementVNode("div",mc,[e.createElementVNode("p",pc,[a.value.type=="dir"?(e.openBlock(),e.createElementBlock("svg",gc,yc)):(e.openBlock(),e.createElementBlock("svg",bc,vc)),e.createElementVNode("span",Sc,e.toDisplayString(a.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>u.value=b),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,40,wc),[[e.vModelText,u.value]]),p.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[1]||(m[1]=b=>p.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),kc={class:"sm:flex sm:items-start"},xc=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),Dc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ec={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Nc={class:"mt-2"},Cc={class:"text-gray-500 mb-1"},Vc=["id"],Mc={key:0,class:"py-2"},Tc=["disabled","onClick"],Bc=Object.assign({name:"VFModalUpload"},{props:{current:Object},setup(n){const t=n,o=e.inject("emitter"),{apiUrl:i}=ue(),{t:l}=e.inject("i18n"),a=e.inject("maxFileSize"),u=e.ref(null),p=e.ref(null),c=e.ref(null),y=e.ref([]),m=e.ref(""),b=e.ref(!0),S=()=>{m.value="",u.value.start()},E=e.inject("postData");return e.onMounted(()=>{u.value=new ve.Uploader({runtimes:"html5",browse_button:c.value,container:p.value,max_file_size:a,multiple_queues:!0,file_data_name:"file",url:i.value+"?"+Ce(Object.assign(E,{q:"upload",adapter:t.current.adapter,path:t.current.dirname})),headers:{...nt&&{"X-CSRF-Token":nt}},init:{PostInit:function(){},FilesAdded:function(_,N){b.value=!1,ve.each(N,function(D){y.value.push({id:D.id,name:D.name,size:ve.formatSize(D.size),percent:""})})},UploadProgress:function(_,N){y.value[y.value.findIndex(D=>D.id==N.id)].percent=N.percent+"%"},UploadComplete:function(){b.value=!0,o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})},Error:function(_,N){u.value.stop(),N.code==ve.HTTP_ERROR?m.value=l(JSON.parse(N.response).message):N.code==ve.FILE_SIZE_ERROR?m.value=l("The selected file exceeds the maximum file size. You cannot upload files greater than %s",[a]):m.value=l(N.message)}}}),u.value.init()}),(_,N)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{disabled:b.value,onClick:e.withModifiers(S,["prevent"]),type:"button",class:e.normalizeClass([b.value?"bg-blue-200 hover:bg-blue-200 dark:bg-gray-700/50 dark:hover:bg-gray-700/50 dark:text-gray-500":"bg-blue-600 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-500","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(l)("Upload")),11,Tc),e.createElementVNode("button",{type:"button",onClick:N[1]||(N[1]=D=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",kc,[xc,e.createElementVNode("div",Dc,[e.createElementVNode("h3",Ec,e.toDisplayString(e.unref(l)("Upload files")),1),e.createElementVNode("div",Nc,[e.createElementVNode("div",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,D=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{id:D.id},[e.createTextVNode(e.toDisplayString(D.name)+" ( "+e.toDisplayString(D.size)+") ",1),e.createElementVNode("b",null,e.toDisplayString(D.percent),1)],8,Vc)]))),256)),y.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Mc,e.toDisplayString(e.unref(l)("No files selected!")),1))]),e.createElementVNode("div",{class:"text-gray-500",ref_key:"container",ref:p},[e.createElementVNode("button",{ref_key:"pickFiles",ref:c,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(l)("Select Files")),513)],512),m.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:N[0]||(N[0]=D=>m.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),$c={class:"sm:flex sm:items-start"},Ac=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),Ic={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Lc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Oc={class:"mt-2"},jc={class:"flex text-sm text-gray-800 dark:text-gray-400"},Pc={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"},zc=[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)],Rc={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"},Hc=[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)],Fc={class:"ml-1.5"},Uc=["onKeyup","placeholder"],Yc=Object.assign({name:"VFModalArchive"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=e.ref(t.selection.items),c=()=>{p.value.length&&o.emit("vf-fetch",{params:{q:"archive",adapter:i.value,path:t.current.dirname,items:JSON.stringify(p.value.map(({path:y,type:m})=>({path:y,type:m}))),name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("The file(s) archived.")})},onError:y=>{u.value=l(y.message)}})};return(y,m)=>(e.openBlock(),e.createBlock(me,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-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:m[2]||(m[2]=b=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$c,[Ac,e.createElementVNode("div",Ic,[e.createElementVNode("h3",Lc,e.toDisplayString(e.unref(l)("Archive the files")),1),e.createElementVNode("div",Oc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,b=>(e.openBlock(),e.createElementBlock("p",jc,[b.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Pc,zc)):(e.openBlock(),e.createElementBlock("svg",Rc,Hc)),e.createElementVNode("span",Fc,e.toDisplayString(b.basename),1)]))),256)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>a.value=b),onKeyup:e.withKeys(c,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(l)("Archive name. (.zip file will be created)"),type:"text"},null,40,Uc),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[1]||(m[1]=b=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Kc={class:"sm:flex sm:items-start"},Wc=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),Xc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Zc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},qc={class:"mt-2"},Gc={class:"flex text-sm text-gray-800 dark:text-gray-400"},Jc={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"},Qc=[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)],ed={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"},td=[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)],rd={class:"ml-1.5"},nd={class:"my-1 text-sm text-gray-500"},od=Object.assign({name:"VFModalUnarchive"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n");e.ref("");const a=e.ref(t.selection.items[0]),u=e.ref(""),p=e.ref([]),c=()=>{o.emit("vf-fetch",{params:{q:"unarchive",adapter:i.value,path:t.current.dirname,item:a.value.path},onSuccess:()=>{o.emit("vf-toast-push",{label:l("The file unarchived.")})},onError:y=>{u.value=l(y.message)}})};return(y,m)=>(e.openBlock(),e.createBlock(me,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-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:m[1]||(m[1]=b=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Kc,[Wc,e.createElementVNode("div",Xc,[e.createElementVNode("h3",Zc,e.toDisplayString(e.unref(l)("Unarchive")),1),e.createElementVNode("div",qc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,b=>(e.openBlock(),e.createElementBlock("p",Gc,[b.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Jc,Qc)):(e.openBlock(),e.createElementBlock("svg",ed,td)),e.createElementVNode("span",rd,e.toDisplayString(b.basename),1)]))),256)),e.createElementVNode("p",nd,e.toDisplayString(e.unref(l)("The archive will be unarchived at"))+" ("+e.toDisplayString(n.current.dirname)+")",1),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[0]||(m[0]=b=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),id={class:"sm:flex sm:items-start"},sd=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),ad={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ld={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},cd={class:"mt-2"},dd={class:"flex text-sm text-gray-800 dark:text-gray-400"},hd={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"},ud=[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)],fd={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"},md=[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)],pd={class:"ml-1.5"},gd={class:"text-sm text-gray-500 pb-1 pt-3"},yd={class:"flex text-sm text-gray-800 dark:text-gray-400"},bd=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),vd={class:"ml-1.5 overflow-auto"},Jt={VueFinder:Xs,...Object.freeze(Object.defineProperty({__proto__:null,ModalArchive:Yc,ModalDelete:pa,ModalMessage:_a,ModalMove:Object.assign({name:"VFModalMove"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter"),{t:i}=e.inject("i18n");e.inject("storage");const l=e.inject("adapter"),a=e.ref(t.selection.items.from),u=e.ref(""),p=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"move",adapter:l.value,path:t.current.dirname,items:JSON.stringify(a.value.map(({path:c,type:y})=>({path:c,type:y}))),item:t.selection.items.to.path},onSuccess:()=>{o.emit("vf-toast-push",{label:i("Files moved.",t.selection.items.to.name)})},onError:c=>{u.value=i(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(i)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:y[1]||(y[1]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(i)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",id,[sd,e.createElementVNode("div",ad,[e.createElementVNode("h3",ld,e.toDisplayString(e.unref(i)("Move files")),1),e.createElementVNode("div",cd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("p",dd,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",hd,ud)):(e.openBlock(),e.createElementBlock("svg",fd,md)),e.createElementVNode("span",pd,e.toDisplayString(m.path),1)]))),256)),e.createElementVNode("p",gd,e.toDisplayString(e.unref(i)("Are you sure you want to move these files?")),1),e.createElementVNode("p",yd,[bd,e.createElementVNode("span",vd,e.toDisplayString(n.selection.items.to.path),1)]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[0]||(y[0]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ModalNewFile:ja,ModalNewFolder:Ma,ModalPreview:cc,ModalRename:_c,ModalUnarchive:od,ModalUpload:Bc},Symbol.toStringTag,{value:"Module"}))},fu="",mu="",Sd={install(n){for(const t in Jt)if(Jt.hasOwnProperty(t)){const o=Jt[t];n.component(o.name,o)}}},wd=Object.freeze(Object.defineProperty({__proto__:null,default:`{
20
+ "Language": "Sprache",
21
+ "Create": "Erstellen",
22
+ "Close": "Schließen",
23
+ "Cancel": "Abbrechen",
24
+ "Save": "Speichern",
25
+ "Edit": "Bearbeiten",
26
+ "Crop": "Zuschneiden",
27
+ "New Folder": "Neuer Ordner",
28
+ "New File": "Neue Datei",
29
+ "Rename": "Umbenennen",
30
+ "Delete": "Löschen",
31
+ "Upload": "Hochladen",
32
+ "Download": "Herunterladen",
33
+ "Archive": "Archivieren",
34
+ "Unarchive": "Dearchivieren",
35
+ "Open": "Öffnen",
36
+ "Open containing folder": "Enthaltenden Ordner öffnen",
37
+ "Refresh": "Aktualisieren",
38
+ "Preview": "Vorschau",
39
+ "Dark Mode": "Dunkler Modus",
40
+ "Toggle Full Screen": "Vollbild umschalten",
41
+ "Change View": "Ansicht ändern",
42
+ "Storage": "Speicher",
43
+ "Go up a directory": "Ein Verzeichnis hochgehen",
44
+ "Search anything..": "Suche etwas..",
45
+ "Name": "Name",
46
+ "Size": "Größe",
47
+ "Date": "Datum",
48
+ "Filepath": "Dateipfad",
49
+ "About": "Über",
50
+ "Folder Name": "Ordnername",
51
+ "File Name": "Dateiname",
52
+ "Move files": "Dateien verschieben",
53
+ "Are you sure you want to move these files to?": "Sind Sie sicher, dass Sie diese Dateien verschieben möchten?",
54
+ "Yes, Move!": "Ja, Verschieben!",
55
+ "Delete files": "Dateien löschen",
56
+ "Yes, Delete!": "Ja, Löschen!",
57
+ "Upload Files": "Dateien hochladen",
58
+ "No files selected!": "Keine Dateien ausgewählt!",
59
+ "Select Files": "Dateien auswählen",
60
+ "Archive the files": "Dateien archivieren",
61
+ "Unarchive the files": "Dateien dearchivieren",
62
+ "The archive will be unarchived at": "Das Archiv wird dearchiviert bei",
63
+ "Archive name. (.zip file will be created)": "Archivname. (.zip Datei wird erstellt)",
64
+ "Vuefinder is a file manager component for vue 3.": "Vuefinder ist eine Dateimanager-Komponente für Vue 3.",
65
+ "Create a new folder": "Einen neuen Ordner erstellen",
66
+ "Create a new file": "Eine neue Datei erstellen",
67
+ "Are you sure you want to delete these files?": "Sind Sie sicher, dass Sie diese Dateien löschen möchten?",
68
+ "This action cannot be undone.": "Diese Aktion kann nicht rückgängig gemacht werden.",
69
+ "Search results for": "Suchergebnisse für",
70
+ "item(s) selected.": "Artikel ausgewählt.",
71
+ "%s is renamed.": "%s wurde umbenannt.",
72
+ "This is a readonly storage.": "Dies ist ein schreibgeschützter Speicher.",
73
+ "%s is created.": "%s wurde erstellt.",
74
+ "Files moved.": "Dateien verschoben.",
75
+ "Files deleted.": "Dateien gelöscht.",
76
+ "The file unarchived.": "Die Datei wurde dearchiviert.",
77
+ "The file(s) archived.": "Die Datei(en) wurden archiviert.",
78
+ "Updated.": "Aktualisiert.",
79
+ "No search result found.": "Keine Suchergebnisse gefunden.",
80
+ "Are you sure you want to move these files?": "Sind Sie sicher, dass Sie diese Dateien verschieben möchten?",
81
+ "File Size": "Dateigröße",
82
+ "Last Modified": "Zuletzt geändert",
83
+ "Drag&Drop: on": "Drag&Drop: an",
84
+ "Drag&Drop: off": "Drag&Drop: aus",
85
+ "The selected file exceeds the maximum file size. You cannot upload files greater than %s": "Die ausgewählte Datei überschreitet die maximale Dateigröße. Sie können keine Dateien hochladen, die größer sind als %s"
86
+ }
87
+ `},Symbol.toStringTag,{value:"Module"})),_d=Object.freeze(Object.defineProperty({__proto__:null,default:`{
20
88
  "Language": "Language",
21
89
  "Create": "Create",
22
90
  "Close": "Close",
@@ -84,7 +152,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
84
152
  "Drag&Drop: off": "Drag&Drop: off",
85
153
  "The selected file exceeds the maximum file size. You cannot upload files greater than %s": "The selected file exceeds the maximum file size. You cannot upload files greater than %s"
86
154
  }
87
- `},Symbol.toStringTag,{value:"Module"})),ud=Object.freeze(Object.defineProperty({__proto__:null,default:`{
155
+ `},Symbol.toStringTag,{value:"Module"})),kd=Object.freeze(Object.defineProperty({__proto__:null,default:`{
88
156
  "Language": "زبان",
89
157
  "Create": "ایجاد",
90
158
  "Close": "بستن",
@@ -152,7 +220,75 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
152
220
  "Drag&Drop: off": "Drag&Drop: خاموش",
153
221
  "The selected file exceeds the maximum file size. You cannot upload files greater than %s": "حداکثر ظرفیت مجاز فایل %s میباشد! فایل شما بزرگتر از این مقدار میباشد."
154
222
  }
155
- `},Symbol.toStringTag,{value:"Module"})),fd=Object.freeze(Object.defineProperty({__proto__:null,default:`{
223
+ `},Symbol.toStringTag,{value:"Module"})),xd=Object.freeze(Object.defineProperty({__proto__:null,default:`{
224
+ "Language": "שפה",
225
+ "Create": "יצירה",
226
+ "Close": "סגירה",
227
+ "Cancel": "ביטול",
228
+ "Save": "שמירה",
229
+ "Edit": "עריכה",
230
+ "Crop": "חיתוך",
231
+ "New Folder": "תיקייה חדשה",
232
+ "New File": "קובץ חדש",
233
+ "Rename": "שינוי שם",
234
+ "Delete": "מחיקה",
235
+ "Upload": "העלאה",
236
+ "Download": "הורדה",
237
+ "Archive": "לדחוס",
238
+ "Unarchive": "לחלץ",
239
+ "Open": "פתיחה",
240
+ "Open containing folder": "פתיחת מיקום קובץ",
241
+ "Refresh": "רענון",
242
+ "Preview": "תצוגה מקדימה",
243
+ "Dark Mode": "עיצוב כהה",
244
+ "Toggle Full Screen": "שינוי מצב מסך מלא",
245
+ "Change View": "שינוי תצוגה",
246
+ "Storage": "אחסון",
247
+ "Go up a directory": "מעבר תיקייה אחת למעלה",
248
+ "Search anything..": "חיפוש...",
249
+ "Name": "שם",
250
+ "Size": "גודל",
251
+ "Date": "תאריך",
252
+ "Filepath": "נתיב קובץ",
253
+ "About": "אודות",
254
+ "Folder Name": "שם התיקייה",
255
+ "File Name": "שם הקובץ",
256
+ "Move files": "העברת קבצים",
257
+ "Are you sure you want to move these files to?": "האם בטוח להעביר קבצים אלה?",
258
+ "Yes, Move!": "כן, להעביר!",
259
+ "Delete files": "מחיקת קבצים",
260
+ "Yes, Delete!": "כן, למחוק!",
261
+ "Upload Files": "העלאת קבצים",
262
+ "No files selected!": "לא נבחרו קבצים",
263
+ "Select Files": "בחירת קבצים",
264
+ "Archive the files": "דחיסת קבצים אלו",
265
+ "Unarchive the files": "חילוץ קבצים אלו",
266
+ "The archive will be unarchived at": "הארכיןם יוחלץ ל:",
267
+ "Archive name. (.zip file will be created)": "שם הארכיון. (סיומת .zip תווסף)",
268
+ "Vuefinder is a file manager component for vue 3.": "Vuefinder הינו רכיב מנהל קבצים עבור vue 3",
269
+ "Create a new folder": "יצירת תיקייה חדשה",
270
+ "Create a new file": "יצירת קובץ חדש",
271
+ "Are you sure you want to delete these files?": "האם בטוח למחוק קבצים אלה?",
272
+ "This action cannot be undone.": "לא ניתן לבטל פעולה זו.",
273
+ "Search results for": "תוצאות חיפוש עבור",
274
+ "item(s) selected.": "פריט(ים) נבחרו.",
275
+ "%s is renamed.": "השם של %s השתנה.",
276
+ "This is a readonly storage.": "זהו אחסון לקריאה בלבד.",
277
+ "%s is created.": "%s נוצר",
278
+ "Files moved.": "הקבצים הועברו.",
279
+ "Files deleted.": "הקבצים נמחקו",
280
+ "The file unarchived.": "הקבצים חולצו.",
281
+ "The file(s) archived.": "הקובצים נדחסו.",
282
+ "Updated.": "התעדכן",
283
+ "No search result found.": "לא נמצאו תוצאות לחיפוש.",
284
+ "Are you sure you want to move these files?": "האם בטוח להעביר קבצים אלו?",
285
+ "File Size": "גודל קובץ",
286
+ "Last Modified": "תאריך שינוי",
287
+ "Drag&Drop: on": "מצב גרירה: פעיל",
288
+ "Drag&Drop: off": "מצב גרירה: כבוי",
289
+ "The selected file exceeds the maximum file size. You cannot upload files greater than %s": "הקובץ הנבחר חורג ממגבלת המקסימום של גודל קובץ. לא ניתן להעלות קובץ גדול מ-%s"
290
+ }
291
+ `},Symbol.toStringTag,{value:"Module"})),Dd=Object.freeze(Object.defineProperty({__proto__:null,default:`{
156
292
  "Language": "Язык",
157
293
  "Create": "Создать",
158
294
  "Close": "Закрыть",
@@ -219,7 +355,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
219
355
  "Drag&Drop: on": "Drag&Drop: on",
220
356
  "Drag&Drop: off": "Drag&Drop: off"
221
357
  }
222
- `},Symbol.toStringTag,{value:"Module"})),md=Object.freeze(Object.defineProperty({__proto__:null,default:`{
358
+ `},Symbol.toStringTag,{value:"Module"})),Ed=Object.freeze(Object.defineProperty({__proto__:null,default:`{
223
359
  "Language": "Dil",
224
360
  "Create": "Oluştur",
225
361
  "Close": "Kapat",
@@ -287,4 +423,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
287
423
  "Drag&Drop: off": "Sürükle&Bırak: devre dışı",
288
424
  "The selected file exceeds the maximum file size. You cannot upload files greater than %s": "Seçilen dosya maksimum dosya boyutunu aşıyor. %s'den büyük dosyaları yükleyemezsiniz."
289
425
  }
290
- `},Symbol.toStringTag,{value:"Module"}));return dd});
426
+ `},Symbol.toStringTag,{value:"Module"}));return Sd});