vuefinder 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vuefinder.js +2390 -2384
- package/dist/vuefinder.umd.cjs +6 -6
- package/package.json +1 -1
package/dist/vuefinder.umd.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(e,ve){typeof exports=="object"&&typeof module<"u"?module.exports=ve(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],ve):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=ve(e.Vue,e.plupload))})(this,function(e,ve){var bn;"use strict";const nt=(bn=document.querySelector('meta[name="csrf-token"]'))==null?void 0:bn.getAttribute("content"),ot=(n,{method:t="get",params:o={},json:i=!0,signal:a=null})=>{const l={method:t};if(l.signal=a,t=="get")n+="?"+new URLSearchParams(o);else{l.headers={},nt&&(l.headers["X-CSRF-Token"]=nt);let u=new FormData;for(const[g,c]of Object.entries(o))u.append(g,c);l.body=u}return fetch(n,l).then(u=>u.ok?i?u.json():u.text():u.json().then(Promise.reject.bind(Promise)))};function Cn(n){return{all:n=n||new Map,on:function(t,o){var i=n.get(t);i?i.push(o):n.set(t,[o])},off:function(t,o){var i=n.get(t);i&&(o?i.splice(i.indexOf(o)>>>0,1):n.set(t,[]))},emit:function(t,o){var i=n.get(t);i&&i.slice().map(function(a){a(o)}),(i=n.get("*"))&&i.slice().map(function(a){a(t,o)})}}}function wt(n){let t=localStorage.getItem(n+"_storage");const o=e.ref(JSON.parse(t));e.watch(o,i);function i(){o.value===null||o.value===""?localStorage.removeItem(n+"_storage"):localStorage.setItem(n+"_storage",JSON.stringify(o.value))}function a(g,c){o.value=Object.assign({...o.value},{[g]:c})}function l(){o.value=null}return{getStore:(g,c=null)=>o.value===null||o.value===""?c:o.value.hasOwnProperty(g)?o.value[g]:c,setStore:a,clearStore:l}}const nr=e.ref("");function ue(){function n(t){nr.value=t}return{apiUrl:nr,setApiUrl:n}}const Vn={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Mn={key:0,class:"flex text-center"},Tn=["aria-label"],Bn=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})],-1)],$n=["aria-label"],An=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})],-1)],In=["aria-label"],Ln=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1)],On=["aria-label"],jn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1)],Pn=["aria-label"],zn=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})],-1)],Rn=["aria-label"],Hn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1)],Fn=["aria-label"],Un=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1)],Yn={key:1,class:"flex text-center"},Kn={class:"pl-2"},Wn={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Xn={key:0,class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Zn=[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)],qn={class:"flex text-center items-center justify-end"},Gn=["aria-label"],Jn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"},null,-1)],Qn=["aria-label"],eo={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},to={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"},ro={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},no=["aria-label"],oo={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"},io={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"},so=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),{getStore:o,setStore:i}=e.inject("storage"),{t:a}=e.inject("i18n"),l=e.ref(o("viewport","grid")),u=e.ref([]),g=e.ref(o("full-screen",!1)),c=e.ref("");t.on("vf-search-query",({newQuery:S})=>{c.value=S});const y=e.inject("loadingState"),m=()=>y.value,b=()=>{g.value=!g.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",S=>{u.value=S}),t.on("vf-view-toggle",S=>{i("viewport",S),l.value=S}),(S,x)=>(e.openBlock(),e.createElementBlock("div",Vn,[c.value.length?(e.openBlock(),e.createElementBlock("div",Yn,[e.createElementVNode("div",Kn,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Wn,e.toDisplayString(c.value),1)]),m()?(e.openBlock(),e.createElementBlock("svg",Xn,Zn)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Mn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:x[0]||(x[0]=D=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:u.value}))},Bn,8,Tn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[1]||(x[1]=D=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:u.value}))},An,8,$n),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[2]||(x[2]=D=>u.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:u.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([u.value.length==1?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ln,2))],8,In),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[3]||(x[3]=D=>!u.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:u.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([u.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},jn,2))],8,On),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[4]||(x[4]=D=>e.unref(t).emit("vf-modal-show",{type:"upload",items:u.value}))},zn,8,Pn),u.value.length==1&&u.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[5]||(x[5]=D=>!u.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:u.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([u.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Hn,2))],8,Rn)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:x[6]||(x[6]=D=>!u.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:u.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([u.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Un,2))],8,Fn))])),e.createElementVNode("div",qn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:x[7]||(x[7]=D=>e.unref(t).emit("vf-darkMode-toggle")),viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-6 w-6 m-auto cursor-pointer stroke-sky-500 fill-sky-100 hover:stroke-sky-600 dark:stroke-gray-400 dark:fill-gray-400/20 dark:hover:stroke-gray-300"},Jn))],8,Gn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:b},[(e.openBlock(),e.createElementBlock("svg",eo,[g.value?(e.openBlock(),e.createElementBlock("path",to)):(e.openBlock(),e.createElementBlock("path",ro))]))],8,Qn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:x[8]||(x[8]=D=>c.value.length||e.unref(t).emit("vf-view-toggle",l.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},[l.value=="grid"?(e.openBlock(),e.createElementBlock("path",oo)):e.createCommentVNode("",!0),l.value=="list"?(e.openBlock(),e.createElementBlock("path",io)):e.createCommentVNode("",!0)],2))],8,no)])]))}});var ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var or={exports:{}};(function(n,t){(function(o,i){n.exports=i()})(ao,function(){function o(d,h){var r=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(r!=null){var p,s,f,v,w=[],k=!0,A=!1;try{if(f=(r=r.call(d)).next,h===0){if(Object(r)!==r)return;k=!1}else for(;!(k=(p=f.call(r)).done)&&(w.push(p.value),w.length!==h);k=!0);}catch(z){A=!0,s=z}finally{try{if(!k&&r.return!=null&&(v=r.return(),Object(v)!==v))return}finally{if(A)throw s}}return w}}function i(d,h){var r=Object.keys(d);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);h&&(p=p.filter(function(s){return Object.getOwnPropertyDescriptor(d,s).enumerable})),r.push.apply(r,p)}return r}function a(d){for(var h=1;h<arguments.length;h++){var r=arguments[h]!=null?arguments[h]:{};h%2?i(Object(r),!0).forEach(function(p){c(d,p,r[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(p){Object.defineProperty(d,p,Object.getOwnPropertyDescriptor(r,p))})}return d}function l(d,h){if(!(d instanceof h))throw new TypeError("Cannot call a class as a function")}function u(d,h){for(var r=0;r<h.length;r++){var p=h[r];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(d,B(p.key),p)}}function g(d,h,r){return h&&u(d.prototype,h),r&&u(d,r),Object.defineProperty(d,"prototype",{writable:!1}),d}function c(d,h,r){return h=B(h),h in d?Object.defineProperty(d,h,{value:r,enumerable:!0,configurable:!0,writable:!0}):d[h]=r,d}function y(d,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(h&&h.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),h&&b(d,h)}function m(d){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},m(d)}function b(d,h){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,s){return p.__proto__=s,p},b(d,h)}function S(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function x(d,h,r){return S()?x=Reflect.construct.bind():x=function(s,f,v){var w=[null];w.push.apply(w,f);var k=Function.bind.apply(s,w),A=new k;return v&&b(A,v.prototype),A},x.apply(null,arguments)}function D(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function N(d){var h=typeof Map=="function"?new Map:void 0;return N=function(p){if(p===null||!D(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h<"u"){if(h.has(p))return h.get(p);h.set(p,s)}function s(){return x(p,arguments,m(this).constructor)}return s.prototype=Object.create(p.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),b(s,p)},N(d)}function E(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function L(d,h){if(h&&(typeof h=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return E(d)}function $(d){var h=S();return function(){var p=m(d),s;if(h){var f=m(this).constructor;s=Reflect.construct(p,arguments,f)}else s=p.apply(this,arguments);return L(this,s)}}function T(d,h){for(;!Object.prototype.hasOwnProperty.call(d,h)&&(d=m(d),d!==null););return d}function I(){return typeof Reflect<"u"&&Reflect.get?I=Reflect.get.bind():I=function(h,r,p){var s=T(h,r);if(s){var f=Object.getOwnPropertyDescriptor(s,r);return f.get?f.get.call(arguments.length<3?h:p):f.value}},I.apply(this,arguments)}function R(d,h){return H(d)||o(d,h)||W(d,h)||ne()}function _(d){return M(d)||X(d)||W(d)||se()}function M(d){if(Array.isArray(d))return te(d)}function H(d){if(Array.isArray(d))return d}function X(d){if(typeof Symbol<"u"&&d[Symbol.iterator]!=null||d["@@iterator"]!=null)return Array.from(d)}function W(d,h){if(d){if(typeof d=="string")return te(d,h);var r=Object.prototype.toString.call(d).slice(8,-1);if(r==="Object"&&d.constructor&&(r=d.constructor.name),r==="Map"||r==="Set")return Array.from(d);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(d,h)}}function te(d,h){(h==null||h>d.length)&&(h=d.length);for(var r=0,p=new Array(h);r<h;r++)p[r]=d[r];return p}function se(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1
|
+
(function(e,ve){typeof exports=="object"&&typeof module<"u"?module.exports=ve(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],ve):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=ve(e.Vue,e.plupload))})(this,function(e,ve){var bn;"use strict";const nt=(bn=document.querySelector('meta[name="csrf-token"]'))==null?void 0:bn.getAttribute("content"),ot=(n,{method:t="get",params:o={},json:i=!0,signal:l=null})=>{const a={method:t};if(a.signal=l,t=="get")n+="?"+new URLSearchParams(o);else{a.headers={},nt&&(a.headers["X-CSRF-Token"]=nt);let u=new FormData;for(const[p,c]of Object.entries(o))u.append(p,c);a.body=u}return fetch(n,a).then(u=>u.ok?i?u.json():u.text():u.json().then(Promise.reject.bind(Promise)))};function Cn(n){return{all:n=n||new Map,on:function(t,o){var i=n.get(t);i?i.push(o):n.set(t,[o])},off:function(t,o){var i=n.get(t);i&&(o?i.splice(i.indexOf(o)>>>0,1):n.set(t,[]))},emit:function(t,o){var i=n.get(t);i&&i.slice().map(function(l){l(o)}),(i=n.get("*"))&&i.slice().map(function(l){l(t,o)})}}}function wt(n){let t=localStorage.getItem(n+"_storage");const o=e.ref(JSON.parse(t));e.watch(o,i);function i(){o.value===null||o.value===""?localStorage.removeItem(n+"_storage"):localStorage.setItem(n+"_storage",JSON.stringify(o.value))}function l(p,c){o.value=Object.assign({...o.value},{[p]:c})}function a(){o.value=null}return{getStore:(p,c=null)=>o.value===null||o.value===""?c:o.value.hasOwnProperty(p)?o.value[p]:c,setStore:l,clearStore:a}}const nr=e.ref("");function ue(){function n(t){nr.value=t}return{apiUrl:nr,setApiUrl:n}}const Vn={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Mn={key:0,class:"flex text-center"},Tn=["aria-label"],Bn=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})],-1)],$n=["aria-label"],An=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})],-1)],In=["aria-label"],Ln=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1)],On=["aria-label"],jn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1)],Pn=["aria-label"],zn=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})],-1)],Rn=["aria-label"],Hn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1)],Fn=["aria-label"],Un=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1)],Yn={key:1,class:"flex text-center"},Kn={class:"pl-2"},Wn={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Xn={key:0,class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Zn=[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)],qn={class:"flex text-center items-center justify-end"},Gn=["aria-label"],Jn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"},null,-1)],Qn=["aria-label"],eo={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},to={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"},ro={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},no=["aria-label"],oo={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"},io={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"},so=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),o=e.inject("usePropDarkMode"),{getStore:i,setStore:l}=e.inject("storage"),{t:a}=e.inject("i18n"),u=e.ref(i("viewport","grid")),p=e.ref([]),c=e.ref(i("full-screen",!1)),y=e.ref("");t.on("vf-search-query",({newQuery:E})=>{y.value=E});const m=e.inject("loadingState"),b=()=>m.value,S=()=>{c.value=!c.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",E=>{p.value=E}),t.on("vf-view-toggle",E=>{l("viewport",E),u.value=E}),(E,_)=>(e.openBlock(),e.createElementBlock("div",Vn,[y.value.length?(e.openBlock(),e.createElementBlock("div",Yn,[e.createElementVNode("div",Kn,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Wn,e.toDisplayString(y.value),1)]),b()?(e.openBlock(),e.createElementBlock("svg",Xn,Zn)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Mn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:_[0]||(_[0]=N=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:p.value}))},Bn,8,Tn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[1]||(_[1]=N=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:p.value}))},An,8,$n),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[2]||(_[2]=N=>p.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.value.length==1?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ln,2))],8,In),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[3]||(_[3]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},jn,2))],8,On),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[4]||(_[4]=N=>e.unref(t).emit("vf-modal-show",{type:"upload",items:p.value}))},zn,8,Pn),p.value.length==1&&p.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[5]||(_[5]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Hn,2))],8,Rn)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:_[6]||(_[6]=N=>!p.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:p.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Un,2))],8,Fn))])),e.createElementVNode("div",qn,[e.withDirectives(e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:_[7]||(_[7]=N=>e.unref(t).emit("vf-darkMode-toggle")),viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-6 w-6 m-auto cursor-pointer stroke-sky-500 fill-sky-100 hover:stroke-sky-600 dark:stroke-gray-400 dark:fill-gray-400/20 dark:hover:stroke-gray-300"},Jn))],8,Gn),[[e.vShow,!e.unref(o)]]),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:S},[(e.openBlock(),e.createElementBlock("svg",eo,[c.value?(e.openBlock(),e.createElementBlock("path",to)):(e.openBlock(),e.createElementBlock("path",ro))]))],8,Qn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:_[8]||(_[8]=N=>y.value.length||e.unref(t).emit("vf-view-toggle",u.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([y.value.length?"stroke-gray-200 dark:stroke-gray-700":"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[u.value=="grid"?(e.openBlock(),e.createElementBlock("path",oo)):e.createCommentVNode("",!0),u.value=="list"?(e.openBlock(),e.createElementBlock("path",io)):e.createCommentVNode("",!0)],2))],8,no)])]))}});var ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var or={exports:{}};(function(n,t){(function(o,i){n.exports=i()})(ao,function(){function o(d,h){var r=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(r!=null){var g,s,f,v,w=[],x=!0,A=!1;try{if(f=(r=r.call(d)).next,h===0){if(Object(r)!==r)return;x=!1}else for(;!(x=(g=f.call(r)).done)&&(w.push(g.value),w.length!==h);x=!0);}catch(z){A=!0,s=z}finally{try{if(!x&&r.return!=null&&(v=r.return(),Object(v)!==v))return}finally{if(A)throw s}}return w}}function i(d,h){var r=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);h&&(g=g.filter(function(s){return Object.getOwnPropertyDescriptor(d,s).enumerable})),r.push.apply(r,g)}return r}function l(d){for(var h=1;h<arguments.length;h++){var r=arguments[h]!=null?arguments[h]:{};h%2?i(Object(r),!0).forEach(function(g){c(d,g,r[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(g){Object.defineProperty(d,g,Object.getOwnPropertyDescriptor(r,g))})}return d}function a(d,h){if(!(d instanceof h))throw new TypeError("Cannot call a class as a function")}function u(d,h){for(var r=0;r<h.length;r++){var g=h[r];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(d,B(g.key),g)}}function p(d,h,r){return h&&u(d.prototype,h),r&&u(d,r),Object.defineProperty(d,"prototype",{writable:!1}),d}function c(d,h,r){return h=B(h),h in d?Object.defineProperty(d,h,{value:r,enumerable:!0,configurable:!0,writable:!0}):d[h]=r,d}function y(d,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(h&&h.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),h&&b(d,h)}function m(d){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},m(d)}function b(d,h){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,s){return g.__proto__=s,g},b(d,h)}function S(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function E(d,h,r){return S()?E=Reflect.construct.bind():E=function(s,f,v){var w=[null];w.push.apply(w,f);var x=Function.bind.apply(s,w),A=new x;return v&&b(A,v.prototype),A},E.apply(null,arguments)}function _(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function N(d){var h=typeof Map=="function"?new Map:void 0;return N=function(g){if(g===null||!_(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h<"u"){if(h.has(g))return h.get(g);h.set(g,s)}function s(){return E(g,arguments,m(this).constructor)}return s.prototype=Object.create(g.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),b(s,g)},N(d)}function D(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function L(d,h){if(h&&(typeof h=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(d)}function $(d){var h=S();return function(){var g=m(d),s;if(h){var f=m(this).constructor;s=Reflect.construct(g,arguments,f)}else s=g.apply(this,arguments);return L(this,s)}}function T(d,h){for(;!Object.prototype.hasOwnProperty.call(d,h)&&(d=m(d),d!==null););return d}function I(){return typeof Reflect<"u"&&Reflect.get?I=Reflect.get.bind():I=function(h,r,g){var s=T(h,r);if(s){var f=Object.getOwnPropertyDescriptor(s,r);return f.get?f.get.call(arguments.length<3?h:g):f.value}},I.apply(this,arguments)}function R(d,h){return H(d)||o(d,h)||W(d,h)||ne()}function k(d){return M(d)||X(d)||W(d)||se()}function M(d){if(Array.isArray(d))return te(d)}function H(d){if(Array.isArray(d))return d}function X(d){if(typeof Symbol<"u"&&d[Symbol.iterator]!=null||d["@@iterator"]!=null)return Array.from(d)}function W(d,h){if(d){if(typeof d=="string")return te(d,h);var r=Object.prototype.toString.call(d).slice(8,-1);if(r==="Object"&&d.constructor&&(r=d.constructor.name),r==="Map"||r==="Set")return Array.from(d);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(d,h)}}function te(d,h){(h==null||h>d.length)&&(h=d.length);for(var r=0,g=new Array(h);r<h;r++)g[r]=d[r];return g}function se(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(d,h){var r=typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(!r){if(Array.isArray(d)||(r=W(d))||h&&d&&typeof d.length=="number"){r&&(d=r);var
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,v=!1,w;return{s:function(){r=r.call(d)},n:function(){var k=r.next();return f=k.done,k},e:function(k){v=!0,w=k},f:function(){try{!f&&r.return!=null&&r.return()}finally{if(v)throw w}}}}function C(d,h){if(typeof d!="object"||d===null)return d;var r=d[Symbol.toPrimitive];if(r!==void 0){var p=r.call(d,h||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}function B(d){var h=C(d,"string");return typeof h=="symbol"?h:String(h)}var V=function(h,r,p){var s=h.x,f=h.y,v=p.x,w=p.y,k={"+":{x:s+v,y:f+w},"-":{x:s-v,y:f-w},"*":{x:s*v,y:f*w},"/":{x:s/v,y:f/w}};return k[r]},Y=function(h){return{x:h.left,y:h.top}},O=function(h){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:h.x,top:h.y,right:h.x,bottom:h.y,width:r,height:r}},ce=function(h){return{x:h,y:h}},ae=function(d,h){var r=h;window.addEventListener("resize",r),window.addEventListener("scroll",r);var p=new MutationObserver(r);d.forEach(function(f,v){p.observe(f,{childList:v!==0,attributes:!0})});var s=function(){return jd(p,r)};return{observer:p,callback:r,cleanup:s}},pt=function(d){var h=bt(d);return h.x||h.y?!0:d instanceof Document?d.body?!!(d.body.scrollTop=1):!!(d.documentElement.scrollTop=1):!!(d.scrollTop=1)},gt=function(){var d=document.createElement("div");return d.style.position="fixed",d.style.overflow="hidden",d.style.pointerEvents="none",d.style.zIndex="999999999999999999",d},Qt=function(d){var h=document.createElement("div");return h.style.position="absolute",d||(h.style.background="rgba(0, 175, 255, 0.2)",h.style.border="1px solid rgba(0, 175, 255, 0.8)",h.style.display="none",h.style.pointerEvents="none"),h},yt=function(d,h){var r;return function(){for(var p=arguments.length,s=new Array(p),f=0;f<p;f++)s[f]=arguments[f];var v=function(){r=null,d.apply(void 0,s)};clearTimeout(r),r=setTimeout(v,h)}},er=function(){var d,h,r,p;return{y:((d=document.body)===null||d===void 0?void 0:d.scrollTop)||((h=document.documentElement)===null||h===void 0?void 0:h.scrollTop)||0,x:((r=document.body)===null||r===void 0?void 0:r.scrollLeft)||((p=document.documentElement)===null||p===void 0?void 0:p.scrollLeft)||0}},vn=function(d){var h=function r(p){var s,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,v=(s=p[f])===null||s===void 0?void 0:s.parentNode;return v?(p.push(v),f++,r(p,f)):p};return h([d])},Nd=function(d,h){if(d instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var r=d.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(d.clientWidth||r.width)*h,height:(d.clientHeight||r.height)*h}},Sn=function(d,h){var r={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return Ne(d).forEach(function(p){var s=h.getRect(p);r.top=Math.min(r.top,s.top),r.left=Math.min(r.left,s.left),r.bottom=Math.max(r.bottom,s.bottom),r.right=Math.max(r.right,s.right)}),r.height=r.bottom-r.top,r.width=r.right-r.left,r},bt=function(d){return!d||d instanceof Document?er():{x:d.scrollLeft>=0?d.scrollLeft:er().x,y:d.scrollTop>=0?d.scrollTop:er().y}},wn=function(d){var h=d.elementRect,r=d.containerRect,p=d.tolerance,s=p===void 0?{x:0,y:0}:p,f=[];return h.top-s.y<r.top&&f.push("top"),h.left-s.x<r.left&&f.push("left"),h.bottom+s.y>r.bottom&&f.push("bottom"),h.right+s.y>r.right&&f.push("right"),f},Cd=function(d){var h=d.event;return{x:h.clientX,y:h.clientY}},Vd=function(d){var h=d.scrollAmount,r=d.initialPointerPos,p=d.pointerPos,s={};return p.x>r.x-h.x?(s.left=r.x-h.x,s.width=p.x-r.x+h.x):(s.left=p.x,s.width=r.x-p.x-h.x),p.y>r.y-h.y?(s.top=r.y-h.y,s.height=p.y-r.y+h.y):(s.top=p.y,s.height=r.y-p.y-h.y),s},_n=function(h){var r={x:0,y:0},p=window.getComputedStyle(h);if(!p.transform||p.transform==="none")return r;if(p.transform.indexOf("3d")>=0){var s=p.transform.trim().match(/matrix3d\((.*?)\)/);if(s&&s.length){var f,v=(f=s[1])===null||f===void 0?void 0:f.split(",");r.x=parseInt(v[12])||0,r.y=parseInt(v[13])||0}return r}var w=p.transform.trim().match(/matrix\((.*?)\)/);if(w&&w.length){var k,A=(k=w[1])===null||k===void 0?void 0:k.split(",");r.x=parseInt(A[4])||0,r.y=parseInt(A[5])||0}return r},Md=function(h){var r=h.style.transform;if(!r||r.indexOf("translate")<0)return _n(h);var p={x:0,y:0},s=r.trim().match(/translate[3dD]*?\(.*?\)/);if(s){var f,v=(f=s[0])===null||f===void 0?void 0:f.split("(");if(v){var w,k=(w=v[1])===null||w===void 0?void 0:w.split(",");p.x=parseInt(k[0])||0,p.y=parseInt(k[1])||0}}return!p.x&&!p.x?_n(h):p},Td=function(h){var r=h.style,p={x:parseInt(r.left)||0,y:parseInt(r.top)||0};if(!p.x&&!p.x){var s=window.getComputedStyle(h);return{x:parseInt(s.left)||0,y:parseInt(s.top)||0}}return p},Bd=function(d,h){return h?Md(d):Td(d)},$d=function(d){var h=d.element,r=d.edges,p=d.elementRect,s=d.containerRect,f=d.elementPos,v=d.useTransform;r.includes("top")&&et(h,{y:f.y+s.top-p.top,x:f.x},v),r.includes("left")&&et(h,{y:f.y,x:f.x+s.left-p.left},v),r.includes("bottom")&&et(h,{y:f.y+s.bottom-p.bottom,x:f.x},v),r.includes("right")&&et(h,{y:f.y,x:f.x+s.right-p.right},v)},kn=function(d){var h=d.computedStyle,r=d.node,p=h.position,s=p==="absolute"||p==="relative"||p==="fixed";!(r instanceof Document)&&!s&&(r.style.position="relative")},Ad=function(d){var h=d.shiftKey,r=d.keyboardDragSpeed,p=d.zoom,s=d.key,f=d.dragKeys,v=d.scrollDiff,w=d.canScroll,k=d.scrollCallback,A={x:0,y:0},z=h?r*4*p:r*p;return f.left.includes(s)&&(A.x=v.x||-z,!h&&!v.x&&w&&k(["left"],r)),f.right.includes(s)&&(A.x=v.x||z,!h&&!v.x&&w&&k(["right"],r)),f.up.includes(s)&&(A.y=v.y||-z,!h&&!v.y&&w&&k(["top"],r)),f.down.includes(s)&&(A.y=v.y||z,!h&&!v.y&&w&&k(["bottom"],r)),A},Id=function(d){var h=d.element,r=d.force,p=d.multiSelectionToggle,s=d.SelectedSet,f=d.hoverClassName;h.classList.contains(f)&&!r||(s.has(h)?p&&s.delete(h):s.add(h),h.classList.add(f))},Ld=function(d){var h=d.element,r=d.force,p=d.SelectedSet,s=d.PrevSelectedSet,f=d.hoverClassName;if(!h.classList.contains(f)&&!r)return!1;var v=p.has(h),w=s.has(h);v&&!w?p.delete(h):!v&&w&&p.add(h),h.classList.remove(f)},Qe=function(h,r,p){return console.warn('[DragSelect] TypeIssue: setting "'.concat(h,'" is not of type "').concat(r,'".'))},P=function(h,r,p,s){if(r===void 0)return p?c({},h,s):{};if(r===null)return c({},h,null);var f=!0,v=!1,w=typeof s=="string";w&&(f=typeof r=="string"||r instanceof String),w&&!f&&(v=!0,Qe(h,"string"));var k=!Number.isNaN(s)&&typeof s=="number";k&&(f=!Number.isNaN(r)&&typeof r=="number"),k&&!f&&(v=!0,Qe(h,"number"));var A=Object.prototype.toString.call(s)==="[object Object]";A&&(f=Object.prototype.toString.call(r)==="[object Object]"),A&&!f&&(v=!0,Qe(h,"object"));var z=typeof s=="boolean";z&&(f=typeof r=="boolean"),z&&!f&&(v=!0,Qe(h,"boolean"));var G=Array.isArray(s);G&&(f=Array.isArray(r)),G&&!f&&(v=!0,Qe(h,"array"));var de=v||p;return h==="dragKeys"&&f?c({},h,Object.assign(s,r)):h==="dragKeys"&&!f?de?c({},h,s):{}:(h==="dropZones"&&f&&new Set(r.map(function(he){return he.id})).size!==r.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),f?c({},h,r):de?c({},h,s):{})},Od=function(d,h){return a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a({},P("area",d.area,h,document)),P("selectables",d.selectables,h,null)),P("autoScrollSpeed",d.autoScrollSpeed,h,5)),P("overflowTolerance",d.overflowTolerance,h,{x:25,y:25})),P("zoom",d.zoom,h,1)),P("customStyles",d.customStyles,h,!1)),P("multiSelectMode",d.multiSelectMode,h,!1)),P("multiSelectToggling",d.multiSelectToggling,h,!0)),P("multiSelectKeys",d.multiSelectKeys,h,["Control","Shift","Meta"])),P("selector",d.selector,h,null)),P("selectionThreshold",d.selectionThreshold,h,0)),P("draggability",d.draggability,h,!0)),P("immediateDrag",d.immediateDrag,h,!0)),P("keyboardDrag",d.keyboardDrag,h,!0)),P("dragKeys",d.dragKeys,h,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),P("keyboardDragSpeed",d.keyboardDragSpeed,h,10)),P("useTransform",d.useTransform,h,!0)),P("refreshMemoryRate",d.refreshMemoryRate,h,80)),P("dropZones",d.dropZones,h,[])),P("dropInsideThreshold",d.dropInsideThreshold,h,1)),P("dropTargetThreshold",d.dropTargetThreshold,h,0)),P("usePointerEvents",d.usePointerEvents,h,!1)),P("hoverClass",d.hoverClass,h,"ds-hover")),P("selectableClass",d.selectableClass,h,"ds-selectable")),P("selectedClass",d.selectedClass,h,"ds-selected")),P("selectorClass",d.selectorClass,h,"ds-selector")),P("selectorAreaClass",d.selectorAreaClass,h,"ds-selector-area")),P("droppedTargetClass",d.droppedTargetClass,h,"ds-dropped-target")),P("droppedInsideClass",d.droppedInsideClass,h,"ds-dropped-inside")),P("droppableClass",d.droppableClass,h,"ds-droppable")),P("dropZoneClass",d.dropZoneClass,h,"ds-dropzone")),P("dropZoneReadyClass",d.dropZoneReadyClass,h,"ds-dropzone-ready")),P("dropZoneTargetClass",d.dropZoneTargetClass,h,"ds-dropzone-target")),P("dropZoneInsideClass",d.dropZoneInsideClass,h,"ds-dropzone-inside")),P("dragAsBlock",d.dragAsBlock,h,!1))},Re=function(d,h){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,p=d;if(r>0){var s=(d.right-d.left)*r,f=(d.bottom-d.top)*r;p={left:d.left+s,right:d.right-s,top:d.top+f,bottom:d.bottom-f}}return p.left<h.right&&p.right>h.left&&p.top<h.bottom&&p.bottom>h.top},xn=function(d){var h=d.element,r=d.posDirection,p=d.containerRect,s=d.useTransform,f=Bd(h,s),v=V(f,"+",r);et(h,v,s);var w=h.getBoundingClientRect(),k=wn({elementRect:w,containerRect:p});$d({element:h,edges:k,elementRect:w,containerRect:p,elementPos:v,useTransform:s})},jd=function(d,h){window.removeEventListener("resize",h),window.removeEventListener("scroll",h),d.disconnect()},Pd=function(d,h,r){if(h.length){var p=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=d instanceof Document?p||document.body:d,f=h.includes("top")&&s.scrollTop>0,v=h.includes("bottom")&&s.scrollTop<s.scrollHeight,w=h.includes("left")&&s.scrollLeft>0,k=h.includes("right")&&s.scrollLeft<s.scrollWidth;f&&(s.scrollTop-=1*r),v&&(s.scrollTop+=1*r),w&&(s.scrollLeft-=1*r),k&&(s.scrollLeft+=1*r)}},et=function(d,h,r){if(r){var p=d.style.transform;d.style.transform="translate3d(".concat(h.x,"px,").concat(h.y,"px,1px) ").concat(p.replace(/translate.*?\)/g,""))}else d.style.left="".concat(h.x,"px"),d.style.top="".concat(h.y,"px");return d},zd=function(d){for(var h=d.subscribe,r=d.publish,p=d.Interaction,s=d.SelectedSet,f=d.DropZones,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(G){return G.event}}],"Interaction:end":[{name:"callback",extraData:function(){var G=f.getTarget();return a({},G?{dropTarget:G.toObject()}:{})}}]},w=function(){var G=R(A[k],2),de=G[0],he=G[1];["pre",!1].forEach(function(be){return h(be?"".concat(de,":").concat(be):de,function(Z){return he.forEach(function(oe){return(!oe.condition||oe.condition(Z))&&r(be?"".concat(be).concat(oe.name):oe.name,a(a({items:s.elements,isDragging:p.isDragging},Z),oe.extraData?oe.extraData(Z):{}))})})})},k=0,A=Object.entries(v);k<A.length;k++)w()},Ne=function(d){return d?!Array.isArray(d)&&(d instanceof HTMLElement||d instanceof SVGElement)?[d]:_(new Set(_(d))):[]},Dn=function(d,h){d.style.left="".concat(h.left,"px"),d.style.top="".concat(h.top,"px"),d.style.width="".concat(h.width,"px"),d.style.height="".concat(h.height,"px")},Rd=function(){function d(h){var r=this,p=h.DS;l(this,d),c(this,"DS",void 0),c(this,"_observers",void 0),c(this,"_node",void 0),c(this,"_parentNodes",void 0),c(this,"_computedStyle",void 0),c(this,"_computedBorder",void 0),c(this,"_rect",void 0),c(this,"setArea",function(s){r.reset(),r._node=s,kn({computedStyle:r.computedStyle,node:r._node}),setTimeout(function(){r.DS.PubSub.publish("Area:modified:pre",{item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{item:r})})}),c(this,"start",function(){r._observers=ae(r.parentNodes,yt(function(s){r.DS.PubSub.publish("Area:modified:pre",{event:s,item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{event:s,item:r})},60))}),c(this,"reset",function(){r._computedStyle=void 0,r._rect=void 0,r._computedBorder=void 0,r._parentNodes=void 0}),c(this,"stop",function(){r._observers.cleanup(),r.reset()}),c(this,"scroll",function(s,f){var v={scroll_directions:s,scroll_multiplier:f};r.DS.PubSub.publish("Area:scroll:pre",v),Pd(r._node,s,f),r.DS.PubSub.publish("Area:scroll",v)}),this.DS=p,this.setArea(this.DS.stores.SettingsStore.s.area),this.DS.PubSub.subscribe("Settings:updated:area",function(s){var f=s.settings;r.setArea(f.area)}),this.DS.PubSub.subscribe("Interaction:init",this.start),this.DS.PubSub.subscribe("Interaction:end",this.reset)}return g(d,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof Document?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=Nd(this.HTMLNode,this.DS.stores.SettingsStore.s.zoom)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=vn(this.HTMLNode)}}]),d}(),Hd=function(){function d(h){var r=this,p=h.DS;l(this,d),c(this,"_prevCursorPos",void 0),c(this,"_prevScrollPos",void 0),c(this,"_elements",[]),c(this,"_dragKeys",void 0),c(this,"_dragKeysFlat",[]),c(this,"_selectionRect",void 0),c(this,"assignDragkeys",function(){r._dragKeys={up:r.DS.stores.SettingsStore.s.dragKeys.up.map(function(s){return s.toLowerCase()}),down:r.DS.stores.SettingsStore.s.dragKeys.down.map(function(s){return s.toLowerCase()}),left:r.DS.stores.SettingsStore.s.dragKeys.left.map(function(s){return s.toLowerCase()}),right:r.DS.stores.SettingsStore.s.dragKeys.right.map(function(s){return s.toLowerCase()})},r._dragKeysFlat=[].concat(_(r._dragKeys.up),_(r._dragKeys.down),_(r._dragKeys.left),_(r._dragKeys.right))}),c(this,"keyboardDrag",function(s){var f=s.event,v=s.key,w=v.toLowerCase();if(!(!r.DS.stores.SettingsStore.s.keyboardDrag||!r._dragKeysFlat.includes(w)||!r.DS.SelectedSet.size||!r.DS.stores.SettingsStore.s.draggability||r.DS.continue)){var k={event:f,isDragging:!0,isDraggingKeyboard:!0};r.DS.publish(["Interaction:start:pre","Interaction:start"],k),r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=Sn(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0);var A=Ad({shiftKey:r.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:r.DS.stores.SettingsStore.s.keyboardDragSpeed,zoom:r.DS.stores.SettingsStore.s.zoom,key:w,scrollCallback:r.DS.Area.scroll,scrollDiff:r._scrollDiff,canScroll:r.DS.stores.ScrollStore.canScroll,dragKeys:r._dragKeys});r.DS.stores.SettingsStore.s.dragAsBlock&&(A=r.limitDirection(A)),r._elements.forEach(function(z){return xn({element:z,posDirection:A,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})}),r.DS.publish(["Interaction:update:pre","Interaction:update"],k)}}),c(this,"keyboardEnd",function(s){var f=s.event,v=s.key,w=v.toLowerCase();if(!(!r.DS.stores.SettingsStore.s.keyboardDrag||!r._dragKeysFlat.includes(w)||!r.DS.SelectedSet.size||!r.DS.stores.SettingsStore.s.draggability)){var k={event:f,isDragging:r.DS.stores.SettingsStore.s.draggability,isDraggingKeyboard:!0};r.DS.publish(["Interaction:end:pre","Interaction:end"],k)}}),c(this,"start",function(s){var f=s.isDragging,v=s.isDraggingKeyboard;!f||v||(r._prevCursorPos=null,r._prevScrollPos=null,r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=Sn(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0))}),c(this,"stop",function(s){s!=null&&s.isKeyboard||(r._prevCursorPos=null,r._prevScrollPos=null,r.handleZIndex(!1),r._elements=[])}),c(this,"update",function(s){var f=s.isDragging,v=s.isDraggingKeyboard;if(!(!f||!r._elements.length||v||r.DS.continue)){var w=V(r._cursorDiff,"+",r._scrollDiff);r.DS.stores.SettingsStore.s.dragAsBlock&&(w=r.limitDirection(w)),r._elements.forEach(function(k){return xn({element:k,posDirection:w,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})})}}),c(this,"limitDirection",function(s){var f=r.DS.SelectorArea.rect,v=r.DS.stores.ScrollStore.scrollAmount,w={top:f.top-r._selectionRect.top+v.y,left:f.left-r._selectionRect.left+v.x,bottom:f.bottom-r._selectionRect.bottom+v.y,right:f.right-r._selectionRect.right+v.x};return s.x===0&&s.y===0||(s.y<0&&(s.y=Math.max(s.y,w.top)),s.x<0&&(s.x=Math.max(s.x,w.left)),s.y>0&&(s.y=Math.min(s.y,w.bottom)),s.x>0&&(s.x=Math.min(s.x,w.right)),r._selectionRect.top+=s.y,r._selectionRect.bottom+=s.y,r._selectionRect.left+=s.x,r._selectionRect.right+=s.x),s}),c(this,"handleZIndex",function(s){r._elements.forEach(function(f){return f.style.zIndex="".concat((parseInt(f.style.zIndex)||0)+s?9999:-9998)})}),this.DS=p,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return g(d,[{key:"_cursorDiff",get:function(){var r=this.DS.stores.PointerStore.currentVal,p=this._prevCursorPos?V(r,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=r,p}},{key:"_scrollDiff",get:function(){var r=this.DS.stores.ScrollStore.currentVal,p=this._prevScrollPos?V(r,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=r,p}}]),d}(),Fd=function(){function d(h){var r=this,p=h.DS,s=h.id,f=h.element,v=h.droppables;l(this,d),c(this,"id",void 0),c(this,"element",void 0),c(this,"_droppables",void 0),c(this,"_rect",void 0),c(this,"_observers",void 0),c(this,"_timeout",void 0),c(this,"_itemsDropped",[]),c(this,"_itemsInside",void 0),c(this,"setReadyClasses",function(w){if(!r.isDestroyed){var k=r.droppables.filter(function(A){return r.DS.SelectedSet.has(A)});k.length&&(k.forEach(function(A){A.classList[w]("".concat(r.Settings.droppableClass)),A.classList[w]("".concat(r.Settings.droppableClass,"-").concat(r.id))}),r.element.classList[w]("".concat(r.Settings.dropZoneReadyClass)))}}),c(this,"handleNoDrop",function(){var w;r.isDestroyed||(r.DS.SelectedSet.forEach(function(k){k.classList.remove(r.Settings.droppedTargetClass),k.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),r._itemsDropped=r._itemsDropped.filter(function(k){return!r.DS.SelectedSet.has(k)}),(w=r._itemsDropped)!==null&&w!==void 0&&w.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleDrop",function(){var w,k,A;r.isDestroyed||(r._itemsDropped=_(new Set([].concat(_(r._itemsDropped),_((w=r.droppables)===null||w===void 0?void 0:w.filter(function(z){return r.DS.SelectedSet.has(z)}))))),(k=r._itemsDropped)===null||k===void 0||k.forEach(function(z){z.classList.add("".concat(r.Settings.droppedTargetClass)),z.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),(A=r._itemsDropped)!==null&&A!==void 0&&A.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleItemsInsideClasses",function(){var w=!1;r.droppables.forEach(function(k){r.itemsInside.includes(k)?(k.classList.add("".concat(r.Settings.droppedInsideClass)),k.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),w=!0):(k.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),k.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||k.classList.remove("".concat(r.Settings.droppedInsideClass)))}),w?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))}),c(this,"start",function(w){var k=w.isDragging;!k||r.isDestroyed||r.setReadyClasses("add")}),c(this,"stop",function(w){var k=w.isDragging;!k||r.isDestroyed||(r.setReadyClasses("remove"),r.handleItemsInsideClasses())}),c(this,"toObject",function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}}),this.DS=p,this.Settings=p.stores.SettingsStore.s,this.id=s,this.element=f,v&&(this.droppables=Ne(v)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",function(w){var k=w.settings;r.element&&(r.element.classList.remove(k["dropZoneClass:pre"]),r.element.classList.add(k.dropZoneClass))}),this._observers=ae(this.parentNodes,yt(function(){return r._rect=null},this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return g(d,[{key:"destroy",value:function(){var r=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach(function(p){p.classList.remove("".concat(r.Settings.droppedTargetClass)),p.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id)),p.classList.remove("".concat(r.Settings.droppableClass)),p.classList.remove("".concat(r.Settings.droppableClass,"-").concat(r.id))}),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var r=this;return this.isDestroyed?null:this._itemsInside?this._itemsInside:(this._itemsInside=this.droppables.flatMap(function(p){return Re(r.DS.SelectableSet.rects.get(p),r.rect,r.Settings.dropInsideThreshold)?[p]:[]}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return r._itemsInside=null},this.Settings.refreshMemoryRate),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=vn(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(r){this._droppables=r}}]),d}(),Ud=g(function d(h){var r=this,p=h.DS;l(this,d),c(this,"_zoneByElement",new Map),c(this,"_zoneById",new Map),c(this,"_zonesByDroppable",new Map),c(this,"_zones",void 0),c(this,"setDropZones",function(s){var f=s.dropZones;f&&(r._zones&&r._zones.forEach(function(v){return v.destroy()}),r._zones=f.map(function(v){return new Fd(a({DS:r.DS},v))}),r._zones.forEach(function(v){r._zoneByElement.set(v.element,v),r._zoneById.set(v.id,v),v.droppables.forEach(function(w){var k=r._zonesByDroppable.get(w);if(!(k!=null&&k.length))return r._zonesByDroppable.set(w,[v]);r._zonesByDroppable.set(w,_(new Set([].concat(_(k),[v]))))})}))}),c(this,"_handleDrop",function(s){r._zones.forEach(function(f){f!==s&&f.handleNoDrop()}),s&&s.handleDrop()}),c(this,"_getZoneByElementsFromPoint",function(s,f){for(var v=f.x,w=f.y,k=0,A=s.length;k<A;k++){var z=r._zoneByElement.get(s[k]);if(z&&Re(z.rect,{left:v,right:v,top:w,bottom:w},Math.min(r.Settings.dropTargetThreshold,.5)))return z}}),c(this,"stop",function(s){var f=s.isDragging;if(f){var v=r.getTarget();r._handleDrop(v)}}),c(this,"getItemsDroppedById",function(s){var f=r._zoneById.get(s);return f?f.itemsDropped:console.warn("[DragSelect] No zone found (id: ".concat(s,")"))}),c(this,"getItemsInsideById",function(s,f){var v=r._zoneById.get(s);if(!v)return console.warn("[DragSelect] No zone found (id: ".concat(s,")"));var w=v.itemsInside;return f&&v.handleItemsInsideClasses(),w}),c(this,"getTarget",function(s){var f;if((f=r._zones)!==null&&f!==void 0&&f.length){var v=(s==null?void 0:s.x)||r.DS.stores.PointerStore.currentVal.x,w=(s==null?void 0:s.y)||r.DS.stores.PointerStore.currentVal.y,k=document.elementsFromPoint(v,w);return r._getZoneByElementsFromPoint(k,{x:v,y:w})}}),this.DS=p,this.Settings=p.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:dropZones",function(s){var f=s.settings;return r.setDropZones(f)}),this.setDropZones({dropZones:this.DS.stores.SettingsStore.s.dropZones}),this.DS.subscribe("Interaction:end",this.stop)}),Yd=function(){function d(h){var r=this,p=h.DS;l(this,d),c(this,"isInteracting",void 0),c(this,"isDragging",void 0),c(this,"init",function(){return r.DS.publish("Interaction:init:pre",{})}),c(this,"_init",function(){r.stop(),r.Settings.usePointerEvents?r.DS.Area.HTMLNode.addEventListener("pointerdown",r.start,{passive:!1}):r.DS.Area.HTMLNode.addEventListener("mousedown",r.start),r.DS.Area.HTMLNode.addEventListener("touchstart",r.start,{passive:!1}),r.DS.publish("Interaction:init",{})}),c(this,"start",function(s){return r.DS.publish("Interaction:start:pre",{event:s,isDragging:r.isDragging})}),c(this,"_start",function(s){s.type==="touchstart"&&s.preventDefault(),r._canInteract(s)&&(r.isInteracting=!0,r.isDragging=r.isDragEvent(s),r.DS.publish("Interaction:start",{event:s,isDragging:r.isDragging}),r.Settings.usePointerEvents?(document.addEventListener("pointerup",r.reset),document.addEventListener("pointercancel",r.reset)):document.addEventListener("mouseup",r.reset),document.addEventListener("touchend",r.reset))}),c(this,"isDragEvent",function(s){var f=s.target.closest(".".concat(r.Settings.selectableClass));return!r.Settings.draggability||r.DS.stores.KeyStore.isMultiSelectKeyPressed(s)||!f?!1:(r.Settings.immediateDrag&&(r.DS.SelectedSet.size?r.DS.SelectedSet.has(f)||(r.DS.SelectedSet.clear(),r.DS.SelectedSet.add(f)):r.DS.SelectedSet.add(f)),!!r.DS.SelectedSet.has(f))}),c(this,"onClick",function(s){var f=s.event;if(r._canInteract(f)&&!(f.detail>0)){var v=r.DS,w=v.stores,k=w.PointerStore,A=w.KeyStore,z=v.SelectableSet,G=v.SelectedSet;k.start(f);var de=f.target;z.has(de)&&(A.isMultiSelectKeyPressed(f)||G.clear(),G.toggle(de),r.reset())}}),c(this,"stop",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(s.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(s.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),s.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)}),c(this,"update",function(s){var f=s.event,v=s.scroll_directions,w=s.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:f,scroll_directions:v,scroll_multiplier:w,isDragging:r.isDragging})}),c(this,"reset",function(s){return r.DS.publish("Interaction:end:pre",{event:s,isDragging:r.isDragging})}),c(this,"_reset",function(s){var f=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:s,isDragging:f})}),this.DS=p,this.Settings=p.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",function(s){var f=s.settings;r.stop(f["area:pre"]),r.init()}),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:start:pre",function(s){var f=s.event;return r._start(f)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(s){var f=s.event;return r._reset(f)}),this.DS.subscribe("Area:scroll",this.update)}return g(d,[{key:"_canInteract",value:function(r){var p=r.clientX===0&&r.clientY===0&&r.detail===0&&r.target;return!(r.button===2||this.isInteracting||r.target&&!this.DS.SelectorArea.isInside(r.target)||!p&&!this.DS.SelectorArea.isClicked(r))}}]),d}(),Kd=g(function d(h){var r=this,p=h.DS;l(this,d),c(this,"subscribers",{}),c(this,"subscribe",function(s,f){return Array.isArray(r.subscribers[s])||(r.subscribers[s]=[]),r.subscribers[s].push(f),r.subscribers[s].length-1}),c(this,"unsubscribe",function(s,f,v){v>=0?r.subscribers[s].splice(v,1):f&&(r.subscribers[s]=r.subscribers[s].filter(function(w){return w!==f}))}),c(this,"publish",function(s,f){Array.isArray(s)?s.forEach(function(v){return r._publish(v,f)}):r._publish(s,f)}),c(this,"_publish",function(s,f){var v=r.subscribers[s];Array.isArray(v)&&(s.includes(":pre")?r._handlePrePublish(v,f):r._handlePublish(v,f))}),c(this,"_handlePublish",function(s,f){for(var v=0,w=s.length;v<w;v++){if(r.DS.stopped)return;s[v](f)}}),c(this,"_handlePrePublish",function(s,f){for(var v=s.length;v--;){if(r.DS.stopped)return;s[v](f)}}),this.DS=p}),Wd=function(d){y(r,d);var h=$(r);function r(p){var s,f=p.DS;return l(this,r),s=h.call(this),c(E(s),"_rects",void 0),c(E(s),"_timeout",void 0),c(E(s),"init",function(){return Ne(s.Settings.selectables).forEach(function(v){return s.add(v)})}),c(E(s),"clear",function(){return s.forEach(function(v){return s.delete(v)})}),c(E(s),"_onClick",function(v){return s.DS.publish(["Selectable:click:pre","Selectable:click"],{event:v})}),c(E(s),"_onPointer",function(v){return s.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:v})}),c(E(s),"addAll",function(v){return v.forEach(function(w){return s.add(w)})}),c(E(s),"deleteAll",function(v){return v.forEach(function(w){return s.delete(w)})}),c(E(s),"getRect",function(v){return s._rects?s.rects.get(v):v.getBoundingClientRect()}),s.DS=f,s.Settings=f.stores.SettingsStore.s,s.DS.subscribe("Interaction:init",s.init),s.DS.PubSub.subscribe("Settings:updated:selectables",function(){s.clear(),s.init()}),s.DS.subscribe("Settings:updated:selectableClass",function(v){var w=v.settings;s.forEach(function(k){k.classList.remove(w["selectableClass:pre"]),k.classList.add(w.selectableClass)})}),s}return g(r,[{key:"add",value:function(s){if(I(m(r.prototype),"has",this).call(this,s))return this;var f={items:this.elements,item:s};return this.DS.publish("Selectable:added:pre",f),s.classList.add(this.Settings.selectableClass),s.addEventListener("click",this._onClick),this.Settings.usePointerEvents?s.addEventListener("pointerdown",this._onPointer,{passive:!1}):s.addEventListener("mousedown",this._onPointer),s.addEventListener("touchstart",this._onPointer,{passive:!1}),this.Settings.draggability&&!this.Settings.useTransform&&kn({computedStyle:window.getComputedStyle(s),node:s}),I(m(r.prototype),"add",this).call(this,s),this.DS.publish("Selectable:added",f),this}},{key:"delete",value:function(s){if(!I(m(r.prototype),"has",this).call(this,s))return!0;var f={items:this.elements,item:s};return this.DS.publish("Selectable:removed:pre",f),s.classList.remove(this.Settings.selectableClass),s.classList.remove(this.Settings.hoverClass),s.removeEventListener("click",this._onClick),this.Settings.usePointerEvents?s.removeEventListener("pointerdown",this._onPointer,{passive:!1}):s.removeEventListener("mousedown",this._onPointer),s.removeEventListener("touchstart",this._onPointer,{passive:!1}),I(m(r.prototype),"delete",this).call(this,s),this.DS.publish("Selectable:removed",f),!0}},{key:"elements",get:function(){return Array.from(this.values())}},{key:"rects",get:function(){var s=this;return this._rects?this._rects:(this._rects=new Map,this.forEach(function(f){return s._rects.set(f,f.getBoundingClientRect())}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return s._rects=null},this.Settings.refreshMemoryRate),this._rects)}}]),r}(N(Set)),Xd=function(d){y(r,d);var h=$(r);function r(p){var s,f=p.DS;return l(this,r),s=h.call(this),c(E(s),"clear",function(){return s.forEach(function(v){return s.delete(v)})}),c(E(s),"addAll",function(v){return v.forEach(function(w){return s.add(w)})}),c(E(s),"deleteAll",function(v){return v.forEach(function(w){return s.delete(w)})}),s.DS=f,s}return g(r,[{key:"add",value:function(s){if(I(m(r.prototype),"has",this).call(this,s))return this;var f={items:this.elements,item:s};return this.DS.publish("Selected:added:pre",f),I(m(r.prototype),"add",this).call(this,s),s.classList.add(this.DS.stores.SettingsStore.s.selectedClass),s.style.zIndex="".concat((parseInt(s.style.zIndex)||0)+1),this.DS.publish("Selected:added",f),this}},{key:"delete",value:function(s){if(!I(m(r.prototype),"has",this).call(this,s))return!0;var f={items:this.elements,item:s};this.DS.publish("Selected:removed:pre",f);var v=I(m(r.prototype),"delete",this).call(this,s);return s.classList.remove(this.DS.stores.SettingsStore.s.selectedClass),s.style.zIndex="".concat((parseInt(s.style.zIndex)||0)-1),this.DS.publish("Selected:removed",f),v}},{key:"toggle",value:function(s){return this.has(s)?this.delete(s):this.add(s),s}},{key:"elements",get:function(){return Array.from(this.values())}}]),r}(N(Set)),Zd=function(){function d(h){var r=this,p=h.DS;l(this,d),c(this,"_prevSelectedSet",void 0),c(this,"start",function(s){var f=s.event,v=s.isDragging;v||(r._storePrevious(f),r._handleInsideSelection(!0,f))}),c(this,"update",function(s){var f=s.isDragging;f||r.DS.continue||r._handleInsideSelection()}),c(this,"_handleInsideSelection",function(s,f){var v=r.DS,w=v.SelectableSet,k=v.SelectorArea,A=v.Selector,z=r.DS.stores.KeyStore.isMultiSelectKeyPressed(f)&&r.Settings.multiSelectToggling,G=r.Settings.selectionThreshold,de=w.rects,he=A.rect,be=new Map,Z=new Map,oe=re(de),tt;try{for(oe.s();!(tt=oe.n()).done;){var vt=R(tt.value,2),rt=vt[0],St=vt[1];k.isInside(rt,St)&&(Re(St,he,G)?be.set(rt,St):Z.set(rt,St))}}catch(tr){oe.e(tr)}finally{oe.f()}if(!r.DS.continue){var Nn=r.filterSelected({select:be,unselect:Z,selectorRect:he}),rh=Nn.select,nh=Nn.unselect;rh.forEach(function(tr,rr){return Id({element:rr,force:s,multiSelectionToggle:z,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass})}),nh.forEach(function(tr,rr){return Ld({element:rr,force:s,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass,PrevSelectedSet:r._prevSelectedSet})})}}),c(this,"filterSelected",function(s){var f=s.select,v=s.unselect;return s.selectorRect,{select:f,unselect:v}}),this.DS=p,this.Settings=this.DS.stores.SettingsStore.s,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return g(d,[{key:"_storePrevious",value:function(r){var p=this.DS,s=p.stores.KeyStore,f=p.SelectedSet;s.isMultiSelectKeyPressed(r)?this._prevSelectedSet=new Set(f):this._prevSelectedSet=new Set}}]),d}(),qd=function(){function d(h){var r=this,p=h.DS;l(this,d),c(this,"_rect",void 0),c(this,"attachSelector",function(){var s,f;r.HTMLNode&&(s=r.DS.SelectorArea)!==null&&s!==void 0&&s.HTMLNode&&r.DS.SelectorArea.HTMLNode.removeChild(r.HTMLNode),r.HTMLNode=r.DS.stores.SettingsStore.s.selector||Qt(r.DS.stores.SettingsStore.s.customStyles),r.HTMLNode.classList.add(r.DS.stores.SettingsStore.s.selectorClass),r.HTMLNode&&(f=r.DS.SelectorArea)!==null&&f!==void 0&&f.HTMLNode&&r.DS.SelectorArea.HTMLNode.appendChild(r.HTMLNode)}),c(this,"start",function(s){var f=s.isDragging;if(!f){var v=r.DS.stores.PointerStore,w=v.initialValArea;Dn(r.HTMLNode,O(w,1)),r.HTMLNode.style.display="block",r._rect=null}}),c(this,"stop",function(){r.HTMLNode.style.width="0",r.HTMLNode.style.height="0",r.HTMLNode.style.display="none"}),c(this,"update",function(s){var f=s.isDragging;if(!(f||r.DS.continue)){var v=r.DS.stores,w=v.ScrollStore,k=v.PointerStore,A=Vd({scrollAmount:w.scrollAmount,initialPointerPos:k.initialValArea,pointerPos:k.currentValArea});Dn(r.HTMLNode,A),r._rect=null}}),this.DS=p,this.DS.subscribe("Settings:updated:selectorClass",function(s){var f=s.settings;r.HTMLNode.classList.remove(f["selectorClass:pre"]),r.HTMLNode.classList.add(f.selectorClass)}),this.DS.subscribe("Settings:updated:selector",this.attachSelector),this.DS.subscribe("Settings:updated:customStyles",this.attachSelector),this.attachSelector(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return g(d,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),d}(),Gd=function(){function d(h){var r=this,p=h.DS;l(this,d),c(this,"_scrollInterval",void 0),c(this,"_rect",void 0),c(this,"currentEdges",[]),c(this,"start",function(){r.applyElements("append"),r.updatePos()}),c(this,"applyElements",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",f=document.body?"body":"documentElement",v="".concat(s,"Child");r.HTMLNode[v](r.DS.Selector.HTMLNode),document[f][v](r.HTMLNode)}),c(this,"updatePos",function(){r._rect=null;var s=r.DS.Area.rect,f=r.DS.Area.computedBorder,v=r.HTMLNode.style,w="".concat(s.top+f.top,"px"),k="".concat(s.left+f.left,"px"),A="".concat(s.width,"px"),z="".concat(s.height,"px");v.top!==w&&(v.top=w),v.left!==k&&(v.left=k),v.width!==A&&(v.width=A),v.height!==z&&(v.height=z)}),c(this,"stop",function(s){r.stopAutoScroll(),s&&r.applyElements("remove")}),c(this,"startAutoScroll",function(){r.currentEdges=[],r._scrollInterval=setInterval(function(){return r.handleAutoScroll()},16)}),c(this,"handleAutoScroll",function(){if(!r.DS.continue){var s=r.DS,f=s.stores.PointerStore,v=s.Area;r.currentEdges=wn({elementRect:O(f.currentVal),containerRect:r.rect,tolerance:r.DS.stores.SettingsStore.s.overflowTolerance}),r.currentEdges.length&&v.scroll(r.currentEdges,r.DS.stores.SettingsStore.s.autoScrollSpeed)}}),c(this,"stopAutoScroll",function(){r.currentEdges=[],clearInterval(r._scrollInterval)}),c(this,"isInside",function(s,f){return r.DS.Area.HTMLNode.contains(s)&&r.DS.stores.ScrollStore.canScroll?!0:Re(r.rect,f||s.getBoundingClientRect())}),this.DS=p,this.HTMLNode=gt(),this.DS.subscribe("Settings:updated:selectorAreaClass",function(s){var f=s.settings;r.HTMLNode.classList.remove(f["selectorAreaClass:pre"]),r.HTMLNode.classList.add(f.selectorAreaClass)}),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){r.updatePos(),r.stopAutoScroll()})}return g(d,[{key:"isClicked",value:function(r){var p=this.DS.stores.PointerStore,s=r?p.getPointerPosition(r):p.initialVal;return Re({left:s.x,top:s.y,right:s.x,bottom:s.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),d}(),Jd=function(){function d(h){var r=this,p=h.DS;l(this,d),c(this,"_currentValues",new Set),c(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),c(this,"init",function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)}),c(this,"keydown",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:s,key:f}),r._currentValues.add(f),r.DS.publish("KeyStore:down",{event:s,key:f})}),c(this,"keyup",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:s,key:f}),r._currentValues.delete(f),r.DS.publish("KeyStore:up",{event:s,key:f})}),c(this,"stop",function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()}),c(this,"reset",function(){return r._currentValues.clear()}),this.DS=p,this.DS.subscribe("Interaction:init",this.init)}return g(d,[{key:"isMultiSelectKeyPressed",value:function(r){var p=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var s=this.DS.stores.SettingsStore.s.multiSelectKeys.map(function(f){return f.toLocaleLowerCase()});return!!(this.currentValues.some(function(f){return s.includes(f.toLocaleLowerCase())})||r&&s.some(function(f){return r[p._keyMapping[f]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),d}(),Qd=function(){function d(h){var r=this,p=h.DS;l(this,d),c(this,"_isMouseInteraction",!1),c(this,"_initialValArea",void 0),c(this,"_currentValArea",void 0),c(this,"_lastValArea",void 0),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_lastVal",void 0),c(this,"_lastTouch",void 0),c(this,"init",function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})}),c(this,"getPointerPosition",function(s){return Cd({event:r._normalizedEvent(s)})}),c(this,"update",function(s){s&&(r.DS.publish("PointerStore:updated:pre",{event:s}),r.currentVal=r.getPointerPosition(s),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:s}))}),c(this,"stop",function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout(function(){return r._isMouseInteraction=!1},100)}),c(this,"reset",function(s){s&&(r.currentVal=r.lastVal=r.getPointerPosition(s),r.stop(),r.init())}),this.DS=p,this.Settings=p.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:end",function(s){var f=s.event;return r.reset(f)})}return g(d,[{key:"start",value:function(r){r&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(r))}},{key:"_normalizedEvent",value:function(r){return"touches"in r&&r.type!=="touchend"&&(this._lastTouch=r),"touches"in r?this._lastTouch.touches[0]:r}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(r){this._initialVal=r,this._initialValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(r){this._currentVal=r,this._currentValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(r){this._lastVal=r,this._lastValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}}]),d}(),eh=function(){function d(h){var r=this,p=h.DS;l(this,d),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_canScroll",void 0),c(this,"init",function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"start",function(){r._currentVal=r._initialVal=bt(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"update",function(){return r._currentVal=bt(r.DS.stores.SettingsStore.s.area)}),c(this,"stop",function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null}),c(this,"reset",function(){r.stop(),r.start()}),this.DS=p,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return r.start()}),this.DS.subscribe("Interaction:end",function(){return r.reset()})}return g(d,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=pt(this.DS.stores.SettingsStore.s.area)}},{key:"scrollAmount",get:function(){var r=V(this.currentVal,"-",this.initialVal),p=ce(this.DS.stores.SettingsStore.s.zoom),s=V(V(r,"*",p),"-",r);return{x:r.x+s.x,y:r.y+s.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=bt(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),d}(),th=g(function d(h){var r=this,p=h.DS,s=h.settings;l(this,d),c(this,"_settings",{}),c(this,"s",{}),c(this,"update",function(f){var v=f.settings,w=f.init;return r.DS.publish("Settings:updated:pre",a({settings:v},w?{init:w}:{}))}),c(this,"_update",function(f){for(var v=f.settings,w=f.init,k=Od(v,w),A=function(){var he,be=R(G[z],2),Z=be[0],oe=be[1];Z in r._settings||Object.defineProperty(r.s,Z,{get:function(){return r._settings[Z]},set:function(rt){return r.update({settings:c({},Z,rt)})}}),r._settings["".concat(Z,":pre")]=r._settings[Z],r._settings[Z]=oe;var tt={settings:(he={},c(he,Z,r._settings[Z]),c(he,"".concat(Z,":pre"),r._settings["".concat(Z,":pre")]),he)};r.DS.publish("Settings:updated",tt),r.DS.publish("Settings:updated:".concat(Z),tt)},z=0,G=Object.entries(k);z<G.length;z++)A()}),this.DS=p,this.DS.subscribe("Settings:updated:pre",this._update),this.update({settings:s,init:!0})}),En=function(){function d(h){var r=this;l(this,d),c(this,"continue",!1),c(this,"start",function(){r.stopped=!1,r.Interaction.init()}),c(this,"break",function(){return r.continue=!0}),c(this,"setSettings",function(p){return r.stores.SettingsStore.update({settings:p})}),c(this,"getSelection",function(){return r.SelectedSet.elements}),c(this,"getSelectables",function(){return r.SelectableSet.elements}),c(this,"getInitialCursorPosition",function(){return r.stores.PointerStore.initialVal}),c(this,"getCurrentCursorPosition",function(){return r.stores.PointerStore.currentVal}),c(this,"getPreviousCursorPosition",function(){return r.stores.PointerStore.lastVal}),c(this,"getInitialCursorPositionArea",function(){return r.stores.PointerStore.initialValArea}),c(this,"getCurrentCursorPositionArea",function(){return r.stores.PointerStore.currentValArea}),c(this,"getPreviousCursorPositionArea",function(){return r.stores.PointerStore.lastValArea}),c(this,"isMultiSelect",function(p){return r.stores.KeyStore.isMultiSelectKeyPressed(p)}),c(this,"isDragging",function(){return r.Interaction.isDragging}),c(this,"getZoneByCoordinates",function(p){var s;return(s=r.DropZones.getTarget(p))===null||s===void 0?void 0:s.toObject()}),c(this,"getItemsDroppedByZoneId",function(p){return r.DropZones.getItemsDroppedById(p)}),c(this,"getItemsInsideByZoneId",function(p,s){return r.DropZones.getItemsInsideById(p,s)}),this.PubSub=new Kd({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this.stores={},this.stores.SettingsStore=new th({DS:this,settings:h}),this.stores.PointerStore=new Qd({DS:this}),this.stores.ScrollStore=new eh({DS:this}),this.stores.KeyStore=new Jd({DS:this}),this.Area=new Rd({DS:this}),this.Selector=new qd({DS:this}),this.SelectorArea=new Gd({DS:this}),this.SelectableSet=new Wd({DS:this}),this.SelectedSet=new Xd({DS:this}),this.Selection=new Zd({DS:this}),this.Drag=new Hd({DS:this}),this.DropZones=new Ud({DS:this}),this.Interaction=new Yd({DS:this}),zd({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction,DropZones:this.DropZones}),this.subscribe("Interaction:end",function(){return r.continue=!1}),this.start()}return g(d,[{key:"stop",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(r),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),r&&this.SelectableSet.clear(),p&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(r){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ne(r)),s||this.addSelectables(r),p&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(r){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ne(r)),s&&this.removeSelectables(r),p&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(r){var p=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ne(r).forEach(function(v){return p.SelectedSet.has(v)?p.removeSelection(r,s,f):p.addSelection(r,s,f)}),s&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(r){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(r,p,s),this.getSelection()}},{key:"clearSelection",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),r&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(r,p,s){var f=Ne(r);return this.SelectableSet.addAll(f),p&&this.SelectedSet.addAll(f),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}},{key:"setSelectables",value:function(r){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(r,p),this.addSelectables(r,s)}},{key:"removeSelectables",value:function(r,p,s){return this.SelectableSet.deleteAll(Ne(r)),p&&this.removeSelection(r),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}}]),d}();return En.isCollision=Re,En})})(or);var co=or.exports;const ho=lo(co),ir=(n,t,o,i,a)=>(t=Math,o=t.log,i=1024,a=o(n)/o(i)|0,n/t.pow(i,a)).toFixed(0)+" "+(a?"KMGTPEZY"[--a]+"iB":"B"),sr=(n,t=null)=>new Date(n*1e3).toLocaleString(t??navigator.language??"en-US"),uo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},fo=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)],mo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},po=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1)],it=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(n){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[n.direction=="down"?(e.openBlock(),e.createElementBlock("svg",uo,fo)):e.createCommentVNode("",!0),n.direction=="up"?(e.openBlock(),e.createElementBlock("svg",mo,po)):e.createCommentVNode("",!0)]))}}),go=["onClick"],yo=Object.assign({name:"VFToast.vue"},{setup(n){const t=e.inject("emitter"),{getStore:o}=e.inject("storage"),i=e.ref(o("full-screen",!1)),a=c=>c=="error"?"text-red-400 border-red-400 dark:text-red-300 dark:border-red-300":"text-lime-600 border-lime-600 dark:text-lime-300 dark:border-lime-1300",l=e.ref([]),u=c=>{l.value.splice(c,1)},g=c=>{let y=l.value.findIndex(m=>m.id===c);y!==-1&&u(y)};return t.on("vf-toast-clear",()=>{l.value=[]}),t.on("vf-toast-push",c=>{let y=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");c.id=y,l.value.push(c),setTimeout(()=>{g(y)},5e3)}),(c,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([i.value.value?"fixed":"absolute","bottom-0 max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(m,b)=>(e.openBlock(),e.createElementBlock("div",{onClick:S=>u(b),key:m,class:e.normalizeClass([a(m.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 dark:bg-gray-600 border text-xs sm:text-sm rounded cursor-pointer"])},e.toDisplayString(m.label),11,go))),128))]),_:1})],2))}}),Ce=n=>Object.entries(n).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:bo}=ue(),_t=(n,t)=>bo.value+"?"+Ce({q:"preview",adapter:n,path:t}),we=typeof window<"u",ar=we&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),lr=we&&"IntersectionObserver"in window,cr=we&&"classList"in document.createElement("p"),dr=we&&window.devicePixelRatio>1,vo={elements_selector:".lazy",container:ar||we?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},hr=n=>Object.assign({},vo,n),ur=function(n,t){let o;const i="LazyLoad::Initialized",a=new n(t);try{o=new CustomEvent(i,{detail:{instance:a}})}catch{o=document.createEvent("CustomEvent"),o.initCustomEvent(i,!1,!1,{instance:a})}window.dispatchEvent(o)},So=(n,t)=>{if(t)if(!t.length)ur(n,t);else for(let o=0,i;i=t[o];o+=1)ur(n,i)},Se="src",kt="srcset",xt="sizes",fr="poster",He="llOriginalAttrs",mr="data",Dt="loading",pr="loaded",gr="applied",wo="entered",Et="error",yr="native",br="data-",vr="ll-status",J=(n,t)=>n.getAttribute(br+t),_o=(n,t,o)=>{var i=br+t;if(o===null){n.removeAttribute(i);return}n.setAttribute(i,o)},Fe=n=>J(n,vr),Ve=(n,t)=>_o(n,vr,t),st=n=>Ve(n,null),Nt=n=>Fe(n)===null,ko=n=>Fe(n)===Dt,xo=n=>Fe(n)===Et,Ct=n=>Fe(n)===yr,Do=[Dt,pr,gr,Et],Eo=n=>Do.indexOf(Fe(n))>=0,_e=(n,t,o,i)=>{if(n){if(i!==void 0){n(t,o,i);return}if(o!==void 0){n(t,o);return}n(t)}},Ae=(n,t)=>{if(cr){n.classList.add(t);return}n.className+=(n.className?" ":"")+t},fe=(n,t)=>{if(cr){n.classList.remove(t);return}n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},No=n=>{n.llTempImage=document.createElement("IMG")},Co=n=>{delete n.llTempImage},Sr=n=>n.llTempImage,at=(n,t)=>{if(!t)return;const o=t._observer;o&&o.unobserve(n)},Vo=n=>{n.disconnect()},Mo=(n,t,o)=>{t.unobserve_entered&&at(n,o)},Vt=(n,t)=>{n&&(n.loadingCount+=t)},To=n=>{n&&(n.toLoadCount-=1)},wr=(n,t)=>{n&&(n.toLoadCount=t)},Bo=n=>n.loadingCount>0,$o=n=>n.toLoadCount>0,_r=n=>{let t=[];for(let o=0,i;i=n.children[o];o+=1)i.tagName==="SOURCE"&&t.push(i);return t},Mt=(n,t)=>{const o=n.parentNode;if(!o||o.tagName!=="PICTURE")return;_r(o).forEach(t)},kr=(n,t)=>{_r(n).forEach(t)},lt=[Se],xr=[Se,fr],Ue=[Se,kt,xt],Dr=[mr],ct=n=>!!n[He],Er=n=>n[He],Nr=n=>delete n[He],Ie=(n,t)=>{if(ct(n))return;const o={};t.forEach(i=>{o[i]=n.getAttribute(i)}),n[He]=o},Ao=n=>{ct(n)||(n[He]={backgroundImage:n.style.backgroundImage})},Io=(n,t,o)=>{if(!o){n.removeAttribute(t);return}n.setAttribute(t,o)},Me=(n,t)=>{if(!ct(n))return;const o=Er(n);t.forEach(i=>{Io(n,i,o[i])})},Lo=n=>{if(!ct(n))return;const t=Er(n);n.style.backgroundImage=t.backgroundImage},Cr=(n,t,o)=>{Ae(n,t.class_applied),Ve(n,gr),o&&(t.unobserve_completed&&at(n,t),_e(t.callback_applied,n,o))},Vr=(n,t,o)=>{Ae(n,t.class_loading),Ve(n,Dt),o&&(Vt(o,1),_e(t.callback_loading,n,o))},ke=(n,t,o)=>{o&&n.setAttribute(t,o)},Mr=(n,t)=>{ke(n,xt,J(n,t.data_sizes)),ke(n,kt,J(n,t.data_srcset)),ke(n,Se,J(n,t.data_src))},Oo=(n,t)=>{Mt(n,o=>{Ie(o,Ue),Mr(o,t)}),Ie(n,Ue),Mr(n,t)},jo=(n,t)=>{Ie(n,lt),ke(n,Se,J(n,t.data_src))},Po=(n,t)=>{kr(n,o=>{Ie(o,lt),ke(o,Se,J(o,t.data_src))}),Ie(n,xr),ke(n,fr,J(n,t.data_poster)),ke(n,Se,J(n,t.data_src)),n.load()},zo=(n,t)=>{Ie(n,Dr),ke(n,mr,J(n,t.data_src))},Ro=(n,t,o)=>{const i=J(n,t.data_bg),a=J(n,t.data_bg_hidpi),l=dr&&a?a:i;l&&(n.style.backgroundImage=`url("${l}")`,Sr(n).setAttribute(Se,l),Vr(n,t,o))},Ho=(n,t,o)=>{const i=J(n,t.data_bg_multi),a=J(n,t.data_bg_multi_hidpi),l=dr&&a?a:i;l&&(n.style.backgroundImage=l,Cr(n,t,o))},Fo=(n,t,o)=>{const i=J(n,t.data_bg_set);if(!i)return;const a=i.split("|");let l=a.map(u=>`image-set(${u})`);n.style.backgroundImage=l.join(),n.style.backgroundImage===""&&(l=a.map(u=>`-webkit-image-set(${u})`),n.style.backgroundImage=l.join()),Cr(n,t,o)},Tr={IMG:Oo,IFRAME:jo,VIDEO:Po,OBJECT:zo},Uo=(n,t)=>{const o=Tr[n.tagName];o&&o(n,t)},Yo=(n,t,o)=>{const i=Tr[n.tagName];i&&(i(n,t),Vr(n,t,o))},Ko=["IMG","IFRAME","VIDEO","OBJECT"],Wo=n=>Ko.indexOf(n.tagName)>-1,Br=(n,t)=>{t&&!Bo(t)&&!$o(t)&&_e(n.callback_finish,t)},$r=(n,t,o)=>{n.addEventListener(t,o),n.llEvLisnrs[t]=o},Xo=(n,t,o)=>{n.removeEventListener(t,o)},Tt=n=>!!n.llEvLisnrs,Zo=(n,t,o)=>{Tt(n)||(n.llEvLisnrs={});const i=n.tagName==="VIDEO"?"loadeddata":"load";$r(n,i,t),$r(n,"error",o)},Bt=n=>{if(!Tt(n))return;const t=n.llEvLisnrs;for(let o in t){const i=t[o];Xo(n,o,i)}delete n.llEvLisnrs},Ar=(n,t,o)=>{Co(n),Vt(o,-1),To(o),fe(n,t.class_loading),t.unobserve_completed&&at(n,o)},qo=(n,t,o,i)=>{const a=Ct(t);Ar(t,o,i),Ae(t,o.class_loaded),Ve(t,pr),_e(o.callback_loaded,t,i),a||Br(o,i)},Go=(n,t,o,i)=>{const a=Ct(t);Ar(t,o,i),Ae(t,o.class_error),Ve(t,Et),_e(o.callback_error,t,i),o.restore_on_error&&Me(t,Ue),a||Br(o,i)},$t=(n,t,o)=>{const i=Sr(n)||n;if(Tt(i))return;Zo(i,u=>{qo(u,n,t,o),Bt(i)},u=>{Go(u,n,t,o),Bt(i)})},Jo=(n,t,o)=>{No(n),$t(n,t,o),Ao(n),Ro(n,t,o),Ho(n,t,o),Fo(n,t,o)},Qo=(n,t,o)=>{$t(n,t,o),Yo(n,t,o)},At=(n,t,o)=>{Wo(n)?Qo(n,t,o):Jo(n,t,o)},ei=(n,t,o)=>{n.setAttribute("loading","lazy"),$t(n,t,o),Uo(n,t),Ve(n,yr)},Ir=n=>{n.removeAttribute(Se),n.removeAttribute(kt),n.removeAttribute(xt)},ti=n=>{Mt(n,t=>{Ir(t)}),Ir(n)},Lr=n=>{Mt(n,t=>{Me(t,Ue)}),Me(n,Ue)},ri={IMG:Lr,IFRAME:n=>{Me(n,lt)},VIDEO:n=>{kr(n,t=>{Me(t,lt)}),Me(n,xr),n.load()},OBJECT:n=>{Me(n,Dr)}},ni=n=>{const t=ri[n.tagName];if(!t){Lo(n);return}t(n)},oi=(n,t)=>{Nt(n)||Ct(n)||(fe(n,t.class_entered),fe(n,t.class_exited),fe(n,t.class_applied),fe(n,t.class_loading),fe(n,t.class_loaded),fe(n,t.class_error))},ii=(n,t)=>{ni(n),oi(n,t),st(n),Nr(n)},si=(n,t,o,i)=>{o.cancel_on_exit&&ko(n)&&n.tagName==="IMG"&&(Bt(n),ti(n),Lr(n),fe(n,o.class_loading),Vt(i,-1),st(n),_e(o.callback_cancel,n,t,i))},ai=(n,t,o,i)=>{const a=Eo(n);Ve(n,wo),Ae(n,o.class_entered),fe(n,o.class_exited),Mo(n,o,i),_e(o.callback_enter,n,t,i),!a&&At(n,o,i)},li=(n,t,o,i)=>{Nt(n)||(Ae(n,o.class_exited),si(n,t,o,i),_e(o.callback_exit,n,t,i))},ci=["IMG","IFRAME","VIDEO"],Or=n=>n.use_native&&"loading"in HTMLImageElement.prototype,di=(n,t,o)=>{n.forEach(i=>{ci.indexOf(i.tagName)!==-1&&ei(i,t,o)}),wr(o,0)},hi=n=>n.isIntersecting||n.intersectionRatio>0,ui=n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}),fi=(n,t,o)=>{n.forEach(i=>hi(i)?ai(i.target,i,t,o):li(i.target,i,t,o))},mi=(n,t)=>{t.forEach(o=>{n.observe(o)})},pi=(n,t)=>{Vo(n),mi(n,t)},gi=(n,t)=>{!lr||Or(n)||(t._observer=new IntersectionObserver(o=>{fi(o,n,t)},ui(n)))},jr=n=>Array.prototype.slice.call(n),dt=n=>n.container.querySelectorAll(n.elements_selector),yi=n=>jr(n).filter(Nt),bi=n=>xo(n),vi=n=>jr(n).filter(bi),Pr=(n,t)=>yi(n||dt(t)),Si=(n,t)=>{vi(dt(n)).forEach(i=>{fe(i,n.class_error),st(i)}),t.update()},wi=(n,t)=>{we&&(t._onlineHandler=()=>{Si(n,t)},window.addEventListener("online",t._onlineHandler))},_i=n=>{we&&window.removeEventListener("online",n._onlineHandler)},Ye=function(n,t){const o=hr(n);this._settings=o,this.loadingCount=0,gi(o,this),wi(o,this),this.update(t)};Ye.prototype={update:function(n){const t=this._settings,o=Pr(n,t);if(wr(this,o.length),ar||!lr){this.loadAll(o);return}if(Or(t)){di(o,t,this);return}pi(this._observer,o)},destroy:function(){this._observer&&this._observer.disconnect(),_i(this),dt(this._settings).forEach(n=>{Nr(n)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(n){const t=this._settings;Pr(n,t).forEach(i=>{at(i,this),At(i,t,this)})},restoreAll:function(){const n=this._settings;dt(n).forEach(t=>{ii(t,n)})}},Ye.load=(n,t)=>{const o=hr(t);At(n,o)},Ye.resetStatus=n=>{st(n)},we&&So(Ye,window.lazyLoadOptions);const ki={class:"relative flex-auto flex flex-col overflow-hidden"},xi={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Di={class:"absolute"},Ei=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"absolute h-6 w-6 md:h-12 md:w-12 m-auto stroke-neutral-500 fill-white dark:fill-gray-700 dark:stroke-gray-600 z-10",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})],-1),Ni={class:"text-neutral-700 dark:text-neutral-300 p-1 absolute text-center top-4 right-[-2rem] md:top-5 md:right-[-2.4rem] z-20 text-xs"},Ci=["onDblclick","onContextmenu","data-type","data-item","data-index"],Vi={class:"grid grid-cols-12 items-center"},Mi={class:"flex col-span-7 items-center"},Ti={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Bi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],$i={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Ai=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Ii={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Li={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Oi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],ji={class:"grid grid-cols-12 items-center"},Pi={class:"flex col-span-7 items-center"},zi={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Ri=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],Hi={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Fi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Ui={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Yi={class:"col-span-2 text-center"},Ki={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Wi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Xi={class:"relative"},Zi={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},qi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],Gi=["data-src","alt"],Ji={key:2,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Qi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],es={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},ts={class:"break-all"},rs=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(n){const t=n,o=e.inject("emitter"),{setStore:i,getStore:a}=e.inject("storage"),l=e.inject("adapter"),u=C=>C==null?void 0:C.substring(0,3),g=C=>C.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),c=e.ref(null),y=e.ref(null),m=e.ref(0),b=e.ref(null),{t:S}=e.inject("i18n"),x=Math.floor(Math.random()*2**32),D=e.ref(a("full-screen",!1)),N=new Ye;o.on("vf-fullscreen-toggle",()=>{c.value.style.height=null,D.value=!D.value,i("full-screen",D.value)});const E=e.ref("");o.on("vf-search-query",({newQuery:C})=>{E.value=C,C?o.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:C},onSuccess:B=>{B.files.length||o.emit("vf-toast-push",{label:S("No search result found.")})}}):o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let L=null;const $=()=>{L&&clearTimeout(L)},T=e.ref(!0),I=C=>{C.touches.length>1&&(T.value?(b.value.stop(),o.emit("vf-toast-push",{label:S("Drag&Drop: off")})):(b.value.start(),o.emit("vf-toast-push",{label:S("Drag&Drop: on")}),o.emit("vf-explorer-update")),T.value=!T.value)},R=C=>{L=setTimeout(()=>{const B=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:C.target.getBoundingClientRect().x,clientY:C.target.getBoundingClientRect().y});C.target.dispatchEvent(B)},500)},_=C=>{C.type=="dir"?(o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:C.path}})):o.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:C})},M=e.reactive({active:!1,column:"",order:""}),H=(C=!0)=>{let B=[...t.data.files],V=M.column,Y=M.order=="asc"?1:-1;if(!C)return B;const O=(ce,ae)=>typeof ce=="string"&&typeof ae=="string"?ce.toLowerCase().localeCompare(ae.toLowerCase()):ce<ae?-1:ce>ae?1:0;return M.active&&(B=B.slice().sort((ce,ae)=>O(ce[V],ae[V])*Y)),B},X=C=>{M.active&&M.column==C?(M.active=M.order=="asc",M.column=C,M.order="desc"):(M.active=!0,M.column=C,M.order="asc")},W=()=>b.value.getSelection().map(C=>JSON.parse(C.dataset.item)),te=(C,B)=>{if(C.altKey||C.ctrlKey||C.metaKey)return C.preventDefault(),!1;C.dataTransfer.setDragImage(y.value,0,15),C.dataTransfer.effectAllowed="all",C.dataTransfer.dropEffect="copy",C.dataTransfer.setData("items",JSON.stringify(W()))},se=(C,B)=>{C.preventDefault();let V=JSON.parse(C.dataTransfer.getData("items"));if(V.find(Y=>Y.storage!=l.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:V,to:B}})},ne=(C,B)=>{C.preventDefault(),!B||B.type!=="dir"||b.value.getSelection().find(V=>V==C.currentTarget)?(C.dataTransfer.dropEffect="none",C.dataTransfer.effectAllowed="none"):C.dataTransfer.dropEffect="copy"},re=()=>{b.value=new ho({area:c.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),o.on("vf-explorer-update",()=>e.nextTick(()=>{b.value.clearSelection(),b.value.setSelectables(document.getElementsByClassName("vf-item-"+x))})),b.value.subscribe("predragstart",({event:C,isDragging:B})=>{if(B)m.value=b.value.getSelection().length,b.value.break();else{const V=C.target.offsetWidth-C.offsetX,Y=C.target.offsetHeight-C.offsetY;V<15&&Y<15&&(b.value.clearSelection(),b.value.break())}}),b.value.subscribe("predragmove",({isDragging:C})=>{C&&b.value.break()}),b.value.subscribe("callback",({items:C,event:B,isDragging:V})=>{o.emit("vf-nodes-selected",W()),m.value=b.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{b.value.Area.reset(),b.value.SelectorArea.updatePos(),N.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>o.emit("vf-explorer-update"))}),(C,B)=>(e.openBlock(),e.createElementBlock("div",ki,[n.view=="list"||E.value.length?(e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("div",{onClick:B[0]||(B[0]=V=>X("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Name"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="basename"]])]),E.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:B[1]||(B[1]=V=>X("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Size"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="file_size"]])])),E.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:B[2]||(B[2]=V=>X("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Date"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="last_modified"]])])),E.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:B[3]||(B[3]=V=>X("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Filepath"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("div",{ref_key:"dragImage",ref:y,class:"absolute -z-50 -top-96"},[Ei,e.createElementVNode("div",Ni,e.toDisplayString(m.value),1)],512)]),e.createElementVNode("div",{onTouchstart:I,onContextmenu:B[10]||(B[10]=e.withModifiers(V=>e.unref(o).emit("vf-contextmenu-show",{event:V,area:c.value,items:W()}),["self","prevent"])),class:e.normalizeClass([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:c},[E.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:O=>_(V),onTouchstart:B[4]||(B[4]=O=>R(O)),onTouchend:B[5]||(B[5]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(x),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Mi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ti,Bi)):(e.openBlock(),e.createElementBlock("svg",$i,Ai)),e.createElementVNode("span",Ii,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Li,e.toDisplayString(V.path),1)])],42,Ci))),256)):e.createCommentVNode("",!0),n.view=="list"&&!E.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>_(V),onTouchstart:B[6]||(B[6]=O=>R(O)),onTouchend:B[7]||(B[7]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(x),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",ji,[e.createElementVNode("div",Pi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",zi,Ri)):(e.openBlock(),e.createElementBlock("svg",Hi,Fi)),e.createElementVNode("span",Ui,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Yi,e.toDisplayString(V.file_size?e.unref(ir)(V.file_size):""),1),e.createElementVNode("div",Ki,e.toDisplayString(e.unref(sr)(V.last_modified)),1)])],42,Oi))),256)):e.createCommentVNode("",!0),n.view=="grid"&&!E.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H(!1),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>_(V),onTouchstart:B[8]||(B[8]=O=>R(O)),onTouchend:B[9]||(B[9]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(x),"border border-transparent hover:bg-neutral-50 m-1 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 text-center justify-center select-none"]),"data-type":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",null,[e.createElementVNode("div",Xi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Zi,qi)):(V.mime_type??"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(_t)(e.unref(l).value,V.path),alt:V.basename},null,8,Gi)):(e.openBlock(),e.createElementBlock("svg",Ji,Qi)),!(V.mime_type??"").startsWith("image")&&V.type!="dir"?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(u(V.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ts,e.toDisplayString(g(V.basename)),1)])],42,Wi))),256)):e.createCommentVNode("",!0)],34),e.createVNode(yo)]))}}),ns="1.2.1",os={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},is={class:"flex leading-5 items-center"},ss=["aria-label"],as=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})],-1)],ls=["value"],cs={class:"ml-3"},ds={key:0},hs={class:"ml-1"},us={class:"flex leading-5 items-center"},fs={value:"",disabled:""},ms=e.createStaticVNode('<option value="en">English</option><option value="fr">French</option><option value="fa">Persian</option><option value="de">German</option><option value="ru">Russian</option><option value="tr">Turkish</option><option value="tr">Hebrew</option>',7),ps=["aria-label"],gs=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 stroke-slate-500 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)],ys=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),{getStore:o,setStore:i}=e.inject("storage"),a=e.ref(0),l=e.inject("adapter"),{t:u,changeLocale:g}=e.inject("i18n"),c=e.ref(o("locale","")),y=()=>{t.emit("vf-search-exit"),t.emit("vf-fetch",{params:{q:"index",adapter:l.value}}),i("adapter",l.value)};t.on("vf-nodes-selected",b=>{a.value=b.length});const m=e.ref("");return t.on("vf-search-query",({newQuery:b})=>{m.value=b}),(b,S)=>(e.openBlock(),e.createElementBlock("div",os,[e.createElementVNode("div",is,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(u)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},as,8,ss),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=x=>e.isRef(l)?l.value=x:null),onChange:y,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data.storages,x=>(e.openBlock(),e.createElementBlock("option",{value:x},e.toDisplayString(x),9,ls))),256))],544),[[e.vModelSelect,e.unref(l)]]),e.createElementVNode("div",cs,[m.value.length?(e.openBlock(),e.createElementBlock("span",ds,e.toDisplayString(n.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",hs,e.toDisplayString(a.value>0?a.value+" "+e.unref(u)("item(s) selected."):""),1)])]),e.createElementVNode("div",us,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=x=>c.value=x),onChange:S[2]||(S[2]=x=>e.unref(g)(x.target.value)),class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8 mr-3"},[e.createElementVNode("option",fs,e.toDisplayString(e.unref(u)("Language")),1),ms],544),[[e.vModelSelect,c.value]]),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(u)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=x=>e.unref(t).emit("vf-modal-show",{type:"message",title:"Vuefinder "+e.unref(ns),message:e.unref(u)("Vuefinder is a file manager component for vue 3.")}))},gs,8,ps)])]))}}),bs=(n,t=0,o=!1)=>{let i;return(...a)=>{o&&!i&&n(...a),clearTimeout(i),i=setTimeout(()=>{n(...a)},t)}},vs=(n,t,o)=>{const i=e.ref(n);return e.customRef((l,u)=>({get(){return l(),i.value},set:bs(g=>{i.value=g,u()},t,o)}))},Ss={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-xs"},ws=["aria-label"],_s=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1)],ks=["aria-label"],xs=[e.createElementVNode("path",{d:"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z"},null,-1)],Ds=["aria-label"],Es=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ns=["onClick"],Cs=[e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},null,-1)],Vs={class:"flex leading-5"},Ms=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),Ts=["title","onClick"],Bs={key:0,class:"animate-spin p-1 h-6 w-6 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},$s=[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)],As={key:3,class:"relative flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Is=e.createElementVNode("svg",{class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})],-1),Ls=e.createElementVNode("div",{class:"w-full"},null,-1),Os=["onKeydown","placeholder"],js=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ps=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),a=e.ref(null),l=e.ref([]),u=e.ref(!1),g=e.ref(null),{t:c}=e.inject("i18n"),y=e.inject("loadingState");o.on("vf-explorer-update",()=>{let $=[],T=[];a.value=t.data.dirname??i.value+"://",a.value.length==0&&(l.value=[]),a.value.replace(i.value+"://","").split("/").forEach(function(I){$.push(I),$.join("/")!=""&&T.push({basename:I,name:I,path:i.value+"://"+$.join("/"),type:"dir"})}),T.length>4&&(T=T.slice(-5),T[0].name=".."),l.value=T});const m=()=>{u.value=!1,S.value=""};o.on("vf-search-exit",()=>{m()});const b=()=>{u.value=!0,e.nextTick(()=>g.value.focus())},S=vs("",400),x=()=>y.value;e.watch(S,$=>{o.emit("vf-toast-clear"),o.emit("vf-search-query",{newQuery:$})});const D=()=>l.value.length&&!u.value,N=$=>{$.preventDefault();let T=JSON.parse($.dataTransfer.getData("items"));if(T.find(I=>I.storage!=i.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:T,to:l.value[l.value.length-2]??{path:i.value+"://"}}})},E=$=>{$.preventDefault(),D()?$.dataTransfer.dropEffect="copy":($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none")},L=()=>{S.value==""&&m()};return($,T)=>(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("span",{"aria-label":e.unref(c)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:T[0]||(T[0]=I=>E(I)),onDrop:T[1]||(T[1]=I=>N(I)),onClick:T[2]||(T[2]=I=>{var R;return!D()||e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:((R=l.value[l.value.length-2])==null?void 0:R.path)??e.unref(i)+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",D()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},_s,34))],8,ws),x()?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(c)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[4]||(T[4]=I=>e.unref(o).emit("vf-fetch-abort")),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer"},Es))],8,Ds)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(c)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[3]||(T[3]=I=>{e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:n.data.dirname}})}),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"-40 -40 580 580",fill:"currentColor"},xs))],8,ks)),u.value?(e.openBlock(),e.createElementBlock("div",As,[Is,Ls,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:g,onKeydown:e.withKeys(m,["esc"]),onBlur:L,"onUpdate:modelValue":T[6]||(T[6]=I=>e.isRef(S)?S.value=I:null),placeholder:e.unref(c)("Search anything.."),class:"absolute ml-4 pt-1 pb-0 px-2 border-0 ring-0 outline-0 text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,Os),[[e.vModelText,e.unref(S)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:m,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},js))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(b,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[5]||(T[5]=I=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter}})),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Cs)),e.createElementVNode("div",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(I,R)=>(e.openBlock(),e.createElementBlock("div",{key:R},[Ms,e.createElementVNode("span",{class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer",title:I.basename,onClick:_=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:I.path}})},e.toDisplayString(I.name),9,Ts)]))),128))]),x()?(e.openBlock(),e.createElementBlock("svg",Bs,$s)):e.createCommentVNode("",!0)],8,Ns))]))}}),zs=["onClick"],Rs=e.createElementVNode("span",{class:"px-1"},null,-1),Hs=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(n){const t=n,o=e.inject("emitter"),i=e.ref(null),{apiUrl:a}=ue(),l=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),u=e.ref([]);o.on("vf-context-selected",S=>{u.value=S});const{t:g}=e.inject("i18n"),c={newfolder:{title:()=>g("New Folder"),action:()=>{o.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>g("Delete"),action:()=>{o.emit("vf-modal-show",{type:"delete",items:u})}},refresh:{title:()=>g("Refresh"),action:()=>{o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>g("Preview"),action:()=>{o.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:u.value[0]})}},open:{title:()=>g("Open"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].path}})}},openDir:{title:()=>g("Open containing folder"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].dir}})}},download:{title:()=>g("Download"),action:()=>{const S=a.value+"?"+Ce({q:"download",adapter:t.current.adapter,path:u.value[0].path});o.emit("vf-download",S)}},archive:{title:()=>g("Archive"),action:()=>{o.emit("vf-modal-show",{type:"archive",items:u})}},unarchive:{title:()=>g("Unarchive"),action:()=>{o.emit("vf-modal-show",{type:"unarchive",items:u})}},rename:{title:()=>g("Rename"),action:()=>{o.emit("vf-modal-show",{type:"rename",items:u})}}},y=S=>{o.emit("vf-contextmenu-hide"),S.action()},m=e.ref("");o.on("vf-search-query",({newQuery:S})=>{m.value=S}),o.on("vf-contextmenu-show",({event:S,area:x,items:D,target:N=null})=>{if(l.items=[],m.value)if(N)l.items.push(c.openDir),o.emit("vf-context-selected",[N]);else return;else!N&&!m.value?(l.items.push(c.refresh),l.items.push(c.newfolder),o.emit("vf-context-selected",[])):D.length>1&&D.some(E=>E.path===N.path)?(l.items.push(c.refresh),l.items.push(c.archive),l.items.push(c.delete),o.emit("vf-context-selected",D)):(N.type=="dir"?l.items.push(c.open):(l.items.push(c.preview),l.items.push(c.download)),l.items.push(c.rename),N.mime_type=="application/zip"?l.items.push(c.unarchive):l.items.push(c.archive),l.items.push(c.delete),o.emit("vf-context-selected",[N]));b(S,x)}),o.on("vf-contextmenu-hide",()=>{l.active=!1});const b=(S,x)=>{l.active=!0,e.nextTick(()=>{let D=x.getBoundingClientRect(),N=S.pageX,E=S.pageY,L=i.value.offsetHeight,$=i.value.offsetWidth;N=D.right-S.pageX+window.scrollX<$?N-$:N,E=D.bottom-S.pageY+window.scrollY<L?E-L:E,l.positions={left:N+"px",top:E+"px"}})};return(S,x)=>l.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:i,style:e.normalizeStyle(l.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,D=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:D.title,onClick:N=>y(D)},[Rs,e.createElementVNode("span",null,e.toDisplayString(D.title()),1)],8,zs))),128))],4)):e.createCommentVNode("",!0)}}),Fs=(n,t)=>{const o=n[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((i,a)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(a.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function Us(n){const t=await Fs(Object.assign({"../locales/de.json":()=>Promise.resolve().then(()=>wd),"../locales/en.json":()=>Promise.resolve().then(()=>_d),"../locales/fa.json":()=>Promise.resolve().then(()=>kd),"../locales/he.json":()=>Promise.resolve().then(()=>xd),"../locales/ru.json":()=>Promise.resolve().then(()=>Dd),"../locales/tr.json":()=>Promise.resolve().then(()=>Ed)}),`../locales/${n}.json`);return JSON.parse(t.default)}function Ys(n,t,o){const{getStore:i,setStore:a}=wt(n),l=e.ref({}),u=y=>{Us(y).then(m=>{l.value=m,a("locale",y),a("translations",m),o.emit("vf-toast-push",{label:"The language is set to "+y})}).catch(m=>{o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),u("en")})};i("locale")?l.value=i("translations"):u(t);const g=(y,...m)=>m.length?g(y=y.replace("%s",m.shift()),...m):y;function c(y,...m){return l.value.hasOwnProperty(y)?g(l.value[y],...m):g(y,...m)}return{t:c,changeLocale:u}}const Ks={class:"vuefinder"},Ws=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Xs=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},postData:{type:Object,default:{}}},setup(n){const t=n,o=Cn(),{setStore:i,getStore:a}=wt(t.id),l=e.ref(a("adapter"));e.provide("emitter",o),e.provide("storage",wt(t.id)),e.provide("postData",t.postData),e.provide("adapter",l),e.provide("maxFileSize",t.maxFileSize);const u=Ys(t.id,t.locale,o);e.provide("i18n",u);const{apiUrl:g,setApiUrl:c}=ue();c(t.url);const y=e.reactive({adapter:l.value,storages:[],dirname:".",files:[]}),m=e.ref(a("viewport","grid")),b=e.ref(a("darkMode",t.dark));o.on("vf-darkMode-toggle",()=>{b.value=!b.value,i("darkMode",b.value)});const S=e.ref(!1);e.provide("loadingState",S);const x=e.ref(a("full-screen",!1));o.on("vf-fullscreen-toggle",()=>{x.value=!x.value,i("full-screen",x.value)}),o.on("vf-view-toggle",L=>{m.value=L});const D=e.reactive({active:!1,type:"delete",data:{}});o.on("vf-modal-close",()=>{D.active=!1}),o.on("vf-modal-show",L=>{D.active=!0,D.type=L.type,D.data=L});const N=L=>{Object.assign(y,L),o.emit("vf-nodes-selected",{}),o.emit("vf-explorer-update")};let E;return o.on("vf-fetch-abort",()=>{E.abort(),S.value=!1}),o.on("vf-fetch",({params:L,onSuccess:$=null,onError:T=null})=>{["index","search"].includes(L.q)&&(E&&E.abort(),S.value=!0),E=new AbortController;const I=E.signal;ot(g.value,{params:L,signal:I}).then(R=>{l.value=R.adapter,["index","search"].includes(L.q)&&(S.value=!1),o.emit("vf-modal-close"),N(R),$(R)}).catch(R=>{T&&T(R)}).finally(()=>{})}),o.on("vf-download",L=>{document.getElementById("download_frame").src=L,o.emit("vf-modal-close")}),e.onMounted(()=>{o.emit("vf-fetch",{params:{q:"index",adapter:l.value}})}),(L,$)=>(e.openBlock(),e.createElementBlock("div",Ks,[e.createElementVNode("div",{class:e.normalizeClass(b.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([x.value?"fixed w-screen inset-0 z-20":"relative rounded-md","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(x.value?"":"max-height: "+n.maxHeight),onMousedown:$[0]||($[0]=T=>e.unref(o).emit("vf-contextmenu-hide")),onTouchstart:$[1]||($[1]=T=>e.unref(o).emit("vf-contextmenu-hide"))},[e.createVNode(so,{data:y},null,8,["data"]),e.createVNode(Ps,{data:y},null,8,["data"]),e.createVNode(rs,{view:m.value,data:y},null,8,["view","data"]),e.createVNode(ys,{data:y},null,8,["data"])],38),D.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+D.type),{key:0,selection:D.data,current:y},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Hs,{current:y},null,8,["current"]),Ws],2)]))}}),Zs=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 dark:bg-gray-600 dark:bg-opacity-75 bg-opacity-75 transition-opacity"},null,-1),qs={class:"fixed z-10 inset-0 overflow-hidden"},Gs={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl w-full"},Js={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qs={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},me={__name:"ModalLayout",setup(n){const t=e.inject("emitter");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:i[1]||(i[1]=e.withKeys(a=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Zs,e.createElementVNode("div",qs,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:i[0]||(i[0]=e.withModifiers(a=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Gs,[e.createElementVNode("div",Js,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Qs,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},ea=["aria-label"],ta=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)],pe=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(n,{emit:t}){var g;const{t:o}=e.inject("i18n"),i=e.ref(!1),a=e.ref(null),l=e.ref((g=a.value)==null?void 0:g.strMessage);e.watch(l,()=>i.value=!1);const u=()=>{t("hidden"),i.value=!0};return(c,y)=>(e.openBlock(),e.createElementBlock("div",null,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:a,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",n.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(c.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:u,"aria-label":e.unref(o)("Close"),"data-microtip-position":"top-left",role:"tooltip"},ta,8,ea)],2))]))}}),ra={class:"sm:flex sm:items-start"},na=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})])],-1),oa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ia={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},sa={class:"mt-2"},aa={class:"text-sm text-gray-500"},la={class:"flex text-sm text-gray-800 dark:text-gray-400"},ca={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},da=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],ha={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ua=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],fa={class:"ml-1.5"},ma={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},pa=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:a}=e.inject("i18n"),l=e.ref(t.selection.items),u=e.ref(""),g=()=>{l.value.length&&o.emit("vf-fetch",{params:{q:"delete",adapter:i.value,path:t.current.dirname,items:JSON.stringify(l.value.map(({path:c,type:y})=>({path:c,type:y})))},onSuccess:()=>{o.emit("vf-toast-push",{label:a("Files deleted.")})},onError:c=>{u.value=a(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:g,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(a)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:y[1]||(y[1]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Cancel")),1),e.createElementVNode("div",ma,e.toDisplayString(e.unref(a)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ra,[na,e.createElementVNode("div",oa,[e.createElementVNode("h3",ia,e.toDisplayString(e.unref(a)("Delete files")),1),e.createElementVNode("div",sa,[e.createElementVNode("p",aa,e.toDisplayString(e.unref(a)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,m=>(e.openBlock(),e.createElementBlock("p",la,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",ca,da)):(e.openBlock(),e.createElementBlock("svg",ha,ua)),e.createElementVNode("span",fa,e.toDisplayString(m.basename),1)]))),256)),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[0]||(y[0]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ga={class:"sm:flex sm:items-start"},ya=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1),ba={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},va={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Sa={class:"mt-2"},wa={class:"text-sm text-gray-500"},_a=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(n){const t=e.inject("emitter"),{t:o}=e.inject("i18n");return(i,a)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:a[0]||(a[0]=l=>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 l,u;return[e.createElementVNode("div",ga,[ya,e.createElementVNode("div",ba,[e.createElementVNode("h3",va,e.toDisplayString(((l=n.selection)==null?void 0:l.title)??"Title"),1),e.createElementVNode("div",Sa,[e.createElementVNode("p",wa,e.toDisplayString(((u=n.selection)==null?void 0:u.message)??"Message")+".",1)])])])]}),_:1}))}}),ka={class:"sm:flex sm:items-start"},xa=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})])],-1),Da={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ea={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Na={class:"mt-2"},Ca={class:"text-sm text-gray-500"},Va=["onKeyup","placeholder"],Ma=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:a}=e.inject("i18n"),l=e.ref(""),u=e.ref(""),g=()=>{l.value!=""&&o.emit("vf-fetch",{params:{q:"newfolder",adapter:i.value,path:t.current.dirname,name:l.value},onSuccess:()=>{o.emit("vf-toast-push",{label:a("%s is created.",l.value)})},onError:c=>{u.value=a(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:g,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(a)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ka,[xa,e.createElementVNode("div",Da,[e.createElementVNode("h3",Ea,e.toDisplayString(e.unref(a)("New Folder")),1),e.createElementVNode("div",Na,[e.createElementVNode("p",Ca,e.toDisplayString(e.unref(a)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>l.value=m),onKeyup:e.withKeys(g,["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(a)("Folder Name"),type:"text"},null,40,Va),[[e.vModelText,l.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ta={class:"sm:flex sm:items-start"},Ba=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),$a={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Aa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ia={class:"mt-2"},La={class:"text-sm text-gray-500"},Oa=["onKeyup","placeholder"],ja=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:a}=e.inject("i18n"),l=e.ref(""),u=e.ref(""),g=()=>{l.value!=""&&o.emit("vf-fetch",{params:{q:"newfile",adapter:i.value,path:t.current.dirname,name:l.value},onSuccess:()=>{o.emit("vf-toast-push",{label:a("%s is created.",l.value)})},onError:c=>{u.value=a(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:g,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(a)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ta,[Ba,e.createElementVNode("div",$a,[e.createElementVNode("h3",Aa,e.toDisplayString(e.unref(a)("New File")),1),e.createElementVNode("div",Ia,[e.createElementVNode("p",La,e.toDisplayString(e.unref(a)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>l.value=m),onKeyup:e.withKeys(g,["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(a)("File Name"),type:"text"},null,40,Oa),[[e.vModelText,l.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Pa={class:"flex"},za=["aria-label"],Ra={class:"ml-auto mb-2"},Ha={key:0,class:"p-2 border font-normal whitespace-pre-wrap border-gray-200 dark:border-gray-700/50 dark:text-gray-200 rounded min-h-[200px] max-h-[60vh] text-xs overflow-auto"},Fa={key:1},Ua={__name:"Text",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,i=e.ref(""),a=e.ref(""),l=e.ref(null),u=e.ref(!1),{apiUrl:g}=ue(),c=e.ref(""),y=e.ref(!1),{t:m}=e.inject("i18n");e.onMounted(()=>{ot(g.value,{params:{q:"preview",adapter:o.selection.adapter,path:o.selection.item.path},json:!1}).then(D=>{i.value=D,t("load")})});const b=()=>{u.value=!u.value,a.value=i.value,u.value==!0&&e.nextTick(()=>{l.value.focus()})},S=e.inject("postData"),x=()=>{c.value="",y.value=!1,ot(g.value,{method:"POST",params:Object.assign(S,{q:"save",adapter:o.selection.adapter,path:o.selection.item.path,content:a.value}),json:!1}).then(D=>{c.value=m("Updated."),i.value=D,t("load"),u.value=!u.value}).catch(D=>{c.value=m(D.message),y.value=!0})};return(D,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pa,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,za),e.createElementVNode("div",Ra,[u.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:x,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(m)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:N[0]||(N[0]=E=>b())},e.toDisplayString(u.value?e.unref(m)("Cancel"):e.unref(m)("Edit")),1)])]),e.createElementVNode("div",null,[u.value?(e.openBlock(),e.createElementBlock("div",Fa,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:l,"onUpdate:modelValue":N[1]||(N[1]=E=>a.value=E),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,a.value]])])):(e.openBlock(),e.createElementBlock("pre",Ha,e.toDisplayString(i.value),1)),c.value.length?(e.openBlock(),e.createBlock(pe,{key:2,onHidden:N[2]||(N[2]=E=>c.value=""),error:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},qh="";/*!
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(d,h){var r=typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(!r){if(Array.isArray(d)||(r=W(d))||h&&d&&typeof d.length=="number"){r&&(d=r);var g=0,s=function(){};return{s,n:function(){return g>=d.length?{done:!0}:{done:!1,value:d[g++]}},e:function(x){throw x},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,v=!1,w;return{s:function(){r=r.call(d)},n:function(){var x=r.next();return f=x.done,x},e:function(x){v=!0,w=x},f:function(){try{!f&&r.return!=null&&r.return()}finally{if(v)throw w}}}}function C(d,h){if(typeof d!="object"||d===null)return d;var r=d[Symbol.toPrimitive];if(r!==void 0){var g=r.call(d,h||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}function B(d){var h=C(d,"string");return typeof h=="symbol"?h:String(h)}var V=function(h,r,g){var s=h.x,f=h.y,v=g.x,w=g.y,x={"+":{x:s+v,y:f+w},"-":{x:s-v,y:f-w},"*":{x:s*v,y:f*w},"/":{x:s/v,y:f/w}};return x[r]},Y=function(h){return{x:h.left,y:h.top}},O=function(h){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:h.x,top:h.y,right:h.x,bottom:h.y,width:r,height:r}},ce=function(h){return{x:h,y:h}},ae=function(d,h){var r=h;window.addEventListener("resize",r),window.addEventListener("scroll",r);var g=new MutationObserver(r);d.forEach(function(f,v){g.observe(f,{childList:v!==0,attributes:!0})});var s=function(){return jd(g,r)};return{observer:g,callback:r,cleanup:s}},pt=function(d){var h=bt(d);return h.x||h.y?!0:d instanceof Document?d.body?!!(d.body.scrollTop=1):!!(d.documentElement.scrollTop=1):!!(d.scrollTop=1)},gt=function(){var d=document.createElement("div");return d.style.position="fixed",d.style.overflow="hidden",d.style.pointerEvents="none",d.style.zIndex="999999999999999999",d},Qt=function(d){var h=document.createElement("div");return h.style.position="absolute",d||(h.style.background="rgba(0, 175, 255, 0.2)",h.style.border="1px solid rgba(0, 175, 255, 0.8)",h.style.display="none",h.style.pointerEvents="none"),h},yt=function(d,h){var r;return function(){for(var g=arguments.length,s=new Array(g),f=0;f<g;f++)s[f]=arguments[f];var v=function(){r=null,d.apply(void 0,s)};clearTimeout(r),r=setTimeout(v,h)}},er=function(){var d,h,r,g;return{y:((d=document.body)===null||d===void 0?void 0:d.scrollTop)||((h=document.documentElement)===null||h===void 0?void 0:h.scrollTop)||0,x:((r=document.body)===null||r===void 0?void 0:r.scrollLeft)||((g=document.documentElement)===null||g===void 0?void 0:g.scrollLeft)||0}},vn=function(d){var h=function r(g){var s,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,v=(s=g[f])===null||s===void 0?void 0:s.parentNode;return v?(g.push(v),f++,r(g,f)):g};return h([d])},Nd=function(d,h){if(d instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var r=d.getBoundingClientRect();return{top:r.top,left:r.left,bottom:r.bottom,right:r.right,width:(d.clientWidth||r.width)*h,height:(d.clientHeight||r.height)*h}},Sn=function(d,h){var r={top:Number.POSITIVE_INFINITY,left:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,right:Number.NEGATIVE_INFINITY,width:Number.NEGATIVE_INFINITY,height:Number.NEGATIVE_INFINITY};return Ne(d).forEach(function(g){var s=h.getRect(g);r.top=Math.min(r.top,s.top),r.left=Math.min(r.left,s.left),r.bottom=Math.max(r.bottom,s.bottom),r.right=Math.max(r.right,s.right)}),r.height=r.bottom-r.top,r.width=r.right-r.left,r},bt=function(d){return!d||d instanceof Document?er():{x:d.scrollLeft>=0?d.scrollLeft:er().x,y:d.scrollTop>=0?d.scrollTop:er().y}},wn=function(d){var h=d.elementRect,r=d.containerRect,g=d.tolerance,s=g===void 0?{x:0,y:0}:g,f=[];return h.top-s.y<r.top&&f.push("top"),h.left-s.x<r.left&&f.push("left"),h.bottom+s.y>r.bottom&&f.push("bottom"),h.right+s.y>r.right&&f.push("right"),f},Cd=function(d){var h=d.event;return{x:h.clientX,y:h.clientY}},Vd=function(d){var h=d.scrollAmount,r=d.initialPointerPos,g=d.pointerPos,s={};return g.x>r.x-h.x?(s.left=r.x-h.x,s.width=g.x-r.x+h.x):(s.left=g.x,s.width=r.x-g.x-h.x),g.y>r.y-h.y?(s.top=r.y-h.y,s.height=g.y-r.y+h.y):(s.top=g.y,s.height=r.y-g.y-h.y),s},_n=function(h){var r={x:0,y:0},g=window.getComputedStyle(h);if(!g.transform||g.transform==="none")return r;if(g.transform.indexOf("3d")>=0){var s=g.transform.trim().match(/matrix3d\((.*?)\)/);if(s&&s.length){var f,v=(f=s[1])===null||f===void 0?void 0:f.split(",");r.x=parseInt(v[12])||0,r.y=parseInt(v[13])||0}return r}var w=g.transform.trim().match(/matrix\((.*?)\)/);if(w&&w.length){var x,A=(x=w[1])===null||x===void 0?void 0:x.split(",");r.x=parseInt(A[4])||0,r.y=parseInt(A[5])||0}return r},Md=function(h){var r=h.style.transform;if(!r||r.indexOf("translate")<0)return _n(h);var g={x:0,y:0},s=r.trim().match(/translate[3dD]*?\(.*?\)/);if(s){var f,v=(f=s[0])===null||f===void 0?void 0:f.split("(");if(v){var w,x=(w=v[1])===null||w===void 0?void 0:w.split(",");g.x=parseInt(x[0])||0,g.y=parseInt(x[1])||0}}return!g.x&&!g.x?_n(h):g},Td=function(h){var r=h.style,g={x:parseInt(r.left)||0,y:parseInt(r.top)||0};if(!g.x&&!g.x){var s=window.getComputedStyle(h);return{x:parseInt(s.left)||0,y:parseInt(s.top)||0}}return g},Bd=function(d,h){return h?Md(d):Td(d)},$d=function(d){var h=d.element,r=d.edges,g=d.elementRect,s=d.containerRect,f=d.elementPos,v=d.useTransform;r.includes("top")&&et(h,{y:f.y+s.top-g.top,x:f.x},v),r.includes("left")&&et(h,{y:f.y,x:f.x+s.left-g.left},v),r.includes("bottom")&&et(h,{y:f.y+s.bottom-g.bottom,x:f.x},v),r.includes("right")&&et(h,{y:f.y,x:f.x+s.right-g.right},v)},kn=function(d){var h=d.computedStyle,r=d.node,g=h.position,s=g==="absolute"||g==="relative"||g==="fixed";!(r instanceof Document)&&!s&&(r.style.position="relative")},Ad=function(d){var h=d.shiftKey,r=d.keyboardDragSpeed,g=d.zoom,s=d.key,f=d.dragKeys,v=d.scrollDiff,w=d.canScroll,x=d.scrollCallback,A={x:0,y:0},z=h?r*4*g:r*g;return f.left.includes(s)&&(A.x=v.x||-z,!h&&!v.x&&w&&x(["left"],r)),f.right.includes(s)&&(A.x=v.x||z,!h&&!v.x&&w&&x(["right"],r)),f.up.includes(s)&&(A.y=v.y||-z,!h&&!v.y&&w&&x(["top"],r)),f.down.includes(s)&&(A.y=v.y||z,!h&&!v.y&&w&&x(["bottom"],r)),A},Id=function(d){var h=d.element,r=d.force,g=d.multiSelectionToggle,s=d.SelectedSet,f=d.hoverClassName;h.classList.contains(f)&&!r||(s.has(h)?g&&s.delete(h):s.add(h),h.classList.add(f))},Ld=function(d){var h=d.element,r=d.force,g=d.SelectedSet,s=d.PrevSelectedSet,f=d.hoverClassName;if(!h.classList.contains(f)&&!r)return!1;var v=g.has(h),w=s.has(h);v&&!w?g.delete(h):!v&&w&&g.add(h),h.classList.remove(f)},Qe=function(h,r,g){return console.warn('[DragSelect] TypeIssue: setting "'.concat(h,'" is not of type "').concat(r,'".'))},P=function(h,r,g,s){if(r===void 0)return g?c({},h,s):{};if(r===null)return c({},h,null);var f=!0,v=!1,w=typeof s=="string";w&&(f=typeof r=="string"||r instanceof String),w&&!f&&(v=!0,Qe(h,"string"));var x=!Number.isNaN(s)&&typeof s=="number";x&&(f=!Number.isNaN(r)&&typeof r=="number"),x&&!f&&(v=!0,Qe(h,"number"));var A=Object.prototype.toString.call(s)==="[object Object]";A&&(f=Object.prototype.toString.call(r)==="[object Object]"),A&&!f&&(v=!0,Qe(h,"object"));var z=typeof s=="boolean";z&&(f=typeof r=="boolean"),z&&!f&&(v=!0,Qe(h,"boolean"));var G=Array.isArray(s);G&&(f=Array.isArray(r)),G&&!f&&(v=!0,Qe(h,"array"));var de=v||g;return h==="dragKeys"&&f?c({},h,Object.assign(s,r)):h==="dragKeys"&&!f?de?c({},h,s):{}:(h==="dropZones"&&f&&new Set(r.map(function(he){return he.id})).size!==r.length&&console.warn('[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.'),f?c({},h,r):de?c({},h,s):{})},Od=function(d,h){return l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l({},P("area",d.area,h,document)),P("selectables",d.selectables,h,null)),P("autoScrollSpeed",d.autoScrollSpeed,h,5)),P("overflowTolerance",d.overflowTolerance,h,{x:25,y:25})),P("zoom",d.zoom,h,1)),P("customStyles",d.customStyles,h,!1)),P("multiSelectMode",d.multiSelectMode,h,!1)),P("multiSelectToggling",d.multiSelectToggling,h,!0)),P("multiSelectKeys",d.multiSelectKeys,h,["Control","Shift","Meta"])),P("selector",d.selector,h,null)),P("selectionThreshold",d.selectionThreshold,h,0)),P("draggability",d.draggability,h,!0)),P("immediateDrag",d.immediateDrag,h,!0)),P("keyboardDrag",d.keyboardDrag,h,!0)),P("dragKeys",d.dragKeys,h,{up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]})),P("keyboardDragSpeed",d.keyboardDragSpeed,h,10)),P("useTransform",d.useTransform,h,!0)),P("refreshMemoryRate",d.refreshMemoryRate,h,80)),P("dropZones",d.dropZones,h,[])),P("dropInsideThreshold",d.dropInsideThreshold,h,1)),P("dropTargetThreshold",d.dropTargetThreshold,h,0)),P("usePointerEvents",d.usePointerEvents,h,!1)),P("hoverClass",d.hoverClass,h,"ds-hover")),P("selectableClass",d.selectableClass,h,"ds-selectable")),P("selectedClass",d.selectedClass,h,"ds-selected")),P("selectorClass",d.selectorClass,h,"ds-selector")),P("selectorAreaClass",d.selectorAreaClass,h,"ds-selector-area")),P("droppedTargetClass",d.droppedTargetClass,h,"ds-dropped-target")),P("droppedInsideClass",d.droppedInsideClass,h,"ds-dropped-inside")),P("droppableClass",d.droppableClass,h,"ds-droppable")),P("dropZoneClass",d.dropZoneClass,h,"ds-dropzone")),P("dropZoneReadyClass",d.dropZoneReadyClass,h,"ds-dropzone-ready")),P("dropZoneTargetClass",d.dropZoneTargetClass,h,"ds-dropzone-target")),P("dropZoneInsideClass",d.dropZoneInsideClass,h,"ds-dropzone-inside")),P("dragAsBlock",d.dragAsBlock,h,!1))},Re=function(d,h){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=d;if(r>0){var s=(d.right-d.left)*r,f=(d.bottom-d.top)*r;g={left:d.left+s,right:d.right-s,top:d.top+f,bottom:d.bottom-f}}return g.left<h.right&&g.right>h.left&&g.top<h.bottom&&g.bottom>h.top},xn=function(d){var h=d.element,r=d.posDirection,g=d.containerRect,s=d.useTransform,f=Bd(h,s),v=V(f,"+",r);et(h,v,s);var w=h.getBoundingClientRect(),x=wn({elementRect:w,containerRect:g});$d({element:h,edges:x,elementRect:w,containerRect:g,elementPos:v,useTransform:s})},jd=function(d,h){window.removeEventListener("resize",h),window.removeEventListener("scroll",h),d.disconnect()},Pd=function(d,h,r){if(h.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,s=d instanceof Document?g||document.body:d,f=h.includes("top")&&s.scrollTop>0,v=h.includes("bottom")&&s.scrollTop<s.scrollHeight,w=h.includes("left")&&s.scrollLeft>0,x=h.includes("right")&&s.scrollLeft<s.scrollWidth;f&&(s.scrollTop-=1*r),v&&(s.scrollTop+=1*r),w&&(s.scrollLeft-=1*r),x&&(s.scrollLeft+=1*r)}},et=function(d,h,r){if(r){var g=d.style.transform;d.style.transform="translate3d(".concat(h.x,"px,").concat(h.y,"px,1px) ").concat(g.replace(/translate.*?\)/g,""))}else d.style.left="".concat(h.x,"px"),d.style.top="".concat(h.y,"px");return d},zd=function(d){for(var h=d.subscribe,r=d.publish,g=d.Interaction,s=d.SelectedSet,f=d.DropZones,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(G){return G.event}}],"Interaction:end":[{name:"callback",extraData:function(){var G=f.getTarget();return l({},G?{dropTarget:G.toObject()}:{})}}]},w=function(){var G=R(A[x],2),de=G[0],he=G[1];["pre",!1].forEach(function(be){return h(be?"".concat(de,":").concat(be):de,function(Z){return he.forEach(function(oe){return(!oe.condition||oe.condition(Z))&&r(be?"".concat(be).concat(oe.name):oe.name,l(l({items:s.elements,isDragging:g.isDragging},Z),oe.extraData?oe.extraData(Z):{}))})})})},x=0,A=Object.entries(v);x<A.length;x++)w()},Ne=function(d){return d?!Array.isArray(d)&&(d instanceof HTMLElement||d instanceof SVGElement)?[d]:k(new Set(k(d))):[]},Dn=function(d,h){d.style.left="".concat(h.left,"px"),d.style.top="".concat(h.top,"px"),d.style.width="".concat(h.width,"px"),d.style.height="".concat(h.height,"px")},Rd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"DS",void 0),c(this,"_observers",void 0),c(this,"_node",void 0),c(this,"_parentNodes",void 0),c(this,"_computedStyle",void 0),c(this,"_computedBorder",void 0),c(this,"_rect",void 0),c(this,"setArea",function(s){r.reset(),r._node=s,kn({computedStyle:r.computedStyle,node:r._node}),setTimeout(function(){r.DS.PubSub.publish("Area:modified:pre",{item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{item:r})})}),c(this,"start",function(){r._observers=ae(r.parentNodes,yt(function(s){r.DS.PubSub.publish("Area:modified:pre",{event:s,item:r}),r.reset(),r.DS.PubSub.publish("Area:modified",{event:s,item:r})},60))}),c(this,"reset",function(){r._computedStyle=void 0,r._rect=void 0,r._computedBorder=void 0,r._parentNodes=void 0}),c(this,"stop",function(){r._observers.cleanup(),r.reset()}),c(this,"scroll",function(s,f){var v={scroll_directions:s,scroll_multiplier:f};r.DS.PubSub.publish("Area:scroll:pre",v),Pd(r._node,s,f),r.DS.PubSub.publish("Area:scroll",v)}),this.DS=g,this.setArea(this.DS.stores.SettingsStore.s.area),this.DS.PubSub.subscribe("Settings:updated:area",function(s){var f=s.settings;r.setArea(f.area)}),this.DS.PubSub.subscribe("Interaction:init",this.start),this.DS.PubSub.subscribe("Interaction:end",this.reset)}return p(d,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof Document?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=Nd(this.HTMLNode,this.DS.stores.SettingsStore.s.zoom)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=vn(this.HTMLNode)}}]),d}(),Hd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_prevCursorPos",void 0),c(this,"_prevScrollPos",void 0),c(this,"_elements",[]),c(this,"_dragKeys",void 0),c(this,"_dragKeysFlat",[]),c(this,"_selectionRect",void 0),c(this,"assignDragkeys",function(){r._dragKeys={up:r.DS.stores.SettingsStore.s.dragKeys.up.map(function(s){return s.toLowerCase()}),down:r.DS.stores.SettingsStore.s.dragKeys.down.map(function(s){return s.toLowerCase()}),left:r.DS.stores.SettingsStore.s.dragKeys.left.map(function(s){return s.toLowerCase()}),right:r.DS.stores.SettingsStore.s.dragKeys.right.map(function(s){return s.toLowerCase()})},r._dragKeysFlat=[].concat(k(r._dragKeys.up),k(r._dragKeys.down),k(r._dragKeys.left),k(r._dragKeys.right))}),c(this,"keyboardDrag",function(s){var f=s.event,v=s.key,w=v.toLowerCase();if(!(!r.DS.stores.SettingsStore.s.keyboardDrag||!r._dragKeysFlat.includes(w)||!r.DS.SelectedSet.size||!r.DS.stores.SettingsStore.s.draggability||r.DS.continue)){var x={event:f,isDragging:!0,isDraggingKeyboard:!0};r.DS.publish(["Interaction:start:pre","Interaction:start"],x),r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=Sn(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0);var A=Ad({shiftKey:r.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:r.DS.stores.SettingsStore.s.keyboardDragSpeed,zoom:r.DS.stores.SettingsStore.s.zoom,key:w,scrollCallback:r.DS.Area.scroll,scrollDiff:r._scrollDiff,canScroll:r.DS.stores.ScrollStore.canScroll,dragKeys:r._dragKeys});r.DS.stores.SettingsStore.s.dragAsBlock&&(A=r.limitDirection(A)),r._elements.forEach(function(z){return xn({element:z,posDirection:A,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})}),r.DS.publish(["Interaction:update:pre","Interaction:update"],x)}}),c(this,"keyboardEnd",function(s){var f=s.event,v=s.key,w=v.toLowerCase();if(!(!r.DS.stores.SettingsStore.s.keyboardDrag||!r._dragKeysFlat.includes(w)||!r.DS.SelectedSet.size||!r.DS.stores.SettingsStore.s.draggability)){var x={event:f,isDragging:r.DS.stores.SettingsStore.s.draggability,isDraggingKeyboard:!0};r.DS.publish(["Interaction:end:pre","Interaction:end"],x)}}),c(this,"start",function(s){var f=s.isDragging,v=s.isDraggingKeyboard;!f||v||(r._prevCursorPos=null,r._prevScrollPos=null,r._elements=r.DS.getSelection(),r.DS.stores.SettingsStore.s.dragAsBlock&&(r._selectionRect=Sn(r._elements,r.DS.SelectableSet)),r.handleZIndex(!0))}),c(this,"stop",function(s){s!=null&&s.isKeyboard||(r._prevCursorPos=null,r._prevScrollPos=null,r.handleZIndex(!1),r._elements=[])}),c(this,"update",function(s){var f=s.isDragging,v=s.isDraggingKeyboard;if(!(!f||!r._elements.length||v||r.DS.continue)){var w=V(r._cursorDiff,"+",r._scrollDiff);r.DS.stores.SettingsStore.s.dragAsBlock&&(w=r.limitDirection(w)),r._elements.forEach(function(x){return xn({element:x,posDirection:w,containerRect:r.DS.SelectorArea.rect,useTransform:r.DS.stores.SettingsStore.s.useTransform})})}}),c(this,"limitDirection",function(s){var f=r.DS.SelectorArea.rect,v=r.DS.stores.ScrollStore.scrollAmount,w={top:f.top-r._selectionRect.top+v.y,left:f.left-r._selectionRect.left+v.x,bottom:f.bottom-r._selectionRect.bottom+v.y,right:f.right-r._selectionRect.right+v.x};return s.x===0&&s.y===0||(s.y<0&&(s.y=Math.max(s.y,w.top)),s.x<0&&(s.x=Math.max(s.x,w.left)),s.y>0&&(s.y=Math.min(s.y,w.bottom)),s.x>0&&(s.x=Math.min(s.x,w.right)),r._selectionRect.top+=s.y,r._selectionRect.bottom+=s.y,r._selectionRect.left+=s.x,r._selectionRect.right+=s.x),s}),c(this,"handleZIndex",function(s){r._elements.forEach(function(f){return f.style.zIndex="".concat((parseInt(f.style.zIndex)||0)+s?9999:-9998)})}),this.DS=g,this.DS.subscribe("Settings:updated:dragKeys",this.assignDragkeys),this.assignDragkeys(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return p(d,[{key:"_cursorDiff",get:function(){var r=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?V(r,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=r,g}},{key:"_scrollDiff",get:function(){var r=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?V(r,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=r,g}}]),d}(),Fd=function(){function d(h){var r=this,g=h.DS,s=h.id,f=h.element,v=h.droppables;a(this,d),c(this,"id",void 0),c(this,"element",void 0),c(this,"_droppables",void 0),c(this,"_rect",void 0),c(this,"_observers",void 0),c(this,"_timeout",void 0),c(this,"_itemsDropped",[]),c(this,"_itemsInside",void 0),c(this,"setReadyClasses",function(w){if(!r.isDestroyed){var x=r.droppables.filter(function(A){return r.DS.SelectedSet.has(A)});x.length&&(x.forEach(function(A){A.classList[w]("".concat(r.Settings.droppableClass)),A.classList[w]("".concat(r.Settings.droppableClass,"-").concat(r.id))}),r.element.classList[w]("".concat(r.Settings.dropZoneReadyClass)))}}),c(this,"handleNoDrop",function(){var w;r.isDestroyed||(r.DS.SelectedSet.forEach(function(x){x.classList.remove(r.Settings.droppedTargetClass),x.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),r._itemsDropped=r._itemsDropped.filter(function(x){return!r.DS.SelectedSet.has(x)}),(w=r._itemsDropped)!==null&&w!==void 0&&w.length||r.element.classList.remove("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleDrop",function(){var w,x,A;r.isDestroyed||(r._itemsDropped=k(new Set([].concat(k(r._itemsDropped),k((w=r.droppables)===null||w===void 0?void 0:w.filter(function(z){return r.DS.SelectedSet.has(z)}))))),(x=r._itemsDropped)===null||x===void 0||x.forEach(function(z){z.classList.add("".concat(r.Settings.droppedTargetClass)),z.classList.add("".concat(r.Settings.droppedTargetClass,"-").concat(r.id))}),(A=r._itemsDropped)!==null&&A!==void 0&&A.length&&r.element.classList.add("".concat(r.Settings.dropZoneTargetClass)))}),c(this,"handleItemsInsideClasses",function(){var w=!1;r.droppables.forEach(function(x){r.itemsInside.includes(x)?(x.classList.add("".concat(r.Settings.droppedInsideClass)),x.classList.add("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),w=!0):(x.classList.remove("".concat(r.Settings.droppedInsideClass,"-").concat(r.id)),x.className.includes("".concat(r.Settings.droppedInsideClass,"-"))||x.classList.remove("".concat(r.Settings.droppedInsideClass)))}),w?r.element.classList.add("".concat(r.Settings.dropZoneInsideClass)):r.element.classList.remove("".concat(r.Settings.dropZoneInsideClass))}),c(this,"start",function(w){var x=w.isDragging;!x||r.isDestroyed||r.setReadyClasses("add")}),c(this,"stop",function(w){var x=w.isDragging;!x||r.isDestroyed||(r.setReadyClasses("remove"),r.handleItemsInsideClasses())}),c(this,"toObject",function(){return{id:r.id,element:r.element,droppables:r.droppables,itemsDropped:r.itemsDropped,itemsInside:r.itemsInside}}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.id=s,this.element=f,v&&(this.droppables=Ne(v)),this.element.classList.add("".concat(this.Settings.dropZoneClass)),this.DS.subscribe("Settings:updated:dropZoneClass",function(w){var x=w.settings;r.element&&(r.element.classList.remove(x["dropZoneClass:pre"]),r.element.classList.add(x.dropZoneClass))}),this._observers=ae(this.parentNodes,yt(function(){return r._rect=null},this.Settings.refreshMemoryRate)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop)}return p(d,[{key:"destroy",value:function(){var r=this;this._observers.cleanup(),this.element.classList.remove("".concat(this.Settings.dropZoneClass)),this.element.classList.remove("".concat(this.Settings.dropZoneTargetClass)),this.element.classList.remove("".concat(this.Settings.dropZoneReadyClass)),this.droppables.forEach(function(g){g.classList.remove("".concat(r.Settings.droppedTargetClass)),g.classList.remove("".concat(r.Settings.droppedTargetClass,"-").concat(r.id)),g.classList.remove("".concat(r.Settings.droppableClass)),g.classList.remove("".concat(r.Settings.droppableClass,"-").concat(r.id))}),this.DS.unsubscribe("Interaction:start",this.start),this.DS.unsubscribe("Interaction:end",this.stop),this.element=null,this.droppables=null,this.id=null,this._itemsDropped=null,this._itemsInside=null,this.isDestroyed=!0}},{key:"rect",get:function(){return this.isDestroyed?null:this._rect?this._rect:this._rect=this.element.getBoundingClientRect()}},{key:"itemsDropped",get:function(){return this.isDestroyed?null:this._itemsDropped}},{key:"itemsInside",get:function(){var r=this;return this.isDestroyed?null:this._itemsInside?this._itemsInside:(this._itemsInside=this.droppables.flatMap(function(g){return Re(r.DS.SelectableSet.rects.get(g),r.rect,r.Settings.dropInsideThreshold)?[g]:[]}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return r._itemsInside=null},this.Settings.refreshMemoryRate),this._itemsInside)}},{key:"parentNodes",get:function(){return this._parentNodes?this._parentNodes:this._parentNodes=vn(this.element)}},{key:"droppables",get:function(){return this._droppables?this._droppables:this.DS.SelectableSet.elements},set:function(r){this._droppables=r}}]),d}(),Ud=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"_zoneByElement",new Map),c(this,"_zoneById",new Map),c(this,"_zonesByDroppable",new Map),c(this,"_zones",void 0),c(this,"setDropZones",function(s){var f=s.dropZones;f&&(r._zones&&r._zones.forEach(function(v){return v.destroy()}),r._zones=f.map(function(v){return new Fd(l({DS:r.DS},v))}),r._zones.forEach(function(v){r._zoneByElement.set(v.element,v),r._zoneById.set(v.id,v),v.droppables.forEach(function(w){var x=r._zonesByDroppable.get(w);if(!(x!=null&&x.length))return r._zonesByDroppable.set(w,[v]);r._zonesByDroppable.set(w,k(new Set([].concat(k(x),[v]))))})}))}),c(this,"_handleDrop",function(s){r._zones.forEach(function(f){f!==s&&f.handleNoDrop()}),s&&s.handleDrop()}),c(this,"_getZoneByElementsFromPoint",function(s,f){for(var v=f.x,w=f.y,x=0,A=s.length;x<A;x++){var z=r._zoneByElement.get(s[x]);if(z&&Re(z.rect,{left:v,right:v,top:w,bottom:w},Math.min(r.Settings.dropTargetThreshold,.5)))return z}}),c(this,"stop",function(s){var f=s.isDragging;if(f){var v=r.getTarget();r._handleDrop(v)}}),c(this,"getItemsDroppedById",function(s){var f=r._zoneById.get(s);return f?f.itemsDropped:console.warn("[DragSelect] No zone found (id: ".concat(s,")"))}),c(this,"getItemsInsideById",function(s,f){var v=r._zoneById.get(s);if(!v)return console.warn("[DragSelect] No zone found (id: ".concat(s,")"));var w=v.itemsInside;return f&&v.handleItemsInsideClasses(),w}),c(this,"getTarget",function(s){var f;if((f=r._zones)!==null&&f!==void 0&&f.length){var v=(s==null?void 0:s.x)||r.DS.stores.PointerStore.currentVal.x,w=(s==null?void 0:s.y)||r.DS.stores.PointerStore.currentVal.y,x=document.elementsFromPoint(v,w);return r._getZoneByElementsFromPoint(x,{x:v,y:w})}}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:dropZones",function(s){var f=s.settings;return r.setDropZones(f)}),this.setDropZones({dropZones:this.DS.stores.SettingsStore.s.dropZones}),this.DS.subscribe("Interaction:end",this.stop)}),Yd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"isInteracting",void 0),c(this,"isDragging",void 0),c(this,"init",function(){return r.DS.publish("Interaction:init:pre",{})}),c(this,"_init",function(){r.stop(),r.Settings.usePointerEvents?r.DS.Area.HTMLNode.addEventListener("pointerdown",r.start,{passive:!1}):r.DS.Area.HTMLNode.addEventListener("mousedown",r.start),r.DS.Area.HTMLNode.addEventListener("touchstart",r.start,{passive:!1}),r.DS.publish("Interaction:init",{})}),c(this,"start",function(s){return r.DS.publish("Interaction:start:pre",{event:s,isDragging:r.isDragging})}),c(this,"_start",function(s){s.type==="touchstart"&&s.preventDefault(),r._canInteract(s)&&(r.isInteracting=!0,r.isDragging=r.isDragEvent(s),r.DS.publish("Interaction:start",{event:s,isDragging:r.isDragging}),r.Settings.usePointerEvents?(document.addEventListener("pointerup",r.reset),document.addEventListener("pointercancel",r.reset)):document.addEventListener("mouseup",r.reset),document.addEventListener("touchend",r.reset))}),c(this,"isDragEvent",function(s){var f=s.target.closest(".".concat(r.Settings.selectableClass));return!r.Settings.draggability||r.DS.stores.KeyStore.isMultiSelectKeyPressed(s)||!f?!1:(r.Settings.immediateDrag&&(r.DS.SelectedSet.size?r.DS.SelectedSet.has(f)||(r.DS.SelectedSet.clear(),r.DS.SelectedSet.add(f)):r.DS.SelectedSet.add(f)),!!r.DS.SelectedSet.has(f))}),c(this,"onClick",function(s){var f=s.event;if(r._canInteract(f)&&!(f.detail>0)){var v=r.DS,w=v.stores,x=w.PointerStore,A=w.KeyStore,z=v.SelectableSet,G=v.SelectedSet;x.start(f);var de=f.target;z.has(de)&&(A.isMultiSelectKeyPressed(f)||G.clear(),G.toggle(de),r.reset())}}),c(this,"stop",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.DS.Area.HTMLNode;r.isInteracting=!1,r.isDragging=!1,r.Settings.usePointerEvents?(s.removeEventListener("pointerdown",r.start,{passive:!1}),document.removeEventListener("pointerup",r.reset),document.removeEventListener("pointercancel",r.reset)):(s.removeEventListener("mousedown",r.start),document.removeEventListener("mouseup",r.reset)),s.removeEventListener("touchstart",r.start,{passive:!1}),document.removeEventListener("touchend",r.reset)}),c(this,"update",function(s){var f=s.event,v=s.scroll_directions,w=s.scroll_multiplier;r.isInteracting&&r.DS.publish(["Interaction:update:pre","Interaction:update"],{event:f,scroll_directions:v,scroll_multiplier:w,isDragging:r.isDragging})}),c(this,"reset",function(s){return r.DS.publish("Interaction:end:pre",{event:s,isDragging:r.isDragging})}),c(this,"_reset",function(s){var f=r.isDragging;r.stop(),r.init(),r.DS.publish("Interaction:end",{event:s,isDragging:f})}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Settings:updated:area",function(s){var f=s.settings;r.stop(f["area:pre"]),r.init()}),this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:start:pre",function(s){var f=s.event;return r._start(f)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(s){var f=s.event;return r._reset(f)}),this.DS.subscribe("Area:scroll",this.update)}return p(d,[{key:"_canInteract",value:function(r){var g=r.clientX===0&&r.clientY===0&&r.detail===0&&r.target;return!(r.button===2||this.isInteracting||r.target&&!this.DS.SelectorArea.isInside(r.target)||!g&&!this.DS.SelectorArea.isClicked(r))}}]),d}(),Kd=p(function d(h){var r=this,g=h.DS;a(this,d),c(this,"subscribers",{}),c(this,"subscribe",function(s,f){return Array.isArray(r.subscribers[s])||(r.subscribers[s]=[]),r.subscribers[s].push(f),r.subscribers[s].length-1}),c(this,"unsubscribe",function(s,f,v){v>=0?r.subscribers[s].splice(v,1):f&&(r.subscribers[s]=r.subscribers[s].filter(function(w){return w!==f}))}),c(this,"publish",function(s,f){Array.isArray(s)?s.forEach(function(v){return r._publish(v,f)}):r._publish(s,f)}),c(this,"_publish",function(s,f){var v=r.subscribers[s];Array.isArray(v)&&(s.includes(":pre")?r._handlePrePublish(v,f):r._handlePublish(v,f))}),c(this,"_handlePublish",function(s,f){for(var v=0,w=s.length;v<w;v++){if(r.DS.stopped)return;s[v](f)}}),c(this,"_handlePrePublish",function(s,f){for(var v=s.length;v--;){if(r.DS.stopped)return;s[v](f)}}),this.DS=g}),Wd=function(d){y(r,d);var h=$(r);function r(g){var s,f=g.DS;return a(this,r),s=h.call(this),c(D(s),"_rects",void 0),c(D(s),"_timeout",void 0),c(D(s),"init",function(){return Ne(s.Settings.selectables).forEach(function(v){return s.add(v)})}),c(D(s),"clear",function(){return s.forEach(function(v){return s.delete(v)})}),c(D(s),"_onClick",function(v){return s.DS.publish(["Selectable:click:pre","Selectable:click"],{event:v})}),c(D(s),"_onPointer",function(v){return s.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:v})}),c(D(s),"addAll",function(v){return v.forEach(function(w){return s.add(w)})}),c(D(s),"deleteAll",function(v){return v.forEach(function(w){return s.delete(w)})}),c(D(s),"getRect",function(v){return s._rects?s.rects.get(v):v.getBoundingClientRect()}),s.DS=f,s.Settings=f.stores.SettingsStore.s,s.DS.subscribe("Interaction:init",s.init),s.DS.PubSub.subscribe("Settings:updated:selectables",function(){s.clear(),s.init()}),s.DS.subscribe("Settings:updated:selectableClass",function(v){var w=v.settings;s.forEach(function(x){x.classList.remove(w["selectableClass:pre"]),x.classList.add(w.selectableClass)})}),s}return p(r,[{key:"add",value:function(s){if(I(m(r.prototype),"has",this).call(this,s))return this;var f={items:this.elements,item:s};return this.DS.publish("Selectable:added:pre",f),s.classList.add(this.Settings.selectableClass),s.addEventListener("click",this._onClick),this.Settings.usePointerEvents?s.addEventListener("pointerdown",this._onPointer,{passive:!1}):s.addEventListener("mousedown",this._onPointer),s.addEventListener("touchstart",this._onPointer,{passive:!1}),this.Settings.draggability&&!this.Settings.useTransform&&kn({computedStyle:window.getComputedStyle(s),node:s}),I(m(r.prototype),"add",this).call(this,s),this.DS.publish("Selectable:added",f),this}},{key:"delete",value:function(s){if(!I(m(r.prototype),"has",this).call(this,s))return!0;var f={items:this.elements,item:s};return this.DS.publish("Selectable:removed:pre",f),s.classList.remove(this.Settings.selectableClass),s.classList.remove(this.Settings.hoverClass),s.removeEventListener("click",this._onClick),this.Settings.usePointerEvents?s.removeEventListener("pointerdown",this._onPointer,{passive:!1}):s.removeEventListener("mousedown",this._onPointer),s.removeEventListener("touchstart",this._onPointer,{passive:!1}),I(m(r.prototype),"delete",this).call(this,s),this.DS.publish("Selectable:removed",f),!0}},{key:"elements",get:function(){return Array.from(this.values())}},{key:"rects",get:function(){var s=this;return this._rects?this._rects:(this._rects=new Map,this.forEach(function(f){return s._rects.set(f,f.getBoundingClientRect())}),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){return s._rects=null},this.Settings.refreshMemoryRate),this._rects)}}]),r}(N(Set)),Xd=function(d){y(r,d);var h=$(r);function r(g){var s,f=g.DS;return a(this,r),s=h.call(this),c(D(s),"clear",function(){return s.forEach(function(v){return s.delete(v)})}),c(D(s),"addAll",function(v){return v.forEach(function(w){return s.add(w)})}),c(D(s),"deleteAll",function(v){return v.forEach(function(w){return s.delete(w)})}),s.DS=f,s}return p(r,[{key:"add",value:function(s){if(I(m(r.prototype),"has",this).call(this,s))return this;var f={items:this.elements,item:s};return this.DS.publish("Selected:added:pre",f),I(m(r.prototype),"add",this).call(this,s),s.classList.add(this.DS.stores.SettingsStore.s.selectedClass),s.style.zIndex="".concat((parseInt(s.style.zIndex)||0)+1),this.DS.publish("Selected:added",f),this}},{key:"delete",value:function(s){if(!I(m(r.prototype),"has",this).call(this,s))return!0;var f={items:this.elements,item:s};this.DS.publish("Selected:removed:pre",f);var v=I(m(r.prototype),"delete",this).call(this,s);return s.classList.remove(this.DS.stores.SettingsStore.s.selectedClass),s.style.zIndex="".concat((parseInt(s.style.zIndex)||0)-1),this.DS.publish("Selected:removed",f),v}},{key:"toggle",value:function(s){return this.has(s)?this.delete(s):this.add(s),s}},{key:"elements",get:function(){return Array.from(this.values())}}]),r}(N(Set)),Zd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_prevSelectedSet",void 0),c(this,"start",function(s){var f=s.event,v=s.isDragging;v||(r._storePrevious(f),r._handleInsideSelection(!0,f))}),c(this,"update",function(s){var f=s.isDragging;f||r.DS.continue||r._handleInsideSelection()}),c(this,"_handleInsideSelection",function(s,f){var v=r.DS,w=v.SelectableSet,x=v.SelectorArea,A=v.Selector,z=r.DS.stores.KeyStore.isMultiSelectKeyPressed(f)&&r.Settings.multiSelectToggling,G=r.Settings.selectionThreshold,de=w.rects,he=A.rect,be=new Map,Z=new Map,oe=re(de),tt;try{for(oe.s();!(tt=oe.n()).done;){var vt=R(tt.value,2),rt=vt[0],St=vt[1];x.isInside(rt,St)&&(Re(St,he,G)?be.set(rt,St):Z.set(rt,St))}}catch(tr){oe.e(tr)}finally{oe.f()}if(!r.DS.continue){var Nn=r.filterSelected({select:be,unselect:Z,selectorRect:he}),rh=Nn.select,nh=Nn.unselect;rh.forEach(function(tr,rr){return Id({element:rr,force:s,multiSelectionToggle:z,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass})}),nh.forEach(function(tr,rr){return Ld({element:rr,force:s,SelectedSet:r.DS.SelectedSet,hoverClassName:r.Settings.hoverClass,PrevSelectedSet:r._prevSelectedSet})})}}),c(this,"filterSelected",function(s){var f=s.select,v=s.unselect;return s.selectorRect,{select:f,unselect:v}}),this.DS=g,this.Settings=this.DS.stores.SettingsStore.s,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return p(d,[{key:"_storePrevious",value:function(r){var g=this.DS,s=g.stores.KeyStore,f=g.SelectedSet;s.isMultiSelectKeyPressed(r)?this._prevSelectedSet=new Set(f):this._prevSelectedSet=new Set}}]),d}(),qd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_rect",void 0),c(this,"attachSelector",function(){var s,f;r.HTMLNode&&(s=r.DS.SelectorArea)!==null&&s!==void 0&&s.HTMLNode&&r.DS.SelectorArea.HTMLNode.removeChild(r.HTMLNode),r.HTMLNode=r.DS.stores.SettingsStore.s.selector||Qt(r.DS.stores.SettingsStore.s.customStyles),r.HTMLNode.classList.add(r.DS.stores.SettingsStore.s.selectorClass),r.HTMLNode&&(f=r.DS.SelectorArea)!==null&&f!==void 0&&f.HTMLNode&&r.DS.SelectorArea.HTMLNode.appendChild(r.HTMLNode)}),c(this,"start",function(s){var f=s.isDragging;if(!f){var v=r.DS.stores.PointerStore,w=v.initialValArea;Dn(r.HTMLNode,O(w,1)),r.HTMLNode.style.display="block",r._rect=null}}),c(this,"stop",function(){r.HTMLNode.style.width="0",r.HTMLNode.style.height="0",r.HTMLNode.style.display="none"}),c(this,"update",function(s){var f=s.isDragging;if(!(f||r.DS.continue)){var v=r.DS.stores,w=v.ScrollStore,x=v.PointerStore,A=Vd({scrollAmount:w.scrollAmount,initialPointerPos:x.initialValArea,pointerPos:x.currentValArea});Dn(r.HTMLNode,A),r._rect=null}}),this.DS=g,this.DS.subscribe("Settings:updated:selectorClass",function(s){var f=s.settings;r.HTMLNode.classList.remove(f["selectorClass:pre"]),r.HTMLNode.classList.add(f.selectorClass)}),this.DS.subscribe("Settings:updated:selector",this.attachSelector),this.DS.subscribe("Settings:updated:customStyles",this.attachSelector),this.attachSelector(),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return p(d,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),d}(),Gd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_scrollInterval",void 0),c(this,"_rect",void 0),c(this,"currentEdges",[]),c(this,"start",function(){r.applyElements("append"),r.updatePos()}),c(this,"applyElements",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",f=document.body?"body":"documentElement",v="".concat(s,"Child");r.HTMLNode[v](r.DS.Selector.HTMLNode),document[f][v](r.HTMLNode)}),c(this,"updatePos",function(){r._rect=null;var s=r.DS.Area.rect,f=r.DS.Area.computedBorder,v=r.HTMLNode.style,w="".concat(s.top+f.top,"px"),x="".concat(s.left+f.left,"px"),A="".concat(s.width,"px"),z="".concat(s.height,"px");v.top!==w&&(v.top=w),v.left!==x&&(v.left=x),v.width!==A&&(v.width=A),v.height!==z&&(v.height=z)}),c(this,"stop",function(s){r.stopAutoScroll(),s&&r.applyElements("remove")}),c(this,"startAutoScroll",function(){r.currentEdges=[],r._scrollInterval=setInterval(function(){return r.handleAutoScroll()},16)}),c(this,"handleAutoScroll",function(){if(!r.DS.continue){var s=r.DS,f=s.stores.PointerStore,v=s.Area;r.currentEdges=wn({elementRect:O(f.currentVal),containerRect:r.rect,tolerance:r.DS.stores.SettingsStore.s.overflowTolerance}),r.currentEdges.length&&v.scroll(r.currentEdges,r.DS.stores.SettingsStore.s.autoScrollSpeed)}}),c(this,"stopAutoScroll",function(){r.currentEdges=[],clearInterval(r._scrollInterval)}),c(this,"isInside",function(s,f){return r.DS.Area.HTMLNode.contains(s)&&r.DS.stores.ScrollStore.canScroll?!0:Re(r.rect,f||s.getBoundingClientRect())}),this.DS=g,this.HTMLNode=gt(),this.DS.subscribe("Settings:updated:selectorAreaClass",function(s){var f=s.settings;r.HTMLNode.classList.remove(f["selectorAreaClass:pre"]),r.HTMLNode.classList.add(f.selectorAreaClass)}),this.HTMLNode.classList.add(this.DS.stores.SettingsStore.s.selectorAreaClass),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){r.updatePos(),r.stopAutoScroll()})}return p(d,[{key:"isClicked",value:function(r){var g=this.DS.stores.PointerStore,s=r?g.getPointerPosition(r):g.initialVal;return Re({left:s.x,top:s.y,right:s.x,bottom:s.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),d}(),Jd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_currentValues",new Set),c(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),c(this,"init",function(){document.addEventListener("keydown",r.keydown),document.addEventListener("keyup",r.keyup),window.addEventListener("blur",r.reset)}),c(this,"keydown",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:down:pre",{event:s,key:f}),r._currentValues.add(f),r.DS.publish("KeyStore:down",{event:s,key:f})}),c(this,"keyup",function(s){var f=s.key.toLowerCase();r.DS.publish("KeyStore:up:pre",{event:s,key:f}),r._currentValues.delete(f),r.DS.publish("KeyStore:up",{event:s,key:f})}),c(this,"stop",function(){document.removeEventListener("keydown",r.keydown),document.removeEventListener("keyup",r.reset),window.removeEventListener("blur",r.reset),r.reset()}),c(this,"reset",function(){return r._currentValues.clear()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init)}return p(d,[{key:"isMultiSelectKeyPressed",value:function(r){var g=this;if(this.DS.stores.SettingsStore.s.multiSelectMode)return!0;var s=this.DS.stores.SettingsStore.s.multiSelectKeys.map(function(f){return f.toLocaleLowerCase()});return!!(this.currentValues.some(function(f){return s.includes(f.toLocaleLowerCase())})||r&&s.some(function(f){return r[g._keyMapping[f]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),d}(),Qd=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_isMouseInteraction",!1),c(this,"_initialValArea",void 0),c(this,"_currentValArea",void 0),c(this,"_lastValArea",void 0),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_lastVal",void 0),c(this,"_lastTouch",void 0),c(this,"init",function(){r.Settings.usePointerEvents?document.addEventListener("pointermove",r.update,{passive:!1}):document.addEventListener("mousemove",r.update),document.addEventListener("touchmove",r.update,{passive:!1})}),c(this,"getPointerPosition",function(s){return Cd({event:r._normalizedEvent(s)})}),c(this,"update",function(s){s&&(r.DS.publish("PointerStore:updated:pre",{event:s}),r.currentVal=r.getPointerPosition(s),r._isMouseInteraction&&r.DS.publish("PointerStore:updated",{event:s}))}),c(this,"stop",function(){r.Settings.usePointerEvents?document.removeEventListener("pointermove",r.update,{passive:!1}):document.removeEventListener("mousemove",r.update),document.removeEventListener("touchmove",r.update,{passive:!1}),setTimeout(function(){return r._isMouseInteraction=!1},100)}),c(this,"reset",function(s){s&&(r.currentVal=r.lastVal=r.getPointerPosition(s),r.stop(),r.init())}),this.DS=g,this.Settings=g.stores.SettingsStore.s,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(s){var f=s.event;return r.start(f)}),this.DS.subscribe("Interaction:end",function(s){var f=s.event;return r.reset(f)})}return p(d,[{key:"start",value:function(r){r&&(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(r))}},{key:"_normalizedEvent",value:function(r){return"touches"in r&&r.type!=="touchend"&&(this._lastTouch=r),"touches"in r?this._lastTouch.touches[0]:r}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(r){this._initialVal=r,this._initialValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(r){this._currentVal=r,this._currentValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(r){this._lastVal=r,this._lastValArea=r&&V(r,"-",V(Y(this.DS.Area.rect),"+",Y(this.DS.Area.computedBorder)))}}]),d}(),eh=function(){function d(h){var r=this,g=h.DS;a(this,d),c(this,"_initialVal",void 0),c(this,"_currentVal",void 0),c(this,"_canScroll",void 0),c(this,"init",function(){return r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"start",function(){r._currentVal=r._initialVal=bt(r.DS.stores.SettingsStore.s.area),r.DS.stores.SettingsStore.s.area.addEventListener("scroll",r.update)}),c(this,"update",function(){return r._currentVal=bt(r.DS.stores.SettingsStore.s.area)}),c(this,"stop",function(){r.DS.stores.SettingsStore.s.area.removeEventListener("scroll",r.update),r._initialVal={x:0,y:0},r._canScroll=null}),c(this,"reset",function(){r.stop(),r.start()}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return r.start()}),this.DS.subscribe("Interaction:end",function(){return r.reset()})}return p(d,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=pt(this.DS.stores.SettingsStore.s.area)}},{key:"scrollAmount",get:function(){var r=V(this.currentVal,"-",this.initialVal),g=ce(this.DS.stores.SettingsStore.s.zoom),s=V(V(r,"*",g),"-",r);return{x:r.x+s.x,y:r.y+s.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=bt(this.DS.stores.SettingsStore.s.area)),this._currentVal}}]),d}(),th=p(function d(h){var r=this,g=h.DS,s=h.settings;a(this,d),c(this,"_settings",{}),c(this,"s",{}),c(this,"update",function(f){var v=f.settings,w=f.init;return r.DS.publish("Settings:updated:pre",l({settings:v},w?{init:w}:{}))}),c(this,"_update",function(f){for(var v=f.settings,w=f.init,x=Od(v,w),A=function(){var he,be=R(G[z],2),Z=be[0],oe=be[1];Z in r._settings||Object.defineProperty(r.s,Z,{get:function(){return r._settings[Z]},set:function(rt){return r.update({settings:c({},Z,rt)})}}),r._settings["".concat(Z,":pre")]=r._settings[Z],r._settings[Z]=oe;var tt={settings:(he={},c(he,Z,r._settings[Z]),c(he,"".concat(Z,":pre"),r._settings["".concat(Z,":pre")]),he)};r.DS.publish("Settings:updated",tt),r.DS.publish("Settings:updated:".concat(Z),tt)},z=0,G=Object.entries(x);z<G.length;z++)A()}),this.DS=g,this.DS.subscribe("Settings:updated:pre",this._update),this.update({settings:s,init:!0})}),En=function(){function d(h){var r=this;a(this,d),c(this,"continue",!1),c(this,"start",function(){r.stopped=!1,r.Interaction.init()}),c(this,"break",function(){return r.continue=!0}),c(this,"setSettings",function(g){return r.stores.SettingsStore.update({settings:g})}),c(this,"getSelection",function(){return r.SelectedSet.elements}),c(this,"getSelectables",function(){return r.SelectableSet.elements}),c(this,"getInitialCursorPosition",function(){return r.stores.PointerStore.initialVal}),c(this,"getCurrentCursorPosition",function(){return r.stores.PointerStore.currentVal}),c(this,"getPreviousCursorPosition",function(){return r.stores.PointerStore.lastVal}),c(this,"getInitialCursorPositionArea",function(){return r.stores.PointerStore.initialValArea}),c(this,"getCurrentCursorPositionArea",function(){return r.stores.PointerStore.currentValArea}),c(this,"getPreviousCursorPositionArea",function(){return r.stores.PointerStore.lastValArea}),c(this,"isMultiSelect",function(g){return r.stores.KeyStore.isMultiSelectKeyPressed(g)}),c(this,"isDragging",function(){return r.Interaction.isDragging}),c(this,"getZoneByCoordinates",function(g){var s;return(s=r.DropZones.getTarget(g))===null||s===void 0?void 0:s.toObject()}),c(this,"getItemsDroppedByZoneId",function(g){return r.DropZones.getItemsDroppedById(g)}),c(this,"getItemsInsideByZoneId",function(g,s){return r.DropZones.getItemsInsideById(g,s)}),this.PubSub=new Kd({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this.stores={},this.stores.SettingsStore=new th({DS:this,settings:h}),this.stores.PointerStore=new Qd({DS:this}),this.stores.ScrollStore=new eh({DS:this}),this.stores.KeyStore=new Jd({DS:this}),this.Area=new Rd({DS:this}),this.Selector=new qd({DS:this}),this.SelectorArea=new Gd({DS:this}),this.SelectableSet=new Wd({DS:this}),this.SelectedSet=new Xd({DS:this}),this.Selection=new Zd({DS:this}),this.Drag=new Hd({DS:this}),this.DropZones=new Ud({DS:this}),this.Interaction=new Yd({DS:this}),zd({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction,DropZones:this.DropZones}),this.subscribe("Interaction:end",function(){return r.continue=!1}),this.start()}return p(d,[{key:"stop",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(r),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),r&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ne(r)),s||this.addSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ne(r)),s&&this.removeSelectables(r),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(r){var g=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ne(r).forEach(function(v){return g.SelectedSet.has(v)?g.removeSelection(r,s,f):g.addSelection(r,s,f)}),s&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(r,g,s),this.getSelection()}},{key:"clearSelection",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),r&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(r,g,s){var f=Ne(r);return this.SelectableSet.addAll(f),g&&this.SelectedSet.addAll(f),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}},{key:"setSelectables",value:function(r){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return console.warn('[DragSelect] DEPRECATION ".setSelectables" is deprecated and will be removed soon. Please use "ds.setSettings({ selectables: << new dom elements >> })" instead (see docs)'),this.removeSelectables(r,g),this.addSelectables(r,s)}},{key:"removeSelectables",value:function(r,g,s){return this.SelectableSet.deleteAll(Ne(r)),g&&this.removeSelection(r),s&&this.PubSub.publish("callback",{items:this.getSelection()}),r}}]),d}();return En.isCollision=Re,En})})(or);var co=or.exports;const ho=lo(co),ir=(n,t,o,i,l)=>(t=Math,o=t.log,i=1024,l=o(n)/o(i)|0,n/t.pow(i,l)).toFixed(0)+" "+(l?"KMGTPEZY"[--l]+"iB":"B"),sr=(n,t=null)=>new Date(n*1e3).toLocaleString(t??navigator.language??"en-US"),uo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},fo=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)],mo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},po=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1)],it=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(n){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[n.direction=="down"?(e.openBlock(),e.createElementBlock("svg",uo,fo)):e.createCommentVNode("",!0),n.direction=="up"?(e.openBlock(),e.createElementBlock("svg",mo,po)):e.createCommentVNode("",!0)]))}}),go=["onClick"],yo=Object.assign({name:"VFToast.vue"},{setup(n){const t=e.inject("emitter"),{getStore:o}=e.inject("storage"),i=e.ref(o("full-screen",!1)),l=c=>c=="error"?"text-red-400 border-red-400 dark:text-red-300 dark:border-red-300":"text-lime-600 border-lime-600 dark:text-lime-300 dark:border-lime-1300",a=e.ref([]),u=c=>{a.value.splice(c,1)},p=c=>{let y=a.value.findIndex(m=>m.id===c);y!==-1&&u(y)};return t.on("vf-toast-clear",()=>{a.value=[]}),t.on("vf-toast-push",c=>{let y=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");c.id=y,a.value.push(c),setTimeout(()=>{p(y)},5e3)}),(c,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([i.value.value?"fixed":"absolute","bottom-0 max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(m,b)=>(e.openBlock(),e.createElementBlock("div",{onClick:S=>u(b),key:m,class:e.normalizeClass([l(m.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 dark:bg-gray-600 border text-xs sm:text-sm rounded cursor-pointer"])},e.toDisplayString(m.label),11,go))),128))]),_:1})],2))}}),Ce=n=>Object.entries(n).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:bo}=ue(),_t=(n,t)=>bo.value+"?"+Ce({q:"preview",adapter:n,path:t}),we=typeof window<"u",ar=we&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),lr=we&&"IntersectionObserver"in window,cr=we&&"classList"in document.createElement("p"),dr=we&&window.devicePixelRatio>1,vo={elements_selector:".lazy",container:ar||we?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},hr=n=>Object.assign({},vo,n),ur=function(n,t){let o;const i="LazyLoad::Initialized",l=new n(t);try{o=new CustomEvent(i,{detail:{instance:l}})}catch{o=document.createEvent("CustomEvent"),o.initCustomEvent(i,!1,!1,{instance:l})}window.dispatchEvent(o)},So=(n,t)=>{if(t)if(!t.length)ur(n,t);else for(let o=0,i;i=t[o];o+=1)ur(n,i)},Se="src",kt="srcset",xt="sizes",fr="poster",He="llOriginalAttrs",mr="data",Dt="loading",pr="loaded",gr="applied",wo="entered",Et="error",yr="native",br="data-",vr="ll-status",J=(n,t)=>n.getAttribute(br+t),_o=(n,t,o)=>{var i=br+t;if(o===null){n.removeAttribute(i);return}n.setAttribute(i,o)},Fe=n=>J(n,vr),Ve=(n,t)=>_o(n,vr,t),st=n=>Ve(n,null),Nt=n=>Fe(n)===null,ko=n=>Fe(n)===Dt,xo=n=>Fe(n)===Et,Ct=n=>Fe(n)===yr,Do=[Dt,pr,gr,Et],Eo=n=>Do.indexOf(Fe(n))>=0,_e=(n,t,o,i)=>{if(n){if(i!==void 0){n(t,o,i);return}if(o!==void 0){n(t,o);return}n(t)}},Ae=(n,t)=>{if(cr){n.classList.add(t);return}n.className+=(n.className?" ":"")+t},fe=(n,t)=>{if(cr){n.classList.remove(t);return}n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},No=n=>{n.llTempImage=document.createElement("IMG")},Co=n=>{delete n.llTempImage},Sr=n=>n.llTempImage,at=(n,t)=>{if(!t)return;const o=t._observer;o&&o.unobserve(n)},Vo=n=>{n.disconnect()},Mo=(n,t,o)=>{t.unobserve_entered&&at(n,o)},Vt=(n,t)=>{n&&(n.loadingCount+=t)},To=n=>{n&&(n.toLoadCount-=1)},wr=(n,t)=>{n&&(n.toLoadCount=t)},Bo=n=>n.loadingCount>0,$o=n=>n.toLoadCount>0,_r=n=>{let t=[];for(let o=0,i;i=n.children[o];o+=1)i.tagName==="SOURCE"&&t.push(i);return t},Mt=(n,t)=>{const o=n.parentNode;if(!o||o.tagName!=="PICTURE")return;_r(o).forEach(t)},kr=(n,t)=>{_r(n).forEach(t)},lt=[Se],xr=[Se,fr],Ue=[Se,kt,xt],Dr=[mr],ct=n=>!!n[He],Er=n=>n[He],Nr=n=>delete n[He],Ie=(n,t)=>{if(ct(n))return;const o={};t.forEach(i=>{o[i]=n.getAttribute(i)}),n[He]=o},Ao=n=>{ct(n)||(n[He]={backgroundImage:n.style.backgroundImage})},Io=(n,t,o)=>{if(!o){n.removeAttribute(t);return}n.setAttribute(t,o)},Me=(n,t)=>{if(!ct(n))return;const o=Er(n);t.forEach(i=>{Io(n,i,o[i])})},Lo=n=>{if(!ct(n))return;const t=Er(n);n.style.backgroundImage=t.backgroundImage},Cr=(n,t,o)=>{Ae(n,t.class_applied),Ve(n,gr),o&&(t.unobserve_completed&&at(n,t),_e(t.callback_applied,n,o))},Vr=(n,t,o)=>{Ae(n,t.class_loading),Ve(n,Dt),o&&(Vt(o,1),_e(t.callback_loading,n,o))},ke=(n,t,o)=>{o&&n.setAttribute(t,o)},Mr=(n,t)=>{ke(n,xt,J(n,t.data_sizes)),ke(n,kt,J(n,t.data_srcset)),ke(n,Se,J(n,t.data_src))},Oo=(n,t)=>{Mt(n,o=>{Ie(o,Ue),Mr(o,t)}),Ie(n,Ue),Mr(n,t)},jo=(n,t)=>{Ie(n,lt),ke(n,Se,J(n,t.data_src))},Po=(n,t)=>{kr(n,o=>{Ie(o,lt),ke(o,Se,J(o,t.data_src))}),Ie(n,xr),ke(n,fr,J(n,t.data_poster)),ke(n,Se,J(n,t.data_src)),n.load()},zo=(n,t)=>{Ie(n,Dr),ke(n,mr,J(n,t.data_src))},Ro=(n,t,o)=>{const i=J(n,t.data_bg),l=J(n,t.data_bg_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=`url("${a}")`,Sr(n).setAttribute(Se,a),Vr(n,t,o))},Ho=(n,t,o)=>{const i=J(n,t.data_bg_multi),l=J(n,t.data_bg_multi_hidpi),a=dr&&l?l:i;a&&(n.style.backgroundImage=a,Cr(n,t,o))},Fo=(n,t,o)=>{const i=J(n,t.data_bg_set);if(!i)return;const l=i.split("|");let a=l.map(u=>`image-set(${u})`);n.style.backgroundImage=a.join(),n.style.backgroundImage===""&&(a=l.map(u=>`-webkit-image-set(${u})`),n.style.backgroundImage=a.join()),Cr(n,t,o)},Tr={IMG:Oo,IFRAME:jo,VIDEO:Po,OBJECT:zo},Uo=(n,t)=>{const o=Tr[n.tagName];o&&o(n,t)},Yo=(n,t,o)=>{const i=Tr[n.tagName];i&&(i(n,t),Vr(n,t,o))},Ko=["IMG","IFRAME","VIDEO","OBJECT"],Wo=n=>Ko.indexOf(n.tagName)>-1,Br=(n,t)=>{t&&!Bo(t)&&!$o(t)&&_e(n.callback_finish,t)},$r=(n,t,o)=>{n.addEventListener(t,o),n.llEvLisnrs[t]=o},Xo=(n,t,o)=>{n.removeEventListener(t,o)},Tt=n=>!!n.llEvLisnrs,Zo=(n,t,o)=>{Tt(n)||(n.llEvLisnrs={});const i=n.tagName==="VIDEO"?"loadeddata":"load";$r(n,i,t),$r(n,"error",o)},Bt=n=>{if(!Tt(n))return;const t=n.llEvLisnrs;for(let o in t){const i=t[o];Xo(n,o,i)}delete n.llEvLisnrs},Ar=(n,t,o)=>{Co(n),Vt(o,-1),To(o),fe(n,t.class_loading),t.unobserve_completed&&at(n,o)},qo=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_loaded),Ve(t,pr),_e(o.callback_loaded,t,i),l||Br(o,i)},Go=(n,t,o,i)=>{const l=Ct(t);Ar(t,o,i),Ae(t,o.class_error),Ve(t,Et),_e(o.callback_error,t,i),o.restore_on_error&&Me(t,Ue),l||Br(o,i)},$t=(n,t,o)=>{const i=Sr(n)||n;if(Tt(i))return;Zo(i,u=>{qo(u,n,t,o),Bt(i)},u=>{Go(u,n,t,o),Bt(i)})},Jo=(n,t,o)=>{No(n),$t(n,t,o),Ao(n),Ro(n,t,o),Ho(n,t,o),Fo(n,t,o)},Qo=(n,t,o)=>{$t(n,t,o),Yo(n,t,o)},At=(n,t,o)=>{Wo(n)?Qo(n,t,o):Jo(n,t,o)},ei=(n,t,o)=>{n.setAttribute("loading","lazy"),$t(n,t,o),Uo(n,t),Ve(n,yr)},Ir=n=>{n.removeAttribute(Se),n.removeAttribute(kt),n.removeAttribute(xt)},ti=n=>{Mt(n,t=>{Ir(t)}),Ir(n)},Lr=n=>{Mt(n,t=>{Me(t,Ue)}),Me(n,Ue)},ri={IMG:Lr,IFRAME:n=>{Me(n,lt)},VIDEO:n=>{kr(n,t=>{Me(t,lt)}),Me(n,xr),n.load()},OBJECT:n=>{Me(n,Dr)}},ni=n=>{const t=ri[n.tagName];if(!t){Lo(n);return}t(n)},oi=(n,t)=>{Nt(n)||Ct(n)||(fe(n,t.class_entered),fe(n,t.class_exited),fe(n,t.class_applied),fe(n,t.class_loading),fe(n,t.class_loaded),fe(n,t.class_error))},ii=(n,t)=>{ni(n),oi(n,t),st(n),Nr(n)},si=(n,t,o,i)=>{o.cancel_on_exit&&ko(n)&&n.tagName==="IMG"&&(Bt(n),ti(n),Lr(n),fe(n,o.class_loading),Vt(i,-1),st(n),_e(o.callback_cancel,n,t,i))},ai=(n,t,o,i)=>{const l=Eo(n);Ve(n,wo),Ae(n,o.class_entered),fe(n,o.class_exited),Mo(n,o,i),_e(o.callback_enter,n,t,i),!l&&At(n,o,i)},li=(n,t,o,i)=>{Nt(n)||(Ae(n,o.class_exited),si(n,t,o,i),_e(o.callback_exit,n,t,i))},ci=["IMG","IFRAME","VIDEO"],Or=n=>n.use_native&&"loading"in HTMLImageElement.prototype,di=(n,t,o)=>{n.forEach(i=>{ci.indexOf(i.tagName)!==-1&&ei(i,t,o)}),wr(o,0)},hi=n=>n.isIntersecting||n.intersectionRatio>0,ui=n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}),fi=(n,t,o)=>{n.forEach(i=>hi(i)?ai(i.target,i,t,o):li(i.target,i,t,o))},mi=(n,t)=>{t.forEach(o=>{n.observe(o)})},pi=(n,t)=>{Vo(n),mi(n,t)},gi=(n,t)=>{!lr||Or(n)||(t._observer=new IntersectionObserver(o=>{fi(o,n,t)},ui(n)))},jr=n=>Array.prototype.slice.call(n),dt=n=>n.container.querySelectorAll(n.elements_selector),yi=n=>jr(n).filter(Nt),bi=n=>xo(n),vi=n=>jr(n).filter(bi),Pr=(n,t)=>yi(n||dt(t)),Si=(n,t)=>{vi(dt(n)).forEach(i=>{fe(i,n.class_error),st(i)}),t.update()},wi=(n,t)=>{we&&(t._onlineHandler=()=>{Si(n,t)},window.addEventListener("online",t._onlineHandler))},_i=n=>{we&&window.removeEventListener("online",n._onlineHandler)},Ye=function(n,t){const o=hr(n);this._settings=o,this.loadingCount=0,gi(o,this),wi(o,this),this.update(t)};Ye.prototype={update:function(n){const t=this._settings,o=Pr(n,t);if(wr(this,o.length),ar||!lr){this.loadAll(o);return}if(Or(t)){di(o,t,this);return}pi(this._observer,o)},destroy:function(){this._observer&&this._observer.disconnect(),_i(this),dt(this._settings).forEach(n=>{Nr(n)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(n){const t=this._settings;Pr(n,t).forEach(i=>{at(i,this),At(i,t,this)})},restoreAll:function(){const n=this._settings;dt(n).forEach(t=>{ii(t,n)})}},Ye.load=(n,t)=>{const o=hr(t);At(n,o)},Ye.resetStatus=n=>{st(n)},we&&So(Ye,window.lazyLoadOptions);const ki={class:"relative flex-auto flex flex-col overflow-hidden"},xi={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Di={class:"absolute"},Ei=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"absolute h-6 w-6 md:h-12 md:w-12 m-auto stroke-neutral-500 fill-white dark:fill-gray-700 dark:stroke-gray-600 z-10",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})],-1),Ni={class:"text-neutral-700 dark:text-neutral-300 p-1 absolute text-center top-4 right-[-2rem] md:top-5 md:right-[-2.4rem] z-20 text-xs"},Ci=["onDblclick","onContextmenu","data-type","data-item","data-index"],Vi={class:"grid grid-cols-12 items-center"},Mi={class:"flex col-span-7 items-center"},Ti={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Bi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],$i={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Ai=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Ii={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Li={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},Oi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],ji={class:"grid grid-cols-12 items-center"},Pi={class:"flex col-span-7 items-center"},zi={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Ri=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],Hi={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Fi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Ui={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Yi={class:"col-span-2 text-center"},Ki={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Wi=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Xi={class:"relative"},Zi={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},qi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],Gi=["data-src","alt"],Ji={key:2,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Qi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],es={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},ts={class:"break-all"},rs=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(n){const t=n,o=e.inject("emitter"),{setStore:i,getStore:l}=e.inject("storage"),a=e.inject("adapter"),u=C=>C==null?void 0:C.substring(0,3),p=C=>C.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),c=e.ref(null),y=e.ref(null),m=e.ref(0),b=e.ref(null),{t:S}=e.inject("i18n"),E=Math.floor(Math.random()*2**32),_=e.ref(l("full-screen",!1)),N=new Ye;o.on("vf-fullscreen-toggle",()=>{c.value.style.height=null,_.value=!_.value,i("full-screen",_.value)});const D=e.ref("");o.on("vf-search-query",({newQuery:C})=>{D.value=C,C?o.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:C},onSuccess:B=>{B.files.length||o.emit("vf-toast-push",{label:S("No search result found.")})}}):o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let L=null;const $=()=>{L&&clearTimeout(L)},T=e.ref(!0),I=C=>{C.touches.length>1&&(T.value?(b.value.stop(),o.emit("vf-toast-push",{label:S("Drag&Drop: off")})):(b.value.start(),o.emit("vf-toast-push",{label:S("Drag&Drop: on")}),o.emit("vf-explorer-update")),T.value=!T.value)},R=C=>{L=setTimeout(()=>{const B=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:C.target.getBoundingClientRect().x,clientY:C.target.getBoundingClientRect().y});C.target.dispatchEvent(B)},500)},k=C=>{C.type=="dir"?(o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:C.path}})):o.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:C})},M=e.reactive({active:!1,column:"",order:""}),H=(C=!0)=>{let B=[...t.data.files],V=M.column,Y=M.order=="asc"?1:-1;if(!C)return B;const O=(ce,ae)=>typeof ce=="string"&&typeof ae=="string"?ce.toLowerCase().localeCompare(ae.toLowerCase()):ce<ae?-1:ce>ae?1:0;return M.active&&(B=B.slice().sort((ce,ae)=>O(ce[V],ae[V])*Y)),B},X=C=>{M.active&&M.column==C?(M.active=M.order=="asc",M.column=C,M.order="desc"):(M.active=!0,M.column=C,M.order="asc")},W=()=>b.value.getSelection().map(C=>JSON.parse(C.dataset.item)),te=(C,B)=>{if(C.altKey||C.ctrlKey||C.metaKey)return C.preventDefault(),!1;C.dataTransfer.setDragImage(y.value,0,15),C.dataTransfer.effectAllowed="all",C.dataTransfer.dropEffect="copy",C.dataTransfer.setData("items",JSON.stringify(W()))},se=(C,B)=>{C.preventDefault();let V=JSON.parse(C.dataTransfer.getData("items"));if(V.find(Y=>Y.storage!=a.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:V,to:B}})},ne=(C,B)=>{C.preventDefault(),!B||B.type!=="dir"||b.value.getSelection().find(V=>V==C.currentTarget)?(C.dataTransfer.dropEffect="none",C.dataTransfer.effectAllowed="none"):C.dataTransfer.dropEffect="copy"},re=()=>{b.value=new ho({area:c.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),o.on("vf-explorer-update",()=>e.nextTick(()=>{b.value.clearSelection(),b.value.setSelectables(document.getElementsByClassName("vf-item-"+E))})),b.value.subscribe("predragstart",({event:C,isDragging:B})=>{if(B)m.value=b.value.getSelection().length,b.value.break();else{const V=C.target.offsetWidth-C.offsetX,Y=C.target.offsetHeight-C.offsetY;V<15&&Y<15&&(b.value.clearSelection(),b.value.break())}}),b.value.subscribe("predragmove",({isDragging:C})=>{C&&b.value.break()}),b.value.subscribe("callback",({items:C,event:B,isDragging:V})=>{o.emit("vf-nodes-selected",W()),m.value=b.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{b.value.Area.reset(),b.value.SelectorArea.updatePos(),N.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>o.emit("vf-explorer-update"))}),(C,B)=>(e.openBlock(),e.createElementBlock("div",ki,[n.view=="list"||D.value.length?(e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("div",{onClick:B[0]||(B[0]=V=>X("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Name"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="basename"]])]),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:B[1]||(B[1]=V=>X("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Size"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="file_size"]])])),D.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:B[2]||(B[2]=V=>X("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Date"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="last_modified"]])])),D.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:B[3]||(B[3]=V=>X("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(S)("Filepath"))+" ",1),e.withDirectives(e.createVNode(it,{direction:M.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,M.active&&M.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("div",{ref_key:"dragImage",ref:y,class:"absolute -z-50 -top-96"},[Ei,e.createElementVNode("div",Ni,e.toDisplayString(m.value),1)],512)]),e.createElementVNode("div",{onTouchstart:I,onContextmenu:B[10]||(B[10]=e.withModifiers(V=>e.unref(o).emit("vf-contextmenu-show",{event:V,area:c.value,items:W()}),["self","prevent"])),class:e.normalizeClass([_.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:c},[D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:O=>k(V),onTouchstart:B[4]||(B[4]=O=>R(O)),onTouchend:B[5]||(B[5]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(E),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Mi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ti,Bi)):(e.openBlock(),e.createElementBlock("svg",$i,Ai)),e.createElementVNode("span",Ii,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Li,e.toDisplayString(V.path),1)])],42,Ci))),256)):e.createCommentVNode("",!0),n.view=="list"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H(),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[6]||(B[6]=O=>R(O)),onTouchend:B[7]||(B[7]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",ji,[e.createElementVNode("div",Pi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",zi,Ri)):(e.openBlock(),e.createElementBlock("svg",Hi,Fi)),e.createElementVNode("span",Ui,e.toDisplayString(V.basename),1)]),e.createElementVNode("div",Yi,e.toDisplayString(V.file_size?e.unref(ir)(V.file_size):""),1),e.createElementVNode("div",Ki,e.toDisplayString(e.unref(sr)(V.last_modified)),1)])],42,Oi))),256)):e.createCommentVNode("",!0),n.view=="grid"&&!D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H(!1),(V,Y)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:O=>k(V),onTouchstart:B[8]||(B[8]=O=>R(O)),onTouchend:B[9]||(B[9]=O=>$()),onContextmenu:e.withModifiers(O=>e.unref(o).emit("vf-contextmenu-show",{event:O,area:c.value,items:W(),target:V}),["prevent"]),onDragstart:O=>te(O),onDragover:O=>ne(O,V),onDrop:O=>se(O,V),class:e.normalizeClass(["vf-item-"+e.unref(E),"border border-transparent hover:bg-neutral-50 m-1 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 text-center justify-center select-none"]),"data-type":V.type,"data-item":JSON.stringify(V),"data-index":Y},[e.createElementVNode("div",null,[e.createElementVNode("div",Xi,[V.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Zi,qi)):(V.mime_type??"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(_t)(e.unref(a).value,V.path),alt:V.basename},null,8,Gi)):(e.openBlock(),e.createElementBlock("svg",Ji,Qi)),!(V.mime_type??"").startsWith("image")&&V.type!="dir"?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(u(V.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ts,e.toDisplayString(p(V.basename)),1)])],42,Wi))),256)):e.createCommentVNode("",!0)],34),e.createVNode(yo)]))}}),ns="1.2.2",os={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},is={class:"flex leading-5 items-center"},ss=["aria-label"],as=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})],-1)],ls=["value"],cs={class:"ml-3"},ds={key:0},hs={class:"ml-1"},us={class:"flex leading-5 items-center"},fs={value:"",disabled:""},ms=e.createStaticVNode('<option value="en">English</option><option value="fr">French</option><option value="fa">Persian</option><option value="de">German</option><option value="ru">Russian</option><option value="tr">Turkish</option><option value="tr">Hebrew</option>',7),ps=["aria-label"],gs=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 stroke-slate-500 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)],ys=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(n){const t=e.inject("emitter"),{getStore:o,setStore:i}=e.inject("storage"),l=e.ref(0),a=e.inject("adapter"),{t:u,changeLocale:p}=e.inject("i18n"),c=e.ref(o("locale","")),y=()=>{t.emit("vf-search-exit"),t.emit("vf-fetch",{params:{q:"index",adapter:a.value}}),i("adapter",a.value)};t.on("vf-nodes-selected",b=>{l.value=b.length});const m=e.ref("");return t.on("vf-search-query",({newQuery:b})=>{m.value=b}),(b,S)=>(e.openBlock(),e.createElementBlock("div",os,[e.createElementVNode("div",is,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(u)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},as,8,ss),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=E=>e.isRef(a)?a.value=E:null),onChange:y,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data.storages,E=>(e.openBlock(),e.createElementBlock("option",{value:E},e.toDisplayString(E),9,ls))),256))],544),[[e.vModelSelect,e.unref(a)]]),e.createElementVNode("div",cs,[m.value.length?(e.openBlock(),e.createElementBlock("span",ds,e.toDisplayString(n.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",hs,e.toDisplayString(l.value>0?l.value+" "+e.unref(u)("item(s) selected."):""),1)])]),e.createElementVNode("div",us,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=E=>c.value=E),onChange:S[2]||(S[2]=E=>e.unref(p)(E.target.value)),class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8 mr-3"},[e.createElementVNode("option",fs,e.toDisplayString(e.unref(u)("Language")),1),ms],544),[[e.vModelSelect,c.value]]),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(u)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=E=>e.unref(t).emit("vf-modal-show",{type:"message",title:"Vuefinder "+e.unref(ns),message:e.unref(u)("Vuefinder is a file manager component for vue 3.")}))},gs,8,ps)])]))}}),bs=(n,t=0,o=!1)=>{let i;return(...l)=>{o&&!i&&n(...l),clearTimeout(i),i=setTimeout(()=>{n(...l)},t)}},vs=(n,t,o)=>{const i=e.ref(n);return e.customRef((a,u)=>({get(){return a(),i.value},set:bs(p=>{i.value=p,u()},t,o)}))},Ss={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-xs"},ws=["aria-label"],_s=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1)],ks=["aria-label"],xs=[e.createElementVNode("path",{d:"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z"},null,-1)],Ds=["aria-label"],Es=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ns=["onClick"],Cs=[e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},null,-1)],Vs={class:"flex leading-5"},Ms=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),Ts=["title","onClick"],Bs={key:0,class:"animate-spin p-1 h-6 w-6 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},$s=[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)],As={key:3,class:"relative flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Is=e.createElementVNode("svg",{class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})],-1),Ls=e.createElementVNode("div",{class:"w-full"},null,-1),Os=["onKeydown","placeholder"],js=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ps=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),l=e.ref(null),a=e.ref([]),u=e.ref(!1),p=e.ref(null),{t:c}=e.inject("i18n"),y=e.inject("loadingState");o.on("vf-explorer-update",()=>{let $=[],T=[];l.value=t.data.dirname??i.value+"://",l.value.length==0&&(a.value=[]),l.value.replace(i.value+"://","").split("/").forEach(function(I){$.push(I),$.join("/")!=""&&T.push({basename:I,name:I,path:i.value+"://"+$.join("/"),type:"dir"})}),T.length>4&&(T=T.slice(-5),T[0].name=".."),a.value=T});const m=()=>{u.value=!1,S.value=""};o.on("vf-search-exit",()=>{m()});const b=()=>{u.value=!0,e.nextTick(()=>p.value.focus())},S=vs("",400),E=()=>y.value;e.watch(S,$=>{o.emit("vf-toast-clear"),o.emit("vf-search-query",{newQuery:$})});const _=()=>a.value.length&&!u.value,N=$=>{$.preventDefault();let T=JSON.parse($.dataTransfer.getData("items"));if(T.find(I=>I.storage!=i.value)){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:T,to:a.value[a.value.length-2]??{path:i.value+"://"}}})},D=$=>{$.preventDefault(),_()?$.dataTransfer.dropEffect="copy":($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none")},L=()=>{S.value==""&&m()};return($,T)=>(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("span",{"aria-label":e.unref(c)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:T[0]||(T[0]=I=>D(I)),onDrop:T[1]||(T[1]=I=>N(I)),onClick:T[2]||(T[2]=I=>{var R;return!_()||e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:((R=a.value[a.value.length-2])==null?void 0:R.path)??e.unref(i)+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",_()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},_s,34))],8,ws),E()?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(c)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[4]||(T[4]=I=>e.unref(o).emit("vf-fetch-abort")),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer"},Es))],8,Ds)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(c)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[3]||(T[3]=I=>{e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:n.data.dirname}})}),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"-40 -40 580 580",fill:"currentColor"},xs))],8,ks)),u.value?(e.openBlock(),e.createElementBlock("div",As,[Is,Ls,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:p,onKeydown:e.withKeys(m,["esc"]),onBlur:L,"onUpdate:modelValue":T[6]||(T[6]=I=>e.isRef(S)?S.value=I:null),placeholder:e.unref(c)("Search anything.."),class:"absolute ml-4 pt-1 pb-0 px-2 border-0 ring-0 outline-0 text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,Os),[[e.vModelText,e.unref(S)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:m,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},js))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(b,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[5]||(T[5]=I=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter}})),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Cs)),e.createElementVNode("div",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(I,R)=>(e.openBlock(),e.createElementBlock("div",{key:R},[Ms,e.createElementVNode("span",{class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer",title:I.basename,onClick:k=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:n.data.adapter,path:I.path}})},e.toDisplayString(I.name),9,Ts)]))),128))]),E()?(e.openBlock(),e.createElementBlock("svg",Bs,$s)):e.createCommentVNode("",!0)],8,Ns))]))}}),zs=["onClick"],Rs=e.createElementVNode("span",{class:"px-1"},null,-1),Hs=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(n){const t=n,o=e.inject("emitter"),i=e.ref(null),{apiUrl:l}=ue(),a=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),u=e.ref([]);o.on("vf-context-selected",S=>{u.value=S});const{t:p}=e.inject("i18n"),c={newfolder:{title:()=>p("New Folder"),action:()=>{o.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>p("Delete"),action:()=>{o.emit("vf-modal-show",{type:"delete",items:u})}},refresh:{title:()=>p("Refresh"),action:()=>{o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>p("Preview"),action:()=>{o.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:u.value[0]})}},open:{title:()=>p("Open"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].path}})}},openDir:{title:()=>p("Open containing folder"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:u.value[0].dir}})}},download:{title:()=>p("Download"),action:()=>{const S=l.value+"?"+Ce({q:"download",adapter:t.current.adapter,path:u.value[0].path});o.emit("vf-download",S)}},archive:{title:()=>p("Archive"),action:()=>{o.emit("vf-modal-show",{type:"archive",items:u})}},unarchive:{title:()=>p("Unarchive"),action:()=>{o.emit("vf-modal-show",{type:"unarchive",items:u})}},rename:{title:()=>p("Rename"),action:()=>{o.emit("vf-modal-show",{type:"rename",items:u})}}},y=S=>{o.emit("vf-contextmenu-hide"),S.action()},m=e.ref("");o.on("vf-search-query",({newQuery:S})=>{m.value=S}),o.on("vf-contextmenu-show",({event:S,area:E,items:_,target:N=null})=>{if(a.items=[],m.value)if(N)a.items.push(c.openDir),o.emit("vf-context-selected",[N]);else return;else!N&&!m.value?(a.items.push(c.refresh),a.items.push(c.newfolder),o.emit("vf-context-selected",[])):_.length>1&&_.some(D=>D.path===N.path)?(a.items.push(c.refresh),a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",_)):(N.type=="dir"?a.items.push(c.open):(a.items.push(c.preview),a.items.push(c.download)),a.items.push(c.rename),N.mime_type=="application/zip"?a.items.push(c.unarchive):a.items.push(c.archive),a.items.push(c.delete),o.emit("vf-context-selected",[N]));b(S,E)}),o.on("vf-contextmenu-hide",()=>{a.active=!1});const b=(S,E)=>{a.active=!0,e.nextTick(()=>{let _=E.getBoundingClientRect(),N=S.pageX,D=S.pageY,L=i.value.offsetHeight,$=i.value.offsetWidth;N=_.right-S.pageX+window.scrollX<$?N-$:N,D=_.bottom-S.pageY+window.scrollY<L?D-L:D,a.positions={left:N+"px",top:D+"px"}})};return(S,E)=>a.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:i,style:e.normalizeStyle(a.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,_=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:_.title,onClick:N=>y(_)},[Rs,e.createElementVNode("span",null,e.toDisplayString(_.title()),1)],8,zs))),128))],4)):e.createCommentVNode("",!0)}}),Fs=(n,t)=>{const o=n[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((i,l)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(l.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function Us(n){const t=await Fs(Object.assign({"../locales/de.json":()=>Promise.resolve().then(()=>wd),"../locales/en.json":()=>Promise.resolve().then(()=>_d),"../locales/fa.json":()=>Promise.resolve().then(()=>kd),"../locales/he.json":()=>Promise.resolve().then(()=>xd),"../locales/ru.json":()=>Promise.resolve().then(()=>Dd),"../locales/tr.json":()=>Promise.resolve().then(()=>Ed)}),`../locales/${n}.json`);return JSON.parse(t.default)}function Ys(n,t,o){const{getStore:i,setStore:l}=wt(n),a=e.ref({}),u=y=>{Us(y).then(m=>{a.value=m,l("locale",y),l("translations",m),o.emit("vf-toast-push",{label:"The language is set to "+y})}).catch(m=>{o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),u("en")})};i("locale")?a.value=i("translations"):u(t);const p=(y,...m)=>m.length?p(y=y.replace("%s",m.shift()),...m):y;function c(y,...m){return a.value.hasOwnProperty(y)?p(a.value[y],...m):p(y,...m)}return{t:c,changeLocale:u}}const Ks={class:"vuefinder"},Ws=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Xs=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},usePropDarkMode:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},postData:{type:Object,default:{}}},setup(n){const t=n,o=Cn(),{setStore:i,getStore:l}=wt(t.id),a=e.ref(l("adapter"));e.provide("emitter",o),e.provide("storage",wt(t.id)),e.provide("postData",t.postData),e.provide("adapter",a),e.provide("maxFileSize",t.maxFileSize),e.provide("usePropDarkMode",t.usePropDarkMode);const u=Ys(t.id,t.locale,o);e.provide("i18n",u);const{apiUrl:p,setApiUrl:c}=ue();c(t.url);const y=e.reactive({adapter:a.value,storages:[],dirname:".",files:[]}),m=e.ref(l("viewport","grid")),b=t.usePropDarkMode?e.computed(()=>t.dark):e.ref(l("darkMode",t.dark));console.log(t.usePropDarkMode),o.on("vf-darkMode-toggle",()=>{b.value=!b.value,i("darkMode",b.value)});const S=e.ref(!1);e.provide("loadingState",S);const E=e.ref(l("full-screen",!1));o.on("vf-fullscreen-toggle",()=>{E.value=!E.value,i("full-screen",E.value)}),o.on("vf-view-toggle",L=>{m.value=L});const _=e.reactive({active:!1,type:"delete",data:{}});o.on("vf-modal-close",()=>{_.active=!1}),o.on("vf-modal-show",L=>{_.active=!0,_.type=L.type,_.data=L});const N=L=>{Object.assign(y,L),o.emit("vf-nodes-selected",{}),o.emit("vf-explorer-update")};let D;return o.on("vf-fetch-abort",()=>{D.abort(),S.value=!1}),o.on("vf-fetch",({params:L,onSuccess:$=null,onError:T=null})=>{["index","search"].includes(L.q)&&(D&&D.abort(),S.value=!0),D=new AbortController;const I=D.signal;ot(p.value,{params:L,signal:I}).then(R=>{a.value=R.adapter,["index","search"].includes(L.q)&&(S.value=!1),o.emit("vf-modal-close"),N(R),$(R)}).catch(R=>{T&&T(R)}).finally(()=>{})}),o.on("vf-download",L=>{document.getElementById("download_frame").src=L,o.emit("vf-modal-close")}),e.onMounted(()=>{o.emit("vf-fetch",{params:{q:"index",adapter:a.value}})}),(L,$)=>(e.openBlock(),e.createElementBlock("div",Ks,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b)?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([E.value?"fixed w-screen inset-0 z-20":"relative rounded-md","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(E.value?"":"max-height: "+n.maxHeight),onMousedown:$[0]||($[0]=T=>e.unref(o).emit("vf-contextmenu-hide")),onTouchstart:$[1]||($[1]=T=>e.unref(o).emit("vf-contextmenu-hide"))},[e.createVNode(so,{data:y},null,8,["data"]),e.createVNode(Ps,{data:y},null,8,["data"]),e.createVNode(rs,{view:m.value,data:y},null,8,["view","data"]),e.createVNode(ys,{data:y},null,8,["data"])],38),_.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+_.type),{key:0,selection:_.data,current:y},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Hs,{current:y},null,8,["current"]),Ws],2)]))}}),Zs=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 dark:bg-gray-600 dark:bg-opacity-75 bg-opacity-75 transition-opacity"},null,-1),qs={class:"fixed z-10 inset-0 overflow-hidden"},Gs={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl w-full"},Js={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Qs={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},me={__name:"ModalLayout",setup(n){const t=e.inject("emitter");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:i[1]||(i[1]=e.withKeys(l=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Zs,e.createElementVNode("div",qs,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:i[0]||(i[0]=e.withModifiers(l=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Gs,[e.createElementVNode("div",Js,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",Qs,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},ea=["aria-label"],ta=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)],pe=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(n,{emit:t}){var p;const{t:o}=e.inject("i18n"),i=e.ref(!1),l=e.ref(null),a=e.ref((p=l.value)==null?void 0:p.strMessage);e.watch(a,()=>i.value=!1);const u=()=>{t("hidden"),i.value=!0};return(c,y)=>(e.openBlock(),e.createElementBlock("div",null,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:l,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",n.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(c.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:u,"aria-label":e.unref(o)("Close"),"data-microtip-position":"top-left",role:"tooltip"},ta,8,ea)],2))]))}}),ra={class:"sm:flex sm:items-start"},na=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})])],-1),oa={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ia={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},sa={class:"mt-2"},aa={class:"text-sm text-gray-500"},la={class:"flex text-sm text-gray-800 dark:text-gray-400"},ca={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},da=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],ha={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ua=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],fa={class:"ml-1.5"},ma={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},pa=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(t.selection.items),u=e.ref(""),p=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"delete",adapter:i.value,path:t.current.dirname,items:JSON.stringify(a.value.map(({path:c,type:y})=>({path:c,type:y})))},onSuccess:()=>{o.emit("vf-toast-push",{label:l("Files deleted.")})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:y[1]||(y[1]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1),e.createElementVNode("div",ma,e.toDisplayString(e.unref(l)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ra,[na,e.createElementVNode("div",oa,[e.createElementVNode("h3",ia,e.toDisplayString(e.unref(l)("Delete files")),1),e.createElementVNode("div",sa,[e.createElementVNode("p",aa,e.toDisplayString(e.unref(l)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("p",la,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",ca,da)):(e.openBlock(),e.createElementBlock("svg",ha,ua)),e.createElementVNode("span",fa,e.toDisplayString(m.basename),1)]))),256)),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[0]||(y[0]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ga={class:"sm:flex sm:items-start"},ya=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1),ba={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},va={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Sa={class:"mt-2"},wa={class:"text-sm text-gray-500"},_a=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(n){const t=e.inject("emitter"),{t:o}=e.inject("i18n");return(i,l)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l[0]||(l[0]=a=>e.unref(t).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var a,u;return[e.createElementVNode("div",ga,[ya,e.createElementVNode("div",ba,[e.createElementVNode("h3",va,e.toDisplayString(((a=n.selection)==null?void 0:a.title)??"Title"),1),e.createElementVNode("div",Sa,[e.createElementVNode("p",wa,e.toDisplayString(((u=n.selection)==null?void 0:u.message)??"Message")+".",1)])])])]}),_:1}))}}),ka={class:"sm:flex sm:items-start"},xa=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})])],-1),Da={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ea={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Na={class:"mt-2"},Ca={class:"text-sm text-gray-500"},Va=["onKeyup","placeholder"],Ma=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfolder",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ka,[xa,e.createElementVNode("div",Da,[e.createElementVNode("h3",Ea,e.toDisplayString(e.unref(l)("New Folder")),1),e.createElementVNode("div",Na,[e.createElementVNode("p",Ca,e.toDisplayString(e.unref(l)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(l)("Folder Name"),type:"text"},null,40,Va),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ta={class:"sm:flex sm:items-start"},Ba=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),$a={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Aa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ia={class:"mt-2"},La={class:"text-sm text-gray-500"},Oa=["onKeyup","placeholder"],ja=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfile",adapter:i.value,path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is created.",a.value)})},onError:c=>{u.value=l(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Create")),1),e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ta,[Ba,e.createElementVNode("div",$a,[e.createElementVNode("h3",Aa,e.toDisplayString(e.unref(l)("New File")),1),e.createElementVNode("div",Ia,[e.createElementVNode("p",La,e.toDisplayString(e.unref(l)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=m=>a.value=m),onKeyup:e.withKeys(p,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(l)("File Name"),type:"text"},null,40,Oa),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[1]||(y[1]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Pa={class:"flex"},za=["aria-label"],Ra={class:"ml-auto mb-2"},Ha={key:0,class:"p-2 border font-normal whitespace-pre-wrap border-gray-200 dark:border-gray-700/50 dark:text-gray-200 rounded min-h-[200px] max-h-[60vh] text-xs overflow-auto"},Fa={key:1},Ua={__name:"Text",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,i=e.ref(""),l=e.ref(""),a=e.ref(null),u=e.ref(!1),{apiUrl:p}=ue(),c=e.ref(""),y=e.ref(!1),{t:m}=e.inject("i18n");e.onMounted(()=>{ot(p.value,{params:{q:"preview",adapter:o.selection.adapter,path:o.selection.item.path},json:!1}).then(_=>{i.value=_,t("load")})});const b=()=>{u.value=!u.value,l.value=i.value,u.value==!0&&e.nextTick(()=>{a.value.focus()})},S=e.inject("postData"),E=()=>{c.value="",y.value=!1,ot(p.value,{method:"POST",params:Object.assign(S,{q:"save",adapter:o.selection.adapter,path:o.selection.item.path,content:l.value}),json:!1}).then(_=>{c.value=m("Updated."),i.value=_,t("load"),u.value=!u.value}).catch(_=>{c.value=m(_.message),y.value=!0})};return(_,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pa,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,za),e.createElementVNode("div",Ra,[u.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:E,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(m)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:N[0]||(N[0]=D=>b())},e.toDisplayString(u.value?e.unref(m)("Cancel"):e.unref(m)("Edit")),1)])]),e.createElementVNode("div",null,[u.value?(e.openBlock(),e.createElementBlock("div",Fa,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:a,"onUpdate:modelValue":N[1]||(N[1]=D=>l.value=D),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] max-h-[60vh] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,l.value]])])):(e.openBlock(),e.createElementBlock("pre",Ha,e.toDisplayString(i.value),1)),c.value.length?(e.openBlock(),e.createBlock(pe,{key:2,onHidden:N[2]||(N[2]=D=>c.value=""),error:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},qh="";/*!
|
|
5
5
|
* Cropper.js v1.5.13
|
|
6
6
|
* https://fengyuanchen.github.io/cropperjs
|
|
7
7
|
*
|
|
@@ -9,14 +9,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
9
9
|
* Released under the MIT license
|
|
10
10
|
*
|
|
11
11
|
* Date: 2022-11-20T05:30:46.114Z
|
|
12
|
-
*/function zr(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(
|
|
13
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ht=typeof window<"u"&&typeof window.document<"u",ge=ht?window:{},Ot=ht&&ge.document.documentElement?"ontouchstart"in ge.document.documentElement:!1,jt=ht?"PointerEvent"in ge:!1,F="cropper",Pt="all",Ur="crop",Yr="move",Kr="zoom",Te="e",Be="w",Le="s",xe="n",Ke="ne",We="nw",Xe="se",Ze="sw",zt="".concat(F,"-crop"),Wr="".concat(F,"-disabled"),Q="".concat(F,"-hidden"),Xr="".concat(F,"-hide"),Ja="".concat(F,"-invisible"),ut="".concat(F,"-modal"),Rt="".concat(F,"-move"),qe="".concat(F,"Action"),ft="".concat(F,"Preview"),Ht="crop",Zr="move",qr="none",Ft="crop",Ut="cropend",Yt="cropmove",Kt="cropstart",Gr="dblclick",Qa=Ot?"touchstart":"mousedown",el=Ot?"touchmove":"mousemove",tl=Ot?"touchend touchcancel":"mouseup",Jr=jt?"pointerdown":Qa,Qr=jt?"pointermove":el,en=jt?"pointerup pointercancel":tl,tn="ready",rn="resize",nn="wheel",Wt="zoom",on="image/jpeg",rl=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,nl=/^data:/,ol=/^data:image\/jpeg;base64,/,il=/^img|canvas$/i,sn=200,an=100,ln={viewMode:0,dragMode:Ht,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:sn,minContainerHeight:an,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},sl='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',al=Number.isNaN||ge.isNaN;function j(n){return typeof n=="number"&&!al(n)}var cn=function(t){return t>0&&t<1/0};function Xt(n){return typeof n>"u"}function $e(n){return It(n)==="object"&&n!==null}var ll=Object.prototype.hasOwnProperty;function Oe(n){if(!$e(n))return!1;try{var t=n.constructor,o=t.prototype;return t&&o&&ll.call(o,"isPrototypeOf")}catch{return!1}}function ee(n){return typeof n=="function"}var cl=Array.prototype.slice;function dn(n){return Array.from?Array.from(n):cl.call(n)}function K(n,t){return n&&ee(t)&&(Array.isArray(n)||j(n.length)?dn(n).forEach(function(o,i){t.call(n,o,i,n)}):$e(n)&&Object.keys(n).forEach(function(o){t.call(n,n[o],o,n)})),n}var U=Object.assign||function(t){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return $e(t)&&i.length>0&&i.forEach(function(l){$e(l)&&Object.keys(l).forEach(function(u){t[u]=l[u]})}),t},dl=/\.\d*(?:0|9){12}\d*$/;function je(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return dl.test(n)?Math.round(n*t)/t:n}var hl=/^width|height|left|top|marginLeft|marginTop$/;function De(n,t){var o=n.style;K(t,function(i,a){hl.test(a)&&j(i)&&(i="".concat(i,"px")),o[a]=i})}function ul(n,t){return n.classList?n.classList.contains(t):n.className.indexOf(t)>-1}function q(n,t){if(t){if(j(n.length)){K(n,function(i){q(i,t)});return}if(n.classList){n.classList.add(t);return}var o=n.className.trim();o?o.indexOf(t)<0&&(n.className="".concat(o," ").concat(t)):n.className=t}}function ye(n,t){if(t){if(j(n.length)){K(n,function(o){ye(o,t)});return}if(n.classList){n.classList.remove(t);return}n.className.indexOf(t)>=0&&(n.className=n.className.replace(t,""))}}function Pe(n,t,o){if(t){if(j(n.length)){K(n,function(i){Pe(i,t,o)});return}o?q(n,t):ye(n,t)}}var fl=/([a-z\d])([A-Z])/g;function Zt(n){return n.replace(fl,"$1-$2").toLowerCase()}function qt(n,t){return $e(n[t])?n[t]:n.dataset?n.dataset[t]:n.getAttribute("data-".concat(Zt(t)))}function Ge(n,t,o){$e(o)?n[t]=o:n.dataset?n.dataset[t]=o:n.setAttribute("data-".concat(Zt(t)),o)}function ml(n,t){if($e(n[t]))try{delete n[t]}catch{n[t]=void 0}else if(n.dataset)try{delete n.dataset[t]}catch{n.dataset[t]=void 0}else n.removeAttribute("data-".concat(Zt(t)))}var hn=/\s\s*/,un=function(){var n=!1;if(ht){var t=!1,o=function(){},i=Object.defineProperty({},"once",{get:function(){return n=!0,t},set:function(l){t=l}});ge.addEventListener("test",o,i),ge.removeEventListener("test",o,i)}return n}();function le(n,t,o){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=o;t.trim().split(hn).forEach(function(l){if(!un){var u=n.listeners;u&&u[l]&&u[l][o]&&(a=u[l][o],delete u[l][o],Object.keys(u[l]).length===0&&delete u[l],Object.keys(u).length===0&&delete n.listeners)}n.removeEventListener(l,a,i)})}function ie(n,t,o){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=o;t.trim().split(hn).forEach(function(l){if(i.once&&!un){var u=n.listeners,g=u===void 0?{}:u;a=function(){delete g[l][o],n.removeEventListener(l,a,i);for(var y=arguments.length,m=new Array(y),b=0;b<y;b++)m[b]=arguments[b];o.apply(n,m)},g[l]||(g[l]={}),g[l][o]&&n.removeEventListener(l,g[l][o],i),g[l][o]=a,n.listeners=g}n.addEventListener(l,a,i)})}function ze(n,t,o){var i;return ee(Event)&&ee(CustomEvent)?i=new CustomEvent(t,{detail:o,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,!0,!0,o)),n.dispatchEvent(i)}function fn(n){var t=n.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Gt=ge.location,pl=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function mn(n){var t=n.match(pl);return t!==null&&(t[1]!==Gt.protocol||t[2]!==Gt.hostname||t[3]!==Gt.port)}function pn(n){var t="timestamp=".concat(new Date().getTime());return n+(n.indexOf("?")===-1?"?":"&")+t}function Je(n){var t=n.rotate,o=n.scaleX,i=n.scaleY,a=n.translateX,l=n.translateY,u=[];j(a)&&a!==0&&u.push("translateX(".concat(a,"px)")),j(l)&&l!==0&&u.push("translateY(".concat(l,"px)")),j(t)&&t!==0&&u.push("rotate(".concat(t,"deg)")),j(o)&&o!==1&&u.push("scaleX(".concat(o,")")),j(i)&&i!==1&&u.push("scaleY(".concat(i,")"));var g=u.length?u.join(" "):"none";return{WebkitTransform:g,msTransform:g,transform:g}}function gl(n){var t=Rr({},n),o=0;return K(n,function(i,a){delete t[a],K(t,function(l){var u=Math.abs(i.startX-l.startX),g=Math.abs(i.startY-l.startY),c=Math.abs(i.endX-l.endX),y=Math.abs(i.endY-l.endY),m=Math.sqrt(u*u+g*g),b=Math.sqrt(c*c+y*y),S=(b-m)/m;Math.abs(S)>Math.abs(o)&&(o=S)})}),o}function mt(n,t){var o=n.pageX,i=n.pageY,a={endX:o,endY:i};return t?a:Rr({startX:o,startY:i},a)}function yl(n){var t=0,o=0,i=0;return K(n,function(a){var l=a.startX,u=a.startY;t+=l,o+=u,i+=1}),t/=i,o/=i,{pageX:t,pageY:o}}function Ee(n){var t=n.aspectRatio,o=n.height,i=n.width,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",l=cn(i),u=cn(o);if(l&&u){var g=o*t;a==="contain"&&g>i||a==="cover"&&g<i?o=i/t:i=o*t}else l?o=i/t:u&&(i=o*t);return{width:i,height:o}}function bl(n){var t=n.width,o=n.height,i=n.degree;if(i=Math.abs(i)%180,i===90)return{width:o,height:t};var a=i%90*Math.PI/180,l=Math.sin(a),u=Math.cos(a),g=t*u+o*l,c=t*l+o*u;return i>90?{width:c,height:g}:{width:g,height:c}}function vl(n,t,o,i){var a=t.aspectRatio,l=t.naturalWidth,u=t.naturalHeight,g=t.rotate,c=g===void 0?0:g,y=t.scaleX,m=y===void 0?1:y,b=t.scaleY,S=b===void 0?1:b,x=o.aspectRatio,D=o.naturalWidth,N=o.naturalHeight,E=i.fillColor,L=E===void 0?"transparent":E,$=i.imageSmoothingEnabled,T=$===void 0?!0:$,I=i.imageSmoothingQuality,R=I===void 0?"low":I,_=i.maxWidth,M=_===void 0?1/0:_,H=i.maxHeight,X=H===void 0?1/0:H,W=i.minWidth,te=W===void 0?0:W,se=i.minHeight,ne=se===void 0?0:se,re=document.createElement("canvas"),C=re.getContext("2d"),B=Ee({aspectRatio:x,width:M,height:X}),V=Ee({aspectRatio:x,width:te,height:ne},"cover"),Y=Math.min(B.width,Math.max(V.width,D)),O=Math.min(B.height,Math.max(V.height,N)),ce=Ee({aspectRatio:a,width:M,height:X}),ae=Ee({aspectRatio:a,width:te,height:ne},"cover"),pt=Math.min(ce.width,Math.max(ae.width,l)),gt=Math.min(ce.height,Math.max(ae.height,u)),Qt=[-pt/2,-gt/2,pt,gt];return re.width=je(Y),re.height=je(O),C.fillStyle=L,C.fillRect(0,0,Y,O),C.save(),C.translate(Y/2,O/2),C.rotate(c*Math.PI/180),C.scale(m,S),C.imageSmoothingEnabled=T,C.imageSmoothingQuality=R,C.drawImage.apply(C,[n].concat(Fr(Qt.map(function(yt){return Math.floor(je(yt))})))),C.restore(),re}var gn=String.fromCharCode;function Sl(n,t,o){var i="";o+=t;for(var a=t;a<o;a+=1)i+=gn(n.getUint8(a));return i}var wl=/^data:.*,/;function _l(n){var t=n.replace(wl,""),o=atob(t),i=new ArrayBuffer(o.length),a=new Uint8Array(i);return K(a,function(l,u){a[u]=o.charCodeAt(u)}),i}function kl(n,t){for(var o=[],i=8192,a=new Uint8Array(n);a.length>0;)o.push(gn.apply(null,dn(a.subarray(0,i)))),a=a.subarray(i);return"data:".concat(t,";base64,").concat(btoa(o.join("")))}function xl(n){var t=new DataView(n),o;try{var i,a,l;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var u=t.byteLength,g=2;g+1<u;){if(t.getUint8(g)===255&&t.getUint8(g+1)===225){a=g;break}g+=1}if(a){var c=a+4,y=a+10;if(Sl(t,c,4)==="Exif"){var m=t.getUint16(y);if(i=m===18761,(i||m===19789)&&t.getUint16(y+2,i)===42){var b=t.getUint32(y+4,i);b>=8&&(l=y+b)}}}if(l){var S=t.getUint16(l,i),x,D;for(D=0;D<S;D+=1)if(x=l+D*12+2,t.getUint16(x,i)===274){x+=8,o=t.getUint16(x,i),t.setUint16(x,1,i);break}}}catch{o=1}return o}function Dl(n){var t=0,o=1,i=1;switch(n){case 2:o=-1;break;case 3:t=-180;break;case 4:i=-1;break;case 5:t=90,i=-1;break;case 6:t=90;break;case 7:t=90,o=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:o,scaleY:i}}var El={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,o=this.options,i=this.container,a=this.cropper,l=Number(o.minContainerWidth),u=Number(o.minContainerHeight);q(a,Q),ye(t,Q);var g={width:Math.max(i.offsetWidth,l>=0?l:sn),height:Math.max(i.offsetHeight,u>=0?u:an)};this.containerData=g,De(a,{width:g.width,height:g.height}),q(t,Q),ye(a,Q)},initCanvas:function(){var t=this.containerData,o=this.imageData,i=this.options.viewMode,a=Math.abs(o.rotate)%180===90,l=a?o.naturalHeight:o.naturalWidth,u=a?o.naturalWidth:o.naturalHeight,g=l/u,c=t.width,y=t.height;t.height*g>t.width?i===3?c=t.height*g:y=t.width/g:i===3?y=t.width/g:c=t.height*g;var m={aspectRatio:g,naturalWidth:l,naturalHeight:u,width:c,height:y};this.canvasData=m,this.limited=i===1||i===2,this.limitCanvas(!0,!0),m.width=Math.min(Math.max(m.width,m.minWidth),m.maxWidth),m.height=Math.min(Math.max(m.height,m.minHeight),m.maxHeight),m.left=(t.width-m.width)/2,m.top=(t.height-m.height)/2,m.oldLeft=m.left,m.oldTop=m.top,this.initialCanvasData=U({},m)},limitCanvas:function(t,o){var i=this.options,a=this.containerData,l=this.canvasData,u=this.cropBoxData,g=i.viewMode,c=l.aspectRatio,y=this.cropped&&u;if(t){var m=Number(i.minCanvasWidth)||0,b=Number(i.minCanvasHeight)||0;g>1?(m=Math.max(m,a.width),b=Math.max(b,a.height),g===3&&(b*c>m?m=b*c:b=m/c)):g>0&&(m?m=Math.max(m,y?u.width:0):b?b=Math.max(b,y?u.height:0):y&&(m=u.width,b=u.height,b*c>m?m=b*c:b=m/c));var S=Ee({aspectRatio:c,width:m,height:b});m=S.width,b=S.height,l.minWidth=m,l.minHeight=b,l.maxWidth=1/0,l.maxHeight=1/0}if(o)if(g>(y?0:1)){var x=a.width-l.width,D=a.height-l.height;l.minLeft=Math.min(0,x),l.minTop=Math.min(0,D),l.maxLeft=Math.max(0,x),l.maxTop=Math.max(0,D),y&&this.limited&&(l.minLeft=Math.min(u.left,u.left+(u.width-l.width)),l.minTop=Math.min(u.top,u.top+(u.height-l.height)),l.maxLeft=u.left,l.maxTop=u.top,g===2&&(l.width>=a.width&&(l.minLeft=Math.min(0,x),l.maxLeft=Math.max(0,x)),l.height>=a.height&&(l.minTop=Math.min(0,D),l.maxTop=Math.max(0,D))))}else l.minLeft=-l.width,l.minTop=-l.height,l.maxLeft=a.width,l.maxTop=a.height},renderCanvas:function(t,o){var i=this.canvasData,a=this.imageData;if(o){var l=bl({width:a.naturalWidth*Math.abs(a.scaleX||1),height:a.naturalHeight*Math.abs(a.scaleY||1),degree:a.rotate||0}),u=l.width,g=l.height,c=i.width*(u/i.naturalWidth),y=i.height*(g/i.naturalHeight);i.left-=(c-i.width)/2,i.top-=(y-i.height)/2,i.width=c,i.height=y,i.aspectRatio=u/g,i.naturalWidth=u,i.naturalHeight=g,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,De(this.canvas,U({width:i.width,height:i.height},Je({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var o=this.canvasData,i=this.imageData,a=i.naturalWidth*(o.width/o.naturalWidth),l=i.naturalHeight*(o.height/o.naturalHeight);U(i,{width:a,height:l,left:(o.width-a)/2,top:(o.height-l)/2}),De(this.image,U({width:i.width,height:i.height},Je(U({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,o=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,a=Number(t.autoCropArea)||.8,l={width:o.width,height:o.height};i&&(o.height*i>o.width?l.height=l.width/i:l.width=l.height*i),this.cropBoxData=l,this.limitCropBox(!0,!0),l.width=Math.min(Math.max(l.width,l.minWidth),l.maxWidth),l.height=Math.min(Math.max(l.height,l.minHeight),l.maxHeight),l.width=Math.max(l.minWidth,l.width*a),l.height=Math.max(l.minHeight,l.height*a),l.left=o.left+(o.width-l.width)/2,l.top=o.top+(o.height-l.height)/2,l.oldLeft=l.left,l.oldTop=l.top,this.initialCropBoxData=U({},l)},limitCropBox:function(t,o){var i=this.options,a=this.containerData,l=this.canvasData,u=this.cropBoxData,g=this.limited,c=i.aspectRatio;if(t){var y=Number(i.minCropBoxWidth)||0,m=Number(i.minCropBoxHeight)||0,b=g?Math.min(a.width,l.width,l.width+l.left,a.width-l.left):a.width,S=g?Math.min(a.height,l.height,l.height+l.top,a.height-l.top):a.height;y=Math.min(y,a.width),m=Math.min(m,a.height),c&&(y&&m?m*c>y?m=y/c:y=m*c:y?m=y/c:m&&(y=m*c),S*c>b?S=b/c:b=S*c),u.minWidth=Math.min(y,b),u.minHeight=Math.min(m,S),u.maxWidth=b,u.maxHeight=S}o&&(g?(u.minLeft=Math.max(0,l.left),u.minTop=Math.max(0,l.top),u.maxLeft=Math.min(a.width,l.left+l.width)-u.width,u.maxTop=Math.min(a.height,l.top+l.height)-u.height):(u.minLeft=0,u.minTop=0,u.maxLeft=a.width-u.width,u.maxTop=a.height-u.height))},renderCropBox:function(){var t=this.options,o=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&Ge(this.face,qe,i.width>=o.width&&i.height>=o.height?Yr:Pt),De(this.cropBox,U({width:i.width,height:i.height},Je({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ze(this.element,Ft,this.getData())}},Nl={initPreview:function(){var t=this.element,o=this.crossOrigin,i=this.options.preview,a=o?this.crossOriginUrl:this.url,l=t.alt||"The image to preview",u=document.createElement("img");if(o&&(u.crossOrigin=o),u.src=a,u.alt=l,this.viewBox.appendChild(u),this.viewBoxImage=u,!!i){var g=i;typeof i=="string"?g=t.ownerDocument.querySelectorAll(i):i.querySelector&&(g=[i]),this.previews=g,K(g,function(c){var y=document.createElement("img");Ge(c,ft,{width:c.offsetWidth,height:c.offsetHeight,html:c.innerHTML}),o&&(y.crossOrigin=o),y.src=a,y.alt=l,y.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',c.innerHTML="",c.appendChild(y)})}},resetPreview:function(){K(this.previews,function(t){var o=qt(t,ft);De(t,{width:o.width,height:o.height}),t.innerHTML=o.html,ml(t,ft)})},preview:function(){var t=this.imageData,o=this.canvasData,i=this.cropBoxData,a=i.width,l=i.height,u=t.width,g=t.height,c=i.left-o.left-t.left,y=i.top-o.top-t.top;!this.cropped||this.disabled||(De(this.viewBoxImage,U({width:u,height:g},Je(U({translateX:-c,translateY:-y},t)))),K(this.previews,function(m){var b=qt(m,ft),S=b.width,x=b.height,D=S,N=x,E=1;a&&(E=S/a,N=l*E),l&&N>x&&(E=x/l,D=a*E,N=x),De(m,{width:D,height:N}),De(m.getElementsByTagName("img")[0],U({width:u*E,height:g*E},Je(U({translateX:-c*E,translateY:-y*E},t))))}))}},Cl={bind:function(){var t=this.element,o=this.options,i=this.cropper;ee(o.cropstart)&&ie(t,Kt,o.cropstart),ee(o.cropmove)&&ie(t,Yt,o.cropmove),ee(o.cropend)&&ie(t,Ut,o.cropend),ee(o.crop)&&ie(t,Ft,o.crop),ee(o.zoom)&&ie(t,Wt,o.zoom),ie(i,Jr,this.onCropStart=this.cropStart.bind(this)),o.zoomable&&o.zoomOnWheel&&ie(i,nn,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),o.toggleDragModeOnDblclick&&ie(i,Gr,this.onDblclick=this.dblclick.bind(this)),ie(t.ownerDocument,Qr,this.onCropMove=this.cropMove.bind(this)),ie(t.ownerDocument,en,this.onCropEnd=this.cropEnd.bind(this)),o.responsive&&ie(window,rn,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,o=this.options,i=this.cropper;ee(o.cropstart)&&le(t,Kt,o.cropstart),ee(o.cropmove)&&le(t,Yt,o.cropmove),ee(o.cropend)&&le(t,Ut,o.cropend),ee(o.crop)&&le(t,Ft,o.crop),ee(o.zoom)&&le(t,Wt,o.zoom),le(i,Jr,this.onCropStart),o.zoomable&&o.zoomOnWheel&&le(i,nn,this.onWheel,{passive:!1,capture:!0}),o.toggleDragModeOnDblclick&&le(i,Gr,this.onDblclick),le(t.ownerDocument,Qr,this.onCropMove),le(t.ownerDocument,en,this.onCropEnd),o.responsive&&le(window,rn,this.onResize)}},Vl={resize:function(){if(!this.disabled){var t=this.options,o=this.container,i=this.containerData,a=o.offsetWidth/i.width,l=o.offsetHeight/i.height,u=Math.abs(a-1)>Math.abs(l-1)?a:l;if(u!==1){var g,c;t.restore&&(g=this.getCanvasData(),c=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(K(g,function(y,m){g[m]=y*u})),this.setCropBoxData(K(c,function(y,m){c[m]=y*u})))}}},dblclick:function(){this.disabled||this.options.dragMode===qr||this.setDragMode(ul(this.dragBox,zt)?Zr:Ht)},wheel:function(t){var o=this,i=Number(this.options.wheelZoomRatio)||.1,a=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){o.wheeling=!1},50),t.deltaY?a=t.deltaY>0?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=t.detail>0?1:-1),this.zoom(-a*i,t)))},cropStart:function(t){var o=t.buttons,i=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(j(o)&&o!==1||j(i)&&i!==0||t.ctrlKey))){var a=this.options,l=this.pointers,u;t.changedTouches?K(t.changedTouches,function(g){l[g.identifier]=mt(g)}):l[t.pointerId||0]=mt(t),Object.keys(l).length>1&&a.zoomable&&a.zoomOnTouch?u=Kr:u=qt(t.target,qe),rl.test(u)&&ze(this.element,Kt,{originalEvent:t,action:u})!==!1&&(t.preventDefault(),this.action=u,this.cropping=!1,u===Ur&&(this.cropping=!0,q(this.dragBox,ut)))}},cropMove:function(t){var o=this.action;if(!(this.disabled||!o)){var i=this.pointers;t.preventDefault(),ze(this.element,Yt,{originalEvent:t,action:o})!==!1&&(t.changedTouches?K(t.changedTouches,function(a){U(i[a.identifier]||{},mt(a,!0))}):U(i[t.pointerId||0]||{},mt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var o=this.action,i=this.pointers;t.changedTouches?K(t.changedTouches,function(a){delete i[a.identifier]}):delete i[t.pointerId||0],o&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,Pe(this.dragBox,ut,this.cropped&&this.options.modal)),ze(this.element,Ut,{originalEvent:t,action:o}))}}},Ml={change:function(t){var o=this.options,i=this.canvasData,a=this.containerData,l=this.cropBoxData,u=this.pointers,g=this.action,c=o.aspectRatio,y=l.left,m=l.top,b=l.width,S=l.height,x=y+b,D=m+S,N=0,E=0,L=a.width,$=a.height,T=!0,I;!c&&t.shiftKey&&(c=b&&S?b/S:1),this.limited&&(N=l.minLeft,E=l.minTop,L=N+Math.min(a.width,i.width,i.left+i.width),$=E+Math.min(a.height,i.height,i.top+i.height));var R=u[Object.keys(u)[0]],_={x:R.endX-R.startX,y:R.endY-R.startY},M=function(X){switch(X){case Te:x+_.x>L&&(_.x=L-x);break;case Be:y+_.x<N&&(_.x=N-y);break;case xe:m+_.y<E&&(_.y=E-m);break;case Le:D+_.y>$&&(_.y=$-D);break}};switch(g){case Pt:y+=_.x,m+=_.y;break;case Te:if(_.x>=0&&(x>=L||c&&(m<=E||D>=$))){T=!1;break}M(Te),b+=_.x,b<0&&(g=Be,b=-b,y-=b),c&&(S=b/c,m+=(l.height-S)/2);break;case xe:if(_.y<=0&&(m<=E||c&&(y<=N||x>=L))){T=!1;break}M(xe),S-=_.y,m+=_.y,S<0&&(g=Le,S=-S,m-=S),c&&(b=S*c,y+=(l.width-b)/2);break;case Be:if(_.x<=0&&(y<=N||c&&(m<=E||D>=$))){T=!1;break}M(Be),b-=_.x,y+=_.x,b<0&&(g=Te,b=-b,y-=b),c&&(S=b/c,m+=(l.height-S)/2);break;case Le:if(_.y>=0&&(D>=$||c&&(y<=N||x>=L))){T=!1;break}M(Le),S+=_.y,S<0&&(g=xe,S=-S,m-=S),c&&(b=S*c,y+=(l.width-b)/2);break;case Ke:if(c){if(_.y<=0&&(m<=E||x>=L)){T=!1;break}M(xe),S-=_.y,m+=_.y,b=S*c}else M(xe),M(Te),_.x>=0?x<L?b+=_.x:_.y<=0&&m<=E&&(T=!1):b+=_.x,_.y<=0?m>E&&(S-=_.y,m+=_.y):(S-=_.y,m+=_.y);b<0&&S<0?(g=Ze,S=-S,b=-b,m-=S,y-=b):b<0?(g=We,b=-b,y-=b):S<0&&(g=Xe,S=-S,m-=S);break;case We:if(c){if(_.y<=0&&(m<=E||y<=N)){T=!1;break}M(xe),S-=_.y,m+=_.y,b=S*c,y+=l.width-b}else M(xe),M(Be),_.x<=0?y>N?(b-=_.x,y+=_.x):_.y<=0&&m<=E&&(T=!1):(b-=_.x,y+=_.x),_.y<=0?m>E&&(S-=_.y,m+=_.y):(S-=_.y,m+=_.y);b<0&&S<0?(g=Xe,S=-S,b=-b,m-=S,y-=b):b<0?(g=Ke,b=-b,y-=b):S<0&&(g=Ze,S=-S,m-=S);break;case Ze:if(c){if(_.x<=0&&(y<=N||D>=$)){T=!1;break}M(Be),b-=_.x,y+=_.x,S=b/c}else M(Le),M(Be),_.x<=0?y>N?(b-=_.x,y+=_.x):_.y>=0&&D>=$&&(T=!1):(b-=_.x,y+=_.x),_.y>=0?D<$&&(S+=_.y):S+=_.y;b<0&&S<0?(g=Ke,S=-S,b=-b,m-=S,y-=b):b<0?(g=Xe,b=-b,y-=b):S<0&&(g=We,S=-S,m-=S);break;case Xe:if(c){if(_.x>=0&&(x>=L||D>=$)){T=!1;break}M(Te),b+=_.x,S=b/c}else M(Le),M(Te),_.x>=0?x<L?b+=_.x:_.y>=0&&D>=$&&(T=!1):b+=_.x,_.y>=0?D<$&&(S+=_.y):S+=_.y;b<0&&S<0?(g=We,S=-S,b=-b,m-=S,y-=b):b<0?(g=Ze,b=-b,y-=b):S<0&&(g=Ke,S=-S,m-=S);break;case Yr:this.move(_.x,_.y),T=!1;break;case Kr:this.zoom(gl(u),t),T=!1;break;case Ur:if(!_.x||!_.y){T=!1;break}I=fn(this.cropper),y=R.startX-I.left,m=R.startY-I.top,b=l.minWidth,S=l.minHeight,_.x>0?g=_.y>0?Xe:Ke:_.x<0&&(y-=b,g=_.y>0?Ze:We),_.y<0&&(m-=S),this.cropped||(ye(this.cropBox,Q),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(l.width=b,l.height=S,l.left=y,l.top=m,this.action=g,this.renderCropBox()),K(u,function(H){H.startX=H.endX,H.startY=H.endY})}},Tl={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&q(this.dragBox,ut),ye(this.cropBox,Q),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=U({},this.initialImageData),this.canvasData=U({},this.initialCanvasData),this.cropBoxData=U({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(U(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ye(this.dragBox,ut),q(this.cropBox,Q)),this},replace:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),o?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,K(this.previews,function(i){i.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,ye(this.cropper,Wr)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,q(this.cropper,Wr)),this},destroy:function(){var t=this.element;return t[F]?(t[F]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,a=i.left,l=i.top;return this.moveTo(Xt(t)?t:a+Number(t),Xt(o)?o:l+Number(o))},moveTo:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,a=!1;return t=Number(t),o=Number(o),this.ready&&!this.disabled&&this.options.movable&&(j(t)&&(i.left=t,a=!0),j(o)&&(i.top=o,a=!0),a&&this.renderCanvas(!0)),this},zoom:function(t,o){var i=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(i.width*t/i.naturalWidth,null,o)},zoomTo:function(t,o,i){var a=this.options,l=this.canvasData,u=l.width,g=l.height,c=l.naturalWidth,y=l.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&a.zoomable){var m=c*t,b=y*t;if(ze(this.element,Wt,{ratio:t,oldRatio:u/c,originalEvent:i})===!1)return this;if(i){var S=this.pointers,x=fn(this.cropper),D=S&&Object.keys(S).length?yl(S):{pageX:i.pageX,pageY:i.pageY};l.left-=(m-u)*((D.pageX-x.left-l.left)/u),l.top-=(b-g)*((D.pageY-x.top-l.top)/g)}else Oe(o)&&j(o.x)&&j(o.y)?(l.left-=(m-u)*((o.x-l.left)/u),l.top-=(b-g)*((o.y-l.top)/g)):(l.left-=(m-u)/2,l.top-=(b-g)/2);l.width=m,l.height=b,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),j(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var o=this.imageData.scaleY;return this.scale(t,j(o)?o:1)},scaleY:function(t){var o=this.imageData.scaleX;return this.scale(j(o)?o:1,t)},scale:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.imageData,a=!1;return t=Number(t),o=Number(o),this.ready&&!this.disabled&&this.options.scalable&&(j(t)&&(i.scaleX=t,a=!0),j(o)&&(i.scaleY=o,a=!0),a&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=this.options,i=this.imageData,a=this.canvasData,l=this.cropBoxData,u;if(this.ready&&this.cropped){u={x:l.left-a.left,y:l.top-a.top,width:l.width,height:l.height};var g=i.width/i.naturalWidth;if(K(u,function(m,b){u[b]=m/g}),t){var c=Math.round(u.y+u.height),y=Math.round(u.x+u.width);u.x=Math.round(u.x),u.y=Math.round(u.y),u.width=y-u.x,u.height=c-u.y}}else u={x:0,y:0,width:0,height:0};return o.rotatable&&(u.rotate=i.rotate||0),o.scalable&&(u.scaleX=i.scaleX||1,u.scaleY=i.scaleY||1),u},setData:function(t){var o=this.options,i=this.imageData,a=this.canvasData,l={};if(this.ready&&!this.disabled&&Oe(t)){var u=!1;o.rotatable&&j(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,u=!0),o.scalable&&(j(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,u=!0),j(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,u=!0)),u&&this.renderCanvas(!0,!0);var g=i.width/i.naturalWidth;j(t.x)&&(l.left=t.x*g+a.left),j(t.y)&&(l.top=t.y*g+a.top),j(t.width)&&(l.width=t.width*g),j(t.height)&&(l.height=t.height*g),this.setCropBoxData(l)}return this},getContainerData:function(){return this.ready?U({},this.containerData):{}},getImageData:function(){return this.sized?U({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,o={};return this.ready&&K(["left","top","width","height","naturalWidth","naturalHeight"],function(i){o[i]=t[i]}),o},setCanvasData:function(t){var o=this.canvasData,i=o.aspectRatio;return this.ready&&!this.disabled&&Oe(t)&&(j(t.left)&&(o.left=t.left),j(t.top)&&(o.top=t.top),j(t.width)?(o.width=t.width,o.height=t.width/i):j(t.height)&&(o.height=t.height,o.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,o;return this.ready&&this.cropped&&(o={left:t.left,top:t.top,width:t.width,height:t.height}),o||{}},setCropBoxData:function(t){var o=this.cropBoxData,i=this.options.aspectRatio,a,l;return this.ready&&this.cropped&&!this.disabled&&Oe(t)&&(j(t.left)&&(o.left=t.left),j(t.top)&&(o.top=t.top),j(t.width)&&t.width!==o.width&&(a=!0,o.width=t.width),j(t.height)&&t.height!==o.height&&(l=!0,o.height=t.height),i&&(a?o.height=o.width/i:l&&(o.width=o.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var o=this.canvasData,i=vl(this.image,this.imageData,o,t);if(!this.cropped)return i;var a=this.getData(),l=a.x,u=a.y,g=a.width,c=a.height,y=i.width/Math.floor(o.naturalWidth);y!==1&&(l*=y,u*=y,g*=y,c*=y);var m=g/c,b=Ee({aspectRatio:m,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),S=Ee({aspectRatio:m,width:t.minWidth||0,height:t.minHeight||0},"cover"),x=Ee({aspectRatio:m,width:t.width||(y!==1?i.width:g),height:t.height||(y!==1?i.height:c)}),D=x.width,N=x.height;D=Math.min(b.width,Math.max(S.width,D)),N=Math.min(b.height,Math.max(S.height,N));var E=document.createElement("canvas"),L=E.getContext("2d");E.width=je(D),E.height=je(N),L.fillStyle=t.fillColor||"transparent",L.fillRect(0,0,D,N);var $=t.imageSmoothingEnabled,T=$===void 0?!0:$,I=t.imageSmoothingQuality;L.imageSmoothingEnabled=T,I&&(L.imageSmoothingQuality=I);var R=i.width,_=i.height,M=l,H=u,X,W,te,se,ne,re;M<=-g||M>R?(M=0,X=0,te=0,ne=0):M<=0?(te=-M,M=0,X=Math.min(R,g+M),ne=X):M<=R&&(te=0,X=Math.min(g,R-M),ne=X),X<=0||H<=-c||H>_?(H=0,W=0,se=0,re=0):H<=0?(se=-H,H=0,W=Math.min(_,c+H),re=W):H<=_&&(se=0,W=Math.min(c,_-H),re=W);var C=[M,H,X,W];if(ne>0&&re>0){var B=D/g;C.push(te*B,se*B,ne*B,re*B)}return L.drawImage.apply(L,[i].concat(Fr(C.map(function(V){return Math.floor(je(V))})))),E},setAspectRatio:function(t){var o=this.options;return!this.disabled&&!Xt(t)&&(o.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var o=this.options,i=this.dragBox,a=this.face;if(this.ready&&!this.disabled){var l=t===Ht,u=o.movable&&t===Zr;t=l||u?t:qr,o.dragMode=t,Ge(i,qe,t),Pe(i,zt,l),Pe(i,Rt,u),o.cropBoxMovable||(Ge(a,qe,t),Pe(a,zt,l),Pe(a,Rt,u))}return this}},Bl=ge.Cropper,yn=function(){function n(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ya(this,n),!t||!il.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=U({},ln,Oe(o)&&o),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Ka(n,[{key:"init",value:function(){var o=this.element,i=o.tagName.toLowerCase(),a;if(!o[F]){if(o[F]=this,i==="img"){if(this.isImg=!0,a=o.getAttribute("src")||"",this.originalUrl=a,!a)return;a=o.src}else i==="canvas"&&window.HTMLCanvasElement&&(a=o.toDataURL());this.load(a)}}},{key:"load",value:function(o){var i=this;if(o){this.url=o,this.imageData={};var a=this.element,l=this.options;if(!l.rotatable&&!l.scalable&&(l.checkOrientation=!1),!l.checkOrientation||!window.ArrayBuffer){this.clone();return}if(nl.test(o)){ol.test(o)?this.read(_l(o)):this.clone();return}var u=new XMLHttpRequest,g=this.clone.bind(this);this.reloading=!0,this.xhr=u,u.onabort=g,u.onerror=g,u.ontimeout=g,u.onprogress=function(){u.getResponseHeader("content-type")!==on&&u.abort()},u.onload=function(){i.read(u.response)},u.onloadend=function(){i.reloading=!1,i.xhr=null},l.checkCrossOrigin&&mn(o)&&a.crossOrigin&&(o=pn(o)),u.open("GET",o,!0),u.responseType="arraybuffer",u.withCredentials=a.crossOrigin==="use-credentials",u.send()}}},{key:"read",value:function(o){var i=this.options,a=this.imageData,l=xl(o),u=0,g=1,c=1;if(l>1){this.url=kl(o,on);var y=Dl(l);u=y.rotate,g=y.scaleX,c=y.scaleY}i.rotatable&&(a.rotate=u),i.scalable&&(a.scaleX=g,a.scaleY=c),this.clone()}},{key:"clone",value:function(){var o=this.element,i=this.url,a=o.crossOrigin,l=i;this.options.checkCrossOrigin&&mn(i)&&(a||(a="anonymous"),l=pn(i)),this.crossOrigin=a,this.crossOriginUrl=l;var u=document.createElement("img");a&&(u.crossOrigin=a),u.src=l||i,u.alt=o.alt||"The image to crop",this.image=u,u.onload=this.start.bind(this),u.onerror=this.stop.bind(this),q(u,Xr),o.parentNode.insertBefore(u,o.nextSibling)}},{key:"start",value:function(){var o=this,i=this.image;i.onload=null,i.onerror=null,this.sizing=!0;var a=ge.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ge.navigator.userAgent),l=function(y,m){U(o.imageData,{naturalWidth:y,naturalHeight:m,aspectRatio:y/m}),o.initialImageData=U({},o.imageData),o.sizing=!1,o.sized=!0,o.build()};if(i.naturalWidth&&!a){l(i.naturalWidth,i.naturalHeight);return}var u=document.createElement("img"),g=document.body||document.documentElement;this.sizingImage=u,u.onload=function(){l(u.width,u.height),a||g.removeChild(u)},u.src=i.src,a||(u.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",g.appendChild(u))}},{key:"stop",value:function(){var o=this.image;o.onload=null,o.onerror=null,o.parentNode.removeChild(o),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var o=this.element,i=this.options,a=this.image,l=o.parentNode,u=document.createElement("div");u.innerHTML=sl;var g=u.querySelector(".".concat(F,"-container")),c=g.querySelector(".".concat(F,"-canvas")),y=g.querySelector(".".concat(F,"-drag-box")),m=g.querySelector(".".concat(F,"-crop-box")),b=m.querySelector(".".concat(F,"-face"));this.container=l,this.cropper=g,this.canvas=c,this.dragBox=y,this.cropBox=m,this.viewBox=g.querySelector(".".concat(F,"-view-box")),this.face=b,c.appendChild(a),q(o,Q),l.insertBefore(g,o.nextSibling),ye(a,Xr),this.initPreview(),this.bind(),i.initialAspectRatio=Math.max(0,i.initialAspectRatio)||NaN,i.aspectRatio=Math.max(0,i.aspectRatio)||NaN,i.viewMode=Math.max(0,Math.min(3,Math.round(i.viewMode)))||0,q(m,Q),i.guides||q(m.getElementsByClassName("".concat(F,"-dashed")),Q),i.center||q(m.getElementsByClassName("".concat(F,"-center")),Q),i.background&&q(g,"".concat(F,"-bg")),i.highlight||q(b,Ja),i.cropBoxMovable&&(q(b,Rt),Ge(b,qe,Pt)),i.cropBoxResizable||(q(m.getElementsByClassName("".concat(F,"-line")),Q),q(m.getElementsByClassName("".concat(F,"-point")),Q)),this.render(),this.ready=!0,this.setDragMode(i.dragMode),i.autoCrop&&this.crop(),this.setData(i.data),ee(i.ready)&&ie(o,tn,i.ready,{once:!0}),ze(o,tn)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var o=this.cropper.parentNode;o&&o.removeChild(this.cropper),ye(this.element,Q)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Bl,n}},{key:"setDefaults",value:function(o){U(ln,Oe(o)&&o)}}]),n}();U(yn.prototype,El,Nl,Cl,Vl,Ml,Tl);const $l={class:"flex"},Al=["aria-label"],Il={class:"ml-auto mb-2"},Ll={class:"w-full flex justify-center"},Ol=["src"],jl={__name:"Image",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{t:i}=e.inject("i18n"),{apiUrl:a}=ue(),l=e.ref(null),u=e.ref(null),g=e.ref(!1),c=e.ref(""),y=e.ref(!1),m=()=>{g.value=!g.value,g.value?u.value=new yn(l.value,{crop(x){}}):u.value.destroy()},b=e.inject("postData"),S=()=>{u.value.getCroppedCanvas({width:795,height:341}).toBlob(x=>{c.value="",y.value=!1,ot(a.value,{method:"POST",params:Object.assign(b,{q:"upload",adapter:o.selection.adapter,path:o.selection.item.path,file:x}),name:o.selection.item.basename,json:!1}).then(D=>{c.value=i("Updated."),l.value.src=_t(o.selection.adapter,o.selection.item.path),m(),t("load")}).catch(D=>{c.value=i(D.message),y.value=!0})})};return e.onMounted(()=>{t("load")}),(x,D)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",$l,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Al),e.createElementVNode("div",Il,[g.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:S,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(i)("Crop")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:D[0]||(D[0]=N=>m())},e.toDisplayString(g.value?e.unref(i)("Cancel"):e.unref(i)("Edit")),1)])]),e.createElementVNode("div",Ll,[e.createElementVNode("img",{ref_key:"image",ref:l,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(_t)(o.selection.adapter,o.selection.item.path),alt:""},null,8,Ol)]),c.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:D[1]||(D[1]=N=>c.value=""),error:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},Pl={class:"flex"},zl=["aria-label"],Rl=e.createElementVNode("div",null,null,-1),Hl={__name:"Default",props:{selection:Object},emits:["load"],setup(n,{emit:t}){return e.onMounted(()=>{t("load")}),(o,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pl,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,zl)]),Rl],64))}},Fl=["aria-label"],Ul={class:"w-full",preload:"",controls:""},Yl=["src"],Kl={__name:"Video",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{apiUrl:i}=ue(),a=()=>i.value+"?"+Ce({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(l,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Fl),e.createElementVNode("div",null,[e.createElementVNode("video",Ul,[e.createElementVNode("source",{src:a(),type:"video/mp4"},null,8,Yl),e.createTextVNode(" Your browser does not support the video tag. ")])])],64))}},Wl=["aria-label"],Xl={class:"w-full",controls:""},Zl=["src"],ql={__name:"Audio",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{apiUrl:i}=ue(),a=()=>i.value+"?"+Ce({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(l,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Wl),e.createElementVNode("div",null,[e.createElementVNode("audio",Xl,[e.createElementVNode("source",{src:a(),type:"audio/mpeg"},null,8,Zl),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},Gl=["aria-label"],Jl=["data"],Ql=["src"],ec={__name:"Pdf",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{apiUrl:i}=ue(),a=()=>i.value+"?"+Ce({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(l,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Gl),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:a(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:a(),width:"100%",height:"100%"},`
|
|
12
|
+
*/function zr(n,t){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),o.push.apply(o,i)}return o}function Rr(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?zr(Object(o),!0).forEach(function(i){Wa(n,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):zr(Object(o)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(o,i))})}return n}function It(n){"@babel/helpers - typeof";return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(n)}function Ya(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Hr(n,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function Ka(n,t,o){return t&&Hr(n.prototype,t),o&&Hr(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n}function Wa(n,t,o){return t in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}function Fr(n){return Xa(n)||Za(n)||qa(n)||Ga()}function Xa(n){if(Array.isArray(n))return Lt(n)}function Za(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function qa(n,t){if(n){if(typeof n=="string")return Lt(n,t);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set")return Array.from(n);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Lt(n,t)}}function Lt(n,t){(t==null||t>n.length)&&(t=n.length);for(var o=0,i=new Array(t);o<t;o++)i[o]=n[o];return i}function Ga(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
13
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ht=typeof window<"u"&&typeof window.document<"u",ge=ht?window:{},Ot=ht&&ge.document.documentElement?"ontouchstart"in ge.document.documentElement:!1,jt=ht?"PointerEvent"in ge:!1,F="cropper",Pt="all",Ur="crop",Yr="move",Kr="zoom",Te="e",Be="w",Le="s",xe="n",Ke="ne",We="nw",Xe="se",Ze="sw",zt="".concat(F,"-crop"),Wr="".concat(F,"-disabled"),Q="".concat(F,"-hidden"),Xr="".concat(F,"-hide"),Ja="".concat(F,"-invisible"),ut="".concat(F,"-modal"),Rt="".concat(F,"-move"),qe="".concat(F,"Action"),ft="".concat(F,"Preview"),Ht="crop",Zr="move",qr="none",Ft="crop",Ut="cropend",Yt="cropmove",Kt="cropstart",Gr="dblclick",Qa=Ot?"touchstart":"mousedown",el=Ot?"touchmove":"mousemove",tl=Ot?"touchend touchcancel":"mouseup",Jr=jt?"pointerdown":Qa,Qr=jt?"pointermove":el,en=jt?"pointerup pointercancel":tl,tn="ready",rn="resize",nn="wheel",Wt="zoom",on="image/jpeg",rl=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,nl=/^data:/,ol=/^data:image\/jpeg;base64,/,il=/^img|canvas$/i,sn=200,an=100,ln={viewMode:0,dragMode:Ht,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:sn,minContainerHeight:an,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},sl='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',al=Number.isNaN||ge.isNaN;function j(n){return typeof n=="number"&&!al(n)}var cn=function(t){return t>0&&t<1/0};function Xt(n){return typeof n>"u"}function $e(n){return It(n)==="object"&&n!==null}var ll=Object.prototype.hasOwnProperty;function Oe(n){if(!$e(n))return!1;try{var t=n.constructor,o=t.prototype;return t&&o&&ll.call(o,"isPrototypeOf")}catch{return!1}}function ee(n){return typeof n=="function"}var cl=Array.prototype.slice;function dn(n){return Array.from?Array.from(n):cl.call(n)}function K(n,t){return n&&ee(t)&&(Array.isArray(n)||j(n.length)?dn(n).forEach(function(o,i){t.call(n,o,i,n)}):$e(n)&&Object.keys(n).forEach(function(o){t.call(n,n[o],o,n)})),n}var U=Object.assign||function(t){for(var o=arguments.length,i=new Array(o>1?o-1:0),l=1;l<o;l++)i[l-1]=arguments[l];return $e(t)&&i.length>0&&i.forEach(function(a){$e(a)&&Object.keys(a).forEach(function(u){t[u]=a[u]})}),t},dl=/\.\d*(?:0|9){12}\d*$/;function je(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return dl.test(n)?Math.round(n*t)/t:n}var hl=/^width|height|left|top|marginLeft|marginTop$/;function De(n,t){var o=n.style;K(t,function(i,l){hl.test(l)&&j(i)&&(i="".concat(i,"px")),o[l]=i})}function ul(n,t){return n.classList?n.classList.contains(t):n.className.indexOf(t)>-1}function q(n,t){if(t){if(j(n.length)){K(n,function(i){q(i,t)});return}if(n.classList){n.classList.add(t);return}var o=n.className.trim();o?o.indexOf(t)<0&&(n.className="".concat(o," ").concat(t)):n.className=t}}function ye(n,t){if(t){if(j(n.length)){K(n,function(o){ye(o,t)});return}if(n.classList){n.classList.remove(t);return}n.className.indexOf(t)>=0&&(n.className=n.className.replace(t,""))}}function Pe(n,t,o){if(t){if(j(n.length)){K(n,function(i){Pe(i,t,o)});return}o?q(n,t):ye(n,t)}}var fl=/([a-z\d])([A-Z])/g;function Zt(n){return n.replace(fl,"$1-$2").toLowerCase()}function qt(n,t){return $e(n[t])?n[t]:n.dataset?n.dataset[t]:n.getAttribute("data-".concat(Zt(t)))}function Ge(n,t,o){$e(o)?n[t]=o:n.dataset?n.dataset[t]=o:n.setAttribute("data-".concat(Zt(t)),o)}function ml(n,t){if($e(n[t]))try{delete n[t]}catch{n[t]=void 0}else if(n.dataset)try{delete n.dataset[t]}catch{n.dataset[t]=void 0}else n.removeAttribute("data-".concat(Zt(t)))}var hn=/\s\s*/,un=function(){var n=!1;if(ht){var t=!1,o=function(){},i=Object.defineProperty({},"once",{get:function(){return n=!0,t},set:function(a){t=a}});ge.addEventListener("test",o,i),ge.removeEventListener("test",o,i)}return n}();function le(n,t,o){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=o;t.trim().split(hn).forEach(function(a){if(!un){var u=n.listeners;u&&u[a]&&u[a][o]&&(l=u[a][o],delete u[a][o],Object.keys(u[a]).length===0&&delete u[a],Object.keys(u).length===0&&delete n.listeners)}n.removeEventListener(a,l,i)})}function ie(n,t,o){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=o;t.trim().split(hn).forEach(function(a){if(i.once&&!un){var u=n.listeners,p=u===void 0?{}:u;l=function(){delete p[a][o],n.removeEventListener(a,l,i);for(var y=arguments.length,m=new Array(y),b=0;b<y;b++)m[b]=arguments[b];o.apply(n,m)},p[a]||(p[a]={}),p[a][o]&&n.removeEventListener(a,p[a][o],i),p[a][o]=l,n.listeners=p}n.addEventListener(a,l,i)})}function ze(n,t,o){var i;return ee(Event)&&ee(CustomEvent)?i=new CustomEvent(t,{detail:o,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,!0,!0,o)),n.dispatchEvent(i)}function fn(n){var t=n.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Gt=ge.location,pl=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function mn(n){var t=n.match(pl);return t!==null&&(t[1]!==Gt.protocol||t[2]!==Gt.hostname||t[3]!==Gt.port)}function pn(n){var t="timestamp=".concat(new Date().getTime());return n+(n.indexOf("?")===-1?"?":"&")+t}function Je(n){var t=n.rotate,o=n.scaleX,i=n.scaleY,l=n.translateX,a=n.translateY,u=[];j(l)&&l!==0&&u.push("translateX(".concat(l,"px)")),j(a)&&a!==0&&u.push("translateY(".concat(a,"px)")),j(t)&&t!==0&&u.push("rotate(".concat(t,"deg)")),j(o)&&o!==1&&u.push("scaleX(".concat(o,")")),j(i)&&i!==1&&u.push("scaleY(".concat(i,")"));var p=u.length?u.join(" "):"none";return{WebkitTransform:p,msTransform:p,transform:p}}function gl(n){var t=Rr({},n),o=0;return K(n,function(i,l){delete t[l],K(t,function(a){var u=Math.abs(i.startX-a.startX),p=Math.abs(i.startY-a.startY),c=Math.abs(i.endX-a.endX),y=Math.abs(i.endY-a.endY),m=Math.sqrt(u*u+p*p),b=Math.sqrt(c*c+y*y),S=(b-m)/m;Math.abs(S)>Math.abs(o)&&(o=S)})}),o}function mt(n,t){var o=n.pageX,i=n.pageY,l={endX:o,endY:i};return t?l:Rr({startX:o,startY:i},l)}function yl(n){var t=0,o=0,i=0;return K(n,function(l){var a=l.startX,u=l.startY;t+=a,o+=u,i+=1}),t/=i,o/=i,{pageX:t,pageY:o}}function Ee(n){var t=n.aspectRatio,o=n.height,i=n.width,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",a=cn(i),u=cn(o);if(a&&u){var p=o*t;l==="contain"&&p>i||l==="cover"&&p<i?o=i/t:i=o*t}else a?o=i/t:u&&(i=o*t);return{width:i,height:o}}function bl(n){var t=n.width,o=n.height,i=n.degree;if(i=Math.abs(i)%180,i===90)return{width:o,height:t};var l=i%90*Math.PI/180,a=Math.sin(l),u=Math.cos(l),p=t*u+o*a,c=t*a+o*u;return i>90?{width:c,height:p}:{width:p,height:c}}function vl(n,t,o,i){var l=t.aspectRatio,a=t.naturalWidth,u=t.naturalHeight,p=t.rotate,c=p===void 0?0:p,y=t.scaleX,m=y===void 0?1:y,b=t.scaleY,S=b===void 0?1:b,E=o.aspectRatio,_=o.naturalWidth,N=o.naturalHeight,D=i.fillColor,L=D===void 0?"transparent":D,$=i.imageSmoothingEnabled,T=$===void 0?!0:$,I=i.imageSmoothingQuality,R=I===void 0?"low":I,k=i.maxWidth,M=k===void 0?1/0:k,H=i.maxHeight,X=H===void 0?1/0:H,W=i.minWidth,te=W===void 0?0:W,se=i.minHeight,ne=se===void 0?0:se,re=document.createElement("canvas"),C=re.getContext("2d"),B=Ee({aspectRatio:E,width:M,height:X}),V=Ee({aspectRatio:E,width:te,height:ne},"cover"),Y=Math.min(B.width,Math.max(V.width,_)),O=Math.min(B.height,Math.max(V.height,N)),ce=Ee({aspectRatio:l,width:M,height:X}),ae=Ee({aspectRatio:l,width:te,height:ne},"cover"),pt=Math.min(ce.width,Math.max(ae.width,a)),gt=Math.min(ce.height,Math.max(ae.height,u)),Qt=[-pt/2,-gt/2,pt,gt];return re.width=je(Y),re.height=je(O),C.fillStyle=L,C.fillRect(0,0,Y,O),C.save(),C.translate(Y/2,O/2),C.rotate(c*Math.PI/180),C.scale(m,S),C.imageSmoothingEnabled=T,C.imageSmoothingQuality=R,C.drawImage.apply(C,[n].concat(Fr(Qt.map(function(yt){return Math.floor(je(yt))})))),C.restore(),re}var gn=String.fromCharCode;function Sl(n,t,o){var i="";o+=t;for(var l=t;l<o;l+=1)i+=gn(n.getUint8(l));return i}var wl=/^data:.*,/;function _l(n){var t=n.replace(wl,""),o=atob(t),i=new ArrayBuffer(o.length),l=new Uint8Array(i);return K(l,function(a,u){l[u]=o.charCodeAt(u)}),i}function kl(n,t){for(var o=[],i=8192,l=new Uint8Array(n);l.length>0;)o.push(gn.apply(null,dn(l.subarray(0,i)))),l=l.subarray(i);return"data:".concat(t,";base64,").concat(btoa(o.join("")))}function xl(n){var t=new DataView(n),o;try{var i,l,a;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var u=t.byteLength,p=2;p+1<u;){if(t.getUint8(p)===255&&t.getUint8(p+1)===225){l=p;break}p+=1}if(l){var c=l+4,y=l+10;if(Sl(t,c,4)==="Exif"){var m=t.getUint16(y);if(i=m===18761,(i||m===19789)&&t.getUint16(y+2,i)===42){var b=t.getUint32(y+4,i);b>=8&&(a=y+b)}}}if(a){var S=t.getUint16(a,i),E,_;for(_=0;_<S;_+=1)if(E=a+_*12+2,t.getUint16(E,i)===274){E+=8,o=t.getUint16(E,i),t.setUint16(E,1,i);break}}}catch{o=1}return o}function Dl(n){var t=0,o=1,i=1;switch(n){case 2:o=-1;break;case 3:t=-180;break;case 4:i=-1;break;case 5:t=90,i=-1;break;case 6:t=90;break;case 7:t=90,o=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:o,scaleY:i}}var El={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,o=this.options,i=this.container,l=this.cropper,a=Number(o.minContainerWidth),u=Number(o.minContainerHeight);q(l,Q),ye(t,Q);var p={width:Math.max(i.offsetWidth,a>=0?a:sn),height:Math.max(i.offsetHeight,u>=0?u:an)};this.containerData=p,De(l,{width:p.width,height:p.height}),q(t,Q),ye(l,Q)},initCanvas:function(){var t=this.containerData,o=this.imageData,i=this.options.viewMode,l=Math.abs(o.rotate)%180===90,a=l?o.naturalHeight:o.naturalWidth,u=l?o.naturalWidth:o.naturalHeight,p=a/u,c=t.width,y=t.height;t.height*p>t.width?i===3?c=t.height*p:y=t.width/p:i===3?y=t.width/p:c=t.height*p;var m={aspectRatio:p,naturalWidth:a,naturalHeight:u,width:c,height:y};this.canvasData=m,this.limited=i===1||i===2,this.limitCanvas(!0,!0),m.width=Math.min(Math.max(m.width,m.minWidth),m.maxWidth),m.height=Math.min(Math.max(m.height,m.minHeight),m.maxHeight),m.left=(t.width-m.width)/2,m.top=(t.height-m.height)/2,m.oldLeft=m.left,m.oldTop=m.top,this.initialCanvasData=U({},m)},limitCanvas:function(t,o){var i=this.options,l=this.containerData,a=this.canvasData,u=this.cropBoxData,p=i.viewMode,c=a.aspectRatio,y=this.cropped&&u;if(t){var m=Number(i.minCanvasWidth)||0,b=Number(i.minCanvasHeight)||0;p>1?(m=Math.max(m,l.width),b=Math.max(b,l.height),p===3&&(b*c>m?m=b*c:b=m/c)):p>0&&(m?m=Math.max(m,y?u.width:0):b?b=Math.max(b,y?u.height:0):y&&(m=u.width,b=u.height,b*c>m?m=b*c:b=m/c));var S=Ee({aspectRatio:c,width:m,height:b});m=S.width,b=S.height,a.minWidth=m,a.minHeight=b,a.maxWidth=1/0,a.maxHeight=1/0}if(o)if(p>(y?0:1)){var E=l.width-a.width,_=l.height-a.height;a.minLeft=Math.min(0,E),a.minTop=Math.min(0,_),a.maxLeft=Math.max(0,E),a.maxTop=Math.max(0,_),y&&this.limited&&(a.minLeft=Math.min(u.left,u.left+(u.width-a.width)),a.minTop=Math.min(u.top,u.top+(u.height-a.height)),a.maxLeft=u.left,a.maxTop=u.top,p===2&&(a.width>=l.width&&(a.minLeft=Math.min(0,E),a.maxLeft=Math.max(0,E)),a.height>=l.height&&(a.minTop=Math.min(0,_),a.maxTop=Math.max(0,_))))}else a.minLeft=-a.width,a.minTop=-a.height,a.maxLeft=l.width,a.maxTop=l.height},renderCanvas:function(t,o){var i=this.canvasData,l=this.imageData;if(o){var a=bl({width:l.naturalWidth*Math.abs(l.scaleX||1),height:l.naturalHeight*Math.abs(l.scaleY||1),degree:l.rotate||0}),u=a.width,p=a.height,c=i.width*(u/i.naturalWidth),y=i.height*(p/i.naturalHeight);i.left-=(c-i.width)/2,i.top-=(y-i.height)/2,i.width=c,i.height=y,i.aspectRatio=u/p,i.naturalWidth=u,i.naturalHeight=p,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,De(this.canvas,U({width:i.width,height:i.height},Je({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var o=this.canvasData,i=this.imageData,l=i.naturalWidth*(o.width/o.naturalWidth),a=i.naturalHeight*(o.height/o.naturalHeight);U(i,{width:l,height:a,left:(o.width-l)/2,top:(o.height-a)/2}),De(this.image,U({width:i.width,height:i.height},Je(U({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,o=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,l=Number(t.autoCropArea)||.8,a={width:o.width,height:o.height};i&&(o.height*i>o.width?a.height=a.width/i:a.width=a.height*i),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*l),a.height=Math.max(a.minHeight,a.height*l),a.left=o.left+(o.width-a.width)/2,a.top=o.top+(o.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=U({},a)},limitCropBox:function(t,o){var i=this.options,l=this.containerData,a=this.canvasData,u=this.cropBoxData,p=this.limited,c=i.aspectRatio;if(t){var y=Number(i.minCropBoxWidth)||0,m=Number(i.minCropBoxHeight)||0,b=p?Math.min(l.width,a.width,a.width+a.left,l.width-a.left):l.width,S=p?Math.min(l.height,a.height,a.height+a.top,l.height-a.top):l.height;y=Math.min(y,l.width),m=Math.min(m,l.height),c&&(y&&m?m*c>y?m=y/c:y=m*c:y?m=y/c:m&&(y=m*c),S*c>b?S=b/c:b=S*c),u.minWidth=Math.min(y,b),u.minHeight=Math.min(m,S),u.maxWidth=b,u.maxHeight=S}o&&(p?(u.minLeft=Math.max(0,a.left),u.minTop=Math.max(0,a.top),u.maxLeft=Math.min(l.width,a.left+a.width)-u.width,u.maxTop=Math.min(l.height,a.top+a.height)-u.height):(u.minLeft=0,u.minTop=0,u.maxLeft=l.width-u.width,u.maxTop=l.height-u.height))},renderCropBox:function(){var t=this.options,o=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&Ge(this.face,qe,i.width>=o.width&&i.height>=o.height?Yr:Pt),De(this.cropBox,U({width:i.width,height:i.height},Je({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ze(this.element,Ft,this.getData())}},Nl={initPreview:function(){var t=this.element,o=this.crossOrigin,i=this.options.preview,l=o?this.crossOriginUrl:this.url,a=t.alt||"The image to preview",u=document.createElement("img");if(o&&(u.crossOrigin=o),u.src=l,u.alt=a,this.viewBox.appendChild(u),this.viewBoxImage=u,!!i){var p=i;typeof i=="string"?p=t.ownerDocument.querySelectorAll(i):i.querySelector&&(p=[i]),this.previews=p,K(p,function(c){var y=document.createElement("img");Ge(c,ft,{width:c.offsetWidth,height:c.offsetHeight,html:c.innerHTML}),o&&(y.crossOrigin=o),y.src=l,y.alt=a,y.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',c.innerHTML="",c.appendChild(y)})}},resetPreview:function(){K(this.previews,function(t){var o=qt(t,ft);De(t,{width:o.width,height:o.height}),t.innerHTML=o.html,ml(t,ft)})},preview:function(){var t=this.imageData,o=this.canvasData,i=this.cropBoxData,l=i.width,a=i.height,u=t.width,p=t.height,c=i.left-o.left-t.left,y=i.top-o.top-t.top;!this.cropped||this.disabled||(De(this.viewBoxImage,U({width:u,height:p},Je(U({translateX:-c,translateY:-y},t)))),K(this.previews,function(m){var b=qt(m,ft),S=b.width,E=b.height,_=S,N=E,D=1;l&&(D=S/l,N=a*D),a&&N>E&&(D=E/a,_=l*D,N=E),De(m,{width:_,height:N}),De(m.getElementsByTagName("img")[0],U({width:u*D,height:p*D},Je(U({translateX:-c*D,translateY:-y*D},t))))}))}},Cl={bind:function(){var t=this.element,o=this.options,i=this.cropper;ee(o.cropstart)&&ie(t,Kt,o.cropstart),ee(o.cropmove)&&ie(t,Yt,o.cropmove),ee(o.cropend)&&ie(t,Ut,o.cropend),ee(o.crop)&&ie(t,Ft,o.crop),ee(o.zoom)&&ie(t,Wt,o.zoom),ie(i,Jr,this.onCropStart=this.cropStart.bind(this)),o.zoomable&&o.zoomOnWheel&&ie(i,nn,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),o.toggleDragModeOnDblclick&&ie(i,Gr,this.onDblclick=this.dblclick.bind(this)),ie(t.ownerDocument,Qr,this.onCropMove=this.cropMove.bind(this)),ie(t.ownerDocument,en,this.onCropEnd=this.cropEnd.bind(this)),o.responsive&&ie(window,rn,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,o=this.options,i=this.cropper;ee(o.cropstart)&&le(t,Kt,o.cropstart),ee(o.cropmove)&&le(t,Yt,o.cropmove),ee(o.cropend)&&le(t,Ut,o.cropend),ee(o.crop)&&le(t,Ft,o.crop),ee(o.zoom)&&le(t,Wt,o.zoom),le(i,Jr,this.onCropStart),o.zoomable&&o.zoomOnWheel&&le(i,nn,this.onWheel,{passive:!1,capture:!0}),o.toggleDragModeOnDblclick&&le(i,Gr,this.onDblclick),le(t.ownerDocument,Qr,this.onCropMove),le(t.ownerDocument,en,this.onCropEnd),o.responsive&&le(window,rn,this.onResize)}},Vl={resize:function(){if(!this.disabled){var t=this.options,o=this.container,i=this.containerData,l=o.offsetWidth/i.width,a=o.offsetHeight/i.height,u=Math.abs(l-1)>Math.abs(a-1)?l:a;if(u!==1){var p,c;t.restore&&(p=this.getCanvasData(),c=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(K(p,function(y,m){p[m]=y*u})),this.setCropBoxData(K(c,function(y,m){c[m]=y*u})))}}},dblclick:function(){this.disabled||this.options.dragMode===qr||this.setDragMode(ul(this.dragBox,zt)?Zr:Ht)},wheel:function(t){var o=this,i=Number(this.options.wheelZoomRatio)||.1,l=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){o.wheeling=!1},50),t.deltaY?l=t.deltaY>0?1:-1:t.wheelDelta?l=-t.wheelDelta/120:t.detail&&(l=t.detail>0?1:-1),this.zoom(-l*i,t)))},cropStart:function(t){var o=t.buttons,i=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(j(o)&&o!==1||j(i)&&i!==0||t.ctrlKey))){var l=this.options,a=this.pointers,u;t.changedTouches?K(t.changedTouches,function(p){a[p.identifier]=mt(p)}):a[t.pointerId||0]=mt(t),Object.keys(a).length>1&&l.zoomable&&l.zoomOnTouch?u=Kr:u=qt(t.target,qe),rl.test(u)&&ze(this.element,Kt,{originalEvent:t,action:u})!==!1&&(t.preventDefault(),this.action=u,this.cropping=!1,u===Ur&&(this.cropping=!0,q(this.dragBox,ut)))}},cropMove:function(t){var o=this.action;if(!(this.disabled||!o)){var i=this.pointers;t.preventDefault(),ze(this.element,Yt,{originalEvent:t,action:o})!==!1&&(t.changedTouches?K(t.changedTouches,function(l){U(i[l.identifier]||{},mt(l,!0))}):U(i[t.pointerId||0]||{},mt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var o=this.action,i=this.pointers;t.changedTouches?K(t.changedTouches,function(l){delete i[l.identifier]}):delete i[t.pointerId||0],o&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,Pe(this.dragBox,ut,this.cropped&&this.options.modal)),ze(this.element,Ut,{originalEvent:t,action:o}))}}},Ml={change:function(t){var o=this.options,i=this.canvasData,l=this.containerData,a=this.cropBoxData,u=this.pointers,p=this.action,c=o.aspectRatio,y=a.left,m=a.top,b=a.width,S=a.height,E=y+b,_=m+S,N=0,D=0,L=l.width,$=l.height,T=!0,I;!c&&t.shiftKey&&(c=b&&S?b/S:1),this.limited&&(N=a.minLeft,D=a.minTop,L=N+Math.min(l.width,i.width,i.left+i.width),$=D+Math.min(l.height,i.height,i.top+i.height));var R=u[Object.keys(u)[0]],k={x:R.endX-R.startX,y:R.endY-R.startY},M=function(X){switch(X){case Te:E+k.x>L&&(k.x=L-E);break;case Be:y+k.x<N&&(k.x=N-y);break;case xe:m+k.y<D&&(k.y=D-m);break;case Le:_+k.y>$&&(k.y=$-_);break}};switch(p){case Pt:y+=k.x,m+=k.y;break;case Te:if(k.x>=0&&(E>=L||c&&(m<=D||_>=$))){T=!1;break}M(Te),b+=k.x,b<0&&(p=Be,b=-b,y-=b),c&&(S=b/c,m+=(a.height-S)/2);break;case xe:if(k.y<=0&&(m<=D||c&&(y<=N||E>=L))){T=!1;break}M(xe),S-=k.y,m+=k.y,S<0&&(p=Le,S=-S,m-=S),c&&(b=S*c,y+=(a.width-b)/2);break;case Be:if(k.x<=0&&(y<=N||c&&(m<=D||_>=$))){T=!1;break}M(Be),b-=k.x,y+=k.x,b<0&&(p=Te,b=-b,y-=b),c&&(S=b/c,m+=(a.height-S)/2);break;case Le:if(k.y>=0&&(_>=$||c&&(y<=N||E>=L))){T=!1;break}M(Le),S+=k.y,S<0&&(p=xe,S=-S,m-=S),c&&(b=S*c,y+=(a.width-b)/2);break;case Ke:if(c){if(k.y<=0&&(m<=D||E>=L)){T=!1;break}M(xe),S-=k.y,m+=k.y,b=S*c}else M(xe),M(Te),k.x>=0?E<L?b+=k.x:k.y<=0&&m<=D&&(T=!1):b+=k.x,k.y<=0?m>D&&(S-=k.y,m+=k.y):(S-=k.y,m+=k.y);b<0&&S<0?(p=Ze,S=-S,b=-b,m-=S,y-=b):b<0?(p=We,b=-b,y-=b):S<0&&(p=Xe,S=-S,m-=S);break;case We:if(c){if(k.y<=0&&(m<=D||y<=N)){T=!1;break}M(xe),S-=k.y,m+=k.y,b=S*c,y+=a.width-b}else M(xe),M(Be),k.x<=0?y>N?(b-=k.x,y+=k.x):k.y<=0&&m<=D&&(T=!1):(b-=k.x,y+=k.x),k.y<=0?m>D&&(S-=k.y,m+=k.y):(S-=k.y,m+=k.y);b<0&&S<0?(p=Xe,S=-S,b=-b,m-=S,y-=b):b<0?(p=Ke,b=-b,y-=b):S<0&&(p=Ze,S=-S,m-=S);break;case Ze:if(c){if(k.x<=0&&(y<=N||_>=$)){T=!1;break}M(Be),b-=k.x,y+=k.x,S=b/c}else M(Le),M(Be),k.x<=0?y>N?(b-=k.x,y+=k.x):k.y>=0&&_>=$&&(T=!1):(b-=k.x,y+=k.x),k.y>=0?_<$&&(S+=k.y):S+=k.y;b<0&&S<0?(p=Ke,S=-S,b=-b,m-=S,y-=b):b<0?(p=Xe,b=-b,y-=b):S<0&&(p=We,S=-S,m-=S);break;case Xe:if(c){if(k.x>=0&&(E>=L||_>=$)){T=!1;break}M(Te),b+=k.x,S=b/c}else M(Le),M(Te),k.x>=0?E<L?b+=k.x:k.y>=0&&_>=$&&(T=!1):b+=k.x,k.y>=0?_<$&&(S+=k.y):S+=k.y;b<0&&S<0?(p=We,S=-S,b=-b,m-=S,y-=b):b<0?(p=Ze,b=-b,y-=b):S<0&&(p=Ke,S=-S,m-=S);break;case Yr:this.move(k.x,k.y),T=!1;break;case Kr:this.zoom(gl(u),t),T=!1;break;case Ur:if(!k.x||!k.y){T=!1;break}I=fn(this.cropper),y=R.startX-I.left,m=R.startY-I.top,b=a.minWidth,S=a.minHeight,k.x>0?p=k.y>0?Xe:Ke:k.x<0&&(y-=b,p=k.y>0?Ze:We),k.y<0&&(m-=S),this.cropped||(ye(this.cropBox,Q),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(a.width=b,a.height=S,a.left=y,a.top=m,this.action=p,this.renderCropBox()),K(u,function(H){H.startX=H.endX,H.startY=H.endY})}},Tl={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&q(this.dragBox,ut),ye(this.cropBox,Q),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=U({},this.initialImageData),this.canvasData=U({},this.initialCanvasData),this.cropBoxData=U({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(U(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ye(this.dragBox,ut),q(this.cropBox,Q)),this},replace:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),o?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,K(this.previews,function(i){i.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,ye(this.cropper,Wr)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,q(this.cropper,Wr)),this},destroy:function(){var t=this.element;return t[F]?(t[F]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,l=i.left,a=i.top;return this.moveTo(Xt(t)?t:l+Number(t),Xt(o)?o:a+Number(o))},moveTo:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.canvasData,l=!1;return t=Number(t),o=Number(o),this.ready&&!this.disabled&&this.options.movable&&(j(t)&&(i.left=t,l=!0),j(o)&&(i.top=o,l=!0),l&&this.renderCanvas(!0)),this},zoom:function(t,o){var i=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(i.width*t/i.naturalWidth,null,o)},zoomTo:function(t,o,i){var l=this.options,a=this.canvasData,u=a.width,p=a.height,c=a.naturalWidth,y=a.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&l.zoomable){var m=c*t,b=y*t;if(ze(this.element,Wt,{ratio:t,oldRatio:u/c,originalEvent:i})===!1)return this;if(i){var S=this.pointers,E=fn(this.cropper),_=S&&Object.keys(S).length?yl(S):{pageX:i.pageX,pageY:i.pageY};a.left-=(m-u)*((_.pageX-E.left-a.left)/u),a.top-=(b-p)*((_.pageY-E.top-a.top)/p)}else Oe(o)&&j(o.x)&&j(o.y)?(a.left-=(m-u)*((o.x-a.left)/u),a.top-=(b-p)*((o.y-a.top)/p)):(a.left-=(m-u)/2,a.top-=(b-p)/2);a.width=m,a.height=b,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),j(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var o=this.imageData.scaleY;return this.scale(t,j(o)?o:1)},scaleY:function(t){var o=this.imageData.scaleX;return this.scale(j(o)?o:1,t)},scale:function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,i=this.imageData,l=!1;return t=Number(t),o=Number(o),this.ready&&!this.disabled&&this.options.scalable&&(j(t)&&(i.scaleX=t,l=!0),j(o)&&(i.scaleY=o,l=!0),l&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=this.options,i=this.imageData,l=this.canvasData,a=this.cropBoxData,u;if(this.ready&&this.cropped){u={x:a.left-l.left,y:a.top-l.top,width:a.width,height:a.height};var p=i.width/i.naturalWidth;if(K(u,function(m,b){u[b]=m/p}),t){var c=Math.round(u.y+u.height),y=Math.round(u.x+u.width);u.x=Math.round(u.x),u.y=Math.round(u.y),u.width=y-u.x,u.height=c-u.y}}else u={x:0,y:0,width:0,height:0};return o.rotatable&&(u.rotate=i.rotate||0),o.scalable&&(u.scaleX=i.scaleX||1,u.scaleY=i.scaleY||1),u},setData:function(t){var o=this.options,i=this.imageData,l=this.canvasData,a={};if(this.ready&&!this.disabled&&Oe(t)){var u=!1;o.rotatable&&j(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,u=!0),o.scalable&&(j(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,u=!0),j(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,u=!0)),u&&this.renderCanvas(!0,!0);var p=i.width/i.naturalWidth;j(t.x)&&(a.left=t.x*p+l.left),j(t.y)&&(a.top=t.y*p+l.top),j(t.width)&&(a.width=t.width*p),j(t.height)&&(a.height=t.height*p),this.setCropBoxData(a)}return this},getContainerData:function(){return this.ready?U({},this.containerData):{}},getImageData:function(){return this.sized?U({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,o={};return this.ready&&K(["left","top","width","height","naturalWidth","naturalHeight"],function(i){o[i]=t[i]}),o},setCanvasData:function(t){var o=this.canvasData,i=o.aspectRatio;return this.ready&&!this.disabled&&Oe(t)&&(j(t.left)&&(o.left=t.left),j(t.top)&&(o.top=t.top),j(t.width)?(o.width=t.width,o.height=t.width/i):j(t.height)&&(o.height=t.height,o.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,o;return this.ready&&this.cropped&&(o={left:t.left,top:t.top,width:t.width,height:t.height}),o||{}},setCropBoxData:function(t){var o=this.cropBoxData,i=this.options.aspectRatio,l,a;return this.ready&&this.cropped&&!this.disabled&&Oe(t)&&(j(t.left)&&(o.left=t.left),j(t.top)&&(o.top=t.top),j(t.width)&&t.width!==o.width&&(l=!0,o.width=t.width),j(t.height)&&t.height!==o.height&&(a=!0,o.height=t.height),i&&(l?o.height=o.width/i:a&&(o.width=o.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var o=this.canvasData,i=vl(this.image,this.imageData,o,t);if(!this.cropped)return i;var l=this.getData(),a=l.x,u=l.y,p=l.width,c=l.height,y=i.width/Math.floor(o.naturalWidth);y!==1&&(a*=y,u*=y,p*=y,c*=y);var m=p/c,b=Ee({aspectRatio:m,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),S=Ee({aspectRatio:m,width:t.minWidth||0,height:t.minHeight||0},"cover"),E=Ee({aspectRatio:m,width:t.width||(y!==1?i.width:p),height:t.height||(y!==1?i.height:c)}),_=E.width,N=E.height;_=Math.min(b.width,Math.max(S.width,_)),N=Math.min(b.height,Math.max(S.height,N));var D=document.createElement("canvas"),L=D.getContext("2d");D.width=je(_),D.height=je(N),L.fillStyle=t.fillColor||"transparent",L.fillRect(0,0,_,N);var $=t.imageSmoothingEnabled,T=$===void 0?!0:$,I=t.imageSmoothingQuality;L.imageSmoothingEnabled=T,I&&(L.imageSmoothingQuality=I);var R=i.width,k=i.height,M=a,H=u,X,W,te,se,ne,re;M<=-p||M>R?(M=0,X=0,te=0,ne=0):M<=0?(te=-M,M=0,X=Math.min(R,p+M),ne=X):M<=R&&(te=0,X=Math.min(p,R-M),ne=X),X<=0||H<=-c||H>k?(H=0,W=0,se=0,re=0):H<=0?(se=-H,H=0,W=Math.min(k,c+H),re=W):H<=k&&(se=0,W=Math.min(c,k-H),re=W);var C=[M,H,X,W];if(ne>0&&re>0){var B=_/p;C.push(te*B,se*B,ne*B,re*B)}return L.drawImage.apply(L,[i].concat(Fr(C.map(function(V){return Math.floor(je(V))})))),D},setAspectRatio:function(t){var o=this.options;return!this.disabled&&!Xt(t)&&(o.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var o=this.options,i=this.dragBox,l=this.face;if(this.ready&&!this.disabled){var a=t===Ht,u=o.movable&&t===Zr;t=a||u?t:qr,o.dragMode=t,Ge(i,qe,t),Pe(i,zt,a),Pe(i,Rt,u),o.cropBoxMovable||(Ge(l,qe,t),Pe(l,zt,a),Pe(l,Rt,u))}return this}},Bl=ge.Cropper,yn=function(){function n(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ya(this,n),!t||!il.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=U({},ln,Oe(o)&&o),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Ka(n,[{key:"init",value:function(){var o=this.element,i=o.tagName.toLowerCase(),l;if(!o[F]){if(o[F]=this,i==="img"){if(this.isImg=!0,l=o.getAttribute("src")||"",this.originalUrl=l,!l)return;l=o.src}else i==="canvas"&&window.HTMLCanvasElement&&(l=o.toDataURL());this.load(l)}}},{key:"load",value:function(o){var i=this;if(o){this.url=o,this.imageData={};var l=this.element,a=this.options;if(!a.rotatable&&!a.scalable&&(a.checkOrientation=!1),!a.checkOrientation||!window.ArrayBuffer){this.clone();return}if(nl.test(o)){ol.test(o)?this.read(_l(o)):this.clone();return}var u=new XMLHttpRequest,p=this.clone.bind(this);this.reloading=!0,this.xhr=u,u.onabort=p,u.onerror=p,u.ontimeout=p,u.onprogress=function(){u.getResponseHeader("content-type")!==on&&u.abort()},u.onload=function(){i.read(u.response)},u.onloadend=function(){i.reloading=!1,i.xhr=null},a.checkCrossOrigin&&mn(o)&&l.crossOrigin&&(o=pn(o)),u.open("GET",o,!0),u.responseType="arraybuffer",u.withCredentials=l.crossOrigin==="use-credentials",u.send()}}},{key:"read",value:function(o){var i=this.options,l=this.imageData,a=xl(o),u=0,p=1,c=1;if(a>1){this.url=kl(o,on);var y=Dl(a);u=y.rotate,p=y.scaleX,c=y.scaleY}i.rotatable&&(l.rotate=u),i.scalable&&(l.scaleX=p,l.scaleY=c),this.clone()}},{key:"clone",value:function(){var o=this.element,i=this.url,l=o.crossOrigin,a=i;this.options.checkCrossOrigin&&mn(i)&&(l||(l="anonymous"),a=pn(i)),this.crossOrigin=l,this.crossOriginUrl=a;var u=document.createElement("img");l&&(u.crossOrigin=l),u.src=a||i,u.alt=o.alt||"The image to crop",this.image=u,u.onload=this.start.bind(this),u.onerror=this.stop.bind(this),q(u,Xr),o.parentNode.insertBefore(u,o.nextSibling)}},{key:"start",value:function(){var o=this,i=this.image;i.onload=null,i.onerror=null,this.sizing=!0;var l=ge.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ge.navigator.userAgent),a=function(y,m){U(o.imageData,{naturalWidth:y,naturalHeight:m,aspectRatio:y/m}),o.initialImageData=U({},o.imageData),o.sizing=!1,o.sized=!0,o.build()};if(i.naturalWidth&&!l){a(i.naturalWidth,i.naturalHeight);return}var u=document.createElement("img"),p=document.body||document.documentElement;this.sizingImage=u,u.onload=function(){a(u.width,u.height),l||p.removeChild(u)},u.src=i.src,l||(u.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",p.appendChild(u))}},{key:"stop",value:function(){var o=this.image;o.onload=null,o.onerror=null,o.parentNode.removeChild(o),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var o=this.element,i=this.options,l=this.image,a=o.parentNode,u=document.createElement("div");u.innerHTML=sl;var p=u.querySelector(".".concat(F,"-container")),c=p.querySelector(".".concat(F,"-canvas")),y=p.querySelector(".".concat(F,"-drag-box")),m=p.querySelector(".".concat(F,"-crop-box")),b=m.querySelector(".".concat(F,"-face"));this.container=a,this.cropper=p,this.canvas=c,this.dragBox=y,this.cropBox=m,this.viewBox=p.querySelector(".".concat(F,"-view-box")),this.face=b,c.appendChild(l),q(o,Q),a.insertBefore(p,o.nextSibling),ye(l,Xr),this.initPreview(),this.bind(),i.initialAspectRatio=Math.max(0,i.initialAspectRatio)||NaN,i.aspectRatio=Math.max(0,i.aspectRatio)||NaN,i.viewMode=Math.max(0,Math.min(3,Math.round(i.viewMode)))||0,q(m,Q),i.guides||q(m.getElementsByClassName("".concat(F,"-dashed")),Q),i.center||q(m.getElementsByClassName("".concat(F,"-center")),Q),i.background&&q(p,"".concat(F,"-bg")),i.highlight||q(b,Ja),i.cropBoxMovable&&(q(b,Rt),Ge(b,qe,Pt)),i.cropBoxResizable||(q(m.getElementsByClassName("".concat(F,"-line")),Q),q(m.getElementsByClassName("".concat(F,"-point")),Q)),this.render(),this.ready=!0,this.setDragMode(i.dragMode),i.autoCrop&&this.crop(),this.setData(i.data),ee(i.ready)&&ie(o,tn,i.ready,{once:!0}),ze(o,tn)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var o=this.cropper.parentNode;o&&o.removeChild(this.cropper),ye(this.element,Q)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Bl,n}},{key:"setDefaults",value:function(o){U(ln,Oe(o)&&o)}}]),n}();U(yn.prototype,El,Nl,Cl,Vl,Ml,Tl);const $l={class:"flex"},Al=["aria-label"],Il={class:"ml-auto mb-2"},Ll={class:"w-full flex justify-center"},Ol=["src"],jl={__name:"Image",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{t:i}=e.inject("i18n"),{apiUrl:l}=ue(),a=e.ref(null),u=e.ref(null),p=e.ref(!1),c=e.ref(""),y=e.ref(!1),m=()=>{p.value=!p.value,p.value?u.value=new yn(a.value,{crop(E){}}):u.value.destroy()},b=e.inject("postData"),S=()=>{u.value.getCroppedCanvas({width:795,height:341}).toBlob(E=>{c.value="",y.value=!1,ot(l.value,{method:"POST",params:Object.assign(b,{q:"upload",adapter:o.selection.adapter,path:o.selection.item.path,file:E}),name:o.selection.item.basename,json:!1}).then(_=>{c.value=i("Updated."),a.value.src=_t(o.selection.adapter,o.selection.item.path),m(),t("load")}).catch(_=>{c.value=i(_.message),y.value=!0})})};return e.onMounted(()=>{t("load")}),(E,_)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",$l,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Al),e.createElementVNode("div",Il,[p.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:S,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(i)("Crop")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:_[0]||(_[0]=N=>m())},e.toDisplayString(p.value?e.unref(i)("Cancel"):e.unref(i)("Edit")),1)])]),e.createElementVNode("div",Ll,[e.createElementVNode("img",{ref_key:"image",ref:a,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(_t)(o.selection.adapter,o.selection.item.path),alt:""},null,8,Ol)]),c.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:_[1]||(_[1]=N=>c.value=""),error:y.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},Pl={class:"flex"},zl=["aria-label"],Rl=e.createElementVNode("div",null,null,-1),Hl={__name:"Default",props:{selection:Object},emits:["load"],setup(n,{emit:t}){return e.onMounted(()=>{t("load")}),(o,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pl,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,zl)]),Rl],64))}},Fl=["aria-label"],Ul={class:"w-full",preload:"",controls:""},Yl=["src"],Kl={__name:"Video",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{apiUrl:i}=ue(),l=()=>i.value+"?"+Ce({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(a,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Fl),e.createElementVNode("div",null,[e.createElementVNode("video",Ul,[e.createElementVNode("source",{src:l(),type:"video/mp4"},null,8,Yl),e.createTextVNode(" Your browser does not support the video tag. ")])])],64))}},Wl=["aria-label"],Xl={class:"w-full",controls:""},Zl=["src"],ql={__name:"Audio",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{apiUrl:i}=ue(),l=()=>i.value+"?"+Ce({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(a,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Wl),e.createElementVNode("div",null,[e.createElementVNode("audio",Xl,[e.createElementVNode("source",{src:l(),type:"audio/mpeg"},null,8,Zl),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},Gl=["aria-label"],Jl=["data"],Ql=["src"],ec={__name:"Pdf",props:{selection:Object},emits:["load"],setup(n,{emit:t}){const o=n,{apiUrl:i}=ue(),l=()=>i.value+"?"+Ce({q:"preview",adapter:o.selection.adapter,path:o.selection.item.path});return e.onMounted(()=>{t("load")}),(a,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":n.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(n.selection.item.basename),9,Gl),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:l(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:l(),width:"100%",height:"100%"},`
|
|
14
14
|
<p>
|
|
15
15
|
Your browser does not support PDFs.
|
|
16
16
|
<a href="https://example.com/test.pdf">Download the PDF</a>
|
|
17
17
|
.
|
|
18
18
|
</p>
|
|
19
|
-
`,8,Ql)],8,Jl)])],64))}},tc={class:"sm:flex sm:items-start"},rc={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},nc={class:"text-gray-700 dark:text-gray-200 text-sm"},oc={key:0,class:"flex leading-5"},ic=e.createElementVNode("svg",{class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),sc={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},ac={class:"font-bold pl-2"},lc={class:"font-bold pl-2"},cc=Object.assign({name:"VFModalPreview"},{props:{selection:Object},setup(n){const t=n,{apiUrl:o}=ue(),i=e.inject("emitter"),{t:a}=e.inject("i18n"),l=e.ref(!1),u=y=>l.value=y,g=y=>(t.selection.item.mime_type??"").startsWith(y),c=()=>{const y=o.value+"?"+Ce({q:"download",adapter:t.selection.adapter,path:t.selection.item.path});i.emit("vf-download",y)};return(y,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m[6]||(m[6]=b=>e.unref(i).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-gray-400 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Close")),1),e.createElementVNode("button",{type:"button",onClick:m[7]||(m[7]=b=>c()),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-gray-400 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Download")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",tc,[e.createElementVNode("div",rc,[e.createElementVNode("div",null,[g("text")?(e.openBlock(),e.createBlock(Ua,{key:0,selection:n.selection,onLoad:m[0]||(m[0]=b=>u(!0))},null,8,["selection"])):g("image")?(e.openBlock(),e.createBlock(jl,{key:1,selection:n.selection,onLoad:m[1]||(m[1]=b=>u(!0))},null,8,["selection"])):g("video")?(e.openBlock(),e.createBlock(Kl,{key:2,selection:n.selection,onLoad:m[2]||(m[2]=b=>u(!0))},null,8,["selection"])):g("audio")?(e.openBlock(),e.createBlock(ql,{key:3,selection:n.selection,onLoad:m[3]||(m[3]=b=>u(!0))},null,8,["selection"])):g("application/pdf")?(e.openBlock(),e.createBlock(ec,{key:4,selection:n.selection,onLoad:m[4]||(m[4]=b=>u(!0))},null,8,["selection"])):(e.openBlock(),e.createBlock(Hl,{key:5,selection:n.selection,onLoad:m[5]||(m[5]=b=>u(!0))},null,8,["selection"]))]),e.createElementVNode("div",nc,[l.value==!1?(e.openBlock(),e.createElementBlock("div",oc,[ic,e.createElementVNode("span",null,e.toDisplayString(e.unref(a)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",sc,[e.createElementVNode("div",null,[e.createElementVNode("span",ac,e.toDisplayString(e.unref(a)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(ir)(n.selection.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",lc,e.toDisplayString(e.unref(a)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(sr)(n.selection.item.last_modified)),1)])])]),_:1}))}}),dc={class:"sm:flex sm:items-start"},hc=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})])],-1),uc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},fc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},mc={class:"mt-2"},pc={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},gc={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},yc=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],bc={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},vc=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Sc={class:"ml-1.5"},wc=["onKeyup"],_c=Object.assign({name:"VFModalRename"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:a}=e.inject("i18n"),l=e.ref(t.selection.items[0]),u=e.ref(t.selection.items[0].basename),g=e.ref(""),c=()=>{u.value!=""&&o.emit("vf-fetch",{params:{q:"rename",adapter:i.value,path:t.current.dirname,item:l.value.path,name:u.value},onSuccess:()=>{o.emit("vf-toast-push",{label:a("%s is renamed.",u.value)})},onError:y=>{g.value=a(y.message)}})};return(y,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:m[2]||(m[2]=b=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",dc,[hc,e.createElementVNode("div",uc,[e.createElementVNode("h3",fc,e.toDisplayString(e.unref(a)("Rename")),1),e.createElementVNode("div",mc,[e.createElementVNode("p",pc,[l.value.type=="dir"?(e.openBlock(),e.createElementBlock("svg",gc,yc)):(e.openBlock(),e.createElementBlock("svg",bc,vc)),e.createElementVNode("span",Sc,e.toDisplayString(l.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>u.value=b),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,40,wc),[[e.vModelText,u.value]]),g.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[1]||(m[1]=b=>g.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),kc={class:"sm:flex sm:items-start"},xc=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})])],-1),Dc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ec={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Nc={class:"mt-2"},Cc={class:"text-gray-500 mb-1"},Vc=["id"],Mc={key:0,class:"py-2"},Tc=["disabled","onClick"],Bc=Object.assign({name:"VFModalUpload"},{props:{current:Object},setup(n){const t=n,o=e.inject("emitter"),{apiUrl:i}=ue(),{t:a}=e.inject("i18n"),l=e.inject("maxFileSize"),u=e.ref(null),g=e.ref(null),c=e.ref(null),y=e.ref([]),m=e.ref(""),b=e.ref(!0),S=()=>{m.value="",u.value.start()},x=e.inject("postData");return e.onMounted(()=>{u.value=new ve.Uploader({runtimes:"html5",browse_button:c.value,container:g.value,max_file_size:l,multiple_queues:!0,file_data_name:"file",url:i.value+"?"+Ce(Object.assign(x,{q:"upload",adapter:t.current.adapter,path:t.current.dirname})),headers:{...nt&&{"X-CSRF-Token":nt}},init:{PostInit:function(){},FilesAdded:function(D,N){b.value=!1,ve.each(N,function(E){y.value.push({id:E.id,name:E.name,size:ve.formatSize(E.size),percent:""})})},UploadProgress:function(D,N){y.value[y.value.findIndex(E=>E.id==N.id)].percent=N.percent+"%"},UploadComplete:function(){b.value=!0,o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})},Error:function(D,N){u.value.stop(),N.code==ve.HTTP_ERROR?m.value=a(JSON.parse(N.response).message):N.code==ve.FILE_SIZE_ERROR?m.value=a("The selected file exceeds the maximum file size. You cannot upload files greater than %s",[l]):m.value=a(N.message)}}}),u.value.init()}),(D,N)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{disabled:b.value,onClick:e.withModifiers(S,["prevent"]),type:"button",class:e.normalizeClass([b.value?"bg-blue-200 hover:bg-blue-200 dark:bg-gray-700/50 dark:hover:bg-gray-700/50 dark:text-gray-500":"bg-blue-600 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-500","w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"])},e.toDisplayString(e.unref(a)("Upload")),11,Tc),e.createElementVNode("button",{type:"button",onClick:N[1]||(N[1]=E=>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(a)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",kc,[xc,e.createElementVNode("div",Dc,[e.createElementVNode("h3",Ec,e.toDisplayString(e.unref(a)("Upload files")),1),e.createElementVNode("div",Nc,[e.createElementVNode("div",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,E=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{id:E.id},[e.createTextVNode(e.toDisplayString(E.name)+" ( "+e.toDisplayString(E.size)+") ",1),e.createElementVNode("b",null,e.toDisplayString(E.percent),1)],8,Vc)]))),256)),y.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Mc,e.toDisplayString(e.unref(a)("No files selected!")),1))]),e.createElementVNode("div",{class:"text-gray-500",ref_key:"container",ref:g},[e.createElementVNode("button",{ref_key:"pickFiles",ref:c,type:"button",class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Select Files")),513)],512),m.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:N[0]||(N[0]=E=>m.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),$c={class:"sm:flex sm:items-start"},Ac=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),Ic={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Lc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Oc={class:"mt-2"},jc={class:"flex text-sm text-gray-800 dark:text-gray-400"},Pc={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},zc=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],Rc={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Hc=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Fc={class:"ml-1.5"},Uc=["onKeyup","placeholder"],Yc=Object.assign({name:"VFModalArchive"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:a}=e.inject("i18n"),l=e.ref(""),u=e.ref(""),g=e.ref(t.selection.items),c=()=>{g.value.length&&o.emit("vf-fetch",{params:{q:"archive",adapter:i.value,path:t.current.dirname,items:JSON.stringify(g.value.map(({path:y,type:m})=>({path:y,type:m}))),name:l.value},onSuccess:()=>{o.emit("vf-toast-push",{label:a("The file(s) archived.")})},onError:y=>{u.value=a(y.message)}})};return(y,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:m[2]||(m[2]=b=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$c,[Ac,e.createElementVNode("div",Ic,[e.createElementVNode("h3",Lc,e.toDisplayString(e.unref(a)("Archive the files")),1),e.createElementVNode("div",Oc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,b=>(e.openBlock(),e.createElementBlock("p",jc,[b.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Pc,zc)):(e.openBlock(),e.createElementBlock("svg",Rc,Hc)),e.createElementVNode("span",Fc,e.toDisplayString(b.basename),1)]))),256)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>l.value=b),onKeyup:e.withKeys(c,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(a)("Archive name. (.zip file will be created)"),type:"text"},null,40,Uc),[[e.vModelText,l.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[1]||(m[1]=b=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Kc={class:"sm:flex sm:items-start"},Wc=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),Xc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Zc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},qc={class:"mt-2"},Gc={class:"flex text-sm text-gray-800 dark:text-gray-400"},Jc={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Qc=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],ed={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},td=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],rd={class:"ml-1.5"},nd={class:"my-1 text-sm text-gray-500"},od=Object.assign({name:"VFModalUnarchive"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:a}=e.inject("i18n");e.ref("");const l=e.ref(t.selection.items[0]),u=e.ref(""),g=e.ref([]),c=()=>{o.emit("vf-fetch",{params:{q:"unarchive",adapter:i.value,path:t.current.dirname,item:l.value.path},onSuccess:()=>{o.emit("vf-toast-push",{label:a("The file unarchived.")})},onError:y=>{u.value=a(y.message)}})};return(y,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:m[1]||(m[1]=b=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Kc,[Wc,e.createElementVNode("div",Xc,[e.createElementVNode("h3",Zc,e.toDisplayString(e.unref(a)("Unarchive")),1),e.createElementVNode("div",qc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,b=>(e.openBlock(),e.createElementBlock("p",Gc,[b.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Jc,Qc)):(e.openBlock(),e.createElementBlock("svg",ed,td)),e.createElementVNode("span",rd,e.toDisplayString(b.basename),1)]))),256)),e.createElementVNode("p",nd,e.toDisplayString(e.unref(a)("The archive will be unarchived at"))+" ("+e.toDisplayString(n.current.dirname)+")",1),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[0]||(m[0]=b=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),id={class:"sm:flex sm:items-start"},sd=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1),ad={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ld={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},cd={class:"mt-2"},dd={class:"flex text-sm text-gray-800 dark:text-gray-400"},hd={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ud=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],fd={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},md=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],pd={class:"ml-1.5"},gd={class:"text-sm text-gray-500 pb-1 pt-3"},yd={class:"flex text-sm text-gray-800 dark:text-gray-400"},bd=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),vd={class:"ml-1.5 overflow-auto"},Jt={VueFinder:Xs,...Object.freeze(Object.defineProperty({__proto__:null,ModalArchive:Yc,ModalDelete:pa,ModalMessage:_a,ModalMove:Object.assign({name:"VFModalMove"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter"),{t:i}=e.inject("i18n");e.inject("storage");const a=e.inject("adapter"),l=e.ref(t.selection.items.from),u=e.ref(""),g=()=>{l.value.length&&o.emit("vf-fetch",{params:{q:"move",adapter:a.value,path:t.current.dirname,items:JSON.stringify(l.value.map(({path:c,type:y})=>({path:c,type:y}))),item:t.selection.items.to.path},onSuccess:()=>{o.emit("vf-toast-push",{label:i("Files moved.",t.selection.items.to.name)})},onError:c=>{u.value=i(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:g,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(i)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:y[1]||(y[1]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(i)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",id,[sd,e.createElementVNode("div",ad,[e.createElementVNode("h3",ld,e.toDisplayString(e.unref(i)("Move files")),1),e.createElementVNode("div",cd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,m=>(e.openBlock(),e.createElementBlock("p",dd,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",hd,ud)):(e.openBlock(),e.createElementBlock("svg",fd,md)),e.createElementVNode("span",pd,e.toDisplayString(m.path),1)]))),256)),e.createElementVNode("p",gd,e.toDisplayString(e.unref(i)("Are you sure you want to move these files?")),1),e.createElementVNode("p",yd,[bd,e.createElementVNode("span",vd,e.toDisplayString(n.selection.items.to.path),1)]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[0]||(y[0]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ModalNewFile:ja,ModalNewFolder:Ma,ModalPreview:cc,ModalRename:_c,ModalUnarchive:od,ModalUpload:Bc},Symbol.toStringTag,{value:"Module"}))},fu="",mu="",Sd={install(n){for(const t in Jt)if(Jt.hasOwnProperty(t)){const o=Jt[t];n.component(o.name,o)}}},wd=Object.freeze(Object.defineProperty({__proto__:null,default:`{
|
|
19
|
+
`,8,Ql)],8,Jl)])],64))}},tc={class:"sm:flex sm:items-start"},rc={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},nc={class:"text-gray-700 dark:text-gray-200 text-sm"},oc={key:0,class:"flex leading-5"},ic=e.createElementVNode("svg",{class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),sc={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},ac={class:"font-bold pl-2"},lc={class:"font-bold pl-2"},cc=Object.assign({name:"VFModalPreview"},{props:{selection:Object},setup(n){const t=n,{apiUrl:o}=ue(),i=e.inject("emitter"),{t:l}=e.inject("i18n"),a=e.ref(!1),u=y=>a.value=y,p=y=>(t.selection.item.mime_type??"").startsWith(y),c=()=>{const y=o.value+"?"+Ce({q:"download",adapter:t.selection.adapter,path:t.selection.item.path});i.emit("vf-download",y)};return(y,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m[6]||(m[6]=b=>e.unref(i).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-gray-400 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Close")),1),e.createElementVNode("button",{type:"button",onClick:m[7]||(m[7]=b=>c()),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-gray-400 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Download")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",tc,[e.createElementVNode("div",rc,[e.createElementVNode("div",null,[p("text")?(e.openBlock(),e.createBlock(Ua,{key:0,selection:n.selection,onLoad:m[0]||(m[0]=b=>u(!0))},null,8,["selection"])):p("image")?(e.openBlock(),e.createBlock(jl,{key:1,selection:n.selection,onLoad:m[1]||(m[1]=b=>u(!0))},null,8,["selection"])):p("video")?(e.openBlock(),e.createBlock(Kl,{key:2,selection:n.selection,onLoad:m[2]||(m[2]=b=>u(!0))},null,8,["selection"])):p("audio")?(e.openBlock(),e.createBlock(ql,{key:3,selection:n.selection,onLoad:m[3]||(m[3]=b=>u(!0))},null,8,["selection"])):p("application/pdf")?(e.openBlock(),e.createBlock(ec,{key:4,selection:n.selection,onLoad:m[4]||(m[4]=b=>u(!0))},null,8,["selection"])):(e.openBlock(),e.createBlock(Hl,{key:5,selection:n.selection,onLoad:m[5]||(m[5]=b=>u(!0))},null,8,["selection"]))]),e.createElementVNode("div",nc,[a.value==!1?(e.openBlock(),e.createElementBlock("div",oc,[ic,e.createElementVNode("span",null,e.toDisplayString(e.unref(l)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",sc,[e.createElementVNode("div",null,[e.createElementVNode("span",ac,e.toDisplayString(e.unref(l)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(ir)(n.selection.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",lc,e.toDisplayString(e.unref(l)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(sr)(n.selection.item.last_modified)),1)])])]),_:1}))}}),dc={class:"sm:flex sm:items-start"},hc=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})])],-1),uc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},fc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},mc={class:"mt-2"},pc={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},gc={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},yc=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],bc={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},vc=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Sc={class:"ml-1.5"},wc=["onKeyup"],_c=Object.assign({name:"VFModalRename"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(t.selection.items[0]),u=e.ref(t.selection.items[0].basename),p=e.ref(""),c=()=>{u.value!=""&&o.emit("vf-fetch",{params:{q:"rename",adapter:i.value,path:t.current.dirname,item:a.value.path,name:u.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("%s is renamed.",u.value)})},onError:y=>{p.value=l(y.message)}})};return(y,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:m[2]||(m[2]=b=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",dc,[hc,e.createElementVNode("div",uc,[e.createElementVNode("h3",fc,e.toDisplayString(e.unref(l)("Rename")),1),e.createElementVNode("div",mc,[e.createElementVNode("p",pc,[a.value.type=="dir"?(e.openBlock(),e.createElementBlock("svg",gc,yc)):(e.openBlock(),e.createElementBlock("svg",bc,vc)),e.createElementVNode("span",Sc,e.toDisplayString(a.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>u.value=b),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,40,wc),[[e.vModelText,u.value]]),p.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[1]||(m[1]=b=>p.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),kc={class:"sm:flex sm:items-start"},xc=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})])],-1),Dc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ec={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Nc={class:"mt-2"},Cc={class:"text-gray-500 mb-1"},Vc=["id"],Mc={key:0,class:"py-2"},Tc=["disabled","onClick"],Bc=Object.assign({name:"VFModalUpload"},{props:{current:Object},setup(n){const t=n,o=e.inject("emitter"),{apiUrl:i}=ue(),{t:l}=e.inject("i18n"),a=e.inject("maxFileSize"),u=e.ref(null),p=e.ref(null),c=e.ref(null),y=e.ref([]),m=e.ref(""),b=e.ref(!0),S=()=>{m.value="",u.value.start()},E=e.inject("postData");return e.onMounted(()=>{u.value=new ve.Uploader({runtimes:"html5",browse_button:c.value,container:p.value,max_file_size:a,multiple_queues:!0,file_data_name:"file",url:i.value+"?"+Ce(Object.assign(E,{q:"upload",adapter:t.current.adapter,path:t.current.dirname})),headers:{...nt&&{"X-CSRF-Token":nt}},init:{PostInit:function(){},FilesAdded:function(_,N){b.value=!1,ve.each(N,function(D){y.value.push({id:D.id,name:D.name,size:ve.formatSize(D.size),percent:""})})},UploadProgress:function(_,N){y.value[y.value.findIndex(D=>D.id==N.id)].percent=N.percent+"%"},UploadComplete:function(){b.value=!0,o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})},Error:function(_,N){u.value.stop(),N.code==ve.HTTP_ERROR?m.value=l(JSON.parse(N.response).message):N.code==ve.FILE_SIZE_ERROR?m.value=l("The selected file exceeds the maximum file size. You cannot upload files greater than %s",[a]):m.value=l(N.message)}}}),u.value.init()}),(_,N)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{disabled:b.value,onClick:e.withModifiers(S,["prevent"]),type:"button",class:e.normalizeClass([b.value?"bg-blue-200 hover:bg-blue-200 dark:bg-gray-700/50 dark:hover:bg-gray-700/50 dark:text-gray-500":"bg-blue-600 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-500","w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"])},e.toDisplayString(e.unref(l)("Upload")),11,Tc),e.createElementVNode("button",{type:"button",onClick:N[1]||(N[1]=D=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",kc,[xc,e.createElementVNode("div",Dc,[e.createElementVNode("h3",Ec,e.toDisplayString(e.unref(l)("Upload files")),1),e.createElementVNode("div",Nc,[e.createElementVNode("div",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,D=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{id:D.id},[e.createTextVNode(e.toDisplayString(D.name)+" ( "+e.toDisplayString(D.size)+") ",1),e.createElementVNode("b",null,e.toDisplayString(D.percent),1)],8,Vc)]))),256)),y.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Mc,e.toDisplayString(e.unref(l)("No files selected!")),1))]),e.createElementVNode("div",{class:"text-gray-500",ref_key:"container",ref:p},[e.createElementVNode("button",{ref_key:"pickFiles",ref:c,type:"button",class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Select Files")),513)],512),m.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:N[0]||(N[0]=D=>m.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),$c={class:"sm:flex sm:items-start"},Ac=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),Ic={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Lc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Oc={class:"mt-2"},jc={class:"flex text-sm text-gray-800 dark:text-gray-400"},Pc={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},zc=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],Rc={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Hc=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],Fc={class:"ml-1.5"},Uc=["onKeyup","placeholder"],Yc=Object.assign({name:"VFModalArchive"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n"),a=e.ref(""),u=e.ref(""),p=e.ref(t.selection.items),c=()=>{p.value.length&&o.emit("vf-fetch",{params:{q:"archive",adapter:i.value,path:t.current.dirname,items:JSON.stringify(p.value.map(({path:y,type:m})=>({path:y,type:m}))),name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:l("The file(s) archived.")})},onError:y=>{u.value=l(y.message)}})};return(y,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:m[2]||(m[2]=b=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$c,[Ac,e.createElementVNode("div",Ic,[e.createElementVNode("h3",Lc,e.toDisplayString(e.unref(l)("Archive the files")),1),e.createElementVNode("div",Oc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,b=>(e.openBlock(),e.createElementBlock("p",jc,[b.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Pc,zc)):(e.openBlock(),e.createElementBlock("svg",Rc,Hc)),e.createElementVNode("span",Fc,e.toDisplayString(b.basename),1)]))),256)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>a.value=b),onKeyup:e.withKeys(c,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(l)("Archive name. (.zip file will be created)"),type:"text"},null,40,Uc),[[e.vModelText,a.value]]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[1]||(m[1]=b=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Kc={class:"sm:flex sm:items-start"},Wc=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),Xc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Zc={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},qc={class:"mt-2"},Gc={class:"flex text-sm text-gray-800 dark:text-gray-400"},Jc={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Qc=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],ed={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},td=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],rd={class:"ml-1.5"},nd={class:"my-1 text-sm text-gray-500"},od=Object.assign({name:"VFModalUnarchive"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter");e.inject("storage");const i=e.inject("adapter"),{t:l}=e.inject("i18n");e.ref("");const a=e.ref(t.selection.items[0]),u=e.ref(""),p=e.ref([]),c=()=>{o.emit("vf-fetch",{params:{q:"unarchive",adapter:i.value,path:t.current.dirname,item:a.value.path},onSuccess:()=>{o.emit("vf-toast-push",{label:l("The file unarchived.")})},onError:y=>{u.value=l(y.message)}})};return(y,m)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:m[1]||(m[1]=b=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(l)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Kc,[Wc,e.createElementVNode("div",Xc,[e.createElementVNode("h3",Zc,e.toDisplayString(e.unref(l)("Unarchive")),1),e.createElementVNode("div",qc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,b=>(e.openBlock(),e.createElementBlock("p",Gc,[b.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Jc,Qc)):(e.openBlock(),e.createElementBlock("svg",ed,td)),e.createElementVNode("span",rd,e.toDisplayString(b.basename),1)]))),256)),e.createElementVNode("p",nd,e.toDisplayString(e.unref(l)("The archive will be unarchived at"))+" ("+e.toDisplayString(n.current.dirname)+")",1),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:m[0]||(m[0]=b=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),id={class:"sm:flex sm:items-start"},sd=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1),ad={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ld={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},cd={class:"mt-2"},dd={class:"flex text-sm text-gray-800 dark:text-gray-400"},hd={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ud=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)],fd={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},md=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],pd={class:"ml-1.5"},gd={class:"text-sm text-gray-500 pb-1 pt-3"},yd={class:"flex text-sm text-gray-800 dark:text-gray-400"},bd=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),vd={class:"ml-1.5 overflow-auto"},Jt={VueFinder:Xs,...Object.freeze(Object.defineProperty({__proto__:null,ModalArchive:Yc,ModalDelete:pa,ModalMessage:_a,ModalMove:Object.assign({name:"VFModalMove"},{props:{selection:Object,current:Object},setup(n){const t=n,o=e.inject("emitter"),{t:i}=e.inject("i18n");e.inject("storage");const l=e.inject("adapter"),a=e.ref(t.selection.items.from),u=e.ref(""),p=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"move",adapter:l.value,path:t.current.dirname,items:JSON.stringify(a.value.map(({path:c,type:y})=>({path:c,type:y}))),item:t.selection.items.to.path},onSuccess:()=>{o.emit("vf-toast-push",{label:i("Files moved.",t.selection.items.to.name)})},onError:c=>{u.value=i(c.message)}})};return(c,y)=>(e.openBlock(),e.createBlock(me,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:p,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(i)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:y[1]||(y[1]=m=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(i)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",id,[sd,e.createElementVNode("div",ad,[e.createElementVNode("h3",ld,e.toDisplayString(e.unref(i)("Move files")),1),e.createElementVNode("div",cd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("p",dd,[m.type=="dir"?(e.openBlock(),e.createElementBlock("svg",hd,ud)):(e.openBlock(),e.createElementBlock("svg",fd,md)),e.createElementVNode("span",pd,e.toDisplayString(m.path),1)]))),256)),e.createElementVNode("p",gd,e.toDisplayString(e.unref(i)("Are you sure you want to move these files?")),1),e.createElementVNode("p",yd,[bd,e.createElementVNode("span",vd,e.toDisplayString(n.selection.items.to.path),1)]),u.value.length?(e.openBlock(),e.createBlock(pe,{key:0,onHidden:y[0]||(y[0]=m=>u.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ModalNewFile:ja,ModalNewFolder:Ma,ModalPreview:cc,ModalRename:_c,ModalUnarchive:od,ModalUpload:Bc},Symbol.toStringTag,{value:"Module"}))},fu="",mu="",Sd={install(n){for(const t in Jt)if(Jt.hasOwnProperty(t)){const o=Jt[t];n.component(o.name,o)}}},wd=Object.freeze(Object.defineProperty({__proto__:null,default:`{
|
|
20
20
|
"Language": "Sprache",
|
|
21
21
|
"Create": "Erstellen",
|
|
22
22
|
"Close": "Schließen",
|