vuefinder 1.0.7 → 1.0.8

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 CHANGED
@@ -3076,11 +3076,15 @@ const vn = /* @__PURE__ */ h("iframe", {
3076
3076
  i.value.focus();
3077
3077
  });
3078
3078
  }, b = B("ajaxData"), A = () => {
3079
- g.value = "", m.value = !1, mt(f.value, {
3079
+ g.value = "", m.value = !1, console.log(b), mt(f.value, {
3080
3080
  method: "POST",
3081
- params: { q: "save", adapter: t.selection.adapter, path: t.selection.item.path, content: n.value },
3082
- json: !1,
3083
- ...b
3081
+ params: Object.assign(b, {
3082
+ q: "save",
3083
+ adapter: t.selection.adapter,
3084
+ path: t.selection.item.path,
3085
+ content: n.value
3086
+ }),
3087
+ json: !1
3084
3088
  }).then((_) => {
3085
3089
  g.value = d("Updated."), a.value = _, e("load"), s.value = !s.value;
3086
3090
  }).catch((_) => {
@@ -4320,10 +4324,14 @@ const hl = { class: "flex" }, fl = {
4320
4324
  (A) => {
4321
4325
  g.value = "", m.value = !1, mt(n.value, {
4322
4326
  method: "POST",
4323
- params: { q: "upload", adapter: t.selection.adapter, path: t.selection.item.path, file: A },
4327
+ params: Object.assign(p, {
4328
+ q: "upload",
4329
+ adapter: t.selection.adapter,
4330
+ path: t.selection.item.path,
4331
+ file: A
4332
+ }),
4324
4333
  name: t.selection.item.basename,
4325
- json: !1,
4326
- ...p
4334
+ json: !1
4327
4335
  }).then((_) => {
4328
4336
  g.value = a("Updated."), i.value.src = $t(t.selection.adapter, t.selection.item.path), d(), e("load");
4329
4337
  }).catch((_) => {
@@ -1,6 +1,6 @@
1
1
  (function(e,Ve){typeof exports=="object"&&typeof module<"u"?module.exports=Ve(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],Ve):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=Ve(e.Vue,e.plupload))})(this,function(e,Ve){"use strict";const Ge=(i=>i&&typeof i=="object"&&"default"in i?i:{default:i})(Ve),Le=(i,{method:t="get",params:r={},json:a=!0})=>{const s={method:t};if(t=="get")i+="?"+new URLSearchParams(r);else{s.headers={};let o=new FormData;for(const[l,m]of Object.entries(r))o.append(l,m);s.body=o}return fetch(i,s).then(o=>o.ok?a?o.json():o.text():o.json().then(Promise.reject.bind(Promise)))};function br(i){return{all:i=i||new Map,on:function(t,r){var a=i.get(t);a?a.push(r):i.set(t,[r])},off:function(t,r){var a=i.get(t);a&&(r?a.splice(a.indexOf(r)>>>0,1):i.set(t,[]))},emit:function(t,r){var a=i.get(t);a&&a.slice().map(function(s){s(r)}),(a=i.get("*"))&&a.slice().map(function(s){s(t,r)})}}}function Je(i){let t=localStorage.getItem(i+"_storage");const r=e.ref(JSON.parse(t));e.watch(r,a);function a(){r.value===null||r.value===""?localStorage.removeItem(i+"_storage"):localStorage.setItem(i+"_storage",JSON.stringify(r.value))}function s(m,g){r.value=Object.assign({...r.value},{[m]:g})}function o(){r.value=null}return{getStore:(m,g=null)=>r.value===null||r.value===""?g:r.value.hasOwnProperty(m)?r.value[m]:g,setStore:s,clearStore:o}}const vt=e.ref("");function ie(){function i(t){vt.value=t}return{apiUrl:vt,setApiUrl:i}}const vr={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},wr={key:0,class:"flex text-center"},kr=["aria-label"],_r=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})],-1)],xr=["aria-label"],Sr=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})],-1)],Dr=["aria-label"],Er=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1)],Nr=["aria-label"],Vr=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1)],Cr=["aria-label"],Mr=[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)],$r=["aria-label"],Br=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1)],Tr=["aria-label"],Ar=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1)],Or={key:1,class:"flex text-center"},jr={class:"pl-2"},Pr={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Ir={class:"flex text-center items-center justify-end"},Lr=["aria-label"],zr=[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)],Rr=["aria-label"],Hr={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"},Ur={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"},Fr={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},Kr=["aria-label"],Yr={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"},Wr={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"},Xr=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(i){const t=e.inject("emitter"),{getStore:r,setStore:a}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(r("viewport","grid")),l=e.ref([]),m=e.ref(r("full-screen",!1)),g=e.ref("");t.on("vf-search-query",({newQuery:u})=>{g.value=u});const f=()=>{m.value=!m.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",u=>{l.value=u}),t.on("vf-view-toggle",u=>{a("viewport",u),o.value=u}),(u,p)=>(e.openBlock(),e.createElementBlock("div",vr,[g.value.length?(e.openBlock(),e.createElementBlock("div",Or,[e.createElementVNode("div",jr,[e.createTextVNode(e.toDisplayString(e.unref(s)("Search results for"))+" ",1),e.createElementVNode("span",Pr,e.toDisplayString(g.value),1)])])):(e.openBlock(),e.createElementBlock("div",wr,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:p[0]||(p[0]=b=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:l.value}))},_r,8,kr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:p[1]||(p[1]=b=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:l.value}))},Sr,8,xr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:p[2]||(p[2]=b=>l.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.value.length==1?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Er,2))],8,Dr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:p[3]||(p[3]=b=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Vr,2))],8,Nr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:p[4]||(p[4]=b=>e.unref(t).emit("vf-modal-show",{type:"upload",items:l.value}))},Mr,8,Cr),l.value.length==1&&l.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(s)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:p[5]||(p[5]=b=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Br,2))],8,$r)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(s)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:p[6]||(p[6]=b=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ar,2))],8,Tr))])),e.createElementVNode("div",Ir,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:p[7]||(p[7]=b=>e.unref(t).emit("vf-darkMode-toggle")),viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-6 w-6 m-auto cursor-pointer stroke-sky-500 fill-sky-100 hover:stroke-sky-600 dark:stroke-gray-400 dark:fill-gray-400/20 dark:hover:stroke-gray-300"},zr))],8,Lr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Toggle Full Screen"),"data-microtip-position":"bottom",role:"tooltip",onClick:f},[(e.openBlock(),e.createElementBlock("svg",Hr,[m.value?(e.openBlock(),e.createElementBlock("path",Ur)):(e.openBlock(),e.createElementBlock("path",Fr))]))],8,Rr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:p[8]||(p[8]=b=>g.value.length||e.unref(t).emit("vf-view-toggle",o.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([g.value.length?"stroke-gray-200 dark:stroke-gray-700":"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[o.value=="grid"?(e.openBlock(),e.createElementBlock("path",Yr)):e.createCommentVNode("",!0),o.value=="list"?(e.openBlock(),e.createElementBlock("path",Wr)):e.createCommentVNode("",!0)],2))],8,Kr)])]))}});var qr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},wt={exports:{}};(function(i,t){(function(r,a){i.exports=a()})(qr,function(){function r(h,c){if(!(h instanceof c))throw new TypeError("Cannot call a class as a function")}function a(h,c){for(var n=0;n<c.length;n++){var y=c[n];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(h,y.key,y)}}function s(h,c,n){return c&&a(h.prototype,c),n&&a(h,n),h}function o(h,c,n){return c in h?Object.defineProperty(h,c,{value:n,enumerable:!0,configurable:!0,writable:!0}):h[c]=n,h}function l(h,c){var n=Object.keys(h);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(h);c&&(y=y.filter(function(d){return Object.getOwnPropertyDescriptor(h,d).enumerable})),n.push.apply(n,y)}return n}function m(h){for(var c=1;c<arguments.length;c++){var n=arguments[c]!=null?arguments[c]:{};c%2?l(Object(n),!0).forEach(function(y){o(h,y,n[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(y){Object.defineProperty(h,y,Object.getOwnPropertyDescriptor(n,y))})}return h}function g(h,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(c&&c.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),c&&u(h,c)}function f(h){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},f(h)}function u(h,c){return u=Object.setPrototypeOf||function(y,d){return y.__proto__=d,y},u(h,c)}function p(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(h,c,n){return p()?b=Reflect.construct:b=function(d,v,w){var _=[null];_.push.apply(_,v);var x=Function.bind.apply(d,_),V=new x;return w&&u(V,w.prototype),V},b.apply(null,arguments)}function N(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function k(h){var c=typeof Map=="function"?new Map:void 0;return k=function(y){if(y===null||!N(y))return y;if(typeof y!="function")throw new TypeError("Super expression must either be null or a function");if(typeof c<"u"){if(c.has(y))return c.get(y);c.set(y,d)}function d(){return b(y,arguments,f(this).constructor)}return d.prototype=Object.create(y.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),u(d,y)},k(h)}function D(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function M(h,c){return c&&(typeof c=="object"||typeof c=="function")?c:D(h)}function T(h){var c=p();return function(){var y=f(h),d;if(c){var v=f(this).constructor;d=Reflect.construct(y,arguments,v)}else d=y.apply(this,arguments);return M(this,d)}}function O(h,c){for(;!Object.prototype.hasOwnProperty.call(h,c)&&(h=f(h),h!==null););return h}function C(h,c,n){return typeof Reflect<"u"&&Reflect.get?C=Reflect.get:C=function(d,v,w){var _=O(d,v);if(!!_){var x=Object.getOwnPropertyDescriptor(_,v);return x.get?x.get.call(w):x.value}},C(h,c,n||h)}function J(h,c){return R(h)||Q(h,c)||re(h,c)||$()}function F(h){return S(h)||K(h)||re(h)||j()}function S(h){if(Array.isArray(h))return B(h)}function R(h){if(Array.isArray(h))return h}function K(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}function Q(h,c){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(h)))){var n=[],y=!0,d=!1,v=void 0;try{for(var w=h[Symbol.iterator](),_;!(y=(_=w.next()).done)&&(n.push(_.value),!(c&&n.length===c));y=!0);}catch(x){d=!0,v=x}finally{try{!y&&w.return!=null&&w.return()}finally{if(d)throw v}}return n}}function re(h,c){if(!!h){if(typeof h=="string")return B(h,c);var n=Object.prototype.toString.call(h).slice(8,-1);if(n==="Object"&&h.constructor&&(n=h.constructor.name),n==="Map"||n==="Set")return Array.from(h);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B(h,c)}}function B(h,c){(c==null||c>h.length)&&(c=h.length);for(var n=0,y=new Array(c);n<c;n++)y[n]=h[n];return y}function j(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L=function(c,n,y){var d=c.x,v=c.y,w=y.x,_=y.y,x={"+":{x:d+w,y:v+_},"-":{x:d-w,y:v-_},"*":{x:d*w,y:v*_},"/":{x:d/w,y:v/_}};return x[n]},P=function(c){return{x:c.left,y:c.top}},q=function(c){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:c.x,top:c.y,right:c.x,bottom:c.y,width:n,height:n}},Y=function(c){return{x:c,y:c}},je=function(h,c,n){window.addEventListener("resize",c),window.addEventListener("scroll",c),h.forEach(function(y,d){n.observe(y,{childList:d!==0,attributes:!0})})},Pe=function(h){var c=De(h);return c.x||c.y?!0:h instanceof HTMLDocument?h.body?!!(h.body.scrollTop=1):!!(h.documentElement.scrollTop=1):!!(h.scrollTop=1)},Ye=function(h){var c=document.createElement("div");return c.style.position="fixed",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="999999999999999999",c.classList.add(h),c},We=function(h){var c=document.createElement("div");return c.style.position="absolute",h||(c.style.background="rgba(0, 0, 255, 0.1)",c.style.border="1px solid rgba(0, 0, 255, 0.45)",c.style.display="none",c.style.pointerEvents="none"),c},Xe=function(h,c){var n;return function(){for(var y=arguments.length,d=new Array(y),v=0;v<y;v++)d[v]=arguments[v];var w=function(){n=null,h.apply(void 0,d)};clearTimeout(n),n=setTimeout(w,c)}},Se=function(){var h,c,n,y;return{y:((h=document.body)===null||h===void 0?void 0:h.scrollTop)||((c=document.documentElement)===null||c===void 0?void 0:c.scrollTop)||0,x:((n=document.body)===null||n===void 0?void 0:n.scrollLeft)||((y=document.documentElement)===null||y===void 0?void 0:y.scrollLeft)||0}},gt=function(h,c){if(h instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=h.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(h.clientWidth||n.width)*c,height:(h.clientHeight||n.height)*c}},De=function(h){return!h||h instanceof Document?Se():{x:h.scrollLeft>=0?h.scrollLeft:Se().x,y:h.scrollTop>=0?h.scrollTop:Se().y}},Zt=function(h){var c=h.elementRect,n=h.containerRect,y=h.tolerance,d=y===void 0?{x:0,y:0}:y,v=[];return c.top-d.y<n.top&&v.push("top"),c.left-d.x<n.left&&v.push("left"),c.bottom+d.y>n.bottom&&v.push("bottom"),c.right+d.y>n.right&&v.push("right"),v},Qs=function(h){var c=h.event;return{x:c.clientX,y:c.clientY}},el=function(h){var c=h.scrollAmount,n=h.initialPointerPos,y=h.pointerPos,d={};return y.x>n.x-c.x?(d.left=n.x-c.x,d.width=y.x-n.x+c.x):(d.left=y.x,d.width=n.x-y.x-c.x),y.y>n.y-c.y?(d.top=n.y-c.y,d.height=y.y-n.y+c.y):(d.top=y.y,d.height=n.y-y.y-c.y),d},Qt=function(c){var n={x:0,y:0},y=window.getComputedStyle(c);if(!y.transform||y.transform==="none")return n;if(y.transform.indexOf("3d")>=0){var d=y.transform.trim().match(/matrix3d\((.*?)\)/);if(d&&d.length){var v,w=(v=d[1])===null||v===void 0?void 0:v.split(",");n.x=parseInt(w[12])||0,n.y=parseInt(w[13])||0}return n}else{var _=y.transform.trim().match(/matrix\((.*?)\)/);if(_&&_.length){var x,V=(x=_[1])===null||x===void 0?void 0:x.split(",");n.x=parseInt(V[4])||0,n.y=parseInt(V[5])||0}return n}},tl=function(c){var n=c.style.transform;if(!n||n.indexOf("translate")<0)return Qt(c);var y={x:0,y:0},d=n.trim().match(/translate[3dD]*?\(.*?\)/);if(d){var v,w=(v=d[0])===null||v===void 0?void 0:v.split("(");if(w){var _,x=(_=w[1])===null||_===void 0?void 0:_.split(",");y.x=parseInt(x[0])||0,y.y=parseInt(x[1])||0}}return!y.x&&!y.x?Qt(c):y},rl=function(c){var n=c.style,y={x:parseInt(n.left)||0,y:parseInt(n.top)||0};if(!y.x&&!y.x){var d=window.getComputedStyle(c);return{x:parseInt(d.left)||0,y:parseInt(d.top)||0}}return y},nl=function(h,c){return c?tl(h):rl(h)},ol=function(h){var c=h.element,n=h.edges,y=h.elementRect,d=h.containerRect,v=h.elementPos,w=h.useTransform;n.includes("top")&&Ie(c,{y:v.y+d.top-y.top,x:v.x},w),n.includes("left")&&Ie(c,{y:v.y,x:v.x+d.left-y.left},w),n.includes("bottom")&&Ie(c,{y:v.y+d.bottom-y.bottom,x:v.x},w),n.includes("right")&&Ie(c,{y:v.y,x:v.x+d.right-y.right},w)},er=function(h){var c=h.computedStyle,n=h.node,y=c.position,d=y==="absolute"||y==="relative"||y==="fixed";!(n instanceof HTMLDocument)&&!d&&(n.style.position="relative")},al=function(h){var c=h.shiftKey,n=h.keyboardDragSpeed,y=h.zoom,d=h.key,v=h.dragKeys,w=h.scrollDiff,_=h.canScroll,x=h.scrollCallback,V={x:0,y:0},E=c?n*4*y:n*y;return v.left.includes(d)&&(V.x=w.x||-E,!c&&!w.x&&_&&x(["left"],n)),v.right.includes(d)&&(V.x=w.x||E,!c&&!w.x&&_&&x(["right"],n)),v.up.includes(d)&&(V.y=w.y||-E,!c&&!w.y&&_&&x(["top"],n)),v.down.includes(d)&&(V.y=w.y||E,!c&&!w.y&&_&&x(["bottom"],n)),V},il=function(h){var c=h.element,n=h.force,y=h.multiSelectionToggle,d=h.SelectedSet,v=h.hoverClassName;c.classList.contains(v)&&!n||(d.has(c)?y&&d.delete(c):d.add(c),c.classList.add(v))},sl=function(h){var c=h.element,n=h.force,y=h.SelectedSet,d=h.PrevSelectedSet,v=h.hoverClassName;if(!c.classList.contains(v)&&!n)return!1;var w=y.has(c),_=d.has(c);w&&!_?y.delete(c):!w&&_&&y.add(c),c.classList.remove(v)},yt=function(h,c){return h.left<c.right&&h.right>c.left&&h.top<c.bottom&&h.bottom>c.top},tr=function(h){var c=h.element,n=h.posDirection,y=h.containerRect,d=h.useTransform,v=nl(c,d),w=L(v,"+",n);Ie(c,w,d);var _=c.getBoundingClientRect(),x=Zt({elementRect:_,containerRect:y});ol({element:c,edges:x,elementRect:_,containerRect:y,elementPos:w,useTransform:d})},ll=function(h,c){window.removeEventListener("resize",c),window.removeEventListener("scroll",c),h.disconnect()},cl=function(h,c,n){if(!!c.length){var y=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,d=h instanceof HTMLDocument?y||document.body:h,v=c.includes("top")&&d.scrollTop>0,w=c.includes("bottom")&&d.scrollTop<d.scrollHeight,_=c.includes("left")&&d.scrollLeft>0,x=c.includes("right")&&d.scrollLeft<d.scrollWidth;v&&(d.scrollTop-=1*n),w&&(d.scrollTop+=1*n),_&&(d.scrollLeft-=1*n),x&&(d.scrollLeft+=1*n)}},Ie=function(h,c,n){if(n){var y=h.style.transform;h.style.transform="translate3d(".concat(c.x,"px,").concat(c.y,"px,1px) ").concat(y.replace(/translate.*?\)/g,""))}else h.style.left="".concat(c.x,"px"),h.style.top="".concat(c.y,"px");return h},dl=function(h){for(var c=h.subscribe,n=h.publish,y=h.Interaction,d=h.SelectedSet,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(E){return E.event}}],"Interaction:end":[{name:"callback"}]},w=function(){var E=J(x[_],2),A=E[0],I=E[1];["pre",!1].forEach(function(W){return c(W?"".concat(A,":").concat(W):A,function(ne){return I.forEach(function(G){return(!G.condition||G.condition(ne))&&n(W?"".concat(W).concat(G.name):G.name,m({items:d.elements,isDragging:y.isDragging},ne))})})})},_=0,x=Object.entries(v);_<x.length;_++)w()},Ee=function(h){return h?!Array.isArray(h)&&(h instanceof HTMLElement||h instanceof SVGElement)?[h]:F(h):[]},rr=function(h,c){h.style.left="".concat(c.left,"px"),h.style.top="".concat(c.top,"px"),h.style.width="".concat(c.width,"px"),h.style.height="".concat(c.height,"px")},hl=function(){function h(c){var n=this,y=c.area,d=c.PS,v=c.zoom;r(this,h),o(this,"_modificationCallback",void 0),o(this,"_modificationObserver",void 0),o(this,"_zoom",void 0),o(this,"_node",void 0),o(this,"_parentNodes",void 0),o(this,"_computedStyle",void 0),o(this,"_computedBorder",void 0),o(this,"_rect",void 0),o(this,"setArea",function(w){n._node=w,er({computedStyle:n.computedStyle,node:n._node}),setTimeout(function(){n.PubSub.publish("Area:modified:pre",{item:n}),n.reset(),n.PubSub.publish("Area:modified",{item:n})})}),o(this,"start",function(){je(n.parentNodes,n._modificationCallback,n._modificationObserver)}),o(this,"reset",function(){n._computedStyle=void 0,n._rect=void 0,n._computedBorder=void 0,n._parentNodes=void 0}),o(this,"stop",function(){ll(n._modificationObserver,n._modificationCallback),n.reset()}),o(this,"scroll",function(w,_){var x={scroll_directions:w,scroll_multiplier:_};n.PubSub.publish("Area:scroll:pre",x),cl(n._node,w,_),n.PubSub.publish("Area:scroll",x)}),this._zoom=v,this.PubSub=d,this.setArea(y),this._modificationCallback=Xe(function(w){n.PubSub.publish("Area:modified:pre",{event:w,item:n}),n.reset(),n.PubSub.publish("Area:modified",{event:w,item:n})},60),this._modificationObserver=new MutationObserver(this._modificationCallback),this.PubSub.subscribe("Interaction:init",this.start),this.PubSub.subscribe("Interaction:end",this.reset)}return s(h,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof HTMLDocument?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=gt(this.HTMLNode,this._zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;var n=function y(d){var v,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=(v=d[w])===null||v===void 0?void 0:v.parentNode;return _?(d.push(_),w++,y(d,w)):d};return this._parentNodes=n([this.HTMLNode]),this._parentNodes}}]),h}(),ul=function(){function h(c){var n=this,y=c.DS,d=c.dragKeys,v=c.draggability,w=c.keyboardDrag,_=c.keyboardDragSpeed,x=c.useTransform,V=c.zoom;r(this,h),o(this,"_useTransform",void 0),o(this,"_prevCursorPos",void 0),o(this,"_prevScrollPos",void 0),o(this,"_elements",[]),o(this,"_draggability",void 0),o(this,"_dragKeys",void 0),o(this,"_dragKeysFlat",void 0),o(this,"_keyboardDrag",void 0),o(this,"_keyboardDragSpeed",void 0),o(this,"_zoom",void 0),o(this,"keyboardDrag",function(E){var A=E.event,I=E.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability||n.DS.continue)){var W={event:A,isDragging:!0,isDraggingKeyboard:!0};n.DS.publish(["Interaction:start:pre","Interaction:start"],W),n._elements=n.DS.getSelection(),n.handleZIndex(!0);var ne=al({shiftKey:n.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:n._keyboardDragSpeed,zoom:n._zoom,key:I,scrollCallback:n.DS.Area.scroll,scrollDiff:n._scrollDiff,canScroll:n.DS.stores.ScrollStore.canScroll,dragKeys:n._dragKeys});n._elements.forEach(function(G){return tr({element:G,posDirection:ne,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})}),n.DS.publish(["Interaction:update:pre","Interaction:update"],W)}}),o(this,"keyboardEnd",function(E){var A=E.event,I=E.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability)){var W={event:A,isDragging:n._draggability,isDraggingKeyboard:!0};n.DS.publish(["Interaction:end:pre","Interaction:end"],W)}}),o(this,"start",function(E){var A=E.isDragging,I=E.isDraggingKeyboard;!A||I||(n._prevCursorPos=null,n._prevScrollPos=null,n._elements=n.DS.getSelection(),n.handleZIndex(!0))}),o(this,"stop",function(E){E!=null&&E.isKeyboard||(n._prevCursorPos=null,n._prevScrollPos=null,n.handleZIndex(!1),n._elements=[])}),o(this,"update",function(E){var A=E.isDragging,I=E.isDraggingKeyboard;if(!(!A||!n._elements.length||I||n.DS.continue)){var W=L(n._cursorDiff,"+",n._scrollDiff);n._elements.forEach(function(ne){return tr({element:ne,posDirection:W,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})})}}),o(this,"handleZIndex",function(E){n._elements.forEach(function(A){return A.style.zIndex="".concat((parseInt(A.style.zIndex)||0)+E?9999:-9998)})}),this.DS=y,this._useTransform=x,this._keyboardDragSpeed=_,this._keyboardDrag=w,this._zoom=V,this._draggability=v,this._dragKeys={up:d.up.map(function(E){return E.toLowerCase()}),down:d.down.map(function(E){return E.toLowerCase()}),left:d.left.map(function(E){return E.toLowerCase()}),right:d.right.map(function(E){return E.toLowerCase()})},this._dragKeysFlat=[].concat(F(this._dragKeys.up),F(this._dragKeys.down),F(this._dragKeys.left),F(this._dragKeys.right)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return s(h,[{key:"_cursorDiff",get:function(){var n=this.DS.stores.PointerStore.currentVal,y=this._prevCursorPos?L(n,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=n,y}},{key:"_scrollDiff",get:function(){var n=this.DS.stores.ScrollStore.currentVal,y=this._prevScrollPos?L(n,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=n,y}}]),h}(),ml=function(){function h(c){var n=this,y=c.DS,d=c.areaElement,v=c.draggability,w=c.immediateDrag,_=c.selectableClass;r(this,h),o(this,"_areaElement",void 0),o(this,"_draggability",void 0),o(this,"_immediateDrag",void 0),o(this,"_selectableClass",void 0),o(this,"isInteracting",void 0),o(this,"isDragging",void 0),o(this,"init",function(){return n.DS.publish("Interaction:init:pre",{})}),o(this,"_init",function(){n.stop(),n._areaElement.addEventListener("mousedown",n.start),n._areaElement.addEventListener("touchstart",n.start,{passive:!1}),n.DS.publish("Interaction:init",{})}),o(this,"start",function(x){return n.DS.publish("Interaction:start:pre",{event:x,isDragging:n.isDragging})}),o(this,"_start",function(x){x.type==="touchstart"&&x.preventDefault(),n._canInteract(x)&&(n.isInteracting=!0,n.isDragging=n.isDragEvent(x),n.DS.publish("Interaction:start",{event:x,isDragging:n.isDragging}),document.addEventListener("mouseup",n.reset),document.addEventListener("touchend",n.reset))}),o(this,"isDragEvent",function(x){var V=x.target.closest(".".concat(n._selectableClass));return!n._draggability||n.DS.stores.KeyStore.isMultiSelectKeyPressed(x)||!V?!1:(n._immediateDrag&&(n.DS.SelectedSet.size?n.DS.SelectedSet.has(V)||(n.DS.SelectedSet.clear(),n.DS.SelectedSet.add(V)):n.DS.SelectedSet.add(V)),!!n.DS.SelectedSet.has(V))}),o(this,"onClick",function(x){var V=x.event;if(!!n._canInteract(V)&&!(V.detail>0)){var E=n.DS,A=E.stores,I=A.PointerStore,W=A.KeyStore,ne=E.SelectableSet,G=E.SelectedSet;I.start(V);var Ne=V.target;!ne.has(Ne)||(W.isMultiSelectKeyPressed(V)||G.clear(),G.toggle(Ne),n.reset())}}),o(this,"stop",function(){n.isInteracting=!1,n.isDragging=!1,n._areaElement.removeEventListener("mousedown",n.start),n._areaElement.removeEventListener("touchstart",n.start,{passive:!1}),document.removeEventListener("mouseup",n.reset),document.removeEventListener("touchend",n.reset)}),o(this,"update",function(x){var V=x.event,E=x.scroll_directions,A=x.scroll_multiplier;n.isInteracting&&n.DS.publish(["Interaction:update:pre","Interaction:update"],{event:V,scroll_directions:E,scroll_multiplier:A,isDragging:n.isDragging})}),o(this,"reset",function(x){return n.DS.publish("Interaction:end:pre",{event:x,isDragging:n.isDragging})}),o(this,"_reset",function(x){var V=n.isDragging;n.stop(),n.init(),n.DS.publish("Interaction:end",{event:x,isDragging:V})}),this._areaElement=d,this._draggability=v,this._immediateDrag=w,this._selectableClass=_,this.DS=y,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(x){var V=x.event;return n.start(V)}),this.DS.subscribe("Interaction:start:pre",function(x){var V=x.event;return n._start(V)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(x){var V=x.event;return n._reset(V)}),this.DS.subscribe("Area:scroll",this.update)}return s(h,[{key:"_canInteract",value:function(n){var y=n.clientX===0&&n.clientY===0&&n.detail===0&&n.target;return!(n.button===2||this.isInteracting||n.target&&!this.DS.SelectorArea.isInside(n.target)||!y&&!this.DS.SelectorArea.isClicked(n))}}]),h}(),fl=function h(c){var n=this,y=c.DS;r(this,h),o(this,"subscribers",{}),o(this,"subscribe",function(d,v){return Array.isArray(n.subscribers[d])||(n.subscribers[d]=[]),n.subscribers[d].push(v),n.subscribers[d].length-1}),o(this,"unsubscribe",function(d,v,w){w>=0?n.subscribers[d].splice(w,1):v&&(n.subscribers[d]=n.subscribers[d].filter(function(_){return _!==v}))}),o(this,"publish",function(d,v){Array.isArray(d)?d.forEach(function(w){return n._publish(w,v)}):n._publish(d,v)}),o(this,"_publish",function(d,v){var w=n.subscribers[d];!Array.isArray(w)||(d.includes(":pre")?n._handlePrePublish(w,v):n._handlePublish(w,v))}),o(this,"_handlePublish",function(d,v){for(var w=0,_=d.length;w<_;w++){if(n.DS.stopped)return;d[w](v)}}),o(this,"_handlePrePublish",function(d,v){for(var w=d.length;w--;){if(n.DS.stopped)return;d[w](v)}}),this.DS=y},pl=function(h){g(n,h);var c=T(n);function n(y){var d,v=y.elements,w=y.className,_=y.hoverClassName,x=y.draggability,V=y.useTransform,E=y.DS;return r(this,n),d=c.call(this),o(D(d),"_initElements",void 0),o(D(d),"_className",void 0),o(D(d),"_hoverClassName",void 0),o(D(d),"_useTransform",void 0),o(D(d),"_draggability",void 0),o(D(d),"init",function(){return d._initElements.forEach(function(A){return d.add(A)})}),o(D(d),"clear",function(){return d.forEach(function(A){return d.delete(A)})}),o(D(d),"_onClick",function(A){return d.DS.publish(["Selectable:click:pre","Selectable:click"],{event:A})}),o(D(d),"_onPointer",function(A){return d.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:A})}),o(D(d),"addAll",function(A){return A.forEach(function(I){return d.add(I)})}),o(D(d),"deleteAll",function(A){return A.forEach(function(I){return d.delete(I)})}),d.DS=E,d._initElements=Ee(v),d._className=w,d._hoverClassName=_,d._useTransform=V,d._draggability=x,d.DS.subscribe("Interaction:init",d.init),d}return s(n,[{key:"add",value:function(d){return d.classList.add(this._className),d.addEventListener("click",this._onClick),d.addEventListener("mousedown",this._onPointer),d.addEventListener("touchstart",this._onPointer,{passive:!1}),this._draggability&&!this._useTransform&&er({computedStyle:window.getComputedStyle(d),node:d}),C(f(n.prototype),"add",this).call(this,d)}},{key:"delete",value:function(d){return d.classList.remove(this._className),d.classList.remove(this._hoverClassName),d.removeEventListener("click",this._onClick),d.removeEventListener("mousedown",this._onPointer),d.removeEventListener("touchstart",this._onPointer,{passive:!1}),C(f(n.prototype),"delete",this).call(this,d)}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(k(Set)),gl=function(h){g(n,h);var c=T(n);function n(y){var d,v=y.className,w=y.DS;return r(this,n),d=c.call(this),o(D(d),"_className",void 0),o(D(d),"clear",function(){return d.forEach(function(_){return d.delete(_)})}),o(D(d),"addAll",function(_){return _.forEach(function(x){return d.add(x)})}),o(D(d),"deleteAll",function(_){return _.forEach(function(x){return d.delete(x)})}),d.DS=w,d._className=v,d}return s(n,[{key:"add",value:function(d){if(!C(f(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};return this.DS.publish("Selected:added:pre",v),C(f(n.prototype),"add",this).call(this,d),d.classList.add(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)+1),this.DS.publish("Selected:added",v),this}}},{key:"delete",value:function(d){if(!!C(f(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};this.DS.publish("Selected:removed:pre",v);var w=C(f(n.prototype),"delete",this).call(this,d);return d.classList.remove(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)-1),this.DS.publish("Selected:removed",v),w}}},{key:"toggle",value:function(d){return this.has(d)?this.delete(d):this.add(d),d}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(k(Set)),yl=function(){function h(c){var n=this,y=c.DS,d=c.hoverClassName,v=c.multiSelectToggling;r(this,h),o(this,"_prevSelectedSet",void 0),o(this,"_hoverClassName",void 0),o(this,"_multiSelectToggling",void 0),o(this,"start",function(w){var _=w.event,x=w.isDragging;x||(n._storePrevious(_),n._handleInsideSelection(!0,_))}),o(this,"update",function(w){var _=w.isDragging;_||n.DS.continue||n._handleInsideSelection()}),o(this,"_handleInsideSelection",function(w,_){for(var x=n.DS,V=x.SelectableSet,E=x.SelectorArea,A=x.Selector,I=V.elements.map(function(fe){return[fe,fe.getBoundingClientRect()]}),W=[],ne=[],G=0,Ne=I.length;G<Ne;G++)!E.isInside(I[G][0],I[G][1])||(yt(I[G][1],A.rect)?W.push(I[G][0]):ne.push(I[G][0]));var qe=n.DS.stores.KeyStore.isMultiSelectKeyPressed(_)&&n._multiSelectToggling;n.DS.continue||(W.forEach(function(fe){return il({element:fe,force:w,multiSelectionToggle:qe,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName})}),ne.forEach(function(fe){return sl({element:fe,force:w,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName,PrevSelectedSet:n._prevSelectedSet})}))}),this._hoverClassName=d,this._multiSelectToggling=v,this.DS=y,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(h,[{key:"_storePrevious",value:function(n){var y=this.DS,d=y.stores.KeyStore,v=y.SelectedSet;d.isMultiSelectKeyPressed(n)?this._prevSelectedSet=new Set(v):this._prevSelectedSet=new Set}}]),h}(),bl=function(){function h(c){var n=this,y=c.DS,d=c.selector,v=c.selectorClass,w=c.customStyles;r(this,h),o(this,"_rect",void 0),o(this,"start",function(_){var x=_.isDragging;if(!x){var V=n.DS.stores.PointerStore,E=V.initialValArea;rr(n.HTMLNode,q(E,1)),n.HTMLNode.style.display="block",n._rect=null}}),o(this,"stop",function(){n.HTMLNode.style.width="0",n.HTMLNode.style.height="0",n.HTMLNode.style.display="none"}),o(this,"update",function(_){var x=_.isDragging;if(!(x||n.DS.continue)){var V=n.DS.stores,E=V.ScrollStore,A=V.PointerStore,I=el({scrollAmount:E.scrollAmount,initialPointerPos:A.initialValArea,pointerPos:A.currentValArea});rr(n.HTMLNode,I),n._rect=null}}),this.DS=y,this.HTMLNode=d||We(w),this.HTMLNode.classList.add(v),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(h,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),vl=function(){function h(c){var n=this,y=c.DS,d=c.selectorAreaClass,v=c.autoScrollSpeed,w=c.overflowTolerance;r(this,h),o(this,"_autoScrollSpeed",void 0),o(this,"_scrollInterval",void 0),o(this,"_rect",void 0),o(this,"currentEdges",[]),o(this,"_overflowTolerance",void 0),o(this,"start",function(){return n.applyElements("append")}),o(this,"applyElements",function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",x=document.body?"body":"documentElement",V="".concat(_,"Child");n.HTMLNode[V](n.DS.Selector.HTMLNode),document[x][V](n.HTMLNode)}),o(this,"updatePos",function(){n._rect=null;var _=n.DS.Area.rect,x=n.DS.Area.computedBorder,V=n.HTMLNode.style,E="".concat(_.top+x.top,"px"),A="".concat(_.left+x.left,"px"),I="".concat(_.width,"px"),W="".concat(_.height,"px");V.top!==E&&(V.top=E),V.left!==A&&(V.left=A),V.width!==I&&(V.width=I),V.height!==W&&(V.height=W)}),o(this,"stop",function(_){n.stopAutoScroll(),_&&n.applyElements("remove")}),o(this,"startAutoScroll",function(){n.currentEdges=[],n._scrollInterval=setInterval(function(){return n.handleAutoScroll()},16)}),o(this,"handleAutoScroll",function(){if(!n.DS.continue){var _=n.DS,x=_.stores.PointerStore,V=_.Area;n.currentEdges=Zt({elementRect:q(x.currentVal),containerRect:n.rect,tolerance:n._overflowTolerance}),n.currentEdges.length&&V.scroll(n.currentEdges,n._autoScrollSpeed)}}),o(this,"stopAutoScroll",function(){n.currentEdges=[],clearInterval(n._scrollInterval)}),o(this,"isInside",function(_,x){return n.DS.Area.HTMLNode.contains(_)&&n.DS.stores.ScrollStore.canScroll?!0:yt(n.rect,x||_.getBoundingClientRect())}),this._autoScrollSpeed=v,this._overflowTolerance=w,this.DS=y,this.HTMLNode=Ye(d),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){n.updatePos(),n.stopAutoScroll()})}return s(h,[{key:"isClicked",value:function(n){var y=this.DS.stores.PointerStore,d=n?y.getPointerPosition(n):y.initialVal;return yt({left:d.x,top:d.y,right:d.x,bottom:d.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),wl=function(){function h(c){var n=this,y=c.DS,d=c.multiSelectKeys,v=c.multiSelectMode;r(this,h),o(this,"_multiSelectMode",void 0),o(this,"_multiSelectKeys",void 0),o(this,"_currentValues",new Set),o(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),o(this,"init",function(){document.addEventListener("keydown",n.keydown),document.addEventListener("keyup",n.keyup),window.addEventListener("blur",n.reset)}),o(this,"keydown",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:down:pre",{event:w,key:_}),n._currentValues.add(_),n.DS.publish("KeyStore:down",{event:w,key:_})}),o(this,"keyup",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:up:pre",{event:w,key:_}),n._currentValues.delete(_),n.DS.publish("KeyStore:up",{event:w,key:_})}),o(this,"stop",function(){document.removeEventListener("keydown",n.keydown),document.removeEventListener("keyup",n.reset),window.removeEventListener("blur",n.reset),n.reset()}),o(this,"reset",function(){return n._currentValues.clear()}),this.DS=y,this._multiSelectMode=v,this._multiSelectKeys=d.map(function(w){var _={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"},x=_[w];return x?(console.warn("[DragSelect] ".concat(w,' is deprecated. Use "').concat(x,'" instead. Act Now!. See docs for more info')),x.toLowerCase()):w.toLowerCase()}),this.DS.subscribe("Interaction:init",this.init)}return s(h,[{key:"isMultiSelectKeyPressed",value:function(n){var y=this;return!!(this._multiSelectMode||this.currentValues.some(function(d){return y._multiSelectKeys.includes(d)})||n&&this._multiSelectKeys.some(function(d){return n[y._keyMapping[d]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),h}(),kl=function(){function h(c){var n=this,y=c.DS;r(this,h),o(this,"_isMouseInteraction",!1),o(this,"_initialValArea",void 0),o(this,"_currentValArea",void 0),o(this,"_lastValArea",void 0),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_lastVal",void 0),o(this,"_lastTouch",void 0),o(this,"init",function(){document.addEventListener("mousemove",n.update),document.addEventListener("touchmove",n.update,{passive:!1})}),o(this,"getPointerPosition",function(d){return Qs({event:n._normalizedEvent(d)})}),o(this,"update",function(d){!d||(n.DS.publish("PointerStore:updated:pre",{event:d}),n.currentVal=n.getPointerPosition(d),n._isMouseInteraction&&n.DS.publish("PointerStore:updated",{event:d}))}),o(this,"stop",function(){document.removeEventListener("mousemove",n.update),document.removeEventListener("touchmove",n.update,{passive:!1}),setTimeout(function(){return n._isMouseInteraction=!1},100)}),o(this,"reset",function(d){!d||(n.currentVal=n.lastVal=n.getPointerPosition(d),n.stop(),n.init())}),this.DS=y,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(d){var v=d.event;return n.start(v)}),this.DS.subscribe("Interaction:end",function(d){var v=d.event;return n.reset(v)})}return s(h,[{key:"start",value:function(n){!n||(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(n))}},{key:"_normalizedEvent",value:function(n){return"touches"in n&&n.type!=="touchend"&&(this._lastTouch=n),"touches"in n?this._lastTouch.touches[0]:n}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(n){this._initialVal=n,this._initialValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(n){this._currentVal=n,this._currentValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(n){this._lastVal=n,this._lastValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}}]),h}(),_l=function(){function h(c){var n=this,y=c.DS,d=c.areaElement,v=c.zoom;r(this,h),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_areaElement",void 0),o(this,"_canScroll",void 0),o(this,"init",function(){return n._areaElement.addEventListener("scroll",n.update)}),o(this,"start",function(){n._currentVal=n._initialVal=De(n._areaElement),n._areaElement.addEventListener("scroll",n.update)}),o(this,"update",function(){return n._currentVal=De(n._areaElement)}),o(this,"stop",function(){n._areaElement.removeEventListener("scroll",n.update),n._initialVal={x:0,y:0},n._canScroll=null}),o(this,"reset",function(){n.stop(),n.start()}),this._areaElement=d,this.DS=y,this.zoom=v,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return n.start()}),this.DS.subscribe("Interaction:end",function(){return n.reset()})}return s(h,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=Pe(this._areaElement)}},{key:"scrollAmount",get:function(){var n=L(this.currentVal,"-",this.initialVal),y=Y(this.zoom),d=L(L(n,"*",y),"-",n);return{x:n.x+d.x,y:n.y+d.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=De(this._areaElement)),this._currentVal}}]),h}(),xl=function(){function h(c){var n=this,y=c.area,d=y===void 0?document:y,v=c.selectables,w=v===void 0?[]:v,_=c.autoScrollSpeed,x=_===void 0?5:_,V=c.overflowTolerance,E=V===void 0?{x:25,y:25}:V,A=c.zoom,I=A===void 0?1:A,W=c.customStyles,ne=W===void 0?!1:W,G=c.multiSelectMode,Ne=G===void 0?!1:G,qe=c.multiSelectToggling,fe=qe===void 0?!0:qe,nr=c.multiSelectKeys,Sl=nr===void 0?["Control","Shift","Meta"]:nr,or=c.selector,Dl=or===void 0?void 0:or,ar=c.draggability,bt=ar===void 0?!0:ar,ir=c.immediateDrag,El=ir===void 0?!0:ir,sr=c.keyboardDrag,Nl=sr===void 0?!0:sr,Vl=c.dragKeys,lr=c.keyboardDragSpeed,Cl=lr===void 0?10:lr,cr=c.useTransform,dr=cr===void 0?!0:cr,hr=c.hoverClass,ur=hr===void 0?"ds-hover":hr,mr=c.selectableClass,fr=mr===void 0?"ds-selectable":mr,pr=c.selectedClass,Ml=pr===void 0?"ds-selected":pr,gr=c.selectorClass,$l=gr===void 0?"ds-selector":gr,yr=c.selectorAreaClass,Bl=yr===void 0?"ds-selector-area":yr,Tl=c.callback,Al=c.onDragMove,Ol=c.onDragStartBegin,jl=c.onDragStart,Pl=c.onElementSelect,Il=c.onElementUnselect;r(this,h),o(this,"continue",!1),o(this,"start",function(){n.stopped=!1,n.Interaction.init()}),o(this,"break",function(){return n.continue=!0}),o(this,"getSelection",function(){return n.SelectedSet.elements}),o(this,"getSelectables",function(){return n.SelectableSet.elements}),o(this,"getInitialCursorPosition",function(){return n.stores.PointerStore.initialVal}),o(this,"getCurrentCursorPosition",function(){return n.stores.PointerStore.currentVal}),o(this,"getPreviousCursorPosition",function(){return n.stores.PointerStore.lastVal}),o(this,"getInitialCursorPositionArea",function(){return n.stores.PointerStore.initialValArea}),o(this,"getCurrentCursorPositionArea",function(){return n.stores.PointerStore.currentValArea}),o(this,"getPreviousCursorPositionArea",function(){return n.stores.PointerStore.lastValArea}),o(this,"isMultiSelect",function(Ll){return n.stores.KeyStore.isMultiSelectKeyPressed(Ll)}),o(this,"isDragging",function(){return n.Interaction.isDragging}),this.PubSub=new fl({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:Tl,onDragMove:Al,onDragStart:jl,onDragStartBegin:Ol,onElementSelect:Pl,onElementUnselect:Il}),this.stores={PointerStore:new kl({DS:this}),ScrollStore:new _l({DS:this,areaElement:d,zoom:I}),KeyStore:new wl({DS:this,multiSelectKeys:Sl,multiSelectMode:Ne})},this.Area=new hl({area:d,PS:this.PubSub,zoom:I}),this.Selector=new bl({DS:this,selector:Dl,selectorClass:$l,customStyles:ne}),this.SelectorArea=new vl({DS:this,selectorAreaClass:Bl,autoScrollSpeed:x,overflowTolerance:E}),this.SelectableSet=new pl({elements:w,DS:this,className:fr,hoverClassName:ur,useTransform:dr,draggability:bt}),this.SelectedSet=new gl({DS:this,className:Ml}),this.Selection=new yl({DS:this,hoverClassName:ur,multiSelectToggling:fe}),this.Drag=new ul({DS:this,draggability:bt,useTransform:dr,keyboardDrag:Nl,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},Vl),zoom:I,keyboardDragSpeed:Cl}),this.Interaction=new ml({areaElement:d,DS:this,draggability:bt,immediateDrag:El,selectableClass:fr}),dl({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",function(){return n.continue=!1}),this.start()}return s(h,[{key:"_callbacksTemp",value:function(n){var y=n.callback,d=n.onDragMove,v=n.onDragStart,w=n.onDragStartBegin,_=n.onElementSelect,x=n.onElementUnselect,V=function(A,I){return console.warn("[DragSelect] ".concat(A,' is deprecated. Use DragSelect.subscribe("').concat(I,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};y&&(V("callback","callback"),this.subscribe("callback",function(E){var A=E.items;E.item;var I=E.event;return y(A,I)})),d&&(V("onDragMove","dragmove"),this.subscribe("dragmove",function(E){E.items,E.item;var A=E.event;return d(A)})),v&&(V("onDragStart","dragstart"),this.subscribe("dragstart",function(E){E.items,E.item;var A=E.event;return v(A)})),w&&(V("onDragStartBegin","dragstart"),this.subscribe("dragstart",function(E){E.items,E.item;var A=E.event;return w(A)})),_&&(V("onElementSelect","elementselect"),this.subscribe("elementselect",function(E){E.items;var A=E.item,I=E.event;return _(A,I)})),x&&(V("onElementUnselect","elementunselect"),this.subscribe("elementunselect",function(E){E.items;var A=E.item,I=E.event;return x(A,I)}))}},{key:"stop",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;d&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(n),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),n&&this.SelectableSet.clear(),y&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ee(n)),d||this.addSelectables(n),y&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ee(n)),d&&this.removeSelectables(n),y&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(n){var y=this,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ee(n).forEach(function(w){return y.SelectedSet.has(w)?y.removeSelection(n,d,v):y.addSelection(n,d,v)}),d&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(n,y,d),this.getSelection()}},{key:"clearSelection",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=Ee(n);return this.SelectableSet.addAll(d),y&&this.SelectedSet.addAll(d),n}},{key:"setSelectables",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.removeSelectables(n,y),this.addSelectables(n,d)}},{key:"removeSelectables",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.SelectableSet.deleteAll(Ee(n)),y&&this.removeSelection(n),n}},{key:"getCursorPositionDifference",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");var d=y?this.getCurrentCursorPositionArea():this.getCurrentCursorPosition(),v=n?y?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():y?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return L(d,"-",v)}}]),h}();return xl})})(wt);const Gr=wt.exports,Jr=(i,t,r,a,s)=>(t=Math,r=t.log,a=1024,s=r(i)/r(a)|0,i/t.pow(a,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B"),Zr=(i,t="en-US")=>new Date(i*1e3).toLocaleString(t),Qr={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},en=[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)],tn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},rn=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1)],ze=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(i){return(t,r)=>(e.openBlock(),e.createElementBlock("div",null,[i.direction=="down"?(e.openBlock(),e.createElementBlock("svg",Qr,en)):e.createCommentVNode("",!0),i.direction=="up"?(e.openBlock(),e.createElementBlock("svg",tn,rn)):e.createCommentVNode("",!0)]))}}),nn=["onClick"],on=Object.assign({name:"VFToast.vue"},{setup(i){const t=e.inject("emitter"),{getStore:r}=e.inject("storage"),a=e.ref(r("full-screen",!1)),s=g=>g=="error"?"text-red-400 border-red-400":"text-lime-600 border-lime-600",o=e.ref([]),l=g=>{o.value.splice(g,1)},m=g=>{let f=o.value.findIndex(u=>u.id===g);f!==-1&&l(f)};return t.on("vf-toast-clear",()=>{o.value=[]}),t.on("vf-toast-push",g=>{let f=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");g.id=f,o.value.push(g),setTimeout(()=>{m(f)},5e3)}),(g,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.value.value?"fixed":"absolute","bottom-0 max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(u,p)=>(e.openBlock(),e.createElementBlock("div",{onClick:b=>l(p),key:u,class:e.normalizeClass([s(u.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 border text-xs rounded cursor-pointer"])},e.toDisplayString(u.label),11,nn))),128))]),_:1})],2))}}),pe=i=>Object.entries(i).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:an}=ie(),Ze=(i,t)=>an.value+"?"+pe({q:"preview",adapter:i,path:t}),sn={class:"relative flex-auto flex flex-col overflow-hidden"},ln={key:0,class:"grid grid-cols-12 border-b border-neutral-300 dark:border-gray-700 text-xs select-none"},cn={class:"absolute"},dn=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),hn={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"},un=["onDblclick","onTouchstart","onContextmenu","data-type","data-item","data-index"],mn={class:"grid grid-cols-12 items-center"},fn={class:"flex col-span-7 items-center"},pn={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"},gn=[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)],yn={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"},bn=[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)],vn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},wn={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},kn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],_n={class:"grid grid-cols-12 items-center"},xn={class:"flex col-span-7 items-center"},Sn={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"},Dn=[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)],En={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"},Nn=[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)],Vn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Cn={class:"col-span-2 text-center"},Mn={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},$n=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Bn={class:"relative"},Tn={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"},An=[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)],On=["src"],jn={key:2,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Pn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],In={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},Ln={class:"break-all"},zn=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(i){const t=i,r=e.inject("emitter"),{setStore:a,getStore:s}=e.inject("storage"),o=B=>B==null?void 0:B.substring(0,3),l=B=>B.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),m=e.ref(null),g=e.ref(null),f=e.ref(0),u=e.ref(null),{t:p}=e.inject("i18n"),b=Math.floor(Math.random()*2**32),N=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{N.value=!N.value,a("full-screen",N.value)});const k=e.ref("");r.on("vf-search-query",({newQuery:B})=>{k.value=B,B?r.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:B},onSuccess:j=>{j.files.length||r.emit("vf-toast-push",{label:p("No search result found.")})}}):r.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let D=null;const M=()=>{D&&clearTimeout(D)},T=B=>{D=setTimeout(()=>{O(B)},500)},O=B=>{B.type=="dir"?(r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:B.path}})):r.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:B})},C=e.reactive({active:!1,column:"",order:""}),J=(B=!0)=>{let j=[...t.data.files],$=C.column,L=C.order=="asc"?1:-1;if(!B)return j;const P=(q,Y)=>typeof q=="string"&&typeof Y=="string"?q.toLowerCase().localeCompare(Y.toLowerCase()):q<Y?-1:q>Y?1:0;return C.active&&(j=j.slice().sort((q,Y)=>P(q[$],Y[$])*L)),j},F=B=>{C.active&&C.column==B?(C.active=C.order=="asc",C.column=B,C.order="desc"):(C.active=!0,C.column=B,C.order="asc")},S=()=>u.value.getSelection().map(B=>JSON.parse(B.dataset.item)),R=(B,j)=>{if(B.altKey||B.ctrlKey||B.metaKey)return B.preventDefault(),!1;B.dataTransfer.setDragImage(g.value,0,15),B.dataTransfer.effectAllowed="all",B.dataTransfer.dropEffect="copy",B.dataTransfer.setData("items",JSON.stringify(S()))},K=(B,j)=>{B.preventDefault();let $=JSON.parse(B.dataTransfer.getData("items"));if($.find(L=>L.storage!=s("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:$,to:j}})},Q=(B,j)=>{B.preventDefault(),!j||j.type!=="dir"||u.value.getSelection().find($=>$==B.currentTarget)?(B.dataTransfer.dropEffect="none",B.dataTransfer.effectAllowed="none"):B.dataTransfer.dropEffect="copy"},re=()=>{u.value=new Gr({area:m.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),r.on("vf-explorer-update",()=>e.nextTick(()=>{u.value.clearSelection(),u.value.setSelectables(document.getElementsByClassName("vf-item-"+b))})),u.value.subscribe("predragstart",({event:B,isDragging:j})=>{if(j)f.value=u.value.getSelection().length,u.value.break();else{const $=B.target.offsetWidth-B.offsetX,L=B.target.offsetHeight-B.offsetY;$<15&&L<15&&(u.value.clearSelection(),u.value.break())}}),u.value.subscribe("predragmove",({isDragging:B})=>{B&&u.value.break()}),u.value.subscribe("callback",({items:B,event:j,isDragging:$})=>{r.emit("vf-nodes-selected",S()),f.value=u.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{u.value.setSelection(u.value.getSelection())}),e.onMounted(()=>{e.watch(()=>t.view,()=>r.emit("vf-explorer-update"))}),(B,j)=>(e.openBlock(),e.createElementBlock("div",sn,[i.view=="list"||k.value.length?(e.openBlock(),e.createElementBlock("div",ln,[e.createElementVNode("div",{onClick:j[0]||(j[0]=$=>F("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(p)("Name"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="basename"]])]),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:j[1]||(j[1]=$=>F("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(p)("Size"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="file_size"]])])),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:j[2]||(j[2]=$=>F("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(p)("Date"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="last_modified"]])])),k.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:j[3]||(j[3]=$=>F("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(p)("Filepath"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",cn,[e.createElementVNode("div",{ref_key:"dragImage",ref:g,class:"absolute -z-50 -top-96"},[dn,e.createElementVNode("div",hn,e.toDisplayString(f.value),1)],512)]),e.createElementVNode("div",{class:e.normalizeClass([N.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:m,onContextmenu:j[7]||(j[7]=e.withModifiers($=>e.unref(r).emit("vf-contextmenu-show",{event:$,area:m.value,items:S()}),["self","prevent"]))},[k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(J(),($,L)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:P=>O($),onTouchstart:P=>T($),onTouchend:j[4]||(j[4]=P=>M()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:S(),target:$}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(b),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":$.type,"data-item":JSON.stringify($),"data-index":L},[e.createElementVNode("div",mn,[e.createElementVNode("div",fn,[$.type=="dir"?(e.openBlock(),e.createElementBlock("svg",pn,gn)):(e.openBlock(),e.createElementBlock("svg",yn,bn)),e.createElementVNode("span",vn,e.toDisplayString($.basename),1)]),e.createElementVNode("div",wn,e.toDisplayString($.path),1)])],42,un))),256)):e.createCommentVNode("",!0),i.view=="list"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(J(),($,L)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:P=>O($),onTouchstart:P=>T($),onTouchend:j[5]||(j[5]=P=>M()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:S(),target:$}),["prevent"]),onDragstart:P=>R(P),onDragover:P=>Q(P,$),onDrop:P=>K(P,$),class:e.normalizeClass(["vf-item-"+e.unref(b),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":$.type,"data-item":JSON.stringify($),"data-index":L},[e.createElementVNode("div",_n,[e.createElementVNode("div",xn,[$.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Sn,Dn)):(e.openBlock(),e.createElementBlock("svg",En,Nn)),e.createElementVNode("span",Vn,e.toDisplayString($.basename),1)]),e.createElementVNode("div",Cn,e.toDisplayString($.file_size?e.unref(Jr)($.file_size):""),1),e.createElementVNode("div",Mn,e.toDisplayString(e.unref(Zr)($.last_modified)),1)])],42,kn))),256)):e.createCommentVNode("",!0),i.view=="grid"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(J(!1),($,L)=>{var P,q;return e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:Y=>O($),onTouchstart:Y=>T($),onTouchend:j[6]||(j[6]=Y=>M()),onContextmenu:e.withModifiers(Y=>e.unref(r).emit("vf-contextmenu-show",{event:Y,area:m.value,items:S(),target:$}),["prevent"]),onDragstart:Y=>R(Y),onDragover:Y=>Q(Y,$),onDrop:Y=>K(Y,$),class:e.normalizeClass(["vf-item-"+e.unref(b),"border border-transparent hover:bg-neutral-50 m-0.5 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 md:h-24 text-center justify-center select-none"]),"data-type":$.type,"data-item":JSON.stringify($),"data-index":L},[e.createElementVNode("div",null,[e.createElementVNode("div",Bn,[$.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Tn,An)):((P=$.mime_type)!=null?P:"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"h-10 md:h-12 m-auto",src:e.unref(Ze)(e.unref(s)("adapter",t.data.adapter),$.path),alt:""},null,8,On)):(e.openBlock(),e.createElementBlock("svg",jn,Pn)),((q=$.mime_type)!=null?q:"").startsWith("image")?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",In,e.toDisplayString(o($.extension)),1))]),e.createElementVNode("span",Ln,e.toDisplayString(l($.basename)),1)])],42,$n)}),256)):e.createCommentVNode("",!0)],34),e.createVNode(on)]))}}),Rn={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Hn={class:"flex leading-5 items-center"},Un=["aria-label"],Fn=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})],-1)],Kn=["value"],Yn={class:"ml-3"},Wn={key:0},Xn={class:"ml-1"},qn={class:"flex leading-5 items-center"},Gn={value:"",disabled:""},Jn=e.createElementVNode("option",{value:"tr"},"Turkish",-1),Zn=e.createElementVNode("option",{value:"en"},"English",-1),Qn=e.createElementVNode("option",{value:"fr"},"French",-1),eo=["aria-label"],to=[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)],ro=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(i){var b;const t=i,r=e.inject("emitter"),{getStore:a,setStore:s}=e.inject("storage"),o=e.ref(0),l=e.ref((b=a("adapter"))!=null?b:t.data.adapter),{t:m,changeLocale:g}=e.inject("i18n"),f=e.ref(a("locale","")),u=()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:l.value}}),s("adapter",l.value)};r.on("vf-nodes-selected",N=>{o.value=N.length});const p=e.ref("");return r.on("vf-search-query",({newQuery:N})=>{p.value=N}),(N,k)=>(e.openBlock(),e.createElementBlock("div",Rn,[e.createElementVNode("div",Hn,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(m)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},Fn,8,Un),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":k[0]||(k[0]=D=>l.value=D),onChange:u,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.data.storages,D=>(e.openBlock(),e.createElementBlock("option",{value:D},e.toDisplayString(D),9,Kn))),256))],544),[[e.vModelSelect,l.value]]),e.createElementVNode("div",Yn,[p.value.length?(e.openBlock(),e.createElementBlock("span",Wn,e.toDisplayString(i.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Xn,e.toDisplayString(o.value>0?o.value+" "+e.unref(m)("item(s) selected."):""),1)])]),e.createElementVNode("div",qn,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":k[1]||(k[1]=D=>f.value=D),onChange:k[2]||(k[2]=D=>e.unref(g)(D.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",Gn,e.toDisplayString(e.unref(m)("Language")),1),Jn,Zn,Qn],544),[[e.vModelSelect,f.value]]),e.createElementVNode("span",{"aria-label":e.unref(m)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:k[3]||(k[3]=D=>e.unref(r).emit("vf-modal-show",{type:"message",title:"Vuefinder 1.0",message:e.unref(m)("Vuefinder is a file manager component for vue 3.")}))},to,8,eo)])]))}}),no=(i,t=0,r=!1)=>{let a;return(...s)=>{r&&!a&&i(...s),clearTimeout(a),a=setTimeout(()=>{i(...s)},t)}},oo=(i,t,r)=>{const a=e.ref(i);return e.customRef((o,l)=>({get(){return o(),a.value},set:no(m=>{a.value=m,l()},t,r)}))},ao={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-xs"},io=["aria-label"],so=[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)],lo=["onClick"],co=[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)],ho={class:"flex leading-5"},uo=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),mo=["title","onClick"],fo={key:1,class:"flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},po=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),go=["onKeydown","placeholder"],yo=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],bo=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:a}=e.inject("storage"),s=e.ref(null),o=e.ref([]),l=e.ref(!1),m=e.ref(null),{t:g}=e.inject("i18n");r.on("vf-explorer-update",()=>{var O;let M=[],T=[];s.value=(O=t.data.dirname)!=null?O:a("adapter","local")+"://",s.value.length==0&&(o.value=[]),s.value.replace(a("adapter","local")+"://","").split("/").forEach(function(C){M.push(C),M.join("/")!=""&&T.push({basename:C,name:C,path:a("adapter","local")+"://"+M.join("/"),type:"dir"})}),T.length>4&&(T=T.slice(-5),T[0].name=".."),o.value=T});const f=()=>{l.value=!1,p.value=""};r.on("vf-search-exit",()=>{f()});const u=()=>{l.value=!0,e.nextTick(()=>m.value.focus())},p=oo("",400);e.watch(p,M=>{r.emit("vf-toast-clear"),r.emit("vf-search-query",{newQuery:M})});const b=()=>o.value.length&&!l.value,N=M=>{var O;M.preventDefault();let T=JSON.parse(M.dataTransfer.getData("items"));if(T.find(C=>C.storage!=a("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:T,to:(O=o.value[o.value.length-2])!=null?O:{path:a("adapter","local")+"://"}}})},k=M=>{M.preventDefault(),b()?M.dataTransfer.dropEffect="copy":(M.dataTransfer.dropEffect="none",M.dataTransfer.effectAllowed="none")},D=()=>{p.value==""&&f()};return(M,T)=>(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("span",{"aria-label":e.unref(g)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:T[0]||(T[0]=O=>k(O)),onDrop:T[1]||(T[1]=O=>N(O)),onClick:T[2]||(T[2]=O=>{var C,J;return!b()||e.unref(r).emit("vf-fetch",{params:{q:"index",adapter:i.data.adapter,path:(J=(C=o.value[o.value.length-2])==null?void 0:C.path)!=null?J:e.unref(a)("adapter","local")+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",b()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},so,34))],8,io),l.value?(e.openBlock(),e.createElementBlock("div",fo,[po,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,onKeydown:e.withKeys(f,["esc"]),onBlur:D,"onUpdate:modelValue":T[4]||(T[4]=O=>e.isRef(p)?p.value=O:null),placeholder:e.unref(g)("Search anything.."),class:"py-0 px-2 w-full border-0 ring-0 outline-0 text-sm text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,go),[[e.vModelText,e.unref(p)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:f,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},yo))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(u,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[3]||(T[3]=O=>e.unref(r).emit("vf-fetch",{params:{q:"index",adapter:i.data.adapter}})),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},co)),e.createElementVNode("div",ho,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(O,C)=>(e.openBlock(),e.createElementBlock("div",{key:C},[uo,e.createElementVNode("span",{class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer",title:O.basename,onClick:J=>e.unref(r).emit("vf-fetch",{params:{q:"index",adapter:i.data.adapter,path:O.path}})},e.toDisplayString(O.name),9,mo)]))),128))])],8,lo))]))}}),vo=["onClick"],wo=e.createElementVNode("span",{class:"px-1"},null,-1),ko=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(i){const t=i,r=e.inject("emitter"),a=e.ref(null),{apiUrl:s}=ie(),o=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),l=e.ref([]);r.on("vf-context-selected",b=>{l.value=b});const{t:m}=e.inject("i18n"),g={newfolder:{title:()=>m("New Folder"),action:()=>{r.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>m("Delete"),action:()=>{r.emit("vf-modal-show",{type:"delete",items:l})}},refresh:{title:()=>m("Refresh"),action:()=>{r.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>m("Preview"),action:()=>{r.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:l.value[0]})}},open:{title:()=>m("Open"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].path}})}},openDir:{title:()=>m("Open containing folder"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].dir}})}},download:{title:()=>m("Download"),action:()=>{const b=s.value+"?"+pe({q:"download",adapter:l.value[0].adapter,path:l.value[0].path});r.emit("vf-download",b)}},archive:{title:()=>m("Archive"),action:()=>{r.emit("vf-modal-show",{type:"archive",items:l})}},unarchive:{title:()=>m("Unarchive"),action:()=>{r.emit("vf-modal-show",{type:"unarchive",items:l})}},rename:{title:()=>m("Rename"),action:()=>{r.emit("vf-modal-show",{type:"rename",items:l})}}},f=b=>{r.emit("vf-contextmenu-hide"),b.action()},u=e.ref("");r.on("vf-search-query",({newQuery:b})=>{u.value=b}),r.on("vf-contextmenu-show",({event:b,area:N,items:k,target:D=null})=>{if(o.items=[],u.value)if(D)o.items.push(g.openDir),r.emit("vf-context-selected",[D]),console.log("search item selected");else return;else!D&&!u.value?(o.items.push(g.refresh),o.items.push(g.newfolder),r.emit("vf-context-selected",[]),console.log("no files selected")):k.length>1&&k.some(M=>M.path===D.path)?(o.items.push(g.refresh),o.items.push(g.archive),o.items.push(g.delete),r.emit("vf-context-selected",k),console.log(k.length+" selected (more than 1 item.)")):(D.type=="dir"?o.items.push(g.open):(o.items.push(g.preview),o.items.push(g.download)),o.items.push(g.rename),D.mime_type=="application/zip"?o.items.push(g.unarchive):o.items.push(g.archive),o.items.push(g.delete),r.emit("vf-context-selected",[D]),console.log(D.type+" is selected"));p(b,N)}),r.on("vf-contextmenu-hide",()=>{o.active=!1});const p=(b,N)=>{o.active=!0,e.nextTick(()=>{let k=N.getBoundingClientRect(),D=b.pageX,M=b.pageY,T=a.value.offsetHeight,O=a.value.offsetWidth;D=k.right-b.pageX+window.scrollX<O?D-O:D,M=k.bottom-b.pageY+window.scrollY<T?M-T:M,o.positions={left:D+"px",top:M+"px"}})};return(b,N)=>o.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:a,style:e.normalizeStyle(o.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,k=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:k.title,onClick:D=>f(k)},[wo,e.createElementVNode("span",null,e.toDisplayString(k.title()),1)],8,vo))),128))],4)):e.createCommentVNode("",!0)}}),_o=(i,t)=>{const r=i[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((a,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function xo(i){const t=await _o(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>Js),"../locales/tr.json":()=>Promise.resolve().then(()=>Zs)}),`../locales/${i}.json`);return JSON.parse(t.default)}function So(i,t){const{getStore:r,setStore:a}=Je(i),s=["en","tr"],o=e.ref({}),l=f=>{s.includes(f)||(console.log("The selected locale is not yet supported. The fallback language is set as 'en'"),f="en"),xo(f).then(u=>{o.value=u,a("locale",f),a("translations",u),console.log(f+" is loaded.")})};r("locale")?o.value=r("translations"):l(t);const m=(f,...u)=>u.length?m(f=f.replace("%s",u.shift()),...u):f;function g(f,...u){return o.value.hasOwnProperty(f)?m(o.value[f],...u):f}return{t:g,support_locales:s,changeLocale:l}}const Do=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Eo=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"},ajaxData:{type:Object,default:{}}},setup(i){const t=i,r=br(),{setStore:a,getStore:s}=Je(t.id);e.provide("emitter",r),e.provide("storage",Je(t.id)),e.provide("ajaxData",t.ajaxData);const o=So(t.id,t.locale);e.provide("i18n",o);const{apiUrl:l,setApiUrl:m}=ie();m(t.url);const g=e.reactive({adapter:"local",storages:[],dirname:".",files:[]}),f=e.ref(s("viewport","grid")),u=e.ref(s("darkMode",t.dark));r.on("vf-darkMode-toggle",()=>{u.value=!u.value,a("darkMode",u.value)});const p=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{p.value=!p.value,a("full-screen",p.value)}),r.on("vf-view-toggle",k=>{f.value=k});const b=e.reactive({active:!1,type:"delete",data:{}});r.on("vf-modal-close",()=>{b.active=!1}),r.on("vf-modal-show",k=>{b.active=!0,b.type=k.type,b.data=k});const N=k=>{Object.assign(g,k),r.emit("vf-nodes-selected",{}),r.emit("vf-explorer-update")};return r.on("vf-fetch",({params:k,onSuccess:D=null,onError:M=null})=>{Le(l.value,{params:k}).then(T=>{r.emit("vf-modal-close"),N(T),D(T)}).catch(T=>{M&&M(T)})}),r.on("vf-download",k=>{document.getElementById("download_frame").src=k,r.emit("vf-modal-close")}),e.onMounted(()=>{r.emit("vf-fetch",{params:{q:"index",adapter:s("adapter",g.adapter)}})}),(k,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(u.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([p.value?"fixed w-screen inset-0 z-20":"relative","border flex flex-col rounded-md bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(p.value?"":"max-height: "+i.maxHeight),onMousedown:D[0]||(D[0]=M=>e.unref(r).emit("vf-contextmenu-hide"))},[e.createVNode(Xr,{data:g},null,8,["data"]),e.createVNode(bo,{data:g},null,8,["data"]),e.createVNode(zn,{view:f.value,data:g},null,8,["view","data"]),e.createVNode(ro,{data:g},null,8,["data"])],38),b.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+b.type),{key:0,selection:b.data,current:g},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(ko,{current:g},null,8,["current"]),Do],2))}}),No=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1),Vo={class:"fixed z-10 inset-0 overflow-y-auto"},Co={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl sm:w-full"},Mo={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},$o={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},se={__name:"ModalLayout",setup(i){const t=e.inject("emitter");return e.onMounted(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus()}),(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:a[1]||(a[1]=e.withKeys(s=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[No,e.createElementVNode("div",Vo,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:a[0]||(a[0]=e.withModifiers(s=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Co,[e.createElementVNode("div",Mo,[e.renderSlot(r.$slots,"default")]),e.createElementVNode("div",$o,[e.renderSlot(r.$slots,"buttons")])])],32)])],32))}},Bo=["aria-label"],To=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)],le=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},setup(i){var l;const{t}=e.inject("i18n"),r=e.ref(!1),a=e.ref(null),s=e.ref((l=a.value)==null?void 0:l.strMessage);e.watch(s,()=>r.value=!1);const o=()=>r.value=!0;return(m,g)=>(e.openBlock(),e.createElementBlock("div",null,[r.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",i.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(m.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:o,"aria-label":e.unref(t)("Close"),"data-microtip-position":"top-left",role:"tooltip"},To,8,Bo)],2))]))}}),Ao={class:"sm:flex sm:items-start"},Oo=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),jo={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Po={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Io={class:"mt-2"},Lo={class:"text-sm text-gray-500"},zo={class:"flex text-sm text-gray-800 dark:text-gray-400"},Ro={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"},Ho=[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)],Uo={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"},Fo=[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)],Ko={class:"ml-1.5"},Yo={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},Wo=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:a}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(t.selection.items),l=e.ref(""),m=()=>{o.value.length&&r.emit("vf-fetch",{params:{q:"delete",adapter:a("adapter","local"),path:t.current.dirname,items:JSON.stringify(o.value.map(({path:g,type:f})=>({path:g,type:f})))},onSuccess:()=>{r.emit("vf-toast-push",{label:s("Files deleted.")})},onError:g=>{l.value=s(g.message)}})};return(g,f)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:f[0]||(f[0]=u=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1),e.createElementVNode("div",Yo,e.toDisplayString(e.unref(s)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ao,[Oo,e.createElementVNode("div",jo,[e.createElementVNode("h3",Po,e.toDisplayString(e.unref(s)("Delete files")),1),e.createElementVNode("div",Io,[e.createElementVNode("p",Lo,e.toDisplayString(e.unref(s)("Are you sure you want to delete these files ?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,u=>(e.openBlock(),e.createElementBlock("p",zo,[u.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ro,Ho)):(e.openBlock(),e.createElementBlock("svg",Uo,Fo)),e.createElementVNode("span",Ko,e.toDisplayString(u.basename),1)]))),256)),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Xo={class:"sm:flex sm:items-start"},qo=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"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),Go={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Jo={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Zo={class:"mt-2"},Qo={class:"text-sm text-gray-500"},ea=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(i){const t=e.inject("emitter"),{t:r}=e.inject("i18n");return(a,s)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[0]||(s[0]=o=>e.unref(t).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(r)("Close")),1)]),default:e.withCtx(()=>{var o,l,m,g;return[e.createElementVNode("div",Xo,[qo,e.createElementVNode("div",Go,[e.createElementVNode("h3",Jo,e.toDisplayString((l=(o=i.selection)==null?void 0:o.title)!=null?l:"Title"),1),e.createElementVNode("div",Zo,[e.createElementVNode("p",Qo,e.toDisplayString((g=(m=i.selection)==null?void 0:m.message)!=null?g:"Message")+".",1)])])])]}),_:1}))}}),ta={class:"sm:flex sm:items-start"},ra=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),na={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},oa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},aa={class:"mt-2"},ia={class:"text-sm text-gray-500"},sa=["onKeyup","placeholder"],la=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:a}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),l=e.ref(""),m=()=>{o.value!=""&&r.emit("vf-fetch",{params:{q:"newfolder",adapter:a("adapter","local"),path:t.current.dirname,name:o.value},onSuccess:()=>{r.emit("vf-toast-push",{label:s("%s is created.",o.value)})},onError:g=>{l.value=s(g.message)}})};return(g,f)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Create")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=u=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ta,[ra,e.createElementVNode("div",na,[e.createElementVNode("h3",oa,e.toDisplayString(e.unref(s)("New Folder")),1),e.createElementVNode("div",aa,[e.createElementVNode("p",ia,e.toDisplayString(e.unref(s)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=u=>o.value=u),onKeyup:e.withKeys(m,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("Folder Name"),type:"text"},null,40,sa),[[e.vModelText,o.value]]),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ca={class:"sm:flex sm:items-start"},da=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-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),ha={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ua={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ma={class:"mt-2"},fa={class:"text-sm text-gray-500"},pa=["onKeyup","placeholder"],ga=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:a}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),l=e.ref(""),m=()=>{o.value!=""&&r.emit("vf-fetch",{params:{q:"newfile",adapter:a("adapter","local"),path:t.current.dirname,name:o.value},onSuccess:()=>{r.emit("vf-toast-push",{label:s("%s is created.",o.value)})},onError:g=>{l.value=s(g.message)}})};return(g,f)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},"Create!"),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=u=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},"Cancel")]),default:e.withCtx(()=>[e.createElementVNode("div",ca,[da,e.createElementVNode("div",ha,[e.createElementVNode("h3",ua,e.toDisplayString(e.unref(s)("New File")),1),e.createElementVNode("div",ma,[e.createElementVNode("p",fa,e.toDisplayString(e.unref(s)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=u=>o.value=u),onKeyup:e.withKeys(m,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("File Name"),type:"text"},null,40,pa),[[e.vModelText,o.value]]),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ya={class:"flex"},ba={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},va={class:"ml-auto mb-2"},wa={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"},ka={key:1},_a={__name:"Text",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,a=e.ref(""),s=e.ref(""),o=e.ref(null),l=e.ref(!1),{apiUrl:m}=ie(),g=e.ref(""),f=e.ref(!1),{t:u}=e.inject("i18n");e.onMounted(()=>{Le(m.value,{params:{q:"preview",adapter:r.selection.adapter,path:r.selection.item.path},json:!1}).then(k=>{a.value=k,t("load")})});const p=()=>{l.value=!l.value,s.value=a.value,l.value==!0&&e.nextTick(()=>{o.value.focus()})},b=e.inject("ajaxData"),N=()=>{g.value="",f.value=!1,Le(m.value,{method:"POST",params:{q:"save",adapter:r.selection.adapter,path:r.selection.item.path,content:s.value},json:!1,...b}).then(k=>{g.value=u("Updated."),a.value=k,t("load"),l.value=!l.value}).catch(k=>{g.value=u(k.message),f.value=!0})};return(k,D)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ya,[e.createElementVNode("div",ba,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",va,[l.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:N,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(u)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:D[0]||(D[0]=M=>p())},e.toDisplayString(l.value?e.unref(u)("Cancel"):e.unref(u)("Edit")),1)])]),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",ka,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:o,"onUpdate:modelValue":D[1]||(D[1]=M=>s.value=M),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,s.value]])])):(e.openBlock(),e.createElementBlock("pre",wa,e.toDisplayString(a.value),1)),g.value.length?(e.openBlock(),e.createBlock(le,{key:2,error:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},Sc="";/*!
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L=function(c,n,y){var d=c.x,v=c.y,w=y.x,_=y.y,x={"+":{x:d+w,y:v+_},"-":{x:d-w,y:v-_},"*":{x:d*w,y:v*_},"/":{x:d/w,y:v/_}};return x[n]},P=function(c){return{x:c.left,y:c.top}},q=function(c){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:c.x,top:c.y,right:c.x,bottom:c.y,width:n,height:n}},Y=function(c){return{x:c,y:c}},je=function(h,c,n){window.addEventListener("resize",c),window.addEventListener("scroll",c),h.forEach(function(y,d){n.observe(y,{childList:d!==0,attributes:!0})})},Pe=function(h){var c=De(h);return c.x||c.y?!0:h instanceof HTMLDocument?h.body?!!(h.body.scrollTop=1):!!(h.documentElement.scrollTop=1):!!(h.scrollTop=1)},Ye=function(h){var c=document.createElement("div");return c.style.position="fixed",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="999999999999999999",c.classList.add(h),c},We=function(h){var c=document.createElement("div");return c.style.position="absolute",h||(c.style.background="rgba(0, 0, 255, 0.1)",c.style.border="1px solid rgba(0, 0, 255, 0.45)",c.style.display="none",c.style.pointerEvents="none"),c},Xe=function(h,c){var n;return function(){for(var y=arguments.length,d=new Array(y),v=0;v<y;v++)d[v]=arguments[v];var w=function(){n=null,h.apply(void 0,d)};clearTimeout(n),n=setTimeout(w,c)}},Se=function(){var h,c,n,y;return{y:((h=document.body)===null||h===void 0?void 0:h.scrollTop)||((c=document.documentElement)===null||c===void 0?void 0:c.scrollTop)||0,x:((n=document.body)===null||n===void 0?void 0:n.scrollLeft)||((y=document.documentElement)===null||y===void 0?void 0:y.scrollLeft)||0}},gt=function(h,c){if(h instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=h.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(h.clientWidth||n.width)*c,height:(h.clientHeight||n.height)*c}},De=function(h){return!h||h instanceof Document?Se():{x:h.scrollLeft>=0?h.scrollLeft:Se().x,y:h.scrollTop>=0?h.scrollTop:Se().y}},Zt=function(h){var c=h.elementRect,n=h.containerRect,y=h.tolerance,d=y===void 0?{x:0,y:0}:y,v=[];return c.top-d.y<n.top&&v.push("top"),c.left-d.x<n.left&&v.push("left"),c.bottom+d.y>n.bottom&&v.push("bottom"),c.right+d.y>n.right&&v.push("right"),v},Qs=function(h){var c=h.event;return{x:c.clientX,y:c.clientY}},el=function(h){var c=h.scrollAmount,n=h.initialPointerPos,y=h.pointerPos,d={};return y.x>n.x-c.x?(d.left=n.x-c.x,d.width=y.x-n.x+c.x):(d.left=y.x,d.width=n.x-y.x-c.x),y.y>n.y-c.y?(d.top=n.y-c.y,d.height=y.y-n.y+c.y):(d.top=y.y,d.height=n.y-y.y-c.y),d},Qt=function(c){var n={x:0,y:0},y=window.getComputedStyle(c);if(!y.transform||y.transform==="none")return n;if(y.transform.indexOf("3d")>=0){var d=y.transform.trim().match(/matrix3d\((.*?)\)/);if(d&&d.length){var v,w=(v=d[1])===null||v===void 0?void 0:v.split(",");n.x=parseInt(w[12])||0,n.y=parseInt(w[13])||0}return n}else{var _=y.transform.trim().match(/matrix\((.*?)\)/);if(_&&_.length){var x,V=(x=_[1])===null||x===void 0?void 0:x.split(",");n.x=parseInt(V[4])||0,n.y=parseInt(V[5])||0}return n}},tl=function(c){var n=c.style.transform;if(!n||n.indexOf("translate")<0)return Qt(c);var y={x:0,y:0},d=n.trim().match(/translate[3dD]*?\(.*?\)/);if(d){var v,w=(v=d[0])===null||v===void 0?void 0:v.split("(");if(w){var _,x=(_=w[1])===null||_===void 0?void 0:_.split(",");y.x=parseInt(x[0])||0,y.y=parseInt(x[1])||0}}return!y.x&&!y.x?Qt(c):y},rl=function(c){var n=c.style,y={x:parseInt(n.left)||0,y:parseInt(n.top)||0};if(!y.x&&!y.x){var d=window.getComputedStyle(c);return{x:parseInt(d.left)||0,y:parseInt(d.top)||0}}return y},nl=function(h,c){return c?tl(h):rl(h)},ol=function(h){var c=h.element,n=h.edges,y=h.elementRect,d=h.containerRect,v=h.elementPos,w=h.useTransform;n.includes("top")&&Ie(c,{y:v.y+d.top-y.top,x:v.x},w),n.includes("left")&&Ie(c,{y:v.y,x:v.x+d.left-y.left},w),n.includes("bottom")&&Ie(c,{y:v.y+d.bottom-y.bottom,x:v.x},w),n.includes("right")&&Ie(c,{y:v.y,x:v.x+d.right-y.right},w)},er=function(h){var c=h.computedStyle,n=h.node,y=c.position,d=y==="absolute"||y==="relative"||y==="fixed";!(n instanceof HTMLDocument)&&!d&&(n.style.position="relative")},al=function(h){var c=h.shiftKey,n=h.keyboardDragSpeed,y=h.zoom,d=h.key,v=h.dragKeys,w=h.scrollDiff,_=h.canScroll,x=h.scrollCallback,V={x:0,y:0},E=c?n*4*y:n*y;return v.left.includes(d)&&(V.x=w.x||-E,!c&&!w.x&&_&&x(["left"],n)),v.right.includes(d)&&(V.x=w.x||E,!c&&!w.x&&_&&x(["right"],n)),v.up.includes(d)&&(V.y=w.y||-E,!c&&!w.y&&_&&x(["top"],n)),v.down.includes(d)&&(V.y=w.y||E,!c&&!w.y&&_&&x(["bottom"],n)),V},il=function(h){var c=h.element,n=h.force,y=h.multiSelectionToggle,d=h.SelectedSet,v=h.hoverClassName;c.classList.contains(v)&&!n||(d.has(c)?y&&d.delete(c):d.add(c),c.classList.add(v))},sl=function(h){var c=h.element,n=h.force,y=h.SelectedSet,d=h.PrevSelectedSet,v=h.hoverClassName;if(!c.classList.contains(v)&&!n)return!1;var w=y.has(c),_=d.has(c);w&&!_?y.delete(c):!w&&_&&y.add(c),c.classList.remove(v)},yt=function(h,c){return h.left<c.right&&h.right>c.left&&h.top<c.bottom&&h.bottom>c.top},tr=function(h){var c=h.element,n=h.posDirection,y=h.containerRect,d=h.useTransform,v=nl(c,d),w=L(v,"+",n);Ie(c,w,d);var _=c.getBoundingClientRect(),x=Zt({elementRect:_,containerRect:y});ol({element:c,edges:x,elementRect:_,containerRect:y,elementPos:w,useTransform:d})},ll=function(h,c){window.removeEventListener("resize",c),window.removeEventListener("scroll",c),h.disconnect()},cl=function(h,c,n){if(!!c.length){var y=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,d=h instanceof HTMLDocument?y||document.body:h,v=c.includes("top")&&d.scrollTop>0,w=c.includes("bottom")&&d.scrollTop<d.scrollHeight,_=c.includes("left")&&d.scrollLeft>0,x=c.includes("right")&&d.scrollLeft<d.scrollWidth;v&&(d.scrollTop-=1*n),w&&(d.scrollTop+=1*n),_&&(d.scrollLeft-=1*n),x&&(d.scrollLeft+=1*n)}},Ie=function(h,c,n){if(n){var y=h.style.transform;h.style.transform="translate3d(".concat(c.x,"px,").concat(c.y,"px,1px) ").concat(y.replace(/translate.*?\)/g,""))}else h.style.left="".concat(c.x,"px"),h.style.top="".concat(c.y,"px");return h},dl=function(h){for(var c=h.subscribe,n=h.publish,y=h.Interaction,d=h.SelectedSet,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(E){return E.event}}],"Interaction:end":[{name:"callback"}]},w=function(){var E=J(x[_],2),A=E[0],I=E[1];["pre",!1].forEach(function(W){return c(W?"".concat(A,":").concat(W):A,function(ne){return I.forEach(function(G){return(!G.condition||G.condition(ne))&&n(W?"".concat(W).concat(G.name):G.name,m({items:d.elements,isDragging:y.isDragging},ne))})})})},_=0,x=Object.entries(v);_<x.length;_++)w()},Ee=function(h){return h?!Array.isArray(h)&&(h instanceof HTMLElement||h instanceof SVGElement)?[h]:F(h):[]},rr=function(h,c){h.style.left="".concat(c.left,"px"),h.style.top="".concat(c.top,"px"),h.style.width="".concat(c.width,"px"),h.style.height="".concat(c.height,"px")},hl=function(){function h(c){var n=this,y=c.area,d=c.PS,v=c.zoom;r(this,h),o(this,"_modificationCallback",void 0),o(this,"_modificationObserver",void 0),o(this,"_zoom",void 0),o(this,"_node",void 0),o(this,"_parentNodes",void 0),o(this,"_computedStyle",void 0),o(this,"_computedBorder",void 0),o(this,"_rect",void 0),o(this,"setArea",function(w){n._node=w,er({computedStyle:n.computedStyle,node:n._node}),setTimeout(function(){n.PubSub.publish("Area:modified:pre",{item:n}),n.reset(),n.PubSub.publish("Area:modified",{item:n})})}),o(this,"start",function(){je(n.parentNodes,n._modificationCallback,n._modificationObserver)}),o(this,"reset",function(){n._computedStyle=void 0,n._rect=void 0,n._computedBorder=void 0,n._parentNodes=void 0}),o(this,"stop",function(){ll(n._modificationObserver,n._modificationCallback),n.reset()}),o(this,"scroll",function(w,_){var x={scroll_directions:w,scroll_multiplier:_};n.PubSub.publish("Area:scroll:pre",x),cl(n._node,w,_),n.PubSub.publish("Area:scroll",x)}),this._zoom=v,this.PubSub=d,this.setArea(y),this._modificationCallback=Xe(function(w){n.PubSub.publish("Area:modified:pre",{event:w,item:n}),n.reset(),n.PubSub.publish("Area:modified",{event:w,item:n})},60),this._modificationObserver=new MutationObserver(this._modificationCallback),this.PubSub.subscribe("Interaction:init",this.start),this.PubSub.subscribe("Interaction:end",this.reset)}return s(h,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof HTMLDocument?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=gt(this.HTMLNode,this._zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;var n=function y(d){var v,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=(v=d[w])===null||v===void 0?void 0:v.parentNode;return _?(d.push(_),w++,y(d,w)):d};return this._parentNodes=n([this.HTMLNode]),this._parentNodes}}]),h}(),ul=function(){function h(c){var n=this,y=c.DS,d=c.dragKeys,v=c.draggability,w=c.keyboardDrag,_=c.keyboardDragSpeed,x=c.useTransform,V=c.zoom;r(this,h),o(this,"_useTransform",void 0),o(this,"_prevCursorPos",void 0),o(this,"_prevScrollPos",void 0),o(this,"_elements",[]),o(this,"_draggability",void 0),o(this,"_dragKeys",void 0),o(this,"_dragKeysFlat",void 0),o(this,"_keyboardDrag",void 0),o(this,"_keyboardDragSpeed",void 0),o(this,"_zoom",void 0),o(this,"keyboardDrag",function(E){var A=E.event,I=E.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability||n.DS.continue)){var W={event:A,isDragging:!0,isDraggingKeyboard:!0};n.DS.publish(["Interaction:start:pre","Interaction:start"],W),n._elements=n.DS.getSelection(),n.handleZIndex(!0);var ne=al({shiftKey:n.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:n._keyboardDragSpeed,zoom:n._zoom,key:I,scrollCallback:n.DS.Area.scroll,scrollDiff:n._scrollDiff,canScroll:n.DS.stores.ScrollStore.canScroll,dragKeys:n._dragKeys});n._elements.forEach(function(G){return tr({element:G,posDirection:ne,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})}),n.DS.publish(["Interaction:update:pre","Interaction:update"],W)}}),o(this,"keyboardEnd",function(E){var A=E.event,I=E.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability)){var W={event:A,isDragging:n._draggability,isDraggingKeyboard:!0};n.DS.publish(["Interaction:end:pre","Interaction:end"],W)}}),o(this,"start",function(E){var A=E.isDragging,I=E.isDraggingKeyboard;!A||I||(n._prevCursorPos=null,n._prevScrollPos=null,n._elements=n.DS.getSelection(),n.handleZIndex(!0))}),o(this,"stop",function(E){E!=null&&E.isKeyboard||(n._prevCursorPos=null,n._prevScrollPos=null,n.handleZIndex(!1),n._elements=[])}),o(this,"update",function(E){var A=E.isDragging,I=E.isDraggingKeyboard;if(!(!A||!n._elements.length||I||n.DS.continue)){var W=L(n._cursorDiff,"+",n._scrollDiff);n._elements.forEach(function(ne){return tr({element:ne,posDirection:W,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})})}}),o(this,"handleZIndex",function(E){n._elements.forEach(function(A){return A.style.zIndex="".concat((parseInt(A.style.zIndex)||0)+E?9999:-9998)})}),this.DS=y,this._useTransform=x,this._keyboardDragSpeed=_,this._keyboardDrag=w,this._zoom=V,this._draggability=v,this._dragKeys={up:d.up.map(function(E){return E.toLowerCase()}),down:d.down.map(function(E){return E.toLowerCase()}),left:d.left.map(function(E){return E.toLowerCase()}),right:d.right.map(function(E){return E.toLowerCase()})},this._dragKeysFlat=[].concat(F(this._dragKeys.up),F(this._dragKeys.down),F(this._dragKeys.left),F(this._dragKeys.right)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return s(h,[{key:"_cursorDiff",get:function(){var n=this.DS.stores.PointerStore.currentVal,y=this._prevCursorPos?L(n,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=n,y}},{key:"_scrollDiff",get:function(){var n=this.DS.stores.ScrollStore.currentVal,y=this._prevScrollPos?L(n,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=n,y}}]),h}(),ml=function(){function h(c){var n=this,y=c.DS,d=c.areaElement,v=c.draggability,w=c.immediateDrag,_=c.selectableClass;r(this,h),o(this,"_areaElement",void 0),o(this,"_draggability",void 0),o(this,"_immediateDrag",void 0),o(this,"_selectableClass",void 0),o(this,"isInteracting",void 0),o(this,"isDragging",void 0),o(this,"init",function(){return n.DS.publish("Interaction:init:pre",{})}),o(this,"_init",function(){n.stop(),n._areaElement.addEventListener("mousedown",n.start),n._areaElement.addEventListener("touchstart",n.start,{passive:!1}),n.DS.publish("Interaction:init",{})}),o(this,"start",function(x){return n.DS.publish("Interaction:start:pre",{event:x,isDragging:n.isDragging})}),o(this,"_start",function(x){x.type==="touchstart"&&x.preventDefault(),n._canInteract(x)&&(n.isInteracting=!0,n.isDragging=n.isDragEvent(x),n.DS.publish("Interaction:start",{event:x,isDragging:n.isDragging}),document.addEventListener("mouseup",n.reset),document.addEventListener("touchend",n.reset))}),o(this,"isDragEvent",function(x){var V=x.target.closest(".".concat(n._selectableClass));return!n._draggability||n.DS.stores.KeyStore.isMultiSelectKeyPressed(x)||!V?!1:(n._immediateDrag&&(n.DS.SelectedSet.size?n.DS.SelectedSet.has(V)||(n.DS.SelectedSet.clear(),n.DS.SelectedSet.add(V)):n.DS.SelectedSet.add(V)),!!n.DS.SelectedSet.has(V))}),o(this,"onClick",function(x){var V=x.event;if(!!n._canInteract(V)&&!(V.detail>0)){var E=n.DS,A=E.stores,I=A.PointerStore,W=A.KeyStore,ne=E.SelectableSet,G=E.SelectedSet;I.start(V);var Ne=V.target;!ne.has(Ne)||(W.isMultiSelectKeyPressed(V)||G.clear(),G.toggle(Ne),n.reset())}}),o(this,"stop",function(){n.isInteracting=!1,n.isDragging=!1,n._areaElement.removeEventListener("mousedown",n.start),n._areaElement.removeEventListener("touchstart",n.start,{passive:!1}),document.removeEventListener("mouseup",n.reset),document.removeEventListener("touchend",n.reset)}),o(this,"update",function(x){var V=x.event,E=x.scroll_directions,A=x.scroll_multiplier;n.isInteracting&&n.DS.publish(["Interaction:update:pre","Interaction:update"],{event:V,scroll_directions:E,scroll_multiplier:A,isDragging:n.isDragging})}),o(this,"reset",function(x){return n.DS.publish("Interaction:end:pre",{event:x,isDragging:n.isDragging})}),o(this,"_reset",function(x){var V=n.isDragging;n.stop(),n.init(),n.DS.publish("Interaction:end",{event:x,isDragging:V})}),this._areaElement=d,this._draggability=v,this._immediateDrag=w,this._selectableClass=_,this.DS=y,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(x){var V=x.event;return n.start(V)}),this.DS.subscribe("Interaction:start:pre",function(x){var V=x.event;return n._start(V)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(x){var V=x.event;return n._reset(V)}),this.DS.subscribe("Area:scroll",this.update)}return s(h,[{key:"_canInteract",value:function(n){var y=n.clientX===0&&n.clientY===0&&n.detail===0&&n.target;return!(n.button===2||this.isInteracting||n.target&&!this.DS.SelectorArea.isInside(n.target)||!y&&!this.DS.SelectorArea.isClicked(n))}}]),h}(),fl=function h(c){var n=this,y=c.DS;r(this,h),o(this,"subscribers",{}),o(this,"subscribe",function(d,v){return Array.isArray(n.subscribers[d])||(n.subscribers[d]=[]),n.subscribers[d].push(v),n.subscribers[d].length-1}),o(this,"unsubscribe",function(d,v,w){w>=0?n.subscribers[d].splice(w,1):v&&(n.subscribers[d]=n.subscribers[d].filter(function(_){return _!==v}))}),o(this,"publish",function(d,v){Array.isArray(d)?d.forEach(function(w){return n._publish(w,v)}):n._publish(d,v)}),o(this,"_publish",function(d,v){var w=n.subscribers[d];!Array.isArray(w)||(d.includes(":pre")?n._handlePrePublish(w,v):n._handlePublish(w,v))}),o(this,"_handlePublish",function(d,v){for(var w=0,_=d.length;w<_;w++){if(n.DS.stopped)return;d[w](v)}}),o(this,"_handlePrePublish",function(d,v){for(var w=d.length;w--;){if(n.DS.stopped)return;d[w](v)}}),this.DS=y},pl=function(h){g(n,h);var c=T(n);function n(y){var d,v=y.elements,w=y.className,_=y.hoverClassName,x=y.draggability,V=y.useTransform,E=y.DS;return r(this,n),d=c.call(this),o(D(d),"_initElements",void 0),o(D(d),"_className",void 0),o(D(d),"_hoverClassName",void 0),o(D(d),"_useTransform",void 0),o(D(d),"_draggability",void 0),o(D(d),"init",function(){return d._initElements.forEach(function(A){return d.add(A)})}),o(D(d),"clear",function(){return d.forEach(function(A){return d.delete(A)})}),o(D(d),"_onClick",function(A){return d.DS.publish(["Selectable:click:pre","Selectable:click"],{event:A})}),o(D(d),"_onPointer",function(A){return d.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:A})}),o(D(d),"addAll",function(A){return A.forEach(function(I){return d.add(I)})}),o(D(d),"deleteAll",function(A){return A.forEach(function(I){return d.delete(I)})}),d.DS=E,d._initElements=Ee(v),d._className=w,d._hoverClassName=_,d._useTransform=V,d._draggability=x,d.DS.subscribe("Interaction:init",d.init),d}return s(n,[{key:"add",value:function(d){return d.classList.add(this._className),d.addEventListener("click",this._onClick),d.addEventListener("mousedown",this._onPointer),d.addEventListener("touchstart",this._onPointer,{passive:!1}),this._draggability&&!this._useTransform&&er({computedStyle:window.getComputedStyle(d),node:d}),C(f(n.prototype),"add",this).call(this,d)}},{key:"delete",value:function(d){return d.classList.remove(this._className),d.classList.remove(this._hoverClassName),d.removeEventListener("click",this._onClick),d.removeEventListener("mousedown",this._onPointer),d.removeEventListener("touchstart",this._onPointer,{passive:!1}),C(f(n.prototype),"delete",this).call(this,d)}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(k(Set)),gl=function(h){g(n,h);var c=T(n);function n(y){var d,v=y.className,w=y.DS;return r(this,n),d=c.call(this),o(D(d),"_className",void 0),o(D(d),"clear",function(){return d.forEach(function(_){return d.delete(_)})}),o(D(d),"addAll",function(_){return _.forEach(function(x){return d.add(x)})}),o(D(d),"deleteAll",function(_){return _.forEach(function(x){return d.delete(x)})}),d.DS=w,d._className=v,d}return s(n,[{key:"add",value:function(d){if(!C(f(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};return this.DS.publish("Selected:added:pre",v),C(f(n.prototype),"add",this).call(this,d),d.classList.add(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)+1),this.DS.publish("Selected:added",v),this}}},{key:"delete",value:function(d){if(!!C(f(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};this.DS.publish("Selected:removed:pre",v);var w=C(f(n.prototype),"delete",this).call(this,d);return d.classList.remove(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)-1),this.DS.publish("Selected:removed",v),w}}},{key:"toggle",value:function(d){return this.has(d)?this.delete(d):this.add(d),d}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(k(Set)),yl=function(){function h(c){var n=this,y=c.DS,d=c.hoverClassName,v=c.multiSelectToggling;r(this,h),o(this,"_prevSelectedSet",void 0),o(this,"_hoverClassName",void 0),o(this,"_multiSelectToggling",void 0),o(this,"start",function(w){var _=w.event,x=w.isDragging;x||(n._storePrevious(_),n._handleInsideSelection(!0,_))}),o(this,"update",function(w){var _=w.isDragging;_||n.DS.continue||n._handleInsideSelection()}),o(this,"_handleInsideSelection",function(w,_){for(var x=n.DS,V=x.SelectableSet,E=x.SelectorArea,A=x.Selector,I=V.elements.map(function(fe){return[fe,fe.getBoundingClientRect()]}),W=[],ne=[],G=0,Ne=I.length;G<Ne;G++)!E.isInside(I[G][0],I[G][1])||(yt(I[G][1],A.rect)?W.push(I[G][0]):ne.push(I[G][0]));var qe=n.DS.stores.KeyStore.isMultiSelectKeyPressed(_)&&n._multiSelectToggling;n.DS.continue||(W.forEach(function(fe){return il({element:fe,force:w,multiSelectionToggle:qe,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName})}),ne.forEach(function(fe){return sl({element:fe,force:w,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName,PrevSelectedSet:n._prevSelectedSet})}))}),this._hoverClassName=d,this._multiSelectToggling=v,this.DS=y,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(h,[{key:"_storePrevious",value:function(n){var y=this.DS,d=y.stores.KeyStore,v=y.SelectedSet;d.isMultiSelectKeyPressed(n)?this._prevSelectedSet=new Set(v):this._prevSelectedSet=new Set}}]),h}(),bl=function(){function h(c){var n=this,y=c.DS,d=c.selector,v=c.selectorClass,w=c.customStyles;r(this,h),o(this,"_rect",void 0),o(this,"start",function(_){var x=_.isDragging;if(!x){var V=n.DS.stores.PointerStore,E=V.initialValArea;rr(n.HTMLNode,q(E,1)),n.HTMLNode.style.display="block",n._rect=null}}),o(this,"stop",function(){n.HTMLNode.style.width="0",n.HTMLNode.style.height="0",n.HTMLNode.style.display="none"}),o(this,"update",function(_){var x=_.isDragging;if(!(x||n.DS.continue)){var V=n.DS.stores,E=V.ScrollStore,A=V.PointerStore,I=el({scrollAmount:E.scrollAmount,initialPointerPos:A.initialValArea,pointerPos:A.currentValArea});rr(n.HTMLNode,I),n._rect=null}}),this.DS=y,this.HTMLNode=d||We(w),this.HTMLNode.classList.add(v),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(h,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),vl=function(){function h(c){var n=this,y=c.DS,d=c.selectorAreaClass,v=c.autoScrollSpeed,w=c.overflowTolerance;r(this,h),o(this,"_autoScrollSpeed",void 0),o(this,"_scrollInterval",void 0),o(this,"_rect",void 0),o(this,"currentEdges",[]),o(this,"_overflowTolerance",void 0),o(this,"start",function(){return n.applyElements("append")}),o(this,"applyElements",function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",x=document.body?"body":"documentElement",V="".concat(_,"Child");n.HTMLNode[V](n.DS.Selector.HTMLNode),document[x][V](n.HTMLNode)}),o(this,"updatePos",function(){n._rect=null;var _=n.DS.Area.rect,x=n.DS.Area.computedBorder,V=n.HTMLNode.style,E="".concat(_.top+x.top,"px"),A="".concat(_.left+x.left,"px"),I="".concat(_.width,"px"),W="".concat(_.height,"px");V.top!==E&&(V.top=E),V.left!==A&&(V.left=A),V.width!==I&&(V.width=I),V.height!==W&&(V.height=W)}),o(this,"stop",function(_){n.stopAutoScroll(),_&&n.applyElements("remove")}),o(this,"startAutoScroll",function(){n.currentEdges=[],n._scrollInterval=setInterval(function(){return n.handleAutoScroll()},16)}),o(this,"handleAutoScroll",function(){if(!n.DS.continue){var _=n.DS,x=_.stores.PointerStore,V=_.Area;n.currentEdges=Zt({elementRect:q(x.currentVal),containerRect:n.rect,tolerance:n._overflowTolerance}),n.currentEdges.length&&V.scroll(n.currentEdges,n._autoScrollSpeed)}}),o(this,"stopAutoScroll",function(){n.currentEdges=[],clearInterval(n._scrollInterval)}),o(this,"isInside",function(_,x){return n.DS.Area.HTMLNode.contains(_)&&n.DS.stores.ScrollStore.canScroll?!0:yt(n.rect,x||_.getBoundingClientRect())}),this._autoScrollSpeed=v,this._overflowTolerance=w,this.DS=y,this.HTMLNode=Ye(d),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){n.updatePos(),n.stopAutoScroll()})}return s(h,[{key:"isClicked",value:function(n){var y=this.DS.stores.PointerStore,d=n?y.getPointerPosition(n):y.initialVal;return yt({left:d.x,top:d.y,right:d.x,bottom:d.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),wl=function(){function h(c){var n=this,y=c.DS,d=c.multiSelectKeys,v=c.multiSelectMode;r(this,h),o(this,"_multiSelectMode",void 0),o(this,"_multiSelectKeys",void 0),o(this,"_currentValues",new Set),o(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),o(this,"init",function(){document.addEventListener("keydown",n.keydown),document.addEventListener("keyup",n.keyup),window.addEventListener("blur",n.reset)}),o(this,"keydown",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:down:pre",{event:w,key:_}),n._currentValues.add(_),n.DS.publish("KeyStore:down",{event:w,key:_})}),o(this,"keyup",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:up:pre",{event:w,key:_}),n._currentValues.delete(_),n.DS.publish("KeyStore:up",{event:w,key:_})}),o(this,"stop",function(){document.removeEventListener("keydown",n.keydown),document.removeEventListener("keyup",n.reset),window.removeEventListener("blur",n.reset),n.reset()}),o(this,"reset",function(){return n._currentValues.clear()}),this.DS=y,this._multiSelectMode=v,this._multiSelectKeys=d.map(function(w){var _={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"},x=_[w];return x?(console.warn("[DragSelect] ".concat(w,' is deprecated. Use "').concat(x,'" instead. Act Now!. See docs for more info')),x.toLowerCase()):w.toLowerCase()}),this.DS.subscribe("Interaction:init",this.init)}return s(h,[{key:"isMultiSelectKeyPressed",value:function(n){var y=this;return!!(this._multiSelectMode||this.currentValues.some(function(d){return y._multiSelectKeys.includes(d)})||n&&this._multiSelectKeys.some(function(d){return n[y._keyMapping[d]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),h}(),kl=function(){function h(c){var n=this,y=c.DS;r(this,h),o(this,"_isMouseInteraction",!1),o(this,"_initialValArea",void 0),o(this,"_currentValArea",void 0),o(this,"_lastValArea",void 0),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_lastVal",void 0),o(this,"_lastTouch",void 0),o(this,"init",function(){document.addEventListener("mousemove",n.update),document.addEventListener("touchmove",n.update,{passive:!1})}),o(this,"getPointerPosition",function(d){return Qs({event:n._normalizedEvent(d)})}),o(this,"update",function(d){!d||(n.DS.publish("PointerStore:updated:pre",{event:d}),n.currentVal=n.getPointerPosition(d),n._isMouseInteraction&&n.DS.publish("PointerStore:updated",{event:d}))}),o(this,"stop",function(){document.removeEventListener("mousemove",n.update),document.removeEventListener("touchmove",n.update,{passive:!1}),setTimeout(function(){return n._isMouseInteraction=!1},100)}),o(this,"reset",function(d){!d||(n.currentVal=n.lastVal=n.getPointerPosition(d),n.stop(),n.init())}),this.DS=y,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(d){var v=d.event;return n.start(v)}),this.DS.subscribe("Interaction:end",function(d){var v=d.event;return n.reset(v)})}return s(h,[{key:"start",value:function(n){!n||(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(n))}},{key:"_normalizedEvent",value:function(n){return"touches"in n&&n.type!=="touchend"&&(this._lastTouch=n),"touches"in n?this._lastTouch.touches[0]:n}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(n){this._initialVal=n,this._initialValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(n){this._currentVal=n,this._currentValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(n){this._lastVal=n,this._lastValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}}]),h}(),_l=function(){function h(c){var n=this,y=c.DS,d=c.areaElement,v=c.zoom;r(this,h),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_areaElement",void 0),o(this,"_canScroll",void 0),o(this,"init",function(){return n._areaElement.addEventListener("scroll",n.update)}),o(this,"start",function(){n._currentVal=n._initialVal=De(n._areaElement),n._areaElement.addEventListener("scroll",n.update)}),o(this,"update",function(){return n._currentVal=De(n._areaElement)}),o(this,"stop",function(){n._areaElement.removeEventListener("scroll",n.update),n._initialVal={x:0,y:0},n._canScroll=null}),o(this,"reset",function(){n.stop(),n.start()}),this._areaElement=d,this.DS=y,this.zoom=v,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return n.start()}),this.DS.subscribe("Interaction:end",function(){return n.reset()})}return s(h,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=Pe(this._areaElement)}},{key:"scrollAmount",get:function(){var n=L(this.currentVal,"-",this.initialVal),y=Y(this.zoom),d=L(L(n,"*",y),"-",n);return{x:n.x+d.x,y:n.y+d.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=De(this._areaElement)),this._currentVal}}]),h}(),xl=function(){function h(c){var n=this,y=c.area,d=y===void 0?document:y,v=c.selectables,w=v===void 0?[]:v,_=c.autoScrollSpeed,x=_===void 0?5:_,V=c.overflowTolerance,E=V===void 0?{x:25,y:25}:V,A=c.zoom,I=A===void 0?1:A,W=c.customStyles,ne=W===void 0?!1:W,G=c.multiSelectMode,Ne=G===void 0?!1:G,qe=c.multiSelectToggling,fe=qe===void 0?!0:qe,nr=c.multiSelectKeys,Sl=nr===void 0?["Control","Shift","Meta"]:nr,or=c.selector,Dl=or===void 0?void 0:or,ar=c.draggability,bt=ar===void 0?!0:ar,ir=c.immediateDrag,El=ir===void 0?!0:ir,sr=c.keyboardDrag,Nl=sr===void 0?!0:sr,Vl=c.dragKeys,lr=c.keyboardDragSpeed,Cl=lr===void 0?10:lr,cr=c.useTransform,dr=cr===void 0?!0:cr,hr=c.hoverClass,ur=hr===void 0?"ds-hover":hr,mr=c.selectableClass,fr=mr===void 0?"ds-selectable":mr,pr=c.selectedClass,Ml=pr===void 0?"ds-selected":pr,gr=c.selectorClass,$l=gr===void 0?"ds-selector":gr,yr=c.selectorAreaClass,Bl=yr===void 0?"ds-selector-area":yr,Tl=c.callback,Al=c.onDragMove,Ol=c.onDragStartBegin,jl=c.onDragStart,Pl=c.onElementSelect,Il=c.onElementUnselect;r(this,h),o(this,"continue",!1),o(this,"start",function(){n.stopped=!1,n.Interaction.init()}),o(this,"break",function(){return n.continue=!0}),o(this,"getSelection",function(){return n.SelectedSet.elements}),o(this,"getSelectables",function(){return n.SelectableSet.elements}),o(this,"getInitialCursorPosition",function(){return n.stores.PointerStore.initialVal}),o(this,"getCurrentCursorPosition",function(){return n.stores.PointerStore.currentVal}),o(this,"getPreviousCursorPosition",function(){return n.stores.PointerStore.lastVal}),o(this,"getInitialCursorPositionArea",function(){return n.stores.PointerStore.initialValArea}),o(this,"getCurrentCursorPositionArea",function(){return n.stores.PointerStore.currentValArea}),o(this,"getPreviousCursorPositionArea",function(){return n.stores.PointerStore.lastValArea}),o(this,"isMultiSelect",function(Ll){return n.stores.KeyStore.isMultiSelectKeyPressed(Ll)}),o(this,"isDragging",function(){return n.Interaction.isDragging}),this.PubSub=new fl({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:Tl,onDragMove:Al,onDragStart:jl,onDragStartBegin:Ol,onElementSelect:Pl,onElementUnselect:Il}),this.stores={PointerStore:new kl({DS:this}),ScrollStore:new _l({DS:this,areaElement:d,zoom:I}),KeyStore:new wl({DS:this,multiSelectKeys:Sl,multiSelectMode:Ne})},this.Area=new hl({area:d,PS:this.PubSub,zoom:I}),this.Selector=new bl({DS:this,selector:Dl,selectorClass:$l,customStyles:ne}),this.SelectorArea=new vl({DS:this,selectorAreaClass:Bl,autoScrollSpeed:x,overflowTolerance:E}),this.SelectableSet=new pl({elements:w,DS:this,className:fr,hoverClassName:ur,useTransform:dr,draggability:bt}),this.SelectedSet=new gl({DS:this,className:Ml}),this.Selection=new yl({DS:this,hoverClassName:ur,multiSelectToggling:fe}),this.Drag=new ul({DS:this,draggability:bt,useTransform:dr,keyboardDrag:Nl,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},Vl),zoom:I,keyboardDragSpeed:Cl}),this.Interaction=new ml({areaElement:d,DS:this,draggability:bt,immediateDrag:El,selectableClass:fr}),dl({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",function(){return n.continue=!1}),this.start()}return s(h,[{key:"_callbacksTemp",value:function(n){var y=n.callback,d=n.onDragMove,v=n.onDragStart,w=n.onDragStartBegin,_=n.onElementSelect,x=n.onElementUnselect,V=function(A,I){return console.warn("[DragSelect] ".concat(A,' is deprecated. Use DragSelect.subscribe("').concat(I,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};y&&(V("callback","callback"),this.subscribe("callback",function(E){var A=E.items;E.item;var I=E.event;return y(A,I)})),d&&(V("onDragMove","dragmove"),this.subscribe("dragmove",function(E){E.items,E.item;var A=E.event;return d(A)})),v&&(V("onDragStart","dragstart"),this.subscribe("dragstart",function(E){E.items,E.item;var A=E.event;return v(A)})),w&&(V("onDragStartBegin","dragstart"),this.subscribe("dragstart",function(E){E.items,E.item;var A=E.event;return w(A)})),_&&(V("onElementSelect","elementselect"),this.subscribe("elementselect",function(E){E.items;var A=E.item,I=E.event;return _(A,I)})),x&&(V("onElementUnselect","elementunselect"),this.subscribe("elementunselect",function(E){E.items;var A=E.item,I=E.event;return x(A,I)}))}},{key:"stop",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;d&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(n),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),n&&this.SelectableSet.clear(),y&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ee(n)),d||this.addSelectables(n),y&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ee(n)),d&&this.removeSelectables(n),y&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(n){var y=this,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ee(n).forEach(function(w){return y.SelectedSet.has(w)?y.removeSelection(n,d,v):y.addSelection(n,d,v)}),d&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(n,y,d),this.getSelection()}},{key:"clearSelection",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=Ee(n);return this.SelectableSet.addAll(d),y&&this.SelectedSet.addAll(d),n}},{key:"setSelectables",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.removeSelectables(n,y),this.addSelectables(n,d)}},{key:"removeSelectables",value:function(n){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.SelectableSet.deleteAll(Ee(n)),y&&this.removeSelection(n),n}},{key:"getCursorPositionDifference",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");var d=y?this.getCurrentCursorPositionArea():this.getCurrentCursorPosition(),v=n?y?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():y?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return L(d,"-",v)}}]),h}();return xl})})(wt);const Gr=wt.exports,Jr=(i,t,r,a,s)=>(t=Math,r=t.log,a=1024,s=r(i)/r(a)|0,i/t.pow(a,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B"),Zr=(i,t="en-US")=>new Date(i*1e3).toLocaleString(t),Qr={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},en=[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)],tn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},rn=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1)],ze=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(i){return(t,r)=>(e.openBlock(),e.createElementBlock("div",null,[i.direction=="down"?(e.openBlock(),e.createElementBlock("svg",Qr,en)):e.createCommentVNode("",!0),i.direction=="up"?(e.openBlock(),e.createElementBlock("svg",tn,rn)):e.createCommentVNode("",!0)]))}}),nn=["onClick"],on=Object.assign({name:"VFToast.vue"},{setup(i){const t=e.inject("emitter"),{getStore:r}=e.inject("storage"),a=e.ref(r("full-screen",!1)),s=g=>g=="error"?"text-red-400 border-red-400":"text-lime-600 border-lime-600",o=e.ref([]),l=g=>{o.value.splice(g,1)},m=g=>{let f=o.value.findIndex(u=>u.id===g);f!==-1&&l(f)};return t.on("vf-toast-clear",()=>{o.value=[]}),t.on("vf-toast-push",g=>{let f=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");g.id=f,o.value.push(g),setTimeout(()=>{m(f)},5e3)}),(g,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.value.value?"fixed":"absolute","bottom-0 max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(u,p)=>(e.openBlock(),e.createElementBlock("div",{onClick:b=>l(p),key:u,class:e.normalizeClass([s(u.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 border text-xs rounded cursor-pointer"])},e.toDisplayString(u.label),11,nn))),128))]),_:1})],2))}}),pe=i=>Object.entries(i).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:an}=ie(),Ze=(i,t)=>an.value+"?"+pe({q:"preview",adapter:i,path:t}),sn={class:"relative flex-auto flex flex-col overflow-hidden"},ln={key:0,class:"grid grid-cols-12 border-b border-neutral-300 dark:border-gray-700 text-xs select-none"},cn={class:"absolute"},dn=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),hn={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"},un=["onDblclick","onTouchstart","onContextmenu","data-type","data-item","data-index"],mn={class:"grid grid-cols-12 items-center"},fn={class:"flex col-span-7 items-center"},pn={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"},gn=[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)],yn={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"},bn=[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)],vn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},wn={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},kn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],_n={class:"grid grid-cols-12 items-center"},xn={class:"flex col-span-7 items-center"},Sn={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"},Dn=[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)],En={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"},Nn=[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)],Vn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Cn={class:"col-span-2 text-center"},Mn={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},$n=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Bn={class:"relative"},Tn={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"},An=[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)],On=["src"],jn={key:2,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Pn=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)],In={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},Ln={class:"break-all"},zn=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(i){const t=i,r=e.inject("emitter"),{setStore:a,getStore:s}=e.inject("storage"),o=B=>B==null?void 0:B.substring(0,3),l=B=>B.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),m=e.ref(null),g=e.ref(null),f=e.ref(0),u=e.ref(null),{t:p}=e.inject("i18n"),b=Math.floor(Math.random()*2**32),N=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{N.value=!N.value,a("full-screen",N.value)});const k=e.ref("");r.on("vf-search-query",({newQuery:B})=>{k.value=B,B?r.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:B},onSuccess:j=>{j.files.length||r.emit("vf-toast-push",{label:p("No search result found.")})}}):r.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let D=null;const M=()=>{D&&clearTimeout(D)},T=B=>{D=setTimeout(()=>{O(B)},500)},O=B=>{B.type=="dir"?(r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:B.path}})):r.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:B})},C=e.reactive({active:!1,column:"",order:""}),J=(B=!0)=>{let j=[...t.data.files],$=C.column,L=C.order=="asc"?1:-1;if(!B)return j;const P=(q,Y)=>typeof q=="string"&&typeof Y=="string"?q.toLowerCase().localeCompare(Y.toLowerCase()):q<Y?-1:q>Y?1:0;return C.active&&(j=j.slice().sort((q,Y)=>P(q[$],Y[$])*L)),j},F=B=>{C.active&&C.column==B?(C.active=C.order=="asc",C.column=B,C.order="desc"):(C.active=!0,C.column=B,C.order="asc")},S=()=>u.value.getSelection().map(B=>JSON.parse(B.dataset.item)),R=(B,j)=>{if(B.altKey||B.ctrlKey||B.metaKey)return B.preventDefault(),!1;B.dataTransfer.setDragImage(g.value,0,15),B.dataTransfer.effectAllowed="all",B.dataTransfer.dropEffect="copy",B.dataTransfer.setData("items",JSON.stringify(S()))},K=(B,j)=>{B.preventDefault();let $=JSON.parse(B.dataTransfer.getData("items"));if($.find(L=>L.storage!=s("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:$,to:j}})},Q=(B,j)=>{B.preventDefault(),!j||j.type!=="dir"||u.value.getSelection().find($=>$==B.currentTarget)?(B.dataTransfer.dropEffect="none",B.dataTransfer.effectAllowed="none"):B.dataTransfer.dropEffect="copy"},re=()=>{u.value=new Gr({area:m.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),r.on("vf-explorer-update",()=>e.nextTick(()=>{u.value.clearSelection(),u.value.setSelectables(document.getElementsByClassName("vf-item-"+b))})),u.value.subscribe("predragstart",({event:B,isDragging:j})=>{if(j)f.value=u.value.getSelection().length,u.value.break();else{const $=B.target.offsetWidth-B.offsetX,L=B.target.offsetHeight-B.offsetY;$<15&&L<15&&(u.value.clearSelection(),u.value.break())}}),u.value.subscribe("predragmove",({isDragging:B})=>{B&&u.value.break()}),u.value.subscribe("callback",({items:B,event:j,isDragging:$})=>{r.emit("vf-nodes-selected",S()),f.value=u.value.getSelection().length})};return e.onMounted(re),e.onUpdated(()=>{u.value.setSelection(u.value.getSelection())}),e.onMounted(()=>{e.watch(()=>t.view,()=>r.emit("vf-explorer-update"))}),(B,j)=>(e.openBlock(),e.createElementBlock("div",sn,[i.view=="list"||k.value.length?(e.openBlock(),e.createElementBlock("div",ln,[e.createElementVNode("div",{onClick:j[0]||(j[0]=$=>F("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(p)("Name"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="basename"]])]),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:j[1]||(j[1]=$=>F("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(p)("Size"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="file_size"]])])),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:j[2]||(j[2]=$=>F("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(p)("Date"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="last_modified"]])])),k.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:j[3]||(j[3]=$=>F("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(p)("Filepath"))+" ",1),e.withDirectives(e.createVNode(ze,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",cn,[e.createElementVNode("div",{ref_key:"dragImage",ref:g,class:"absolute -z-50 -top-96"},[dn,e.createElementVNode("div",hn,e.toDisplayString(f.value),1)],512)]),e.createElementVNode("div",{class:e.normalizeClass([N.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:m,onContextmenu:j[7]||(j[7]=e.withModifiers($=>e.unref(r).emit("vf-contextmenu-show",{event:$,area:m.value,items:S()}),["self","prevent"]))},[k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(J(),($,L)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:P=>O($),onTouchstart:P=>T($),onTouchend:j[4]||(j[4]=P=>M()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:S(),target:$}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(b),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":$.type,"data-item":JSON.stringify($),"data-index":L},[e.createElementVNode("div",mn,[e.createElementVNode("div",fn,[$.type=="dir"?(e.openBlock(),e.createElementBlock("svg",pn,gn)):(e.openBlock(),e.createElementBlock("svg",yn,bn)),e.createElementVNode("span",vn,e.toDisplayString($.basename),1)]),e.createElementVNode("div",wn,e.toDisplayString($.path),1)])],42,un))),256)):e.createCommentVNode("",!0),i.view=="list"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(J(),($,L)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:P=>O($),onTouchstart:P=>T($),onTouchend:j[5]||(j[5]=P=>M()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:S(),target:$}),["prevent"]),onDragstart:P=>R(P),onDragover:P=>Q(P,$),onDrop:P=>K(P,$),class:e.normalizeClass(["vf-item-"+e.unref(b),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":$.type,"data-item":JSON.stringify($),"data-index":L},[e.createElementVNode("div",_n,[e.createElementVNode("div",xn,[$.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Sn,Dn)):(e.openBlock(),e.createElementBlock("svg",En,Nn)),e.createElementVNode("span",Vn,e.toDisplayString($.basename),1)]),e.createElementVNode("div",Cn,e.toDisplayString($.file_size?e.unref(Jr)($.file_size):""),1),e.createElementVNode("div",Mn,e.toDisplayString(e.unref(Zr)($.last_modified)),1)])],42,kn))),256)):e.createCommentVNode("",!0),i.view=="grid"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(J(!1),($,L)=>{var P,q;return e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:Y=>O($),onTouchstart:Y=>T($),onTouchend:j[6]||(j[6]=Y=>M()),onContextmenu:e.withModifiers(Y=>e.unref(r).emit("vf-contextmenu-show",{event:Y,area:m.value,items:S(),target:$}),["prevent"]),onDragstart:Y=>R(Y),onDragover:Y=>Q(Y,$),onDrop:Y=>K(Y,$),class:e.normalizeClass(["vf-item-"+e.unref(b),"border border-transparent hover:bg-neutral-50 m-0.5 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 md:h-24 text-center justify-center select-none"]),"data-type":$.type,"data-item":JSON.stringify($),"data-index":L},[e.createElementVNode("div",null,[e.createElementVNode("div",Bn,[$.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Tn,An)):((P=$.mime_type)!=null?P:"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"h-10 md:h-12 m-auto",src:e.unref(Ze)(e.unref(s)("adapter",t.data.adapter),$.path),alt:""},null,8,On)):(e.openBlock(),e.createElementBlock("svg",jn,Pn)),((q=$.mime_type)!=null?q:"").startsWith("image")?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",In,e.toDisplayString(o($.extension)),1))]),e.createElementVNode("span",Ln,e.toDisplayString(l($.basename)),1)])],42,$n)}),256)):e.createCommentVNode("",!0)],34),e.createVNode(on)]))}}),Rn={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Hn={class:"flex leading-5 items-center"},Un=["aria-label"],Fn=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})],-1)],Kn=["value"],Yn={class:"ml-3"},Wn={key:0},Xn={class:"ml-1"},qn={class:"flex leading-5 items-center"},Gn={value:"",disabled:""},Jn=e.createElementVNode("option",{value:"tr"},"Turkish",-1),Zn=e.createElementVNode("option",{value:"en"},"English",-1),Qn=e.createElementVNode("option",{value:"fr"},"French",-1),eo=["aria-label"],to=[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)],ro=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(i){var b;const t=i,r=e.inject("emitter"),{getStore:a,setStore:s}=e.inject("storage"),o=e.ref(0),l=e.ref((b=a("adapter"))!=null?b:t.data.adapter),{t:m,changeLocale:g}=e.inject("i18n"),f=e.ref(a("locale","")),u=()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:l.value}}),s("adapter",l.value)};r.on("vf-nodes-selected",N=>{o.value=N.length});const p=e.ref("");return r.on("vf-search-query",({newQuery:N})=>{p.value=N}),(N,k)=>(e.openBlock(),e.createElementBlock("div",Rn,[e.createElementVNode("div",Hn,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(m)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},Fn,8,Un),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":k[0]||(k[0]=D=>l.value=D),onChange:u,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.data.storages,D=>(e.openBlock(),e.createElementBlock("option",{value:D},e.toDisplayString(D),9,Kn))),256))],544),[[e.vModelSelect,l.value]]),e.createElementVNode("div",Yn,[p.value.length?(e.openBlock(),e.createElementBlock("span",Wn,e.toDisplayString(i.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Xn,e.toDisplayString(o.value>0?o.value+" "+e.unref(m)("item(s) selected."):""),1)])]),e.createElementVNode("div",qn,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":k[1]||(k[1]=D=>f.value=D),onChange:k[2]||(k[2]=D=>e.unref(g)(D.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",Gn,e.toDisplayString(e.unref(m)("Language")),1),Jn,Zn,Qn],544),[[e.vModelSelect,f.value]]),e.createElementVNode("span",{"aria-label":e.unref(m)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:k[3]||(k[3]=D=>e.unref(r).emit("vf-modal-show",{type:"message",title:"Vuefinder 1.0",message:e.unref(m)("Vuefinder is a file manager component for vue 3.")}))},to,8,eo)])]))}}),no=(i,t=0,r=!1)=>{let a;return(...s)=>{r&&!a&&i(...s),clearTimeout(a),a=setTimeout(()=>{i(...s)},t)}},oo=(i,t,r)=>{const a=e.ref(i);return e.customRef((o,l)=>({get(){return o(),a.value},set:no(m=>{a.value=m,l()},t,r)}))},ao={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-xs"},io=["aria-label"],so=[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)],lo=["onClick"],co=[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)],ho={class:"flex leading-5"},uo=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),mo=["title","onClick"],fo={key:1,class:"flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},po=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),go=["onKeydown","placeholder"],yo=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],bo=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:a}=e.inject("storage"),s=e.ref(null),o=e.ref([]),l=e.ref(!1),m=e.ref(null),{t:g}=e.inject("i18n");r.on("vf-explorer-update",()=>{var O;let M=[],T=[];s.value=(O=t.data.dirname)!=null?O:a("adapter","local")+"://",s.value.length==0&&(o.value=[]),s.value.replace(a("adapter","local")+"://","").split("/").forEach(function(C){M.push(C),M.join("/")!=""&&T.push({basename:C,name:C,path:a("adapter","local")+"://"+M.join("/"),type:"dir"})}),T.length>4&&(T=T.slice(-5),T[0].name=".."),o.value=T});const f=()=>{l.value=!1,p.value=""};r.on("vf-search-exit",()=>{f()});const u=()=>{l.value=!0,e.nextTick(()=>m.value.focus())},p=oo("",400);e.watch(p,M=>{r.emit("vf-toast-clear"),r.emit("vf-search-query",{newQuery:M})});const b=()=>o.value.length&&!l.value,N=M=>{var O;M.preventDefault();let T=JSON.parse(M.dataTransfer.getData("items"));if(T.find(C=>C.storage!=a("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:T,to:(O=o.value[o.value.length-2])!=null?O:{path:a("adapter","local")+"://"}}})},k=M=>{M.preventDefault(),b()?M.dataTransfer.dropEffect="copy":(M.dataTransfer.dropEffect="none",M.dataTransfer.effectAllowed="none")},D=()=>{p.value==""&&f()};return(M,T)=>(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("span",{"aria-label":e.unref(g)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:T[0]||(T[0]=O=>k(O)),onDrop:T[1]||(T[1]=O=>N(O)),onClick:T[2]||(T[2]=O=>{var C,J;return!b()||e.unref(r).emit("vf-fetch",{params:{q:"index",adapter:i.data.adapter,path:(J=(C=o.value[o.value.length-2])==null?void 0:C.path)!=null?J:e.unref(a)("adapter","local")+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",b()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},so,34))],8,io),l.value?(e.openBlock(),e.createElementBlock("div",fo,[po,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,onKeydown:e.withKeys(f,["esc"]),onBlur:D,"onUpdate:modelValue":T[4]||(T[4]=O=>e.isRef(p)?p.value=O:null),placeholder:e.unref(g)("Search anything.."),class:"py-0 px-2 w-full border-0 ring-0 outline-0 text-sm text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,go),[[e.vModelText,e.unref(p)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:f,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},yo))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(u,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:T[3]||(T[3]=O=>e.unref(r).emit("vf-fetch",{params:{q:"index",adapter:i.data.adapter}})),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},co)),e.createElementVNode("div",ho,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(O,C)=>(e.openBlock(),e.createElementBlock("div",{key:C},[uo,e.createElementVNode("span",{class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer",title:O.basename,onClick:J=>e.unref(r).emit("vf-fetch",{params:{q:"index",adapter:i.data.adapter,path:O.path}})},e.toDisplayString(O.name),9,mo)]))),128))])],8,lo))]))}}),vo=["onClick"],wo=e.createElementVNode("span",{class:"px-1"},null,-1),ko=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(i){const t=i,r=e.inject("emitter"),a=e.ref(null),{apiUrl:s}=ie(),o=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),l=e.ref([]);r.on("vf-context-selected",b=>{l.value=b});const{t:m}=e.inject("i18n"),g={newfolder:{title:()=>m("New Folder"),action:()=>{r.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>m("Delete"),action:()=>{r.emit("vf-modal-show",{type:"delete",items:l})}},refresh:{title:()=>m("Refresh"),action:()=>{r.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>m("Preview"),action:()=>{r.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:l.value[0]})}},open:{title:()=>m("Open"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].path}})}},openDir:{title:()=>m("Open containing folder"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].dir}})}},download:{title:()=>m("Download"),action:()=>{const b=s.value+"?"+pe({q:"download",adapter:l.value[0].adapter,path:l.value[0].path});r.emit("vf-download",b)}},archive:{title:()=>m("Archive"),action:()=>{r.emit("vf-modal-show",{type:"archive",items:l})}},unarchive:{title:()=>m("Unarchive"),action:()=>{r.emit("vf-modal-show",{type:"unarchive",items:l})}},rename:{title:()=>m("Rename"),action:()=>{r.emit("vf-modal-show",{type:"rename",items:l})}}},f=b=>{r.emit("vf-contextmenu-hide"),b.action()},u=e.ref("");r.on("vf-search-query",({newQuery:b})=>{u.value=b}),r.on("vf-contextmenu-show",({event:b,area:N,items:k,target:D=null})=>{if(o.items=[],u.value)if(D)o.items.push(g.openDir),r.emit("vf-context-selected",[D]),console.log("search item selected");else return;else!D&&!u.value?(o.items.push(g.refresh),o.items.push(g.newfolder),r.emit("vf-context-selected",[]),console.log("no files selected")):k.length>1&&k.some(M=>M.path===D.path)?(o.items.push(g.refresh),o.items.push(g.archive),o.items.push(g.delete),r.emit("vf-context-selected",k),console.log(k.length+" selected (more than 1 item.)")):(D.type=="dir"?o.items.push(g.open):(o.items.push(g.preview),o.items.push(g.download)),o.items.push(g.rename),D.mime_type=="application/zip"?o.items.push(g.unarchive):o.items.push(g.archive),o.items.push(g.delete),r.emit("vf-context-selected",[D]),console.log(D.type+" is selected"));p(b,N)}),r.on("vf-contextmenu-hide",()=>{o.active=!1});const p=(b,N)=>{o.active=!0,e.nextTick(()=>{let k=N.getBoundingClientRect(),D=b.pageX,M=b.pageY,T=a.value.offsetHeight,O=a.value.offsetWidth;D=k.right-b.pageX+window.scrollX<O?D-O:D,M=k.bottom-b.pageY+window.scrollY<T?M-T:M,o.positions={left:D+"px",top:M+"px"}})};return(b,N)=>o.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:a,style:e.normalizeStyle(o.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,k=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:k.title,onClick:D=>f(k)},[wo,e.createElementVNode("span",null,e.toDisplayString(k.title()),1)],8,vo))),128))],4)):e.createCommentVNode("",!0)}}),_o=(i,t)=>{const r=i[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((a,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function xo(i){const t=await _o(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>Js),"../locales/tr.json":()=>Promise.resolve().then(()=>Zs)}),`../locales/${i}.json`);return JSON.parse(t.default)}function So(i,t){const{getStore:r,setStore:a}=Je(i),s=["en","tr"],o=e.ref({}),l=f=>{s.includes(f)||(console.log("The selected locale is not yet supported. The fallback language is set as 'en'"),f="en"),xo(f).then(u=>{o.value=u,a("locale",f),a("translations",u),console.log(f+" is loaded.")})};r("locale")?o.value=r("translations"):l(t);const m=(f,...u)=>u.length?m(f=f.replace("%s",u.shift()),...u):f;function g(f,...u){return o.value.hasOwnProperty(f)?m(o.value[f],...u):f}return{t:g,support_locales:s,changeLocale:l}}const Do=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Eo=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"},ajaxData:{type:Object,default:{}}},setup(i){const t=i,r=br(),{setStore:a,getStore:s}=Je(t.id);e.provide("emitter",r),e.provide("storage",Je(t.id)),e.provide("ajaxData",t.ajaxData);const o=So(t.id,t.locale);e.provide("i18n",o);const{apiUrl:l,setApiUrl:m}=ie();m(t.url);const g=e.reactive({adapter:"local",storages:[],dirname:".",files:[]}),f=e.ref(s("viewport","grid")),u=e.ref(s("darkMode",t.dark));r.on("vf-darkMode-toggle",()=>{u.value=!u.value,a("darkMode",u.value)});const p=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{p.value=!p.value,a("full-screen",p.value)}),r.on("vf-view-toggle",k=>{f.value=k});const b=e.reactive({active:!1,type:"delete",data:{}});r.on("vf-modal-close",()=>{b.active=!1}),r.on("vf-modal-show",k=>{b.active=!0,b.type=k.type,b.data=k});const N=k=>{Object.assign(g,k),r.emit("vf-nodes-selected",{}),r.emit("vf-explorer-update")};return r.on("vf-fetch",({params:k,onSuccess:D=null,onError:M=null})=>{Le(l.value,{params:k}).then(T=>{r.emit("vf-modal-close"),N(T),D(T)}).catch(T=>{M&&M(T)})}),r.on("vf-download",k=>{document.getElementById("download_frame").src=k,r.emit("vf-modal-close")}),e.onMounted(()=>{r.emit("vf-fetch",{params:{q:"index",adapter:s("adapter",g.adapter)}})}),(k,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(u.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([p.value?"fixed w-screen inset-0 z-20":"relative","border flex flex-col rounded-md bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(p.value?"":"max-height: "+i.maxHeight),onMousedown:D[0]||(D[0]=M=>e.unref(r).emit("vf-contextmenu-hide"))},[e.createVNode(Xr,{data:g},null,8,["data"]),e.createVNode(bo,{data:g},null,8,["data"]),e.createVNode(zn,{view:f.value,data:g},null,8,["view","data"]),e.createVNode(ro,{data:g},null,8,["data"])],38),b.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+b.type),{key:0,selection:b.data,current:g},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(ko,{current:g},null,8,["current"]),Do],2))}}),No=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1),Vo={class:"fixed z-10 inset-0 overflow-y-auto"},Co={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl sm:w-full"},Mo={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},$o={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},se={__name:"ModalLayout",setup(i){const t=e.inject("emitter");return e.onMounted(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus()}),(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:a[1]||(a[1]=e.withKeys(s=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[No,e.createElementVNode("div",Vo,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:a[0]||(a[0]=e.withModifiers(s=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Co,[e.createElementVNode("div",Mo,[e.renderSlot(r.$slots,"default")]),e.createElementVNode("div",$o,[e.renderSlot(r.$slots,"buttons")])])],32)])],32))}},Bo=["aria-label"],To=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)],le=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},setup(i){var l;const{t}=e.inject("i18n"),r=e.ref(!1),a=e.ref(null),s=e.ref((l=a.value)==null?void 0:l.strMessage);e.watch(s,()=>r.value=!1);const o=()=>r.value=!0;return(m,g)=>(e.openBlock(),e.createElementBlock("div",null,[r.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",i.error?"bg-red-100 text-red-600":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(m.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:o,"aria-label":e.unref(t)("Close"),"data-microtip-position":"top-left",role:"tooltip"},To,8,Bo)],2))]))}}),Ao={class:"sm:flex sm:items-start"},Oo=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),jo={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Po={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Io={class:"mt-2"},Lo={class:"text-sm text-gray-500"},zo={class:"flex text-sm text-gray-800 dark:text-gray-400"},Ro={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"},Ho=[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)],Uo={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"},Fo=[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)],Ko={class:"ml-1.5"},Yo={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},Wo=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:a}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(t.selection.items),l=e.ref(""),m=()=>{o.value.length&&r.emit("vf-fetch",{params:{q:"delete",adapter:a("adapter","local"),path:t.current.dirname,items:JSON.stringify(o.value.map(({path:g,type:f})=>({path:g,type:f})))},onSuccess:()=>{r.emit("vf-toast-push",{label:s("Files deleted.")})},onError:g=>{l.value=s(g.message)}})};return(g,f)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:f[0]||(f[0]=u=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1),e.createElementVNode("div",Yo,e.toDisplayString(e.unref(s)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ao,[Oo,e.createElementVNode("div",jo,[e.createElementVNode("h3",Po,e.toDisplayString(e.unref(s)("Delete files")),1),e.createElementVNode("div",Io,[e.createElementVNode("p",Lo,e.toDisplayString(e.unref(s)("Are you sure you want to delete these files ?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,u=>(e.openBlock(),e.createElementBlock("p",zo,[u.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Ro,Ho)):(e.openBlock(),e.createElementBlock("svg",Uo,Fo)),e.createElementVNode("span",Ko,e.toDisplayString(u.basename),1)]))),256)),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Xo={class:"sm:flex sm:items-start"},qo=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"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),Go={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Jo={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Zo={class:"mt-2"},Qo={class:"text-sm text-gray-500"},ea=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(i){const t=e.inject("emitter"),{t:r}=e.inject("i18n");return(a,s)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[0]||(s[0]=o=>e.unref(t).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(r)("Close")),1)]),default:e.withCtx(()=>{var o,l,m,g;return[e.createElementVNode("div",Xo,[qo,e.createElementVNode("div",Go,[e.createElementVNode("h3",Jo,e.toDisplayString((l=(o=i.selection)==null?void 0:o.title)!=null?l:"Title"),1),e.createElementVNode("div",Zo,[e.createElementVNode("p",Qo,e.toDisplayString((g=(m=i.selection)==null?void 0:m.message)!=null?g:"Message")+".",1)])])])]}),_:1}))}}),ta={class:"sm:flex sm:items-start"},ra=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),na={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},oa={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},aa={class:"mt-2"},ia={class:"text-sm text-gray-500"},sa=["onKeyup","placeholder"],la=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:a}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),l=e.ref(""),m=()=>{o.value!=""&&r.emit("vf-fetch",{params:{q:"newfolder",adapter:a("adapter","local"),path:t.current.dirname,name:o.value},onSuccess:()=>{r.emit("vf-toast-push",{label:s("%s is created.",o.value)})},onError:g=>{l.value=s(g.message)}})};return(g,f)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Create")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=u=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ta,[ra,e.createElementVNode("div",na,[e.createElementVNode("h3",oa,e.toDisplayString(e.unref(s)("New Folder")),1),e.createElementVNode("div",aa,[e.createElementVNode("p",ia,e.toDisplayString(e.unref(s)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=u=>o.value=u),onKeyup:e.withKeys(m,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("Folder Name"),type:"text"},null,40,sa),[[e.vModelText,o.value]]),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ca={class:"sm:flex sm:items-start"},da=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-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),ha={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ua={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ma={class:"mt-2"},fa={class:"text-sm text-gray-500"},pa=["onKeyup","placeholder"],ga=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(i){const t=i,r=e.inject("emitter"),{getStore:a}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),l=e.ref(""),m=()=>{o.value!=""&&r.emit("vf-fetch",{params:{q:"newfile",adapter:a("adapter","local"),path:t.current.dirname,name:o.value},onSuccess:()=>{r.emit("vf-toast-push",{label:s("%s is created.",o.value)})},onError:g=>{l.value=s(g.message)}})};return(g,f)=>(e.openBlock(),e.createBlock(se,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},"Create!"),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=u=>e.unref(r).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},"Cancel")]),default:e.withCtx(()=>[e.createElementVNode("div",ca,[da,e.createElementVNode("div",ha,[e.createElementVNode("h3",ua,e.toDisplayString(e.unref(s)("New File")),1),e.createElementVNode("div",ma,[e.createElementVNode("p",fa,e.toDisplayString(e.unref(s)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=u=>o.value=u),onKeyup:e.withKeys(m,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(s)("File Name"),type:"text"},null,40,pa),[[e.vModelText,o.value]]),l.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ya={class:"flex"},ba={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},va={class:"ml-auto mb-2"},wa={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"},ka={key:1},_a={__name:"Text",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,a=e.ref(""),s=e.ref(""),o=e.ref(null),l=e.ref(!1),{apiUrl:m}=ie(),g=e.ref(""),f=e.ref(!1),{t:u}=e.inject("i18n");e.onMounted(()=>{Le(m.value,{params:{q:"preview",adapter:r.selection.adapter,path:r.selection.item.path},json:!1}).then(k=>{a.value=k,t("load")})});const p=()=>{l.value=!l.value,s.value=a.value,l.value==!0&&e.nextTick(()=>{o.value.focus()})},b=e.inject("ajaxData"),N=()=>{g.value="",f.value=!1,console.log(b),Le(m.value,{method:"POST",params:Object.assign(b,{q:"save",adapter:r.selection.adapter,path:r.selection.item.path,content:s.value}),json:!1}).then(k=>{g.value=u("Updated."),a.value=k,t("load"),l.value=!l.value}).catch(k=>{g.value=u(k.message),f.value=!0})};return(k,D)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ya,[e.createElementVNode("div",ba,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",va,[l.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:N,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(u)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:D[0]||(D[0]=M=>p())},e.toDisplayString(l.value?e.unref(u)("Cancel"):e.unref(u)("Edit")),1)])]),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",ka,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:o,"onUpdate:modelValue":D[1]||(D[1]=M=>s.value=M),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,s.value]])])):(e.openBlock(),e.createElementBlock("pre",wa,e.toDisplayString(a.value),1)),g.value.length?(e.openBlock(),e.createBlock(le,{key:2,error:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},Sc="";/*!
4
4
  * Cropper.js v1.5.12
5
5
  * https://fengyuanchen.github.io/cropperjs
6
6
  *
@@ -9,7 +9,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
9
9
  *
10
10
  * Date: 2021-06-12T08:00:17.411Z
11
11
  */function kt(i,t){var r=Object.keys(i);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(i);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),r.push.apply(r,a)}return r}function _t(i){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kt(Object(r),!0).forEach(function(a){Da(i,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach(function(a){Object.defineProperty(i,a,Object.getOwnPropertyDescriptor(r,a))})}return i}function Re(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Re=function(t){return typeof t}:Re=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(i)}function xa(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function xt(i,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(i,a.key,a)}}function Sa(i,t,r){return t&&xt(i.prototype,t),r&&xt(i,r),i}function Da(i,t,r){return t in i?Object.defineProperty(i,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[t]=r,i}function St(i){return Ea(i)||Na(i)||Va(i)||Ca()}function Ea(i){if(Array.isArray(i))return Qe(i)}function Na(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Va(i,t){if(!!i){if(typeof i=="string")return Qe(i,t);var r=Object.prototype.toString.call(i).slice(8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return Array.from(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qe(i,t)}}function Qe(i,t){(t==null||t>i.length)&&(t=i.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=i[r];return a}function Ca(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var He=typeof window<"u"&&typeof window.document<"u",ce=He?window:{},et=He&&ce.document.documentElement?"ontouchstart"in ce.document.documentElement:!1,tt=He?"PointerEvent"in ce:!1,H="cropper",rt="all",Dt="crop",Et="move",Nt="zoom",ge="e",ye="w",ve="s",he="n",Ce="ne",Me="nw",$e="se",Be="sw",nt="".concat(H,"-crop"),Vt="".concat(H,"-disabled"),ee="".concat(H,"-hidden"),Ct="".concat(H,"-hide"),Ma="".concat(H,"-invisible"),Ue="".concat(H,"-modal"),ot="".concat(H,"-move"),Te="".concat(H,"Action"),Fe="".concat(H,"Preview"),at="crop",Mt="move",$t="none",it="crop",st="cropend",lt="cropmove",ct="cropstart",Bt="dblclick",$a=et?"touchstart":"mousedown",Ba=et?"touchmove":"mousemove",Ta=et?"touchend touchcancel":"mouseup",Tt=tt?"pointerdown":$a,At=tt?"pointermove":Ba,Ot=tt?"pointerup pointercancel":Ta,jt="ready",Pt="resize",It="wheel",dt="zoom",Lt="image/jpeg",Aa=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Oa=/^data:/,ja=/^data:image\/jpeg;base64,/,Pa=/^img|canvas$/i,zt=200,Rt=100,Ht={viewMode:0,dragMode:at,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:zt,minContainerHeight:Rt,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Ia='<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>',La=Number.isNaN||ce.isNaN;function z(i){return typeof i=="number"&&!La(i)}var Ut=function(t){return t>0&&t<1/0};function ht(i){return typeof i>"u"}function be(i){return Re(i)==="object"&&i!==null}var za=Object.prototype.hasOwnProperty;function we(i){if(!be(i))return!1;try{var t=i.constructor,r=t.prototype;return t&&r&&za.call(r,"isPrototypeOf")}catch{return!1}}function te(i){return typeof i=="function"}var Ra=Array.prototype.slice;function Ft(i){return Array.from?Array.from(i):Ra.call(i)}function X(i,t){return i&&te(t)&&(Array.isArray(i)||z(i.length)?Ft(i).forEach(function(r,a){t.call(i,r,a,i)}):be(i)&&Object.keys(i).forEach(function(r){t.call(i,i[r],r,i)})),i}var U=Object.assign||function(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return be(t)&&a.length>0&&a.forEach(function(o){be(o)&&Object.keys(o).forEach(function(l){t[l]=o[l]})}),t},Ha=/\.\d*(?:0|9){12}\d*$/;function ke(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ha.test(i)?Math.round(i*t)/t:i}var Ua=/^width|height|left|top|marginLeft|marginTop$/;function ue(i,t){var r=i.style;X(t,function(a,s){Ua.test(s)&&z(a)&&(a="".concat(a,"px")),r[s]=a})}function Fa(i,t){return i.classList?i.classList.contains(t):i.className.indexOf(t)>-1}function Z(i,t){if(!!t){if(z(i.length)){X(i,function(a){Z(a,t)});return}if(i.classList){i.classList.add(t);return}var r=i.className.trim();r?r.indexOf(t)<0&&(i.className="".concat(r," ").concat(t)):i.className=t}}function de(i,t){if(!!t){if(z(i.length)){X(i,function(r){de(r,t)});return}if(i.classList){i.classList.remove(t);return}i.className.indexOf(t)>=0&&(i.className=i.className.replace(t,""))}}function _e(i,t,r){if(!!t){if(z(i.length)){X(i,function(a){_e(a,t,r)});return}r?Z(i,t):de(i,t)}}var Ka=/([a-z\d])([A-Z])/g;function ut(i){return i.replace(Ka,"$1-$2").toLowerCase()}function mt(i,t){return be(i[t])?i[t]:i.dataset?i.dataset[t]:i.getAttribute("data-".concat(ut(t)))}function Ae(i,t,r){be(r)?i[t]=r:i.dataset?i.dataset[t]=r:i.setAttribute("data-".concat(ut(t)),r)}function Ya(i,t){if(be(i[t]))try{delete i[t]}catch{i[t]=void 0}else if(i.dataset)try{delete i.dataset[t]}catch{i.dataset[t]=void 0}else i.removeAttribute("data-".concat(ut(t)))}var Kt=/\s\s*/,Yt=function(){var i=!1;if(He){var t=!1,r=function(){},a=Object.defineProperty({},"once",{get:function(){return i=!0,t},set:function(o){t=o}});ce.addEventListener("test",r,a),ce.removeEventListener("test",r,a)}return i}();function ae(i,t,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r;t.trim().split(Kt).forEach(function(o){if(!Yt){var l=i.listeners;l&&l[o]&&l[o][r]&&(s=l[o][r],delete l[o][r],Object.keys(l[o]).length===0&&delete l[o],Object.keys(l).length===0&&delete i.listeners)}i.removeEventListener(o,s,a)})}function oe(i,t,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r;t.trim().split(Kt).forEach(function(o){if(a.once&&!Yt){var l=i.listeners,m=l===void 0?{}:l;s=function(){delete m[o][r],i.removeEventListener(o,s,a);for(var f=arguments.length,u=new Array(f),p=0;p<f;p++)u[p]=arguments[p];r.apply(i,u)},m[o]||(m[o]={}),m[o][r]&&i.removeEventListener(o,m[o][r],a),m[o][r]=s,i.listeners=m}i.addEventListener(o,s,a)})}function xe(i,t,r){var a;return te(Event)&&te(CustomEvent)?a=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent"),a.initCustomEvent(t,!0,!0,r)),i.dispatchEvent(a)}function Wt(i){var t=i.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var ft=ce.location,Wa=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Xt(i){var t=i.match(Wa);return t!==null&&(t[1]!==ft.protocol||t[2]!==ft.hostname||t[3]!==ft.port)}function qt(i){var t="timestamp=".concat(new Date().getTime());return i+(i.indexOf("?")===-1?"?":"&")+t}function Oe(i){var t=i.rotate,r=i.scaleX,a=i.scaleY,s=i.translateX,o=i.translateY,l=[];z(s)&&s!==0&&l.push("translateX(".concat(s,"px)")),z(o)&&o!==0&&l.push("translateY(".concat(o,"px)")),z(t)&&t!==0&&l.push("rotate(".concat(t,"deg)")),z(r)&&r!==1&&l.push("scaleX(".concat(r,")")),z(a)&&a!==1&&l.push("scaleY(".concat(a,")"));var m=l.length?l.join(" "):"none";return{WebkitTransform:m,msTransform:m,transform:m}}function Xa(i){var t=_t({},i),r=0;return X(i,function(a,s){delete t[s],X(t,function(o){var l=Math.abs(a.startX-o.startX),m=Math.abs(a.startY-o.startY),g=Math.abs(a.endX-o.endX),f=Math.abs(a.endY-o.endY),u=Math.sqrt(l*l+m*m),p=Math.sqrt(g*g+f*f),b=(p-u)/u;Math.abs(b)>Math.abs(r)&&(r=b)})}),r}function Ke(i,t){var r=i.pageX,a=i.pageY,s={endX:r,endY:a};return t?s:_t({startX:r,startY:a},s)}function qa(i){var t=0,r=0,a=0;return X(i,function(s){var o=s.startX,l=s.startY;t+=o,r+=l,a+=1}),t/=a,r/=a,{pageX:t,pageY:r}}function me(i){var t=i.aspectRatio,r=i.height,a=i.width,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=Ut(a),l=Ut(r);if(o&&l){var m=r*t;s==="contain"&&m>a||s==="cover"&&m<a?r=a/t:a=r*t}else o?r=a/t:l&&(a=r*t);return{width:a,height:r}}function Ga(i){var t=i.width,r=i.height,a=i.degree;if(a=Math.abs(a)%180,a===90)return{width:r,height:t};var s=a%90*Math.PI/180,o=Math.sin(s),l=Math.cos(s),m=t*l+r*o,g=t*o+r*l;return a>90?{width:g,height:m}:{width:m,height:g}}function Ja(i,t,r,a){var s=t.aspectRatio,o=t.naturalWidth,l=t.naturalHeight,m=t.rotate,g=m===void 0?0:m,f=t.scaleX,u=f===void 0?1:f,p=t.scaleY,b=p===void 0?1:p,N=r.aspectRatio,k=r.naturalWidth,D=r.naturalHeight,M=a.fillColor,T=M===void 0?"transparent":M,O=a.imageSmoothingEnabled,C=O===void 0?!0:O,J=a.imageSmoothingQuality,F=J===void 0?"low":J,S=a.maxWidth,R=S===void 0?1/0:S,K=a.maxHeight,Q=K===void 0?1/0:K,re=a.minWidth,B=re===void 0?0:re,j=a.minHeight,$=j===void 0?0:j,L=document.createElement("canvas"),P=L.getContext("2d"),q=me({aspectRatio:N,width:R,height:Q}),Y=me({aspectRatio:N,width:B,height:$},"cover"),je=Math.min(q.width,Math.max(Y.width,k)),Pe=Math.min(q.height,Math.max(Y.height,D)),Ye=me({aspectRatio:s,width:R,height:Q}),We=me({aspectRatio:s,width:B,height:$},"cover"),Xe=Math.min(Ye.width,Math.max(We.width,o)),Se=Math.min(Ye.height,Math.max(We.height,l)),gt=[-Xe/2,-Se/2,Xe,Se];return L.width=ke(je),L.height=ke(Pe),P.fillStyle=T,P.fillRect(0,0,je,Pe),P.save(),P.translate(je/2,Pe/2),P.rotate(g*Math.PI/180),P.scale(u,b),P.imageSmoothingEnabled=C,P.imageSmoothingQuality=F,P.drawImage.apply(P,[i].concat(St(gt.map(function(De){return Math.floor(ke(De))})))),P.restore(),L}var Gt=String.fromCharCode;function Za(i,t,r){var a="";r+=t;for(var s=t;s<r;s+=1)a+=Gt(i.getUint8(s));return a}var Qa=/^data:.*,/;function ei(i){var t=i.replace(Qa,""),r=atob(t),a=new ArrayBuffer(r.length),s=new Uint8Array(a);return X(s,function(o,l){s[l]=r.charCodeAt(l)}),a}function ti(i,t){for(var r=[],a=8192,s=new Uint8Array(i);s.length>0;)r.push(Gt.apply(null,Ft(s.subarray(0,a)))),s=s.subarray(a);return"data:".concat(t,";base64,").concat(btoa(r.join("")))}function ri(i){var t=new DataView(i),r;try{var a,s,o;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var l=t.byteLength,m=2;m+1<l;){if(t.getUint8(m)===255&&t.getUint8(m+1)===225){s=m;break}m+=1}if(s){var g=s+4,f=s+10;if(Za(t,g,4)==="Exif"){var u=t.getUint16(f);if(a=u===18761,(a||u===19789)&&t.getUint16(f+2,a)===42){var p=t.getUint32(f+4,a);p>=8&&(o=f+p)}}}if(o){var b=t.getUint16(o,a),N,k;for(k=0;k<b;k+=1)if(N=o+k*12+2,t.getUint16(N,a)===274){N+=8,r=t.getUint16(N,a),t.setUint16(N,1,a);break}}}catch{r=1}return r}function ni(i){var t=0,r=1,a=1;switch(i){case 2:r=-1;break;case 3:t=-180;break;case 4:a=-1;break;case 5:t=90,a=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:r,scaleY:a}}var oi={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,r=this.options,a=this.container,s=this.cropper,o=Number(r.minContainerWidth),l=Number(r.minContainerHeight);Z(s,ee),de(t,ee);var m={width:Math.max(a.offsetWidth,o>=0?o:zt),height:Math.max(a.offsetHeight,l>=0?l:Rt)};this.containerData=m,ue(s,{width:m.width,height:m.height}),Z(t,ee),de(s,ee)},initCanvas:function(){var t=this.containerData,r=this.imageData,a=this.options.viewMode,s=Math.abs(r.rotate)%180===90,o=s?r.naturalHeight:r.naturalWidth,l=s?r.naturalWidth:r.naturalHeight,m=o/l,g=t.width,f=t.height;t.height*m>t.width?a===3?g=t.height*m:f=t.width/m:a===3?f=t.width/m:g=t.height*m;var u={aspectRatio:m,naturalWidth:o,naturalHeight:l,width:g,height:f};this.canvasData=u,this.limited=a===1||a===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(t.width-u.width)/2,u.top=(t.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=U({},u)},limitCanvas:function(t,r){var a=this.options,s=this.containerData,o=this.canvasData,l=this.cropBoxData,m=a.viewMode,g=o.aspectRatio,f=this.cropped&&l;if(t){var u=Number(a.minCanvasWidth)||0,p=Number(a.minCanvasHeight)||0;m>1?(u=Math.max(u,s.width),p=Math.max(p,s.height),m===3&&(p*g>u?u=p*g:p=u/g)):m>0&&(u?u=Math.max(u,f?l.width:0):p?p=Math.max(p,f?l.height:0):f&&(u=l.width,p=l.height,p*g>u?u=p*g:p=u/g));var b=me({aspectRatio:g,width:u,height:p});u=b.width,p=b.height,o.minWidth=u,o.minHeight=p,o.maxWidth=1/0,o.maxHeight=1/0}if(r)if(m>(f?0:1)){var N=s.width-o.width,k=s.height-o.height;o.minLeft=Math.min(0,N),o.minTop=Math.min(0,k),o.maxLeft=Math.max(0,N),o.maxTop=Math.max(0,k),f&&this.limited&&(o.minLeft=Math.min(l.left,l.left+(l.width-o.width)),o.minTop=Math.min(l.top,l.top+(l.height-o.height)),o.maxLeft=l.left,o.maxTop=l.top,m===2&&(o.width>=s.width&&(o.minLeft=Math.min(0,N),o.maxLeft=Math.max(0,N)),o.height>=s.height&&(o.minTop=Math.min(0,k),o.maxTop=Math.max(0,k))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=s.width,o.maxTop=s.height},renderCanvas:function(t,r){var a=this.canvasData,s=this.imageData;if(r){var o=Ga({width:s.naturalWidth*Math.abs(s.scaleX||1),height:s.naturalHeight*Math.abs(s.scaleY||1),degree:s.rotate||0}),l=o.width,m=o.height,g=a.width*(l/a.naturalWidth),f=a.height*(m/a.naturalHeight);a.left-=(g-a.width)/2,a.top-=(f-a.height)/2,a.width=g,a.height=f,a.aspectRatio=l/m,a.naturalWidth=l,a.naturalHeight=m,this.limitCanvas(!0,!1)}(a.width>a.maxWidth||a.width<a.minWidth)&&(a.left=a.oldLeft),(a.height>a.maxHeight||a.height<a.minHeight)&&(a.top=a.oldTop),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),this.limitCanvas(!1,!0),a.left=Math.min(Math.max(a.left,a.minLeft),a.maxLeft),a.top=Math.min(Math.max(a.top,a.minTop),a.maxTop),a.oldLeft=a.left,a.oldTop=a.top,ue(this.canvas,U({width:a.width,height:a.height},Oe({translateX:a.left,translateY:a.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var r=this.canvasData,a=this.imageData,s=a.naturalWidth*(r.width/r.naturalWidth),o=a.naturalHeight*(r.height/r.naturalHeight);U(a,{width:s,height:o,left:(r.width-s)/2,top:(r.height-o)/2}),ue(this.image,U({width:a.width,height:a.height},Oe(U({translateX:a.left,translateY:a.top},a)))),t&&this.output()},initCropBox:function(){var t=this.options,r=this.canvasData,a=t.aspectRatio||t.initialAspectRatio,s=Number(t.autoCropArea)||.8,o={width:r.width,height:r.height};a&&(r.height*a>r.width?o.height=o.width/a:o.width=o.height*a),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*s),o.height=Math.max(o.minHeight,o.height*s),o.left=r.left+(r.width-o.width)/2,o.top=r.top+(r.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=U({},o)},limitCropBox:function(t,r){var a=this.options,s=this.containerData,o=this.canvasData,l=this.cropBoxData,m=this.limited,g=a.aspectRatio;if(t){var f=Number(a.minCropBoxWidth)||0,u=Number(a.minCropBoxHeight)||0,p=m?Math.min(s.width,o.width,o.width+o.left,s.width-o.left):s.width,b=m?Math.min(s.height,o.height,o.height+o.top,s.height-o.top):s.height;f=Math.min(f,s.width),u=Math.min(u,s.height),g&&(f&&u?u*g>f?u=f/g:f=u*g:f?u=f/g:u&&(f=u*g),b*g>p?b=p/g:p=b*g),l.minWidth=Math.min(f,p),l.minHeight=Math.min(u,b),l.maxWidth=p,l.maxHeight=b}r&&(m?(l.minLeft=Math.max(0,o.left),l.minTop=Math.max(0,o.top),l.maxLeft=Math.min(s.width,o.left+o.width)-l.width,l.maxTop=Math.min(s.height,o.top+o.height)-l.height):(l.minLeft=0,l.minTop=0,l.maxLeft=s.width-l.width,l.maxTop=s.height-l.height))},renderCropBox:function(){var t=this.options,r=this.containerData,a=this.cropBoxData;(a.width>a.maxWidth||a.width<a.minWidth)&&(a.left=a.oldLeft),(a.height>a.maxHeight||a.height<a.minHeight)&&(a.top=a.oldTop),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),this.limitCropBox(!1,!0),a.left=Math.min(Math.max(a.left,a.minLeft),a.maxLeft),a.top=Math.min(Math.max(a.top,a.minTop),a.maxTop),a.oldLeft=a.left,a.oldTop=a.top,t.movable&&t.cropBoxMovable&&Ae(this.face,Te,a.width>=r.width&&a.height>=r.height?Et:rt),ue(this.cropBox,U({width:a.width,height:a.height},Oe({translateX:a.left,translateY:a.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),xe(this.element,it,this.getData())}},ai={initPreview:function(){var t=this.element,r=this.crossOrigin,a=this.options.preview,s=r?this.crossOriginUrl:this.url,o=t.alt||"The image to preview",l=document.createElement("img");if(r&&(l.crossOrigin=r),l.src=s,l.alt=o,this.viewBox.appendChild(l),this.viewBoxImage=l,!!a){var m=a;typeof a=="string"?m=t.ownerDocument.querySelectorAll(a):a.querySelector&&(m=[a]),this.previews=m,X(m,function(g){var f=document.createElement("img");Ae(g,Fe,{width:g.offsetWidth,height:g.offsetHeight,html:g.innerHTML}),r&&(f.crossOrigin=r),f.src=s,f.alt=o,f.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',g.innerHTML="",g.appendChild(f)})}},resetPreview:function(){X(this.previews,function(t){var r=mt(t,Fe);ue(t,{width:r.width,height:r.height}),t.innerHTML=r.html,Ya(t,Fe)})},preview:function(){var t=this.imageData,r=this.canvasData,a=this.cropBoxData,s=a.width,o=a.height,l=t.width,m=t.height,g=a.left-r.left-t.left,f=a.top-r.top-t.top;!this.cropped||this.disabled||(ue(this.viewBoxImage,U({width:l,height:m},Oe(U({translateX:-g,translateY:-f},t)))),X(this.previews,function(u){var p=mt(u,Fe),b=p.width,N=p.height,k=b,D=N,M=1;s&&(M=b/s,D=o*M),o&&D>N&&(M=N/o,k=s*M,D=N),ue(u,{width:k,height:D}),ue(u.getElementsByTagName("img")[0],U({width:l*M,height:m*M},Oe(U({translateX:-g*M,translateY:-f*M},t))))}))}},ii={bind:function(){var t=this.element,r=this.options,a=this.cropper;te(r.cropstart)&&oe(t,ct,r.cropstart),te(r.cropmove)&&oe(t,lt,r.cropmove),te(r.cropend)&&oe(t,st,r.cropend),te(r.crop)&&oe(t,it,r.crop),te(r.zoom)&&oe(t,dt,r.zoom),oe(a,Tt,this.onCropStart=this.cropStart.bind(this)),r.zoomable&&r.zoomOnWheel&&oe(a,It,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&oe(a,Bt,this.onDblclick=this.dblclick.bind(this)),oe(t.ownerDocument,At,this.onCropMove=this.cropMove.bind(this)),oe(t.ownerDocument,Ot,this.onCropEnd=this.cropEnd.bind(this)),r.responsive&&oe(window,Pt,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,r=this.options,a=this.cropper;te(r.cropstart)&&ae(t,ct,r.cropstart),te(r.cropmove)&&ae(t,lt,r.cropmove),te(r.cropend)&&ae(t,st,r.cropend),te(r.crop)&&ae(t,it,r.crop),te(r.zoom)&&ae(t,dt,r.zoom),ae(a,Tt,this.onCropStart),r.zoomable&&r.zoomOnWheel&&ae(a,It,this.onWheel,{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&ae(a,Bt,this.onDblclick),ae(t.ownerDocument,At,this.onCropMove),ae(t.ownerDocument,Ot,this.onCropEnd),r.responsive&&ae(window,Pt,this.onResize)}},si={resize:function(){if(!this.disabled){var t=this.options,r=this.container,a=this.containerData,s=r.offsetWidth/a.width,o=r.offsetHeight/a.height,l=Math.abs(s-1)>Math.abs(o-1)?s:o;if(l!==1){var m,g;t.restore&&(m=this.getCanvasData(),g=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(X(m,function(f,u){m[u]=f*l})),this.setCropBoxData(X(g,function(f,u){g[u]=f*l})))}}},dblclick:function(){this.disabled||this.options.dragMode===$t||this.setDragMode(Fa(this.dragBox,nt)?Mt:at)},wheel:function(t){var r=this,a=Number(this.options.wheelZoomRatio)||.1,s=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){r.wheeling=!1},50),t.deltaY?s=t.deltaY>0?1:-1:t.wheelDelta?s=-t.wheelDelta/120:t.detail&&(s=t.detail>0?1:-1),this.zoom(-s*a,t)))},cropStart:function(t){var r=t.buttons,a=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(z(r)&&r!==1||z(a)&&a!==0||t.ctrlKey))){var s=this.options,o=this.pointers,l;t.changedTouches?X(t.changedTouches,function(m){o[m.identifier]=Ke(m)}):o[t.pointerId||0]=Ke(t),Object.keys(o).length>1&&s.zoomable&&s.zoomOnTouch?l=Nt:l=mt(t.target,Te),!!Aa.test(l)&&xe(this.element,ct,{originalEvent:t,action:l})!==!1&&(t.preventDefault(),this.action=l,this.cropping=!1,l===Dt&&(this.cropping=!0,Z(this.dragBox,Ue)))}},cropMove:function(t){var r=this.action;if(!(this.disabled||!r)){var a=this.pointers;t.preventDefault(),xe(this.element,lt,{originalEvent:t,action:r})!==!1&&(t.changedTouches?X(t.changedTouches,function(s){U(a[s.identifier]||{},Ke(s,!0))}):U(a[t.pointerId||0]||{},Ke(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var r=this.action,a=this.pointers;t.changedTouches?X(t.changedTouches,function(s){delete a[s.identifier]}):delete a[t.pointerId||0],r&&(t.preventDefault(),Object.keys(a).length||(this.action=""),this.cropping&&(this.cropping=!1,_e(this.dragBox,Ue,this.cropped&&this.options.modal)),xe(this.element,st,{originalEvent:t,action:r}))}}},li={change:function(t){var r=this.options,a=this.canvasData,s=this.containerData,o=this.cropBoxData,l=this.pointers,m=this.action,g=r.aspectRatio,f=o.left,u=o.top,p=o.width,b=o.height,N=f+p,k=u+b,D=0,M=0,T=s.width,O=s.height,C=!0,J;!g&&t.shiftKey&&(g=p&&b?p/b:1),this.limited&&(D=o.minLeft,M=o.minTop,T=D+Math.min(s.width,a.width,a.left+a.width),O=M+Math.min(s.height,a.height,a.top+a.height));var F=l[Object.keys(l)[0]],S={x:F.endX-F.startX,y:F.endY-F.startY},R=function(Q){switch(Q){case ge:N+S.x>T&&(S.x=T-N);break;case ye:f+S.x<D&&(S.x=D-f);break;case he:u+S.y<M&&(S.y=M-u);break;case ve:k+S.y>O&&(S.y=O-k);break}};switch(m){case rt:f+=S.x,u+=S.y;break;case ge:if(S.x>=0&&(N>=T||g&&(u<=M||k>=O))){C=!1;break}R(ge),p+=S.x,p<0&&(m=ye,p=-p,f-=p),g&&(b=p/g,u+=(o.height-b)/2);break;case he:if(S.y<=0&&(u<=M||g&&(f<=D||N>=T))){C=!1;break}R(he),b-=S.y,u+=S.y,b<0&&(m=ve,b=-b,u-=b),g&&(p=b*g,f+=(o.width-p)/2);break;case ye:if(S.x<=0&&(f<=D||g&&(u<=M||k>=O))){C=!1;break}R(ye),p-=S.x,f+=S.x,p<0&&(m=ge,p=-p,f-=p),g&&(b=p/g,u+=(o.height-b)/2);break;case ve:if(S.y>=0&&(k>=O||g&&(f<=D||N>=T))){C=!1;break}R(ve),b+=S.y,b<0&&(m=he,b=-b,u-=b),g&&(p=b*g,f+=(o.width-p)/2);break;case Ce:if(g){if(S.y<=0&&(u<=M||N>=T)){C=!1;break}R(he),b-=S.y,u+=S.y,p=b*g}else R(he),R(ge),S.x>=0?N<T?p+=S.x:S.y<=0&&u<=M&&(C=!1):p+=S.x,S.y<=0?u>M&&(b-=S.y,u+=S.y):(b-=S.y,u+=S.y);p<0&&b<0?(m=Be,b=-b,p=-p,u-=b,f-=p):p<0?(m=Me,p=-p,f-=p):b<0&&(m=$e,b=-b,u-=b);break;case Me:if(g){if(S.y<=0&&(u<=M||f<=D)){C=!1;break}R(he),b-=S.y,u+=S.y,p=b*g,f+=o.width-p}else R(he),R(ye),S.x<=0?f>D?(p-=S.x,f+=S.x):S.y<=0&&u<=M&&(C=!1):(p-=S.x,f+=S.x),S.y<=0?u>M&&(b-=S.y,u+=S.y):(b-=S.y,u+=S.y);p<0&&b<0?(m=$e,b=-b,p=-p,u-=b,f-=p):p<0?(m=Ce,p=-p,f-=p):b<0&&(m=Be,b=-b,u-=b);break;case Be:if(g){if(S.x<=0&&(f<=D||k>=O)){C=!1;break}R(ye),p-=S.x,f+=S.x,b=p/g}else R(ve),R(ye),S.x<=0?f>D?(p-=S.x,f+=S.x):S.y>=0&&k>=O&&(C=!1):(p-=S.x,f+=S.x),S.y>=0?k<O&&(b+=S.y):b+=S.y;p<0&&b<0?(m=Ce,b=-b,p=-p,u-=b,f-=p):p<0?(m=$e,p=-p,f-=p):b<0&&(m=Me,b=-b,u-=b);break;case $e:if(g){if(S.x>=0&&(N>=T||k>=O)){C=!1;break}R(ge),p+=S.x,b=p/g}else R(ve),R(ge),S.x>=0?N<T?p+=S.x:S.y>=0&&k>=O&&(C=!1):p+=S.x,S.y>=0?k<O&&(b+=S.y):b+=S.y;p<0&&b<0?(m=Me,b=-b,p=-p,u-=b,f-=p):p<0?(m=Be,p=-p,f-=p):b<0&&(m=Ce,b=-b,u-=b);break;case Et:this.move(S.x,S.y),C=!1;break;case Nt:this.zoom(Xa(l),t),C=!1;break;case Dt:if(!S.x||!S.y){C=!1;break}J=Wt(this.cropper),f=F.startX-J.left,u=F.startY-J.top,p=o.minWidth,b=o.minHeight,S.x>0?m=S.y>0?$e:Ce:S.x<0&&(f-=p,m=S.y>0?Be:Me),S.y<0&&(u-=b),this.cropped||(de(this.cropBox,ee),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}C&&(o.width=p,o.height=b,o.left=f,o.top=u,this.action=m,this.renderCropBox()),X(l,function(K){K.startX=K.endX,K.startY=K.endY})}},ci={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Z(this.dragBox,Ue),de(this.cropBox,ee),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=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(),de(this.dragBox,Ue),Z(this.cropBox,ee)),this},replace:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),r?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,X(this.previews,function(a){a.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,de(this.cropper,Vt)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Z(this.cropper,Vt)),this},destroy:function(){var t=this.element;return t[H]?(t[H]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,s=a.left,o=a.top;return this.moveTo(ht(t)?t:s+Number(t),ht(r)?r:o+Number(r))},moveTo:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,s=!1;return t=Number(t),r=Number(r),this.ready&&!this.disabled&&this.options.movable&&(z(t)&&(a.left=t,s=!0),z(r)&&(a.top=r,s=!0),s&&this.renderCanvas(!0)),this},zoom:function(t,r){var a=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(a.width*t/a.naturalWidth,null,r)},zoomTo:function(t,r,a){var s=this.options,o=this.canvasData,l=o.width,m=o.height,g=o.naturalWidth,f=o.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&s.zoomable){var u=g*t,p=f*t;if(xe(this.element,dt,{ratio:t,oldRatio:l/g,originalEvent:a})===!1)return this;if(a){var b=this.pointers,N=Wt(this.cropper),k=b&&Object.keys(b).length?qa(b):{pageX:a.pageX,pageY:a.pageY};o.left-=(u-l)*((k.pageX-N.left-o.left)/l),o.top-=(p-m)*((k.pageY-N.top-o.top)/m)}else we(r)&&z(r.x)&&z(r.y)?(o.left-=(u-l)*((r.x-o.left)/l),o.top-=(p-m)*((r.y-o.top)/m)):(o.left-=(u-l)/2,o.top-=(p-m)/2);o.width=u,o.height=p,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),z(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var r=this.imageData.scaleY;return this.scale(t,z(r)?r:1)},scaleY:function(t){var r=this.imageData.scaleX;return this.scale(z(r)?r:1,t)},scale:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.imageData,s=!1;return t=Number(t),r=Number(r),this.ready&&!this.disabled&&this.options.scalable&&(z(t)&&(a.scaleX=t,s=!0),z(r)&&(a.scaleY=r,s=!0),s&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.options,a=this.imageData,s=this.canvasData,o=this.cropBoxData,l;if(this.ready&&this.cropped){l={x:o.left-s.left,y:o.top-s.top,width:o.width,height:o.height};var m=a.width/a.naturalWidth;if(X(l,function(u,p){l[p]=u/m}),t){var g=Math.round(l.y+l.height),f=Math.round(l.x+l.width);l.x=Math.round(l.x),l.y=Math.round(l.y),l.width=f-l.x,l.height=g-l.y}}else l={x:0,y:0,width:0,height:0};return r.rotatable&&(l.rotate=a.rotate||0),r.scalable&&(l.scaleX=a.scaleX||1,l.scaleY=a.scaleY||1),l},setData:function(t){var r=this.options,a=this.imageData,s=this.canvasData,o={};if(this.ready&&!this.disabled&&we(t)){var l=!1;r.rotatable&&z(t.rotate)&&t.rotate!==a.rotate&&(a.rotate=t.rotate,l=!0),r.scalable&&(z(t.scaleX)&&t.scaleX!==a.scaleX&&(a.scaleX=t.scaleX,l=!0),z(t.scaleY)&&t.scaleY!==a.scaleY&&(a.scaleY=t.scaleY,l=!0)),l&&this.renderCanvas(!0,!0);var m=a.width/a.naturalWidth;z(t.x)&&(o.left=t.x*m+s.left),z(t.y)&&(o.top=t.y*m+s.top),z(t.width)&&(o.width=t.width*m),z(t.height)&&(o.height=t.height*m),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?U({},this.containerData):{}},getImageData:function(){return this.sized?U({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,r={};return this.ready&&X(["left","top","width","height","naturalWidth","naturalHeight"],function(a){r[a]=t[a]}),r},setCanvasData:function(t){var r=this.canvasData,a=r.aspectRatio;return this.ready&&!this.disabled&&we(t)&&(z(t.left)&&(r.left=t.left),z(t.top)&&(r.top=t.top),z(t.width)?(r.width=t.width,r.height=t.width/a):z(t.height)&&(r.height=t.height,r.width=t.height*a),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,r;return this.ready&&this.cropped&&(r={left:t.left,top:t.top,width:t.width,height:t.height}),r||{}},setCropBoxData:function(t){var r=this.cropBoxData,a=this.options.aspectRatio,s,o;return this.ready&&this.cropped&&!this.disabled&&we(t)&&(z(t.left)&&(r.left=t.left),z(t.top)&&(r.top=t.top),z(t.width)&&t.width!==r.width&&(s=!0,r.width=t.width),z(t.height)&&t.height!==r.height&&(o=!0,r.height=t.height),a&&(s?r.height=r.width/a:o&&(r.width=r.height*a)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var r=this.canvasData,a=Ja(this.image,this.imageData,r,t);if(!this.cropped)return a;var s=this.getData(),o=s.x,l=s.y,m=s.width,g=s.height,f=a.width/Math.floor(r.naturalWidth);f!==1&&(o*=f,l*=f,m*=f,g*=f);var u=m/g,p=me({aspectRatio:u,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),b=me({aspectRatio:u,width:t.minWidth||0,height:t.minHeight||0},"cover"),N=me({aspectRatio:u,width:t.width||(f!==1?a.width:m),height:t.height||(f!==1?a.height:g)}),k=N.width,D=N.height;k=Math.min(p.width,Math.max(b.width,k)),D=Math.min(p.height,Math.max(b.height,D));var M=document.createElement("canvas"),T=M.getContext("2d");M.width=ke(k),M.height=ke(D),T.fillStyle=t.fillColor||"transparent",T.fillRect(0,0,k,D);var O=t.imageSmoothingEnabled,C=O===void 0?!0:O,J=t.imageSmoothingQuality;T.imageSmoothingEnabled=C,J&&(T.imageSmoothingQuality=J);var F=a.width,S=a.height,R=o,K=l,Q,re,B,j,$,L;R<=-m||R>F?(R=0,Q=0,B=0,$=0):R<=0?(B=-R,R=0,Q=Math.min(F,m+R),$=Q):R<=F&&(B=0,Q=Math.min(m,F-R),$=Q),Q<=0||K<=-g||K>S?(K=0,re=0,j=0,L=0):K<=0?(j=-K,K=0,re=Math.min(S,g+K),L=re):K<=S&&(j=0,re=Math.min(g,S-K),L=re);var P=[R,K,Q,re];if($>0&&L>0){var q=k/m;P.push(B*q,j*q,$*q,L*q)}return T.drawImage.apply(T,[a].concat(St(P.map(function(Y){return Math.floor(ke(Y))})))),M},setAspectRatio:function(t){var r=this.options;return!this.disabled&&!ht(t)&&(r.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var r=this.options,a=this.dragBox,s=this.face;if(this.ready&&!this.disabled){var o=t===at,l=r.movable&&t===Mt;t=o||l?t:$t,r.dragMode=t,Ae(a,Te,t),_e(a,nt,o),_e(a,ot,l),r.cropBoxMovable||(Ae(s,Te,t),_e(s,nt,o),_e(s,ot,l))}return this}},di=ce.Cropper,Jt=function(){function i(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(xa(this,i),!t||!Pa.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({},Ht,we(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Sa(i,[{key:"init",value:function(){var r=this.element,a=r.tagName.toLowerCase(),s;if(!r[H]){if(r[H]=this,a==="img"){if(this.isImg=!0,s=r.getAttribute("src")||"",this.originalUrl=s,!s)return;s=r.src}else a==="canvas"&&window.HTMLCanvasElement&&(s=r.toDataURL());this.load(s)}}},{key:"load",value:function(r){var a=this;if(!!r){this.url=r,this.imageData={};var s=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Oa.test(r)){ja.test(r)?this.read(ei(r)):this.clone();return}var l=new XMLHttpRequest,m=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=m,l.onerror=m,l.ontimeout=m,l.onprogress=function(){l.getResponseHeader("content-type")!==Lt&&l.abort()},l.onload=function(){a.read(l.response)},l.onloadend=function(){a.reloading=!1,a.xhr=null},o.checkCrossOrigin&&Xt(r)&&s.crossOrigin&&(r=qt(r)),l.open("GET",r,!0),l.responseType="arraybuffer",l.withCredentials=s.crossOrigin==="use-credentials",l.send()}}},{key:"read",value:function(r){var a=this.options,s=this.imageData,o=ri(r),l=0,m=1,g=1;if(o>1){this.url=ti(r,Lt);var f=ni(o);l=f.rotate,m=f.scaleX,g=f.scaleY}a.rotatable&&(s.rotate=l),a.scalable&&(s.scaleX=m,s.scaleY=g),this.clone()}},{key:"clone",value:function(){var r=this.element,a=this.url,s=r.crossOrigin,o=a;this.options.checkCrossOrigin&&Xt(a)&&(s||(s="anonymous"),o=qt(a)),this.crossOrigin=s,this.crossOriginUrl=o;var l=document.createElement("img");s&&(l.crossOrigin=s),l.src=o||a,l.alt=r.alt||"The image to crop",this.image=l,l.onload=this.start.bind(this),l.onerror=this.stop.bind(this),Z(l,Ct),r.parentNode.insertBefore(l,r.nextSibling)}},{key:"start",value:function(){var r=this,a=this.image;a.onload=null,a.onerror=null,this.sizing=!0;var s=ce.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ce.navigator.userAgent),o=function(f,u){U(r.imageData,{naturalWidth:f,naturalHeight:u,aspectRatio:f/u}),r.initialImageData=U({},r.imageData),r.sizing=!1,r.sized=!0,r.build()};if(a.naturalWidth&&!s){o(a.naturalWidth,a.naturalHeight);return}var l=document.createElement("img"),m=document.body||document.documentElement;this.sizingImage=l,l.onload=function(){o(l.width,l.height),s||m.removeChild(l)},l.src=a.src,s||(l.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",m.appendChild(l))}},{key:"stop",value:function(){var r=this.image;r.onload=null,r.onerror=null,r.parentNode.removeChild(r),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var r=this.element,a=this.options,s=this.image,o=r.parentNode,l=document.createElement("div");l.innerHTML=Ia;var m=l.querySelector(".".concat(H,"-container")),g=m.querySelector(".".concat(H,"-canvas")),f=m.querySelector(".".concat(H,"-drag-box")),u=m.querySelector(".".concat(H,"-crop-box")),p=u.querySelector(".".concat(H,"-face"));this.container=o,this.cropper=m,this.canvas=g,this.dragBox=f,this.cropBox=u,this.viewBox=m.querySelector(".".concat(H,"-view-box")),this.face=p,g.appendChild(s),Z(r,ee),o.insertBefore(m,r.nextSibling),this.isImg||de(s,Ct),this.initPreview(),this.bind(),a.initialAspectRatio=Math.max(0,a.initialAspectRatio)||NaN,a.aspectRatio=Math.max(0,a.aspectRatio)||NaN,a.viewMode=Math.max(0,Math.min(3,Math.round(a.viewMode)))||0,Z(u,ee),a.guides||Z(u.getElementsByClassName("".concat(H,"-dashed")),ee),a.center||Z(u.getElementsByClassName("".concat(H,"-center")),ee),a.background&&Z(m,"".concat(H,"-bg")),a.highlight||Z(p,Ma),a.cropBoxMovable&&(Z(p,ot),Ae(p,Te,rt)),a.cropBoxResizable||(Z(u.getElementsByClassName("".concat(H,"-line")),ee),Z(u.getElementsByClassName("".concat(H,"-point")),ee)),this.render(),this.ready=!0,this.setDragMode(a.dragMode),a.autoCrop&&this.crop(),this.setData(a.data),te(a.ready)&&oe(r,jt,a.ready,{once:!0}),xe(r,jt)}}},{key:"unbuild",value:function(){!this.ready||(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),de(this.element,ee))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=di,i}},{key:"setDefaults",value:function(r){U(Ht,we(r)&&r)}}]),i}();U(Jt.prototype,oi,ai,ii,si,li,ci);const hi={class:"flex"},ui={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},mi={class:"ml-auto mb-2"},fi={class:"w-full flex justify-center"},pi=["src"],gi={__name:"Image",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{t:a}=e.inject("i18n"),{apiUrl:s}=ie(),o=e.ref(null),l=e.ref(null),m=e.ref(!1),g=e.ref(""),f=e.ref(!1),u=()=>{m.value=!m.value,m.value?l.value=new Jt(o.value,{crop(N){}}):l.value.destroy()},p=e.inject("ajaxData"),b=()=>{l.value.getCroppedCanvas({width:795,height:341}).toBlob(N=>{g.value="",f.value=!1,Le(s.value,{method:"POST",params:{q:"upload",adapter:r.selection.adapter,path:r.selection.item.path,file:N},name:r.selection.item.basename,json:!1,...p}).then(k=>{g.value=a("Updated."),o.value.src=Ze(r.selection.adapter,r.selection.item.path),u(),t("load")}).catch(k=>{g.value=a(k.message),f.value=!0})})};return e.onMounted(()=>{t("load")}),(N,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",hi,[e.createElementVNode("h3",ui,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",mi,[m.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:b,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Crop")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:k[0]||(k[0]=D=>u())},e.toDisplayString(m.value?e.unref(a)("Cancel"):e.unref(a)("Edit")),1)])]),e.createElementVNode("div",fi,[e.createElementVNode("img",{ref_key:"image",ref:o,class:"max-w-[60vh] max-h-[60vh]",src:e.unref(Ze)(r.selection.adapter,r.selection.item.path),alt:""},null,8,pi)]),g.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},yi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},bi=e.createElementVNode("div",null," Default view.. ",-1),vi={__name:"Default",props:{selection:Object},emits:["load"],setup(i,{emit:t}){return e.onMounted(()=>{t("load")}),(r,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",yi,e.toDisplayString(i.selection.item.basename),1),bi],64))}},wi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ki={class:"w-full",preload:"",controls:""},_i=["src"],xi=e.createTextVNode(" Your browser does not support the video tag. "),Si={__name:"Video",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{apiUrl:a}=ie(),s=()=>a.value+"?"+pe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",wi,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("video",ki,[e.createElementVNode("source",{src:s(),type:"video/mp4"},null,8,_i),xi])])],64))}},Di={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ei={class:"w-full",controls:""},Ni=["src"],Vi=e.createTextVNode(" Your browser does not support the audio element. "),Ci={__name:"Audio",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{apiUrl:a}=ie(),s=()=>a.value+"?"+pe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",Di,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("audio",Ei,[e.createElementVNode("source",{src:s(),type:"audio/mpeg"},null,8,Ni),Vi])])],64))}},Mi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},$i=["data"],Bi=["src"],Ti={__name:"Pdf",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{apiUrl:a}=ie(),s=()=>a.value+"?"+pe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",Mi,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:s(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:s(),width:"100%",height:"100%"},`
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var He=typeof window<"u"&&typeof window.document<"u",ce=He?window:{},et=He&&ce.document.documentElement?"ontouchstart"in ce.document.documentElement:!1,tt=He?"PointerEvent"in ce:!1,H="cropper",rt="all",Dt="crop",Et="move",Nt="zoom",ge="e",ye="w",ve="s",he="n",Ce="ne",Me="nw",$e="se",Be="sw",nt="".concat(H,"-crop"),Vt="".concat(H,"-disabled"),ee="".concat(H,"-hidden"),Ct="".concat(H,"-hide"),Ma="".concat(H,"-invisible"),Ue="".concat(H,"-modal"),ot="".concat(H,"-move"),Te="".concat(H,"Action"),Fe="".concat(H,"Preview"),at="crop",Mt="move",$t="none",it="crop",st="cropend",lt="cropmove",ct="cropstart",Bt="dblclick",$a=et?"touchstart":"mousedown",Ba=et?"touchmove":"mousemove",Ta=et?"touchend touchcancel":"mouseup",Tt=tt?"pointerdown":$a,At=tt?"pointermove":Ba,Ot=tt?"pointerup pointercancel":Ta,jt="ready",Pt="resize",It="wheel",dt="zoom",Lt="image/jpeg",Aa=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Oa=/^data:/,ja=/^data:image\/jpeg;base64,/,Pa=/^img|canvas$/i,zt=200,Rt=100,Ht={viewMode:0,dragMode:at,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:zt,minContainerHeight:Rt,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Ia='<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>',La=Number.isNaN||ce.isNaN;function z(i){return typeof i=="number"&&!La(i)}var Ut=function(t){return t>0&&t<1/0};function ht(i){return typeof i>"u"}function be(i){return Re(i)==="object"&&i!==null}var za=Object.prototype.hasOwnProperty;function we(i){if(!be(i))return!1;try{var t=i.constructor,r=t.prototype;return t&&r&&za.call(r,"isPrototypeOf")}catch{return!1}}function te(i){return typeof i=="function"}var Ra=Array.prototype.slice;function Ft(i){return Array.from?Array.from(i):Ra.call(i)}function X(i,t){return i&&te(t)&&(Array.isArray(i)||z(i.length)?Ft(i).forEach(function(r,a){t.call(i,r,a,i)}):be(i)&&Object.keys(i).forEach(function(r){t.call(i,i[r],r,i)})),i}var U=Object.assign||function(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return be(t)&&a.length>0&&a.forEach(function(o){be(o)&&Object.keys(o).forEach(function(l){t[l]=o[l]})}),t},Ha=/\.\d*(?:0|9){12}\d*$/;function ke(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ha.test(i)?Math.round(i*t)/t:i}var Ua=/^width|height|left|top|marginLeft|marginTop$/;function ue(i,t){var r=i.style;X(t,function(a,s){Ua.test(s)&&z(a)&&(a="".concat(a,"px")),r[s]=a})}function Fa(i,t){return i.classList?i.classList.contains(t):i.className.indexOf(t)>-1}function Z(i,t){if(!!t){if(z(i.length)){X(i,function(a){Z(a,t)});return}if(i.classList){i.classList.add(t);return}var r=i.className.trim();r?r.indexOf(t)<0&&(i.className="".concat(r," ").concat(t)):i.className=t}}function de(i,t){if(!!t){if(z(i.length)){X(i,function(r){de(r,t)});return}if(i.classList){i.classList.remove(t);return}i.className.indexOf(t)>=0&&(i.className=i.className.replace(t,""))}}function _e(i,t,r){if(!!t){if(z(i.length)){X(i,function(a){_e(a,t,r)});return}r?Z(i,t):de(i,t)}}var Ka=/([a-z\d])([A-Z])/g;function ut(i){return i.replace(Ka,"$1-$2").toLowerCase()}function mt(i,t){return be(i[t])?i[t]:i.dataset?i.dataset[t]:i.getAttribute("data-".concat(ut(t)))}function Ae(i,t,r){be(r)?i[t]=r:i.dataset?i.dataset[t]=r:i.setAttribute("data-".concat(ut(t)),r)}function Ya(i,t){if(be(i[t]))try{delete i[t]}catch{i[t]=void 0}else if(i.dataset)try{delete i.dataset[t]}catch{i.dataset[t]=void 0}else i.removeAttribute("data-".concat(ut(t)))}var Kt=/\s\s*/,Yt=function(){var i=!1;if(He){var t=!1,r=function(){},a=Object.defineProperty({},"once",{get:function(){return i=!0,t},set:function(o){t=o}});ce.addEventListener("test",r,a),ce.removeEventListener("test",r,a)}return i}();function ae(i,t,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r;t.trim().split(Kt).forEach(function(o){if(!Yt){var l=i.listeners;l&&l[o]&&l[o][r]&&(s=l[o][r],delete l[o][r],Object.keys(l[o]).length===0&&delete l[o],Object.keys(l).length===0&&delete i.listeners)}i.removeEventListener(o,s,a)})}function oe(i,t,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=r;t.trim().split(Kt).forEach(function(o){if(a.once&&!Yt){var l=i.listeners,m=l===void 0?{}:l;s=function(){delete m[o][r],i.removeEventListener(o,s,a);for(var f=arguments.length,u=new Array(f),p=0;p<f;p++)u[p]=arguments[p];r.apply(i,u)},m[o]||(m[o]={}),m[o][r]&&i.removeEventListener(o,m[o][r],a),m[o][r]=s,i.listeners=m}i.addEventListener(o,s,a)})}function xe(i,t,r){var a;return te(Event)&&te(CustomEvent)?a=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent"),a.initCustomEvent(t,!0,!0,r)),i.dispatchEvent(a)}function Wt(i){var t=i.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var ft=ce.location,Wa=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Xt(i){var t=i.match(Wa);return t!==null&&(t[1]!==ft.protocol||t[2]!==ft.hostname||t[3]!==ft.port)}function qt(i){var t="timestamp=".concat(new Date().getTime());return i+(i.indexOf("?")===-1?"?":"&")+t}function Oe(i){var t=i.rotate,r=i.scaleX,a=i.scaleY,s=i.translateX,o=i.translateY,l=[];z(s)&&s!==0&&l.push("translateX(".concat(s,"px)")),z(o)&&o!==0&&l.push("translateY(".concat(o,"px)")),z(t)&&t!==0&&l.push("rotate(".concat(t,"deg)")),z(r)&&r!==1&&l.push("scaleX(".concat(r,")")),z(a)&&a!==1&&l.push("scaleY(".concat(a,")"));var m=l.length?l.join(" "):"none";return{WebkitTransform:m,msTransform:m,transform:m}}function Xa(i){var t=_t({},i),r=0;return X(i,function(a,s){delete t[s],X(t,function(o){var l=Math.abs(a.startX-o.startX),m=Math.abs(a.startY-o.startY),g=Math.abs(a.endX-o.endX),f=Math.abs(a.endY-o.endY),u=Math.sqrt(l*l+m*m),p=Math.sqrt(g*g+f*f),b=(p-u)/u;Math.abs(b)>Math.abs(r)&&(r=b)})}),r}function Ke(i,t){var r=i.pageX,a=i.pageY,s={endX:r,endY:a};return t?s:_t({startX:r,startY:a},s)}function qa(i){var t=0,r=0,a=0;return X(i,function(s){var o=s.startX,l=s.startY;t+=o,r+=l,a+=1}),t/=a,r/=a,{pageX:t,pageY:r}}function me(i){var t=i.aspectRatio,r=i.height,a=i.width,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=Ut(a),l=Ut(r);if(o&&l){var m=r*t;s==="contain"&&m>a||s==="cover"&&m<a?r=a/t:a=r*t}else o?r=a/t:l&&(a=r*t);return{width:a,height:r}}function Ga(i){var t=i.width,r=i.height,a=i.degree;if(a=Math.abs(a)%180,a===90)return{width:r,height:t};var s=a%90*Math.PI/180,o=Math.sin(s),l=Math.cos(s),m=t*l+r*o,g=t*o+r*l;return a>90?{width:g,height:m}:{width:m,height:g}}function Ja(i,t,r,a){var s=t.aspectRatio,o=t.naturalWidth,l=t.naturalHeight,m=t.rotate,g=m===void 0?0:m,f=t.scaleX,u=f===void 0?1:f,p=t.scaleY,b=p===void 0?1:p,N=r.aspectRatio,k=r.naturalWidth,D=r.naturalHeight,M=a.fillColor,T=M===void 0?"transparent":M,O=a.imageSmoothingEnabled,C=O===void 0?!0:O,J=a.imageSmoothingQuality,F=J===void 0?"low":J,S=a.maxWidth,R=S===void 0?1/0:S,K=a.maxHeight,Q=K===void 0?1/0:K,re=a.minWidth,B=re===void 0?0:re,j=a.minHeight,$=j===void 0?0:j,L=document.createElement("canvas"),P=L.getContext("2d"),q=me({aspectRatio:N,width:R,height:Q}),Y=me({aspectRatio:N,width:B,height:$},"cover"),je=Math.min(q.width,Math.max(Y.width,k)),Pe=Math.min(q.height,Math.max(Y.height,D)),Ye=me({aspectRatio:s,width:R,height:Q}),We=me({aspectRatio:s,width:B,height:$},"cover"),Xe=Math.min(Ye.width,Math.max(We.width,o)),Se=Math.min(Ye.height,Math.max(We.height,l)),gt=[-Xe/2,-Se/2,Xe,Se];return L.width=ke(je),L.height=ke(Pe),P.fillStyle=T,P.fillRect(0,0,je,Pe),P.save(),P.translate(je/2,Pe/2),P.rotate(g*Math.PI/180),P.scale(u,b),P.imageSmoothingEnabled=C,P.imageSmoothingQuality=F,P.drawImage.apply(P,[i].concat(St(gt.map(function(De){return Math.floor(ke(De))})))),P.restore(),L}var Gt=String.fromCharCode;function Za(i,t,r){var a="";r+=t;for(var s=t;s<r;s+=1)a+=Gt(i.getUint8(s));return a}var Qa=/^data:.*,/;function ei(i){var t=i.replace(Qa,""),r=atob(t),a=new ArrayBuffer(r.length),s=new Uint8Array(a);return X(s,function(o,l){s[l]=r.charCodeAt(l)}),a}function ti(i,t){for(var r=[],a=8192,s=new Uint8Array(i);s.length>0;)r.push(Gt.apply(null,Ft(s.subarray(0,a)))),s=s.subarray(a);return"data:".concat(t,";base64,").concat(btoa(r.join("")))}function ri(i){var t=new DataView(i),r;try{var a,s,o;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var l=t.byteLength,m=2;m+1<l;){if(t.getUint8(m)===255&&t.getUint8(m+1)===225){s=m;break}m+=1}if(s){var g=s+4,f=s+10;if(Za(t,g,4)==="Exif"){var u=t.getUint16(f);if(a=u===18761,(a||u===19789)&&t.getUint16(f+2,a)===42){var p=t.getUint32(f+4,a);p>=8&&(o=f+p)}}}if(o){var b=t.getUint16(o,a),N,k;for(k=0;k<b;k+=1)if(N=o+k*12+2,t.getUint16(N,a)===274){N+=8,r=t.getUint16(N,a),t.setUint16(N,1,a);break}}}catch{r=1}return r}function ni(i){var t=0,r=1,a=1;switch(i){case 2:r=-1;break;case 3:t=-180;break;case 4:a=-1;break;case 5:t=90,a=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:r,scaleY:a}}var oi={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,r=this.options,a=this.container,s=this.cropper,o=Number(r.minContainerWidth),l=Number(r.minContainerHeight);Z(s,ee),de(t,ee);var m={width:Math.max(a.offsetWidth,o>=0?o:zt),height:Math.max(a.offsetHeight,l>=0?l:Rt)};this.containerData=m,ue(s,{width:m.width,height:m.height}),Z(t,ee),de(s,ee)},initCanvas:function(){var t=this.containerData,r=this.imageData,a=this.options.viewMode,s=Math.abs(r.rotate)%180===90,o=s?r.naturalHeight:r.naturalWidth,l=s?r.naturalWidth:r.naturalHeight,m=o/l,g=t.width,f=t.height;t.height*m>t.width?a===3?g=t.height*m:f=t.width/m:a===3?f=t.width/m:g=t.height*m;var u={aspectRatio:m,naturalWidth:o,naturalHeight:l,width:g,height:f};this.canvasData=u,this.limited=a===1||a===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(t.width-u.width)/2,u.top=(t.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=U({},u)},limitCanvas:function(t,r){var a=this.options,s=this.containerData,o=this.canvasData,l=this.cropBoxData,m=a.viewMode,g=o.aspectRatio,f=this.cropped&&l;if(t){var u=Number(a.minCanvasWidth)||0,p=Number(a.minCanvasHeight)||0;m>1?(u=Math.max(u,s.width),p=Math.max(p,s.height),m===3&&(p*g>u?u=p*g:p=u/g)):m>0&&(u?u=Math.max(u,f?l.width:0):p?p=Math.max(p,f?l.height:0):f&&(u=l.width,p=l.height,p*g>u?u=p*g:p=u/g));var b=me({aspectRatio:g,width:u,height:p});u=b.width,p=b.height,o.minWidth=u,o.minHeight=p,o.maxWidth=1/0,o.maxHeight=1/0}if(r)if(m>(f?0:1)){var N=s.width-o.width,k=s.height-o.height;o.minLeft=Math.min(0,N),o.minTop=Math.min(0,k),o.maxLeft=Math.max(0,N),o.maxTop=Math.max(0,k),f&&this.limited&&(o.minLeft=Math.min(l.left,l.left+(l.width-o.width)),o.minTop=Math.min(l.top,l.top+(l.height-o.height)),o.maxLeft=l.left,o.maxTop=l.top,m===2&&(o.width>=s.width&&(o.minLeft=Math.min(0,N),o.maxLeft=Math.max(0,N)),o.height>=s.height&&(o.minTop=Math.min(0,k),o.maxTop=Math.max(0,k))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=s.width,o.maxTop=s.height},renderCanvas:function(t,r){var a=this.canvasData,s=this.imageData;if(r){var o=Ga({width:s.naturalWidth*Math.abs(s.scaleX||1),height:s.naturalHeight*Math.abs(s.scaleY||1),degree:s.rotate||0}),l=o.width,m=o.height,g=a.width*(l/a.naturalWidth),f=a.height*(m/a.naturalHeight);a.left-=(g-a.width)/2,a.top-=(f-a.height)/2,a.width=g,a.height=f,a.aspectRatio=l/m,a.naturalWidth=l,a.naturalHeight=m,this.limitCanvas(!0,!1)}(a.width>a.maxWidth||a.width<a.minWidth)&&(a.left=a.oldLeft),(a.height>a.maxHeight||a.height<a.minHeight)&&(a.top=a.oldTop),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),this.limitCanvas(!1,!0),a.left=Math.min(Math.max(a.left,a.minLeft),a.maxLeft),a.top=Math.min(Math.max(a.top,a.minTop),a.maxTop),a.oldLeft=a.left,a.oldTop=a.top,ue(this.canvas,U({width:a.width,height:a.height},Oe({translateX:a.left,translateY:a.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var r=this.canvasData,a=this.imageData,s=a.naturalWidth*(r.width/r.naturalWidth),o=a.naturalHeight*(r.height/r.naturalHeight);U(a,{width:s,height:o,left:(r.width-s)/2,top:(r.height-o)/2}),ue(this.image,U({width:a.width,height:a.height},Oe(U({translateX:a.left,translateY:a.top},a)))),t&&this.output()},initCropBox:function(){var t=this.options,r=this.canvasData,a=t.aspectRatio||t.initialAspectRatio,s=Number(t.autoCropArea)||.8,o={width:r.width,height:r.height};a&&(r.height*a>r.width?o.height=o.width/a:o.width=o.height*a),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*s),o.height=Math.max(o.minHeight,o.height*s),o.left=r.left+(r.width-o.width)/2,o.top=r.top+(r.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=U({},o)},limitCropBox:function(t,r){var a=this.options,s=this.containerData,o=this.canvasData,l=this.cropBoxData,m=this.limited,g=a.aspectRatio;if(t){var f=Number(a.minCropBoxWidth)||0,u=Number(a.minCropBoxHeight)||0,p=m?Math.min(s.width,o.width,o.width+o.left,s.width-o.left):s.width,b=m?Math.min(s.height,o.height,o.height+o.top,s.height-o.top):s.height;f=Math.min(f,s.width),u=Math.min(u,s.height),g&&(f&&u?u*g>f?u=f/g:f=u*g:f?u=f/g:u&&(f=u*g),b*g>p?b=p/g:p=b*g),l.minWidth=Math.min(f,p),l.minHeight=Math.min(u,b),l.maxWidth=p,l.maxHeight=b}r&&(m?(l.minLeft=Math.max(0,o.left),l.minTop=Math.max(0,o.top),l.maxLeft=Math.min(s.width,o.left+o.width)-l.width,l.maxTop=Math.min(s.height,o.top+o.height)-l.height):(l.minLeft=0,l.minTop=0,l.maxLeft=s.width-l.width,l.maxTop=s.height-l.height))},renderCropBox:function(){var t=this.options,r=this.containerData,a=this.cropBoxData;(a.width>a.maxWidth||a.width<a.minWidth)&&(a.left=a.oldLeft),(a.height>a.maxHeight||a.height<a.minHeight)&&(a.top=a.oldTop),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),this.limitCropBox(!1,!0),a.left=Math.min(Math.max(a.left,a.minLeft),a.maxLeft),a.top=Math.min(Math.max(a.top,a.minTop),a.maxTop),a.oldLeft=a.left,a.oldTop=a.top,t.movable&&t.cropBoxMovable&&Ae(this.face,Te,a.width>=r.width&&a.height>=r.height?Et:rt),ue(this.cropBox,U({width:a.width,height:a.height},Oe({translateX:a.left,translateY:a.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),xe(this.element,it,this.getData())}},ai={initPreview:function(){var t=this.element,r=this.crossOrigin,a=this.options.preview,s=r?this.crossOriginUrl:this.url,o=t.alt||"The image to preview",l=document.createElement("img");if(r&&(l.crossOrigin=r),l.src=s,l.alt=o,this.viewBox.appendChild(l),this.viewBoxImage=l,!!a){var m=a;typeof a=="string"?m=t.ownerDocument.querySelectorAll(a):a.querySelector&&(m=[a]),this.previews=m,X(m,function(g){var f=document.createElement("img");Ae(g,Fe,{width:g.offsetWidth,height:g.offsetHeight,html:g.innerHTML}),r&&(f.crossOrigin=r),f.src=s,f.alt=o,f.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',g.innerHTML="",g.appendChild(f)})}},resetPreview:function(){X(this.previews,function(t){var r=mt(t,Fe);ue(t,{width:r.width,height:r.height}),t.innerHTML=r.html,Ya(t,Fe)})},preview:function(){var t=this.imageData,r=this.canvasData,a=this.cropBoxData,s=a.width,o=a.height,l=t.width,m=t.height,g=a.left-r.left-t.left,f=a.top-r.top-t.top;!this.cropped||this.disabled||(ue(this.viewBoxImage,U({width:l,height:m},Oe(U({translateX:-g,translateY:-f},t)))),X(this.previews,function(u){var p=mt(u,Fe),b=p.width,N=p.height,k=b,D=N,M=1;s&&(M=b/s,D=o*M),o&&D>N&&(M=N/o,k=s*M,D=N),ue(u,{width:k,height:D}),ue(u.getElementsByTagName("img")[0],U({width:l*M,height:m*M},Oe(U({translateX:-g*M,translateY:-f*M},t))))}))}},ii={bind:function(){var t=this.element,r=this.options,a=this.cropper;te(r.cropstart)&&oe(t,ct,r.cropstart),te(r.cropmove)&&oe(t,lt,r.cropmove),te(r.cropend)&&oe(t,st,r.cropend),te(r.crop)&&oe(t,it,r.crop),te(r.zoom)&&oe(t,dt,r.zoom),oe(a,Tt,this.onCropStart=this.cropStart.bind(this)),r.zoomable&&r.zoomOnWheel&&oe(a,It,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&oe(a,Bt,this.onDblclick=this.dblclick.bind(this)),oe(t.ownerDocument,At,this.onCropMove=this.cropMove.bind(this)),oe(t.ownerDocument,Ot,this.onCropEnd=this.cropEnd.bind(this)),r.responsive&&oe(window,Pt,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,r=this.options,a=this.cropper;te(r.cropstart)&&ae(t,ct,r.cropstart),te(r.cropmove)&&ae(t,lt,r.cropmove),te(r.cropend)&&ae(t,st,r.cropend),te(r.crop)&&ae(t,it,r.crop),te(r.zoom)&&ae(t,dt,r.zoom),ae(a,Tt,this.onCropStart),r.zoomable&&r.zoomOnWheel&&ae(a,It,this.onWheel,{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&ae(a,Bt,this.onDblclick),ae(t.ownerDocument,At,this.onCropMove),ae(t.ownerDocument,Ot,this.onCropEnd),r.responsive&&ae(window,Pt,this.onResize)}},si={resize:function(){if(!this.disabled){var t=this.options,r=this.container,a=this.containerData,s=r.offsetWidth/a.width,o=r.offsetHeight/a.height,l=Math.abs(s-1)>Math.abs(o-1)?s:o;if(l!==1){var m,g;t.restore&&(m=this.getCanvasData(),g=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(X(m,function(f,u){m[u]=f*l})),this.setCropBoxData(X(g,function(f,u){g[u]=f*l})))}}},dblclick:function(){this.disabled||this.options.dragMode===$t||this.setDragMode(Fa(this.dragBox,nt)?Mt:at)},wheel:function(t){var r=this,a=Number(this.options.wheelZoomRatio)||.1,s=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){r.wheeling=!1},50),t.deltaY?s=t.deltaY>0?1:-1:t.wheelDelta?s=-t.wheelDelta/120:t.detail&&(s=t.detail>0?1:-1),this.zoom(-s*a,t)))},cropStart:function(t){var r=t.buttons,a=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(z(r)&&r!==1||z(a)&&a!==0||t.ctrlKey))){var s=this.options,o=this.pointers,l;t.changedTouches?X(t.changedTouches,function(m){o[m.identifier]=Ke(m)}):o[t.pointerId||0]=Ke(t),Object.keys(o).length>1&&s.zoomable&&s.zoomOnTouch?l=Nt:l=mt(t.target,Te),!!Aa.test(l)&&xe(this.element,ct,{originalEvent:t,action:l})!==!1&&(t.preventDefault(),this.action=l,this.cropping=!1,l===Dt&&(this.cropping=!0,Z(this.dragBox,Ue)))}},cropMove:function(t){var r=this.action;if(!(this.disabled||!r)){var a=this.pointers;t.preventDefault(),xe(this.element,lt,{originalEvent:t,action:r})!==!1&&(t.changedTouches?X(t.changedTouches,function(s){U(a[s.identifier]||{},Ke(s,!0))}):U(a[t.pointerId||0]||{},Ke(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var r=this.action,a=this.pointers;t.changedTouches?X(t.changedTouches,function(s){delete a[s.identifier]}):delete a[t.pointerId||0],r&&(t.preventDefault(),Object.keys(a).length||(this.action=""),this.cropping&&(this.cropping=!1,_e(this.dragBox,Ue,this.cropped&&this.options.modal)),xe(this.element,st,{originalEvent:t,action:r}))}}},li={change:function(t){var r=this.options,a=this.canvasData,s=this.containerData,o=this.cropBoxData,l=this.pointers,m=this.action,g=r.aspectRatio,f=o.left,u=o.top,p=o.width,b=o.height,N=f+p,k=u+b,D=0,M=0,T=s.width,O=s.height,C=!0,J;!g&&t.shiftKey&&(g=p&&b?p/b:1),this.limited&&(D=o.minLeft,M=o.minTop,T=D+Math.min(s.width,a.width,a.left+a.width),O=M+Math.min(s.height,a.height,a.top+a.height));var F=l[Object.keys(l)[0]],S={x:F.endX-F.startX,y:F.endY-F.startY},R=function(Q){switch(Q){case ge:N+S.x>T&&(S.x=T-N);break;case ye:f+S.x<D&&(S.x=D-f);break;case he:u+S.y<M&&(S.y=M-u);break;case ve:k+S.y>O&&(S.y=O-k);break}};switch(m){case rt:f+=S.x,u+=S.y;break;case ge:if(S.x>=0&&(N>=T||g&&(u<=M||k>=O))){C=!1;break}R(ge),p+=S.x,p<0&&(m=ye,p=-p,f-=p),g&&(b=p/g,u+=(o.height-b)/2);break;case he:if(S.y<=0&&(u<=M||g&&(f<=D||N>=T))){C=!1;break}R(he),b-=S.y,u+=S.y,b<0&&(m=ve,b=-b,u-=b),g&&(p=b*g,f+=(o.width-p)/2);break;case ye:if(S.x<=0&&(f<=D||g&&(u<=M||k>=O))){C=!1;break}R(ye),p-=S.x,f+=S.x,p<0&&(m=ge,p=-p,f-=p),g&&(b=p/g,u+=(o.height-b)/2);break;case ve:if(S.y>=0&&(k>=O||g&&(f<=D||N>=T))){C=!1;break}R(ve),b+=S.y,b<0&&(m=he,b=-b,u-=b),g&&(p=b*g,f+=(o.width-p)/2);break;case Ce:if(g){if(S.y<=0&&(u<=M||N>=T)){C=!1;break}R(he),b-=S.y,u+=S.y,p=b*g}else R(he),R(ge),S.x>=0?N<T?p+=S.x:S.y<=0&&u<=M&&(C=!1):p+=S.x,S.y<=0?u>M&&(b-=S.y,u+=S.y):(b-=S.y,u+=S.y);p<0&&b<0?(m=Be,b=-b,p=-p,u-=b,f-=p):p<0?(m=Me,p=-p,f-=p):b<0&&(m=$e,b=-b,u-=b);break;case Me:if(g){if(S.y<=0&&(u<=M||f<=D)){C=!1;break}R(he),b-=S.y,u+=S.y,p=b*g,f+=o.width-p}else R(he),R(ye),S.x<=0?f>D?(p-=S.x,f+=S.x):S.y<=0&&u<=M&&(C=!1):(p-=S.x,f+=S.x),S.y<=0?u>M&&(b-=S.y,u+=S.y):(b-=S.y,u+=S.y);p<0&&b<0?(m=$e,b=-b,p=-p,u-=b,f-=p):p<0?(m=Ce,p=-p,f-=p):b<0&&(m=Be,b=-b,u-=b);break;case Be:if(g){if(S.x<=0&&(f<=D||k>=O)){C=!1;break}R(ye),p-=S.x,f+=S.x,b=p/g}else R(ve),R(ye),S.x<=0?f>D?(p-=S.x,f+=S.x):S.y>=0&&k>=O&&(C=!1):(p-=S.x,f+=S.x),S.y>=0?k<O&&(b+=S.y):b+=S.y;p<0&&b<0?(m=Ce,b=-b,p=-p,u-=b,f-=p):p<0?(m=$e,p=-p,f-=p):b<0&&(m=Me,b=-b,u-=b);break;case $e:if(g){if(S.x>=0&&(N>=T||k>=O)){C=!1;break}R(ge),p+=S.x,b=p/g}else R(ve),R(ge),S.x>=0?N<T?p+=S.x:S.y>=0&&k>=O&&(C=!1):p+=S.x,S.y>=0?k<O&&(b+=S.y):b+=S.y;p<0&&b<0?(m=Me,b=-b,p=-p,u-=b,f-=p):p<0?(m=Be,p=-p,f-=p):b<0&&(m=Ce,b=-b,u-=b);break;case Et:this.move(S.x,S.y),C=!1;break;case Nt:this.zoom(Xa(l),t),C=!1;break;case Dt:if(!S.x||!S.y){C=!1;break}J=Wt(this.cropper),f=F.startX-J.left,u=F.startY-J.top,p=o.minWidth,b=o.minHeight,S.x>0?m=S.y>0?$e:Ce:S.x<0&&(f-=p,m=S.y>0?Be:Me),S.y<0&&(u-=b),this.cropped||(de(this.cropBox,ee),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}C&&(o.width=p,o.height=b,o.left=f,o.top=u,this.action=m,this.renderCropBox()),X(l,function(K){K.startX=K.endX,K.startY=K.endY})}},ci={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Z(this.dragBox,Ue),de(this.cropBox,ee),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=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(),de(this.dragBox,Ue),Z(this.cropBox,ee)),this},replace:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),r?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,X(this.previews,function(a){a.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,de(this.cropper,Vt)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Z(this.cropper,Vt)),this},destroy:function(){var t=this.element;return t[H]?(t[H]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,s=a.left,o=a.top;return this.moveTo(ht(t)?t:s+Number(t),ht(r)?r:o+Number(r))},moveTo:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,s=!1;return t=Number(t),r=Number(r),this.ready&&!this.disabled&&this.options.movable&&(z(t)&&(a.left=t,s=!0),z(r)&&(a.top=r,s=!0),s&&this.renderCanvas(!0)),this},zoom:function(t,r){var a=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(a.width*t/a.naturalWidth,null,r)},zoomTo:function(t,r,a){var s=this.options,o=this.canvasData,l=o.width,m=o.height,g=o.naturalWidth,f=o.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&s.zoomable){var u=g*t,p=f*t;if(xe(this.element,dt,{ratio:t,oldRatio:l/g,originalEvent:a})===!1)return this;if(a){var b=this.pointers,N=Wt(this.cropper),k=b&&Object.keys(b).length?qa(b):{pageX:a.pageX,pageY:a.pageY};o.left-=(u-l)*((k.pageX-N.left-o.left)/l),o.top-=(p-m)*((k.pageY-N.top-o.top)/m)}else we(r)&&z(r.x)&&z(r.y)?(o.left-=(u-l)*((r.x-o.left)/l),o.top-=(p-m)*((r.y-o.top)/m)):(o.left-=(u-l)/2,o.top-=(p-m)/2);o.width=u,o.height=p,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),z(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var r=this.imageData.scaleY;return this.scale(t,z(r)?r:1)},scaleY:function(t){var r=this.imageData.scaleX;return this.scale(z(r)?r:1,t)},scale:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.imageData,s=!1;return t=Number(t),r=Number(r),this.ready&&!this.disabled&&this.options.scalable&&(z(t)&&(a.scaleX=t,s=!0),z(r)&&(a.scaleY=r,s=!0),s&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.options,a=this.imageData,s=this.canvasData,o=this.cropBoxData,l;if(this.ready&&this.cropped){l={x:o.left-s.left,y:o.top-s.top,width:o.width,height:o.height};var m=a.width/a.naturalWidth;if(X(l,function(u,p){l[p]=u/m}),t){var g=Math.round(l.y+l.height),f=Math.round(l.x+l.width);l.x=Math.round(l.x),l.y=Math.round(l.y),l.width=f-l.x,l.height=g-l.y}}else l={x:0,y:0,width:0,height:0};return r.rotatable&&(l.rotate=a.rotate||0),r.scalable&&(l.scaleX=a.scaleX||1,l.scaleY=a.scaleY||1),l},setData:function(t){var r=this.options,a=this.imageData,s=this.canvasData,o={};if(this.ready&&!this.disabled&&we(t)){var l=!1;r.rotatable&&z(t.rotate)&&t.rotate!==a.rotate&&(a.rotate=t.rotate,l=!0),r.scalable&&(z(t.scaleX)&&t.scaleX!==a.scaleX&&(a.scaleX=t.scaleX,l=!0),z(t.scaleY)&&t.scaleY!==a.scaleY&&(a.scaleY=t.scaleY,l=!0)),l&&this.renderCanvas(!0,!0);var m=a.width/a.naturalWidth;z(t.x)&&(o.left=t.x*m+s.left),z(t.y)&&(o.top=t.y*m+s.top),z(t.width)&&(o.width=t.width*m),z(t.height)&&(o.height=t.height*m),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?U({},this.containerData):{}},getImageData:function(){return this.sized?U({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,r={};return this.ready&&X(["left","top","width","height","naturalWidth","naturalHeight"],function(a){r[a]=t[a]}),r},setCanvasData:function(t){var r=this.canvasData,a=r.aspectRatio;return this.ready&&!this.disabled&&we(t)&&(z(t.left)&&(r.left=t.left),z(t.top)&&(r.top=t.top),z(t.width)?(r.width=t.width,r.height=t.width/a):z(t.height)&&(r.height=t.height,r.width=t.height*a),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,r;return this.ready&&this.cropped&&(r={left:t.left,top:t.top,width:t.width,height:t.height}),r||{}},setCropBoxData:function(t){var r=this.cropBoxData,a=this.options.aspectRatio,s,o;return this.ready&&this.cropped&&!this.disabled&&we(t)&&(z(t.left)&&(r.left=t.left),z(t.top)&&(r.top=t.top),z(t.width)&&t.width!==r.width&&(s=!0,r.width=t.width),z(t.height)&&t.height!==r.height&&(o=!0,r.height=t.height),a&&(s?r.height=r.width/a:o&&(r.width=r.height*a)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var r=this.canvasData,a=Ja(this.image,this.imageData,r,t);if(!this.cropped)return a;var s=this.getData(),o=s.x,l=s.y,m=s.width,g=s.height,f=a.width/Math.floor(r.naturalWidth);f!==1&&(o*=f,l*=f,m*=f,g*=f);var u=m/g,p=me({aspectRatio:u,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),b=me({aspectRatio:u,width:t.minWidth||0,height:t.minHeight||0},"cover"),N=me({aspectRatio:u,width:t.width||(f!==1?a.width:m),height:t.height||(f!==1?a.height:g)}),k=N.width,D=N.height;k=Math.min(p.width,Math.max(b.width,k)),D=Math.min(p.height,Math.max(b.height,D));var M=document.createElement("canvas"),T=M.getContext("2d");M.width=ke(k),M.height=ke(D),T.fillStyle=t.fillColor||"transparent",T.fillRect(0,0,k,D);var O=t.imageSmoothingEnabled,C=O===void 0?!0:O,J=t.imageSmoothingQuality;T.imageSmoothingEnabled=C,J&&(T.imageSmoothingQuality=J);var F=a.width,S=a.height,R=o,K=l,Q,re,B,j,$,L;R<=-m||R>F?(R=0,Q=0,B=0,$=0):R<=0?(B=-R,R=0,Q=Math.min(F,m+R),$=Q):R<=F&&(B=0,Q=Math.min(m,F-R),$=Q),Q<=0||K<=-g||K>S?(K=0,re=0,j=0,L=0):K<=0?(j=-K,K=0,re=Math.min(S,g+K),L=re):K<=S&&(j=0,re=Math.min(g,S-K),L=re);var P=[R,K,Q,re];if($>0&&L>0){var q=k/m;P.push(B*q,j*q,$*q,L*q)}return T.drawImage.apply(T,[a].concat(St(P.map(function(Y){return Math.floor(ke(Y))})))),M},setAspectRatio:function(t){var r=this.options;return!this.disabled&&!ht(t)&&(r.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var r=this.options,a=this.dragBox,s=this.face;if(this.ready&&!this.disabled){var o=t===at,l=r.movable&&t===Mt;t=o||l?t:$t,r.dragMode=t,Ae(a,Te,t),_e(a,nt,o),_e(a,ot,l),r.cropBoxMovable||(Ae(s,Te,t),_e(s,nt,o),_e(s,ot,l))}return this}},di=ce.Cropper,Jt=function(){function i(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(xa(this,i),!t||!Pa.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({},Ht,we(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Sa(i,[{key:"init",value:function(){var r=this.element,a=r.tagName.toLowerCase(),s;if(!r[H]){if(r[H]=this,a==="img"){if(this.isImg=!0,s=r.getAttribute("src")||"",this.originalUrl=s,!s)return;s=r.src}else a==="canvas"&&window.HTMLCanvasElement&&(s=r.toDataURL());this.load(s)}}},{key:"load",value:function(r){var a=this;if(!!r){this.url=r,this.imageData={};var s=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Oa.test(r)){ja.test(r)?this.read(ei(r)):this.clone();return}var l=new XMLHttpRequest,m=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=m,l.onerror=m,l.ontimeout=m,l.onprogress=function(){l.getResponseHeader("content-type")!==Lt&&l.abort()},l.onload=function(){a.read(l.response)},l.onloadend=function(){a.reloading=!1,a.xhr=null},o.checkCrossOrigin&&Xt(r)&&s.crossOrigin&&(r=qt(r)),l.open("GET",r,!0),l.responseType="arraybuffer",l.withCredentials=s.crossOrigin==="use-credentials",l.send()}}},{key:"read",value:function(r){var a=this.options,s=this.imageData,o=ri(r),l=0,m=1,g=1;if(o>1){this.url=ti(r,Lt);var f=ni(o);l=f.rotate,m=f.scaleX,g=f.scaleY}a.rotatable&&(s.rotate=l),a.scalable&&(s.scaleX=m,s.scaleY=g),this.clone()}},{key:"clone",value:function(){var r=this.element,a=this.url,s=r.crossOrigin,o=a;this.options.checkCrossOrigin&&Xt(a)&&(s||(s="anonymous"),o=qt(a)),this.crossOrigin=s,this.crossOriginUrl=o;var l=document.createElement("img");s&&(l.crossOrigin=s),l.src=o||a,l.alt=r.alt||"The image to crop",this.image=l,l.onload=this.start.bind(this),l.onerror=this.stop.bind(this),Z(l,Ct),r.parentNode.insertBefore(l,r.nextSibling)}},{key:"start",value:function(){var r=this,a=this.image;a.onload=null,a.onerror=null,this.sizing=!0;var s=ce.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ce.navigator.userAgent),o=function(f,u){U(r.imageData,{naturalWidth:f,naturalHeight:u,aspectRatio:f/u}),r.initialImageData=U({},r.imageData),r.sizing=!1,r.sized=!0,r.build()};if(a.naturalWidth&&!s){o(a.naturalWidth,a.naturalHeight);return}var l=document.createElement("img"),m=document.body||document.documentElement;this.sizingImage=l,l.onload=function(){o(l.width,l.height),s||m.removeChild(l)},l.src=a.src,s||(l.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",m.appendChild(l))}},{key:"stop",value:function(){var r=this.image;r.onload=null,r.onerror=null,r.parentNode.removeChild(r),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var r=this.element,a=this.options,s=this.image,o=r.parentNode,l=document.createElement("div");l.innerHTML=Ia;var m=l.querySelector(".".concat(H,"-container")),g=m.querySelector(".".concat(H,"-canvas")),f=m.querySelector(".".concat(H,"-drag-box")),u=m.querySelector(".".concat(H,"-crop-box")),p=u.querySelector(".".concat(H,"-face"));this.container=o,this.cropper=m,this.canvas=g,this.dragBox=f,this.cropBox=u,this.viewBox=m.querySelector(".".concat(H,"-view-box")),this.face=p,g.appendChild(s),Z(r,ee),o.insertBefore(m,r.nextSibling),this.isImg||de(s,Ct),this.initPreview(),this.bind(),a.initialAspectRatio=Math.max(0,a.initialAspectRatio)||NaN,a.aspectRatio=Math.max(0,a.aspectRatio)||NaN,a.viewMode=Math.max(0,Math.min(3,Math.round(a.viewMode)))||0,Z(u,ee),a.guides||Z(u.getElementsByClassName("".concat(H,"-dashed")),ee),a.center||Z(u.getElementsByClassName("".concat(H,"-center")),ee),a.background&&Z(m,"".concat(H,"-bg")),a.highlight||Z(p,Ma),a.cropBoxMovable&&(Z(p,ot),Ae(p,Te,rt)),a.cropBoxResizable||(Z(u.getElementsByClassName("".concat(H,"-line")),ee),Z(u.getElementsByClassName("".concat(H,"-point")),ee)),this.render(),this.ready=!0,this.setDragMode(a.dragMode),a.autoCrop&&this.crop(),this.setData(a.data),te(a.ready)&&oe(r,jt,a.ready,{once:!0}),xe(r,jt)}}},{key:"unbuild",value:function(){!this.ready||(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),de(this.element,ee))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=di,i}},{key:"setDefaults",value:function(r){U(Ht,we(r)&&r)}}]),i}();U(Jt.prototype,oi,ai,ii,si,li,ci);const hi={class:"flex"},ui={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},mi={class:"ml-auto mb-2"},fi={class:"w-full flex justify-center"},pi=["src"],gi={__name:"Image",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{t:a}=e.inject("i18n"),{apiUrl:s}=ie(),o=e.ref(null),l=e.ref(null),m=e.ref(!1),g=e.ref(""),f=e.ref(!1),u=()=>{m.value=!m.value,m.value?l.value=new Jt(o.value,{crop(N){}}):l.value.destroy()},p=e.inject("ajaxData"),b=()=>{l.value.getCroppedCanvas({width:795,height:341}).toBlob(N=>{g.value="",f.value=!1,Le(s.value,{method:"POST",params:Object.assign(p,{q:"upload",adapter:r.selection.adapter,path:r.selection.item.path,file:N}),name:r.selection.item.basename,json:!1}).then(k=>{g.value=a("Updated."),o.value.src=Ze(r.selection.adapter,r.selection.item.path),u(),t("load")}).catch(k=>{g.value=a(k.message),f.value=!0})})};return e.onMounted(()=>{t("load")}),(N,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",hi,[e.createElementVNode("h3",ui,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",mi,[m.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:b,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(a)("Crop")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:k[0]||(k[0]=D=>u())},e.toDisplayString(m.value?e.unref(a)("Cancel"):e.unref(a)("Edit")),1)])]),e.createElementVNode("div",fi,[e.createElementVNode("img",{ref_key:"image",ref:o,class:"max-w-[60vh] max-h-[60vh]",src:e.unref(Ze)(r.selection.adapter,r.selection.item.path),alt:""},null,8,pi)]),g.value.length?(e.openBlock(),e.createBlock(le,{key:0,error:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},yi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},bi=e.createElementVNode("div",null," Default view.. ",-1),vi={__name:"Default",props:{selection:Object},emits:["load"],setup(i,{emit:t}){return e.onMounted(()=>{t("load")}),(r,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",yi,e.toDisplayString(i.selection.item.basename),1),bi],64))}},wi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ki={class:"w-full",preload:"",controls:""},_i=["src"],xi=e.createTextVNode(" Your browser does not support the video tag. "),Si={__name:"Video",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{apiUrl:a}=ie(),s=()=>a.value+"?"+pe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",wi,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("video",ki,[e.createElementVNode("source",{src:s(),type:"video/mp4"},null,8,_i),xi])])],64))}},Di={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ei={class:"w-full",controls:""},Ni=["src"],Vi=e.createTextVNode(" Your browser does not support the audio element. "),Ci={__name:"Audio",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{apiUrl:a}=ie(),s=()=>a.value+"?"+pe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",Di,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("audio",Ei,[e.createElementVNode("source",{src:s(),type:"audio/mpeg"},null,8,Ni),Vi])])],64))}},Mi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},$i=["data"],Bi=["src"],Ti={__name:"Pdf",props:{selection:Object},emits:["load"],setup(i,{emit:t}){const r=i,{apiUrl:a}=ie(),s=()=>a.value+"?"+pe({q:"preview",adapter:r.selection.adapter,path:r.selection.item.path});return e.onMounted(()=>{t("load")}),(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",Mi,e.toDisplayString(i.selection.item.basename),1),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:s(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:s(),width:"100%",height:"100%"},`
13
13
  <p>
14
14
  Your browser does not support PDFs.
15
15
  <a href="https://example.com/test.pdf">Download the PDF</a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuefinder",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "vuefinder is an elegant web file manager.",
5
5
  "type": "module",
6
6
  "files": [