vuefinder 1.0.13 → 1.1.0
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.
- package/README.md +4 -6
- package/dist/{en.c102e439.js → en.4dabcb3e.js} +3 -1
- package/dist/style.css +1 -1
- package/dist/{tr.78c5046b.js → tr.f45cbe8b.js} +3 -1
- package/dist/vuefinder.js +3042 -2646
- package/dist/vuefinder.umd.cjs +14 -10
- package/package.json +2 -1
package/dist/vuefinder.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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){"use strict";const Ge=(i=>i&&typeof i=="object"&&"default"in i?i:{default:i})(Ve),Ie=(i,{method:t="get",params:r={},json:o=!0,signal:s=null})=>{var l;const a={method:t};if(a.signal=s,t=="get")i+="?"+new URLSearchParams(r);else{a.headers={};const m=(l=document.querySelector('meta[name="csrf-token"]'))==null?void 0:l.getAttribute("content");m&&(a.headers["X-CSRF-Token"]=m);let p=new FormData;for(const[f,u]of Object.entries(r))p.append(f,u);a.body=p}return fetch(i,a).then(m=>m.ok?o?m.json():m.text():m.json().then(Promise.reject.bind(Promise)))};function br(i){return{all:i=i||new Map,on:function(t,r){var o=i.get(t);o?o.push(r):i.set(t,[r])},off:function(t,r){var o=i.get(t);o&&(r?o.splice(o.indexOf(r)>>>0,1):i.set(t,[]))},emit:function(t,r){var o=i.get(t);o&&o.slice().map(function(s){s(r)}),(o=i.get("*"))&&o.slice().map(function(s){s(t,r)})}}}function Je(i){let t=localStorage.getItem(i+"_storage");const r=e.ref(JSON.parse(t));e.watch(r,o);function o(){r.value===null||r.value===""?localStorage.removeItem(i+"_storage"):localStorage.setItem(i+"_storage",JSON.stringify(r.value))}function s(m,p){r.value=Object.assign({...r.value},{[m]:p})}function a(){r.value=null}return{getStore:(m,p=null)=>r.value===null||r.value===""?p:r.value.hasOwnProperty(m)?r.value[m]:p,setStore:s,clearStore:a}}const wt=e.ref("");function ie(){function i(t){wt.value=t}return{apiUrl:wt,setApiUrl:i}}const wr={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},vr={key:0,class:"flex text-center"},kr=["aria-label"],_r=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})],-1)],xr=["aria-label"],Sr=[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)],Dr=["aria-label"],Er=[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)],Nr=["aria-label"],Vr=[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)],Cr=["aria-label"],$r=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})],-1)],Mr=["aria-label"],Br=[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)],Tr=["aria-label"],Ar=[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)],Or={key:1,class:"flex text-center"},jr={class:"pl-2"},Pr={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Lr={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"},Ir=[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)],zr={class:"flex text-center items-center justify-end"},Rr=["aria-label"],Hr=[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)],Ur=["aria-label"],Fr={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"},Kr={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"},Yr={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"},Wr=["aria-label"],Xr={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"},qr={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"},Gr=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(i){const t=e.inject("emitter"),{getStore:r,setStore:o}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(r("viewport","grid")),l=e.ref([]),m=e.ref(r("full-screen",!1)),p=e.ref("");t.on("vf-search-query",({newQuery:b})=>{p.value=b});const f=e.inject("loadingState"),u=()=>f.value,y=()=>{m.value=!m.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",b=>{l.value=b}),t.on("vf-view-toggle",b=>{o("viewport",b),a.value=b}),(b,E)=>(e.openBlock(),e.createElementBlock("div",wr,[p.value.length?(e.openBlock(),e.createElementBlock("div",Or,[e.createElementVNode("div",jr,[e.createTextVNode(e.toDisplayString(e.unref(s)("Search results for"))+" ",1),e.createElementVNode("span",Pr,e.toDisplayString(p.value),1)]),u()?(e.openBlock(),e.createElementBlock("svg",Lr,Ir)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",vr,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:E[0]||(E[0]=k=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:l.value}))},_r,8,kr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:E[1]||(E[1]=k=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:l.value}))},Sr,8,xr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:E[2]||(E[2]=k=>l.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},Er,2))],8,Dr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:E[3]||(E[3]=k=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},Vr,2))],8,Nr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:E[4]||(E[4]=k=>e.unref(t).emit("vf-modal-show",{type:"upload",items:l.value}))},$r,8,Cr),l.value.length==1&&l.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(s)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:E[5]||(E[5]=k=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},Br,2))],8,Mr)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(s)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:E[6]||(E[6]=k=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},Ar,2))],8,Tr))])),e.createElementVNode("div",zr,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:E[7]||(E[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"},Hr))],8,Rr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Toggle Full Screen"),"data-microtip-position":"bottom",role:"tooltip",onClick:y},[(e.openBlock(),e.createElementBlock("svg",Fr,[m.value?(e.openBlock(),e.createElementBlock("path",Kr)):(e.openBlock(),e.createElementBlock("path",Yr))]))],8,Ur),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:E[8]||(E[8]=k=>p.value.length||e.unref(t).emit("vf-view-toggle",a.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},[a.value=="grid"?(e.openBlock(),e.createElementBlock("path",Xr)):e.createCommentVNode("",!0),a.value=="list"?(e.openBlock(),e.createElementBlock("path",qr)):e.createCommentVNode("",!0)],2))],8,Wr)])]))}});var Jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vt={exports:{}};(function(i,t){(function(r,o){i.exports=o()})(Jr,function(){function r(h,c){if(!(h instanceof c))throw new TypeError("Cannot call a class as a function")}function o(h,c){for(var n=0;n<c.length;n++){var g=c[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}function s(h,c,n){return c&&o(h.prototype,c),n&&o(h,n),h}function a(h,c,n){return c in h?Object.defineProperty(h,c,{value:n,enumerable:!0,configurable:!0,writable:!0}):h[c]=n,h}function l(h,c){var n=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);c&&(g=g.filter(function(d){return Object.getOwnPropertyDescriptor(h,d).enumerable})),n.push.apply(n,g)}return n}function m(h){for(var c=1;c<arguments.length;c++){var n=arguments[c]!=null?arguments[c]:{};c%2?l(Object(n),!0).forEach(function(g){a(h,g,n[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(n,g))})}return h}function p(h,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(c&&c.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),c&&u(h,c)}function f(h){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},f(h)}function u(h,c){return u=Object.setPrototypeOf||function(g,d){return g.__proto__=d,g},u(h,c)}function y(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(h,c,n){return y()?b=Reflect.construct:b=function(d,w,v){var _=[null];_.push.apply(_,w);var D=Function.bind.apply(d,_),C=new D;return v&&u(C,v.prototype),C},b.apply(null,arguments)}function E(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function k(h){var c=typeof Map=="function"?new Map:void 0;return k=function(g){if(g===null||!E(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof c<"u"){if(c.has(g))return c.get(g);c.set(g,d)}function d(){return b(g,arguments,f(this).constructor)}return d.prototype=Object.create(g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),u(d,g)},k(h)}function S(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function M(h,c){return c&&(typeof c=="object"||typeof c=="function")?c:S(h)}function R(h){var c=y();return function(){var g=f(h),d;if(c){var w=f(this).constructor;d=Reflect.construct(g,arguments,w)}else d=g.apply(this,arguments);return M(this,d)}}function A(h,c){for(;!Object.prototype.hasOwnProperty.call(h,c)&&(h=f(h),h!==null););return h}function N(h,c,n){return typeof Reflect<"u"&&Reflect.get?N=Reflect.get:N=function(d,w,v){var _=A(d,w);if(!!_){var D=Object.getOwnPropertyDescriptor(_,w);return D.get?D.get.call(v):D.value}},N(h,c,n||h)}function P(h,c){return U(h)||Q(h,c)||re(h,c)||$()}function H(h){return x(h)||Y(h)||re(h)||O()}function x(h){if(Array.isArray(h))return B(h)}function U(h){if(Array.isArray(h))return h}function Y(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}function Q(h,c){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(h)))){var n=[],g=!0,d=!1,w=void 0;try{for(var v=h[Symbol.iterator](),_;!(g=(_=v.next()).done)&&(n.push(_.value),!(c&&n.length===c));g=!0);}catch(D){d=!0,w=D}finally{try{!g&&v.return!=null&&v.return()}finally{if(d)throw w}}return n}}function re(h,c){if(!!h){if(typeof h=="string")return B(h,c);var n=Object.prototype.toString.call(h).slice(8,-1);if(n==="Object"&&h.constructor&&(n=h.constructor.name),n==="Map"||n==="Set")return Array.from(h);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B(h,c)}}function B(h,c){(c==null||c>h.length)&&(c=h.length);for(var n=0,g=new Array(c);n<c;n++)g[n]=h[n];return g}function O(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var I=function(c,n,g){var d=c.x,w=c.y,v=g.x,_=g.y,D={"+":{x:d+v,y:w+_},"-":{x:d-v,y:w-_},"*":{x:d*v,y:w*_},"/":{x:d/v,y:w/_}};return D[n]},j=function(c){return{x:c.left,y:c.top}},G=function(c){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:c.x,top:c.y,right:c.x,bottom:c.y,width:n,height:n}},W=function(c){return{x:c,y:c}},je=function(h,c,n){window.addEventListener("resize",c),window.addEventListener("scroll",c),h.forEach(function(g,d){n.observe(g,{childList:d!==0,attributes:!0})})},Pe=function(h){var c=De(h);return c.x||c.y?!0:h instanceof HTMLDocument?h.body?!!(h.body.scrollTop=1):!!(h.documentElement.scrollTop=1):!!(h.scrollTop=1)},Ye=function(h){var c=document.createElement("div");return c.style.position="fixed",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="999999999999999999",c.classList.add(h),c},We=function(h){var c=document.createElement("div");return c.style.position="absolute",h||(c.style.background="rgba(0, 0, 255, 0.1)",c.style.border="1px solid rgba(0, 0, 255, 0.45)",c.style.display="none",c.style.pointerEvents="none"),c},Xe=function(h,c){var n;return function(){for(var g=arguments.length,d=new Array(g),w=0;w<g;w++)d[w]=arguments[w];var v=function(){n=null,h.apply(void 0,d)};clearTimeout(n),n=setTimeout(v,c)}},Se=function(){var h,c,n,g;return{y:((h=document.body)===null||h===void 0?void 0:h.scrollTop)||((c=document.documentElement)===null||c===void 0?void 0:c.scrollTop)||0,x:((n=document.body)===null||n===void 0?void 0:n.scrollLeft)||((g=document.documentElement)===null||g===void 0?void 0:g.scrollLeft)||0}},gt=function(h,c){if(h instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=h.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(h.clientWidth||n.width)*c,height:(h.clientHeight||n.height)*c}},De=function(h){return!h||h instanceof Document?Se():{x:h.scrollLeft>=0?h.scrollLeft:Se().x,y:h.scrollTop>=0?h.scrollTop:Se().y}},Zt=function(h){var c=h.elementRect,n=h.containerRect,g=h.tolerance,d=g===void 0?{x:0,y:0}:g,w=[];return c.top-d.y<n.top&&w.push("top"),c.left-d.x<n.left&&w.push("left"),c.bottom+d.y>n.bottom&&w.push("bottom"),c.right+d.y>n.right&&w.push("right"),w},sl=function(h){var c=h.event;return{x:c.clientX,y:c.clientY}},ll=function(h){var c=h.scrollAmount,n=h.initialPointerPos,g=h.pointerPos,d={};return g.x>n.x-c.x?(d.left=n.x-c.x,d.width=g.x-n.x+c.x):(d.left=g.x,d.width=n.x-g.x-c.x),g.y>n.y-c.y?(d.top=n.y-c.y,d.height=g.y-n.y+c.y):(d.top=g.y,d.height=n.y-g.y-c.y),d},Qt=function(c){var n={x:0,y:0},g=window.getComputedStyle(c);if(!g.transform||g.transform==="none")return n;if(g.transform.indexOf("3d")>=0){var d=g.transform.trim().match(/matrix3d\((.*?)\)/);if(d&&d.length){var w,v=(w=d[1])===null||w===void 0?void 0:w.split(",");n.x=parseInt(v[12])||0,n.y=parseInt(v[13])||0}return n}else{var _=g.transform.trim().match(/matrix\((.*?)\)/);if(_&&_.length){var D,C=(D=_[1])===null||D===void 0?void 0:D.split(",");n.x=parseInt(C[4])||0,n.y=parseInt(C[5])||0}return n}},cl=function(c){var n=c.style.transform;if(!n||n.indexOf("translate")<0)return Qt(c);var g={x:0,y:0},d=n.trim().match(/translate[3dD]*?\(.*?\)/);if(d){var w,v=(w=d[0])===null||w===void 0?void 0:w.split("(");if(v){var _,D=(_=v[1])===null||_===void 0?void 0:_.split(",");g.x=parseInt(D[0])||0,g.y=parseInt(D[1])||0}}return!g.x&&!g.x?Qt(c):g},dl=function(c){var n=c.style,g={x:parseInt(n.left)||0,y:parseInt(n.top)||0};if(!g.x&&!g.x){var d=window.getComputedStyle(c);return{x:parseInt(d.left)||0,y:parseInt(d.top)||0}}return g},hl=function(h,c){return c?cl(h):dl(h)},ul=function(h){var c=h.element,n=h.edges,g=h.elementRect,d=h.containerRect,w=h.elementPos,v=h.useTransform;n.includes("top")&&Le(c,{y:w.y+d.top-g.top,x:w.x},v),n.includes("left")&&Le(c,{y:w.y,x:w.x+d.left-g.left},v),n.includes("bottom")&&Le(c,{y:w.y+d.bottom-g.bottom,x:w.x},v),n.includes("right")&&Le(c,{y:w.y,x:w.x+d.right-g.right},v)},er=function(h){var c=h.computedStyle,n=h.node,g=c.position,d=g==="absolute"||g==="relative"||g==="fixed";!(n instanceof HTMLDocument)&&!d&&(n.style.position="relative")},ml=function(h){var c=h.shiftKey,n=h.keyboardDragSpeed,g=h.zoom,d=h.key,w=h.dragKeys,v=h.scrollDiff,_=h.canScroll,D=h.scrollCallback,C={x:0,y:0},V=c?n*4*g:n*g;return w.left.includes(d)&&(C.x=v.x||-V,!c&&!v.x&&_&&D(["left"],n)),w.right.includes(d)&&(C.x=v.x||V,!c&&!v.x&&_&&D(["right"],n)),w.up.includes(d)&&(C.y=v.y||-V,!c&&!v.y&&_&&D(["top"],n)),w.down.includes(d)&&(C.y=v.y||V,!c&&!v.y&&_&&D(["bottom"],n)),C},fl=function(h){var c=h.element,n=h.force,g=h.multiSelectionToggle,d=h.SelectedSet,w=h.hoverClassName;c.classList.contains(w)&&!n||(d.has(c)?g&&d.delete(c):d.add(c),c.classList.add(w))},pl=function(h){var c=h.element,n=h.force,g=h.SelectedSet,d=h.PrevSelectedSet,w=h.hoverClassName;if(!c.classList.contains(w)&&!n)return!1;var v=g.has(c),_=d.has(c);v&&!_?g.delete(c):!v&&_&&g.add(c),c.classList.remove(w)},yt=function(h,c){return h.left<c.right&&h.right>c.left&&h.top<c.bottom&&h.bottom>c.top},tr=function(h){var c=h.element,n=h.posDirection,g=h.containerRect,d=h.useTransform,w=hl(c,d),v=I(w,"+",n);Le(c,v,d);var _=c.getBoundingClientRect(),D=Zt({elementRect:_,containerRect:g});ul({element:c,edges:D,elementRect:_,containerRect:g,elementPos:v,useTransform:d})},gl=function(h,c){window.removeEventListener("resize",c),window.removeEventListener("scroll",c),h.disconnect()},yl=function(h,c,n){if(!!c.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,d=h instanceof HTMLDocument?g||document.body:h,w=c.includes("top")&&d.scrollTop>0,v=c.includes("bottom")&&d.scrollTop<d.scrollHeight,_=c.includes("left")&&d.scrollLeft>0,D=c.includes("right")&&d.scrollLeft<d.scrollWidth;w&&(d.scrollTop-=1*n),v&&(d.scrollTop+=1*n),_&&(d.scrollLeft-=1*n),D&&(d.scrollLeft+=1*n)}},Le=function(h,c,n){if(n){var g=h.style.transform;h.style.transform="translate3d(".concat(c.x,"px,").concat(c.y,"px,1px) ").concat(g.replace(/translate.*?\)/g,""))}else h.style.left="".concat(c.x,"px"),h.style.top="".concat(c.y,"px");return h},bl=function(h){for(var c=h.subscribe,n=h.publish,g=h.Interaction,d=h.SelectedSet,w={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(V){return V.event}}],"Interaction:end":[{name:"callback"}]},v=function(){var V=P(D[_],2),T=V[0],L=V[1];["pre",!1].forEach(function(X){return c(X?"".concat(T,":").concat(X):T,function(ne){return L.forEach(function(J){return(!J.condition||J.condition(ne))&&n(X?"".concat(X).concat(J.name):J.name,m({items:d.elements,isDragging:g.isDragging},ne))})})})},_=0,D=Object.entries(w);_<D.length;_++)v()},Ee=function(h){return h?!Array.isArray(h)&&(h instanceof HTMLElement||h instanceof SVGElement)?[h]:H(h):[]},rr=function(h,c){h.style.left="".concat(c.left,"px"),h.style.top="".concat(c.top,"px"),h.style.width="".concat(c.width,"px"),h.style.height="".concat(c.height,"px")},wl=function(){function h(c){var n=this,g=c.area,d=c.PS,w=c.zoom;r(this,h),a(this,"_modificationCallback",void 0),a(this,"_modificationObserver",void 0),a(this,"_zoom",void 0),a(this,"_node",void 0),a(this,"_parentNodes",void 0),a(this,"_computedStyle",void 0),a(this,"_computedBorder",void 0),a(this,"_rect",void 0),a(this,"setArea",function(v){n._node=v,er({computedStyle:n.computedStyle,node:n._node}),setTimeout(function(){n.PubSub.publish("Area:modified:pre",{item:n}),n.reset(),n.PubSub.publish("Area:modified",{item:n})})}),a(this,"start",function(){je(n.parentNodes,n._modificationCallback,n._modificationObserver)}),a(this,"reset",function(){n._computedStyle=void 0,n._rect=void 0,n._computedBorder=void 0,n._parentNodes=void 0}),a(this,"stop",function(){gl(n._modificationObserver,n._modificationCallback),n.reset()}),a(this,"scroll",function(v,_){var D={scroll_directions:v,scroll_multiplier:_};n.PubSub.publish("Area:scroll:pre",D),yl(n._node,v,_),n.PubSub.publish("Area:scroll",D)}),this._zoom=w,this.PubSub=d,this.setArea(g),this._modificationCallback=Xe(function(v){n.PubSub.publish("Area:modified:pre",{event:v,item:n}),n.reset(),n.PubSub.publish("Area:modified",{event:v,item:n})},60),this._modificationObserver=new MutationObserver(this._modificationCallback),this.PubSub.subscribe("Interaction:init",this.start),this.PubSub.subscribe("Interaction:end",this.reset)}return s(h,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof HTMLDocument?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=gt(this.HTMLNode,this._zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;var n=function g(d){var w,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=(w=d[v])===null||w===void 0?void 0:w.parentNode;return _?(d.push(_),v++,g(d,v)):d};return this._parentNodes=n([this.HTMLNode]),this._parentNodes}}]),h}(),vl=function(){function h(c){var n=this,g=c.DS,d=c.dragKeys,w=c.draggability,v=c.keyboardDrag,_=c.keyboardDragSpeed,D=c.useTransform,C=c.zoom;r(this,h),a(this,"_useTransform",void 0),a(this,"_prevCursorPos",void 0),a(this,"_prevScrollPos",void 0),a(this,"_elements",[]),a(this,"_draggability",void 0),a(this,"_dragKeys",void 0),a(this,"_dragKeysFlat",void 0),a(this,"_keyboardDrag",void 0),a(this,"_keyboardDragSpeed",void 0),a(this,"_zoom",void 0),a(this,"keyboardDrag",function(V){var T=V.event,L=V.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(L)||!n.DS.SelectedSet.size||!n._draggability||n.DS.continue)){var X={event:T,isDragging:!0,isDraggingKeyboard:!0};n.DS.publish(["Interaction:start:pre","Interaction:start"],X),n._elements=n.DS.getSelection(),n.handleZIndex(!0);var ne=ml({shiftKey:n.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:n._keyboardDragSpeed,zoom:n._zoom,key:L,scrollCallback:n.DS.Area.scroll,scrollDiff:n._scrollDiff,canScroll:n.DS.stores.ScrollStore.canScroll,dragKeys:n._dragKeys});n._elements.forEach(function(J){return tr({element:J,posDirection:ne,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})}),n.DS.publish(["Interaction:update:pre","Interaction:update"],X)}}),a(this,"keyboardEnd",function(V){var T=V.event,L=V.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(L)||!n.DS.SelectedSet.size||!n._draggability)){var X={event:T,isDragging:n._draggability,isDraggingKeyboard:!0};n.DS.publish(["Interaction:end:pre","Interaction:end"],X)}}),a(this,"start",function(V){var T=V.isDragging,L=V.isDraggingKeyboard;!T||L||(n._prevCursorPos=null,n._prevScrollPos=null,n._elements=n.DS.getSelection(),n.handleZIndex(!0))}),a(this,"stop",function(V){V!=null&&V.isKeyboard||(n._prevCursorPos=null,n._prevScrollPos=null,n.handleZIndex(!1),n._elements=[])}),a(this,"update",function(V){var T=V.isDragging,L=V.isDraggingKeyboard;if(!(!T||!n._elements.length||L||n.DS.continue)){var X=I(n._cursorDiff,"+",n._scrollDiff);n._elements.forEach(function(ne){return tr({element:ne,posDirection:X,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})})}}),a(this,"handleZIndex",function(V){n._elements.forEach(function(T){return T.style.zIndex="".concat((parseInt(T.style.zIndex)||0)+V?9999:-9998)})}),this.DS=g,this._useTransform=D,this._keyboardDragSpeed=_,this._keyboardDrag=v,this._zoom=C,this._draggability=w,this._dragKeys={up:d.up.map(function(V){return V.toLowerCase()}),down:d.down.map(function(V){return V.toLowerCase()}),left:d.left.map(function(V){return V.toLowerCase()}),right:d.right.map(function(V){return V.toLowerCase()})},this._dragKeysFlat=[].concat(H(this._dragKeys.up),H(this._dragKeys.down),H(this._dragKeys.left),H(this._dragKeys.right)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return s(h,[{key:"_cursorDiff",get:function(){var n=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?I(n,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=n,g}},{key:"_scrollDiff",get:function(){var n=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?I(n,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=n,g}}]),h}(),kl=function(){function h(c){var n=this,g=c.DS,d=c.areaElement,w=c.draggability,v=c.immediateDrag,_=c.selectableClass;r(this,h),a(this,"_areaElement",void 0),a(this,"_draggability",void 0),a(this,"_immediateDrag",void 0),a(this,"_selectableClass",void 0),a(this,"isInteracting",void 0),a(this,"isDragging",void 0),a(this,"init",function(){return n.DS.publish("Interaction:init:pre",{})}),a(this,"_init",function(){n.stop(),n._areaElement.addEventListener("mousedown",n.start),n._areaElement.addEventListener("touchstart",n.start,{passive:!1}),n.DS.publish("Interaction:init",{})}),a(this,"start",function(D){return n.DS.publish("Interaction:start:pre",{event:D,isDragging:n.isDragging})}),a(this,"_start",function(D){D.type==="touchstart"&&D.preventDefault(),n._canInteract(D)&&(n.isInteracting=!0,n.isDragging=n.isDragEvent(D),n.DS.publish("Interaction:start",{event:D,isDragging:n.isDragging}),document.addEventListener("mouseup",n.reset),document.addEventListener("touchend",n.reset))}),a(this,"isDragEvent",function(D){var C=D.target.closest(".".concat(n._selectableClass));return!n._draggability||n.DS.stores.KeyStore.isMultiSelectKeyPressed(D)||!C?!1:(n._immediateDrag&&(n.DS.SelectedSet.size?n.DS.SelectedSet.has(C)||(n.DS.SelectedSet.clear(),n.DS.SelectedSet.add(C)):n.DS.SelectedSet.add(C)),!!n.DS.SelectedSet.has(C))}),a(this,"onClick",function(D){var C=D.event;if(!!n._canInteract(C)&&!(C.detail>0)){var V=n.DS,T=V.stores,L=T.PointerStore,X=T.KeyStore,ne=V.SelectableSet,J=V.SelectedSet;L.start(C);var Ne=C.target;!ne.has(Ne)||(X.isMultiSelectKeyPressed(C)||J.clear(),J.toggle(Ne),n.reset())}}),a(this,"stop",function(){n.isInteracting=!1,n.isDragging=!1,n._areaElement.removeEventListener("mousedown",n.start),n._areaElement.removeEventListener("touchstart",n.start,{passive:!1}),document.removeEventListener("mouseup",n.reset),document.removeEventListener("touchend",n.reset)}),a(this,"update",function(D){var C=D.event,V=D.scroll_directions,T=D.scroll_multiplier;n.isInteracting&&n.DS.publish(["Interaction:update:pre","Interaction:update"],{event:C,scroll_directions:V,scroll_multiplier:T,isDragging:n.isDragging})}),a(this,"reset",function(D){return n.DS.publish("Interaction:end:pre",{event:D,isDragging:n.isDragging})}),a(this,"_reset",function(D){var C=n.isDragging;n.stop(),n.init(),n.DS.publish("Interaction:end",{event:D,isDragging:C})}),this._areaElement=d,this._draggability=w,this._immediateDrag=v,this._selectableClass=_,this.DS=g,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(D){var C=D.event;return n.start(C)}),this.DS.subscribe("Interaction:start:pre",function(D){var C=D.event;return n._start(C)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(D){var C=D.event;return n._reset(C)}),this.DS.subscribe("Area:scroll",this.update)}return s(h,[{key:"_canInteract",value:function(n){var g=n.clientX===0&&n.clientY===0&&n.detail===0&&n.target;return!(n.button===2||this.isInteracting||n.target&&!this.DS.SelectorArea.isInside(n.target)||!g&&!this.DS.SelectorArea.isClicked(n))}}]),h}(),_l=function h(c){var n=this,g=c.DS;r(this,h),a(this,"subscribers",{}),a(this,"subscribe",function(d,w){return Array.isArray(n.subscribers[d])||(n.subscribers[d]=[]),n.subscribers[d].push(w),n.subscribers[d].length-1}),a(this,"unsubscribe",function(d,w,v){v>=0?n.subscribers[d].splice(v,1):w&&(n.subscribers[d]=n.subscribers[d].filter(function(_){return _!==w}))}),a(this,"publish",function(d,w){Array.isArray(d)?d.forEach(function(v){return n._publish(v,w)}):n._publish(d,w)}),a(this,"_publish",function(d,w){var v=n.subscribers[d];!Array.isArray(v)||(d.includes(":pre")?n._handlePrePublish(v,w):n._handlePublish(v,w))}),a(this,"_handlePublish",function(d,w){for(var v=0,_=d.length;v<_;v++){if(n.DS.stopped)return;d[v](w)}}),a(this,"_handlePrePublish",function(d,w){for(var v=d.length;v--;){if(n.DS.stopped)return;d[v](w)}}),this.DS=g},xl=function(h){p(n,h);var c=R(n);function n(g){var d,w=g.elements,v=g.className,_=g.hoverClassName,D=g.draggability,C=g.useTransform,V=g.DS;return r(this,n),d=c.call(this),a(S(d),"_initElements",void 0),a(S(d),"_className",void 0),a(S(d),"_hoverClassName",void 0),a(S(d),"_useTransform",void 0),a(S(d),"_draggability",void 0),a(S(d),"init",function(){return d._initElements.forEach(function(T){return d.add(T)})}),a(S(d),"clear",function(){return d.forEach(function(T){return d.delete(T)})}),a(S(d),"_onClick",function(T){return d.DS.publish(["Selectable:click:pre","Selectable:click"],{event:T})}),a(S(d),"_onPointer",function(T){return d.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:T})}),a(S(d),"addAll",function(T){return T.forEach(function(L){return d.add(L)})}),a(S(d),"deleteAll",function(T){return T.forEach(function(L){return d.delete(L)})}),d.DS=V,d._initElements=Ee(w),d._className=v,d._hoverClassName=_,d._useTransform=C,d._draggability=D,d.DS.subscribe("Interaction:init",d.init),d}return s(n,[{key:"add",value:function(d){return d.classList.add(this._className),d.addEventListener("click",this._onClick),d.addEventListener("mousedown",this._onPointer),d.addEventListener("touchstart",this._onPointer,{passive:!1}),this._draggability&&!this._useTransform&&er({computedStyle:window.getComputedStyle(d),node:d}),N(f(n.prototype),"add",this).call(this,d)}},{key:"delete",value:function(d){return d.classList.remove(this._className),d.classList.remove(this._hoverClassName),d.removeEventListener("click",this._onClick),d.removeEventListener("mousedown",this._onPointer),d.removeEventListener("touchstart",this._onPointer,{passive:!1}),N(f(n.prototype),"delete",this).call(this,d)}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(k(Set)),Sl=function(h){p(n,h);var c=R(n);function n(g){var d,w=g.className,v=g.DS;return r(this,n),d=c.call(this),a(S(d),"_className",void 0),a(S(d),"clear",function(){return d.forEach(function(_){return d.delete(_)})}),a(S(d),"addAll",function(_){return _.forEach(function(D){return d.add(D)})}),a(S(d),"deleteAll",function(_){return _.forEach(function(D){return d.delete(D)})}),d.DS=v,d._className=w,d}return s(n,[{key:"add",value:function(d){if(!N(f(n.prototype),"has",this).call(this,d)){var w={items:this.elements,item:d};return this.DS.publish("Selected:added:pre",w),N(f(n.prototype),"add",this).call(this,d),d.classList.add(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)+1),this.DS.publish("Selected:added",w),this}}},{key:"delete",value:function(d){if(!!N(f(n.prototype),"has",this).call(this,d)){var w={items:this.elements,item:d};this.DS.publish("Selected:removed:pre",w);var v=N(f(n.prototype),"delete",this).call(this,d);return d.classList.remove(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)-1),this.DS.publish("Selected:removed",w),v}}},{key:"toggle",value:function(d){return this.has(d)?this.delete(d):this.add(d),d}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(k(Set)),Dl=function(){function h(c){var n=this,g=c.DS,d=c.hoverClassName,w=c.multiSelectToggling;r(this,h),a(this,"_prevSelectedSet",void 0),a(this,"_hoverClassName",void 0),a(this,"_multiSelectToggling",void 0),a(this,"start",function(v){var _=v.event,D=v.isDragging;D||(n._storePrevious(_),n._handleInsideSelection(!0,_))}),a(this,"update",function(v){var _=v.isDragging;_||n.DS.continue||n._handleInsideSelection()}),a(this,"_handleInsideSelection",function(v,_){for(var D=n.DS,C=D.SelectableSet,V=D.SelectorArea,T=D.Selector,L=C.elements.map(function(fe){return[fe,fe.getBoundingClientRect()]}),X=[],ne=[],J=0,Ne=L.length;J<Ne;J++)!V.isInside(L[J][0],L[J][1])||(yt(L[J][1],T.rect)?X.push(L[J][0]):ne.push(L[J][0]));var qe=n.DS.stores.KeyStore.isMultiSelectKeyPressed(_)&&n._multiSelectToggling;n.DS.continue||(X.forEach(function(fe){return fl({element:fe,force:v,multiSelectionToggle:qe,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName})}),ne.forEach(function(fe){return pl({element:fe,force:v,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName,PrevSelectedSet:n._prevSelectedSet})}))}),this._hoverClassName=d,this._multiSelectToggling=w,this.DS=g,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(h,[{key:"_storePrevious",value:function(n){var g=this.DS,d=g.stores.KeyStore,w=g.SelectedSet;d.isMultiSelectKeyPressed(n)?this._prevSelectedSet=new Set(w):this._prevSelectedSet=new Set}}]),h}(),El=function(){function h(c){var n=this,g=c.DS,d=c.selector,w=c.selectorClass,v=c.customStyles;r(this,h),a(this,"_rect",void 0),a(this,"start",function(_){var D=_.isDragging;if(!D){var C=n.DS.stores.PointerStore,V=C.initialValArea;rr(n.HTMLNode,G(V,1)),n.HTMLNode.style.display="block",n._rect=null}}),a(this,"stop",function(){n.HTMLNode.style.width="0",n.HTMLNode.style.height="0",n.HTMLNode.style.display="none"}),a(this,"update",function(_){var D=_.isDragging;if(!(D||n.DS.continue)){var C=n.DS.stores,V=C.ScrollStore,T=C.PointerStore,L=ll({scrollAmount:V.scrollAmount,initialPointerPos:T.initialValArea,pointerPos:T.currentValArea});rr(n.HTMLNode,L),n._rect=null}}),this.DS=g,this.HTMLNode=d||We(v),this.HTMLNode.classList.add(w),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(h,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),Nl=function(){function h(c){var n=this,g=c.DS,d=c.selectorAreaClass,w=c.autoScrollSpeed,v=c.overflowTolerance;r(this,h),a(this,"_autoScrollSpeed",void 0),a(this,"_scrollInterval",void 0),a(this,"_rect",void 0),a(this,"currentEdges",[]),a(this,"_overflowTolerance",void 0),a(this,"start",function(){return n.applyElements("append")}),a(this,"applyElements",function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",D=document.body?"body":"documentElement",C="".concat(_,"Child");n.HTMLNode[C](n.DS.Selector.HTMLNode),document[D][C](n.HTMLNode)}),a(this,"updatePos",function(){n._rect=null;var _=n.DS.Area.rect,D=n.DS.Area.computedBorder,C=n.HTMLNode.style,V="".concat(_.top+D.top,"px"),T="".concat(_.left+D.left,"px"),L="".concat(_.width,"px"),X="".concat(_.height,"px");C.top!==V&&(C.top=V),C.left!==T&&(C.left=T),C.width!==L&&(C.width=L),C.height!==X&&(C.height=X)}),a(this,"stop",function(_){n.stopAutoScroll(),_&&n.applyElements("remove")}),a(this,"startAutoScroll",function(){n.currentEdges=[],n._scrollInterval=setInterval(function(){return n.handleAutoScroll()},16)}),a(this,"handleAutoScroll",function(){if(!n.DS.continue){var _=n.DS,D=_.stores.PointerStore,C=_.Area;n.currentEdges=Zt({elementRect:G(D.currentVal),containerRect:n.rect,tolerance:n._overflowTolerance}),n.currentEdges.length&&C.scroll(n.currentEdges,n._autoScrollSpeed)}}),a(this,"stopAutoScroll",function(){n.currentEdges=[],clearInterval(n._scrollInterval)}),a(this,"isInside",function(_,D){return n.DS.Area.HTMLNode.contains(_)&&n.DS.stores.ScrollStore.canScroll?!0:yt(n.rect,D||_.getBoundingClientRect())}),this._autoScrollSpeed=w,this._overflowTolerance=v,this.DS=g,this.HTMLNode=Ye(d),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){n.updatePos(),n.stopAutoScroll()})}return s(h,[{key:"isClicked",value:function(n){var g=this.DS.stores.PointerStore,d=n?g.getPointerPosition(n):g.initialVal;return yt({left:d.x,top:d.y,right:d.x,bottom:d.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),Vl=function(){function h(c){var n=this,g=c.DS,d=c.multiSelectKeys,w=c.multiSelectMode;r(this,h),a(this,"_multiSelectMode",void 0),a(this,"_multiSelectKeys",void 0),a(this,"_currentValues",new Set),a(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),a(this,"init",function(){document.addEventListener("keydown",n.keydown),document.addEventListener("keyup",n.keyup),window.addEventListener("blur",n.reset)}),a(this,"keydown",function(v){var _=v.key.toLowerCase();n.DS.publish("KeyStore:down:pre",{event:v,key:_}),n._currentValues.add(_),n.DS.publish("KeyStore:down",{event:v,key:_})}),a(this,"keyup",function(v){var _=v.key.toLowerCase();n.DS.publish("KeyStore:up:pre",{event:v,key:_}),n._currentValues.delete(_),n.DS.publish("KeyStore:up",{event:v,key:_})}),a(this,"stop",function(){document.removeEventListener("keydown",n.keydown),document.removeEventListener("keyup",n.reset),window.removeEventListener("blur",n.reset),n.reset()}),a(this,"reset",function(){return n._currentValues.clear()}),this.DS=g,this._multiSelectMode=w,this._multiSelectKeys=d.map(function(v){var _={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"},D=_[v];return D?(console.warn("[DragSelect] ".concat(v,' is deprecated. Use "').concat(D,'" instead. Act Now!. See docs for more info')),D.toLowerCase()):v.toLowerCase()}),this.DS.subscribe("Interaction:init",this.init)}return s(h,[{key:"isMultiSelectKeyPressed",value:function(n){var g=this;return!!(this._multiSelectMode||this.currentValues.some(function(d){return g._multiSelectKeys.includes(d)})||n&&this._multiSelectKeys.some(function(d){return n[g._keyMapping[d]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),h}(),Cl=function(){function h(c){var n=this,g=c.DS;r(this,h),a(this,"_isMouseInteraction",!1),a(this,"_initialValArea",void 0),a(this,"_currentValArea",void 0),a(this,"_lastValArea",void 0),a(this,"_initialVal",void 0),a(this,"_currentVal",void 0),a(this,"_lastVal",void 0),a(this,"_lastTouch",void 0),a(this,"init",function(){document.addEventListener("mousemove",n.update),document.addEventListener("touchmove",n.update,{passive:!1})}),a(this,"getPointerPosition",function(d){return sl({event:n._normalizedEvent(d)})}),a(this,"update",function(d){!d||(n.DS.publish("PointerStore:updated:pre",{event:d}),n.currentVal=n.getPointerPosition(d),n._isMouseInteraction&&n.DS.publish("PointerStore:updated",{event:d}))}),a(this,"stop",function(){document.removeEventListener("mousemove",n.update),document.removeEventListener("touchmove",n.update,{passive:!1}),setTimeout(function(){return n._isMouseInteraction=!1},100)}),a(this,"reset",function(d){!d||(n.currentVal=n.lastVal=n.getPointerPosition(d),n.stop(),n.init())}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(d){var w=d.event;return n.start(w)}),this.DS.subscribe("Interaction:end",function(d){var w=d.event;return n.reset(w)})}return s(h,[{key:"start",value:function(n){!n||(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(n))}},{key:"_normalizedEvent",value:function(n){return"touches"in n&&n.type!=="touchend"&&(this._lastTouch=n),"touches"in n?this._lastTouch.touches[0]:n}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(n){this._initialVal=n,this._initialValArea=n&&I(n,"-",I(j(this.DS.Area.rect),"+",j(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(n){this._currentVal=n,this._currentValArea=n&&I(n,"-",I(j(this.DS.Area.rect),"+",j(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(n){this._lastVal=n,this._lastValArea=n&&I(n,"-",I(j(this.DS.Area.rect),"+",j(this.DS.Area.computedBorder)))}}]),h}(),$l=function(){function h(c){var n=this,g=c.DS,d=c.areaElement,w=c.zoom;r(this,h),a(this,"_initialVal",void 0),a(this,"_currentVal",void 0),a(this,"_areaElement",void 0),a(this,"_canScroll",void 0),a(this,"init",function(){return n._areaElement.addEventListener("scroll",n.update)}),a(this,"start",function(){n._currentVal=n._initialVal=De(n._areaElement),n._areaElement.addEventListener("scroll",n.update)}),a(this,"update",function(){return n._currentVal=De(n._areaElement)}),a(this,"stop",function(){n._areaElement.removeEventListener("scroll",n.update),n._initialVal={x:0,y:0},n._canScroll=null}),a(this,"reset",function(){n.stop(),n.start()}),this._areaElement=d,this.DS=g,this.zoom=w,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return n.start()}),this.DS.subscribe("Interaction:end",function(){return n.reset()})}return s(h,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=Pe(this._areaElement)}},{key:"scrollAmount",get:function(){var n=I(this.currentVal,"-",this.initialVal),g=W(this.zoom),d=I(I(n,"*",g),"-",n);return{x:n.x+d.x,y:n.y+d.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=De(this._areaElement)),this._currentVal}}]),h}(),Ml=function(){function h(c){var n=this,g=c.area,d=g===void 0?document:g,w=c.selectables,v=w===void 0?[]:w,_=c.autoScrollSpeed,D=_===void 0?5:_,C=c.overflowTolerance,V=C===void 0?{x:25,y:25}:C,T=c.zoom,L=T===void 0?1:T,X=c.customStyles,ne=X===void 0?!1:X,J=c.multiSelectMode,Ne=J===void 0?!1:J,qe=c.multiSelectToggling,fe=qe===void 0?!0:qe,nr=c.multiSelectKeys,Bl=nr===void 0?["Control","Shift","Meta"]:nr,or=c.selector,Tl=or===void 0?void 0:or,ar=c.draggability,bt=ar===void 0?!0:ar,ir=c.immediateDrag,Al=ir===void 0?!0:ir,sr=c.keyboardDrag,Ol=sr===void 0?!0:sr,jl=c.dragKeys,lr=c.keyboardDragSpeed,Pl=lr===void 0?10:lr,cr=c.useTransform,dr=cr===void 0?!0:cr,hr=c.hoverClass,ur=hr===void 0?"ds-hover":hr,mr=c.selectableClass,fr=mr===void 0?"ds-selectable":mr,pr=c.selectedClass,Ll=pr===void 0?"ds-selected":pr,gr=c.selectorClass,Il=gr===void 0?"ds-selector":gr,yr=c.selectorAreaClass,zl=yr===void 0?"ds-selector-area":yr,Rl=c.callback,Hl=c.onDragMove,Ul=c.onDragStartBegin,Fl=c.onDragStart,Kl=c.onElementSelect,Yl=c.onElementUnselect;r(this,h),a(this,"continue",!1),a(this,"start",function(){n.stopped=!1,n.Interaction.init()}),a(this,"break",function(){return n.continue=!0}),a(this,"getSelection",function(){return n.SelectedSet.elements}),a(this,"getSelectables",function(){return n.SelectableSet.elements}),a(this,"getInitialCursorPosition",function(){return n.stores.PointerStore.initialVal}),a(this,"getCurrentCursorPosition",function(){return n.stores.PointerStore.currentVal}),a(this,"getPreviousCursorPosition",function(){return n.stores.PointerStore.lastVal}),a(this,"getInitialCursorPositionArea",function(){return n.stores.PointerStore.initialValArea}),a(this,"getCurrentCursorPositionArea",function(){return n.stores.PointerStore.currentValArea}),a(this,"getPreviousCursorPositionArea",function(){return n.stores.PointerStore.lastValArea}),a(this,"isMultiSelect",function(Wl){return n.stores.KeyStore.isMultiSelectKeyPressed(Wl)}),a(this,"isDragging",function(){return n.Interaction.isDragging}),this.PubSub=new _l({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:Rl,onDragMove:Hl,onDragStart:Fl,onDragStartBegin:Ul,onElementSelect:Kl,onElementUnselect:Yl}),this.stores={PointerStore:new Cl({DS:this}),ScrollStore:new $l({DS:this,areaElement:d,zoom:L}),KeyStore:new Vl({DS:this,multiSelectKeys:Bl,multiSelectMode:Ne})},this.Area=new wl({area:d,PS:this.PubSub,zoom:L}),this.Selector=new El({DS:this,selector:Tl,selectorClass:Il,customStyles:ne}),this.SelectorArea=new Nl({DS:this,selectorAreaClass:zl,autoScrollSpeed:D,overflowTolerance:V}),this.SelectableSet=new xl({elements:v,DS:this,className:fr,hoverClassName:ur,useTransform:dr,draggability:bt}),this.SelectedSet=new Sl({DS:this,className:Ll}),this.Selection=new Dl({DS:this,hoverClassName:ur,multiSelectToggling:fe}),this.Drag=new vl({DS:this,draggability:bt,useTransform:dr,keyboardDrag:Ol,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},jl),zoom:L,keyboardDragSpeed:Pl}),this.Interaction=new kl({areaElement:d,DS:this,draggability:bt,immediateDrag:Al,selectableClass:fr}),bl({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",function(){return n.continue=!1}),this.start()}return s(h,[{key:"_callbacksTemp",value:function(n){var g=n.callback,d=n.onDragMove,w=n.onDragStart,v=n.onDragStartBegin,_=n.onElementSelect,D=n.onElementUnselect,C=function(T,L){return console.warn("[DragSelect] ".concat(T,' is deprecated. Use DragSelect.subscribe("').concat(L,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};g&&(C("callback","callback"),this.subscribe("callback",function(V){var T=V.items;V.item;var L=V.event;return g(T,L)})),d&&(C("onDragMove","dragmove"),this.subscribe("dragmove",function(V){V.items,V.item;var T=V.event;return d(T)})),w&&(C("onDragStart","dragstart"),this.subscribe("dragstart",function(V){V.items,V.item;var T=V.event;return w(T)})),v&&(C("onDragStartBegin","dragstart"),this.subscribe("dragstart",function(V){V.items,V.item;var T=V.event;return v(T)})),_&&(C("onElementSelect","elementselect"),this.subscribe("elementselect",function(V){V.items;var T=V.item,L=V.event;return _(T,L)})),D&&(C("onElementUnselect","elementunselect"),this.subscribe("elementunselect",function(V){V.items;var T=V.item,L=V.event;return D(T,L)}))}},{key:"stop",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;d&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(n),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),n&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ee(n)),d||this.addSelectables(n),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ee(n)),d&&this.removeSelectables(n),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(n){var g=this,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ee(n).forEach(function(v){return g.SelectedSet.has(v)?g.removeSelection(n,d,w):g.addSelection(n,d,w)}),d&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(n,g,d),this.getSelection()}},{key:"clearSelection",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=Ee(n);return this.SelectableSet.addAll(d),g&&this.SelectedSet.addAll(d),n}},{key:"setSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.removeSelectables(n,g),this.addSelectables(n,d)}},{key:"removeSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.SelectableSet.deleteAll(Ee(n)),g&&this.removeSelection(n),n}},{key:"getCursorPositionDifference",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");var d=g?this.getCurrentCursorPositionArea():this.getCurrentCursorPosition(),w=n?g?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():g?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return I(d,"-",w)}}]),h}();return Ml})})(vt);const Zr=vt.exports,Qr=(i,t,r,o,s)=>(t=Math,r=t.log,o=1024,s=r(i)/r(o)|0,i/t.pow(o,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B"),en=(i,t="en-US")=>new Date(i*1e3).toLocaleString(t),tn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},rn=[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)],nn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},on=[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)],ze=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(i){return(t,r)=>(e.openBlock(),e.createElementBlock("div",null,[i.direction=="down"?(e.openBlock(),e.createElementBlock("svg",tn,rn)):e.createCommentVNode("",!0),i.direction=="up"?(e.openBlock(),e.createElementBlock("svg",nn,on)):e.createCommentVNode("",!0)]))}}),an=["onClick"],sn=Object.assign({name:"VFToast.vue"},{setup(i){const t=e.inject("emitter"),{getStore:r}=e.inject("storage"),o=e.ref(r("full-screen",!1)),s=p=>p=="error"?"text-red-400 border-red-400":"text-lime-600 border-lime-600",a=e.ref([]),l=p=>{a.value.splice(p,1)},m=p=>{let f=a.value.findIndex(u=>u.id===p);f!==-1&&l(f)};return t.on("vf-toast-clear",()=>{a.value=[]}),t.on("vf-toast-push",p=>{let f=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");p.id=f,a.value.push(p),setTimeout(()=>{m(f)},5e3)}),(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([o.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,(u,y)=>(e.openBlock(),e.createElementBlock("div",{onClick:b=>l(y),key:u,class:e.normalizeClass([s(u.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 border text-xs rounded cursor-pointer"])},e.toDisplayString(u.label),11,an))),128))]),_:1})],2))}}),pe=i=>Object.entries(i).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:ln}=ie(),Ze=(i,t)=>ln.value+"?"+pe({q:"preview",adapter:i,path:t}),cn={class:"relative flex-auto flex flex-col overflow-hidden"},dn={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},hn={class:"absolute"},un=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),mn={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"},fn=["onDblclick","onTouchstart","onContextmenu","data-type","data-item","data-index"],pn={class:"grid grid-cols-12 items-center"},gn={class:"flex col-span-7 items-center"},yn={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"},bn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],wn={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"},vn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],kn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},_n={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},xn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Sn={class:"grid grid-cols-12 items-center"},Dn={class:"flex col-span-7 items-center"},En={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"},Nn=[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)],Vn={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"},Cn=[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)],$n={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Mn={class:"col-span-2 text-center"},Bn={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Tn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],An={class:"relative"},On={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"},jn=[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)],Pn=["src"],Ln={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"},In=[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)],zn={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},Rn={class:"break-all"},Hn=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(i){const t=i,r=e.inject("emitter"),{setStore:o,getStore:s}=e.inject("storage"),a=B=>B==null?void 0:B.substring(0,3),l=B=>B.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),m=e.ref(null),p=e.ref(null),f=e.ref(0),u=e.ref(null),{t:y}=e.inject("i18n"),b=Math.floor(Math.random()*2**32),E=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{E.value=!E.value,o("full-screen",E.value)});const k=e.ref("");r.on("vf-search-query",({newQuery:B})=>{k.value=B,B?r.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:B},onSuccess:O=>{O.files.length||r.emit("vf-toast-push",{label:y("No search result found.")})}}):r.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let S=null;const M=()=>{S&&clearTimeout(S)},R=B=>{S=setTimeout(()=>{A(B)},500)},A=B=>{B.type=="dir"?(r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:B.path}})):r.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:B})},N=e.reactive({active:!1,column:"",order:""}),P=(B=!0)=>{let O=[...t.data.files],$=N.column,I=N.order=="asc"?1:-1;if(!B)return O;const j=(G,W)=>typeof G=="string"&&typeof W=="string"?G.toLowerCase().localeCompare(W.toLowerCase()):G<W?-1:G>W?1:0;return N.active&&(O=O.slice().sort((G,W)=>j(G[$],W[$])*I)),O},H=B=>{N.active&&N.column==B?(N.active=N.order=="asc",N.column=B,N.order="desc"):(N.active=!0,N.column=B,N.order="asc")},x=()=>u.value.getSelection().map(B=>JSON.parse(B.dataset.item)),U=(B,O)=>{if(B.altKey||B.ctrlKey||B.metaKey)return B.preventDefault(),!1;B.dataTransfer.setDragImage(p.value,0,15),B.dataTransfer.effectAllowed="all",B.dataTransfer.dropEffect="copy",B.dataTransfer.setData("items",JSON.stringify(x()))},Y=(B,O)=>{B.preventDefault();let $=JSON.parse(B.dataTransfer.getData("items"));if($.find(I=>I.storage!=s("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:$,to:O}})},Q=(B,O)=>{B.preventDefault(),!O||O.type!=="dir"||u.value.getSelection().find($=>$==B.currentTarget)?(B.dataTransfer.dropEffect="none",B.dataTransfer.effectAllowed="none"):B.dataTransfer.dropEffect="copy"},re=()=>{u.value=new Zr({area:m.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),r.on("vf-explorer-update",()=>e.nextTick(()=>{u.value.clearSelection(),u.value.setSelectables(document.getElementsByClassName("vf-item-"+b))})),u.value.subscribe("predragstart",({event:B,isDragging:O})=>{if(O)f.value=u.value.getSelection().length,u.value.break();else{const $=B.target.offsetWidth-B.offsetX,I=B.target.offsetHeight-B.offsetY;$<15&&I<15&&(u.value.clearSelection(),u.value.break())}}),u.value.subscribe("predragmove",({isDragging:B})=>{B&&u.value.break()}),u.value.subscribe("callback",({items:B,event:O,isDragging:$})=>{r.emit("vf-nodes-selected",x()),f.value=u.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{u.value.setSelection(u.value.getSelection())}),e.onMounted(()=>{e.watch(()=>t.view,()=>r.emit("vf-explorer-update"))}),(B,O)=>(e.openBlock(),e.createElementBlock("div",cn,[i.view=="list"||k.value.length?(e.openBlock(),e.createElementBlock("div",dn,[e.createElementVNode("div",{onClick:O[0]||(O[0]=$=>H("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(y)("Name"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:N.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,N.active&&N.column=="basename"]])]),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:O[1]||(O[1]=$=>H("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(y)("Size"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:N.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,N.active&&N.column=="file_size"]])])),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:O[2]||(O[2]=$=>H("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(y)("Date"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:N.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,N.active&&N.column=="last_modified"]])])),k.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:O[3]||(O[3]=$=>H("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(y)("Filepath"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:N.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,N.active&&N.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",hn,[e.createElementVNode("div",{ref_key:"dragImage",ref:p,class:"absolute -z-50 -top-96"},[un,e.createElementVNode("div",mn,e.toDisplayString(f.value),1)],512)]),e.createElementVNode("div",{class:e.normalizeClass([E.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:m,onContextmenu:O[7]||(O[7]=e.withModifiers($=>e.unref(r).emit("vf-contextmenu-show",{event:$,area:m.value,items:x()}),["self","prevent"]))},[k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(P(),($,I)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:j=>A($),onTouchstart:j=>R($),onTouchend:O[4]||(O[4]=j=>M()),onContextmenu:e.withModifiers(j=>e.unref(r).emit("vf-contextmenu-show",{event:j,area:m.value,items:x(),target:$}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(b),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":$.type,"data-item":JSON.stringify($),"data-index":I},[e.createElementVNode("div",pn,[e.createElementVNode("div",gn,[$.type=="dir"?(e.openBlock(),e.createElementBlock("svg",yn,bn)):(e.openBlock(),e.createElementBlock("svg",wn,vn)),e.createElementVNode("span",kn,e.toDisplayString($.basename),1)]),e.createElementVNode("div",_n,e.toDisplayString($.path),1)])],42,fn))),256)):e.createCommentVNode("",!0),i.view=="list"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(P(),($,I)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:j=>A($),onTouchstart:j=>R($),onTouchend:O[5]||(O[5]=j=>M()),onContextmenu:e.withModifiers(j=>e.unref(r).emit("vf-contextmenu-show",{event:j,area:m.value,items:x(),target:$}),["prevent"]),onDragstart:j=>U(j),onDragover:j=>Q(j,$),onDrop:j=>Y(j,$),class:e.normalizeClass(["vf-item-"+e.unref(b),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":$.type,"data-item":JSON.stringify($),"data-index":I},[e.createElementVNode("div",Sn,[e.createElementVNode("div",Dn,[$.type=="dir"?(e.openBlock(),e.createElementBlock("svg",En,Nn)):(e.openBlock(),e.createElementBlock("svg",Vn,Cn)),e.createElementVNode("span",$n,e.toDisplayString($.basename),1)]),e.createElementVNode("div",Mn,e.toDisplayString($.file_size?e.unref(Qr)($.file_size):""),1),e.createElementVNode("div",Bn,e.toDisplayString(e.unref(en)($.last_modified)),1)])],42,xn))),256)):e.createCommentVNode("",!0),i.view=="grid"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(P(!1),($,I)=>{var j,G;return e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:W=>A($),onTouchstart:W=>R($),onTouchend:O[6]||(O[6]=W=>M()),onContextmenu:e.withModifiers(W=>e.unref(r).emit("vf-contextmenu-show",{event:W,area:m.value,items:x(),target:$}),["prevent"]),onDragstart:W=>U(W),onDragover:W=>Q(W,$),onDrop:W=>Y(W,$),class:e.normalizeClass(["vf-item-"+e.unref(b),"border border-transparent hover:bg-neutral-50 m-0.5 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 md:h-24 text-center justify-center select-none"]),"data-type":$.type,"data-item":JSON.stringify($),"data-index":I},[e.createElementVNode("div",null,[e.createElementVNode("div",An,[$.type=="dir"?(e.openBlock(),e.createElementBlock("svg",On,jn)):((j=$.mime_type)!=null?j:"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"h-10 md:h-12 m-auto",src:e.unref(Ze)(e.unref(s)("adapter",t.data.adapter),$.path),alt:""},null,8,Pn)):(e.openBlock(),e.createElementBlock("svg",Ln,In)),((G=$.mime_type)!=null?G:"").startsWith("image")?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",zn,e.toDisplayString(a($.extension)),1))]),e.createElementVNode("span",Rn,e.toDisplayString(l($.basename)),1)])],42,Tn)}),256)):e.createCommentVNode("",!0)],34),e.createVNode(sn)]))}}),Un={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Fn={class:"flex leading-5 items-center"},Kn=["aria-label"],Yn=[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)],Wn=["value"],Xn={class:"ml-3"},qn={key:0},Gn={class:"ml-1"},Jn={class:"flex leading-5 items-center"},Zn={value:"",disabled:""},Qn=e.createElementVNode("option",{value:"tr"},"Turkish",-1),eo=e.createElementVNode("option",{value:"en"},"English",-1),to=e.createElementVNode("option",{value:"fr"},"French",-1),ro=["aria-label"],no=[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)],oo=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(i){var b;const t=i,r=e.inject("emitter"),{getStore:o,setStore:s}=e.inject("storage"),a=e.ref(0),l=e.ref((b=o("adapter"))!=null?b:t.data.adapter),{t:m,changeLocale:p}=e.inject("i18n"),f=e.ref(o("locale","")),u=()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:l.value}}),s("adapter",l.value)};r.on("vf-nodes-selected",E=>{a.value=E.length});const y=e.ref("");return r.on("vf-search-query",({newQuery:E})=>{y.value=E}),(E,k)=>(e.openBlock(),e.createElementBlock("div",Un,[e.createElementVNode("div",Fn,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(m)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},Yn,8,Kn),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":k[0]||(k[0]=S=>l.value=S),onChange:u,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.data.storages,S=>(e.openBlock(),e.createElementBlock("option",{value:S},e.toDisplayString(S),9,Wn))),256))],544),[[e.vModelSelect,l.value]]),e.createElementVNode("div",Xn,[y.value.length?(e.openBlock(),e.createElementBlock("span",qn,e.toDisplayString(i.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Gn,e.toDisplayString(a.value>0?a.value+" "+e.unref(m)("item(s) selected."):""),1)])]),e.createElementVNode("div",Jn,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":k[1]||(k[1]=S=>f.value=S),onChange:k[2]||(k[2]=S=>e.unref(p)(S.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",Zn,e.toDisplayString(e.unref(m)("Language")),1),Qn,eo,to],544),[[e.vModelSelect,f.value]]),e.createElementVNode("span",{"aria-label":e.unref(m)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:k[3]||(k[3]=S=>e.unref(r).emit("vf-modal-show",{type:"message",title:"Vuefinder 1.0",message:e.unref(m)("Vuefinder is a file manager component for vue 3.")}))},no,8,ro)])]))}}),ao=(i,t=0,r=!1)=>{let o;return(...s)=>{r&&!o&&i(...s),clearTimeout(o),o=setTimeout(()=>{i(...s)},t)}},io=(i,t,r)=>{const o=e.ref(i);return e.customRef((a,l)=>({get(){return a(),o.value},set:ao(m=>{o.value=m,l()},t,r)}))},so={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"},lo=["aria-label"],co=[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)],ho={key:0,"aria-label":"Refresh","data-microtip-position":"bottom-right",role:"tooltip"},uo=[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)],mo={key:1,"aria-label":"Cancel","data-microtip-position":"bottom-right",role:"tooltip"},fo=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],po=["onClick"],go=[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)],yo={class:"flex leading-5"},bo=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),wo=["title","onClick"],vo={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"},ko=[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)],_o={key:3,class:"flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},xo=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),So=["onKeydown","placeholder"],Do=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Eo=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:o}=e.inject("storage"),s=e.ref(null),a=e.ref([]),l=e.ref(!1),m=e.ref(null),{t:p}=e.inject("i18n"),f=e.inject("loadingState");r.on("vf-explorer-update",()=>{var P;let A=[],N=[];s.value=(P=t.data.dirname)!=null?P:o("adapter","local")+"://",s.value.length==0&&(a.value=[]),s.value.replace(o("adapter","local")+"://","").split("/").forEach(function(H){A.push(H),A.join("/")!=""&&N.push({basename:H,name:H,path:o("adapter","local")+"://"+A.join("/"),type:"dir"})}),N.length>4&&(N=N.slice(-5),N[0].name=".."),a.value=N});const u=()=>{l.value=!1,b.value=""};r.on("vf-search-exit",()=>{u()});const y=()=>{l.value=!0,e.nextTick(()=>m.value.focus())},b=io("",400),E=()=>f.value;e.watch(b,A=>{r.emit("vf-toast-clear"),r.emit("vf-search-query",{newQuery:A})});const k=()=>a.value.length&&!l.value,S=A=>{var P;A.preventDefault();let N=JSON.parse(A.dataTransfer.getData("items"));if(N.find(H=>H.storage!=o("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:N,to:(P=a.value[a.value.length-2])!=null?P:{path:o("adapter","local")+"://"}}})},M=A=>{A.preventDefault(),k()?A.dataTransfer.dropEffect="copy":(A.dataTransfer.dropEffect="none",A.dataTransfer.effectAllowed="none")},R=()=>{b.value==""&&u()};return(A,N)=>(e.openBlock(),e.createElementBlock("div",so,[e.createElementVNode("span",{"aria-label":e.unref(p)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:N[0]||(N[0]=P=>M(P)),onDrop:N[1]||(N[1]=P=>S(P)),onClick:N[2]||(N[2]=P=>{var H,x;return!k()||e.unref(r).emit("vf-fetch",{params:{q:"index",adapter:i.data.adapter,path:(x=(H=a.value[a.value.length-2])==null?void 0:H.path)!=null?x:e.unref(o)("adapter","local")+"://"}})}),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"},co,34))],8,lo),E()?(e.openBlock(),e.createElementBlock("span",mo,[(e.openBlock(),e.createElementBlock("svg",{onClick:N[4]||(N[4]=P=>e.unref(r).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"},fo))])):(e.openBlock(),e.createElementBlock("span",ho,[(e.openBlock(),e.createElementBlock("svg",{onClick:N[3]||(N[3]=P=>{e.unref(r).emit("vf-fetch",{params:{q:"index",adapter:i.data.adapter,path:i.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"},uo))])),l.value?(e.openBlock(),e.createElementBlock("div",_o,[xo,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,onKeydown:e.withKeys(u,["esc"]),onBlur:R,"onUpdate:modelValue":N[6]||(N[6]=P=>e.isRef(b)?b.value=P:null),placeholder:e.unref(p)("Search anything.."),class:"py-0 px-2 w-full border-0 ring-0 outline-0 text-sm text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,So),[[e.vModelText,e.unref(b)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:u,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Do))])):(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(y,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:N[5]||(N[5]=P=>e.unref(r).emit("vf-fetch",{params:{q:"index",adapter:i.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"},go)),e.createElementVNode("div",yo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(P,H)=>(e.openBlock(),e.createElementBlock("div",{key:H},[bo,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:P.basename,onClick:x=>e.unref(r).emit("vf-fetch",{params:{q:"index",adapter:i.data.adapter,path:P.path}})},e.toDisplayString(P.name),9,wo)]))),128))]),E()?(e.openBlock(),e.createElementBlock("svg",vo,ko)):e.createCommentVNode("",!0)],8,po))]))}}),No=["onClick"],Vo=e.createElementVNode("span",{class:"px-1"},null,-1),Co=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(i){const t=i,r=e.inject("emitter"),o=e.ref(null),{apiUrl:s}=ie(),a=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),l=e.ref([]);r.on("vf-context-selected",b=>{l.value=b});const{t:m}=e.inject("i18n"),p={newfolder:{title:()=>m("New Folder"),action:()=>{r.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>m("Delete"),action:()=>{r.emit("vf-modal-show",{type:"delete",items:l})}},refresh:{title:()=>m("Refresh"),action:()=>{r.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>m("Preview"),action:()=>{r.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:l.value[0]})}},open:{title:()=>m("Open"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].path}})}},openDir:{title:()=>m("Open containing folder"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].dir}})}},download:{title:()=>m("Download"),action:()=>{const b=s.value+"?"+pe({q:"download",adapter:l.value[0].adapter,path:l.value[0].path});r.emit("vf-download",b)}},archive:{title:()=>m("Archive"),action:()=>{r.emit("vf-modal-show",{type:"archive",items:l})}},unarchive:{title:()=>m("Unarchive"),action:()=>{r.emit("vf-modal-show",{type:"unarchive",items:l})}},rename:{title:()=>m("Rename"),action:()=>{r.emit("vf-modal-show",{type:"rename",items:l})}}},f=b=>{r.emit("vf-contextmenu-hide"),b.action()},u=e.ref("");r.on("vf-search-query",({newQuery:b})=>{u.value=b}),r.on("vf-contextmenu-show",({event:b,area:E,items:k,target:S=null})=>{if(a.items=[],u.value)if(S)a.items.push(p.openDir),r.emit("vf-context-selected",[S]),console.log("search item selected");else return;else!S&&!u.value?(a.items.push(p.refresh),a.items.push(p.newfolder),r.emit("vf-context-selected",[]),console.log("no files selected")):k.length>1&&k.some(M=>M.path===S.path)?(a.items.push(p.refresh),a.items.push(p.archive),a.items.push(p.delete),r.emit("vf-context-selected",k),console.log(k.length+" selected (more than 1 item.)")):(S.type=="dir"?a.items.push(p.open):(a.items.push(p.preview),a.items.push(p.download)),a.items.push(p.rename),S.mime_type=="application/zip"?a.items.push(p.unarchive):a.items.push(p.archive),a.items.push(p.delete),r.emit("vf-context-selected",[S]),console.log(S.type+" is selected"));y(b,E)}),r.on("vf-contextmenu-hide",()=>{a.active=!1});const y=(b,E)=>{a.active=!0,e.nextTick(()=>{let k=E.getBoundingClientRect(),S=b.pageX,M=b.pageY,R=o.value.offsetHeight,A=o.value.offsetWidth;S=k.right-b.pageX+window.scrollX<A?S-A:S,M=k.bottom-b.pageY+window.scrollY<R?M-R:M,a.positions={left:S+"px",top:M+"px"}})};return(b,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:o,style:e.normalizeStyle(a.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.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:S=>f(k)},[Vo,e.createElementVNode("span",null,e.toDisplayString(k.title()),1)],8,No))),128))],4)):e.createCommentVNode("",!0)}}),$o=(i,t)=>{const r=i[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((o,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function Mo(i){const t=await $o(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>al),"../locales/tr.json":()=>Promise.resolve().then(()=>il)}),`../locales/${i}.json`);return JSON.parse(t.default)}function Bo(i,t){const{getStore:r,setStore:o}=Je(i),s=["en","tr"],a=e.ref({}),l=f=>{s.includes(f)||(console.log("The selected locale is not yet supported. The fallback language is set as 'en'"),f="en"),Mo(f).then(u=>{a.value=u,o("locale",f),o("translations",u),console.log(f+" is loaded.")})};r("locale")?a.value=r("translations"):l(t);const m=(f,...u)=>u.length?m(f=f.replace("%s",u.shift()),...u):f;function p(f,...u){return a.value.hasOwnProperty(f)?m(a.value[f],...u):f}return{t:p,support_locales:s,changeLocale:l}}const To=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Ao=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"},postData:{type:Object,default:{}}},setup(i){const t=i,r=br(),{setStore:o,getStore:s}=Je(t.id);e.provide("emitter",r),e.provide("storage",Je(t.id)),e.provide("postData",t.postData);const a=Bo(t.id,t.locale);e.provide("i18n",a);const{apiUrl:l,setApiUrl:m}=ie();m(t.url);const p=e.reactive({adapter:"local",storages:[],dirname:".",files:[]}),f=e.ref(s("viewport","grid")),u=e.ref(s("darkMode",t.dark));r.on("vf-darkMode-toggle",()=>{u.value=!u.value,o("darkMode",u.value)});const y=e.ref(!1);e.provide("loadingState",y);const b=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{b.value=!b.value,o("full-screen",b.value)}),r.on("vf-view-toggle",M=>{f.value=M});const E=e.reactive({active:!1,type:"delete",data:{}});r.on("vf-modal-close",()=>{E.active=!1}),r.on("vf-modal-show",M=>{E.active=!0,E.type=M.type,E.data=M});const k=M=>{Object.assign(p,M),r.emit("vf-nodes-selected",{}),r.emit("vf-explorer-update")};let S;return r.on("vf-fetch-abort",()=>{S.abort(),y.value=!1}),r.on("vf-fetch",({params:M,onSuccess:R=null,onError:A=null})=>{["index","search"].includes(M.q)&&(S&&S.abort(),y.value=!0),S=new AbortController;const N=S.signal;Ie(l.value,{params:M,signal:N}).then(P=>{["index","search"].includes(M.q)&&(y.value=!1),r.emit("vf-modal-close"),k(P),R(P)}).catch(P=>{A&&A(P)}).finally(()=>{})}),r.on("vf-download",M=>{document.getElementById("download_frame").src=M,r.emit("vf-modal-close")}),e.onMounted(()=>{r.emit("vf-fetch",{params:{q:"index",adapter:s("adapter",p.adapter)}})}),(M,R)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(u.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([b.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(b.value?"":"max-height: "+i.maxHeight),onMousedown:R[0]||(R[0]=A=>e.unref(r).emit("vf-contextmenu-hide"))},[e.createVNode(Gr,{data:p},null,8,["data"]),e.createVNode(Eo,{data:p},null,8,["data"]),e.createVNode(Hn,{view:f.value,data:p},null,8,["view","data"]),e.createVNode(oo,{data:p},null,8,["data"])],38),E.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+E.type),{key:0,selection:E.data,current:p},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Co,{current:p},null,8,["current"]),To],2))}}),Oo=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1),jo={class:"fixed z-10 inset-0 overflow-y-auto"},Po={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl sm:w-full"},Lo={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Io={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"},se={__name:"ModalLayout",setup(i){const t=e.inject("emitter");return e.onMounted(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus()}),(r,o)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:o[1]||(o[1]=e.withKeys(s=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Oo,e.createElementVNode("div",jo,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:o[0]||(o[0]=e.withModifiers(s=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Po,[e.createElementVNode("div",Lo,[e.renderSlot(r.$slots,"default")]),e.createElementVNode("div",Io,[e.renderSlot(r.$slots,"buttons")])])],32)])],32))}},zo=["aria-label"],Ro=[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)],le=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},setup(i){var l;const{t}=e.inject("i18n"),r=e.ref(!1),o=e.ref(null),s=e.ref((l=o.value)==null?void 0:l.strMessage);e.watch(s,()=>r.value=!1);const a=()=>r.value=!0;return(m,p)=>(e.openBlock(),e.createElementBlock("div",null,[r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:o,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",i.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(m.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:a,"aria-label":e.unref(t)("Close"),"data-microtip-position":"top-left",role:"tooltip"},Ro,8,zo)],2))]))}}),Ho={class:"sm:flex sm:items-start"},Uo=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-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),Fo={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Ko={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Yo={class:"mt-2"},Wo={class:"text-sm text-gray-500"},Xo={class:"flex text-sm text-gray-800 dark:text-gray-400"},qo={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"},Go=[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)],Jo={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"},Zo=[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)],Qo={class:"ml-1.5"},ea={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},ta=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:o}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(t.selection.items),l=e.ref(""),m=()=>{a.value.length&&r.emit("vf-fetch",{params:{q:"delete",adapter:o("adapter","local"),path:t.current.dirname,items:JSON.stringify(a.value.map(({path:p,type:f})=>({path:p,type:f})))},onSuccess:()=>{r.emit("vf-toast-push",{label:s("Files deleted.")})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:f[0]||(f[0]=u=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1),e.createElementVNode("div",ea,e.toDisplayString(e.unref(s)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ho,[Uo,e.createElementVNode("div",Fo,[e.createElementVNode("h3",Ko,e.toDisplayString(e.unref(s)("Delete files")),1),e.createElementVNode("div",Yo,[e.createElementVNode("p",Wo,e.toDisplayString(e.unref(s)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,u=>(e.openBlock(),e.createElementBlock("p",Xo,[u.type=="dir"?(e.openBlock(),e.createElementBlock("svg",qo,Go)):(e.openBlock(),e.createElementBlock("svg",Jo,Zo)),e.createElementVNode("span",Qo,e.toDisplayString(u.basename),1)]))),256)),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),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-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),oa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},aa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ia={class:"mt-2"},sa={class:"text-sm text-gray-500"},la=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(i){const t=e.inject("emitter"),{t:r}=e.inject("i18n");return(o,s)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[0]||(s[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(r)("Close")),1)]),default:e.withCtx(()=>{var a,l,m,p;return[e.createElementVNode("div",ra,[na,e.createElementVNode("div",oa,[e.createElementVNode("h3",aa,e.toDisplayString((l=(a=i.selection)==null?void 0:a.title)!=null?l:"Title"),1),e.createElementVNode("div",ia,[e.createElementVNode("p",sa,e.toDisplayString((p=(m=i.selection)==null?void 0:m.message)!=null?p:"Message")+".",1)])])])]}),_:1}))}}),ca={class:"sm:flex sm:items-start"},da=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),ha={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ua={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ma={class:"mt-2"},fa={class:"text-sm text-gray-500"},pa=["onKeyup","placeholder"],ga=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:o}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(""),l=e.ref(""),m=()=>{a.value!=""&&r.emit("vf-fetch",{params:{q:"newfolder",adapter:o("adapter","local"),path:t.current.dirname,name:a.value},onSuccess:()=>{r.emit("vf-toast-push",{label:s("%s is created.",a.value)})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Create")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=u=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ca,[da,e.createElementVNode("div",ha,[e.createElementVNode("h3",ua,e.toDisplayString(e.unref(s)("New Folder")),1),e.createElementVNode("div",ma,[e.createElementVNode("p",fa,e.toDisplayString(e.unref(s)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=u=>a.value=u),onKeyup:e.withKeys(m,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("Folder Name"),type:"text"},null,40,pa),[[e.vModelText,a.value]]),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ya={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),wa={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"},ka={class:"mt-2"},_a={class:"text-sm text-gray-500"},xa=["onKeyup","placeholder"],Sa=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:o}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(""),l=e.ref(""),m=()=>{a.value!=""&&r.emit("vf-fetch",{params:{q:"newfile",adapter:o("adapter","local"),path:t.current.dirname,name:a.value},onSuccess:()=>{r.emit("vf-toast-push",{label:s("%s is created.",a.value)})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},"Create!"),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=u=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},"Cancel")]),default:e.withCtx(()=>[e.createElementVNode("div",ya,[ba,e.createElementVNode("div",wa,[e.createElementVNode("h3",va,e.toDisplayString(e.unref(s)("New File")),1),e.createElementVNode("div",ka,[e.createElementVNode("p",_a,e.toDisplayString(e.unref(s)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=u=>a.value=u),onKeyup:e.withKeys(m,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("File Name"),type:"text"},null,40,xa),[[e.vModelText,a.value]]),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Da={class:"flex"},Ea={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Na={class:"ml-auto mb-2"},Va={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"},Ca={key:1},$a={__name:"Text",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,o=e.ref(""),s=e.ref(""),a=e.ref(null),l=e.ref(!1),{apiUrl:m}=ie(),p=e.ref(""),f=e.ref(!1),{t:u}=e.inject("i18n");e.onMounted(()=>{Ie(m.value,{params:{q:"preview",adapter:r.selection.adapter,path:r.selection.item.path},json:!1}).then(k=>{o.value=k,t("load")})});const y=()=>{l.value=!l.value,s.value=o.value,l.value==!0&&e.nextTick(()=>{a.value.focus()})},b=e.inject("postData"),E=()=>{p.value="",f.value=!1,Ie(m.value,{method:"POST",params:Object.assign(b,{q:"save",adapter:r.selection.adapter,path:r.selection.item.path,content:s.value}),json:!1}).then(k=>{p.value=u("Updated."),o.value=k,t("load"),l.value=!l.value}).catch(k=>{p.value=u(k.message),f.value=!0})};return(k,S)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Da,[e.createElementVNode("div",Ea,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",Na,[l.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(u)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:S[0]||(S[0]=M=>y())},e.toDisplayString(l.value?e.unref(u)("Cancel"):e.unref(u)("Edit")),1)])]),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Ca,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:a,"onUpdate:modelValue":S[1]||(S[1]=M=>s.value=M),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,s.value]])])):(e.openBlock(),e.createElementBlock("pre",Va,e.toDisplayString(o.value),1)),p.value.length?(e.openBlock(),e.createBlock(le,{key:2,error:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},Lc="";/*!
|
|
1
|
+
(function(e,Pe){typeof exports=="object"&&typeof module<"u"?module.exports=Pe(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],Pe):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=Pe(e.Vue,e.plupload))})(this,function(e,Pe){var uo;"use strict";const gt=(r=>r&&typeof r=="object"&&"default"in r?r:{default:r})(Pe),Qe=(uo=document.querySelector('meta[name="csrf-token"]'))==null?void 0:uo.getAttribute("content"),et=(r,{method:t="get",params:o={},json:n=!0,signal:s=null})=>{const a={method:t};if(a.signal=s,t=="get")r+="?"+new URLSearchParams(o);else{a.headers={},Qe&&(a.headers["X-CSRF-Token"]=Qe);let l=new FormData;for(const[m,p]of Object.entries(o))l.append(m,p);a.body=l}return fetch(r,a).then(l=>l.ok?n?l.json():l.text():l.json().then(Promise.reject.bind(Promise)))};function To(r){return{all:r=r||new Map,on:function(t,o){var n=r.get(t);n?n.push(o):r.set(t,[o])},off:function(t,o){var n=r.get(t);n&&(o?n.splice(n.indexOf(o)>>>0,1):r.set(t,[]))},emit:function(t,o){var n=r.get(t);n&&n.slice().map(function(s){s(o)}),(n=r.get("*"))&&n.slice().map(function(s){s(t,o)})}}}function yt(r){let t=localStorage.getItem(r+"_storage");const o=e.ref(JSON.parse(t));e.watch(o,n);function n(){o.value===null||o.value===""?localStorage.removeItem(r+"_storage"):localStorage.setItem(r+"_storage",JSON.stringify(o.value))}function s(m,p){o.value=Object.assign({...o.value},{[m]:p})}function a(){o.value=null}return{getStore:(m,p=null)=>o.value===null||o.value===""?p:o.value.hasOwnProperty(m)?o.value[m]:p,setStore:s,clearStore:a}}const Jt=e.ref("");function le(){function r(t){Jt.value=t}return{apiUrl:Jt,setApiUrl:r}}const Ao={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Oo={key:0,class:"flex text-center"},Lo=["aria-label"],Io=[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)],jo=["aria-label"],Po=[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)],zo=["aria-label"],Ro=[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)],Ho=["aria-label"],Fo=[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)],Uo=["aria-label"],Ko=[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)],Yo=["aria-label"],Wo=[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)],Xo=["aria-label"],qo=[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)],Go={key:1,class:"flex text-center"},Jo={class:"pl-2"},Zo={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Qo={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"},en=[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)],tn={class:"flex text-center items-center justify-end"},rn=["aria-label"],on=[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)],nn=["aria-label"],an={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"},sn={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"},ln={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"},cn=["aria-label"],dn={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"},hn={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"},un=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(r){const t=e.inject("emitter"),{getStore:o,setStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(o("viewport","grid")),l=e.ref([]),m=e.ref(o("full-screen",!1)),p=e.ref("");t.on("vf-search-query",({newQuery:b})=>{p.value=b});const f=e.inject("loadingState"),h=()=>f.value,y=()=>{m.value=!m.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",b=>{l.value=b}),t.on("vf-view-toggle",b=>{n("viewport",b),a.value=b}),(b,D)=>(e.openBlock(),e.createElementBlock("div",Ao,[p.value.length?(e.openBlock(),e.createElementBlock("div",Go,[e.createElementVNode("div",Jo,[e.createTextVNode(e.toDisplayString(e.unref(s)("Search results for"))+" ",1),e.createElementVNode("span",Zo,e.toDisplayString(p.value),1)]),h()?(e.openBlock(),e.createElementBlock("svg",Qo,en)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Oo,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:D[0]||(D[0]=_=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:l.value}))},Io,8,Lo),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[1]||(D[1]=_=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:l.value}))},Po,8,jo),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[2]||(D[2]=_=>l.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},Ro,2))],8,zo),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[3]||(D[3]=_=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},Fo,2))],8,Ho),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[4]||(D[4]=_=>e.unref(t).emit("vf-modal-show",{type:"upload",items:l.value}))},Ko,8,Uo),l.value.length==1&&l.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(s)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[5]||(D[5]=_=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},Wo,2))],8,Yo)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(s)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[6]||(D[6]=_=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},qo,2))],8,Xo))])),e.createElementVNode("div",tn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:D[7]||(D[7]=_=>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"},on))],8,rn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Toggle Full Screen"),"data-microtip-position":"bottom",role:"tooltip",onClick:y},[(e.openBlock(),e.createElementBlock("svg",an,[m.value?(e.openBlock(),e.createElementBlock("path",sn)):(e.openBlock(),e.createElementBlock("path",ln))]))],8,nn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:D[8]||(D[8]=_=>p.value.length||e.unref(t).emit("vf-view-toggle",a.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},[a.value=="grid"?(e.openBlock(),e.createElementBlock("path",dn)):e.createCommentVNode("",!0),a.value=="list"?(e.openBlock(),e.createElementBlock("path",hn)):e.createCommentVNode("",!0)],2))],8,cn)])]))}});var mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Zt={exports:{}};(function(r,t){(function(o,n){r.exports=n()})(mn,function(){function o(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}function n(u,c){for(var i=0;i<c.length;i++){var g=c[i];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(u,g.key,g)}}function s(u,c,i){return c&&n(u.prototype,c),i&&n(u,i),u}function a(u,c,i){return c in u?Object.defineProperty(u,c,{value:i,enumerable:!0,configurable:!0,writable:!0}):u[c]=i,u}function l(u,c){var i=Object.keys(u);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(u);c&&(g=g.filter(function(d){return Object.getOwnPropertyDescriptor(u,d).enumerable})),i.push.apply(i,g)}return i}function m(u){for(var c=1;c<arguments.length;c++){var i=arguments[c]!=null?arguments[c]:{};c%2?l(Object(i),!0).forEach(function(g){a(u,g,i[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach(function(g){Object.defineProperty(u,g,Object.getOwnPropertyDescriptor(i,g))})}return u}function p(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(c&&c.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),c&&h(u,c)}function f(u){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},f(u)}function h(u,c){return h=Object.setPrototypeOf||function(g,d){return g.__proto__=d,g},h(u,c)}function y(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(u,c,i){return y()?b=Reflect.construct:b=function(d,v,w){var x=[null];x.push.apply(x,v);var E=Function.bind.apply(d,x),V=new E;return w&&h(V,w.prototype),V},b.apply(null,arguments)}function D(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function _(u){var c=typeof Map=="function"?new Map:void 0;return _=function(g){if(g===null||!D(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof c<"u"){if(c.has(g))return c.get(g);c.set(g,d)}function d(){return b(g,arguments,f(this).constructor)}return d.prototype=Object.create(g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),h(d,g)},_(u)}function k(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function $(u,c){return c&&(typeof c=="object"||typeof c=="function")?c:k(u)}function P(u){var c=y();return function(){var g=f(u),d;if(c){var v=f(this).constructor;d=Reflect.construct(g,arguments,v)}else d=g.apply(this,arguments);return $(this,d)}}function L(u,c){for(;!Object.prototype.hasOwnProperty.call(u,c)&&(u=f(u),u!==null););return u}function B(u,c,i){return typeof Reflect<"u"&&Reflect.get?B=Reflect.get:B=function(d,v,w){var x=L(d,v);if(!!x){var E=Object.getOwnPropertyDescriptor(x,v);return E.get?E.get.call(w):E.value}},B(u,c,i||u)}function T(u,c){return j(u)||Z(u,c)||ee(u,c)||O()}function R(u){return S(u)||Y(u)||ee(u)||M()}function S(u){if(Array.isArray(u))return ne(u)}function j(u){if(Array.isArray(u))return u}function Y(u){if(typeof Symbol<"u"&&Symbol.iterator in Object(u))return Array.from(u)}function Z(u,c){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(u)))){var i=[],g=!0,d=!1,v=void 0;try{for(var w=u[Symbol.iterator](),x;!(g=(x=w.next()).done)&&(i.push(x.value),!(c&&i.length===c));g=!0);}catch(E){d=!0,v=E}finally{try{!g&&w.return!=null&&w.return()}finally{if(d)throw v}}return i}}function ee(u,c){if(!!u){if(typeof u=="string")return ne(u,c);var i=Object.prototype.toString.call(u).slice(8,-1);if(i==="Object"&&u.constructor&&(i=u.constructor.name),i==="Map"||i==="Set")return Array.from(u);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ne(u,c)}}function ne(u,c){(c==null||c>u.length)&&(c=u.length);for(var i=0,g=new Array(c);i<c;i++)g[i]=u[i];return g}function M(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var C=function(c,i,g){var d=c.x,v=c.y,w=g.x,x=g.y,E={"+":{x:d+w,y:v+x},"-":{x:d-w,y:v-x},"*":{x:d*w,y:v*x},"/":{x:d/w,y:v/x}};return E[i]},H=function(c){return{x:c.left,y:c.top}},F=function(c){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:c.x,top:c.y,right:c.x,bottom:c.y,width:i,height:i}},Q=function(c){return{x:c,y:c}},W=function(u,c,i){window.addEventListener("resize",c),window.addEventListener("scroll",c),u.forEach(function(g,d){i.observe(g,{childList:d!==0,attributes:!0})})},Je=function(u){var c=Le(u);return c.x||c.y?!0:u instanceof HTMLDocument?u.body?!!(u.body.scrollTop=1):!!(u.documentElement.scrollTop=1):!!(u.scrollTop=1)},ut=function(u){var c=document.createElement("div");return c.style.position="fixed",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="999999999999999999",c.classList.add(u),c},mt=function(u){var c=document.createElement("div");return c.style.position="absolute",u||(c.style.background="rgba(0, 0, 255, 0.1)",c.style.border="1px solid rgba(0, 0, 255, 0.45)",c.style.display="none",c.style.pointerEvents="none"),c},ft=function(u,c){var i;return function(){for(var g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];var w=function(){i=null,u.apply(void 0,d)};clearTimeout(i),i=setTimeout(w,c)}},Oe=function(){var u,c,i,g;return{y:((u=document.body)===null||u===void 0?void 0:u.scrollTop)||((c=document.documentElement)===null||c===void 0?void 0:c.scrollTop)||0,x:((i=document.body)===null||i===void 0?void 0:i.scrollLeft)||((g=document.documentElement)===null||g===void 0?void 0:g.scrollLeft)||0}},Xt=function(u,c){if(u instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var i=u.getBoundingClientRect();return{top:i.top,left:i.left,bottom:i.bottom,right:i.right,width:(u.clientWidth||i.width)*c,height:(u.clientHeight||i.height)*c}},Le=function(u){return!u||u instanceof Document?Oe():{x:u.scrollLeft>=0?u.scrollLeft:Oe().x,y:u.scrollTop>=0?u.scrollTop:Oe().y}},mo=function(u){var c=u.elementRect,i=u.containerRect,g=u.tolerance,d=g===void 0?{x:0,y:0}:g,v=[];return c.top-d.y<i.top&&v.push("top"),c.left-d.x<i.left&&v.push("left"),c.bottom+d.y>i.bottom&&v.push("bottom"),c.right+d.y>i.right&&v.push("right"),v},Nd=function(u){var c=u.event;return{x:c.clientX,y:c.clientY}},Cd=function(u){var c=u.scrollAmount,i=u.initialPointerPos,g=u.pointerPos,d={};return g.x>i.x-c.x?(d.left=i.x-c.x,d.width=g.x-i.x+c.x):(d.left=g.x,d.width=i.x-g.x-c.x),g.y>i.y-c.y?(d.top=i.y-c.y,d.height=g.y-i.y+c.y):(d.top=g.y,d.height=i.y-g.y-c.y),d},fo=function(c){var i={x:0,y:0},g=window.getComputedStyle(c);if(!g.transform||g.transform==="none")return i;if(g.transform.indexOf("3d")>=0){var d=g.transform.trim().match(/matrix3d\((.*?)\)/);if(d&&d.length){var v,w=(v=d[1])===null||v===void 0?void 0:v.split(",");i.x=parseInt(w[12])||0,i.y=parseInt(w[13])||0}return i}else{var x=g.transform.trim().match(/matrix\((.*?)\)/);if(x&&x.length){var E,V=(E=x[1])===null||E===void 0?void 0:E.split(",");i.x=parseInt(V[4])||0,i.y=parseInt(V[5])||0}return i}},Vd=function(c){var i=c.style.transform;if(!i||i.indexOf("translate")<0)return fo(c);var g={x:0,y:0},d=i.trim().match(/translate[3dD]*?\(.*?\)/);if(d){var v,w=(v=d[0])===null||v===void 0?void 0:v.split("(");if(w){var x,E=(x=w[1])===null||x===void 0?void 0:x.split(",");g.x=parseInt(E[0])||0,g.y=parseInt(E[1])||0}}return!g.x&&!g.x?fo(c):g},$d=function(c){var i=c.style,g={x:parseInt(i.left)||0,y:parseInt(i.top)||0};if(!g.x&&!g.x){var d=window.getComputedStyle(c);return{x:parseInt(d.left)||0,y:parseInt(d.top)||0}}return g},Md=function(u,c){return c?Vd(u):$d(u)},Bd=function(u){var c=u.element,i=u.edges,g=u.elementRect,d=u.containerRect,v=u.elementPos,w=u.useTransform;i.includes("top")&&Ze(c,{y:v.y+d.top-g.top,x:v.x},w),i.includes("left")&&Ze(c,{y:v.y,x:v.x+d.left-g.left},w),i.includes("bottom")&&Ze(c,{y:v.y+d.bottom-g.bottom,x:v.x},w),i.includes("right")&&Ze(c,{y:v.y,x:v.x+d.right-g.right},w)},po=function(u){var c=u.computedStyle,i=u.node,g=c.position,d=g==="absolute"||g==="relative"||g==="fixed";!(i instanceof HTMLDocument)&&!d&&(i.style.position="relative")},Td=function(u){var c=u.shiftKey,i=u.keyboardDragSpeed,g=u.zoom,d=u.key,v=u.dragKeys,w=u.scrollDiff,x=u.canScroll,E=u.scrollCallback,V={x:0,y:0},N=c?i*4*g:i*g;return v.left.includes(d)&&(V.x=w.x||-N,!c&&!w.x&&x&&E(["left"],i)),v.right.includes(d)&&(V.x=w.x||N,!c&&!w.x&&x&&E(["right"],i)),v.up.includes(d)&&(V.y=w.y||-N,!c&&!w.y&&x&&E(["top"],i)),v.down.includes(d)&&(V.y=w.y||N,!c&&!w.y&&x&&E(["bottom"],i)),V},Ad=function(u){var c=u.element,i=u.force,g=u.multiSelectionToggle,d=u.SelectedSet,v=u.hoverClassName;c.classList.contains(v)&&!i||(d.has(c)?g&&d.delete(c):d.add(c),c.classList.add(v))},Od=function(u){var c=u.element,i=u.force,g=u.SelectedSet,d=u.PrevSelectedSet,v=u.hoverClassName;if(!c.classList.contains(v)&&!i)return!1;var w=g.has(c),x=d.has(c);w&&!x?g.delete(c):!w&&x&&g.add(c),c.classList.remove(v)},qt=function(u,c){return u.left<c.right&&u.right>c.left&&u.top<c.bottom&&u.bottom>c.top},go=function(u){var c=u.element,i=u.posDirection,g=u.containerRect,d=u.useTransform,v=Md(c,d),w=C(v,"+",i);Ze(c,w,d);var x=c.getBoundingClientRect(),E=mo({elementRect:x,containerRect:g});Bd({element:c,edges:E,elementRect:x,containerRect:g,elementPos:w,useTransform:d})},Ld=function(u,c){window.removeEventListener("resize",c),window.removeEventListener("scroll",c),u.disconnect()},Id=function(u,c,i){if(!!c.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,d=u instanceof HTMLDocument?g||document.body:u,v=c.includes("top")&&d.scrollTop>0,w=c.includes("bottom")&&d.scrollTop<d.scrollHeight,x=c.includes("left")&&d.scrollLeft>0,E=c.includes("right")&&d.scrollLeft<d.scrollWidth;v&&(d.scrollTop-=1*i),w&&(d.scrollTop+=1*i),x&&(d.scrollLeft-=1*i),E&&(d.scrollLeft+=1*i)}},Ze=function(u,c,i){if(i){var g=u.style.transform;u.style.transform="translate3d(".concat(c.x,"px,").concat(c.y,"px,1px) ").concat(g.replace(/translate.*?\)/g,""))}else u.style.left="".concat(c.x,"px"),u.style.top="".concat(c.y,"px");return u},jd=function(u){for(var c=u.subscribe,i=u.publish,g=u.Interaction,d=u.SelectedSet,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(N){return N.event}}],"Interaction:end":[{name:"callback"}]},w=function(){var N=T(E[x],2),A=N[0],I=N[1];["pre",!1].forEach(function(X){return c(X?"".concat(A,":").concat(X):A,function(ae){return I.forEach(function(G){return(!G.condition||G.condition(ae))&&i(X?"".concat(X).concat(G.name):G.name,m({items:d.elements,isDragging:g.isDragging},ae))})})})},x=0,E=Object.entries(v);x<E.length;x++)w()},Ie=function(u){return u?!Array.isArray(u)&&(u instanceof HTMLElement||u instanceof SVGElement)?[u]:R(u):[]},yo=function(u,c){u.style.left="".concat(c.left,"px"),u.style.top="".concat(c.top,"px"),u.style.width="".concat(c.width,"px"),u.style.height="".concat(c.height,"px")},Pd=function(){function u(c){var i=this,g=c.area,d=c.PS,v=c.zoom;o(this,u),a(this,"_modificationCallback",void 0),a(this,"_modificationObserver",void 0),a(this,"_zoom",void 0),a(this,"_node",void 0),a(this,"_parentNodes",void 0),a(this,"_computedStyle",void 0),a(this,"_computedBorder",void 0),a(this,"_rect",void 0),a(this,"setArea",function(w){i._node=w,po({computedStyle:i.computedStyle,node:i._node}),setTimeout(function(){i.PubSub.publish("Area:modified:pre",{item:i}),i.reset(),i.PubSub.publish("Area:modified",{item:i})})}),a(this,"start",function(){W(i.parentNodes,i._modificationCallback,i._modificationObserver)}),a(this,"reset",function(){i._computedStyle=void 0,i._rect=void 0,i._computedBorder=void 0,i._parentNodes=void 0}),a(this,"stop",function(){Ld(i._modificationObserver,i._modificationCallback),i.reset()}),a(this,"scroll",function(w,x){var E={scroll_directions:w,scroll_multiplier:x};i.PubSub.publish("Area:scroll:pre",E),Id(i._node,w,x),i.PubSub.publish("Area:scroll",E)}),this._zoom=v,this.PubSub=d,this.setArea(g),this._modificationCallback=ft(function(w){i.PubSub.publish("Area:modified:pre",{event:w,item:i}),i.reset(),i.PubSub.publish("Area:modified",{event:w,item:i})},60),this._modificationObserver=new MutationObserver(this._modificationCallback),this.PubSub.subscribe("Interaction:init",this.start),this.PubSub.subscribe("Interaction:end",this.reset)}return s(u,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof HTMLDocument?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=Xt(this.HTMLNode,this._zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;var i=function g(d){var v,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,x=(v=d[w])===null||v===void 0?void 0:v.parentNode;return x?(d.push(x),w++,g(d,w)):d};return this._parentNodes=i([this.HTMLNode]),this._parentNodes}}]),u}(),zd=function(){function u(c){var i=this,g=c.DS,d=c.dragKeys,v=c.draggability,w=c.keyboardDrag,x=c.keyboardDragSpeed,E=c.useTransform,V=c.zoom;o(this,u),a(this,"_useTransform",void 0),a(this,"_prevCursorPos",void 0),a(this,"_prevScrollPos",void 0),a(this,"_elements",[]),a(this,"_draggability",void 0),a(this,"_dragKeys",void 0),a(this,"_dragKeysFlat",void 0),a(this,"_keyboardDrag",void 0),a(this,"_keyboardDragSpeed",void 0),a(this,"_zoom",void 0),a(this,"keyboardDrag",function(N){var A=N.event,I=N.key;if(!(!i._keyboardDrag||!i._dragKeysFlat.includes(I)||!i.DS.SelectedSet.size||!i._draggability||i.DS.continue)){var X={event:A,isDragging:!0,isDraggingKeyboard:!0};i.DS.publish(["Interaction:start:pre","Interaction:start"],X),i._elements=i.DS.getSelection(),i.handleZIndex(!0);var ae=Td({shiftKey:i.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:i._keyboardDragSpeed,zoom:i._zoom,key:I,scrollCallback:i.DS.Area.scroll,scrollDiff:i._scrollDiff,canScroll:i.DS.stores.ScrollStore.canScroll,dragKeys:i._dragKeys});i._elements.forEach(function(G){return go({element:G,posDirection:ae,containerRect:i.DS.SelectorArea.rect,useTransform:i._useTransform})}),i.DS.publish(["Interaction:update:pre","Interaction:update"],X)}}),a(this,"keyboardEnd",function(N){var A=N.event,I=N.key;if(!(!i._keyboardDrag||!i._dragKeysFlat.includes(I)||!i.DS.SelectedSet.size||!i._draggability)){var X={event:A,isDragging:i._draggability,isDraggingKeyboard:!0};i.DS.publish(["Interaction:end:pre","Interaction:end"],X)}}),a(this,"start",function(N){var A=N.isDragging,I=N.isDraggingKeyboard;!A||I||(i._prevCursorPos=null,i._prevScrollPos=null,i._elements=i.DS.getSelection(),i.handleZIndex(!0))}),a(this,"stop",function(N){N!=null&&N.isKeyboard||(i._prevCursorPos=null,i._prevScrollPos=null,i.handleZIndex(!1),i._elements=[])}),a(this,"update",function(N){var A=N.isDragging,I=N.isDraggingKeyboard;if(!(!A||!i._elements.length||I||i.DS.continue)){var X=C(i._cursorDiff,"+",i._scrollDiff);i._elements.forEach(function(ae){return go({element:ae,posDirection:X,containerRect:i.DS.SelectorArea.rect,useTransform:i._useTransform})})}}),a(this,"handleZIndex",function(N){i._elements.forEach(function(A){return A.style.zIndex="".concat((parseInt(A.style.zIndex)||0)+N?9999:-9998)})}),this.DS=g,this._useTransform=E,this._keyboardDragSpeed=x,this._keyboardDrag=w,this._zoom=V,this._draggability=v,this._dragKeys={up:d.up.map(function(N){return N.toLowerCase()}),down:d.down.map(function(N){return N.toLowerCase()}),left:d.left.map(function(N){return N.toLowerCase()}),right:d.right.map(function(N){return N.toLowerCase()})},this._dragKeysFlat=[].concat(R(this._dragKeys.up),R(this._dragKeys.down),R(this._dragKeys.left),R(this._dragKeys.right)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return s(u,[{key:"_cursorDiff",get:function(){var i=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?C(i,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=i,g}},{key:"_scrollDiff",get:function(){var i=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?C(i,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=i,g}}]),u}(),Rd=function(){function u(c){var i=this,g=c.DS,d=c.areaElement,v=c.draggability,w=c.immediateDrag,x=c.selectableClass;o(this,u),a(this,"_areaElement",void 0),a(this,"_draggability",void 0),a(this,"_immediateDrag",void 0),a(this,"_selectableClass",void 0),a(this,"isInteracting",void 0),a(this,"isDragging",void 0),a(this,"init",function(){return i.DS.publish("Interaction:init:pre",{})}),a(this,"_init",function(){i.stop(),i._areaElement.addEventListener("mousedown",i.start),i._areaElement.addEventListener("touchstart",i.start,{passive:!1}),i.DS.publish("Interaction:init",{})}),a(this,"start",function(E){return i.DS.publish("Interaction:start:pre",{event:E,isDragging:i.isDragging})}),a(this,"_start",function(E){E.type==="touchstart"&&E.preventDefault(),i._canInteract(E)&&(i.isInteracting=!0,i.isDragging=i.isDragEvent(E),i.DS.publish("Interaction:start",{event:E,isDragging:i.isDragging}),document.addEventListener("mouseup",i.reset),document.addEventListener("touchend",i.reset))}),a(this,"isDragEvent",function(E){var V=E.target.closest(".".concat(i._selectableClass));return!i._draggability||i.DS.stores.KeyStore.isMultiSelectKeyPressed(E)||!V?!1:(i._immediateDrag&&(i.DS.SelectedSet.size?i.DS.SelectedSet.has(V)||(i.DS.SelectedSet.clear(),i.DS.SelectedSet.add(V)):i.DS.SelectedSet.add(V)),!!i.DS.SelectedSet.has(V))}),a(this,"onClick",function(E){var V=E.event;if(!!i._canInteract(V)&&!(V.detail>0)){var N=i.DS,A=N.stores,I=A.PointerStore,X=A.KeyStore,ae=N.SelectableSet,G=N.SelectedSet;I.start(V);var je=V.target;!ae.has(je)||(X.isMultiSelectKeyPressed(V)||G.clear(),G.toggle(je),i.reset())}}),a(this,"stop",function(){i.isInteracting=!1,i.isDragging=!1,i._areaElement.removeEventListener("mousedown",i.start),i._areaElement.removeEventListener("touchstart",i.start,{passive:!1}),document.removeEventListener("mouseup",i.reset),document.removeEventListener("touchend",i.reset)}),a(this,"update",function(E){var V=E.event,N=E.scroll_directions,A=E.scroll_multiplier;i.isInteracting&&i.DS.publish(["Interaction:update:pre","Interaction:update"],{event:V,scroll_directions:N,scroll_multiplier:A,isDragging:i.isDragging})}),a(this,"reset",function(E){return i.DS.publish("Interaction:end:pre",{event:E,isDragging:i.isDragging})}),a(this,"_reset",function(E){var V=i.isDragging;i.stop(),i.init(),i.DS.publish("Interaction:end",{event:E,isDragging:V})}),this._areaElement=d,this._draggability=v,this._immediateDrag=w,this._selectableClass=x,this.DS=g,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(E){var V=E.event;return i.start(V)}),this.DS.subscribe("Interaction:start:pre",function(E){var V=E.event;return i._start(V)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(E){var V=E.event;return i._reset(V)}),this.DS.subscribe("Area:scroll",this.update)}return s(u,[{key:"_canInteract",value:function(i){var g=i.clientX===0&&i.clientY===0&&i.detail===0&&i.target;return!(i.button===2||this.isInteracting||i.target&&!this.DS.SelectorArea.isInside(i.target)||!g&&!this.DS.SelectorArea.isClicked(i))}}]),u}(),Hd=function u(c){var i=this,g=c.DS;o(this,u),a(this,"subscribers",{}),a(this,"subscribe",function(d,v){return Array.isArray(i.subscribers[d])||(i.subscribers[d]=[]),i.subscribers[d].push(v),i.subscribers[d].length-1}),a(this,"unsubscribe",function(d,v,w){w>=0?i.subscribers[d].splice(w,1):v&&(i.subscribers[d]=i.subscribers[d].filter(function(x){return x!==v}))}),a(this,"publish",function(d,v){Array.isArray(d)?d.forEach(function(w){return i._publish(w,v)}):i._publish(d,v)}),a(this,"_publish",function(d,v){var w=i.subscribers[d];!Array.isArray(w)||(d.includes(":pre")?i._handlePrePublish(w,v):i._handlePublish(w,v))}),a(this,"_handlePublish",function(d,v){for(var w=0,x=d.length;w<x;w++){if(i.DS.stopped)return;d[w](v)}}),a(this,"_handlePrePublish",function(d,v){for(var w=d.length;w--;){if(i.DS.stopped)return;d[w](v)}}),this.DS=g},Fd=function(u){p(i,u);var c=P(i);function i(g){var d,v=g.elements,w=g.className,x=g.hoverClassName,E=g.draggability,V=g.useTransform,N=g.DS;return o(this,i),d=c.call(this),a(k(d),"_initElements",void 0),a(k(d),"_className",void 0),a(k(d),"_hoverClassName",void 0),a(k(d),"_useTransform",void 0),a(k(d),"_draggability",void 0),a(k(d),"init",function(){return d._initElements.forEach(function(A){return d.add(A)})}),a(k(d),"clear",function(){return d.forEach(function(A){return d.delete(A)})}),a(k(d),"_onClick",function(A){return d.DS.publish(["Selectable:click:pre","Selectable:click"],{event:A})}),a(k(d),"_onPointer",function(A){return d.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:A})}),a(k(d),"addAll",function(A){return A.forEach(function(I){return d.add(I)})}),a(k(d),"deleteAll",function(A){return A.forEach(function(I){return d.delete(I)})}),d.DS=N,d._initElements=Ie(v),d._className=w,d._hoverClassName=x,d._useTransform=V,d._draggability=E,d.DS.subscribe("Interaction:init",d.init),d}return s(i,[{key:"add",value:function(d){return d.classList.add(this._className),d.addEventListener("click",this._onClick),d.addEventListener("mousedown",this._onPointer),d.addEventListener("touchstart",this._onPointer,{passive:!1}),this._draggability&&!this._useTransform&&po({computedStyle:window.getComputedStyle(d),node:d}),B(f(i.prototype),"add",this).call(this,d)}},{key:"delete",value:function(d){return d.classList.remove(this._className),d.classList.remove(this._hoverClassName),d.removeEventListener("click",this._onClick),d.removeEventListener("mousedown",this._onPointer),d.removeEventListener("touchstart",this._onPointer,{passive:!1}),B(f(i.prototype),"delete",this).call(this,d)}},{key:"elements",get:function(){return Array.from(this.values())}}]),i}(_(Set)),Ud=function(u){p(i,u);var c=P(i);function i(g){var d,v=g.className,w=g.DS;return o(this,i),d=c.call(this),a(k(d),"_className",void 0),a(k(d),"clear",function(){return d.forEach(function(x){return d.delete(x)})}),a(k(d),"addAll",function(x){return x.forEach(function(E){return d.add(E)})}),a(k(d),"deleteAll",function(x){return x.forEach(function(E){return d.delete(E)})}),d.DS=w,d._className=v,d}return s(i,[{key:"add",value:function(d){if(!B(f(i.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};return this.DS.publish("Selected:added:pre",v),B(f(i.prototype),"add",this).call(this,d),d.classList.add(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)+1),this.DS.publish("Selected:added",v),this}}},{key:"delete",value:function(d){if(!!B(f(i.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};this.DS.publish("Selected:removed:pre",v);var w=B(f(i.prototype),"delete",this).call(this,d);return d.classList.remove(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)-1),this.DS.publish("Selected:removed",v),w}}},{key:"toggle",value:function(d){return this.has(d)?this.delete(d):this.add(d),d}},{key:"elements",get:function(){return Array.from(this.values())}}]),i}(_(Set)),Kd=function(){function u(c){var i=this,g=c.DS,d=c.hoverClassName,v=c.multiSelectToggling;o(this,u),a(this,"_prevSelectedSet",void 0),a(this,"_hoverClassName",void 0),a(this,"_multiSelectToggling",void 0),a(this,"start",function(w){var x=w.event,E=w.isDragging;E||(i._storePrevious(x),i._handleInsideSelection(!0,x))}),a(this,"update",function(w){var x=w.isDragging;x||i.DS.continue||i._handleInsideSelection()}),a(this,"_handleInsideSelection",function(w,x){for(var E=i.DS,V=E.SelectableSet,N=E.SelectorArea,A=E.Selector,I=V.elements.map(function(_e){return[_e,_e.getBoundingClientRect()]}),X=[],ae=[],G=0,je=I.length;G<je;G++)!N.isInside(I[G][0],I[G][1])||(qt(I[G][1],A.rect)?X.push(I[G][0]):ae.push(I[G][0]));var pt=i.DS.stores.KeyStore.isMultiSelectKeyPressed(x)&&i._multiSelectToggling;i.DS.continue||(X.forEach(function(_e){return Ad({element:_e,force:w,multiSelectionToggle:pt,SelectedSet:i.DS.SelectedSet,hoverClassName:i._hoverClassName})}),ae.forEach(function(_e){return Od({element:_e,force:w,SelectedSet:i.DS.SelectedSet,hoverClassName:i._hoverClassName,PrevSelectedSet:i._prevSelectedSet})}))}),this._hoverClassName=d,this._multiSelectToggling=v,this.DS=g,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(u,[{key:"_storePrevious",value:function(i){var g=this.DS,d=g.stores.KeyStore,v=g.SelectedSet;d.isMultiSelectKeyPressed(i)?this._prevSelectedSet=new Set(v):this._prevSelectedSet=new Set}}]),u}(),Yd=function(){function u(c){var i=this,g=c.DS,d=c.selector,v=c.selectorClass,w=c.customStyles;o(this,u),a(this,"_rect",void 0),a(this,"start",function(x){var E=x.isDragging;if(!E){var V=i.DS.stores.PointerStore,N=V.initialValArea;yo(i.HTMLNode,F(N,1)),i.HTMLNode.style.display="block",i._rect=null}}),a(this,"stop",function(){i.HTMLNode.style.width="0",i.HTMLNode.style.height="0",i.HTMLNode.style.display="none"}),a(this,"update",function(x){var E=x.isDragging;if(!(E||i.DS.continue)){var V=i.DS.stores,N=V.ScrollStore,A=V.PointerStore,I=Cd({scrollAmount:N.scrollAmount,initialPointerPos:A.initialValArea,pointerPos:A.currentValArea});yo(i.HTMLNode,I),i._rect=null}}),this.DS=g,this.HTMLNode=d||mt(w),this.HTMLNode.classList.add(v),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(u,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),u}(),Wd=function(){function u(c){var i=this,g=c.DS,d=c.selectorAreaClass,v=c.autoScrollSpeed,w=c.overflowTolerance;o(this,u),a(this,"_autoScrollSpeed",void 0),a(this,"_scrollInterval",void 0),a(this,"_rect",void 0),a(this,"currentEdges",[]),a(this,"_overflowTolerance",void 0),a(this,"start",function(){return i.applyElements("append")}),a(this,"applyElements",function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",E=document.body?"body":"documentElement",V="".concat(x,"Child");i.HTMLNode[V](i.DS.Selector.HTMLNode),document[E][V](i.HTMLNode)}),a(this,"updatePos",function(){i._rect=null;var x=i.DS.Area.rect,E=i.DS.Area.computedBorder,V=i.HTMLNode.style,N="".concat(x.top+E.top,"px"),A="".concat(x.left+E.left,"px"),I="".concat(x.width,"px"),X="".concat(x.height,"px");V.top!==N&&(V.top=N),V.left!==A&&(V.left=A),V.width!==I&&(V.width=I),V.height!==X&&(V.height=X)}),a(this,"stop",function(x){i.stopAutoScroll(),x&&i.applyElements("remove")}),a(this,"startAutoScroll",function(){i.currentEdges=[],i._scrollInterval=setInterval(function(){return i.handleAutoScroll()},16)}),a(this,"handleAutoScroll",function(){if(!i.DS.continue){var x=i.DS,E=x.stores.PointerStore,V=x.Area;i.currentEdges=mo({elementRect:F(E.currentVal),containerRect:i.rect,tolerance:i._overflowTolerance}),i.currentEdges.length&&V.scroll(i.currentEdges,i._autoScrollSpeed)}}),a(this,"stopAutoScroll",function(){i.currentEdges=[],clearInterval(i._scrollInterval)}),a(this,"isInside",function(x,E){return i.DS.Area.HTMLNode.contains(x)&&i.DS.stores.ScrollStore.canScroll?!0:qt(i.rect,E||x.getBoundingClientRect())}),this._autoScrollSpeed=v,this._overflowTolerance=w,this.DS=g,this.HTMLNode=ut(d),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){i.updatePos(),i.stopAutoScroll()})}return s(u,[{key:"isClicked",value:function(i){var g=this.DS.stores.PointerStore,d=i?g.getPointerPosition(i):g.initialVal;return qt({left:d.x,top:d.y,right:d.x,bottom:d.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),u}(),Xd=function(){function u(c){var i=this,g=c.DS,d=c.multiSelectKeys,v=c.multiSelectMode;o(this,u),a(this,"_multiSelectMode",void 0),a(this,"_multiSelectKeys",void 0),a(this,"_currentValues",new Set),a(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),a(this,"init",function(){document.addEventListener("keydown",i.keydown),document.addEventListener("keyup",i.keyup),window.addEventListener("blur",i.reset)}),a(this,"keydown",function(w){var x=w.key.toLowerCase();i.DS.publish("KeyStore:down:pre",{event:w,key:x}),i._currentValues.add(x),i.DS.publish("KeyStore:down",{event:w,key:x})}),a(this,"keyup",function(w){var x=w.key.toLowerCase();i.DS.publish("KeyStore:up:pre",{event:w,key:x}),i._currentValues.delete(x),i.DS.publish("KeyStore:up",{event:w,key:x})}),a(this,"stop",function(){document.removeEventListener("keydown",i.keydown),document.removeEventListener("keyup",i.reset),window.removeEventListener("blur",i.reset),i.reset()}),a(this,"reset",function(){return i._currentValues.clear()}),this.DS=g,this._multiSelectMode=v,this._multiSelectKeys=d.map(function(w){var x={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"},E=x[w];return E?(console.warn("[DragSelect] ".concat(w,' is deprecated. Use "').concat(E,'" instead. Act Now!. See docs for more info')),E.toLowerCase()):w.toLowerCase()}),this.DS.subscribe("Interaction:init",this.init)}return s(u,[{key:"isMultiSelectKeyPressed",value:function(i){var g=this;return!!(this._multiSelectMode||this.currentValues.some(function(d){return g._multiSelectKeys.includes(d)})||i&&this._multiSelectKeys.some(function(d){return i[g._keyMapping[d]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),u}(),qd=function(){function u(c){var i=this,g=c.DS;o(this,u),a(this,"_isMouseInteraction",!1),a(this,"_initialValArea",void 0),a(this,"_currentValArea",void 0),a(this,"_lastValArea",void 0),a(this,"_initialVal",void 0),a(this,"_currentVal",void 0),a(this,"_lastVal",void 0),a(this,"_lastTouch",void 0),a(this,"init",function(){document.addEventListener("mousemove",i.update),document.addEventListener("touchmove",i.update,{passive:!1})}),a(this,"getPointerPosition",function(d){return Nd({event:i._normalizedEvent(d)})}),a(this,"update",function(d){!d||(i.DS.publish("PointerStore:updated:pre",{event:d}),i.currentVal=i.getPointerPosition(d),i._isMouseInteraction&&i.DS.publish("PointerStore:updated",{event:d}))}),a(this,"stop",function(){document.removeEventListener("mousemove",i.update),document.removeEventListener("touchmove",i.update,{passive:!1}),setTimeout(function(){return i._isMouseInteraction=!1},100)}),a(this,"reset",function(d){!d||(i.currentVal=i.lastVal=i.getPointerPosition(d),i.stop(),i.init())}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(d){var v=d.event;return i.start(v)}),this.DS.subscribe("Interaction:end",function(d){var v=d.event;return i.reset(v)})}return s(u,[{key:"start",value:function(i){!i||(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(i))}},{key:"_normalizedEvent",value:function(i){return"touches"in i&&i.type!=="touchend"&&(this._lastTouch=i),"touches"in i?this._lastTouch.touches[0]:i}},{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(i){this._initialVal=i,this._initialValArea=i&&C(i,"-",C(H(this.DS.Area.rect),"+",H(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(i){this._currentVal=i,this._currentValArea=i&&C(i,"-",C(H(this.DS.Area.rect),"+",H(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(i){this._lastVal=i,this._lastValArea=i&&C(i,"-",C(H(this.DS.Area.rect),"+",H(this.DS.Area.computedBorder)))}}]),u}(),Gd=function(){function u(c){var i=this,g=c.DS,d=c.areaElement,v=c.zoom;o(this,u),a(this,"_initialVal",void 0),a(this,"_currentVal",void 0),a(this,"_areaElement",void 0),a(this,"_canScroll",void 0),a(this,"init",function(){return i._areaElement.addEventListener("scroll",i.update)}),a(this,"start",function(){i._currentVal=i._initialVal=Le(i._areaElement),i._areaElement.addEventListener("scroll",i.update)}),a(this,"update",function(){return i._currentVal=Le(i._areaElement)}),a(this,"stop",function(){i._areaElement.removeEventListener("scroll",i.update),i._initialVal={x:0,y:0},i._canScroll=null}),a(this,"reset",function(){i.stop(),i.start()}),this._areaElement=d,this.DS=g,this.zoom=v,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return i.start()}),this.DS.subscribe("Interaction:end",function(){return i.reset()})}return s(u,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=Je(this._areaElement)}},{key:"scrollAmount",get:function(){var i=C(this.currentVal,"-",this.initialVal),g=Q(this.zoom),d=C(C(i,"*",g),"-",i);return{x:i.x+d.x,y:i.y+d.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=Le(this._areaElement)),this._currentVal}}]),u}(),Jd=function(){function u(c){var i=this,g=c.area,d=g===void 0?document:g,v=c.selectables,w=v===void 0?[]:v,x=c.autoScrollSpeed,E=x===void 0?5:x,V=c.overflowTolerance,N=V===void 0?{x:25,y:25}:V,A=c.zoom,I=A===void 0?1:A,X=c.customStyles,ae=X===void 0?!1:X,G=c.multiSelectMode,je=G===void 0?!1:G,pt=c.multiSelectToggling,_e=pt===void 0?!0:pt,bo=c.multiSelectKeys,Zd=bo===void 0?["Control","Shift","Meta"]:bo,vo=c.selector,Qd=vo===void 0?void 0:vo,wo=c.draggability,Gt=wo===void 0?!0:wo,_o=c.immediateDrag,eh=_o===void 0?!0:_o,ko=c.keyboardDrag,th=ko===void 0?!0:ko,rh=c.dragKeys,xo=c.keyboardDragSpeed,oh=xo===void 0?10:xo,So=c.useTransform,Eo=So===void 0?!0:So,Do=c.hoverClass,No=Do===void 0?"ds-hover":Do,Co=c.selectableClass,Vo=Co===void 0?"ds-selectable":Co,$o=c.selectedClass,nh=$o===void 0?"ds-selected":$o,Mo=c.selectorClass,ah=Mo===void 0?"ds-selector":Mo,Bo=c.selectorAreaClass,ih=Bo===void 0?"ds-selector-area":Bo,sh=c.callback,lh=c.onDragMove,ch=c.onDragStartBegin,dh=c.onDragStart,hh=c.onElementSelect,uh=c.onElementUnselect;o(this,u),a(this,"continue",!1),a(this,"start",function(){i.stopped=!1,i.Interaction.init()}),a(this,"break",function(){return i.continue=!0}),a(this,"getSelection",function(){return i.SelectedSet.elements}),a(this,"getSelectables",function(){return i.SelectableSet.elements}),a(this,"getInitialCursorPosition",function(){return i.stores.PointerStore.initialVal}),a(this,"getCurrentCursorPosition",function(){return i.stores.PointerStore.currentVal}),a(this,"getPreviousCursorPosition",function(){return i.stores.PointerStore.lastVal}),a(this,"getInitialCursorPositionArea",function(){return i.stores.PointerStore.initialValArea}),a(this,"getCurrentCursorPositionArea",function(){return i.stores.PointerStore.currentValArea}),a(this,"getPreviousCursorPositionArea",function(){return i.stores.PointerStore.lastValArea}),a(this,"isMultiSelect",function(mh){return i.stores.KeyStore.isMultiSelectKeyPressed(mh)}),a(this,"isDragging",function(){return i.Interaction.isDragging}),this.PubSub=new Hd({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:sh,onDragMove:lh,onDragStart:dh,onDragStartBegin:ch,onElementSelect:hh,onElementUnselect:uh}),this.stores={PointerStore:new qd({DS:this}),ScrollStore:new Gd({DS:this,areaElement:d,zoom:I}),KeyStore:new Xd({DS:this,multiSelectKeys:Zd,multiSelectMode:je})},this.Area=new Pd({area:d,PS:this.PubSub,zoom:I}),this.Selector=new Yd({DS:this,selector:Qd,selectorClass:ah,customStyles:ae}),this.SelectorArea=new Wd({DS:this,selectorAreaClass:ih,autoScrollSpeed:E,overflowTolerance:N}),this.SelectableSet=new Fd({elements:w,DS:this,className:Vo,hoverClassName:No,useTransform:Eo,draggability:Gt}),this.SelectedSet=new Ud({DS:this,className:nh}),this.Selection=new Kd({DS:this,hoverClassName:No,multiSelectToggling:_e}),this.Drag=new zd({DS:this,draggability:Gt,useTransform:Eo,keyboardDrag:th,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},rh),zoom:I,keyboardDragSpeed:oh}),this.Interaction=new Rd({areaElement:d,DS:this,draggability:Gt,immediateDrag:eh,selectableClass:Vo}),jd({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",function(){return i.continue=!1}),this.start()}return s(u,[{key:"_callbacksTemp",value:function(i){var g=i.callback,d=i.onDragMove,v=i.onDragStart,w=i.onDragStartBegin,x=i.onElementSelect,E=i.onElementUnselect,V=function(A,I){return console.warn("[DragSelect] ".concat(A,' is deprecated. Use DragSelect.subscribe("').concat(I,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};g&&(V("callback","callback"),this.subscribe("callback",function(N){var A=N.items;N.item;var I=N.event;return g(A,I)})),d&&(V("onDragMove","dragmove"),this.subscribe("dragmove",function(N){N.items,N.item;var A=N.event;return d(A)})),v&&(V("onDragStart","dragstart"),this.subscribe("dragstart",function(N){N.items,N.item;var A=N.event;return v(A)})),w&&(V("onDragStartBegin","dragstart"),this.subscribe("dragstart",function(N){N.items,N.item;var A=N.event;return w(A)})),x&&(V("onElementSelect","elementselect"),this.subscribe("elementselect",function(N){N.items;var A=N.item,I=N.event;return x(A,I)})),E&&(V("onElementUnselect","elementunselect"),this.subscribe("elementunselect",function(N){N.items;var A=N.item,I=N.event;return E(A,I)}))}},{key:"stop",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;d&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(i),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),i&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ie(i)),d||this.addSelectables(i),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ie(i)),d&&this.removeSelectables(i),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(i){var g=this,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ie(i).forEach(function(w){return g.SelectedSet.has(w)?g.removeSelection(i,d,v):g.addSelection(i,d,v)}),d&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(i,g,d),this.getSelection()}},{key:"clearSelection",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),i&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=Ie(i);return this.SelectableSet.addAll(d),g&&this.SelectedSet.addAll(d),i}},{key:"setSelectables",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.removeSelectables(i,g),this.addSelectables(i,d)}},{key:"removeSelectables",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.SelectableSet.deleteAll(Ie(i)),g&&this.removeSelection(i),i}},{key:"getCursorPositionDifference",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");var d=g?this.getCurrentCursorPositionArea():this.getCurrentCursorPosition(),v=i?g?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():g?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return C(d,"-",v)}}]),u}();return Jd})})(Zt);const fn=Zt.exports,Qt=(r,t,o,n,s)=>(t=Math,o=t.log,n=1024,s=o(r)/o(n)|0,r/t.pow(n,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B"),er=(r,t=null)=>{var o;return new Date(r*1e3).toLocaleString((o=t!=null?t:navigator.language)!=null?o:"en-US")},pn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},gn=[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)],yn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},bn=[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)],tt=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(r){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[r.direction=="down"?(e.openBlock(),e.createElementBlock("svg",pn,gn)):e.createCommentVNode("",!0),r.direction=="up"?(e.openBlock(),e.createElementBlock("svg",yn,bn)):e.createCommentVNode("",!0)]))}}),vn=["onClick"],wn=Object.assign({name:"VFToast.vue"},{setup(r){const t=e.inject("emitter"),{getStore:o}=e.inject("storage"),n=e.ref(o("full-screen",!1)),s=p=>p=="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([]),l=p=>{a.value.splice(p,1)},m=p=>{let f=a.value.findIndex(h=>h.id===p);f!==-1&&l(f)};return t.on("vf-toast-clear",()=>{a.value=[]}),t.on("vf-toast-push",p=>{let f=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");p.id=f,a.value.push(p),setTimeout(()=>{m(f)},5e3)}),(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.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,(h,y)=>(e.openBlock(),e.createElementBlock("div",{onClick:b=>l(y),key:h,class:e.normalizeClass([s(h.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(h.label),11,vn))),128))]),_:1})],2))}}),ke=r=>Object.entries(r).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:_n}=le(),bt=(r,t)=>_n.value+"?"+ke({q:"preview",adapter:r,path:t}),pe=typeof window<"u",tr=pe&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),rr=pe&&"IntersectionObserver"in window,or=pe&&"classList"in document.createElement("p"),nr=pe&&window.devicePixelRatio>1,kn={elements_selector:".lazy",container:tr||pe?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({},kn,r),ir=function(r,t){let o;const n="LazyLoad::Initialized",s=new r(t);try{o=new CustomEvent(n,{detail:{instance:s}})}catch{o=document.createEvent("CustomEvent"),o.initCustomEvent(n,!1,!1,{instance:s})}window.dispatchEvent(o)},xn=(r,t)=>{if(!!t)if(!t.length)ir(r,t);else for(let o=0,n;n=t[o];o+=1)ir(r,n)},fe="src",vt="srcset",wt="sizes",sr="poster",ze="llOriginalAttrs",lr="data",_t="loading",cr="loaded",dr="applied",Sn="entered",kt="error",hr="native",ur="data-",mr="ll-status",te=(r,t)=>r.getAttribute(ur+t),En=(r,t,o)=>{var n=ur+t;if(o===null){r.removeAttribute(n);return}r.setAttribute(n,o)},Re=r=>te(r,mr),xe=(r,t)=>En(r,mr,t),rt=r=>xe(r,null),xt=r=>Re(r)===null,Dn=r=>Re(r)===_t,Nn=r=>Re(r)===kt,St=r=>Re(r)===hr,Cn=[_t,cr,dr,kt],Vn=r=>Cn.indexOf(Re(r))>=0,ge=(r,t,o,n)=>{if(!!r){if(n!==void 0){r(t,o,n);return}if(o!==void 0){r(t,o);return}r(t)}},Ce=(r,t)=>{if(or){r.classList.add(t);return}r.className+=(r.className?" ":"")+t},ce=(r,t)=>{if(or){r.classList.remove(t);return}r.className=r.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},$n=r=>{r.llTempImage=document.createElement("IMG")},Mn=r=>{delete r.llTempImage},fr=r=>r.llTempImage,ot=(r,t)=>{if(!t)return;const o=t._observer;!o||o.unobserve(r)},Bn=r=>{r.disconnect()},Tn=(r,t,o)=>{t.unobserve_entered&&ot(r,o)},Et=(r,t)=>{!r||(r.loadingCount+=t)},An=r=>{!r||(r.toLoadCount-=1)},pr=(r,t)=>{!r||(r.toLoadCount=t)},On=r=>r.loadingCount>0,Ln=r=>r.toLoadCount>0,gr=r=>{let t=[];for(let o=0,n;n=r.children[o];o+=1)n.tagName==="SOURCE"&&t.push(n);return t},Dt=(r,t)=>{const o=r.parentNode;if(!o||o.tagName!=="PICTURE")return;gr(o).forEach(t)},yr=(r,t)=>{gr(r).forEach(t)},nt=[fe],br=[fe,sr],He=[fe,vt,wt],vr=[lr],at=r=>!!r[ze],wr=r=>r[ze],_r=r=>delete r[ze],Ve=(r,t)=>{if(at(r))return;const o={};t.forEach(n=>{o[n]=r.getAttribute(n)}),r[ze]=o},In=r=>{at(r)||(r[ze]={backgroundImage:r.style.backgroundImage})},jn=(r,t,o)=>{if(!o){r.removeAttribute(t);return}r.setAttribute(t,o)},Se=(r,t)=>{if(!at(r))return;const o=wr(r);t.forEach(n=>{jn(r,n,o[n])})},Pn=r=>{if(!at(r))return;const t=wr(r);r.style.backgroundImage=t.backgroundImage},kr=(r,t,o)=>{Ce(r,t.class_applied),xe(r,dr),o&&(t.unobserve_completed&&ot(r,t),ge(t.callback_applied,r,o))},xr=(r,t,o)=>{Ce(r,t.class_loading),xe(r,_t),o&&(Et(o,1),ge(t.callback_loading,r,o))},ye=(r,t,o)=>{!o||r.setAttribute(t,o)},Sr=(r,t)=>{ye(r,wt,te(r,t.data_sizes)),ye(r,vt,te(r,t.data_srcset)),ye(r,fe,te(r,t.data_src))},zn=(r,t)=>{Dt(r,o=>{Ve(o,He),Sr(o,t)}),Ve(r,He),Sr(r,t)},Rn=(r,t)=>{Ve(r,nt),ye(r,fe,te(r,t.data_src))},Hn=(r,t)=>{yr(r,o=>{Ve(o,nt),ye(o,fe,te(o,t.data_src))}),Ve(r,br),ye(r,sr,te(r,t.data_poster)),ye(r,fe,te(r,t.data_src)),r.load()},Fn=(r,t)=>{Ve(r,vr),ye(r,lr,te(r,t.data_src))},Un=(r,t,o)=>{const n=te(r,t.data_bg),s=te(r,t.data_bg_hidpi),a=nr&&s?s:n;!a||(r.style.backgroundImage=`url("${a}")`,fr(r).setAttribute(fe,a),xr(r,t,o))},Kn=(r,t,o)=>{const n=te(r,t.data_bg_multi),s=te(r,t.data_bg_multi_hidpi),a=nr&&s?s:n;!a||(r.style.backgroundImage=a,kr(r,t,o))},Yn=(r,t,o)=>{const n=te(r,t.data_bg_set);if(!n)return;const s=n.split("|");let a=s.map(l=>`image-set(${l})`);r.style.backgroundImage=a.join(),r.style.backgroundImage===""&&(a=s.map(l=>`-webkit-image-set(${l})`),r.style.backgroundImage=a.join()),kr(r,t,o)},Er={IMG:zn,IFRAME:Rn,VIDEO:Hn,OBJECT:Fn},Wn=(r,t)=>{const o=Er[r.tagName];!o||o(r,t)},Xn=(r,t,o)=>{const n=Er[r.tagName];!n||(n(r,t),xr(r,t,o))},qn=["IMG","IFRAME","VIDEO","OBJECT"],Gn=r=>qn.indexOf(r.tagName)>-1,Dr=(r,t)=>{t&&!On(t)&&!Ln(t)&&ge(r.callback_finish,t)},Nr=(r,t,o)=>{r.addEventListener(t,o),r.llEvLisnrs[t]=o},Jn=(r,t,o)=>{r.removeEventListener(t,o)},Nt=r=>!!r.llEvLisnrs,Zn=(r,t,o)=>{Nt(r)||(r.llEvLisnrs={});const n=r.tagName==="VIDEO"?"loadeddata":"load";Nr(r,n,t),Nr(r,"error",o)},Ct=r=>{if(!Nt(r))return;const t=r.llEvLisnrs;for(let o in t){const n=t[o];Jn(r,o,n)}delete r.llEvLisnrs},Cr=(r,t,o)=>{Mn(r),Et(o,-1),An(o),ce(r,t.class_loading),t.unobserve_completed&&ot(r,o)},Qn=(r,t,o,n)=>{const s=St(t);Cr(t,o,n),Ce(t,o.class_loaded),xe(t,cr),ge(o.callback_loaded,t,n),s||Dr(o,n)},ea=(r,t,o,n)=>{const s=St(t);Cr(t,o,n),Ce(t,o.class_error),xe(t,kt),ge(o.callback_error,t,n),o.restore_on_error&&Se(t,He),s||Dr(o,n)},Vt=(r,t,o)=>{const n=fr(r)||r;if(Nt(n))return;Zn(n,l=>{Qn(l,r,t,o),Ct(n)},l=>{ea(l,r,t,o),Ct(n)})},ta=(r,t,o)=>{$n(r),Vt(r,t,o),In(r),Un(r,t,o),Kn(r,t,o),Yn(r,t,o)},ra=(r,t,o)=>{Vt(r,t,o),Xn(r,t,o)},$t=(r,t,o)=>{Gn(r)?ra(r,t,o):ta(r,t,o)},oa=(r,t,o)=>{r.setAttribute("loading","lazy"),Vt(r,t,o),Wn(r,t),xe(r,hr)},Vr=r=>{r.removeAttribute(fe),r.removeAttribute(vt),r.removeAttribute(wt)},na=r=>{Dt(r,t=>{Vr(t)}),Vr(r)},$r=r=>{Dt(r,t=>{Se(t,He)}),Se(r,He)},aa={IMG:$r,IFRAME:r=>{Se(r,nt)},VIDEO:r=>{yr(r,t=>{Se(t,nt)}),Se(r,br),r.load()},OBJECT:r=>{Se(r,vr)}},ia=r=>{const t=aa[r.tagName];if(!t){Pn(r);return}t(r)},sa=(r,t)=>{xt(r)||St(r)||(ce(r,t.class_entered),ce(r,t.class_exited),ce(r,t.class_applied),ce(r,t.class_loading),ce(r,t.class_loaded),ce(r,t.class_error))},la=(r,t)=>{ia(r),sa(r,t),rt(r),_r(r)},ca=(r,t,o,n)=>{!o.cancel_on_exit||!Dn(r)||r.tagName==="IMG"&&(Ct(r),na(r),$r(r),ce(r,o.class_loading),Et(n,-1),rt(r),ge(o.callback_cancel,r,t,n))},da=(r,t,o,n)=>{const s=Vn(r);xe(r,Sn),Ce(r,o.class_entered),ce(r,o.class_exited),Tn(r,o,n),ge(o.callback_enter,r,t,n),!s&&$t(r,o,n)},ha=(r,t,o,n)=>{xt(r)||(Ce(r,o.class_exited),ca(r,t,o,n),ge(o.callback_exit,r,t,n))},ua=["IMG","IFRAME","VIDEO"],Mr=r=>r.use_native&&"loading"in HTMLImageElement.prototype,ma=(r,t,o)=>{r.forEach(n=>{ua.indexOf(n.tagName)!==-1&&oa(n,t,o)}),pr(o,0)},fa=r=>r.isIntersecting||r.intersectionRatio>0,pa=r=>({root:r.container===document?null:r.container,rootMargin:r.thresholds||r.threshold+"px"}),ga=(r,t,o)=>{r.forEach(n=>fa(n)?da(n.target,n,t,o):ha(n.target,n,t,o))},ya=(r,t)=>{t.forEach(o=>{r.observe(o)})},ba=(r,t)=>{Bn(r),ya(r,t)},va=(r,t)=>{!rr||Mr(r)||(t._observer=new IntersectionObserver(o=>{ga(o,r,t)},pa(r)))},Br=r=>Array.prototype.slice.call(r),it=r=>r.container.querySelectorAll(r.elements_selector),wa=r=>Br(r).filter(xt),_a=r=>Nn(r),ka=r=>Br(r).filter(_a),Tr=(r,t)=>wa(r||it(t)),xa=(r,t)=>{ka(it(r)).forEach(n=>{ce(n,r.class_error),rt(n)}),t.update()},Sa=(r,t)=>{!pe||(t._onlineHandler=()=>{xa(r,t)},window.addEventListener("online",t._onlineHandler))},Ea=r=>{!pe||window.removeEventListener("online",r._onlineHandler)},Fe=function(r,t){const o=ar(r);this._settings=o,this.loadingCount=0,va(o,this),Sa(o,this),this.update(t)};Fe.prototype={update:function(r){const t=this._settings,o=Tr(r,t);if(pr(this,o.length),tr||!rr){this.loadAll(o);return}if(Mr(t)){ma(o,t,this);return}ba(this._observer,o)},destroy:function(){this._observer&&this._observer.disconnect(),Ea(this),it(this._settings).forEach(r=>{_r(r)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(r){const t=this._settings;Tr(r,t).forEach(n=>{ot(n,this),$t(n,t,this)})},restoreAll:function(){const r=this._settings;it(r).forEach(t=>{la(t,r)})}},Fe.load=(r,t)=>{const o=ar(t);$t(r,o)},Fe.resetStatus=r=>{rt(r)},pe&&xn(Fe,window.lazyLoadOptions);const Da={class:"relative flex-auto flex flex-col overflow-hidden"},Na={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Ca={class:"absolute"},Va=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),$a={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"},Ma=["onDblclick","onContextmenu","data-type","data-item","data-index"],Ba={class:"grid grid-cols-12 items-center"},Ta={class:"flex col-span-7 items-center"},Aa={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"},Oa=[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)],La={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"},Ia=[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)],ja={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Pa={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},za=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Ra={class:"grid grid-cols-12 items-center"},Ha={class:"flex col-span-7 items-center"},Fa={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"},Ua=[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)],Ka={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Ya=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Wa={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Xa={class:"col-span-2 text-center"},qa={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Ga=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Ja={class:"relative"},Za={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"},Qa=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],ei=["data-src","alt"],ti={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"},ri=[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)],oi={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},ni={class:"break-all"},ai=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(r){const t=r,o=e.inject("emitter"),{setStore:n,getStore:s}=e.inject("storage"),a=M=>M==null?void 0:M.substring(0,3),l=M=>M.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),m=e.ref(null),p=e.ref(null),f=e.ref(0),h=e.ref(null),{t:y}=e.inject("i18n"),b=Math.floor(Math.random()*2**32),D=e.ref(s("full-screen",!1)),_=new Fe;o.on("vf-fullscreen-toggle",()=>{D.value=!D.value,n("full-screen",D.value)});const k=e.ref("");o.on("vf-search-query",({newQuery:M})=>{k.value=M,M?o.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:M},onSuccess:O=>{O.files.length||o.emit("vf-toast-push",{label:y("No search result found.")})}}):o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let $=null;const P=()=>{$&&clearTimeout($)},L=M=>{$=setTimeout(()=>{const O=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:M.target.getBoundingClientRect().x,clientY:M.target.getBoundingClientRect().y});M.target.dispatchEvent(O)},500)},B=M=>{M.type=="dir"?(o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:M.path}})):o.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:M})},T=e.reactive({active:!1,column:"",order:""}),R=(M=!0)=>{let O=[...t.data.files],C=T.column,H=T.order=="asc"?1:-1;if(!M)return O;const F=(Q,W)=>typeof Q=="string"&&typeof W=="string"?Q.toLowerCase().localeCompare(W.toLowerCase()):Q<W?-1:Q>W?1:0;return T.active&&(O=O.slice().sort((Q,W)=>F(Q[C],W[C])*H)),O},S=M=>{T.active&&T.column==M?(T.active=T.order=="asc",T.column=M,T.order="desc"):(T.active=!0,T.column=M,T.order="asc")},j=()=>h.value.getSelection().map(M=>JSON.parse(M.dataset.item)),Y=(M,O)=>{if(M.altKey||M.ctrlKey||M.metaKey)return M.preventDefault(),!1;M.dataTransfer.setDragImage(p.value,0,15),M.dataTransfer.effectAllowed="all",M.dataTransfer.dropEffect="copy",M.dataTransfer.setData("items",JSON.stringify(j()))},Z=(M,O)=>{M.preventDefault();let C=JSON.parse(M.dataTransfer.getData("items"));if(C.find(H=>H.storage!=s("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:C,to:O}})},ee=(M,O)=>{M.preventDefault(),!O||O.type!=="dir"||h.value.getSelection().find(C=>C==M.currentTarget)?(M.dataTransfer.dropEffect="none",M.dataTransfer.effectAllowed="none"):M.dataTransfer.dropEffect="copy"},ne=()=>{h.value=new fn({area:m.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),o.on("vf-explorer-update",()=>e.nextTick(()=>{h.value.clearSelection(),h.value.setSelectables(document.getElementsByClassName("vf-item-"+b))})),h.value.subscribe("predragstart",({event:M,isDragging:O})=>{if(O)f.value=h.value.getSelection().length,h.value.break();else{const C=M.target.offsetWidth-M.offsetX,H=M.target.offsetHeight-M.offsetY;C<15&&H<15&&(h.value.clearSelection(),h.value.break())}}),h.value.subscribe("predragmove",({isDragging:M})=>{M&&h.value.break()}),h.value.subscribe("callback",({items:M,event:O,isDragging:C})=>{o.emit("vf-nodes-selected",j()),f.value=h.value.getSelection().length})};return e.onMounted(ne),e.onUpdated(()=>{h.value.Area.reset(),h.value.SelectorArea.updatePos(),_.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>o.emit("vf-explorer-update"))}),(M,O)=>(e.openBlock(),e.createElementBlock("div",Da,[r.view=="list"||k.value.length?(e.openBlock(),e.createElementBlock("div",Na,[e.createElementVNode("div",{onClick:O[0]||(O[0]=C=>S("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(y)("Name"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="basename"]])]),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:O[1]||(O[1]=C=>S("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(y)("Size"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="file_size"]])])),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:O[2]||(O[2]=C=>S("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(y)("Date"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="last_modified"]])])),k.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:O[3]||(O[3]=C=>S("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(y)("Filepath"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ca,[e.createElementVNode("div",{ref_key:"dragImage",ref:p,class:"absolute -z-50 -top-96"},[Va,e.createElementVNode("div",$a,e.toDisplayString(f.value),1)],512)]),e.createElementVNode("div",{onContextmenu:O[10]||(O[10]=e.withModifiers(C=>e.unref(o).emit("vf-contextmenu-show",{event:C,area:m.value,items:j()}),["self","prevent"])),class:e.normalizeClass([D.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:m},[k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(R(),(C,H)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:F=>B(C),onTouchstart:O[4]||(O[4]=F=>L(F)),onTouchend:O[5]||(O[5]=F=>P()),onContextmenu:e.withModifiers(F=>e.unref(o).emit("vf-contextmenu-show",{event:F,area:m.value,items:j(),target:C}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(b),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":C.type,"data-item":JSON.stringify(C),"data-index":H},[e.createElementVNode("div",Ba,[e.createElementVNode("div",Ta,[C.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Aa,Oa)):(e.openBlock(),e.createElementBlock("svg",La,Ia)),e.createElementVNode("span",ja,e.toDisplayString(C.basename),1)]),e.createElementVNode("div",Pa,e.toDisplayString(C.path),1)])],42,Ma))),256)):e.createCommentVNode("",!0),r.view=="list"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(R(),(C,H)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:F=>B(C),onTouchstart:O[6]||(O[6]=F=>L(F)),onTouchend:O[7]||(O[7]=F=>P()),onContextmenu:e.withModifiers(F=>e.unref(o).emit("vf-contextmenu-show",{event:F,area:m.value,items:j(),target:C}),["prevent"]),onDragstart:F=>Y(F),onDragover:F=>ee(F,C),onDrop:F=>Z(F,C),class:e.normalizeClass(["vf-item-"+e.unref(b),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":C.type,"data-item":JSON.stringify(C),"data-index":H},[e.createElementVNode("div",Ra,[e.createElementVNode("div",Ha,[C.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Fa,Ua)):(e.openBlock(),e.createElementBlock("svg",Ka,Ya)),e.createElementVNode("span",Wa,e.toDisplayString(C.basename),1)]),e.createElementVNode("div",Xa,e.toDisplayString(C.file_size?e.unref(Qt)(C.file_size):""),1),e.createElementVNode("div",qa,e.toDisplayString(e.unref(er)(C.last_modified)),1)])],42,za))),256)):e.createCommentVNode("",!0),r.view=="grid"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(R(!1),(C,H)=>{var F,Q;return e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:W=>B(C),onTouchstart:O[8]||(O[8]=W=>L(W)),onTouchend:O[9]||(O[9]=W=>P()),onContextmenu:e.withModifiers(W=>e.unref(o).emit("vf-contextmenu-show",{event:W,area:m.value,items:j(),target:C}),["prevent"]),onDragstart:W=>Y(W),onDragover:W=>ee(W,C),onDrop:W=>Z(W,C),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":C.type,"data-item":JSON.stringify(C),"data-index":H},[e.createElementVNode("div",null,[e.createElementVNode("div",Ja,[C.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Za,Qa)):((F=C.mime_type)!=null?F:"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(bt)(e.unref(s)("adapter",t.data.adapter),C.path),alt:C.basename},null,8,ei)):(e.openBlock(),e.createElementBlock("svg",ti,ri)),!((Q=C.mime_type)!=null?Q:"").startsWith("image")&&C.type!="dir"?(e.openBlock(),e.createElementBlock("div",oi,e.toDisplayString(a(C.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ni,e.toDisplayString(l(C.basename)),1)])],42,Ga)}),256)):e.createCommentVNode("",!0)],34),e.createVNode(wn)]))}}),ii={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},si={class:"flex leading-5 items-center"},li=["aria-label"],ci=[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)],di=["value"],hi={class:"ml-3"},ui={key:0},mi={class:"ml-1"},fi={class:"flex leading-5 items-center"},pi={value:"",disabled:""},gi=e.createElementVNode("option",{value:"en"},"English",-1),yi=e.createElementVNode("option",{value:"fr"},"French",-1),bi=e.createElementVNode("option",{value:"tr"},"Turkish",-1),vi=["aria-label"],wi=[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)],_i=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(r){var b;const t=r,o=e.inject("emitter"),{getStore:n,setStore:s}=e.inject("storage"),a=e.ref(0),l=e.ref((b=n("adapter"))!=null?b:t.data.adapter),{t:m,changeLocale:p}=e.inject("i18n"),f=e.ref(n("locale","")),h=()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:l.value}}),s("adapter",l.value)};o.on("vf-nodes-selected",D=>{a.value=D.length});const y=e.ref("");return o.on("vf-search-query",({newQuery:D})=>{y.value=D}),(D,_)=>(e.openBlock(),e.createElementBlock("div",ii,[e.createElementVNode("div",si,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(m)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},ci,8,li),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":_[0]||(_[0]=k=>l.value=k),onChange:h,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,k=>(e.openBlock(),e.createElementBlock("option",{value:k},e.toDisplayString(k),9,di))),256))],544),[[e.vModelSelect,l.value]]),e.createElementVNode("div",hi,[y.value.length?(e.openBlock(),e.createElementBlock("span",ui,e.toDisplayString(r.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",mi,e.toDisplayString(a.value>0?a.value+" "+e.unref(m)("item(s) selected."):""),1)])]),e.createElementVNode("div",fi,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":_[1]||(_[1]=k=>f.value=k),onChange:_[2]||(_[2]=k=>e.unref(p)(k.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",pi,e.toDisplayString(e.unref(m)("Language")),1),gi,yi,bi],544),[[e.vModelSelect,f.value]]),e.createElementVNode("span",{"aria-label":e.unref(m)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:_[3]||(_[3]=k=>e.unref(o).emit("vf-modal-show",{type:"message",title:"Vuefinder 1.0",message:e.unref(m)("Vuefinder is a file manager component for vue 3.")}))},wi,8,vi)])]))}}),ki=(r,t=0,o=!1)=>{let n;return(...s)=>{o&&!n&&r(...s),clearTimeout(n),n=setTimeout(()=>{r(...s)},t)}},xi=(r,t,o)=>{const n=e.ref(r);return e.customRef((a,l)=>({get(){return a(),n.value},set:ki(m=>{n.value=m,l()},t,o)}))},Si={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"},Ei=["aria-label"],Di=[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)],Ni=["aria-label"],Ci=[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)],Vi={key:1,"aria-label":"Cancel","data-microtip-position":"bottom-right",role:"tooltip"},$i=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Mi=["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)],Ti={class:"flex leading-5"},Ai=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),Oi=["title","onClick"],Li={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"},Ii=[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)],ji={key:3,class:"flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Pi=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),zi=["onKeydown","placeholder"],Ri=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Hi=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),s=e.ref(null),a=e.ref([]),l=e.ref(!1),m=e.ref(null),{t:p}=e.inject("i18n"),f=e.inject("loadingState");o.on("vf-explorer-update",()=>{var T;let L=[],B=[];s.value=(T=t.data.dirname)!=null?T:n("adapter","local")+"://",s.value.length==0&&(a.value=[]),s.value.replace(n("adapter","local")+"://","").split("/").forEach(function(R){L.push(R),L.join("/")!=""&&B.push({basename:R,name:R,path:n("adapter","local")+"://"+L.join("/"),type:"dir"})}),B.length>4&&(B=B.slice(-5),B[0].name=".."),a.value=B});const h=()=>{l.value=!1,b.value=""};o.on("vf-search-exit",()=>{h()});const y=()=>{l.value=!0,e.nextTick(()=>m.value.focus())},b=xi("",400),D=()=>f.value;e.watch(b,L=>{o.emit("vf-toast-clear"),o.emit("vf-search-query",{newQuery:L})});const _=()=>a.value.length&&!l.value,k=L=>{var T;L.preventDefault();let B=JSON.parse(L.dataTransfer.getData("items"));if(B.find(R=>R.storage!=n("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:B,to:(T=a.value[a.value.length-2])!=null?T:{path:n("adapter","local")+"://"}}})},$=L=>{L.preventDefault(),_()?L.dataTransfer.dropEffect="copy":(L.dataTransfer.dropEffect="none",L.dataTransfer.effectAllowed="none")},P=()=>{b.value==""&&h()};return(L,B)=>(e.openBlock(),e.createElementBlock("div",Si,[e.createElementVNode("span",{"aria-label":e.unref(p)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:B[0]||(B[0]=T=>$(T)),onDrop:B[1]||(B[1]=T=>k(T)),onClick:B[2]||(B[2]=T=>{var R,S;return!_()||e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:(S=(R=a.value[a.value.length-2])==null?void 0:R.path)!=null?S:e.unref(n)("adapter","local")+"://"}})}),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"},Di,34))],8,Ei),D()?(e.openBlock(),e.createElementBlock("span",Vi,[(e.openBlock(),e.createElementBlock("svg",{onClick:B[4]||(B[4]=T=>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"},$i))])):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(p)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:B[3]||(B[3]=T=>{e.unref(o).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"},Ci))],8,Ni)),l.value?(e.openBlock(),e.createElementBlock("div",ji,[Pi,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,onKeydown:e.withKeys(h,["esc"]),onBlur:P,"onUpdate:modelValue":B[6]||(B[6]=T=>e.isRef(b)?b.value=T:null),placeholder:e.unref(p)("Search anything.."),class:"py-0 px-2 w-full border-0 ring-0 outline-0 text-sm text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,zi),[[e.vModelText,e.unref(b)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:h,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Ri))])):(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(y,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:B[5]||(B[5]=T=>e.unref(o).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",Ti,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(T,R)=>(e.openBlock(),e.createElementBlock("div",{key:R},[Ai,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:T.basename,onClick:S=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:T.path}})},e.toDisplayString(T.name),9,Oi)]))),128))]),D()?(e.openBlock(),e.createElementBlock("svg",Li,Ii)):e.createCommentVNode("",!0)],8,Mi))]))}}),Fi=["onClick"],Ui=e.createElementVNode("span",{class:"px-1"},null,-1),Ki=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(r){const t=r,o=e.inject("emitter"),n=e.ref(null),{apiUrl:s}=le(),a=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),l=e.ref([]);o.on("vf-context-selected",b=>{l.value=b});const{t:m}=e.inject("i18n"),p={newfolder:{title:()=>m("New Folder"),action:()=>{o.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>m("Delete"),action:()=>{o.emit("vf-modal-show",{type:"delete",items:l})}},refresh:{title:()=>m("Refresh"),action:()=>{o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>m("Preview"),action:()=>{o.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:l.value[0]})}},open:{title:()=>m("Open"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].path}})}},openDir:{title:()=>m("Open containing folder"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].dir}})}},download:{title:()=>m("Download"),action:()=>{const b=s.value+"?"+ke({q:"download",adapter:t.current.adapter,path:l.value[0].path});o.emit("vf-download",b)}},archive:{title:()=>m("Archive"),action:()=>{o.emit("vf-modal-show",{type:"archive",items:l})}},unarchive:{title:()=>m("Unarchive"),action:()=>{o.emit("vf-modal-show",{type:"unarchive",items:l})}},rename:{title:()=>m("Rename"),action:()=>{o.emit("vf-modal-show",{type:"rename",items:l})}}},f=b=>{o.emit("vf-contextmenu-hide"),b.action()},h=e.ref("");o.on("vf-search-query",({newQuery:b})=>{h.value=b}),o.on("vf-contextmenu-show",({event:b,area:D,items:_,target:k=null})=>{if(a.items=[],h.value)if(k)a.items.push(p.openDir),o.emit("vf-context-selected",[k]);else return;else!k&&!h.value?(a.items.push(p.refresh),a.items.push(p.newfolder),o.emit("vf-context-selected",[])):_.length>1&&_.some($=>$.path===k.path)?(a.items.push(p.refresh),a.items.push(p.archive),a.items.push(p.delete),o.emit("vf-context-selected",_)):(k.type=="dir"?a.items.push(p.open):(a.items.push(p.preview),a.items.push(p.download)),a.items.push(p.rename),k.mime_type=="application/zip"?a.items.push(p.unarchive):a.items.push(p.archive),a.items.push(p.delete),o.emit("vf-context-selected",[k]));y(b,D)}),o.on("vf-contextmenu-hide",()=>{a.active=!1});const y=(b,D)=>{a.active=!0,e.nextTick(()=>{let _=D.getBoundingClientRect(),k=b.pageX,$=b.pageY,P=n.value.offsetHeight,L=n.value.offsetWidth;k=_.right-b.pageX+window.scrollX<L?k-L:k,$=_.bottom-b.pageY+window.scrollY<P?$-P:$,a.positions={left:k+"px",top:$+"px"}})};return(b,D)=>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:n,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:k=>f(_)},[Ui,e.createElementVNode("span",null,e.toDisplayString(_.title()),1)],8,Fi))),128))],4)):e.createCommentVNode("",!0)}}),Yi=(r,t)=>{const o=r[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((n,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function Wi(r){const t=await Yi(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>Ed),"../locales/tr.json":()=>Promise.resolve().then(()=>Dd)}),`../locales/${r}.json`);return JSON.parse(t.default)}function Xi(r,t,o){const{getStore:n,setStore:s}=yt(r),a=["en","tr"],l=e.ref({}),m=h=>{a.includes(h)||(o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),h="en"),Wi(h).then(y=>{l.value=y,s("locale",h),s("translations",y),o.emit("vf-toast-push",{label:"The language is set to "+h})})};n("locale")?l.value=n("translations"):m(t);const p=(h,...y)=>y.length?p(h=h.replace("%s",y.shift()),...y):h;function f(h,...y){return l.value.hasOwnProperty(h)?p(l.value[h],...y):h}return{t:f,support_locales:a,changeLocale:m}}const qi=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Gi=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"},postData:{type:Object,default:{}}},setup(r){const t=r,o=To(),{setStore:n,getStore:s}=yt(t.id);e.provide("emitter",o),e.provide("storage",yt(t.id)),e.provide("postData",t.postData);const a=Xi(t.id,t.locale,o);e.provide("i18n",a);const{apiUrl:l,setApiUrl:m}=le();m(t.url);const p=e.reactive({adapter:"local",storages:[],dirname:".",files:[]}),f=e.ref(s("viewport","grid")),h=e.ref(s("darkMode",t.dark));o.on("vf-darkMode-toggle",()=>{h.value=!h.value,n("darkMode",h.value)});const y=e.ref(!1);e.provide("loadingState",y);const b=e.ref(s("full-screen",!1));o.on("vf-fullscreen-toggle",()=>{b.value=!b.value,n("full-screen",b.value)}),o.on("vf-view-toggle",$=>{f.value=$});const D=e.reactive({active:!1,type:"delete",data:{}});o.on("vf-modal-close",()=>{D.active=!1}),o.on("vf-modal-show",$=>{D.active=!0,D.type=$.type,D.data=$});const _=$=>{Object.assign(p,$),o.emit("vf-nodes-selected",{}),o.emit("vf-explorer-update")};let k;return o.on("vf-fetch-abort",()=>{k.abort(),y.value=!1}),o.on("vf-fetch",({params:$,onSuccess:P=null,onError:L=null})=>{["index","search"].includes($.q)&&(k&&k.abort(),y.value=!0),k=new AbortController;const B=k.signal;et(l.value,{params:$,signal:B}).then(T=>{["index","search"].includes($.q)&&(y.value=!1),o.emit("vf-modal-close"),_(T),P(T)}).catch(T=>{L&&L(T)}).finally(()=>{})}),o.on("vf-download",$=>{document.getElementById("download_frame").src=$,o.emit("vf-modal-close")}),e.onMounted(()=>{o.emit("vf-fetch",{params:{q:"index",adapter:s("adapter",p.adapter)}})}),($,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vuefinder",h.value?"dark":""])},[e.createElementVNode("div",{class:e.normalizeClass([b.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(b.value?"":"max-height: "+r.maxHeight),onMousedown:P[0]||(P[0]=L=>e.unref(o).emit("vf-contextmenu-hide")),onTouchstart:P[1]||(P[1]=L=>e.unref(o).emit("vf-contextmenu-hide"))},[e.createVNode(un,{data:p},null,8,["data"]),e.createVNode(Hi,{data:p},null,8,["data"]),e.createVNode(ai,{view:f.value,data:p},null,8,["view","data"]),e.createVNode(_i,{data:p},null,8,["data"])],38),D.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+D.type),{key:0,selection:D.data,current:p},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Ki,{current:p},null,8,["current"]),qi],2))}}),Ji=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1),Zi={class:"fixed z-10 inset-0 overflow-y-auto w-screen h-screen"},Qi={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"},es={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},ts={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"},de={__name:"ModalLayout",setup(r){const t=e.inject("emitter");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:n[1]||(n[1]=e.withKeys(s=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Ji,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:n[0]||(n[0]=e.withModifiers(s=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Qi,[e.createElementVNode("div",es,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",ts,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},rs=["aria-label"],os=[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)],he=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(r,{emit:t}){var m;const{t:o}=e.inject("i18n"),n=e.ref(!1),s=e.ref(null),a=e.ref((m=s.value)==null?void 0:m.strMessage);e.watch(a,()=>n.value=!1);const l=()=>{t("hidden"),n.value=!0};return(p,f)=>(e.openBlock(),e.createElementBlock("div",null,[n.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:s,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(p.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:l,"aria-label":e.unref(o)("Close"),"data-microtip-position":"top-left",role:"tooltip"},os,8,rs)],2))]))}}),ns={class:"sm:flex sm:items-start"},as=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),is={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},ss={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ls={class:"mt-2"},cs={class:"text-sm text-gray-500"},ds={class:"flex text-sm text-gray-800 dark:text-gray-400"},hs={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"},us=[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)],ms={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"},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)],ps={class:"ml-1.5"},gs={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},ys=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(t.selection.items),l=e.ref(""),m=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"delete",adapter:n("adapter","local"),path:t.current.dirname,items:JSON.stringify(a.value.map(({path:p,type:f})=>({path:p,type:f})))},onSuccess:()=>{o.emit("vf-toast-push",{label:s("Files deleted.")})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=h=>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(s)("Cancel")),1),e.createElementVNode("div",gs,e.toDisplayString(e.unref(s)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ns,[as,e.createElementVNode("div",is,[e.createElementVNode("h3",ss,e.toDisplayString(e.unref(s)("Delete files")),1),e.createElementVNode("div",ls,[e.createElementVNode("p",cs,e.toDisplayString(e.unref(s)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,h=>(e.openBlock(),e.createElementBlock("p",ds,[h.type=="dir"?(e.openBlock(),e.createElementBlock("svg",hs,us)):(e.openBlock(),e.createElementBlock("svg",ms,fs)),e.createElementVNode("span",ps,e.toDisplayString(h.basename),1)]))),256)),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:f[0]||(f[0]=h=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),bs={class:"sm:flex sm:items-start"},vs=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),ws={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},_s={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ks={class:"mt-2"},xs={class:"text-sm text-gray-500"},Ss=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(r){const t=e.inject("emitter"),{t:o}=e.inject("i18n");return(n,s)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[0]||(s[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,l,m,p;return[e.createElementVNode("div",bs,[vs,e.createElementVNode("div",ws,[e.createElementVNode("h3",_s,e.toDisplayString((l=(a=r.selection)==null?void 0:a.title)!=null?l:"Title"),1),e.createElementVNode("div",ks,[e.createElementVNode("p",xs,e.toDisplayString((p=(m=r.selection)==null?void 0:m.message)!=null?p:"Message")+".",1)])])])]}),_:1}))}}),Es={class:"sm:flex sm:items-start"},Ds=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),Ns={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Cs={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Vs={class:"mt-2"},$s={class:"text-sm text-gray-500"},Ms=["onKeyup","placeholder"],Bs=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(""),l=e.ref(""),m=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfolder",adapter:n("adapter","local"),path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:s("%s is created.",a.value)})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-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)("Create")),1),e.createElementVNode("button",{type:"button",onClick:f[2]||(f[2]=h=>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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Es,[Ds,e.createElementVNode("div",Ns,[e.createElementVNode("h3",Cs,e.toDisplayString(e.unref(s)("New Folder")),1),e.createElementVNode("div",Vs,[e.createElementVNode("p",$s,e.toDisplayString(e.unref(s)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=h=>a.value=h),onKeyup:e.withKeys(m,["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(s)("Folder Name"),type:"text"},null,40,Ms),[[e.vModelText,a.value]]),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:f[1]||(f[1]=h=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ts={class:"sm:flex sm:items-start"},As=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),Os={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ls={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Is={class:"mt-2"},js={class:"text-sm text-gray-500"},Ps=["onKeyup","placeholder"],zs=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(""),l=e.ref(""),m=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfile",adapter:n("adapter","local"),path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:s("%s is created.",a.value)})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-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"},"Create!"),e.createElementVNode("button",{type:"button",onClick:f[2]||(f[2]=h=>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"},"Cancel")]),default:e.withCtx(()=>[e.createElementVNode("div",Ts,[As,e.createElementVNode("div",Os,[e.createElementVNode("h3",Ls,e.toDisplayString(e.unref(s)("New File")),1),e.createElementVNode("div",Is,[e.createElementVNode("p",js,e.toDisplayString(e.unref(s)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=h=>a.value=h),onKeyup:e.withKeys(m,["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(s)("File Name"),type:"text"},null,40,Ps),[[e.vModelText,a.value]]),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:f[1]||(f[1]=h=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Rs={class:"flex"},Hs=["aria-label"],Fs={class:"ml-auto mb-2"},Us={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"},Ks={key:1},Ys={__name:"Text",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const o=r,n=e.ref(""),s=e.ref(""),a=e.ref(null),l=e.ref(!1),{apiUrl:m}=le(),p=e.ref(""),f=e.ref(!1),{t:h}=e.inject("i18n");e.onMounted(()=>{et(m.value,{params:{q:"preview",adapter:o.selection.adapter,path:o.selection.item.path},json:!1}).then(_=>{n.value=_,t("load")})});const y=()=>{l.value=!l.value,s.value=n.value,l.value==!0&&e.nextTick(()=>{a.value.focus()})},b=e.inject("postData"),D=()=>{p.value="",f.value=!1,et(m.value,{method:"POST",params:Object.assign(b,{q:"save",adapter:o.selection.adapter,path:o.selection.item.path,content:s.value}),json:!1}).then(_=>{p.value=h("Updated."),n.value=_,t("load"),l.value=!l.value}).catch(_=>{p.value=h(_.message),f.value=!0})};return(_,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Rs,[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,Hs),e.createElementVNode("div",Fs,[l.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:D,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(h)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:k[0]||(k[0]=$=>y())},e.toDisplayString(l.value?e.unref(h)("Cancel"):e.unref(h)("Edit")),1)])]),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Ks,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:a,"onUpdate:modelValue":k[1]||(k[1]=$=>s.value=$),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,s.value]])])):(e.openBlock(),e.createElementBlock("pre",Us,e.toDisplayString(n.value),1)),p.value.length?(e.openBlock(),e.createBlock(he,{key:2,onHidden:k[2]||(k[2]=$=>p.value=""),error:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},su="";/*!
|
|
4
4
|
* Cropper.js v1.5.12
|
|
5
5
|
* https://fengyuanchen.github.io/cropperjs
|
|
6
6
|
*
|
|
@@ -8,14 +8,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
8
8
|
* Released under the MIT license
|
|
9
9
|
*
|
|
10
10
|
* Date: 2021-06-12T08:00:17.411Z
|
|
11
|
-
*/function
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var He=typeof window<"u"&&typeof window.document<"u",ce=He?window:{},et=He&&ce.document.documentElement?"ontouchstart"in ce.document.documentElement:!1,tt=He?"PointerEvent"in ce:!1,F="cropper",rt="all",Dt="crop",Et="move",Nt="zoom",ge="e",ye="w",we="s",he="n",Ce="ne",$e="nw",Me="se",Be="sw",nt="".concat(F,"-crop"),Vt="".concat(F,"-disabled"),ee="".concat(F,"-hidden"),Ct="".concat(F,"-hide"),La="".concat(F,"-invisible"),Ue="".concat(F,"-modal"),ot="".concat(F,"-move"),Te="".concat(F,"Action"),Fe="".concat(F,"Preview"),at="crop",$t="move",Mt="none",it="crop",st="cropend",lt="cropmove",ct="cropstart",Bt="dblclick",Ia=et?"touchstart":"mousedown",za=et?"touchmove":"mousemove",Ra=et?"touchend touchcancel":"mouseup",Tt=tt?"pointerdown":Ia,At=tt?"pointermove":za,Ot=tt?"pointerup pointercancel":Ra,jt="ready",Pt="resize",Lt="wheel",dt="zoom",It="image/jpeg",Ha=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Ua=/^data:/,Fa=/^data:image\/jpeg;base64,/,Ka=/^img|canvas$/i,zt=200,Rt=100,Ht={viewMode:0,dragMode:at,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:zt,minContainerHeight:Rt,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Ya='<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>',Wa=Number.isNaN||ce.isNaN;function z(i){return typeof i=="number"&&!Wa(i)}var Ut=function(t){return t>0&&t<1/0};function ht(i){return typeof i>"u"}function be(i){return Re(i)==="object"&&i!==null}var Xa=Object.prototype.hasOwnProperty;function ve(i){if(!be(i))return!1;try{var t=i.constructor,r=t.prototype;return t&&r&&Xa.call(r,"isPrototypeOf")}catch{return!1}}function te(i){return typeof i=="function"}var qa=Array.prototype.slice;function Ft(i){return Array.from?Array.from(i):qa.call(i)}function q(i,t){return i&&te(t)&&(Array.isArray(i)||z(i.length)?Ft(i).forEach(function(r,o){t.call(i,r,o,i)}):be(i)&&Object.keys(i).forEach(function(r){t.call(i,i[r],r,i)})),i}var K=Object.assign||function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return be(t)&&o.length>0&&o.forEach(function(a){be(a)&&Object.keys(a).forEach(function(l){t[l]=a[l]})}),t},Ga=/\.\d*(?:0|9){12}\d*$/;function ke(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ga.test(i)?Math.round(i*t)/t:i}var Ja=/^width|height|left|top|marginLeft|marginTop$/;function ue(i,t){var r=i.style;q(t,function(o,s){Ja.test(s)&&z(o)&&(o="".concat(o,"px")),r[s]=o})}function Za(i,t){return i.classList?i.classList.contains(t):i.className.indexOf(t)>-1}function Z(i,t){if(!!t){if(z(i.length)){q(i,function(o){Z(o,t)});return}if(i.classList){i.classList.add(t);return}var r=i.className.trim();r?r.indexOf(t)<0&&(i.className="".concat(r," ").concat(t)):i.className=t}}function de(i,t){if(!!t){if(z(i.length)){q(i,function(r){de(r,t)});return}if(i.classList){i.classList.remove(t);return}i.className.indexOf(t)>=0&&(i.className=i.className.replace(t,""))}}function _e(i,t,r){if(!!t){if(z(i.length)){q(i,function(o){_e(o,t,r)});return}r?Z(i,t):de(i,t)}}var Qa=/([a-z\d])([A-Z])/g;function ut(i){return i.replace(Qa,"$1-$2").toLowerCase()}function mt(i,t){return be(i[t])?i[t]:i.dataset?i.dataset[t]:i.getAttribute("data-".concat(ut(t)))}function Ae(i,t,r){be(r)?i[t]=r:i.dataset?i.dataset[t]=r:i.setAttribute("data-".concat(ut(t)),r)}function ei(i,t){if(be(i[t]))try{delete i[t]}catch{i[t]=void 0}else if(i.dataset)try{delete i.dataset[t]}catch{i.dataset[t]=void 0}else i.removeAttribute("data-".concat(ut(t)))}var Kt=/\s\s*/,Yt=function(){var i=!1;if(He){var t=!1,r=function(){},o=Object.defineProperty({},"once",{get:function(){return i=!0,t},set:function(a){t=a}});ce.addEventListener("test",r,o),ce.removeEventListener("test",r,o)}return i}();function ae(i,t,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r;t.trim().split(Kt).forEach(function(a){if(!Yt){var l=i.listeners;l&&l[a]&&l[a][r]&&(s=l[a][r],delete l[a][r],Object.keys(l[a]).length===0&&delete l[a],Object.keys(l).length===0&&delete i.listeners)}i.removeEventListener(a,s,o)})}function oe(i,t,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r;t.trim().split(Kt).forEach(function(a){if(o.once&&!Yt){var l=i.listeners,m=l===void 0?{}:l;s=function(){delete m[a][r],i.removeEventListener(a,s,o);for(var f=arguments.length,u=new Array(f),y=0;y<f;y++)u[y]=arguments[y];r.apply(i,u)},m[a]||(m[a]={}),m[a][r]&&i.removeEventListener(a,m[a][r],o),m[a][r]=s,i.listeners=m}i.addEventListener(a,s,o)})}function xe(i,t,r){var o;return te(Event)&&te(CustomEvent)?o=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(o=document.createEvent("CustomEvent"),o.initCustomEvent(t,!0,!0,r)),i.dispatchEvent(o)}function Wt(i){var t=i.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var ft=ce.location,ti=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Xt(i){var t=i.match(ti);return t!==null&&(t[1]!==ft.protocol||t[2]!==ft.hostname||t[3]!==ft.port)}function qt(i){var t="timestamp=".concat(new Date().getTime());return i+(i.indexOf("?")===-1?"?":"&")+t}function Oe(i){var t=i.rotate,r=i.scaleX,o=i.scaleY,s=i.translateX,a=i.translateY,l=[];z(s)&&s!==0&&l.push("translateX(".concat(s,"px)")),z(a)&&a!==0&&l.push("translateY(".concat(a,"px)")),z(t)&&t!==0&&l.push("rotate(".concat(t,"deg)")),z(r)&&r!==1&&l.push("scaleX(".concat(r,")")),z(o)&&o!==1&&l.push("scaleY(".concat(o,")"));var m=l.length?l.join(" "):"none";return{WebkitTransform:m,msTransform:m,transform:m}}function ri(i){var t=_t({},i),r=0;return q(i,function(o,s){delete t[s],q(t,function(a){var l=Math.abs(o.startX-a.startX),m=Math.abs(o.startY-a.startY),p=Math.abs(o.endX-a.endX),f=Math.abs(o.endY-a.endY),u=Math.sqrt(l*l+m*m),y=Math.sqrt(p*p+f*f),b=(y-u)/u;Math.abs(b)>Math.abs(r)&&(r=b)})}),r}function Ke(i,t){var r=i.pageX,o=i.pageY,s={endX:r,endY:o};return t?s:_t({startX:r,startY:o},s)}function ni(i){var t=0,r=0,o=0;return q(i,function(s){var a=s.startX,l=s.startY;t+=a,r+=l,o+=1}),t/=o,r/=o,{pageX:t,pageY:r}}function me(i){var t=i.aspectRatio,r=i.height,o=i.width,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",a=Ut(o),l=Ut(r);if(a&&l){var m=r*t;s==="contain"&&m>o||s==="cover"&&m<o?r=o/t:o=r*t}else a?r=o/t:l&&(o=r*t);return{width:o,height:r}}function oi(i){var t=i.width,r=i.height,o=i.degree;if(o=Math.abs(o)%180,o===90)return{width:r,height:t};var s=o%90*Math.PI/180,a=Math.sin(s),l=Math.cos(s),m=t*l+r*a,p=t*a+r*l;return o>90?{width:p,height:m}:{width:m,height:p}}function ai(i,t,r,o){var s=t.aspectRatio,a=t.naturalWidth,l=t.naturalHeight,m=t.rotate,p=m===void 0?0:m,f=t.scaleX,u=f===void 0?1:f,y=t.scaleY,b=y===void 0?1:y,E=r.aspectRatio,k=r.naturalWidth,S=r.naturalHeight,M=o.fillColor,R=M===void 0?"transparent":M,A=o.imageSmoothingEnabled,N=A===void 0?!0:A,P=o.imageSmoothingQuality,H=P===void 0?"low":P,x=o.maxWidth,U=x===void 0?1/0:x,Y=o.maxHeight,Q=Y===void 0?1/0:Y,re=o.minWidth,B=re===void 0?0:re,O=o.minHeight,$=O===void 0?0:O,I=document.createElement("canvas"),j=I.getContext("2d"),G=me({aspectRatio:E,width:U,height:Q}),W=me({aspectRatio:E,width:B,height:$},"cover"),je=Math.min(G.width,Math.max(W.width,k)),Pe=Math.min(G.height,Math.max(W.height,S)),Ye=me({aspectRatio:s,width:U,height:Q}),We=me({aspectRatio:s,width:B,height:$},"cover"),Xe=Math.min(Ye.width,Math.max(We.width,a)),Se=Math.min(Ye.height,Math.max(We.height,l)),gt=[-Xe/2,-Se/2,Xe,Se];return I.width=ke(je),I.height=ke(Pe),j.fillStyle=R,j.fillRect(0,0,je,Pe),j.save(),j.translate(je/2,Pe/2),j.rotate(p*Math.PI/180),j.scale(u,b),j.imageSmoothingEnabled=N,j.imageSmoothingQuality=H,j.drawImage.apply(j,[i].concat(St(gt.map(function(De){return Math.floor(ke(De))})))),j.restore(),I}var Gt=String.fromCharCode;function ii(i,t,r){var o="";r+=t;for(var s=t;s<r;s+=1)o+=Gt(i.getUint8(s));return o}var si=/^data:.*,/;function li(i){var t=i.replace(si,""),r=atob(t),o=new ArrayBuffer(r.length),s=new Uint8Array(o);return q(s,function(a,l){s[l]=r.charCodeAt(l)}),o}function ci(i,t){for(var r=[],o=8192,s=new Uint8Array(i);s.length>0;)r.push(Gt.apply(null,Ft(s.subarray(0,o)))),s=s.subarray(o);return"data:".concat(t,";base64,").concat(btoa(r.join("")))}function di(i){var t=new DataView(i),r;try{var o,s,a;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var l=t.byteLength,m=2;m+1<l;){if(t.getUint8(m)===255&&t.getUint8(m+1)===225){s=m;break}m+=1}if(s){var p=s+4,f=s+10;if(ii(t,p,4)==="Exif"){var u=t.getUint16(f);if(o=u===18761,(o||u===19789)&&t.getUint16(f+2,o)===42){var y=t.getUint32(f+4,o);y>=8&&(a=f+y)}}}if(a){var b=t.getUint16(a,o),E,k;for(k=0;k<b;k+=1)if(E=a+k*12+2,t.getUint16(E,o)===274){E+=8,r=t.getUint16(E,o),t.setUint16(E,1,o);break}}}catch{r=1}return r}function hi(i){var t=0,r=1,o=1;switch(i){case 2:r=-1;break;case 3:t=-180;break;case 4:o=-1;break;case 5:t=90,o=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:r,scaleY:o}}var ui={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,r=this.options,o=this.container,s=this.cropper,a=Number(r.minContainerWidth),l=Number(r.minContainerHeight);Z(s,ee),de(t,ee);var m={width:Math.max(o.offsetWidth,a>=0?a:zt),height:Math.max(o.offsetHeight,l>=0?l:Rt)};this.containerData=m,ue(s,{width:m.width,height:m.height}),Z(t,ee),de(s,ee)},initCanvas:function(){var t=this.containerData,r=this.imageData,o=this.options.viewMode,s=Math.abs(r.rotate)%180===90,a=s?r.naturalHeight:r.naturalWidth,l=s?r.naturalWidth:r.naturalHeight,m=a/l,p=t.width,f=t.height;t.height*m>t.width?o===3?p=t.height*m:f=t.width/m:o===3?f=t.width/m:p=t.height*m;var u={aspectRatio:m,naturalWidth:a,naturalHeight:l,width:p,height:f};this.canvasData=u,this.limited=o===1||o===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(t.width-u.width)/2,u.top=(t.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=K({},u)},limitCanvas:function(t,r){var o=this.options,s=this.containerData,a=this.canvasData,l=this.cropBoxData,m=o.viewMode,p=a.aspectRatio,f=this.cropped&&l;if(t){var u=Number(o.minCanvasWidth)||0,y=Number(o.minCanvasHeight)||0;m>1?(u=Math.max(u,s.width),y=Math.max(y,s.height),m===3&&(y*p>u?u=y*p:y=u/p)):m>0&&(u?u=Math.max(u,f?l.width:0):y?y=Math.max(y,f?l.height:0):f&&(u=l.width,y=l.height,y*p>u?u=y*p:y=u/p));var b=me({aspectRatio:p,width:u,height:y});u=b.width,y=b.height,a.minWidth=u,a.minHeight=y,a.maxWidth=1/0,a.maxHeight=1/0}if(r)if(m>(f?0:1)){var E=s.width-a.width,k=s.height-a.height;a.minLeft=Math.min(0,E),a.minTop=Math.min(0,k),a.maxLeft=Math.max(0,E),a.maxTop=Math.max(0,k),f&&this.limited&&(a.minLeft=Math.min(l.left,l.left+(l.width-a.width)),a.minTop=Math.min(l.top,l.top+(l.height-a.height)),a.maxLeft=l.left,a.maxTop=l.top,m===2&&(a.width>=s.width&&(a.minLeft=Math.min(0,E),a.maxLeft=Math.max(0,E)),a.height>=s.height&&(a.minTop=Math.min(0,k),a.maxTop=Math.max(0,k))))}else a.minLeft=-a.width,a.minTop=-a.height,a.maxLeft=s.width,a.maxTop=s.height},renderCanvas:function(t,r){var o=this.canvasData,s=this.imageData;if(r){var a=oi({width:s.naturalWidth*Math.abs(s.scaleX||1),height:s.naturalHeight*Math.abs(s.scaleY||1),degree:s.rotate||0}),l=a.width,m=a.height,p=o.width*(l/o.naturalWidth),f=o.height*(m/o.naturalHeight);o.left-=(p-o.width)/2,o.top-=(f-o.height)/2,o.width=p,o.height=f,o.aspectRatio=l/m,o.naturalWidth=l,o.naturalHeight=m,this.limitCanvas(!0,!1)}(o.width>o.maxWidth||o.width<o.minWidth)&&(o.left=o.oldLeft),(o.height>o.maxHeight||o.height<o.minHeight)&&(o.top=o.oldTop),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),this.limitCanvas(!1,!0),o.left=Math.min(Math.max(o.left,o.minLeft),o.maxLeft),o.top=Math.min(Math.max(o.top,o.minTop),o.maxTop),o.oldLeft=o.left,o.oldTop=o.top,ue(this.canvas,K({width:o.width,height:o.height},Oe({translateX:o.left,translateY:o.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var r=this.canvasData,o=this.imageData,s=o.naturalWidth*(r.width/r.naturalWidth),a=o.naturalHeight*(r.height/r.naturalHeight);K(o,{width:s,height:a,left:(r.width-s)/2,top:(r.height-a)/2}),ue(this.image,K({width:o.width,height:o.height},Oe(K({translateX:o.left,translateY:o.top},o)))),t&&this.output()},initCropBox:function(){var t=this.options,r=this.canvasData,o=t.aspectRatio||t.initialAspectRatio,s=Number(t.autoCropArea)||.8,a={width:r.width,height:r.height};o&&(r.height*o>r.width?a.height=a.width/o:a.width=a.height*o),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*s),a.height=Math.max(a.minHeight,a.height*s),a.left=r.left+(r.width-a.width)/2,a.top=r.top+(r.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=K({},a)},limitCropBox:function(t,r){var o=this.options,s=this.containerData,a=this.canvasData,l=this.cropBoxData,m=this.limited,p=o.aspectRatio;if(t){var f=Number(o.minCropBoxWidth)||0,u=Number(o.minCropBoxHeight)||0,y=m?Math.min(s.width,a.width,a.width+a.left,s.width-a.left):s.width,b=m?Math.min(s.height,a.height,a.height+a.top,s.height-a.top):s.height;f=Math.min(f,s.width),u=Math.min(u,s.height),p&&(f&&u?u*p>f?u=f/p:f=u*p:f?u=f/p:u&&(f=u*p),b*p>y?b=y/p:y=b*p),l.minWidth=Math.min(f,y),l.minHeight=Math.min(u,b),l.maxWidth=y,l.maxHeight=b}r&&(m?(l.minLeft=Math.max(0,a.left),l.minTop=Math.max(0,a.top),l.maxLeft=Math.min(s.width,a.left+a.width)-l.width,l.maxTop=Math.min(s.height,a.top+a.height)-l.height):(l.minLeft=0,l.minTop=0,l.maxLeft=s.width-l.width,l.maxTop=s.height-l.height))},renderCropBox:function(){var t=this.options,r=this.containerData,o=this.cropBoxData;(o.width>o.maxWidth||o.width<o.minWidth)&&(o.left=o.oldLeft),(o.height>o.maxHeight||o.height<o.minHeight)&&(o.top=o.oldTop),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),this.limitCropBox(!1,!0),o.left=Math.min(Math.max(o.left,o.minLeft),o.maxLeft),o.top=Math.min(Math.max(o.top,o.minTop),o.maxTop),o.oldLeft=o.left,o.oldTop=o.top,t.movable&&t.cropBoxMovable&&Ae(this.face,Te,o.width>=r.width&&o.height>=r.height?Et:rt),ue(this.cropBox,K({width:o.width,height:o.height},Oe({translateX:o.left,translateY:o.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),xe(this.element,it,this.getData())}},mi={initPreview:function(){var t=this.element,r=this.crossOrigin,o=this.options.preview,s=r?this.crossOriginUrl:this.url,a=t.alt||"The image to preview",l=document.createElement("img");if(r&&(l.crossOrigin=r),l.src=s,l.alt=a,this.viewBox.appendChild(l),this.viewBoxImage=l,!!o){var m=o;typeof o=="string"?m=t.ownerDocument.querySelectorAll(o):o.querySelector&&(m=[o]),this.previews=m,q(m,function(p){var f=document.createElement("img");Ae(p,Fe,{width:p.offsetWidth,height:p.offsetHeight,html:p.innerHTML}),r&&(f.crossOrigin=r),f.src=s,f.alt=a,f.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;"',p.innerHTML="",p.appendChild(f)})}},resetPreview:function(){q(this.previews,function(t){var r=mt(t,Fe);ue(t,{width:r.width,height:r.height}),t.innerHTML=r.html,ei(t,Fe)})},preview:function(){var t=this.imageData,r=this.canvasData,o=this.cropBoxData,s=o.width,a=o.height,l=t.width,m=t.height,p=o.left-r.left-t.left,f=o.top-r.top-t.top;!this.cropped||this.disabled||(ue(this.viewBoxImage,K({width:l,height:m},Oe(K({translateX:-p,translateY:-f},t)))),q(this.previews,function(u){var y=mt(u,Fe),b=y.width,E=y.height,k=b,S=E,M=1;s&&(M=b/s,S=a*M),a&&S>E&&(M=E/a,k=s*M,S=E),ue(u,{width:k,height:S}),ue(u.getElementsByTagName("img")[0],K({width:l*M,height:m*M},Oe(K({translateX:-p*M,translateY:-f*M},t))))}))}},fi={bind:function(){var t=this.element,r=this.options,o=this.cropper;te(r.cropstart)&&oe(t,ct,r.cropstart),te(r.cropmove)&&oe(t,lt,r.cropmove),te(r.cropend)&&oe(t,st,r.cropend),te(r.crop)&&oe(t,it,r.crop),te(r.zoom)&&oe(t,dt,r.zoom),oe(o,Tt,this.onCropStart=this.cropStart.bind(this)),r.zoomable&&r.zoomOnWheel&&oe(o,Lt,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&oe(o,Bt,this.onDblclick=this.dblclick.bind(this)),oe(t.ownerDocument,At,this.onCropMove=this.cropMove.bind(this)),oe(t.ownerDocument,Ot,this.onCropEnd=this.cropEnd.bind(this)),r.responsive&&oe(window,Pt,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,r=this.options,o=this.cropper;te(r.cropstart)&&ae(t,ct,r.cropstart),te(r.cropmove)&&ae(t,lt,r.cropmove),te(r.cropend)&&ae(t,st,r.cropend),te(r.crop)&&ae(t,it,r.crop),te(r.zoom)&&ae(t,dt,r.zoom),ae(o,Tt,this.onCropStart),r.zoomable&&r.zoomOnWheel&&ae(o,Lt,this.onWheel,{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&ae(o,Bt,this.onDblclick),ae(t.ownerDocument,At,this.onCropMove),ae(t.ownerDocument,Ot,this.onCropEnd),r.responsive&&ae(window,Pt,this.onResize)}},pi={resize:function(){if(!this.disabled){var t=this.options,r=this.container,o=this.containerData,s=r.offsetWidth/o.width,a=r.offsetHeight/o.height,l=Math.abs(s-1)>Math.abs(a-1)?s:a;if(l!==1){var m,p;t.restore&&(m=this.getCanvasData(),p=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(q(m,function(f,u){m[u]=f*l})),this.setCropBoxData(q(p,function(f,u){p[u]=f*l})))}}},dblclick:function(){this.disabled||this.options.dragMode===Mt||this.setDragMode(Za(this.dragBox,nt)?$t:at)},wheel:function(t){var r=this,o=Number(this.options.wheelZoomRatio)||.1,s=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){r.wheeling=!1},50),t.deltaY?s=t.deltaY>0?1:-1:t.wheelDelta?s=-t.wheelDelta/120:t.detail&&(s=t.detail>0?1:-1),this.zoom(-s*o,t)))},cropStart:function(t){var r=t.buttons,o=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(z(r)&&r!==1||z(o)&&o!==0||t.ctrlKey))){var s=this.options,a=this.pointers,l;t.changedTouches?q(t.changedTouches,function(m){a[m.identifier]=Ke(m)}):a[t.pointerId||0]=Ke(t),Object.keys(a).length>1&&s.zoomable&&s.zoomOnTouch?l=Nt:l=mt(t.target,Te),!!Ha.test(l)&&xe(this.element,ct,{originalEvent:t,action:l})!==!1&&(t.preventDefault(),this.action=l,this.cropping=!1,l===Dt&&(this.cropping=!0,Z(this.dragBox,Ue)))}},cropMove:function(t){var r=this.action;if(!(this.disabled||!r)){var o=this.pointers;t.preventDefault(),xe(this.element,lt,{originalEvent:t,action:r})!==!1&&(t.changedTouches?q(t.changedTouches,function(s){K(o[s.identifier]||{},Ke(s,!0))}):K(o[t.pointerId||0]||{},Ke(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var r=this.action,o=this.pointers;t.changedTouches?q(t.changedTouches,function(s){delete o[s.identifier]}):delete o[t.pointerId||0],r&&(t.preventDefault(),Object.keys(o).length||(this.action=""),this.cropping&&(this.cropping=!1,_e(this.dragBox,Ue,this.cropped&&this.options.modal)),xe(this.element,st,{originalEvent:t,action:r}))}}},gi={change:function(t){var r=this.options,o=this.canvasData,s=this.containerData,a=this.cropBoxData,l=this.pointers,m=this.action,p=r.aspectRatio,f=a.left,u=a.top,y=a.width,b=a.height,E=f+y,k=u+b,S=0,M=0,R=s.width,A=s.height,N=!0,P;!p&&t.shiftKey&&(p=y&&b?y/b:1),this.limited&&(S=a.minLeft,M=a.minTop,R=S+Math.min(s.width,o.width,o.left+o.width),A=M+Math.min(s.height,o.height,o.top+o.height));var H=l[Object.keys(l)[0]],x={x:H.endX-H.startX,y:H.endY-H.startY},U=function(Q){switch(Q){case ge:E+x.x>R&&(x.x=R-E);break;case ye:f+x.x<S&&(x.x=S-f);break;case he:u+x.y<M&&(x.y=M-u);break;case we:k+x.y>A&&(x.y=A-k);break}};switch(m){case rt:f+=x.x,u+=x.y;break;case ge:if(x.x>=0&&(E>=R||p&&(u<=M||k>=A))){N=!1;break}U(ge),y+=x.x,y<0&&(m=ye,y=-y,f-=y),p&&(b=y/p,u+=(a.height-b)/2);break;case he:if(x.y<=0&&(u<=M||p&&(f<=S||E>=R))){N=!1;break}U(he),b-=x.y,u+=x.y,b<0&&(m=we,b=-b,u-=b),p&&(y=b*p,f+=(a.width-y)/2);break;case ye:if(x.x<=0&&(f<=S||p&&(u<=M||k>=A))){N=!1;break}U(ye),y-=x.x,f+=x.x,y<0&&(m=ge,y=-y,f-=y),p&&(b=y/p,u+=(a.height-b)/2);break;case we:if(x.y>=0&&(k>=A||p&&(f<=S||E>=R))){N=!1;break}U(we),b+=x.y,b<0&&(m=he,b=-b,u-=b),p&&(y=b*p,f+=(a.width-y)/2);break;case Ce:if(p){if(x.y<=0&&(u<=M||E>=R)){N=!1;break}U(he),b-=x.y,u+=x.y,y=b*p}else U(he),U(ge),x.x>=0?E<R?y+=x.x:x.y<=0&&u<=M&&(N=!1):y+=x.x,x.y<=0?u>M&&(b-=x.y,u+=x.y):(b-=x.y,u+=x.y);y<0&&b<0?(m=Be,b=-b,y=-y,u-=b,f-=y):y<0?(m=$e,y=-y,f-=y):b<0&&(m=Me,b=-b,u-=b);break;case $e:if(p){if(x.y<=0&&(u<=M||f<=S)){N=!1;break}U(he),b-=x.y,u+=x.y,y=b*p,f+=a.width-y}else U(he),U(ye),x.x<=0?f>S?(y-=x.x,f+=x.x):x.y<=0&&u<=M&&(N=!1):(y-=x.x,f+=x.x),x.y<=0?u>M&&(b-=x.y,u+=x.y):(b-=x.y,u+=x.y);y<0&&b<0?(m=Me,b=-b,y=-y,u-=b,f-=y):y<0?(m=Ce,y=-y,f-=y):b<0&&(m=Be,b=-b,u-=b);break;case Be:if(p){if(x.x<=0&&(f<=S||k>=A)){N=!1;break}U(ye),y-=x.x,f+=x.x,b=y/p}else U(we),U(ye),x.x<=0?f>S?(y-=x.x,f+=x.x):x.y>=0&&k>=A&&(N=!1):(y-=x.x,f+=x.x),x.y>=0?k<A&&(b+=x.y):b+=x.y;y<0&&b<0?(m=Ce,b=-b,y=-y,u-=b,f-=y):y<0?(m=Me,y=-y,f-=y):b<0&&(m=$e,b=-b,u-=b);break;case Me:if(p){if(x.x>=0&&(E>=R||k>=A)){N=!1;break}U(ge),y+=x.x,b=y/p}else U(we),U(ge),x.x>=0?E<R?y+=x.x:x.y>=0&&k>=A&&(N=!1):y+=x.x,x.y>=0?k<A&&(b+=x.y):b+=x.y;y<0&&b<0?(m=$e,b=-b,y=-y,u-=b,f-=y):y<0?(m=Be,y=-y,f-=y):b<0&&(m=Ce,b=-b,u-=b);break;case Et:this.move(x.x,x.y),N=!1;break;case Nt:this.zoom(ri(l),t),N=!1;break;case Dt:if(!x.x||!x.y){N=!1;break}P=Wt(this.cropper),f=H.startX-P.left,u=H.startY-P.top,y=a.minWidth,b=a.minHeight,x.x>0?m=x.y>0?Me:Ce:x.x<0&&(f-=y,m=x.y>0?Be:$e),x.y<0&&(u-=b),this.cropped||(de(this.cropBox,ee),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}N&&(a.width=y,a.height=b,a.left=f,a.top=u,this.action=m,this.renderCropBox()),q(l,function(Y){Y.startX=Y.endX,Y.startY=Y.endY})}},yi={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Z(this.dragBox,Ue),de(this.cropBox,ee),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=K({},this.initialImageData),this.canvasData=K({},this.initialCanvasData),this.cropBoxData=K({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(K(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),de(this.dragBox,Ue),Z(this.cropBox,ee)),this},replace:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),r?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,q(this.previews,function(o){o.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,de(this.cropper,Vt)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Z(this.cropper,Vt)),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 r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,o=this.canvasData,s=o.left,a=o.top;return this.moveTo(ht(t)?t:s+Number(t),ht(r)?r:a+Number(r))},moveTo:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,o=this.canvasData,s=!1;return t=Number(t),r=Number(r),this.ready&&!this.disabled&&this.options.movable&&(z(t)&&(o.left=t,s=!0),z(r)&&(o.top=r,s=!0),s&&this.renderCanvas(!0)),this},zoom:function(t,r){var o=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(o.width*t/o.naturalWidth,null,r)},zoomTo:function(t,r,o){var s=this.options,a=this.canvasData,l=a.width,m=a.height,p=a.naturalWidth,f=a.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&s.zoomable){var u=p*t,y=f*t;if(xe(this.element,dt,{ratio:t,oldRatio:l/p,originalEvent:o})===!1)return this;if(o){var b=this.pointers,E=Wt(this.cropper),k=b&&Object.keys(b).length?ni(b):{pageX:o.pageX,pageY:o.pageY};a.left-=(u-l)*((k.pageX-E.left-a.left)/l),a.top-=(y-m)*((k.pageY-E.top-a.top)/m)}else ve(r)&&z(r.x)&&z(r.y)?(a.left-=(u-l)*((r.x-a.left)/l),a.top-=(y-m)*((r.y-a.top)/m)):(a.left-=(u-l)/2,a.top-=(y-m)/2);a.width=u,a.height=y,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),z(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var r=this.imageData.scaleY;return this.scale(t,z(r)?r:1)},scaleY:function(t){var r=this.imageData.scaleX;return this.scale(z(r)?r:1,t)},scale:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,o=this.imageData,s=!1;return t=Number(t),r=Number(r),this.ready&&!this.disabled&&this.options.scalable&&(z(t)&&(o.scaleX=t,s=!0),z(r)&&(o.scaleY=r,s=!0),s&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.options,o=this.imageData,s=this.canvasData,a=this.cropBoxData,l;if(this.ready&&this.cropped){l={x:a.left-s.left,y:a.top-s.top,width:a.width,height:a.height};var m=o.width/o.naturalWidth;if(q(l,function(u,y){l[y]=u/m}),t){var p=Math.round(l.y+l.height),f=Math.round(l.x+l.width);l.x=Math.round(l.x),l.y=Math.round(l.y),l.width=f-l.x,l.height=p-l.y}}else l={x:0,y:0,width:0,height:0};return r.rotatable&&(l.rotate=o.rotate||0),r.scalable&&(l.scaleX=o.scaleX||1,l.scaleY=o.scaleY||1),l},setData:function(t){var r=this.options,o=this.imageData,s=this.canvasData,a={};if(this.ready&&!this.disabled&&ve(t)){var l=!1;r.rotatable&&z(t.rotate)&&t.rotate!==o.rotate&&(o.rotate=t.rotate,l=!0),r.scalable&&(z(t.scaleX)&&t.scaleX!==o.scaleX&&(o.scaleX=t.scaleX,l=!0),z(t.scaleY)&&t.scaleY!==o.scaleY&&(o.scaleY=t.scaleY,l=!0)),l&&this.renderCanvas(!0,!0);var m=o.width/o.naturalWidth;z(t.x)&&(a.left=t.x*m+s.left),z(t.y)&&(a.top=t.y*m+s.top),z(t.width)&&(a.width=t.width*m),z(t.height)&&(a.height=t.height*m),this.setCropBoxData(a)}return this},getContainerData:function(){return this.ready?K({},this.containerData):{}},getImageData:function(){return this.sized?K({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,r={};return this.ready&&q(["left","top","width","height","naturalWidth","naturalHeight"],function(o){r[o]=t[o]}),r},setCanvasData:function(t){var r=this.canvasData,o=r.aspectRatio;return this.ready&&!this.disabled&&ve(t)&&(z(t.left)&&(r.left=t.left),z(t.top)&&(r.top=t.top),z(t.width)?(r.width=t.width,r.height=t.width/o):z(t.height)&&(r.height=t.height,r.width=t.height*o),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,r;return this.ready&&this.cropped&&(r={left:t.left,top:t.top,width:t.width,height:t.height}),r||{}},setCropBoxData:function(t){var r=this.cropBoxData,o=this.options.aspectRatio,s,a;return this.ready&&this.cropped&&!this.disabled&&ve(t)&&(z(t.left)&&(r.left=t.left),z(t.top)&&(r.top=t.top),z(t.width)&&t.width!==r.width&&(s=!0,r.width=t.width),z(t.height)&&t.height!==r.height&&(a=!0,r.height=t.height),o&&(s?r.height=r.width/o:a&&(r.width=r.height*o)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var r=this.canvasData,o=ai(this.image,this.imageData,r,t);if(!this.cropped)return o;var s=this.getData(),a=s.x,l=s.y,m=s.width,p=s.height,f=o.width/Math.floor(r.naturalWidth);f!==1&&(a*=f,l*=f,m*=f,p*=f);var u=m/p,y=me({aspectRatio:u,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),b=me({aspectRatio:u,width:t.minWidth||0,height:t.minHeight||0},"cover"),E=me({aspectRatio:u,width:t.width||(f!==1?o.width:m),height:t.height||(f!==1?o.height:p)}),k=E.width,S=E.height;k=Math.min(y.width,Math.max(b.width,k)),S=Math.min(y.height,Math.max(b.height,S));var M=document.createElement("canvas"),R=M.getContext("2d");M.width=ke(k),M.height=ke(S),R.fillStyle=t.fillColor||"transparent",R.fillRect(0,0,k,S);var A=t.imageSmoothingEnabled,N=A===void 0?!0:A,P=t.imageSmoothingQuality;R.imageSmoothingEnabled=N,P&&(R.imageSmoothingQuality=P);var H=o.width,x=o.height,U=a,Y=l,Q,re,B,O,$,I;U<=-m||U>H?(U=0,Q=0,B=0,$=0):U<=0?(B=-U,U=0,Q=Math.min(H,m+U),$=Q):U<=H&&(B=0,Q=Math.min(m,H-U),$=Q),Q<=0||Y<=-p||Y>x?(Y=0,re=0,O=0,I=0):Y<=0?(O=-Y,Y=0,re=Math.min(x,p+Y),I=re):Y<=x&&(O=0,re=Math.min(p,x-Y),I=re);var j=[U,Y,Q,re];if($>0&&I>0){var G=k/m;j.push(B*G,O*G,$*G,I*G)}return R.drawImage.apply(R,[o].concat(St(j.map(function(W){return Math.floor(ke(W))})))),M},setAspectRatio:function(t){var r=this.options;return!this.disabled&&!ht(t)&&(r.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var r=this.options,o=this.dragBox,s=this.face;if(this.ready&&!this.disabled){var a=t===at,l=r.movable&&t===$t;t=a||l?t:Mt,r.dragMode=t,Ae(o,Te,t),_e(o,nt,a),_e(o,ot,l),r.cropBoxMovable||(Ae(s,Te,t),_e(s,nt,a),_e(s,ot,l))}return this}},bi=ce.Cropper,Jt=function(){function i(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ma(this,i),!t||!Ka.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=K({},Ht,ve(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Ba(i,[{key:"init",value:function(){var r=this.element,o=r.tagName.toLowerCase(),s;if(!r[F]){if(r[F]=this,o==="img"){if(this.isImg=!0,s=r.getAttribute("src")||"",this.originalUrl=s,!s)return;s=r.src}else o==="canvas"&&window.HTMLCanvasElement&&(s=r.toDataURL());this.load(s)}}},{key:"load",value:function(r){var o=this;if(!!r){this.url=r,this.imageData={};var s=this.element,a=this.options;if(!a.rotatable&&!a.scalable&&(a.checkOrientation=!1),!a.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Ua.test(r)){Fa.test(r)?this.read(li(r)):this.clone();return}var l=new XMLHttpRequest,m=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=m,l.onerror=m,l.ontimeout=m,l.onprogress=function(){l.getResponseHeader("content-type")!==It&&l.abort()},l.onload=function(){o.read(l.response)},l.onloadend=function(){o.reloading=!1,o.xhr=null},a.checkCrossOrigin&&Xt(r)&&s.crossOrigin&&(r=qt(r)),l.open("GET",r,!0),l.responseType="arraybuffer",l.withCredentials=s.crossOrigin==="use-credentials",l.send()}}},{key:"read",value:function(r){var o=this.options,s=this.imageData,a=di(r),l=0,m=1,p=1;if(a>1){this.url=ci(r,It);var f=hi(a);l=f.rotate,m=f.scaleX,p=f.scaleY}o.rotatable&&(s.rotate=l),o.scalable&&(s.scaleX=m,s.scaleY=p),this.clone()}},{key:"clone",value:function(){var r=this.element,o=this.url,s=r.crossOrigin,a=o;this.options.checkCrossOrigin&&Xt(o)&&(s||(s="anonymous"),a=qt(o)),this.crossOrigin=s,this.crossOriginUrl=a;var l=document.createElement("img");s&&(l.crossOrigin=s),l.src=a||o,l.alt=r.alt||"The image to crop",this.image=l,l.onload=this.start.bind(this),l.onerror=this.stop.bind(this),Z(l,Ct),r.parentNode.insertBefore(l,r.nextSibling)}},{key:"start",value:function(){var r=this,o=this.image;o.onload=null,o.onerror=null,this.sizing=!0;var s=ce.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ce.navigator.userAgent),a=function(f,u){K(r.imageData,{naturalWidth:f,naturalHeight:u,aspectRatio:f/u}),r.initialImageData=K({},r.imageData),r.sizing=!1,r.sized=!0,r.build()};if(o.naturalWidth&&!s){a(o.naturalWidth,o.naturalHeight);return}var l=document.createElement("img"),m=document.body||document.documentElement;this.sizingImage=l,l.onload=function(){a(l.width,l.height),s||m.removeChild(l)},l.src=o.src,s||(l.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",m.appendChild(l))}},{key:"stop",value:function(){var r=this.image;r.onload=null,r.onerror=null,r.parentNode.removeChild(r),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var r=this.element,o=this.options,s=this.image,a=r.parentNode,l=document.createElement("div");l.innerHTML=Ya;var m=l.querySelector(".".concat(F,"-container")),p=m.querySelector(".".concat(F,"-canvas")),f=m.querySelector(".".concat(F,"-drag-box")),u=m.querySelector(".".concat(F,"-crop-box")),y=u.querySelector(".".concat(F,"-face"));this.container=a,this.cropper=m,this.canvas=p,this.dragBox=f,this.cropBox=u,this.viewBox=m.querySelector(".".concat(F,"-view-box")),this.face=y,p.appendChild(s),Z(r,ee),a.insertBefore(m,r.nextSibling),this.isImg||de(s,Ct),this.initPreview(),this.bind(),o.initialAspectRatio=Math.max(0,o.initialAspectRatio)||NaN,o.aspectRatio=Math.max(0,o.aspectRatio)||NaN,o.viewMode=Math.max(0,Math.min(3,Math.round(o.viewMode)))||0,Z(u,ee),o.guides||Z(u.getElementsByClassName("".concat(F,"-dashed")),ee),o.center||Z(u.getElementsByClassName("".concat(F,"-center")),ee),o.background&&Z(m,"".concat(F,"-bg")),o.highlight||Z(y,La),o.cropBoxMovable&&(Z(y,ot),Ae(y,Te,rt)),o.cropBoxResizable||(Z(u.getElementsByClassName("".concat(F,"-line")),ee),Z(u.getElementsByClassName("".concat(F,"-point")),ee)),this.render(),this.ready=!0,this.setDragMode(o.dragMode),o.autoCrop&&this.crop(),this.setData(o.data),te(o.ready)&&oe(r,jt,o.ready,{once:!0}),xe(r,jt)}}},{key:"unbuild",value:function(){!this.ready||(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),de(this.element,ee))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=bi,i}},{key:"setDefaults",value:function(r){K(Ht,ve(r)&&r)}}]),i}();K(Jt.prototype,ui,mi,fi,pi,gi,yi);const wi={class:"flex"},vi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ki={class:"ml-auto mb-2"},_i={class:"w-full flex justify-center"},xi=["src"],Si={__name:"Image",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{t:o}=e.inject("i18n"),{apiUrl:s}=ie(),a=e.ref(null),l=e.ref(null),m=e.ref(!1),p=e.ref(""),f=e.ref(!1),u=()=>{m.value=!m.value,m.value?l.value=new Jt(a.value,{crop(E){}}):l.value.destroy()},y=e.inject("postData"),b=()=>{l.value.getCroppedCanvas({width:795,height:341}).toBlob(E=>{p.value="",f.value=!1,Ie(s.value,{method:"POST",params:Object.assign(y,{q:"upload",adapter:r.selection.adapter,path:r.selection.item.path,file:E}),name:r.selection.item.basename,json:!1}).then(k=>{p.value=o("Updated."),a.value.src=Ze(r.selection.adapter,r.selection.item.path),u(),t("load")}).catch(k=>{p.value=o(k.message),f.value=!0})})};return e.onMounted(()=>{t("load")}),(E,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",wi,[e.createElementVNode("h3",vi,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",ki,[m.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:b,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(o)("Crop")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:k[0]||(k[0]=S=>u())},e.toDisplayString(m.value?e.unref(o)("Cancel"):e.unref(o)("Edit")),1)])]),e.createElementVNode("div",_i,[e.createElementVNode("img",{ref_key:"image",ref:a,class:"max-w-[60vh] max-h-[60vh]",src:e.unref(Ze)(r.selection.adapter,r.selection.item.path),alt:""},null,8,xi)]),p.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},Di={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ei=e.createElementVNode("div",null," Default view.. ",-1),Ni={__name:"Default",props:{selection:Object},emits:["load"],setup(i,{emit:t}){return e.onMounted(()=>{t("load")}),(r,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",Di,e.toDisplayString(i.selection.item.basename),1),Ei],64))}},Vi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ci={class:"w-full",preload:"",controls:""},$i=["src"],Mi=e.createTextVNode(" Your browser does not support the video tag. "),Bi={__name:"Video",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{apiUrl:o}=ie(),s=()=>o.value+"?"+pe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",Vi,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("video",Ci,[e.createElementVNode("source",{src:s(),type:"video/mp4"},null,8,$i),Mi])])],64))}},Ti={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ai={class:"w-full",controls:""},Oi=["src"],ji=e.createTextVNode(" Your browser does not support the audio element. "),Pi={__name:"Audio",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{apiUrl:o}=ie(),s=()=>o.value+"?"+pe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",Ti,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("audio",Ai,[e.createElementVNode("source",{src:s(),type:"audio/mpeg"},null,8,Oi),ji])])],64))}},Li={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ii=["data"],zi=["src"],Ri={__name:"Pdf",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{apiUrl:o}=ie(),s=()=>o.value+"?"+pe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",Li,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:s(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:s(),width:"100%",height:"100%"},`
|
|
11
|
+
*/function Ar(r,t){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),o.push.apply(o,n)}return o}function Or(r){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?Ar(Object(o),!0).forEach(function(n){qs(r,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Ar(Object(o)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(o,n))})}return r}function st(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?st=function(t){return typeof t}:st=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(r)}function Ws(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function Lr(r,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Xs(r,t,o){return t&&Lr(r.prototype,t),o&&Lr(r,o),r}function qs(r,t,o){return t in r?Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[t]=o,r}function Ir(r){return Gs(r)||Js(r)||Zs(r)||Qs()}function Gs(r){if(Array.isArray(r))return Mt(r)}function Js(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Zs(r,t){if(!!r){if(typeof r=="string")return Mt(r,t);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor&&(o=r.constructor.name),o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Mt(r,t)}}function Mt(r,t){(t==null||t>r.length)&&(t=r.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=r[o];return n}function Qs(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var lt=typeof window<"u"&&typeof window.document<"u",ue=lt?window:{},Bt=lt&&ue.document.documentElement?"ontouchstart"in ue.document.documentElement:!1,Tt=lt?"PointerEvent"in ue:!1,U="cropper",At="all",jr="crop",Pr="move",zr="zoom",Ee="e",De="w",$e="s",be="n",Ue="ne",Ke="nw",Ye="se",We="sw",Ot="".concat(U,"-crop"),Rr="".concat(U,"-disabled"),re="".concat(U,"-hidden"),Hr="".concat(U,"-hide"),el="".concat(U,"-invisible"),ct="".concat(U,"-modal"),Lt="".concat(U,"-move"),Xe="".concat(U,"Action"),dt="".concat(U,"Preview"),It="crop",Fr="move",Ur="none",jt="crop",Pt="cropend",zt="cropmove",Rt="cropstart",Kr="dblclick",tl=Bt?"touchstart":"mousedown",rl=Bt?"touchmove":"mousemove",ol=Bt?"touchend touchcancel":"mouseup",Yr=Tt?"pointerdown":tl,Wr=Tt?"pointermove":rl,Xr=Tt?"pointerup pointercancel":ol,qr="ready",Gr="resize",Jr="wheel",Ht="zoom",Zr="image/jpeg",nl=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,al=/^data:/,il=/^data:image\/jpeg;base64,/,sl=/^img|canvas$/i,Qr=200,eo=100,to={viewMode:0,dragMode:It,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:Qr,minContainerHeight:eo,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},ll='<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>',cl=Number.isNaN||ue.isNaN;function z(r){return typeof r=="number"&&!cl(r)}var ro=function(t){return t>0&&t<1/0};function Ft(r){return typeof r>"u"}function Ne(r){return st(r)==="object"&&r!==null}var dl=Object.prototype.hasOwnProperty;function Me(r){if(!Ne(r))return!1;try{var t=r.constructor,o=t.prototype;return t&&o&&dl.call(o,"isPrototypeOf")}catch{return!1}}function oe(r){return typeof r=="function"}var hl=Array.prototype.slice;function oo(r){return Array.from?Array.from(r):hl.call(r)}function q(r,t){return r&&oe(t)&&(Array.isArray(r)||z(r.length)?oo(r).forEach(function(o,n){t.call(r,o,n,r)}):Ne(r)&&Object.keys(r).forEach(function(o){t.call(r,r[o],o,r)})),r}var K=Object.assign||function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),s=1;s<o;s++)n[s-1]=arguments[s];return Ne(t)&&n.length>0&&n.forEach(function(a){Ne(a)&&Object.keys(a).forEach(function(l){t[l]=a[l]})}),t},ul=/\.\d*(?:0|9){12}\d*$/;function Be(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return ul.test(r)?Math.round(r*t)/t:r}var ml=/^width|height|left|top|marginLeft|marginTop$/;function ve(r,t){var o=r.style;q(t,function(n,s){ml.test(s)&&z(n)&&(n="".concat(n,"px")),o[s]=n})}function fl(r,t){return r.classList?r.classList.contains(t):r.className.indexOf(t)>-1}function J(r,t){if(!!t){if(z(r.length)){q(r,function(n){J(n,t)});return}if(r.classList){r.classList.add(t);return}var o=r.className.trim();o?o.indexOf(t)<0&&(r.className="".concat(o," ").concat(t)):r.className=t}}function me(r,t){if(!!t){if(z(r.length)){q(r,function(o){me(o,t)});return}if(r.classList){r.classList.remove(t);return}r.className.indexOf(t)>=0&&(r.className=r.className.replace(t,""))}}function Te(r,t,o){if(!!t){if(z(r.length)){q(r,function(n){Te(n,t,o)});return}o?J(r,t):me(r,t)}}var pl=/([a-z\d])([A-Z])/g;function Ut(r){return r.replace(pl,"$1-$2").toLowerCase()}function Kt(r,t){return Ne(r[t])?r[t]:r.dataset?r.dataset[t]:r.getAttribute("data-".concat(Ut(t)))}function qe(r,t,o){Ne(o)?r[t]=o:r.dataset?r.dataset[t]=o:r.setAttribute("data-".concat(Ut(t)),o)}function gl(r,t){if(Ne(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(Ut(t)))}var no=/\s\s*/,ao=function(){var r=!1;if(lt){var t=!1,o=function(){},n=Object.defineProperty({},"once",{get:function(){return r=!0,t},set:function(a){t=a}});ue.addEventListener("test",o,n),ue.removeEventListener("test",o,n)}return r}();function se(r,t,o){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=o;t.trim().split(no).forEach(function(a){if(!ao){var l=r.listeners;l&&l[a]&&l[a][o]&&(s=l[a][o],delete l[a][o],Object.keys(l[a]).length===0&&delete l[a],Object.keys(l).length===0&&delete r.listeners)}r.removeEventListener(a,s,n)})}function ie(r,t,o){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=o;t.trim().split(no).forEach(function(a){if(n.once&&!ao){var l=r.listeners,m=l===void 0?{}:l;s=function(){delete m[a][o],r.removeEventListener(a,s,n);for(var f=arguments.length,h=new Array(f),y=0;y<f;y++)h[y]=arguments[y];o.apply(r,h)},m[a]||(m[a]={}),m[a][o]&&r.removeEventListener(a,m[a][o],n),m[a][o]=s,r.listeners=m}r.addEventListener(a,s,n)})}function Ae(r,t,o){var n;return oe(Event)&&oe(CustomEvent)?n=new CustomEvent(t,{detail:o,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,o)),r.dispatchEvent(n)}function io(r){var t=r.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Yt=ue.location,yl=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function so(r){var t=r.match(yl);return t!==null&&(t[1]!==Yt.protocol||t[2]!==Yt.hostname||t[3]!==Yt.port)}function lo(r){var t="timestamp=".concat(new Date().getTime());return r+(r.indexOf("?")===-1?"?":"&")+t}function Ge(r){var t=r.rotate,o=r.scaleX,n=r.scaleY,s=r.translateX,a=r.translateY,l=[];z(s)&&s!==0&&l.push("translateX(".concat(s,"px)")),z(a)&&a!==0&&l.push("translateY(".concat(a,"px)")),z(t)&&t!==0&&l.push("rotate(".concat(t,"deg)")),z(o)&&o!==1&&l.push("scaleX(".concat(o,")")),z(n)&&n!==1&&l.push("scaleY(".concat(n,")"));var m=l.length?l.join(" "):"none";return{WebkitTransform:m,msTransform:m,transform:m}}function bl(r){var t=Or({},r),o=0;return q(r,function(n,s){delete t[s],q(t,function(a){var l=Math.abs(n.startX-a.startX),m=Math.abs(n.startY-a.startY),p=Math.abs(n.endX-a.endX),f=Math.abs(n.endY-a.endY),h=Math.sqrt(l*l+m*m),y=Math.sqrt(p*p+f*f),b=(y-h)/h;Math.abs(b)>Math.abs(o)&&(o=b)})}),o}function ht(r,t){var o=r.pageX,n=r.pageY,s={endX:o,endY:n};return t?s:Or({startX:o,startY:n},s)}function vl(r){var t=0,o=0,n=0;return q(r,function(s){var a=s.startX,l=s.startY;t+=a,o+=l,n+=1}),t/=n,o/=n,{pageX:t,pageY:o}}function we(r){var t=r.aspectRatio,o=r.height,n=r.width,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",a=ro(n),l=ro(o);if(a&&l){var m=o*t;s==="contain"&&m>n||s==="cover"&&m<n?o=n/t:n=o*t}else a?o=n/t:l&&(n=o*t);return{width:n,height:o}}function wl(r){var t=r.width,o=r.height,n=r.degree;if(n=Math.abs(n)%180,n===90)return{width:o,height:t};var s=n%90*Math.PI/180,a=Math.sin(s),l=Math.cos(s),m=t*l+o*a,p=t*a+o*l;return n>90?{width:p,height:m}:{width:m,height:p}}function _l(r,t,o,n){var s=t.aspectRatio,a=t.naturalWidth,l=t.naturalHeight,m=t.rotate,p=m===void 0?0:m,f=t.scaleX,h=f===void 0?1:f,y=t.scaleY,b=y===void 0?1:y,D=o.aspectRatio,_=o.naturalWidth,k=o.naturalHeight,$=n.fillColor,P=$===void 0?"transparent":$,L=n.imageSmoothingEnabled,B=L===void 0?!0:L,T=n.imageSmoothingQuality,R=T===void 0?"low":T,S=n.maxWidth,j=S===void 0?1/0:S,Y=n.maxHeight,Z=Y===void 0?1/0:Y,ee=n.minWidth,ne=ee===void 0?0:ee,M=n.minHeight,O=M===void 0?0:M,C=document.createElement("canvas"),H=C.getContext("2d"),F=we({aspectRatio:D,width:j,height:Z}),Q=we({aspectRatio:D,width:ne,height:O},"cover"),W=Math.min(F.width,Math.max(Q.width,_)),Je=Math.min(F.height,Math.max(Q.height,k)),ut=we({aspectRatio:s,width:j,height:Z}),mt=we({aspectRatio:s,width:ne,height:O},"cover"),ft=Math.min(ut.width,Math.max(mt.width,a)),Oe=Math.min(ut.height,Math.max(mt.height,l)),Xt=[-ft/2,-Oe/2,ft,Oe];return C.width=Be(W),C.height=Be(Je),H.fillStyle=P,H.fillRect(0,0,W,Je),H.save(),H.translate(W/2,Je/2),H.rotate(p*Math.PI/180),H.scale(h,b),H.imageSmoothingEnabled=B,H.imageSmoothingQuality=R,H.drawImage.apply(H,[r].concat(Ir(Xt.map(function(Le){return Math.floor(Be(Le))})))),H.restore(),C}var co=String.fromCharCode;function kl(r,t,o){var n="";o+=t;for(var s=t;s<o;s+=1)n+=co(r.getUint8(s));return n}var xl=/^data:.*,/;function Sl(r){var t=r.replace(xl,""),o=atob(t),n=new ArrayBuffer(o.length),s=new Uint8Array(n);return q(s,function(a,l){s[l]=o.charCodeAt(l)}),n}function El(r,t){for(var o=[],n=8192,s=new Uint8Array(r);s.length>0;)o.push(co.apply(null,oo(s.subarray(0,n)))),s=s.subarray(n);return"data:".concat(t,";base64,").concat(btoa(o.join("")))}function Dl(r){var t=new DataView(r),o;try{var n,s,a;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var l=t.byteLength,m=2;m+1<l;){if(t.getUint8(m)===255&&t.getUint8(m+1)===225){s=m;break}m+=1}if(s){var p=s+4,f=s+10;if(kl(t,p,4)==="Exif"){var h=t.getUint16(f);if(n=h===18761,(n||h===19789)&&t.getUint16(f+2,n)===42){var y=t.getUint32(f+4,n);y>=8&&(a=f+y)}}}if(a){var b=t.getUint16(a,n),D,_;for(_=0;_<b;_+=1)if(D=a+_*12+2,t.getUint16(D,n)===274){D+=8,o=t.getUint16(D,n),t.setUint16(D,1,n);break}}}catch{o=1}return o}function Nl(r){var t=0,o=1,n=1;switch(r){case 2:o=-1;break;case 3:t=-180;break;case 4:n=-1;break;case 5:t=90,n=-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:n}}var Cl={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,o=this.options,n=this.container,s=this.cropper,a=Number(o.minContainerWidth),l=Number(o.minContainerHeight);J(s,re),me(t,re);var m={width:Math.max(n.offsetWidth,a>=0?a:Qr),height:Math.max(n.offsetHeight,l>=0?l:eo)};this.containerData=m,ve(s,{width:m.width,height:m.height}),J(t,re),me(s,re)},initCanvas:function(){var t=this.containerData,o=this.imageData,n=this.options.viewMode,s=Math.abs(o.rotate)%180===90,a=s?o.naturalHeight:o.naturalWidth,l=s?o.naturalWidth:o.naturalHeight,m=a/l,p=t.width,f=t.height;t.height*m>t.width?n===3?p=t.height*m:f=t.width/m:n===3?f=t.width/m:p=t.height*m;var h={aspectRatio:m,naturalWidth:a,naturalHeight:l,width:p,height:f};this.canvasData=h,this.limited=n===1||n===2,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(t.width-h.width)/2,h.top=(t.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=K({},h)},limitCanvas:function(t,o){var n=this.options,s=this.containerData,a=this.canvasData,l=this.cropBoxData,m=n.viewMode,p=a.aspectRatio,f=this.cropped&&l;if(t){var h=Number(n.minCanvasWidth)||0,y=Number(n.minCanvasHeight)||0;m>1?(h=Math.max(h,s.width),y=Math.max(y,s.height),m===3&&(y*p>h?h=y*p:y=h/p)):m>0&&(h?h=Math.max(h,f?l.width:0):y?y=Math.max(y,f?l.height:0):f&&(h=l.width,y=l.height,y*p>h?h=y*p:y=h/p));var b=we({aspectRatio:p,width:h,height:y});h=b.width,y=b.height,a.minWidth=h,a.minHeight=y,a.maxWidth=1/0,a.maxHeight=1/0}if(o)if(m>(f?0:1)){var D=s.width-a.width,_=s.height-a.height;a.minLeft=Math.min(0,D),a.minTop=Math.min(0,_),a.maxLeft=Math.max(0,D),a.maxTop=Math.max(0,_),f&&this.limited&&(a.minLeft=Math.min(l.left,l.left+(l.width-a.width)),a.minTop=Math.min(l.top,l.top+(l.height-a.height)),a.maxLeft=l.left,a.maxTop=l.top,m===2&&(a.width>=s.width&&(a.minLeft=Math.min(0,D),a.maxLeft=Math.max(0,D)),a.height>=s.height&&(a.minTop=Math.min(0,_),a.maxTop=Math.max(0,_))))}else a.minLeft=-a.width,a.minTop=-a.height,a.maxLeft=s.width,a.maxTop=s.height},renderCanvas:function(t,o){var n=this.canvasData,s=this.imageData;if(o){var a=wl({width:s.naturalWidth*Math.abs(s.scaleX||1),height:s.naturalHeight*Math.abs(s.scaleY||1),degree:s.rotate||0}),l=a.width,m=a.height,p=n.width*(l/n.naturalWidth),f=n.height*(m/n.naturalHeight);n.left-=(p-n.width)/2,n.top-=(f-n.height)/2,n.width=p,n.height=f,n.aspectRatio=l/m,n.naturalWidth=l,n.naturalHeight=m,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,ve(this.canvas,K({width:n.width,height:n.height},Ge({translateX:n.left,translateY:n.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var o=this.canvasData,n=this.imageData,s=n.naturalWidth*(o.width/o.naturalWidth),a=n.naturalHeight*(o.height/o.naturalHeight);K(n,{width:s,height:a,left:(o.width-s)/2,top:(o.height-a)/2}),ve(this.image,K({width:n.width,height:n.height},Ge(K({translateX:n.left,translateY:n.top},n)))),t&&this.output()},initCropBox:function(){var t=this.options,o=this.canvasData,n=t.aspectRatio||t.initialAspectRatio,s=Number(t.autoCropArea)||.8,a={width:o.width,height:o.height};n&&(o.height*n>o.width?a.height=a.width/n:a.width=a.height*n),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*s),a.height=Math.max(a.minHeight,a.height*s),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=K({},a)},limitCropBox:function(t,o){var n=this.options,s=this.containerData,a=this.canvasData,l=this.cropBoxData,m=this.limited,p=n.aspectRatio;if(t){var f=Number(n.minCropBoxWidth)||0,h=Number(n.minCropBoxHeight)||0,y=m?Math.min(s.width,a.width,a.width+a.left,s.width-a.left):s.width,b=m?Math.min(s.height,a.height,a.height+a.top,s.height-a.top):s.height;f=Math.min(f,s.width),h=Math.min(h,s.height),p&&(f&&h?h*p>f?h=f/p:f=h*p:f?h=f/p:h&&(f=h*p),b*p>y?b=y/p:y=b*p),l.minWidth=Math.min(f,y),l.minHeight=Math.min(h,b),l.maxWidth=y,l.maxHeight=b}o&&(m?(l.minLeft=Math.max(0,a.left),l.minTop=Math.max(0,a.top),l.maxLeft=Math.min(s.width,a.left+a.width)-l.width,l.maxTop=Math.min(s.height,a.top+a.height)-l.height):(l.minLeft=0,l.minTop=0,l.maxLeft=s.width-l.width,l.maxTop=s.height-l.height))},renderCropBox:function(){var t=this.options,o=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,t.movable&&t.cropBoxMovable&&qe(this.face,Xe,n.width>=o.width&&n.height>=o.height?Pr:At),ve(this.cropBox,K({width:n.width,height:n.height},Ge({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Ae(this.element,jt,this.getData())}},Vl={initPreview:function(){var t=this.element,o=this.crossOrigin,n=this.options.preview,s=o?this.crossOriginUrl:this.url,a=t.alt||"The image to preview",l=document.createElement("img");if(o&&(l.crossOrigin=o),l.src=s,l.alt=a,this.viewBox.appendChild(l),this.viewBoxImage=l,!!n){var m=n;typeof n=="string"?m=t.ownerDocument.querySelectorAll(n):n.querySelector&&(m=[n]),this.previews=m,q(m,function(p){var f=document.createElement("img");qe(p,dt,{width:p.offsetWidth,height:p.offsetHeight,html:p.innerHTML}),o&&(f.crossOrigin=o),f.src=s,f.alt=a,f.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;"',p.innerHTML="",p.appendChild(f)})}},resetPreview:function(){q(this.previews,function(t){var o=Kt(t,dt);ve(t,{width:o.width,height:o.height}),t.innerHTML=o.html,gl(t,dt)})},preview:function(){var t=this.imageData,o=this.canvasData,n=this.cropBoxData,s=n.width,a=n.height,l=t.width,m=t.height,p=n.left-o.left-t.left,f=n.top-o.top-t.top;!this.cropped||this.disabled||(ve(this.viewBoxImage,K({width:l,height:m},Ge(K({translateX:-p,translateY:-f},t)))),q(this.previews,function(h){var y=Kt(h,dt),b=y.width,D=y.height,_=b,k=D,$=1;s&&($=b/s,k=a*$),a&&k>D&&($=D/a,_=s*$,k=D),ve(h,{width:_,height:k}),ve(h.getElementsByTagName("img")[0],K({width:l*$,height:m*$},Ge(K({translateX:-p*$,translateY:-f*$},t))))}))}},$l={bind:function(){var t=this.element,o=this.options,n=this.cropper;oe(o.cropstart)&&ie(t,Rt,o.cropstart),oe(o.cropmove)&&ie(t,zt,o.cropmove),oe(o.cropend)&&ie(t,Pt,o.cropend),oe(o.crop)&&ie(t,jt,o.crop),oe(o.zoom)&&ie(t,Ht,o.zoom),ie(n,Yr,this.onCropStart=this.cropStart.bind(this)),o.zoomable&&o.zoomOnWheel&&ie(n,Jr,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),o.toggleDragModeOnDblclick&&ie(n,Kr,this.onDblclick=this.dblclick.bind(this)),ie(t.ownerDocument,Wr,this.onCropMove=this.cropMove.bind(this)),ie(t.ownerDocument,Xr,this.onCropEnd=this.cropEnd.bind(this)),o.responsive&&ie(window,Gr,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,o=this.options,n=this.cropper;oe(o.cropstart)&&se(t,Rt,o.cropstart),oe(o.cropmove)&&se(t,zt,o.cropmove),oe(o.cropend)&&se(t,Pt,o.cropend),oe(o.crop)&&se(t,jt,o.crop),oe(o.zoom)&&se(t,Ht,o.zoom),se(n,Yr,this.onCropStart),o.zoomable&&o.zoomOnWheel&&se(n,Jr,this.onWheel,{passive:!1,capture:!0}),o.toggleDragModeOnDblclick&&se(n,Kr,this.onDblclick),se(t.ownerDocument,Wr,this.onCropMove),se(t.ownerDocument,Xr,this.onCropEnd),o.responsive&&se(window,Gr,this.onResize)}},Ml={resize:function(){if(!this.disabled){var t=this.options,o=this.container,n=this.containerData,s=o.offsetWidth/n.width,a=o.offsetHeight/n.height,l=Math.abs(s-1)>Math.abs(a-1)?s:a;if(l!==1){var m,p;t.restore&&(m=this.getCanvasData(),p=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(q(m,function(f,h){m[h]=f*l})),this.setCropBoxData(q(p,function(f,h){p[h]=f*l})))}}},dblclick:function(){this.disabled||this.options.dragMode===Ur||this.setDragMode(fl(this.dragBox,Ot)?Fr:It)},wheel:function(t){var o=this,n=Number(this.options.wheelZoomRatio)||.1,s=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){o.wheeling=!1},50),t.deltaY?s=t.deltaY>0?1:-1:t.wheelDelta?s=-t.wheelDelta/120:t.detail&&(s=t.detail>0?1:-1),this.zoom(-s*n,t)))},cropStart:function(t){var o=t.buttons,n=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(z(o)&&o!==1||z(n)&&n!==0||t.ctrlKey))){var s=this.options,a=this.pointers,l;t.changedTouches?q(t.changedTouches,function(m){a[m.identifier]=ht(m)}):a[t.pointerId||0]=ht(t),Object.keys(a).length>1&&s.zoomable&&s.zoomOnTouch?l=zr:l=Kt(t.target,Xe),!!nl.test(l)&&Ae(this.element,Rt,{originalEvent:t,action:l})!==!1&&(t.preventDefault(),this.action=l,this.cropping=!1,l===jr&&(this.cropping=!0,J(this.dragBox,ct)))}},cropMove:function(t){var o=this.action;if(!(this.disabled||!o)){var n=this.pointers;t.preventDefault(),Ae(this.element,zt,{originalEvent:t,action:o})!==!1&&(t.changedTouches?q(t.changedTouches,function(s){K(n[s.identifier]||{},ht(s,!0))}):K(n[t.pointerId||0]||{},ht(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var o=this.action,n=this.pointers;t.changedTouches?q(t.changedTouches,function(s){delete n[s.identifier]}):delete n[t.pointerId||0],o&&(t.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,Te(this.dragBox,ct,this.cropped&&this.options.modal)),Ae(this.element,Pt,{originalEvent:t,action:o}))}}},Bl={change:function(t){var o=this.options,n=this.canvasData,s=this.containerData,a=this.cropBoxData,l=this.pointers,m=this.action,p=o.aspectRatio,f=a.left,h=a.top,y=a.width,b=a.height,D=f+y,_=h+b,k=0,$=0,P=s.width,L=s.height,B=!0,T;!p&&t.shiftKey&&(p=y&&b?y/b:1),this.limited&&(k=a.minLeft,$=a.minTop,P=k+Math.min(s.width,n.width,n.left+n.width),L=$+Math.min(s.height,n.height,n.top+n.height));var R=l[Object.keys(l)[0]],S={x:R.endX-R.startX,y:R.endY-R.startY},j=function(Z){switch(Z){case Ee:D+S.x>P&&(S.x=P-D);break;case De:f+S.x<k&&(S.x=k-f);break;case be:h+S.y<$&&(S.y=$-h);break;case $e:_+S.y>L&&(S.y=L-_);break}};switch(m){case At:f+=S.x,h+=S.y;break;case Ee:if(S.x>=0&&(D>=P||p&&(h<=$||_>=L))){B=!1;break}j(Ee),y+=S.x,y<0&&(m=De,y=-y,f-=y),p&&(b=y/p,h+=(a.height-b)/2);break;case be:if(S.y<=0&&(h<=$||p&&(f<=k||D>=P))){B=!1;break}j(be),b-=S.y,h+=S.y,b<0&&(m=$e,b=-b,h-=b),p&&(y=b*p,f+=(a.width-y)/2);break;case De:if(S.x<=0&&(f<=k||p&&(h<=$||_>=L))){B=!1;break}j(De),y-=S.x,f+=S.x,y<0&&(m=Ee,y=-y,f-=y),p&&(b=y/p,h+=(a.height-b)/2);break;case $e:if(S.y>=0&&(_>=L||p&&(f<=k||D>=P))){B=!1;break}j($e),b+=S.y,b<0&&(m=be,b=-b,h-=b),p&&(y=b*p,f+=(a.width-y)/2);break;case Ue:if(p){if(S.y<=0&&(h<=$||D>=P)){B=!1;break}j(be),b-=S.y,h+=S.y,y=b*p}else j(be),j(Ee),S.x>=0?D<P?y+=S.x:S.y<=0&&h<=$&&(B=!1):y+=S.x,S.y<=0?h>$&&(b-=S.y,h+=S.y):(b-=S.y,h+=S.y);y<0&&b<0?(m=We,b=-b,y=-y,h-=b,f-=y):y<0?(m=Ke,y=-y,f-=y):b<0&&(m=Ye,b=-b,h-=b);break;case Ke:if(p){if(S.y<=0&&(h<=$||f<=k)){B=!1;break}j(be),b-=S.y,h+=S.y,y=b*p,f+=a.width-y}else j(be),j(De),S.x<=0?f>k?(y-=S.x,f+=S.x):S.y<=0&&h<=$&&(B=!1):(y-=S.x,f+=S.x),S.y<=0?h>$&&(b-=S.y,h+=S.y):(b-=S.y,h+=S.y);y<0&&b<0?(m=Ye,b=-b,y=-y,h-=b,f-=y):y<0?(m=Ue,y=-y,f-=y):b<0&&(m=We,b=-b,h-=b);break;case We:if(p){if(S.x<=0&&(f<=k||_>=L)){B=!1;break}j(De),y-=S.x,f+=S.x,b=y/p}else j($e),j(De),S.x<=0?f>k?(y-=S.x,f+=S.x):S.y>=0&&_>=L&&(B=!1):(y-=S.x,f+=S.x),S.y>=0?_<L&&(b+=S.y):b+=S.y;y<0&&b<0?(m=Ue,b=-b,y=-y,h-=b,f-=y):y<0?(m=Ye,y=-y,f-=y):b<0&&(m=Ke,b=-b,h-=b);break;case Ye:if(p){if(S.x>=0&&(D>=P||_>=L)){B=!1;break}j(Ee),y+=S.x,b=y/p}else j($e),j(Ee),S.x>=0?D<P?y+=S.x:S.y>=0&&_>=L&&(B=!1):y+=S.x,S.y>=0?_<L&&(b+=S.y):b+=S.y;y<0&&b<0?(m=Ke,b=-b,y=-y,h-=b,f-=y):y<0?(m=We,y=-y,f-=y):b<0&&(m=Ue,b=-b,h-=b);break;case Pr:this.move(S.x,S.y),B=!1;break;case zr:this.zoom(bl(l),t),B=!1;break;case jr:if(!S.x||!S.y){B=!1;break}T=io(this.cropper),f=R.startX-T.left,h=R.startY-T.top,y=a.minWidth,b=a.minHeight,S.x>0?m=S.y>0?Ye:Ue:S.x<0&&(f-=y,m=S.y>0?We:Ke),S.y<0&&(h-=b),this.cropped||(me(this.cropBox,re),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}B&&(a.width=y,a.height=b,a.left=f,a.top=h,this.action=m,this.renderCropBox()),q(l,function(Y){Y.startX=Y.endX,Y.startY=Y.endY})}},Tl={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&J(this.dragBox,ct),me(this.cropBox,re),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=K({},this.initialImageData),this.canvasData=K({},this.initialCanvasData),this.cropBoxData=K({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(K(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),me(this.dragBox,ct),J(this.cropBox,re)),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,q(this.previews,function(n){n.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,me(this.cropper,Rr)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,J(this.cropper,Rr)),this},destroy:function(){var t=this.element;return t[U]?(t[U]=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,n=this.canvasData,s=n.left,a=n.top;return this.moveTo(Ft(t)?t:s+Number(t),Ft(o)?o:a+Number(o))},moveTo:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,n=this.canvasData,s=!1;return t=Number(t),o=Number(o),this.ready&&!this.disabled&&this.options.movable&&(z(t)&&(n.left=t,s=!0),z(o)&&(n.top=o,s=!0),s&&this.renderCanvas(!0)),this},zoom:function(t,o){var n=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(n.width*t/n.naturalWidth,null,o)},zoomTo:function(t,o,n){var s=this.options,a=this.canvasData,l=a.width,m=a.height,p=a.naturalWidth,f=a.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&s.zoomable){var h=p*t,y=f*t;if(Ae(this.element,Ht,{ratio:t,oldRatio:l/p,originalEvent:n})===!1)return this;if(n){var b=this.pointers,D=io(this.cropper),_=b&&Object.keys(b).length?vl(b):{pageX:n.pageX,pageY:n.pageY};a.left-=(h-l)*((_.pageX-D.left-a.left)/l),a.top-=(y-m)*((_.pageY-D.top-a.top)/m)}else Me(o)&&z(o.x)&&z(o.y)?(a.left-=(h-l)*((o.x-a.left)/l),a.top-=(y-m)*((o.y-a.top)/m)):(a.left-=(h-l)/2,a.top-=(y-m)/2);a.width=h,a.height=y,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),z(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var o=this.imageData.scaleY;return this.scale(t,z(o)?o:1)},scaleY:function(t){var o=this.imageData.scaleX;return this.scale(z(o)?o:1,t)},scale:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,n=this.imageData,s=!1;return t=Number(t),o=Number(o),this.ready&&!this.disabled&&this.options.scalable&&(z(t)&&(n.scaleX=t,s=!0),z(o)&&(n.scaleY=o,s=!0),s&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=this.options,n=this.imageData,s=this.canvasData,a=this.cropBoxData,l;if(this.ready&&this.cropped){l={x:a.left-s.left,y:a.top-s.top,width:a.width,height:a.height};var m=n.width/n.naturalWidth;if(q(l,function(h,y){l[y]=h/m}),t){var p=Math.round(l.y+l.height),f=Math.round(l.x+l.width);l.x=Math.round(l.x),l.y=Math.round(l.y),l.width=f-l.x,l.height=p-l.y}}else l={x:0,y:0,width:0,height:0};return o.rotatable&&(l.rotate=n.rotate||0),o.scalable&&(l.scaleX=n.scaleX||1,l.scaleY=n.scaleY||1),l},setData:function(t){var o=this.options,n=this.imageData,s=this.canvasData,a={};if(this.ready&&!this.disabled&&Me(t)){var l=!1;o.rotatable&&z(t.rotate)&&t.rotate!==n.rotate&&(n.rotate=t.rotate,l=!0),o.scalable&&(z(t.scaleX)&&t.scaleX!==n.scaleX&&(n.scaleX=t.scaleX,l=!0),z(t.scaleY)&&t.scaleY!==n.scaleY&&(n.scaleY=t.scaleY,l=!0)),l&&this.renderCanvas(!0,!0);var m=n.width/n.naturalWidth;z(t.x)&&(a.left=t.x*m+s.left),z(t.y)&&(a.top=t.y*m+s.top),z(t.width)&&(a.width=t.width*m),z(t.height)&&(a.height=t.height*m),this.setCropBoxData(a)}return this},getContainerData:function(){return this.ready?K({},this.containerData):{}},getImageData:function(){return this.sized?K({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,o={};return this.ready&&q(["left","top","width","height","naturalWidth","naturalHeight"],function(n){o[n]=t[n]}),o},setCanvasData:function(t){var o=this.canvasData,n=o.aspectRatio;return this.ready&&!this.disabled&&Me(t)&&(z(t.left)&&(o.left=t.left),z(t.top)&&(o.top=t.top),z(t.width)?(o.width=t.width,o.height=t.width/n):z(t.height)&&(o.height=t.height,o.width=t.height*n),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,n=this.options.aspectRatio,s,a;return this.ready&&this.cropped&&!this.disabled&&Me(t)&&(z(t.left)&&(o.left=t.left),z(t.top)&&(o.top=t.top),z(t.width)&&t.width!==o.width&&(s=!0,o.width=t.width),z(t.height)&&t.height!==o.height&&(a=!0,o.height=t.height),n&&(s?o.height=o.width/n:a&&(o.width=o.height*n)),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,n=_l(this.image,this.imageData,o,t);if(!this.cropped)return n;var s=this.getData(),a=s.x,l=s.y,m=s.width,p=s.height,f=n.width/Math.floor(o.naturalWidth);f!==1&&(a*=f,l*=f,m*=f,p*=f);var h=m/p,y=we({aspectRatio:h,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),b=we({aspectRatio:h,width:t.minWidth||0,height:t.minHeight||0},"cover"),D=we({aspectRatio:h,width:t.width||(f!==1?n.width:m),height:t.height||(f!==1?n.height:p)}),_=D.width,k=D.height;_=Math.min(y.width,Math.max(b.width,_)),k=Math.min(y.height,Math.max(b.height,k));var $=document.createElement("canvas"),P=$.getContext("2d");$.width=Be(_),$.height=Be(k),P.fillStyle=t.fillColor||"transparent",P.fillRect(0,0,_,k);var L=t.imageSmoothingEnabled,B=L===void 0?!0:L,T=t.imageSmoothingQuality;P.imageSmoothingEnabled=B,T&&(P.imageSmoothingQuality=T);var R=n.width,S=n.height,j=a,Y=l,Z,ee,ne,M,O,C;j<=-m||j>R?(j=0,Z=0,ne=0,O=0):j<=0?(ne=-j,j=0,Z=Math.min(R,m+j),O=Z):j<=R&&(ne=0,Z=Math.min(m,R-j),O=Z),Z<=0||Y<=-p||Y>S?(Y=0,ee=0,M=0,C=0):Y<=0?(M=-Y,Y=0,ee=Math.min(S,p+Y),C=ee):Y<=S&&(M=0,ee=Math.min(p,S-Y),C=ee);var H=[j,Y,Z,ee];if(O>0&&C>0){var F=_/m;H.push(ne*F,M*F,O*F,C*F)}return P.drawImage.apply(P,[n].concat(Ir(H.map(function(Q){return Math.floor(Be(Q))})))),$},setAspectRatio:function(t){var o=this.options;return!this.disabled&&!Ft(t)&&(o.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var o=this.options,n=this.dragBox,s=this.face;if(this.ready&&!this.disabled){var a=t===It,l=o.movable&&t===Fr;t=a||l?t:Ur,o.dragMode=t,qe(n,Xe,t),Te(n,Ot,a),Te(n,Lt,l),o.cropBoxMovable||(qe(s,Xe,t),Te(s,Ot,a),Te(s,Lt,l))}return this}},Al=ue.Cropper,ho=function(){function r(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ws(this,r),!t||!sl.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=K({},to,Me(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 Xs(r,[{key:"init",value:function(){var o=this.element,n=o.tagName.toLowerCase(),s;if(!o[U]){if(o[U]=this,n==="img"){if(this.isImg=!0,s=o.getAttribute("src")||"",this.originalUrl=s,!s)return;s=o.src}else n==="canvas"&&window.HTMLCanvasElement&&(s=o.toDataURL());this.load(s)}}},{key:"load",value:function(o){var n=this;if(!!o){this.url=o,this.imageData={};var s=this.element,a=this.options;if(!a.rotatable&&!a.scalable&&(a.checkOrientation=!1),!a.checkOrientation||!window.ArrayBuffer){this.clone();return}if(al.test(o)){il.test(o)?this.read(Sl(o)):this.clone();return}var l=new XMLHttpRequest,m=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=m,l.onerror=m,l.ontimeout=m,l.onprogress=function(){l.getResponseHeader("content-type")!==Zr&&l.abort()},l.onload=function(){n.read(l.response)},l.onloadend=function(){n.reloading=!1,n.xhr=null},a.checkCrossOrigin&&so(o)&&s.crossOrigin&&(o=lo(o)),l.open("GET",o,!0),l.responseType="arraybuffer",l.withCredentials=s.crossOrigin==="use-credentials",l.send()}}},{key:"read",value:function(o){var n=this.options,s=this.imageData,a=Dl(o),l=0,m=1,p=1;if(a>1){this.url=El(o,Zr);var f=Nl(a);l=f.rotate,m=f.scaleX,p=f.scaleY}n.rotatable&&(s.rotate=l),n.scalable&&(s.scaleX=m,s.scaleY=p),this.clone()}},{key:"clone",value:function(){var o=this.element,n=this.url,s=o.crossOrigin,a=n;this.options.checkCrossOrigin&&so(n)&&(s||(s="anonymous"),a=lo(n)),this.crossOrigin=s,this.crossOriginUrl=a;var l=document.createElement("img");s&&(l.crossOrigin=s),l.src=a||n,l.alt=o.alt||"The image to crop",this.image=l,l.onload=this.start.bind(this),l.onerror=this.stop.bind(this),J(l,Hr),o.parentNode.insertBefore(l,o.nextSibling)}},{key:"start",value:function(){var o=this,n=this.image;n.onload=null,n.onerror=null,this.sizing=!0;var s=ue.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ue.navigator.userAgent),a=function(f,h){K(o.imageData,{naturalWidth:f,naturalHeight:h,aspectRatio:f/h}),o.initialImageData=K({},o.imageData),o.sizing=!1,o.sized=!0,o.build()};if(n.naturalWidth&&!s){a(n.naturalWidth,n.naturalHeight);return}var l=document.createElement("img"),m=document.body||document.documentElement;this.sizingImage=l,l.onload=function(){a(l.width,l.height),s||m.removeChild(l)},l.src=n.src,s||(l.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",m.appendChild(l))}},{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,n=this.options,s=this.image,a=o.parentNode,l=document.createElement("div");l.innerHTML=ll;var m=l.querySelector(".".concat(U,"-container")),p=m.querySelector(".".concat(U,"-canvas")),f=m.querySelector(".".concat(U,"-drag-box")),h=m.querySelector(".".concat(U,"-crop-box")),y=h.querySelector(".".concat(U,"-face"));this.container=a,this.cropper=m,this.canvas=p,this.dragBox=f,this.cropBox=h,this.viewBox=m.querySelector(".".concat(U,"-view-box")),this.face=y,p.appendChild(s),J(o,re),a.insertBefore(m,o.nextSibling),this.isImg||me(s,Hr),this.initPreview(),this.bind(),n.initialAspectRatio=Math.max(0,n.initialAspectRatio)||NaN,n.aspectRatio=Math.max(0,n.aspectRatio)||NaN,n.viewMode=Math.max(0,Math.min(3,Math.round(n.viewMode)))||0,J(h,re),n.guides||J(h.getElementsByClassName("".concat(U,"-dashed")),re),n.center||J(h.getElementsByClassName("".concat(U,"-center")),re),n.background&&J(m,"".concat(U,"-bg")),n.highlight||J(y,el),n.cropBoxMovable&&(J(y,Lt),qe(y,Xe,At)),n.cropBoxResizable||(J(h.getElementsByClassName("".concat(U,"-line")),re),J(h.getElementsByClassName("".concat(U,"-point")),re)),this.render(),this.ready=!0,this.setDragMode(n.dragMode),n.autoCrop&&this.crop(),this.setData(n.data),oe(n.ready)&&ie(o,qr,n.ready,{once:!0}),Ae(o,qr)}}},{key:"unbuild",value:function(){!this.ready||(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),me(this.element,re))}},{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=Al,r}},{key:"setDefaults",value:function(o){K(to,Me(o)&&o)}}]),r}();K(ho.prototype,Cl,Vl,$l,Ml,Bl,Tl);const Ol={class:"flex"},Ll=["aria-label"],Il={class:"ml-auto mb-2"},jl={class:"w-full flex justify-center"},Pl=["src"],zl={__name:"Image",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const o=r,{t:n}=e.inject("i18n"),{apiUrl:s}=le(),a=e.ref(null),l=e.ref(null),m=e.ref(!1),p=e.ref(""),f=e.ref(!1),h=()=>{m.value=!m.value,m.value?l.value=new ho(a.value,{crop(D){}}):l.value.destroy()},y=e.inject("postData"),b=()=>{l.value.getCroppedCanvas({width:795,height:341}).toBlob(D=>{p.value="",f.value=!1,et(s.value,{method:"POST",params:Object.assign(y,{q:"upload",adapter:o.selection.adapter,path:o.selection.item.path,file:D}),name:o.selection.item.basename,json:!1}).then(_=>{p.value=n("Updated."),a.value.src=bt(o.selection.adapter,o.selection.item.path),h(),t("load")}).catch(_=>{p.value=n(_.message),f.value=!0})})};return e.onMounted(()=>{t("load")}),(D,_)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ol,[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,Ll),e.createElementVNode("div",Il,[m.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:b,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(n)("Crop")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:_[0]||(_[0]=k=>h())},e.toDisplayString(m.value?e.unref(n)("Cancel"):e.unref(n)("Edit")),1)])]),e.createElementVNode("div",jl,[e.createElementVNode("img",{ref_key:"image",ref:a,class:"max-w-[60vh] max-h-[60vh]",src:e.unref(bt)(o.selection.adapter,o.selection.item.path),alt:""},null,8,Pl)]),p.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:_[1]||(_[1]=k=>p.value=""),error:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},Rl={class:"flex"},Hl=["aria-label"],Fl=e.createElementVNode("div",null,null,-1),Ul={__name:"Default",props:{selection:Object},emits:["load"],setup(r,{emit:t}){return e.onMounted(()=>{t("load")}),(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Rl,[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,Hl)]),Fl],64))}},Kl=["aria-label"],Yl={class:"w-full",preload:"",controls:""},Wl=["src"],Xl=e.createTextVNode(" Your browser does not support the video tag. "),ql={__name:"Video",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const o=r,{apiUrl:n}=le(),s=()=>n.value+"?"+ke({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(a,l)=>(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,Kl),e.createElementVNode("div",null,[e.createElementVNode("video",Yl,[e.createElementVNode("source",{src:s(),type:"video/mp4"},null,8,Wl),Xl])])],64))}},Gl=["aria-label"],Jl={class:"w-full",controls:""},Zl=["src"],Ql=e.createTextVNode(" Your browser does not support the audio element. "),ec={__name:"Audio",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const o=r,{apiUrl:n}=le(),s=()=>n.value+"?"+ke({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(a,l)=>(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,Gl),e.createElementVNode("div",null,[e.createElementVNode("audio",Jl,[e.createElementVNode("source",{src:s(),type:"audio/mpeg"},null,8,Zl),Ql])])],64))}},tc=["aria-label"],rc=["data"],oc=["src"],nc={__name:"Pdf",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const o=r,{apiUrl:n}=le(),s=()=>n.value+"?"+ke({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(a,l)=>(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,tc),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:s(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:s(),width:"100%",height:"100%"},`
|
|
13
13
|
<p>
|
|
14
14
|
Your browser does not support PDFs.
|
|
15
15
|
<a href="https://example.com/test.pdf">Download the PDF</a>
|
|
16
16
|
.
|
|
17
17
|
</p>
|
|
18
|
-
`,8,zi)],8,Ii)])],64))}},Hi={class:"sm:flex sm:items-start"},Ui={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},Fi={class:"text-gray-700 dark:text-gray-200 text-sm"},Ki={key:0,class:"flex leading-5"},Yi=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),Wi=Object.assign({name:"VFModalPreview"},{props:{selection:Object},setup(i){const t=i,{apiUrl:r}=ie(),o=e.inject("emitter"),{t:s}=e.inject("i18n"),a=e.ref(!1),l=f=>a.value=f,m=f=>{var u;return((u=t.selection.item.mime_type)!=null?u:"").startsWith(f)},p=()=>{const f=r.value+"?"+pe({q:"download",adapter:t.selection.adapter,path:t.selection.item.path});o.emit("vf-download",f)};return(f,u)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:u[6]||(u[6]=y=>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(s)("Close")),1),e.createElementVNode("button",{type:"button",onClick:u[7]||(u[7]=y=>p()),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Download")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Hi,[e.createElementVNode("div",Ui,[e.createElementVNode("div",null,[m("text")?(e.openBlock(),e.createBlock($a,{key:0,selection:i.selection,onLoad:u[0]||(u[0]=y=>l(!0))},null,8,["selection"])):m("image")?(e.openBlock(),e.createBlock(Si,{key:1,selection:i.selection,onLoad:u[1]||(u[1]=y=>l(!0))},null,8,["selection"])):m("video")?(e.openBlock(),e.createBlock(Bi,{key:2,selection:i.selection,onLoad:u[2]||(u[2]=y=>l(!0))},null,8,["selection"])):m("audio")?(e.openBlock(),e.createBlock(Pi,{key:3,selection:i.selection,onLoad:u[3]||(u[3]=y=>l(!0))},null,8,["selection"])):m("application/pdf")?(e.openBlock(),e.createBlock(Ri,{key:4,selection:i.selection,onLoad:u[4]||(u[4]=y=>l(!0))},null,8,["selection"])):(e.openBlock(),e.createBlock(Ni,{key:5,selection:i.selection,onLoad:u[5]||(u[5]=y=>l(!0))},null,8,["selection"]))]),e.createElementVNode("div",Fi,[e.createElementVNode("p",null,e.toDisplayString(i.selection.item.path),1),e.createElementVNode("p",null,"mime_type: "+e.toDisplayString(i.selection.item.mime_type),1),a.value==!1?(e.openBlock(),e.createElementBlock("div",Ki,[Yi,e.createElementVNode("span",null,e.toDisplayString(e.unref(s)("Loading")),1)])):e.createCommentVNode("",!0)])])])]),_:1}))}}),Xi={class:"sm:flex sm:items-start"},qi=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),Gi={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ji={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Zi={class:"mt-2"},Qi={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},es={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"},ts=[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={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"},ns=[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)],os={class:"ml-1.5"},as=["onKeyup"],is=Object.assign({name:"VFModalRename"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:o}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(t.selection.items[0]),l=e.ref(t.selection.items[0].basename),m=e.ref(""),p=()=>{l.value!=""&&r.emit("vf-fetch",{params:{q:"rename",adapter:o("adapter","local"),path:t.current.dirname,item:a.value.path,name:l.value},onSuccess:()=>{r.emit("vf-toast-push",{label:s("%s is renamed.",l.value)})},onError:f=>{m.value=s(f.message)}})};return(f,u)=>(e.openBlock(),e.createBlock(se,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(s)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:u[1]||(u[1]=y=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Xi,[qi,e.createElementVNode("div",Gi,[e.createElementVNode("h3",Ji,e.toDisplayString(e.unref(s)("Rename")),1),e.createElementVNode("div",Zi,[e.createElementVNode("p",Qi,[a.value.type=="dir"?(e.openBlock(),e.createElementBlock("svg",es,ts)):(e.openBlock(),e.createElementBlock("svg",rs,ns)),e.createElementVNode("span",os,e.toDisplayString(a.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=y=>l.value=y),onKeyup:e.withKeys(p,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,40,as),[[e.vModelText,l.value]]),m.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ss={class:"sm:flex sm:items-start"},ls=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),cs={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},ds={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},hs={class:"mt-2"},us={class:"text-gray-500 mb-1"},ms=["id"],fs={key:0,class:"py-2"},ps=["disabled","onClick"],gs=Object.assign({name:"VFModalUpload"},{props:{current:Object},setup(i){const t=i,r=e.inject("emitter"),{apiUrl:o}=ie(),{t:s}=e.inject("i18n"),a=e.ref(null),l=e.ref(null),m=e.ref(null),p=e.ref([]),f=e.ref(""),u=e.ref(!0),y=()=>{f.value="",a.value.start()},b=e.inject("postData");return e.onMounted(()=>{a.value=new Ge.default.Uploader({runtimes:"html5",browse_button:m.value,container:l.value,max_file_size:"10mb",multiple_queues:!0,file_data_name:"file",url:o.value+"?"+pe(Object.assign(b,{q:"upload",adapter:t.current.adapter,path:t.current.dirname})),init:{PostInit:function(){},FilesAdded:function(E,k){u.value=!1,Ge.default.each(k,function(S){p.value.push({id:S.id,name:S.name,size:Ge.default.formatSize(S.size),percent:""})})},UploadProgress:function(E,k){p.value[p.value.findIndex(S=>S.id==k.id)].percent=k.percent+"%"},UploadComplete:function(){u.value=!0,r.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})},Error:function(E,k){a.value.stop(),f.value=s(JSON.parse(k.response).message)}}}),a.value.init()}),(E,k)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{disabled:u.value,onClick:e.withModifiers(y,["prevent"]),type:"button",class:e.normalizeClass([u.value?"bg-red-200 hover:bg-red-200":"bg-red-600 hover:bg-red-700","w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"])},e.toDisplayString(e.unref(s)("Upload")),11,ps),e.createElementVNode("button",{type:"button",onClick:k[0]||(k[0]=S=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ss,[ls,e.createElementVNode("div",cs,[e.createElementVNode("h3",ds,e.toDisplayString(e.unref(s)("Upload files")),1),e.createElementVNode("div",hs,[e.createElementVNode("div",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,S=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{id:S.id},[e.createTextVNode(e.toDisplayString(S.name)+" ( "+e.toDisplayString(S.size)+") ",1),e.createElementVNode("b",null,e.toDisplayString(S.percent),1)],8,ms)]))),256)),p.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",fs,e.toDisplayString(e.unref(s)("No files selected!")),1))]),e.createElementVNode("div",{class:"text-gray-500",ref_key:"container",ref:l},[e.createElementVNode("button",{ref_key:"pickFiles",ref:m,type:"button",class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Select Files")),513)],512),f.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ys={class:"sm:flex sm:items-start"},bs=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),ws={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},vs={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ks={class:"mt-2"},_s={class:"flex text-sm text-gray-800 dark:text-gray-400"},xs={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"},Ss=[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)],Ds={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"},Es=[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)],Ns={class:"ml-1.5"},Vs=["onKeyup","placeholder"],Cs=Object.assign({name:"VFModalArchive"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:o}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(""),l=e.ref(""),m=e.ref(t.selection.items),p=()=>{m.value.length&&r.emit("vf-fetch",{params:{q:"archive",adapter:o("adapter","local"),path:t.current.dirname,items:JSON.stringify(m.value.map(({path:f,type:u})=>({path:f,type:u}))),name:a.value},onSuccess:()=>{r.emit("vf-toast-push",{label:s("The file(s) archived.")})},onError:f=>{l.value=s(f.message)}})};return(f,u)=>(e.openBlock(),e.createBlock(se,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(s)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:u[1]||(u[1]=y=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ys,[bs,e.createElementVNode("div",ws,[e.createElementVNode("h3",vs,e.toDisplayString(e.unref(s)("Archive the files")),1),e.createElementVNode("div",ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,y=>(e.openBlock(),e.createElementBlock("p",_s,[y.type=="dir"?(e.openBlock(),e.createElementBlock("svg",xs,Ss)):(e.openBlock(),e.createElementBlock("svg",Ds,Es)),e.createElementVNode("span",Ns,e.toDisplayString(y.basename),1)]))),256)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=y=>a.value=y),onKeyup:e.withKeys(p,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("Archive name. (.zip file will be created)"),type:"text"},null,40,Vs),[[e.vModelText,a.value]]),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),$s={class:"sm:flex sm:items-start"},Ms=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),Bs={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ts={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},As={class:"mt-2"},Os={class:"flex text-sm text-gray-800 dark:text-gray-400"},js={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"},Ps=[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)],Ls={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"},Is=[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)],zs={class:"ml-1.5"},Rs={class:"my-1 text-sm text-gray-500"},Hs=Object.assign({name:"VFModalUnarchive"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:o}=e.inject("storage"),{t:s}=e.inject("i18n");e.ref("");const a=e.ref(t.selection.items[0]),l=e.ref(""),m=e.ref([]),p=()=>{r.emit("vf-fetch",{params:{q:"unarchive",adapter:o("adapter","local"),path:t.current.dirname,item:a.value.path},onSuccess:()=>{r.emit("vf-toast-push",{label:s("The file unarchived.")})},onError:f=>{l.value=s(f.message)}})};return(f,u)=>(e.openBlock(),e.createBlock(se,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(s)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:u[0]||(u[0]=y=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$s,[Ms,e.createElementVNode("div",Bs,[e.createElementVNode("h3",Ts,e.toDisplayString(e.unref(s)("Unarchive")),1),e.createElementVNode("div",As,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,y=>(e.openBlock(),e.createElementBlock("p",Os,[y.type=="dir"?(e.openBlock(),e.createElementBlock("svg",js,Ps)):(e.openBlock(),e.createElementBlock("svg",Ls,Is)),e.createElementVNode("span",zs,e.toDisplayString(y.basename),1)]))),256)),e.createElementVNode("p",Rs,e.toDisplayString(e.unref(s)("The archive will be unarchived at"))+" ("+e.toDisplayString(i.current.dirname)+")",1),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Us={class:"sm:flex sm:items-start"},Fs=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),Ks={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ys={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ws={class:"mt-2"},Xs={class:"flex text-sm text-gray-800 dark:text-gray-400"},qs={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"},Gs=[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)],Js={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"},Zs=[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)],Qs={class:"ml-1.5"},el={class:"text-sm text-gray-500 pb-1 pt-3"},tl={class:"flex text-sm text-gray-800 dark:text-gray-400"},rl=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),nl={class:"ml-1.5 overflow-auto"},pt={VueFinder:Ao,...Object.freeze(Object.defineProperty({__proto__:null,ModalDelete:ta,ModalMessage:la,ModalNewFolder:ga,ModalNewFile:Sa,ModalPreview:Wi,ModalRename:is,ModalUpload:gs,ModalArchive:Cs,ModalUnarchive:Hs,ModalMove:Object.assign({name:"VFModalMove"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{t:o}=e.inject("i18n"),{getStore:s}=e.inject("storage"),a=e.ref(t.selection.items.from),l=e.ref(""),m=()=>{a.value.length&&r.emit("vf-fetch",{params:{q:"move",adapter:s("adapter","local"),path:t.current.dirname,items:JSON.stringify(a.value.map(({path:p,type:f})=>({path:p,type:f}))),item:t.selection.items.to.path},onSuccess:()=>{r.emit("vf-toast-push",{label:o("Files moved.",t.selection.items.to.name)})},onError:p=>{l.value=o(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(o)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:f[0]||(f[0]=u=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Us,[Fs,e.createElementVNode("div",Ks,[e.createElementVNode("h3",Ys,e.toDisplayString(e.unref(o)("Move files")),1),e.createElementVNode("div",Ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,u=>(e.openBlock(),e.createElementBlock("p",Xs,[u.type=="dir"?(e.openBlock(),e.createElementBlock("svg",qs,Gs)):(e.openBlock(),e.createElementBlock("svg",Js,Zs)),e.createElementVNode("span",Qs,e.toDisplayString(u.path),1)]))),256)),e.createElementVNode("p",el,e.toDisplayString(e.unref(o)("Are you sure you want to move these files?")),1),e.createElementVNode("p",tl,[rl,e.createElementVNode("span",nl,e.toDisplayString(i.selection.items.to.path),1)]),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}})},Symbol.toStringTag,{value:"Module"}))},td="",rd="",ol={install(i){for(const t in pt)if(pt.hasOwnProperty(t)){const r=pt[t];i.component(r.name,r)}}},al=Object.freeze(Object.defineProperty({__proto__:null,default:`{
|
|
18
|
+
`,8,oc)],8,rc)])],64))}},ac={class:"sm:flex sm:items-start"},ic={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},sc={class:"text-gray-700 dark:text-gray-200 text-sm"},lc={key:0,class:"flex leading-5"},cc=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),dc={class:"p-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},hc={class:"font-bold pl-2"},uc={class:"font-bold pl-2"},mc=Object.assign({name:"VFModalPreview"},{props:{selection:Object},setup(r){const t=r,{apiUrl:o}=le(),n=e.inject("emitter"),{t:s}=e.inject("i18n"),a=e.ref(!1),l=f=>a.value=f,m=f=>{var h;return((h=t.selection.item.mime_type)!=null?h:"").startsWith(f)},p=()=>{const f=o.value+"?"+ke({q:"download",adapter:t.selection.adapter,path:t.selection.item.path});n.emit("vf-download",f)};return(f,h)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:h[6]||(h[6]=y=>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 dark:focus:ring-gray-400 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Close")),1),e.createElementVNode("button",{type:"button",onClick:h[7]||(h[7]=y=>p()),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(s)("Download")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ac,[e.createElementVNode("div",ic,[e.createElementVNode("div",null,[m("text")?(e.openBlock(),e.createBlock(Ys,{key:0,selection:r.selection,onLoad:h[0]||(h[0]=y=>l(!0))},null,8,["selection"])):m("image")?(e.openBlock(),e.createBlock(zl,{key:1,selection:r.selection,onLoad:h[1]||(h[1]=y=>l(!0))},null,8,["selection"])):m("video")?(e.openBlock(),e.createBlock(ql,{key:2,selection:r.selection,onLoad:h[2]||(h[2]=y=>l(!0))},null,8,["selection"])):m("audio")?(e.openBlock(),e.createBlock(ec,{key:3,selection:r.selection,onLoad:h[3]||(h[3]=y=>l(!0))},null,8,["selection"])):m("application/pdf")?(e.openBlock(),e.createBlock(nc,{key:4,selection:r.selection,onLoad:h[4]||(h[4]=y=>l(!0))},null,8,["selection"])):(e.openBlock(),e.createBlock(Ul,{key:5,selection:r.selection,onLoad:h[5]||(h[5]=y=>l(!0))},null,8,["selection"]))]),e.createElementVNode("div",sc,[a.value==!1?(e.openBlock(),e.createElementBlock("div",lc,[cc,e.createElementVNode("span",null,e.toDisplayString(e.unref(s)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",dc,[e.createElementVNode("div",null,[e.createElementVNode("span",hc,e.toDisplayString(e.unref(s)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(Qt)(r.selection.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",uc,e.toDisplayString(e.unref(s)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(er)(r.selection.item.last_modified)),1)])])]),_:1}))}}),fc={class:"sm:flex sm:items-start"},pc=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),gc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},yc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},bc={class:"mt-2"},vc={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},wc={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"},_c=[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)],kc={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"},xc=[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"},Ec=["onKeyup"],Dc=Object.assign({name:"VFModalRename"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(t.selection.items[0]),l=e.ref(t.selection.items[0].basename),m=e.ref(""),p=()=>{l.value!=""&&o.emit("vf-fetch",{params:{q:"rename",adapter:n("adapter","local"),path:t.current.dirname,item:a.value.path,name:l.value},onSuccess:()=>{o.emit("vf-toast-push",{label:s("%s is renamed.",l.value)})},onError:f=>{m.value=s(f.message)}})};return(f,h)=>(e.openBlock(),e.createBlock(de,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(s)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:h[2]||(h[2]=y=>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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",fc,[pc,e.createElementVNode("div",gc,[e.createElementVNode("h3",yc,e.toDisplayString(e.unref(s)("Rename")),1),e.createElementVNode("div",bc,[e.createElementVNode("p",vc,[a.value.type=="dir"?(e.openBlock(),e.createElementBlock("svg",wc,_c)):(e.openBlock(),e.createElementBlock("svg",kc,xc)),e.createElementVNode("span",Sc,e.toDisplayString(a.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[0]||(h[0]=y=>l.value=y),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:"Name",type:"text"},null,40,Ec),[[e.vModelText,l.value]]),m.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:h[1]||(h[1]=y=>m.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Nc={class:"sm:flex sm:items-start"},Cc=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),Vc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},$c={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Mc={class:"mt-2"},Bc={class:"text-gray-500 mb-1"},Tc=["id"],Ac={key:0,class:"py-2"},Oc=["disabled","onClick"],Lc=Object.assign({name:"VFModalUpload"},{props:{current:Object},setup(r){const t=r,o=e.inject("emitter"),{apiUrl:n}=le(),{t:s}=e.inject("i18n"),a=e.ref(null),l=e.ref(null),m=e.ref(null),p=e.ref([]),f=e.ref(""),h=e.ref(!0),y=()=>{f.value="",a.value.start()},b=e.inject("postData");return e.onMounted(()=>{a.value=new gt.default.Uploader({runtimes:"html5",browse_button:m.value,container:l.value,max_file_size:"10mb",multiple_queues:!0,file_data_name:"file",url:n.value+"?"+ke(Object.assign(b,{q:"upload",adapter:t.current.adapter,path:t.current.dirname})),headers:{...Qe&&{"X-CSRF-Token":Qe}},init:{PostInit:function(){},FilesAdded:function(D,_){h.value=!1,gt.default.each(_,function(k){p.value.push({id:k.id,name:k.name,size:gt.default.formatSize(k.size),percent:""})})},UploadProgress:function(D,_){p.value[p.value.findIndex(k=>k.id==_.id)].percent=_.percent+"%"},UploadComplete:function(){h.value=!0,o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})},Error:function(D,_){a.value.stop(),f.value=s(JSON.parse(_.response).message)}}}),a.value.init()}),(D,_)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{disabled:h.value,onClick:e.withModifiers(y,["prevent"]),type:"button",class:e.normalizeClass([h.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(s)("Upload")),11,Oc),e.createElementVNode("button",{type:"button",onClick:_[1]||(_[1]=k=>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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Nc,[Cc,e.createElementVNode("div",Vc,[e.createElementVNode("h3",$c,e.toDisplayString(e.unref(s)("Upload files")),1),e.createElementVNode("div",Mc,[e.createElementVNode("div",Bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,k=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{id:k.id},[e.createTextVNode(e.toDisplayString(k.name)+" ( "+e.toDisplayString(k.size)+") ",1),e.createElementVNode("b",null,e.toDisplayString(k.percent),1)],8,Tc)]))),256)),p.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ac,e.toDisplayString(e.unref(s)("No files selected!")),1))]),e.createElementVNode("div",{class:"text-gray-500",ref_key:"container",ref:l},[e.createElementVNode("button",{ref_key:"pickFiles",ref:m,type:"button",class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Select Files")),513)],512),f.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:_[0]||(_[0]=k=>f.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ic={class:"sm:flex sm:items-start"},jc=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),Pc={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"},Rc={class:"mt-2"},Hc={class:"flex text-sm text-gray-800 dark:text-gray-400"},Fc={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"},Uc=[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)],Kc={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"},Yc=[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)],Wc={class:"ml-1.5"},Xc=["onKeyup","placeholder"],qc=Object.assign({name:"VFModalArchive"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(""),l=e.ref(""),m=e.ref(t.selection.items),p=()=>{m.value.length&&o.emit("vf-fetch",{params:{q:"archive",adapter:n("adapter","local"),path:t.current.dirname,items:JSON.stringify(m.value.map(({path:f,type:h})=>({path:f,type:h}))),name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:s("The file(s) archived.")})},onError:f=>{l.value=s(f.message)}})};return(f,h)=>(e.openBlock(),e.createBlock(de,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(s)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:h[2]||(h[2]=y=>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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ic,[jc,e.createElementVNode("div",Pc,[e.createElementVNode("h3",zc,e.toDisplayString(e.unref(s)("Archive the files")),1),e.createElementVNode("div",Rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,y=>(e.openBlock(),e.createElementBlock("p",Hc,[y.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Fc,Uc)):(e.openBlock(),e.createElementBlock("svg",Kc,Yc)),e.createElementVNode("span",Wc,e.toDisplayString(y.basename),1)]))),256)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[0]||(h[0]=y=>a.value=y),onKeyup:e.withKeys(p,["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(s)("Archive name. (.zip file will be created)"),type:"text"},null,40,Xc),[[e.vModelText,a.value]]),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:h[1]||(h[1]=y=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Gc={class:"sm:flex sm:items-start"},Jc=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),Zc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Qc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ed={class:"mt-2"},td={class:"flex text-sm text-gray-800 dark:text-gray-400"},rd={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"},od=[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"},ad=[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)],id={class:"ml-1.5"},sd={class:"my-1 text-sm text-gray-500"},ld=Object.assign({name:"VFModalUnarchive"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n");e.ref("");const a=e.ref(t.selection.items[0]),l=e.ref(""),m=e.ref([]),p=()=>{o.emit("vf-fetch",{params:{q:"unarchive",adapter:n("adapter","local"),path:t.current.dirname,item:a.value.path},onSuccess:()=>{o.emit("vf-toast-push",{label:s("The file unarchived.")})},onError:f=>{l.value=s(f.message)}})};return(f,h)=>(e.openBlock(),e.createBlock(de,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(s)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:h[1]||(h[1]=y=>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(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Gc,[Jc,e.createElementVNode("div",Zc,[e.createElementVNode("h3",Qc,e.toDisplayString(e.unref(s)("Unarchive")),1),e.createElementVNode("div",ed,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,y=>(e.openBlock(),e.createElementBlock("p",td,[y.type=="dir"?(e.openBlock(),e.createElementBlock("svg",rd,od)):(e.openBlock(),e.createElementBlock("svg",nd,ad)),e.createElementVNode("span",id,e.toDisplayString(y.basename),1)]))),256)),e.createElementVNode("p",sd,e.toDisplayString(e.unref(s)("The archive will be unarchived at"))+" ("+e.toDisplayString(r.current.dirname)+")",1),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:h[0]||(h[0]=y=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),cd={class:"sm:flex sm:items-start"},dd=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),hd={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ud={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},md={class:"mt-2"},fd={class:"flex text-sm text-gray-800 dark:text-gray-400"},pd={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"},gd=[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)],yd={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"},bd=[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)],vd={class:"ml-1.5"},wd={class:"text-sm text-gray-500 pb-1 pt-3"},_d={class:"flex text-sm text-gray-800 dark:text-gray-400"},kd=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),xd={class:"ml-1.5 overflow-auto"},Wt={VueFinder:Gi,...Object.freeze(Object.defineProperty({__proto__:null,ModalDelete:ys,ModalMessage:Ss,ModalNewFolder:Bs,ModalNewFile:zs,ModalPreview:mc,ModalRename:Dc,ModalUpload:Lc,ModalArchive:qc,ModalUnarchive:ld,ModalMove:Object.assign({name:"VFModalMove"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{t:n}=e.inject("i18n"),{getStore:s}=e.inject("storage"),a=e.ref(t.selection.items.from),l=e.ref(""),m=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"move",adapter:s("adapter","local"),path:t.current.dirname,items:JSON.stringify(a.value.map(({path:p,type:f})=>({path:p,type:f}))),item:t.selection.items.to.path},onSuccess:()=>{o.emit("vf-toast-push",{label:n("Files moved.",t.selection.items.to.name)})},onError:p=>{l.value=n(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-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(n)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=h=>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(n)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",cd,[dd,e.createElementVNode("div",hd,[e.createElementVNode("h3",ud,e.toDisplayString(e.unref(n)("Move files")),1),e.createElementVNode("div",md,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,h=>(e.openBlock(),e.createElementBlock("p",fd,[h.type=="dir"?(e.openBlock(),e.createElementBlock("svg",pd,gd)):(e.openBlock(),e.createElementBlock("svg",yd,bd)),e.createElementVNode("span",vd,e.toDisplayString(h.path),1)]))),256)),e.createElementVNode("p",wd,e.toDisplayString(e.unref(n)("Are you sure you want to move these files?")),1),e.createElementVNode("p",_d,[kd,e.createElementVNode("span",xd,e.toDisplayString(r.selection.items.to.path),1)]),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:f[0]||(f[0]=h=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}})},Symbol.toStringTag,{value:"Module"}))},Su="",Eu="",Sd={install(r){for(const t in Wt)if(Wt.hasOwnProperty(t)){const o=Wt[t];r.component(o.name,o)}}},Ed=Object.freeze(Object.defineProperty({__proto__:null,default:`{
|
|
19
19
|
"Language": "Language",
|
|
20
20
|
"Create": "Create",
|
|
21
21
|
"Close": "Close",
|
|
@@ -76,9 +76,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
76
76
|
"The file(s) archived." : "The file(s) archived.",
|
|
77
77
|
"Updated." : "Updated.",
|
|
78
78
|
"No search result found." : "No search result found.",
|
|
79
|
-
"Are you sure you want to move these files?" : "Are you sure you want to move these files?"
|
|
79
|
+
"Are you sure you want to move these files?" : "Are you sure you want to move these files?",
|
|
80
|
+
"File Size": "File Size",
|
|
81
|
+
"Last Modified": "Last Modified"
|
|
80
82
|
}
|
|
81
|
-
`},Symbol.toStringTag,{value:"Module"})),
|
|
83
|
+
`},Symbol.toStringTag,{value:"Module"})),Dd=Object.freeze(Object.defineProperty({__proto__:null,default:`{
|
|
82
84
|
"Language": "Dil",
|
|
83
85
|
"Create": "Olu\u015Ftur",
|
|
84
86
|
"Close": "Kapat",
|
|
@@ -139,6 +141,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
139
141
|
"The file(s) is archived." : "Dosyalar ar\u015Fivlendi.",
|
|
140
142
|
"Updated." : "G\xFCncellendi.",
|
|
141
143
|
"No search result found." : "Arama sonucu bulunamad\u0131.",
|
|
142
|
-
"Are you sure you want to move these files?" : "Bu dosyalar\u0131 ta\u015F\u0131mak istedi\u011Finize emin misiniz?"
|
|
144
|
+
"Are you sure you want to move these files?" : "Bu dosyalar\u0131 ta\u015F\u0131mak istedi\u011Finize emin misiniz?",
|
|
145
|
+
"File Size": "Dosya Boyutu",
|
|
146
|
+
"Last Modified": "Son De\u011Fi\u015Fiklik"
|
|
143
147
|
}
|
|
144
|
-
`},Symbol.toStringTag,{value:"Module"}));return
|
|
148
|
+
`},Symbol.toStringTag,{value:"Module"}));return Sd});
|