import{_ as m,o as c,c as d,a as F,b as l,n as $,d as u,e as v,t as f,p as C,f as k,r as h,g as _,F as b,h as M,i as y,j as R,k as P,m as H,V as Y,w,l as S,v as V,s as X,q as L,u as j}from"./vendor.b4e4e155.js";const B=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function s(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=s(o);fetch(o.href,i)}};B();class z{static post(t,s,n){var o=this;window.wcfmoptions.poster(t,s,function(i){n.call(o,i)},function(){console.log("failure")})}}const U={},E={style:{position:"absolute",width:"0",height:"0"},width:"0",height:"0",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},q=F(`<defs><symbol id="icon-folder" viewBox="0 0 309.267 309.267"><g><path style="fill:#D0994B;" d="M260.944,43.491H125.64c0,0-18.324-28.994-28.994-28.994H48.323c-10.67,0-19.329,8.65-19.329,19.329
        		v222.286c0,10.67,8.659,19.329,19.329,19.329h212.621c10.67,0,19.329-8.659,19.329-19.329V62.82
        		C280.273,52.15,271.614,43.491,260.944,43.491z"></path><path style="fill:#E4E7E7;" d="M28.994,72.484h251.279v77.317H28.994V72.484z"></path><path style="fill:#F4B459;" d="M19.329,91.814h270.609c10.67,0,19.329,8.65,19.329,19.329l-19.329,164.298
        		c0,10.67-8.659,19.329-19.329,19.329H38.658c-10.67,0-19.329-8.659-19.329-19.329L0,111.143C0,100.463,8.659,91.814,19.329,91.814z
        		"></path></g></symbol><symbol id="icon-unfold" viewBox="0 0 32 32"><path d="M28,14H18V4c0-1.104-0.896-2-2-2s-2,0.896-2,2v10H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h10v10c0,1.104,0.896,2,2,2  s2-0.896,2-2V18h10c1.104,0,2-0.896,2-2S29.104,14,28,14z"></path></symbol><symbol id="icon-fold" viewBox="0 0 24 24"><g fill="none" stroke="#000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"></line></g></symbol><symbol id="icon-file" viewBox="0 0 56 56"><g><path style="fill:#E9E9E0;" d="M36.985,0H7.963C7.155,0,6.5,0.655,6.5,1.926V55c0,0.345,0.655,1,1.463,1h40.074
        		c0.808,0,1.463-0.655,1.463-1V12.978c0-0.696-0.093-0.92-0.257-1.085L37.607,0.257C37.442,0.093,37.218,0,36.985,0z"></path><polygon style="fill:#D9D7CA;" points="37.5,0.151 37.5,12 49.349,12 	"></polygon><circle style="fill:#F3D55B;" cx="18.931" cy="14.431" r="4.569"></circle><polygon style="fill:#26B99A;" points="6.5,39 17.5,39 49.5,39 49.5,28 39.5,18.5 29,30 23.517,24.517 	"></polygon><path style="fill:#14A085;" d="M48.037,56H7.963C7.155,56,6.5,55.345,6.5,54.537V39h43v15.537C49.5,55.345,48.845,56,48.037,56z"></path><g></g></g></symbol><svg id="icon-ok" viewBox="0 0 256 256"><g fill="green" stroke="none" transform="translate(0.000000,256.000000) scale(0.100000,-0.100000)"><path d="M1064 2545 c-406 -72 -744 -324 -927 -690 -96 -193 -127 -333 -127 -575 0 -243 33 -387 133 -585 177 -351 518 -606 907 -676 118 -22 393 -17 511 8 110 24 252 78 356 136 327 183 569 525 628 887 19 122 19 338 0 460 -81 498 -483 914 -990 1025 -101 22 -389 28 -491 10z m814 -745 c39 -27 73 -59 77 -70 9 -27 10 -25 -372 -590 -345 -510 -357 -524 -420 -512 -19 4 -98 74 -250 225 -123 121 -225 228 -228 238 -3 10 1 31 9 47 20 40 125 132 149 132 11 0 79 -59 162 -140 79 -77 146 -140 149 -140 3 0 38 48 78 108 95 143 465 678 496 720 35 46 64 42 150 -18z"></path></g></svg><svg id="icon-not-available" viewBox="0 0 500.000000 500.000000" preserveAspectRatio="xMidYMid meet"><g fill="#b11010" stroke="none" transform="translate(0.000000,500.000000) scale(0.100000,-0.100000)"><path d="M2315 4800 c-479 -35 -928 -217 -1303 -527 -352 -293 -615 -702 -738 -1151 -104 -380 -104 -824 0 -1204 107 -389 302 -724 591 -1013 354 -354 785 -572 1279 -646 196 -30 476 -30 672 0 494 74 925 292 1279 646 354 354 571 784 646 1279 30 197 30 475 0 672 -75 495 -292 925 -646 1279 -289 289 -624 484 -1013 591 -228 62 -528 91 -767 74z m353 -511 c458 -50 874 -272 1170 -624 417 -497 536 -1174 308 -1763 -56 -145 -176 -367 -235 -434 -4 -4 -566 552 -1250 1236 l-1243 1243 94 60 c354 229 754 327 1156 282z m864 -3200 c-67 -59 -289 -179 -434 -235 -946 -366 -2024 172 -2322 1158 -47 155 -66 276 -73 453 -13 362 84 704 290 1023 l60 94 1243 -1243 c684 -684 1240 -1246 1236 -1250z"></path></g></svg><svg id="icon-help" viewBox="0 0 400 400" style="enable-background:new 0 0 400 400;" xml:space="preserve"><g><path style="fill:#cccccc;" d="M199.996,0C89.719,0,0,89.72,0,200c0,110.279,89.719,200,199.996,200C310.281,400,400,310.279,400,200
      			C400,89.72,310.281,0,199.996,0z M199.996,373.77C104.187,373.77,26.23,295.816,26.23,200
      			c0-95.817,77.957-173.769,173.766-173.769c95.816,0,173.772,77.953,173.772,173.769
      			C373.769,295.816,295.812,373.77,199.996,373.77z"></path><path style="fill:#000000;" d="M199.996,91.382c-35.176,0-63.789,28.616-63.789,63.793c0,7.243,5.871,13.115,13.113,13.115
      			c7.246,0,13.117-5.873,13.117-13.115c0-20.71,16.848-37.562,37.559-37.562c20.719,0,37.566,16.852,37.566,37.562
      			c0,20.714-16.849,37.566-37.566,37.566c-7.242,0-13.113,5.873-13.113,13.114v45.684c0,7.243,5.871,13.115,13.113,13.115
      			s13.117-5.872,13.117-13.115v-33.938c28.905-6.064,50.68-31.746,50.68-62.427C263.793,119.998,235.176,91.382,199.996,91.382z"></path><path d="M200.004,273.738c-9.086,0-16.465,7.371-16.465,16.462s7.379,16.465,16.465,16.465c9.094,0,16.457-7.374,16.457-16.465
      			S209.098,273.738,200.004,273.738z"></path></g></svg><svg id="icon-help2" viewBox="0 0 431.855 431.855" style="enable-background:new 0 0 431.855 431.855;" xml:space="preserve"><g><path style="fill:#aaaaaa;" d="M215.936,0C96.722,0,0.008,96.592,0.008,215.814c0,119.336,96.714,216.041,215.927,216.041
        		c119.279,0,215.911-96.706,215.911-216.041C431.847,96.592,335.214,0,215.936,0z M231.323,335.962
        		c-5.015,4.463-10.827,6.706-17.411,6.706c-6.812,0-12.754-2.203-17.826-6.617c-5.08-4.406-7.625-10.575-7.625-18.501
        		c0-7.031,2.463-12.949,7.373-17.745c4.91-4.796,10.933-7.194,18.078-7.194c7.031,0,12.949,2.398,17.753,7.194
        		c4.796,4.796,7.202,10.713,7.202,17.745C238.858,325.362,236.346,331.5,231.323,335.962z M293.856,180.934
        		c-3.853,7.145-8.429,13.306-13.737,18.501c-5.292,5.194-14.81,13.924-28.548,26.198c-3.788,3.463-6.836,6.503-9.12,9.12
        		c-2.284,2.626-3.991,5.023-5.105,7.202c-1.122,2.178-1.983,4.357-2.593,6.535c-0.61,2.17-1.528,5.999-2.772,11.469
        		c-2.113,11.608-8.754,17.411-19.915,17.411c-5.804,0-10.681-1.894-14.656-5.69c-3.959-3.796-5.934-9.429-5.934-16.907
        		c0-9.372,1.455-17.493,4.357-24.361c2.886-6.869,6.747-12.892,11.543-18.086c4.804-5.194,11.274-11.356,19.427-18.501
        		c7.145-6.251,12.307-10.965,15.485-14.144c3.186-3.186,5.861-6.73,8.031-10.632c2.187-3.91,3.26-8.145,3.26-12.721
        		c0-8.933-3.308-16.46-9.957-22.597c-6.641-6.137-15.209-9.21-25.703-9.21c-12.282,0-21.321,3.097-27.125,9.291
        		c-5.804,6.194-10.705,15.314-14.729,27.369c-3.804,12.616-11.006,18.923-21.598,18.923c-6.251,0-11.526-2.203-15.826-6.609
        		c-4.292-4.406-6.438-9.177-6.438-14.314c0-10.6,3.406-21.346,10.21-32.23c6.812-10.884,16.745-19.899,29.807-27.036
        		c13.054-7.145,28.296-10.722,45.699-10.722c16.184,0,30.466,2.991,42.854,8.966c12.388,5.966,21.963,14.087,28.718,24.361
        		c6.747,10.266,10.128,21.427,10.128,33.482C299.635,165.473,297.709,173.789,293.856,180.934z"></path></g></svg></defs>`,1),A=[q];function G(e,t){return c(),d("svg",E,A)}var K=m(U,[["render",G]]);const J={name:"FileItem",emits:["toggle","select"],props:{item:Object},data(){return{hover:!1,selected:!1}},inject:["wcfm"],methods:{onClick(e){this.selected=!0,this.$emit("select",this)},getWCFM(){return this.wcfm},getFullPath(){for(var e=this.$parent,t=[];e!==null&&e.$parent!==null;)e.item&&t.push(e.item.name),e=e.$parent;return t.pop(),t=t.reverse().join("/"),t=t.replace("//","/"),t},infoClick(){this.getWCFM().displayInfo(this.getFullPath())},convertClick(){this.getWCFM().onConvertClick(this.getFullPath())}}},x=e=>(C("data-v-4fb0cc48"),e=e(),k(),e),Q={key:0,class:"icon-fold"},ee=x(()=>l("use",{"xlink:href":"#icon-fold"},null,-1)),te=[ee],oe={key:1,class:"icon-unfold"},se=x(()=>l("use",{"xlink:href":"#icon-unfold"},null,-1)),ie=[se],ne=x(()=>l("use",{"xlink:href":"#icon-folder"},null,-1)),le=[ne],ae={key:2,class:"icon-file"},re=x(()=>l("use",{"xlink:href":"#icon-file"},null,-1)),ce=[re];function de(e,t,s,n,o,i){return c(),d("div",{class:$({fileitem:!0,selected:o.selected}),onMouseover:t[2]||(t[2]=a=>o.hover=!0),onMouseleave:t[3]||(t[3]=a=>o.hover=!1),onClick:t[4]||(t[4]=(...a)=>i.onClick&&i.onClick(...a))},[l("p",null,[s.item.isDir?(c(),d("span",{key:0,class:$({"fold-unfold":!0,empty:s.item.isEmpty}),onClick:t[0]||(t[0]=a=>this.$emit("toggle"))},[s.item.isOpen?(c(),d("svg",Q,te)):u("",!0),s.item.isOpen?u("",!0):(c(),d("svg",oe,ie))],2)):u("",!0),s.item.isDir?(c(),d("svg",{key:1,class:"icon-folder",onClick:t[1]||(t[1]=a=>this.$emit("toggle"))},le)):u("",!0),s.item.isDir?u("",!0):(c(),d("svg",ae,ce)),v(" "+f(s.item.nickname||s.item.name),1)])],34)}var he=m(J,[["render",de],["__scopeId","data-v-4fb0cc48"]]);const ue={name:"FileTree",components:{FileItem:he},emits:["select"],props:{item:Object},data(){return{loading:!1}},methods:{load(){var e=this;z.post("get-folder",{path:this.$refs.thefileitem.getFullPath()},function(t){e.loading=!0,e.item.children=t.children.sort(function(s,n){return s.isDir&&!n.isDir?-1:!s.isDir&&n.isDir||s.name>n.name?1:s.name<n.name?-1:0}),e.item.loaded=!0,e.loading=!1})},toggle(){this.item.isOpen=!this.item.isOpen,this.item.loaded||this.load()},onSelect(e){this.$emit("select",e)}},mounted(){let e=this.$refs.thefileitem.getFullPath();(e=="/"||e.indexOf("/")==-1)&&this.toggle()}},me={key:0},_e=l("li",null,"loading...",-1),fe=[_e],pe={key:1,class:"tree"};function ge(e,t,s,n,o,i){const a=h("FileItem"),r=h("FileTree",!0);return c(),d(b,null,[_(a,{ref:"thefileitem",item:s.item,onDblclick:i.toggle,onToggle:i.toggle,onSelect:i.onSelect},null,8,["item","onDblclick","onToggle","onSelect"]),o.loading?(c(),d("ul",me,fe)):u("",!0),s.item.children!==void 0&&s.item.isOpen?(c(),d("ul",pe,[(c(!0),d(b,null,M(s.item.children,p=>(c(),d("li",null,[_(r,{item:p,onSelect:i.onSelect},null,8,["item","onSelect"])]))),256))])):u("",!0)],64)}var ve=m(ue,[["render",ge]]);const ye={name:"Files",components:{FileTree:ve},emits:["select"],props:{item:Object,statusText:String},methods:{onSelect(e){this.selectedItem&&(this.selectedItem.selected=!1),this.selectedItem=e,this.$emit("select",this.selectedItem.getFullPath(),this.selectedItem.item.isDir)}},data(){return{selected:null}}},ze={key:1};function be(e,t,s,n,o,i){const a=h("FileTree");return c(),d(b,null,[s.item?(c(),y(a,{key:0,item:s.item,onSelect:i.onSelect},null,8,["item","onSelect"])):u("",!0),s.item?u("",!0):(c(),d("div",ze,f(s.statusText),1))],64)}var we=m(ye,[["render",be]]);const xe={name:"Modal",emits:["close"],props:{title:{type:String},closeButtonText:{type:String},alignment:{type:String},width:{type:[Number,String],default:"95%"},height:{type:[Number,String],default:"95%"},maxheight:{type:[Number,String],default:"700px"}},computed:{containerStyle(){let e={width:this.width,height:this.height,"max-height":this.maxheight};return this.alignment=="center"&&(e.margin="0px auto"),this.alignment=="right"&&(e.position="absolute",e.right="10px"),e}},methods:{onCloseClick(){this.$emit("close")}}},$e={class:"modal-mask"},Ce={class:"modal-wrapper"},ke={class:"title"},Se={class:"modal-body"},Ve={class:"content"},Ie=v(" default body "),Fe={class:"close-button-with-text"};function Me(e,t,s,n,o,i){return c(),d("div",$e,[l("div",Ce,[l("div",{class:"modal-container",style:R(i.containerStyle)},[l("a",{class:"close-button",onClick:t[0]||(t[0]=(...a)=>i.onCloseClick&&i.onCloseClick(...a))},"X"),l("div",ke,f(s.title),1),l("div",Se,[l("div",Ve,[P(e.$slots,"default",{},()=>[Ie]),l("div",Fe,[l("button",{onClick:t[1]||(t[1]=(...a)=>i.onCloseClick&&i.onCloseClick(...a))},f(s.closeButtonText),1)])])])],4)])])}var Re=m(xe,[["render",Me]]);const Ye={name:"ZoomSlider",components:{Slider:H},emits:["update:zoom"],props:{zoom:{type:Number,default:1}},watch:{exp(e,t){this.$emit("update:zoom",2**e)},zoom(e,t){this.exp=Math.log2(e)}},methods:{sliderFormat(e){return Math.round(2**e*100)+"%"}},mounted(){},data(){return{exp:0}}},Xe={class:"zoom-slider"};function Oe(e,t,s,n,o,i){const a=h("Slider");return c(),d("div",Xe,[_(a,{modelValue:o.exp,"onUpdate:modelValue":t[0]||(t[0]=r=>o.exp=r),min:-4,max:4,width:100,step:-1,format:i.sliderFormat,tooltipPosition:"bottom",orientation:"horizontal"},null,8,["modelValue","format"])])}var De=m(Ye,[["render",Oe]]);const Te={name:"ImageViewport",components:{VueZoomer:Y,ZoomSlider:De},emits:["update:zoom","update:translateX","update:translateY","load","resize"],props:{src:{type:String},height:{type:Number,default:500},zoom:{type:Number,default:1},scaleZoomRatio:{type:Number},translateX:{type:Number,default:1},translateY:{type:Number,default:1}},data(){return{ratio:1,ro:null}},watch:{height(e,t){var s;((s=this.$refs)==null?void 0:s.zoomer)&&(this.$refs.zoomer.onWindowResize(),this.$refs.zoomer.refreshContainerPos())},scaleZoomRatio(e){var t;((t=this.$refs)==null?void 0:t.zoomer)&&(this.$refs.zoomer.onWindowResize(),this.$refs.zoomer.refreshContainerPos()),this.$refs.zoomer.scale=this.zoom*this.scaleZoomRatio},zoom(e,t){this.isImageReady(),this.$refs.zoomer.scale=e*this.scaleZoomRatio},translateX(e,t){this.$refs.zoomer.translateX!=e&&(this.$refs.zoomer.translateX=e)},translateY(e,t){this.$refs.zoomer.translateY!=e&&(this.$refs.zoomer.translateY=e)}},methods:{getGoodContainerHeight(){var e,t,s;if((t=(e=this.$refs)==null?void 0:e.theimg)==null?void 0:t.naturalWidth){let n=this.$refs.theimg.naturalWidth/this.$refs.theimg.naturalHeight,i=((s=this.$refs.root)==null?void 0:s.offsetWidth)/n;return i>300&&(i=300),i}return 300},updateContainerHeight(){},isImageReady(){var e,t,s;return!(!((t=(e=this.$refs)==null?void 0:e.theimg)==null?void 0:t.naturalWidth)||!((s=this.$refs.root)==null?void 0:s.offsetWidth))},calcScaleZoomRatio(){var n,o;if(!this.isImageReady())return 1;let e=this.$refs.theimg.naturalWidth/((n=this.$refs.root)==null?void 0:n.offsetWidth),t=this.$refs.theimg.naturalHeight/((o=this.$refs.root)==null?void 0:o.offsetHeight),s=Math.max(e,t);return isNaN(s)?1:s},updateRatio(){},updateScale(){this.zoom&&(this.$refs.zoomer.scale=this.zoom*this.scaleZoomRatio)},zoomToFit(){},onImgLoad(){var e,t;((t=(e=this.$refs)==null?void 0:e.theimg)==null?void 0:t.naturalWidth)&&this.$emit("load")},onResize(){this.$emit("resize")},onDoubleTap(){console.log("double tab - zoom to 100%"),this.$emit("update:zoom",1),this.$emit("update:translateX",0),this.$emit("update:translateY",0)}},mounted(){window.ResizeObserver&&(this.ro=new ResizeObserver(this.onResize).observe(this.$refs.root)),this.$refs.zoomer.tapDetector.onDoubleTap(this.onDoubleTap),this.$watch("$refs.zoomer.scale",(e,t)=>{this.isImageReady(),this.$emit("update:zoom",e/this.scaleZoomRatio)}),this.$watch("$refs.zoomer.translateX",(e,t)=>{this.$emit("update:translateX",e)}),this.$watch("$refs.zoomer.translateY",(e,t)=>{this.$emit("update:translateY",e)})},beforeDestroy(){window.ResizeObserver&&this.ro.unobserve(this.$refs.zoomer)}},We={ref:"root",class:"image-viewport"},Ne=["src"],Ze={class:"zoom-info"};function Pe(e,t,s,n,o,i){const a=h("v-zoomer");return c(),d("div",We,[_(a,{ref:"zoomer",class:"zoomer",minScale:.1,maxScale:8,onResize:i.onResize,doubleClickToZoom:!1,style:R({height:s.height+"px"}),pivot:"cursor",limitTranslation:!1,lockPanOnNoScale:!1},{default:w(()=>[l("img",{ref:"theimg",src:s.src,onLoad:t[0]||(t[0]=(...r)=>i.onImgLoad&&i.onImgLoad(...r))},null,40,Ne)]),_:1},8,["minScale","onResize","style"]),l("div",Ze," zoom: "+f(Math.round(s.zoom*100))+"% ",1)],512)}var He=m(Te,[["render",Pe]]);const Le={name:"Variant",components:{ImageViewport:He},emits:["select","update:zoom","update:translateX","update:translateY","load","resize"],props:{title:{type:String},info:{type:Object},url:{type:String,default:""},height:{type:Number},zoom:{type:Number},scaleZoomRatio:{type:Number},translateX:{type:Number},translateY:{type:Number},variantIndex:{type:Number}},computed:{imageUrl:function(){var e;return(e=this.info)==null?void 0:e.url},filesize:function(){var t;if(!((t=this.info)==null?void 0:t.size))return"";let e=this.info.size;return e<1024?e+" bytes":(e/=1024,e<1024?Math.round(e*10)/10+" kb":(e/=1024,Math.round(e*10)/10+" MB"))}},methods:{onVariantSelect(){this.$emit("select",this.variantIndex)},onLoad(){this.$emit("load")},zoomToFit(){this.$refs.theport.zoomToFit()}},mounted(){this.$watch("$refs.theport.zoom",(e,t)=>{this.$emit("update:zoom",e)}),this.$watch("$refs.theport.translateX",(e,t)=>{this.$emit("update:translateX",e)}),this.$watch("$refs.theport.translateY",(e,t)=>{this.$emit("update:translateY",e)})},data(){return{}}},je={class:"variant"},Be={class:"header"},Ue={class:"title"},Ee={class:"size"};function qe(e,t,s,n,o,i){const a=h("ImageViewport");return c(),d("div",je,[l("div",Be,[l("div",Ue,f(s.title),1),l("div",Ee,f(i.filesize),1)]),_(a,{ref:"theport",src:i.imageUrl,height:s.height,zoom:s.zoom,"onUpdate:zoom":t[0]||(t[0]=r=>s.zoom=r),scaleZoomRatio:s.scaleZoomRatio,translateX:s.translateX,"onUpdate:translateX":t[1]||(t[1]=r=>s.translateX=r),translateY:s.translateY,"onUpdate:translateY":t[2]||(t[2]=r=>s.translateY=r),onLoad:i.onLoad,onResize:t[3]||(t[3]=r=>this.$emit("resize"))},null,8,["src","height","zoom","scaleZoomRatio","translateX","translateY","onLoad"])])}var O=m(Le,[["render",qe],["__scopeId","data-v-0372e854"]]);const Ae={name:"Variants",components:{Variant:O},emits:["update:zoom","update:translateX","update:translateY"],props:{file:{type:Object},viewport:{type:Object},height:{type:Number},zoom:{type:Number,default:1},translateX:{type:Number,default:0},translateY:{type:Number,default:0}},watch:{file(e,t){}},methods:{onZoomChange(e){this.$emit("update:zoom",e)},onTranslateXChange(e){this.$emit("update:translateX",e)},onTranslateYChange(e){this.$emit("update:translateY",e)},sliderFormat(e){return Math.round(e*100)+"%"},changeImage(){this.imageUrl=="http://localhost:3000/src/assets/dummy.jpg"?this.imageUrl="http://localhost:3000/src/assets/dummy2.jpg":this.imageUrl="http://localhost:3000/src/assets/dummy.jpg",this.selectedVariant=-1},onVariantSelect(e){this.selectedVariant=e}},mounted(){this.$watch("$refs.variants.zoom",(e,t)=>{})},data(){var e="http://localhost:3000/src/assets/200x100.jpg";return{imageUrl:"",selectedVariant:-1,variants:[{title:"Existing conversion",size:732,url:e},{title:"Lossy, q:20",size:35e5,url:e}]}}},D=e=>(C("data-v-25a3327e"),e=e(),k(),e),Ge={class:"variants-component"},Ke=D(()=>l("br",null,null,-1)),Je=D(()=>l("br",null,null,-1)),Qe={class:"variants"};function et(e,t,s,n,o,i){const a=h("Variant");return c(),d("div",Ge,[v(" File: "+f(s.file)+" ",1),l("button",{onClick:t[0]||(t[0]=r=>i.changeImage())},"Change image"),Ke,Je,l("div",Qe,[(c(!0),d(b,null,M(o.variants,(r,p)=>(c(),y(a,{title:r.title,info:r,variantIndex:p,class:$({selected:p==o.selectedVariant}),height:s.height,zoom:s.zoom,"onUpdate:zoom":[t[1]||(t[1]=g=>s.zoom=g),i.onZoomChange],translateX:s.translateX,"onUpdate:translateX":[t[2]||(t[2]=g=>s.translateX=g),i.onTranslateXChange],translateY:s.translateY,"onUpdate:translateY":[t[3]||(t[3]=g=>s.translateY=g),i.onTranslateYChange],onSelect:i.onVariantSelect},null,8,["title","info","variantIndex","class","height","zoom","translateX","translateY","onSelect","onUpdate:zoom","onUpdate:translateX","onUpdate:translateY"]))),256))])])}var tt=m(Ae,[["render",et],["__scopeId","data-v-25a3327e"]]);const ot={name:"FileProperties",components:{Variant:O,Variants:tt},props:{file:{type:Object,default:{}}},watch:{file(e,t){e.isDir||this.load(e.path)}},methods:{onVariantSelect(e){this.selectedVariant=e},onOriginalLoad(){if(this.updateHeight(),this.$refs.original.$refs.theport.calcScaleZoomRatio()>1){let t=this.$refs.original.$refs.theport,s=t.$refs.theimg,n=t.$refs.root,o=s.naturalWidth,i=s.naturalHeight,a=n.offsetWidth,p=this.height/i,g=a/o;this.zoom=Math.min(p,g)}else this.zoom=1;this.translateX=0,this.translateY=0},onOriginalResize(){this.updateHeight()},updateHeight(){this.$refs.original&&(this.height=this.$refs.original.$refs.theport.getGoodContainerHeight(),this.scaleZoomRatio=this.$refs.original.$refs.theport.calcScaleZoomRatio())},reset(){this.originalInfo=null,this.convertedInfo=null,this.errorMsg=""},load(e){let t=this;t.reset(),t.loading=!0,z.post("info",{path:e},function(s){s.success||(t.errorMsg=s.data),t.loading=!1,t.originalInfo=s.original,s.converted&&(t.convertedInfo=s.converted)})}},mounted(){this.file&&this.load(this.file.path)},data(){return{zoom:1,scaleZoomRatio:1,translateX:0,translateY:0,height:100,loading:!1,errorMsg:"",originalInfo:null,convertedInfo:null}}},T=e=>(C("data-v-32d950b3"),e=e(),k(),e),st={class:"file-properties"},it={class:"path"},nt=v(" Path: "),lt={class:"path"},at={key:0,class:"error"},rt=T(()=>l("p",null," Above, you see the original image. If it has been converted, you also see the converted image (provided that your browser supports webp). ",-1)),ct=T(()=>l("p",null," You can zoom in on the image, ie using scroll wheel. Both images will zoom, allowing you to compare the quality. Double-click the image to set zoom to 100%. You can also drag the image. ",-1));function dt(e,t,s,n,o,i){const a=h("Variant");return c(),d("div",st,[l("div",it,[nt,l("span",lt,f(s.file.path),1)]),o.errorMsg?(c(),d("div",at,f(o.errorMsg),1)):u("",!0),S(l("div",null,"Getting info...",512),[[V,o.loading]]),S(_(a,{ref:"original",title:"Original",info:o.originalInfo,height:o.height,zoom:o.zoom,"onUpdate:zoom":t[0]||(t[0]=r=>o.zoom=r),scaleZoomRatio:o.scaleZoomRatio,translateX:o.translateX,"onUpdate:translateX":t[1]||(t[1]=r=>o.translateX=r),translateY:o.translateY,"onUpdate:translateY":t[2]||(t[2]=r=>o.translateY=r),onLoad:i.onOriginalLoad,onResize:i.onOriginalResize},null,8,["info","height","zoom","scaleZoomRatio","translateX","translateY","onLoad","onResize"]),[[V,o.originalInfo]]),S(_(a,{title:"Existing conversion",info:o.convertedInfo,height:o.height,zoom:o.zoom,"onUpdate:zoom":t[3]||(t[3]=r=>o.zoom=r),scaleZoomRatio:o.scaleZoomRatio,translateX:o.translateX,"onUpdate:translateX":t[4]||(t[4]=r=>o.translateX=r),translateY:o.translateY,"onUpdate:translateY":t[5]||(t[5]=r=>o.translateY=r)},null,8,["info","height","zoom","scaleZoomRatio","translateX","translateY"]),[[V,o.convertedInfo]]),rt,ct])}var ht=m(ot,[["render",dt],["__scopeId","data-v-32d950b3"]]);const ut={name:"FolderProperties",components:{},props:{file:{type:Object,default:{}}},watch:{file(e,t){}}},mt={class:"folder-properties"},_t={class:"path"},ft=v(" Path: "),pt={class:"path"},gt=l("p",null," You cannot do anything on folders yet. Browse to an image... ",-1);function vt(e,t,s,n,o,i){return c(),d("div",mt,[l("div",_t,[ft,l("span",pt,f(s.file.path),1)]),gt])}var yt=m(ut,[["render",vt]]);const zt={name:"Welcome"},bt={class:"welcome"},wt=F('<div class="headline"><div>Welcome to</div><h3>WebP Convert file manager 0.2</h3></div><p> At current stage you can browse the image files and compare the original vs the converted file.<br> To open a folder, click the &quot;+&quot; sign next to the folder name or double click the folder name </p><p><h4>Whats new?</h4><i>Changes in 0.2:</i><ul><li>Tree branches are now loaded on need basis (loaded the complete tree in one go was causing timeout on sites with huge amounts of images)</li></ul><i>Changes in 0.1:</i><ul><li>Everything is new! This is the first tentative pre-alpha work-in-progress release.</li></ul></p><p><h4>Whats planned ahead?</h4> Next thing is of course to enable you to trigger conversions. To support development, you can <a href="https://ko-fi.com/rosell" target="_blank">buy me a cup of coffee</a></p>',4),xt=[wt];function $t(e,t,s,n,o,i){return c(),d("div",bt,xt)}var Ct=m(zt,[["render",$t]]);const kt={name:"WCFM",components:{SVGs:K,FileProperties:ht,FolderProperties:yt,Modal:Re,Files:we,Splitpanes:X.exports.Splitpanes,Pane:X.exports.Pane,Welcome:Ct},methods:{onConvertClick(e){var n,o;let t=(o=(n=this.$refs.convertOptions)==null?void 0:n.general)==null?void 0:o.data,s={path:e,convertOptions:t};console.log(s),z.post("convert",s,function(i){console.log("convert response:",i)})},onConvertCloseClick(){console.log("CLRCL"),this.showConvertOptions=!1},onFileSelect(e,t){this.file={path:e,isDir:t}},displayInfo(e){var t=this;z.post("info",{path:e},function(s){t.selectedInfo=s})}},mounted(){var e=this;z.post("get-folder",{path:""},function(t){e.item=t.children[0]})},data(){return{file:null,selectedItem:null,item:null,treeStatusText:"loading file tree...",selectedInfo:{},showConvertOptions:!1}},provide(){return{wcfm:this}}},St={class:"wcfm",style:{overflow:"hidden"}},Vt={class:"pane-content"},It={key:0,class:"pane-content"};function Ft(e,t,s,n,o,i){const a=h("SVGs"),r=h("Files"),p=h("pane"),g=h("FileProperties"),W=h("FolderProperties"),N=h("Welcome"),Z=h("splitpanes");return c(),d("div",St,[_(a),_(Z,{class:"default-theme",style:{position:"absolute",top:"0",left:"0"}},{default:w(()=>[_(p,{size:"30"},{default:w(()=>[l("div",Vt,[l("div",null,[_(r,{item:o.item,statusText:o.treeStatusText,onSelect:i.onFileSelect},null,8,["item","statusText","onSelect"])])])]),_:1}),_(p,{size:"70",style:{"overflow-y":"auto"}},{default:w(()=>[o.file?(c(),d("div",It,[o.file.isDir?u("",!0):(c(),y(g,{key:0,file:o.file},null,8,["file"])),o.file.isDir?(c(),y(W,{key:1,file:o.file},null,8,["file"])):u("",!0)])):u("",!0),o.file?u("",!0):(c(),y(N,{key:1}))]),_:1})]),_:1})])}var Mt=m(kt,[["render",Ft]]);const I=L(Mt);I.use(Y);I.use(j,{defaultHtml:!1});window.wcfmoptions||(window.wcfmoptions={},window.wcfmoptions.poster=function(e,t,s,n){switch(e){case"get-folder":switch(t.path){case"":var o={children:[{name:"/",isDir:!0,nickname:"root"}]};break;case"/":var o={children:[{name:"empty-folder",isDir:!0,isEmpty:!0},{name:"file",isDir:!1,isConverted:!0},{name:"aaa",isDir:!1,isConverted:!0},{name:"test-folder",isDir:!0},{name:"file2",isDir:!1,isConverted:!1}]};break;case"/empty-folder":var o={children:[]};break;case"/test-folder":var o={children:[{name:"banana",isDir:!1},{name:"subfolder",isDir:!0},{name:"apple",isDir:!1}]};break;case"/test-folder/subfolder":var o={children:[{name:"file2",isDir:!1},{name:"file1",isDir:!1}]};break;default:n();return}break;case"conversion-settings":var o={systemStatus:{converterRequirements:{gd:{extensionLoaded:!1,compiledWithWebP:!0}}}};break;case"info":if(t.path=="root/file2")var o={original:{filename:"file.png",size:100,url:"http://localhost:3000/src/assets/200x100.jpg"},converted:{filename:"file.png.webp",size:70,url:"http://localhost:3000/src/assets/200x100.jpg"},log:"blah blah blah"};else if(t.path=="root/file")var o={original:{filename:"file.png",size:100,url:"http://localhost:3000/src/assets/dummy2.jpg"},log:"blah blah blah"};else var o={original:{filename:"file.png",size:100,url:"http://localhost:3000/src/assets/dummy.jpg"},converted:{filename:"file.png.webp",size:70,url:"http://localhost:3000/src/assets/dummy.jpg"},log:"blah blah blah"};break;case"convert":var o={success:!1,msg:"Image type could not be detected"};break;default:var o="ok";break}s(o)});I.mount("#webpconvert-filemanager");
