mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
138 lines
64 KiB
JavaScript
138 lines
64 KiB
JavaScript
import{u as xn,d as En,e as U,f as Tn,g as An,E as N,h as gt,i as Ln,j as wt}from"./request.df7e735f.js";import{d as Qt,r as P,c as L,o as Jt,ae as St,a as O,b as be,e as Fe,P as xe,Q as Ee,p as I,n as oe,q as zn,k as G,t as Ct,i as Te,g as Mn,f as _,F as Pn,j as Be,h as en,T as tn,X as rt,m as Rn,ao as kt,ap as nn,w as je,V as Le,ad as ot,S as Dn,U as In,aq as On,u as ee,R as Fn,ar as Bn,Y as $e,a3 as _n,a4 as jn,$ as pt,as as ie}from"./index.f883e59e.js";import{c as Y}from"./common.cad90977.js";import{E as Z}from"./index.4050475c.js";import{b as $n,d as Pe,E as Nn,a8 as Un,u as Vn,a7 as xt,_ as Kn,R as Hn,I as We,B as qn,H as Wn,F as Et,a9 as Gn}from"./base.203c5653.js";import{v as Tt,L as At}from"./directive.88613689.js";const Yn={install(e){e.directive("loading",Tt),e.config.globalProperties.$loading=At},directive:Tt,service:At},an=["success","info","warning","error"],Zn=$n({customClass:{type:String,default:""},dangerouslyUseHTMLString:{type:Boolean,default:!1},duration:{type:Number,default:4500},icon:{type:Pe([String,Object]),default:""},id:{type:String,default:""},message:{type:Pe([String,Object]),default:""},offset:{type:Number,default:0},onClick:{type:Pe(Function),default:()=>{}},onClose:{type:Pe(Function),required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...an,""],default:""},zIndex:{type:Number,default:0}}),Xn={destroy:()=>!0},Qn=Qt({name:"ElNotification",components:{ElIcon:Nn,...Un},props:Zn,emits:Xn,setup(e){const t=Vn("notification"),n=P(!1);let a;const o=L(()=>{const m=e.type;return m&&xt[e.type]?t.m(m):""}),i=L(()=>xt[e.type]||e.icon||""),r=L(()=>e.position.endsWith("right")?"right":"left"),l=L(()=>e.position.startsWith("top")?"top":"bottom"),s=L(()=>({[l.value]:`${e.offset}px`,zIndex:e.zIndex}));function g(){e.duration>0&&({stop:a}=Hn(()=>{n.value&&p()},e.duration))}function f(){a==null||a()}function p(){n.value=!1}function S({code:m}){m===We.delete||m===We.backspace?f():m===We.esc?n.value&&p():g()}return Jt(()=>{g(),n.value=!0}),xn(document,"keydown",S),{ns:t,horizontalClass:r,typeClass:o,iconComponent:i,positionStyle:s,visible:n,close:p,clearTimer:f,startTimer:g}}}),Jn=["id"],ea=["textContent"],ta={key:0},na=["innerHTML"];function aa(e,t,n,a,o,i){const r=St("el-icon"),l=St("close");return O(),be(tn,{name:e.ns.b("fade"),onBeforeLeave:e.onClose,onAfterLeave:t[3]||(t[3]=s=>e.$emit("destroy")),persisted:""},{default:Fe(()=>[xe(I("div",{id:e.id,class:oe([e.ns.b(),e.customClass,e.horizontalClass]),style:Te(e.positionStyle),role:"alert",onMouseenter:t[0]||(t[0]=(...s)=>e.clearTimer&&e.clearTimer(...s)),onMouseleave:t[1]||(t[1]=(...s)=>e.startTimer&&e.startTimer(...s)),onClick:t[2]||(t[2]=(...s)=>e.onClick&&e.onClick(...s))},[e.iconComponent?(O(),be(r,{key:0,class:oe([e.ns.e("icon"),e.typeClass])},{default:Fe(()=>[(O(),be(zn(e.iconComponent)))]),_:1},8,["class"])):G("v-if",!0),I("div",{class:oe(e.ns.e("group"))},[I("h2",{class:oe(e.ns.e("title")),textContent:Ct(e.title)},null,10,ea),xe(I("div",{class:oe(e.ns.e("content")),style:Te(e.title?void 0:{margin:0})},[Mn(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(O(),_(Pn,{key:1},[G(" Caution here, message could've been compromized, nerver use user's input as message "),G(" eslint-disable-next-line "),I("p",{innerHTML:e.message},null,8,na)],2112)):(O(),_("p",ta,Ct(e.message),1))])],6),[[Ee,e.message]]),e.showClose?(O(),be(r,{key:0,class:oe(e.ns.e("closeBtn")),onClick:Be(e.close,["stop"])},{default:Fe(()=>[en(l)]),_:1},8,["class","onClick"])):G("v-if",!0)],2)],46,Jn),[[Ee,e.visible]])]),_:3},8,["name","onBeforeLeave"])}var ra=Kn(Qn,[["render",aa],["__file","/home/runner/work/element-plus/element-plus/packages/components/notification/src/notification.vue"]]);const Ne={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},it=16;let oa=1;const ge=function(e={},t=null){if(!qn)return{close:()=>{}};(typeof e=="string"||rt(e))&&(e={message:e});const n=e.position||"top-right";let a=e.offset||0;Ne[n].forEach(({vm:p})=>{var S;a+=(((S=p.el)==null?void 0:S.offsetHeight)||0)+it}),a+=it;const{nextZIndex:o}=Wn(),i=`notification_${oa++}`,r=e.onClose,l={zIndex:o(),offset:a,...e,id:i,onClose:()=>{ia(i,n,r)}};let s=document.body;Et(e.appendTo)?s=e.appendTo:Rn(e.appendTo)&&(s=document.querySelector(e.appendTo)),Et(s)||(s=document.body);const g=document.createElement("div"),f=en(ra,l,rt(l.message)?{default:()=>l.message}:null);return f.appContext=t!=null?t:ge._context,f.props.onDestroy=()=>{kt(null,g)},kt(f,g),Ne[n].push({vm:f}),s.appendChild(g.firstElementChild),{close:()=>{f.component.proxy.visible=!1}}};an.forEach(e=>{ge[e]=(t={})=>((typeof t=="string"||rt(t))&&(t={message:t}),ge({...t,type:e}))});function ia(e,t,n){const a=Ne[t],o=a.findIndex(({vm:g})=>{var f;return((f=g.component)==null?void 0:f.props.id)===e});if(o===-1)return;const{vm:i}=a[o];if(!i)return;n==null||n(i);const r=i.el.offsetHeight,l=t.split("-")[0];a.splice(o,1);const s=a.length;if(!(s<1))for(let g=o;g<s;g++){const{el:f,component:p}=a[g].vm,S=Number.parseInt(f.style[l],10)-r-it;p.props.offset=S}}function la(){for(const e of Object.values(Ne))e.forEach(({vm:t})=>{t.component.proxy.visible=!1})}ge.closeAll=la;ge._context=null;const sa=Gn(ge,"$notify"),ht=nn("storageConfigStore",{state:()=>({config:{siteName:"",directLinkPrefix:"",defaultSwitchToImgMode:!1,infoEnable:!1,showLinkBtn:!1,recordDownloadLog:!1,showShortLink:!1,showPathLink:!1,tableSize:"small",rootShowStorage:!0,fileClickMode:"dbclick",showDocument:!1,debugMode:!1,domain:"",icp:"123",avatar:"",announcement:"",layout:"full",showAnnouncement:!1,searchEnable:!1,showLogin:!1}}),actions:{updateConfig(e){this.config=e}}}),{width:Lt,height:ca}=En();function ua(){const e=L(()=>Lt.value<768),t=L(()=>Lt.value>=768),n=i=>{if(a(i))return"";let r="",l=-1;for(let s=0;s<i.length;s++){const g=i.charAt(s);if(g==="/"){if(l<s){let f=i.substring(l+1,s);r+=encodeURIComponent(f),l=s}r+=g}if(s===i.length-1&&l<s){let f=i.substring(l+1,s+1);r+=encodeURIComponent(f)}}return r},a=i=>i==null||i==="";return{isMobile:e,isNotMobile:t,height:ca,encodeAllIgnoreSlashes:n,strIsEmpty:a,strIsNotEmpty:i=>!a(i)}}const jr=e=>U({url:"/api/site/reset-password",method:"get",data:e}),da=e=>U({url:"/api/storage/list",method:"get",data:e}),Me=nn("fileDataStore",{state:()=>({currentClickRow:{},currentRightClickRow:{},currentStorageSource:{id:null,type:{description:"",key:""}},imgMode:!1,newImgMode:!1,oldStorageKey:null,searchParam:"",fileListSource:[],audioArray:[],audioIndex:0}),getters:{filterFileByType:e=>t=>e.fileListSource.filter(function(n){if(n.type==="BACK")return!1;let a=n.name,o=a.substr(a.lastIndexOf(".")+1).toLowerCase();return Y.constant.fileTypeMap[t].indexOf(o)!==-1}),fileList:e=>{let t=e.fileListSource;return t.forEach(n=>{if(n.icon||(n.icon=Y.getFileIconName(n)),n.preview!==null){var a=Y.getFileType(n.name);a?(n.fileType=a,n.preview=Y.constant.previewFileType.indexOf(a)!==-1):n.preview=!1}}),t}},actions:{updateCurrentStorageSource(e){this.currentStorageSource=e},updateAudioIndex(e){this.audioIndex=e},updateAudioList(e){this.audioArray=e},updateCurrentClickRow(e){this.currentClickRow=e},updateCurrentRightClickRow(e){this.currentRightClickRow=e},updateFileList(e){this.fileListSource=e},updateNewImgMode(e){this.newImgMode=e},updateOldStorageKey(e){this.oldStorageKey=e},updateSearchParam(e){this.searchParam=e},switchImgMode(e){this.imgMode=e}}});let Ge=Me(),zt=ht(),ae=P([]),he=P(),Mt=!1;function fa(e,t){let n=zt.config.rootShowStorage;const a=L(()=>t.params.storageKey);let o=()=>new Promise(f=>{da().then(p=>{if(ae.value=p.data,ae.value.length===0){Z.confirm("\u5F53\u524D\u65E0\u53EF\u7528\u5B58\u50A8\u6E90\uFF0C\u662F\u5426\u8DF3\u8F6C\u81F3\u7BA1\u7406\u5458\u9875\u9762\u6DFB\u52A0\u5B58\u50A8\u6E90\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"info",callback:S=>{S==="confirm"&&e.push("/login")}});return}i(n),f(p)})});const i=f=>{a.value?g(a.value)?he.value=a.value:s():f?(Ge.updateFileList(r.value),document.title=zt.config.siteName+" | \u9996\u9875"):s(),l()},r=L(()=>{let f=[];return ae.value.forEach(p=>{f.push({name:p.name,path:p.key,size:0,time:"-",type:"ROOT"})}),f}),l=()=>{ae.value.some(f=>{f.key===he.value&&Ge.updateCurrentStorageSource(f)})};Mt||(je(()=>he.value,(f,p)=>{Ge.updateOldStorageKey(p),(f&&!t.params.fullpath||p!==void 0)&&(e.push("/"+f),l())}),je(()=>t.params.storageKey,f=>{i(!0)}));const s=()=>{let f=ae.value[0].key;he.value=f,e.push("/"+f)},g=f=>ae.value.find(p=>{if(p.key==f)return p});return Mt=!0,{loadStorageSourceList:o,storageList:ae,findStorageByKey:g,storageKey:a,currentStorageKey:he,storageListAsFileList:r}}var ze={};Object.defineProperty(ze,"__esModule",{value:!0});var Ue=ze.removeDuplicateSlashes=ze.transform=void 0;const ga=/(?!^)\/{2,}/g;function pa(e){return e.map(t=>rn(t))}ze.transform=pa;function rn(e){return e.replace(ga,"/")}Ue=ze.removeDuplicateSlashes=rn;const ha=e=>U({url:"/api/file/operator/mkdir",method:"post",data:e}),ma=e=>U({url:"/api/file/operator/delete/file",method:"post",data:e}),va=e=>U({url:"/api/file/operator/delete/folder",method:"post",data:e}),ya=e=>U({url:"/api/file/operator/rename/file",method:"post",data:e}),ba=e=>U({url:"/api/file/operator/rename/folder",method:"post",data:e}),wa=e=>U({url:"/api/file/operator/upload/file",method:"post",data:e}),Sa=typeof process=="object"&&process&&process.platform==="win32";var Ca=Sa?{sep:"\\"}:{sep:"/"},ka=on;function on(e,t,n){e instanceof RegExp&&(e=Pt(e,n)),t instanceof RegExp&&(t=Pt(t,n));var a=ln(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function Pt(e,t){var n=t.match(e);return n?n[0]:null}on.range=ln;function ln(e,t,n){var a,o,i,r,l,s=n.indexOf(e),g=n.indexOf(t,s+1),f=s;if(s>=0&&g>0){if(e===t)return[s,g];for(a=[],i=n.length;f>=0&&!l;)f==s?(a.push(f),s=n.indexOf(e,f+1)):a.length==1?l=[a.pop(),g]:(o=a.pop(),o<i&&(i=o,r=g),g=n.indexOf(t,f+1)),f=s<g&&s>=0?s:g;a.length&&(l=[i,r])}return l}var sn=ka,xa=Aa,cn="\0SLASH"+Math.random()+"\0",un="\0OPEN"+Math.random()+"\0",mt="\0CLOSE"+Math.random()+"\0",dn="\0COMMA"+Math.random()+"\0",fn="\0PERIOD"+Math.random()+"\0";function Ye(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function Ea(e){return e.split("\\\\").join(cn).split("\\{").join(un).split("\\}").join(mt).split("\\,").join(dn).split("\\.").join(fn)}function Ta(e){return e.split(cn).join("\\").split(un).join("{").split(mt).join("}").split(dn).join(",").split(fn).join(".")}function gn(e){if(!e)return[""];var t=[],n=sn("{","}",e);if(!n)return e.split(",");var a=n.pre,o=n.body,i=n.post,r=a.split(",");r[r.length-1]+="{"+o+"}";var l=gn(i);return i.length&&(r[r.length-1]+=l.shift(),r.push.apply(r,l)),t.push.apply(t,r),t}function Aa(e){return e?(e.substr(0,2)==="{}"&&(e="\\{\\}"+e.substr(2)),we(Ea(e),!0).map(Ta)):[]}function La(e){return"{"+e+"}"}function za(e){return/^-?0\d/.test(e)}function Ma(e,t){return e<=t}function Pa(e,t){return e>=t}function we(e,t){var n=[],a=sn("{","}",e);if(!a)return[e];var o=a.pre,i=a.post.length?we(a.post,!1):[""];if(/\$$/.test(a.pre))for(var r=0;r<i.length;r++){var l=o+"{"+a.body+"}"+i[r];n.push(l)}else{var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),f=s||g,p=a.body.indexOf(",")>=0;if(!f&&!p)return a.post.match(/,.*\}/)?(e=a.pre+"{"+a.body+mt+a.post,we(e)):[e];var S;if(f)S=a.body.split(/\.\./);else if(S=gn(a.body),S.length===1&&(S=we(S[0],!1).map(La),S.length===1))return i.map(function(A){return a.pre+S[0]+A});var m;if(f){var b=Ye(S[0]),k=Ye(S[1]),z=Math.max(S[0].length,S[1].length),T=S.length==3?Math.abs(Ye(S[2])):1,v=Ma,d=k<b;d&&(T*=-1,v=Pa);var u=S.some(za);m=[];for(var h=b;v(h,k);h+=T){var c;if(g)c=String.fromCharCode(h),c==="\\"&&(c="");else if(c=String(h),u){var y=z-c.length;if(y>0){var x=new Array(y+1).join("0");h<0?c="-"+x+c.slice(1):c=x+c}}m.push(c)}}else{m=[];for(var E=0;E<S.length;E++)m.push.apply(m,we(S[E],!1))}for(var E=0;E<m.length;E++)for(var r=0;r<i.length;r++){var l=o+m[E]+i[r];(!t||f||l)&&n.push(l)}}return n}const $=pn=(e,t,n={})=>(Ve(t),!n.nocomment&&t.charAt(0)==="#"?!1:new He(t,n).match(e));var pn=$;const lt=Ca;$.sep=lt.sep;const V=Symbol("globstar **");$.GLOBSTAR=V;const Ra=xa,Rt={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},st="[^/]",Ze=st+"*?",Da="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ia="(?:(?!(?:\\/|^)\\.).)*?",hn=e=>e.split("").reduce((t,n)=>(t[n]=!0,t),{}),Dt=hn("().*{}+?[]^$\\!"),Oa=hn("[.("),It=/\/+/;$.filter=(e,t={})=>(n,a,o)=>$(n,e,t);const X=(e,t={})=>{const n={};return Object.keys(e).forEach(a=>n[a]=e[a]),Object.keys(t).forEach(a=>n[a]=t[a]),n};$.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return $;const t=$,n=(a,o,i)=>t(a,o,X(e,i));return n.Minimatch=class extends t.Minimatch{constructor(o,i){super(o,X(e,i))}},n.Minimatch.defaults=a=>t.defaults(X(e,a)).Minimatch,n.filter=(a,o)=>t.filter(a,X(e,o)),n.defaults=a=>t.defaults(X(e,a)),n.makeRe=(a,o)=>t.makeRe(a,X(e,o)),n.braceExpand=(a,o)=>t.braceExpand(a,X(e,o)),n.match=(a,o,i)=>t.match(a,o,X(e,i)),n};$.braceExpand=(e,t)=>mn(e,t);const mn=(e,t={})=>(Ve(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ra(e)),Fa=1024*64,Ve=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>Fa)throw new TypeError("pattern is too long")},Re=Symbol("subparse");$.makeRe=(e,t)=>new He(e,t||{}).makeRe();$.match=(e,t,n={})=>{const a=new He(t,n);return e=e.filter(o=>a.match(o)),a.options.nonull&&!e.length&&e.push(t),e};const Ba=e=>e.replace(/\\(.)/g,"$1"),_a=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class He{constructor(t,n){Ve(t),n||(n={}),this.options=n,this.set=[],this.pattern=t,this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.make()}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate();let a=this.globSet=this.braceExpand();n.debug&&(this.debug=(...o)=>console.error(...o)),this.debug(this.pattern,a),a=this.globParts=a.map(o=>o.split(It)),this.debug(this.pattern,a),a=a.map((o,i,r)=>o.map(this.parse,this)),this.debug(this.pattern,a),a=a.filter(o=>o.indexOf(!1)===-1),this.debug(this.pattern,a),this.set=a}parseNegate(){if(this.options.nonegate)return;const t=this.pattern;let n=!1,a=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)n=!n,a++;a&&(this.pattern=t.substr(a)),this.negate=n}matchOne(t,n,a){var o=this.options;this.debug("matchOne",{this:this,file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var i=0,r=0,l=t.length,s=n.length;i<l&&r<s;i++,r++){this.debug("matchOne loop");var g=n[r],f=t[i];if(this.debug(n,g,f),g===!1)return!1;if(g===V){this.debug("GLOBSTAR",[n,g,f]);var p=i,S=r+1;if(S===s){for(this.debug("** at the end");i<l;i++)if(t[i]==="."||t[i]===".."||!o.dot&&t[i].charAt(0)===".")return!1;return!0}for(;p<l;){var m=t[p];if(this.debug(`
|
|
globstar while`,t,p,n,S,m),this.matchOne(t.slice(p),n.slice(S),a))return this.debug("globstar found match!",p,l,m),!0;if(m==="."||m===".."||!o.dot&&m.charAt(0)==="."){this.debug("dot detected!",t,p,n,S);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(a&&(this.debug(`
|
|
>>> no match, partial?`,t,p,n,S),p===l))}var b;if(typeof g=="string"?(b=f===g,this.debug("string match",g,f,b)):(b=f.match(g),this.debug("pattern match",g,f,b)),!b)return!1}if(i===l&&r===s)return!0;if(i===l)return a;if(r===s)return i===l-1&&t[i]==="";throw new Error("wtf?")}braceExpand(){return mn(this.pattern,this.options)}parse(t,n){Ve(t);const a=this.options;if(t==="**")if(a.noglobstar)t="*";else return V;if(t==="")return"";let o="",i=!!a.nocase,r=!1;const l=[],s=[];let g,f=!1,p=-1,S=-1,m,b,k;const z=t.charAt(0)==="."?"":a.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",T=()=>{if(g){switch(g){case"*":o+=Ze,i=!0;break;case"?":o+=st,i=!0;break;default:o+="\\"+g;break}this.debug("clearStateChar %j %j",g,o),g=!1}};for(let u=0,h;u<t.length&&(h=t.charAt(u));u++){if(this.debug("%s %s %s %j",t,u,o,h),r){if(h==="/")return!1;Dt[h]&&(o+="\\"),o+=h,r=!1;continue}switch(h){case"/":return!1;case"\\":T(),r=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",t,u,o,h),f){this.debug(" in class"),h==="!"&&u===S+1&&(h="^"),o+=h;continue}this.debug("call clearStateChar %j",g),T(),g=h,a.noext&&T();continue;case"(":if(f){o+="(";continue}if(!g){o+="\\(";continue}l.push({type:g,start:u-1,reStart:o.length,open:Rt[g].open,close:Rt[g].close}),o+=g==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",g,o),g=!1;continue;case")":if(f||!l.length){o+="\\)";continue}T(),i=!0,b=l.pop(),o+=b.close,b.type==="!"&&s.push(b),b.reEnd=o.length;continue;case"|":if(f||!l.length){o+="\\|";continue}T(),o+="|";continue;case"[":if(T(),f){o+="\\"+h;continue}f=!0,S=u,p=o.length,o+=h;continue;case"]":if(u===S+1||!f){o+="\\"+h;continue}m=t.substring(S+1,u);try{RegExp("["+m+"]")}catch{k=this.parse(m,Re),o=o.substr(0,p)+"\\["+k[0]+"\\]",i=i||k[1],f=!1;continue}i=!0,f=!1,o+=h;continue;default:T(),Dt[h]&&!(h==="^"&&f)&&(o+="\\"),o+=h;break}}for(f&&(m=t.substr(S+1),k=this.parse(m,Re),o=o.substr(0,p)+"\\["+k[0],i=i||k[1]),b=l.pop();b;b=l.pop()){let u;u=o.slice(b.reStart+b.open.length),this.debug("setting tail",o,b),u=u.replace(/((?:\\{2}){0,64})(\\?)\|/g,(c,y,x)=>(x||(x="\\"),y+y+x+"|")),this.debug(`tail=%j
|
|
%s`,u,u,b,o);const h=b.type==="*"?Ze:b.type==="?"?st:"\\"+b.type;i=!0,o=o.slice(0,b.reStart)+h+"\\("+u}T(),r&&(o+="\\\\");const v=Oa[o.charAt(0)];for(let u=s.length-1;u>-1;u--){const h=s[u],c=o.slice(0,h.reStart),y=o.slice(h.reStart,h.reEnd-8);let x=o.slice(h.reEnd);const E=o.slice(h.reEnd-8,h.reEnd)+x,A=c.split("(").length-1;let R=x;for(let C=0;C<A;C++)R=R.replace(/\)[+*?]?/,"");x=R;const w=x===""&&n!==Re?"$":"";o=c+y+x+w+E}if(o!==""&&i&&(o="(?=.)"+o),v&&(o=z+o),n===Re)return[o,i];if(!i)return Ba(t);const d=a.nocase?"i":"";try{return Object.assign(new RegExp("^"+o+"$",d),{_glob:t,_src:o})}catch{return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,a=n.noglobstar?Ze:n.dot?Da:Ia,o=n.nocase?"i":"";let i=t.map(r=>(r=r.map(l=>typeof l=="string"?_a(l):l===V?V:l._src).reduce((l,s)=>(l[l.length-1]===V&&s===V||l.push(s),l),[]),r.forEach((l,s)=>{l!==V||r[s-1]===V||(s===0?r.length>1?r[s+1]="(?:\\/|"+a+"\\/)?"+r[s+1]:r[s]=a:s===r.length-1?r[s-1]+="(?:\\/|"+a+")?":(r[s-1]+="(?:\\/|\\/"+a+"\\/)"+r[s+1],r[s+1]=V))}),r.filter(l=>l!==V).join("/"))).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,o)}catch{this.regexp=!1}return this.regexp}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const a=this.options;lt.sep!=="/"&&(t=t.split(lt.sep).join("/")),t=t.split(It),this.debug(this.pattern,"split",t);const o=this.set;this.debug(this.pattern,"set",o);let i;for(let r=t.length-1;r>=0&&(i=t[r],!i);r--);for(let r=0;r<o.length;r++){const l=o[r];let s=t;if(a.matchBase&&l.length===1&&(s=[i]),this.matchOne(s,l,n))return a.flipNegate?!0:!this.negate}return a.flipNegate?!1:this.negate}static defaults(t){return $.defaults(t).Minimatch}}$.Minimatch=He;var ja=pn;const $a=e=>U({url:"/api/storage/files",method:"post",data:e,config:{showDefaultMsg:!1}}),Nr=()=>U({url:"/api/site/config/global",method:"get"}),Na=e=>U({url:"/api/site/config/storage",method:"post",data:e}),Ur=e=>U({url:"/api/short-link",method:"get",data:e});function K(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function Ot(e,t){for(var n="",a=0,o=-1,i=0,r,l=0;l<=e.length;++l){if(l<e.length)r=e.charCodeAt(l);else{if(r===47)break;r=47}if(r===47){if(!(o===l-1||i===1))if(o!==l-1&&i===2){if(n.length<2||a!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var s=n.lastIndexOf("/");if(s!==n.length-1){s===-1?(n="",a=0):(n=n.slice(0,s),a=n.length-1-n.lastIndexOf("/")),o=l,i=0;continue}}else if(n.length===2||n.length===1){n="",a=0,o=l,i=0;continue}}t&&(n.length>0?n+="/..":n="..",a=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),a=l-o-1;o=l,i=0}else r===46&&i!==-1?++i:i=-1}return n}function Ua(e,t){var n=t.dir||t.root,a=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+a:n+e+a:a}var fe={resolve:function(){for(var t="",n=!1,a,o=arguments.length-1;o>=-1&&!n;o--){var i;o>=0?i=arguments[o]:(a===void 0&&(a=process.cwd()),i=a),K(i),i.length!==0&&(t=i+"/"+t,n=i.charCodeAt(0)===47)}return t=Ot(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(K(t),t.length===0)return".";var n=t.charCodeAt(0)===47,a=t.charCodeAt(t.length-1)===47;return t=Ot(t,!n),t.length===0&&!n&&(t="."),t.length>0&&a&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return K(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,n=0;n<arguments.length;++n){var a=arguments[n];K(a),a.length>0&&(t===void 0?t=a:t+="/"+a)}return t===void 0?".":fe.normalize(t)},relative:function(t,n){if(K(t),K(n),t===n||(t=fe.resolve(t),n=fe.resolve(n),t===n))return"";for(var a=1;a<t.length&&t.charCodeAt(a)===47;++a);for(var o=t.length,i=o-a,r=1;r<n.length&&n.charCodeAt(r)===47;++r);for(var l=n.length,s=l-r,g=i<s?i:s,f=-1,p=0;p<=g;++p){if(p===g){if(s>g){if(n.charCodeAt(r+p)===47)return n.slice(r+p+1);if(p===0)return n.slice(r+p)}else i>g&&(t.charCodeAt(a+p)===47?f=p:p===0&&(f=0));break}var S=t.charCodeAt(a+p),m=n.charCodeAt(r+p);if(S!==m)break;S===47&&(f=p)}var b="";for(p=a+f+1;p<=o;++p)(p===o||t.charCodeAt(p)===47)&&(b.length===0?b+="..":b+="/..");return b.length>0?b+n.slice(r+f):(r+=f,n.charCodeAt(r)===47&&++r,n.slice(r))},_makeLong:function(t){return t},dirname:function(t){if(K(t),t.length===0)return".";for(var n=t.charCodeAt(0),a=n===47,o=-1,i=!0,r=t.length-1;r>=1;--r)if(n=t.charCodeAt(r),n===47){if(!i){o=r;break}}else i=!1;return o===-1?a?"/":".":a&&o===1?"//":t.slice(0,o)},basename:function(t,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');K(t);var a=0,o=-1,i=!0,r;if(n!==void 0&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return"";var l=n.length-1,s=-1;for(r=t.length-1;r>=0;--r){var g=t.charCodeAt(r);if(g===47){if(!i){a=r+1;break}}else s===-1&&(i=!1,s=r+1),l>=0&&(g===n.charCodeAt(l)?--l===-1&&(o=r):(l=-1,o=s))}return a===o?o=s:o===-1&&(o=t.length),t.slice(a,o)}else{for(r=t.length-1;r>=0;--r)if(t.charCodeAt(r)===47){if(!i){a=r+1;break}}else o===-1&&(i=!1,o=r+1);return o===-1?"":t.slice(a,o)}},extname:function(t){K(t);for(var n=-1,a=0,o=-1,i=!0,r=0,l=t.length-1;l>=0;--l){var s=t.charCodeAt(l);if(s===47){if(!i){a=l+1;break}continue}o===-1&&(i=!1,o=l+1),s===46?n===-1?n=l:r!==1&&(r=1):n!==-1&&(r=-1)}return n===-1||o===-1||r===0||r===1&&n===o-1&&n===a+1?"":t.slice(n,o)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return Ua("/",t)},parse:function(t){K(t);var n={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return n;var a=t.charCodeAt(0),o=a===47,i;o?(n.root="/",i=1):i=0;for(var r=-1,l=0,s=-1,g=!0,f=t.length-1,p=0;f>=i;--f){if(a=t.charCodeAt(f),a===47){if(!g){l=f+1;break}continue}s===-1&&(g=!1,s=f+1),a===46?r===-1?r=f:p!==1&&(p=1):r!==-1&&(p=-1)}return r===-1||s===-1||p===0||p===1&&r===s-1&&r===l+1?s!==-1&&(l===0&&o?n.base=n.name=t.slice(1,s):n.base=n.name=t.slice(l,s)):(l===0&&o?(n.name=t.slice(1,r),n.base=t.slice(1,s)):(n.name=t.slice(l,r),n.base=t.slice(l,s)),n.ext=t.slice(r,s)),l>0?n.dir=t.slice(0,l-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};fe.posix=fe;var De=fe;let le=null;function vn(e,t){return le===null&&e&&(le=e),{tableRef:le,clearSelection:()=>{le.value.clearSelection()},toggleRowSelection:(i,r)=>{(i==null?void 0:i.type)!=="BACK"&&le.value.toggleRowSelection(i,r)},toggleAllSelection:()=>{le.value.toggleAllSelection()}}}const vt=typeof window!="undefined",Xe=()=>{};function Va(e,t=200,n={}){return function(a,o){return function(...i){a(()=>o.apply(this,i),{fn:o,thisArg:this,args:i})}}(function(a,o={}){let i,r;return l=>{const s=ee(a),g=ee(o.maxWait);if(i&&clearTimeout(i),s<=0||g!==void 0&&g<=0)return r&&(clearTimeout(r),r=null),l();g&&!r&&(r=setTimeout(()=>{i&&clearTimeout(i),r=null,l()},g)),i=setTimeout(()=>{r&&clearTimeout(r),r=null,l()},s)}}(t,n),e)}var Ka=Object.defineProperty,Ha=Object.defineProperties,qa=Object.getOwnPropertyDescriptors,Ft=Object.getOwnPropertySymbols,Wa=Object.prototype.hasOwnProperty,Ga=Object.prototype.propertyIsEnumerable,Bt=(e,t,n)=>t in e?Ka(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ya=(e,t)=>{for(var n in t||(t={}))Wa.call(t,n)&&Bt(e,n,t[n]);if(Ft)for(var n of Ft(t))Ga.call(t,n)&&Bt(e,n,t[n]);return e};const yt=vt?window:void 0;function Ae(...e){let t,n,a,o;if(typeof e[0]=="string"?([n,a,o]=e,t=yt):[t,n,a,o]=e,!t)return Xe;let i=Xe;const r=je(()=>function(g){var f;const p=ee(g);return(f=p==null?void 0:p.$el)!=null?f:p}(t),g=>{i(),g&&(g.addEventListener(n,a,o),i=()=>{g.removeEventListener(n,a,o),i=Xe})},{immediate:!0,flush:"post"}),l=()=>{r(),i()};var s;return s=l,_n()&&jn(s),l}function Za(e,t,n={}){const{target:a=yt,eventName:o="keydown",passive:i=!1}=n,r=typeof(l=e)=="function"?l:typeof l=="string"?s=>s.key===l:Array.isArray(l)?s=>l.includes(s.key):l?()=>!0:()=>!1;var l;return Ae(a,o,s=>{r(s)&&t(s)},i)}const Qe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Je="__vueuse_ssr_handlers__";Qe[Je]=Qe[Je]||{},Qe[Je];var _t,jt,Xa=Object.defineProperty,Qa=Object.defineProperties,Ja=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertySymbols,er=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable,Nt=(e,t,n)=>t in e?Xa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function nr(e,t={}){var n,a;const o=(n=t.draggingElement)!=null?n:yt,i=P((a=t.initialValue)!=null?a:{x:0,y:0}),r=P(),l=m=>!t.pointerTypes||t.pointerTypes.includes(m.pointerType),s=m=>{ee(t.preventDefault)&&m.preventDefault(),ee(t.stopPropagation)&&m.stopPropagation()},g=m=>{var b;l(m)&&r.value&&(i.value={x:m.pageX-r.value.x,y:m.pageY-r.value.y},(b=t.onMove)==null||b.call(t,i.value,m),s(m))},f=m=>{var b;l(m)&&r.value&&(r.value=void 0,(b=t.onEnd)==null||b.call(t,i.value,m),s(m))};return vt&&(Ae(e,"pointerdown",m=>{var b;if(!l(m)||ee(t.exact)&&m.target!==ee(e))return;const k=ee(e).getBoundingClientRect(),z={x:m.pageX-k.left,y:m.pageY-k.top};((b=t.onStart)==null?void 0:b.call(t,z,m))!==!1&&(r.value=z,s(m))},!0),Ae(o,"pointermove",g,!0),Ae(o,"pointerup",f,!0)),p=((m,b)=>{for(var k in b||(b={}))er.call(b,k)&&Nt(m,k,b[k]);if($t)for(var k of $t(b))tr.call(b,k)&&Nt(m,k,b[k]);return m})({},function(m){if(!Fn(m))return ot(m);const b=Array.isArray(m.value)?new Array(m.value.length):{};for(const k in m.value)b[k]=Bn(()=>({get:()=>m.value[k],set(z){if(Array.isArray(m.value)){const v=[...m.value];v[k]=z,m.value=v}else m.value=(T=Ya({},m.value),Ha(T,qa({[k]:z})));var T}}));return b}(i)),S={position:i,isDragging:L(()=>!!r.value),style:L(()=>`left:${i.value.x}px;top:${i.value.y}px;`)},Qa(p,Ja(S));var p,S}vt&&(window==null?void 0:window.navigator)&&((_t=window==null?void 0:window.navigator)==null?void 0:_t.platform)&&/iP(ad|hone|od)/.test((jt=window==null?void 0:window.navigator)==null?void 0:jt.platform);const ar=["a","s","d","w","q","e","A","S","D","W","Q","E","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Escape"," "];var Ke=Qt({name:"V3ImgPreview",props:{showToolbar:{type:Boolean,default:!0},showArrowBtn:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},url:{type:String,default:void 0},escClose:{type:Boolean,default:!0},images:{type:Array,default:()=>[]},showCloseBtn:{type:Boolean,default:!0},index:{type:Number,default:0},on_unmount_v3_ima_preview_app:{type:Function}},setup(e,t){let{emit:n}=t;const a=P(null),o=P(null),{style:i}=nr(o),r=Le({visible:!0,imgState:"loading",src:"",imgIndex:e.index}),l=L(()=>{var d;return((d=e.images)===null||d===void 0?void 0:d.length)>1&&e.showArrowBtn}),s=Le({imgScale:1,imgRotate:0}),g=L(()=>{var d;return((d=e.images)===null||d===void 0?void 0:d.length)>1}),f=Va(d=>{if(!e.keyboard)return!1;d.preventDefault();const{key:u}=d;return["s","S","ArrowDown"].includes(u)?m(-.1,!1):["w","W","ArrowUp"].includes(u)?m(.1,!1):u===" "?p():u==="Escape"&&e.escClose?T():["E","e"].includes(u)?S(!0):["Q","q"].includes(u)?S(!1):["a","A","ArrowLeft"].includes(u)?v(!1):["d","D","ArrowRight"].includes(u)?v(!0):void 0},200);Za(ar,f);const p=()=>{s.imgScale=1,s.imgRotate=0,o.value.style.top="0",o.value.style.left="0"};function S(d){s.imgRotate+=90*(d?1:-1)}function m(d){let u=arguments.length>1&&arguments[1]!==void 0&&arguments[1];s.imgScale<=.2&&d<0||(u?s.imgScale=d:s.imgScale+=d)}function b(d){d.preventDefault(),m(d.deltaY<0?.05:-.05)}function k(d){r.imgState="loading",(u=>{const h=new Image;return h.src=u,new Promise((c,y)=>{h.onload=()=>{c(u)},h.onerror=()=>{y(u)}})})(d).then(()=>{r.imgState="success",r.src=d,p()}).catch(()=>{r.imgState="error"})}function z(){$e(()=>{Ae(a.value,"mousewheel",b,!1),p(),$e(()=>e.url!==void 0?k(e.url):Array.isArray(e.images)&&e.images.length>0?k(e.images[r.imgIndex]):console.error("images is not Array or Array length is 0"))})}function T(){var d;r.visible=!1,n("close"),(d=e.on_unmount_v3_ima_preview_app)===null||d===void 0||d.call(e)}function v(d){g.value&&(d?(r.imgIndex++,r.imgIndex>e.images.length-1&&(r.imgIndex=0)):(r.imgIndex--,r.imgIndex<0&&(r.imgIndex=e.images.length-1)),k(e.images[r.imgIndex]))}return Jt(()=>{window.__V3__IMG__PREVIEW__LOAD__ICON__SVG__||function(d){d.__V3__IMG__PREVIEW__LOAD__ICON__SVG__=!0;var u,h,c,y,x,E='<svg><symbol id="v3-img-close" viewBox="0 0 1045 1024"><path d="M282.517333 213.376l-45.354666 45.162667L489.472 512 237.162667 765.461333l45.354666 45.162667L534.613333 557.354667l252.096 253.269333 45.354667-45.162667-252.288-253.44 252.288-253.482666-45.354667-45.162667L534.613333 466.624l-252.096-253.226667z" ></path></symbol><symbol id="v3-img-img-error" viewBox="0 0 1024 1024"><path d="M704 328a72 72 0 1 0 144 0 72 72 0 1 0-144 0z" ></path><path d="M999.904 116.608a32 32 0 0 0-21.952-10.912L521.76 73.792a31.552 31.552 0 0 0-27.2 11.904l-92.192 114.848a32 32 0 0 0 0.672 40.896l146.144 169.952-147.456 194.656 36.48-173.376a32 32 0 0 0-11.136-31.424L235.616 245.504l79.616-125.696a32 32 0 0 0-29.28-49.024L45.76 87.552a32 32 0 0 0-29.696 34.176l55.808 798.016a32.064 32.064 0 0 0 34.304 29.696l176.512-13.184c17.632-1.312 30.848-16.672 29.504-34.272s-16.576-31.04-34.304-29.536L133.44 883.232l-6.432-92.512 125.312-12.576a32 32 0 0 0 28.672-35.04 32.16 32.16 0 0 0-35.04-28.672L122.56 726.848 82.144 149.184l145.152-10.144-60.96 96.224a32 32 0 0 0 6.848 41.952l198.4 161.344-58.752 279.296a30.912 30.912 0 0 0 0.736 14.752 31.68 31.68 0 0 0 1.408 11.04l51.52 154.56a31.968 31.968 0 0 0 27.456 21.76l523.104 47.552a32.064 32.064 0 0 0 34.848-29.632l55.776-798.048a32.064 32.064 0 0 0-7.776-23.232z m-98.912 630.848l-412.576-39.648a31.52 31.52 0 0 0-34.912 28.768 32 32 0 0 0 28.8 34.912l414.24 39.808-6.272 89.536-469.728-42.72-39.584-118.72 234.816-310.016a31.936 31.936 0 0 0-1.248-40.192L468.896 219.84l65.088-81.056 407.584 28.48-40.576 580.192z" ></path></symbol><symbol id="v3-img-loading" viewBox="0 0 1024 1024"><path d="M834.7648 736.3584a5.632 5.632 0 1 0 11.264 0 5.632 5.632 0 0 0-11.264 0z m-124.16 128.1024a11.1616 11.1616 0 1 0 22.3744 0 11.1616 11.1616 0 0 0-22.3744 0z m-167.3216 65.8944a16.7936 16.7936 0 1 0 33.6384 0 16.7936 16.7936 0 0 0-33.6384 0zM363.1616 921.6a22.3744 22.3744 0 1 0 44.7488 0 22.3744 22.3744 0 0 0-44.7488 0z m-159.744-82.0224a28.0064 28.0064 0 1 0 55.9616 0 28.0064 28.0064 0 0 0-56.0128 0zM92.672 700.16a33.6384 33.6384 0 1 0 67.2256 0 33.6384 33.6384 0 0 0-67.2256 0zM51.2 528.9984a39.168 39.168 0 1 0 78.336 0 39.168 39.168 0 0 0-78.336 0z m34.1504-170.0864a44.8 44.8 0 1 0 89.6 0 44.8 44.8 0 0 0-89.6 0zM187.904 221.7984a50.432 50.432 0 1 0 100.864 0 50.432 50.432 0 0 0-100.864 0zM338.432 143.36a55.9616 55.9616 0 1 0 111.9232 0 55.9616 55.9616 0 0 0-111.9744 0z m169.0112-4.9152a61.5936 61.5936 0 1 0 123.2384 0 61.5936 61.5936 0 0 0-123.2384 0z m154.7776 69.632a67.1744 67.1744 0 1 0 134.3488 0 67.1744 67.1744 0 0 0-134.3488 0z m110.0288 130.816a72.8064 72.8064 0 1 0 145.5616 0 72.8064 72.8064 0 0 0-145.5616 0z m43.7248 169.472a78.3872 78.3872 0 1 0 156.8256 0 78.3872 78.3872 0 0 0-156.8256 0z" fill="" ></path></symbol><symbol id="v3-img-right" viewBox="0 0 1024 1024"><path d="M884.808356 96.170317c0-17.780969-16.723893-32.209586-37.309744-32.209586-20.586874 0-37.310767 14.428617-37.310767 32.209586V927.20035c0 17.780969 16.723893 32.209586 37.310767 32.209586 20.585851 0 37.309744-14.428617 37.309744-32.209586V96.170317zM263.249101 159.859871c-27.619034-21.278629-50.027393-11.659551-50.027393 22.116717v659.490146c0 33.44881 22.481014 43.322691 50.027393 22.116716l407.352615-313.385476c27.65485-21.242813 27.618011-55.784514 0-76.989465L263.249101 159.859871z m449.327612 260.298398c60.265572 48.751331 60.301388 134.302799 0 183.090968L297.061185 939.297876c-70.976518 57.422827-158.459988-25.322735-158.459989-116.158556V200.267163c0-91.12644 87.445608-173.6172 158.459989-116.158557l415.515528 336.049663zM297.061185 84.10963" ></path></symbol><symbol id="v3-img-left" viewBox="0 0 1024 1024"><path d="M138.60222 96.170317V927.20035c0 17.780969 16.723893 32.209586 37.309744 32.209586 20.586874 0 37.310767-14.428617 37.310767-32.209586V96.170317c0-17.780969-16.723893-32.209586-37.310767-32.209586-20.585851 0-37.309744 14.428617-37.309744 32.209586z m621.560278 63.689554L352.80886 473.208509c-27.618011 21.205974-27.65485 55.747675 0 76.989465l407.353638 313.385476c27.54638 21.205974 50.027393 11.33107 50.027393-22.116716v-659.490146c-0.001023-33.776268-22.408359-43.395346-50.027393-22.116717z m-33.812084-75.750241c71.013357-57.459666 158.458965 25.032116 158.458965 116.157533v622.872157c0 90.835821-87.482447 173.581384-158.459988 116.158556L310.834886 603.249237c-60.301388-48.78817-60.265572-134.339638 0-183.090968L726.350414 84.10963z m0 0" ></path></symbol><symbol id="v3-img-zoom-out" viewBox="0 0 1024 1024"><path d="M919.264 905.984l-138.912-138.912C851.808 692.32 896 591.328 896 480c0-229.376-186.624-416-416-416S64 250.624 64 480s186.624 416 416 416c95.008 0 182.432-32.384 252.544-86.208l141.44 141.44a31.904 31.904 0 0 0 45.248 0 32 32 0 0 0 0.032-45.248zM128 480C128 285.92 285.92 128 480 128s352 157.92 352 352-157.92 352-352 352S128 674.08 128 480z" ></path><path d="M625.792 448H336a32 32 0 0 0 0 64h289.792a32 32 0 1 0 0-64z" ></path></symbol><symbol id="v3-img-zoom-big" viewBox="0 0 1024 1024"><path d="M919.264 905.984l-138.912-138.912C851.808 692.32 896 591.328 896 480c0-229.376-186.624-416-416-416S64 250.624 64 480s186.624 416 416 416c95.008 0 182.432-32.384 252.544-86.208l141.44 141.44a31.904 31.904 0 0 0 45.248 0 32 32 0 0 0 0.032-45.248zM128 480C128 285.92 285.92 128 480 128s352 157.92 352 352-157.92 352-352 352S128 674.08 128 480z" ></path><path d="M625.792 448H512v-112a32 32 0 0 0-64 0V448h-112a32 32 0 0 0 0 64H448v112a32 32 0 1 0 64 0V512h113.792a32 32 0 1 0 0-64z" ></path></symbol><symbol id="v3-img-rotate-left" viewBox="0 0 1024 1024"><path d="M884.565333 431.914667c-3.114667 36.266667-22.784 55.893333-59.008 59.008-35.2-3.114667-54.357333-22.741333-57.472-59.008 3.114667-35.157333 22.272-54.314667 57.472-57.429334 36.224 3.114667 55.893333 22.272 59.008 57.429334z m-97.834666 0c3.114667 24.874667 16.042667 38.826667 38.826666 41.941333 22.741333-2.048 35.712-16.042667 38.826667-41.941333-3.114667-24.832-16.085333-38.272-38.826667-40.362667-22.784 3.114667-35.712 16.597333-38.826666 40.362667z m-59.008 82.346666c-1.024 103.466667-34.688 156.245333-100.906667 158.293334-69.376-1.024-104.021333-53.76-104.021333-158.293334 0.981333-104.576 35.157333-158.421333 102.442666-161.536 67.285333 2.133333 101.461333 55.893333 102.485334 161.493334z m-169.216 0c0 89.002667 22.229333 132.992 66.730666 131.925334 44.501333 1.066667 66.773333-42.922667 66.773334-131.968 0-90.026667-22.784-134.528-68.309334-133.546667-42.453333 3.114667-64.213333 47.658667-65.194666 133.546667z m-184.746667 49.664c-58.026667-5.205333-89.6-39.338667-94.72-102.485333 4.096-67.285333 37.76-103.509333 100.906667-108.714667 72.448-0.981333 108.16 50.218667 107.093333 153.728 0 109.738667-37.76 165.12-113.322667 166.144-45.568-2.090667-74.538667-24.32-86.954666-66.773333l32.597333-10.88c7.253333 36.266667 26.453333 53.845333 57.472 52.821333 48.64-2.090667 73.472-45.056 74.538667-128.853333-15.530667 29.994667-41.429333 45.013333-77.653334 45.013333z m3.072-181.674666c-39.338667 3.114667-60.586667 28.458667-63.658667 76.074666 2.048 47.616 23.296 72.96 63.658667 76.074667 40.362667 0 65.194667-18.645333 74.538667-55.893333 0-65.194667-24.874667-97.28-74.538667-96.256z m135.594667 641.578666C230.186667 1023.829333 0.597333 794.24 0.597333 512v-0.981333h53.973334v0.981333c0 252.501333 205.354667 457.898667 457.813333 457.898667 252.501333 0 457.898667-205.397333 457.898667-457.898667 0-252.458667-205.397333-457.813333-457.856-457.813333A457.088 457.088 0 0 0 159.530667 220.586667l120.533333-0.938667h8.106667l-47.061334 47.786667-167.936 1.365333-1.109333-167.936 47.189333-47.872v131.626667A510.933333 510.933333 0 0 1 512.426667 0.128C794.624 0.128 1024.256 229.76 1024.256 512c0 282.282667-229.632 511.872-511.829333 511.872z" ></path></symbol><symbol id="v3-img-antetype" viewBox="0 0 1024 1024"><path d="M316 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8zM512 622c22.1 0 40-17.9 40-39 0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39zM512 482c22.1 0 40-17.9 40-39 0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39z" ></path><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z" ></path><path d="M648 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8z" ></path></symbol><symbol id="v3-img-rotate-right" viewBox="0 0 1024 1024"><path d="M375.381 562.517c-57.898-5.162-89.472-39.296-94.634-102.4 4.138-67.2 37.76-103.381 100.864-108.586 72.362-1.024 108.032 50.176 107.008 153.6 0 109.61-37.76 164.906-113.238 165.973-45.525-2.133-74.453-24.32-86.869-66.73l32.597-10.838c7.211 36.181 26.368 53.76 57.387 52.736 48.597-2.048 73.387-44.97 74.453-128.768-15.488 29.995-41.386 45.013-77.568 45.013z m3.115-181.504c-39.296 3.072-60.501 28.459-63.573 75.99 2.048 47.573 23.253 72.96 63.573 76.032 40.32 0 65.152-18.603 74.453-55.851 0-65.152-24.832-97.195-74.453-96.17z m145.835 131.84c0.981-104.448 35.114-158.208 102.4-161.322 67.157 2.09 101.29 55.85 102.357 161.322-1.067 103.424-34.688 156.16-100.821 158.251-69.334-1.067-103.936-53.76-103.936-158.25z m169.088 0c0-89.984-22.784-134.4-68.267-133.418-42.41 3.114-64.128 47.616-65.152 133.418 0 88.96 22.187 132.907 66.688 131.84 44.459 1.067 66.73-42.88 66.73-131.84z m75.989-82.218c3.115-35.158 22.23-54.272 57.387-57.387 36.181 3.115 55.893 22.23 58.965 57.387-3.115 36.224-22.784 55.893-58.965 58.965-35.158-3.115-54.272-22.741-57.387-58.965z m96.17 0c-3.071-24.832-16.042-38.23-38.783-40.32-22.742 3.114-35.67 16.554-38.784 40.32 3.114 24.832 16.042 38.826 38.826 41.898 22.699-2.048 35.67-16.042 38.742-41.898z m-354.175 592.64c-281.984 0-511.36-229.376-511.36-511.403C0 229.973 229.419 0.512 511.403 0.512c157.696 0 298.922 71.765 392.789 184.32V54.613l47.147 47.872-1.11 167.766-167.765-1.366-47.061-47.744h8.106l121.558 0.982a456.704 456.704 0 0 0-353.664-167.68c-252.246 0-457.43 205.226-457.43 457.429 0 252.288 205.184 457.515 457.43 457.515S968.875 764.16 968.875 511.872v-0.981h53.888v0.981c0 282.027-229.376 511.403-511.36 511.403z" ></path></symbol></svg>',A=(A=document.getElementsByTagName("script"))[A.length-1].getAttribute("data-injectcss");if(A&&!d.__iconfont__svg__cssinject__){d.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(w){console&&console.log(w)}}function R(){x||(x=!0,c())}u=function(){var w,C=document.createElement("div");C.innerHTML=E,E=null,(C=C.getElementsByTagName("svg")[0])&&(C.setAttribute("aria-hidden","true"),C.style.position="absolute",C.style.width=0,C.style.height=0,C.style.overflow="hidden",C=C,(w=document.body).firstChild?function(M,D){D.parentNode.insertBefore(M,D)}(C,w.firstChild):w.appendChild(C))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(u,0):(h=function(){document.removeEventListener("DOMContentLoaded",h,!1),u()},document.addEventListener("DOMContentLoaded",h,!1)):document.attachEvent&&(c=u,y=d.document,x=!1,function w(){try{y.documentElement.doScroll("left")}catch{return void setTimeout(w,50)}R()}(),y.onreadystatechange=function(){y.readyState=="complete"&&(y.onreadystatechange=null,R())})}(typeof window!="undefined"?window:global),z()}),Object.assign(Object.assign(Object.assign({vImagesWrap:a,imgContainer:o},ot(r)),ot(s)),{handleClose:T,toggleImg:v,initImgSize:p,dragStyle:i,handleScale:m,handleRotate:S,visibleArrowBtn:l,isMultiple:g})}});const W=e=>(Dn("data-v-15ccadb3"),e=e(),In(),e),rr={key:0,class:"v-images-wrap",ref:"vImagesWrap"},or={class:"icon img-loading rotate-animation","aria-hidden":"true"},ir=[W(()=>I("use",{"xlink:href":"#v3-img-loading"},null,-1))],lr=["src"],sr=[W(()=>I("use",{"xlink:href":"#v3-img-img-error"},null,-1))],cr=[W(()=>I("use",{"xlink:href":"#v3-img-close"},null,-1))],ur=[W(()=>I("svg",{class:"icon","aria-hidden":"true"},[I("use",{"xlink:href":"#v3-img-left"})],-1))],dr=[W(()=>I("svg",{class:"icon","aria-hidden":"true"},[I("use",{"xlink:href":"#v3-img-right"})],-1))],fr={key:3,class:"v3-img-preview-toolbar"},gr=[W(()=>I("use",{"xlink:href":"#v3-img-zoom-out"},null,-1))],pr=[W(()=>I("use",{"xlink:href":"#v3-img-zoom-big"},null,-1))],hr=[W(()=>I("use",{"xlink:href":"#v3-img-antetype"},null,-1))],mr=[W(()=>I("use",{"xlink:href":"#v3-img-rotate-left"},null,-1))],vr=[W(()=>I("use",{"xlink:href":"#v3-img-rotate-right"},null,-1))];(function(e,t){t===void 0&&(t={});var n=t.insertAt;if(e&&typeof document!="undefined"){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}})(`.icon[data-v-15ccadb3] {
|
|
width: 1em;
|
|
height: 1em;
|
|
vertical-align: -0.15em;
|
|
fill: currentColor;
|
|
overflow: hidden;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] {
|
|
z-index: 200;
|
|
user-select: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
overflow: hidden;
|
|
background: rgba(0, 0, 0, 0.3);
|
|
backdrop-filter: blur(3px);
|
|
color: #fff;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .img-loading[data-v-15ccadb3],
|
|
.v-images-wrap[data-v-15ccadb3] .img-content[data-v-15ccadb3] {
|
|
font-size: 50px;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
margin: auto;
|
|
transition: all 0.2s;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .img-container[data-v-15ccadb3] {
|
|
z-index: 201;
|
|
position: absolute;
|
|
height: 100vh;
|
|
width: 100vw;
|
|
top: 0;
|
|
left: 0;
|
|
text-align: center;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .img-container[data-v-15ccadb3] .img-content[data-v-15ccadb3] {
|
|
max-width: 100%;
|
|
max-height: 100%;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .img-container[data-v-15ccadb3] .img-error[data-v-15ccadb3] {
|
|
font-size: 300px;
|
|
color: #d8d8d8;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .rotate-animation[data-v-15ccadb3] {
|
|
animation: rotate-15ccadb3 1.5s linear infinite;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .arrow[data-v-15ccadb3] {
|
|
width: 42px;
|
|
height: 42px;
|
|
text-align: center;
|
|
line-height: 42px;
|
|
position: absolute;
|
|
top: 50%;
|
|
border-radius: 50%;
|
|
transform: translateY(-50%);
|
|
-ms-transform: translateY(-50%);
|
|
font-size: 24px;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
z-index: 280;
|
|
background: rgba(0, 0, 0, 0.3);
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .arrow[data-v-15ccadb3][data-v-15ccadb3]:hover {
|
|
opacity: 0.8;
|
|
transform: translateY(-50%) scale(1.2);
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .arrow-left[data-v-15ccadb3] {
|
|
left: 50px;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .arrow-right[data-v-15ccadb3] {
|
|
right: 50px;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .close-btn[data-v-15ccadb3] {
|
|
z-index: 205;
|
|
position: absolute;
|
|
right: 50px;
|
|
top: 50px;
|
|
width: 36px;
|
|
height: 36px;
|
|
font-size: 22px;
|
|
line-height: 36px;
|
|
text-align: center;
|
|
border-radius: 50%;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
color: #e7e5e5;
|
|
background: rgba(0, 0, 0, 0.3);
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .close-btn[data-v-15ccadb3][data-v-15ccadb3]:hover {
|
|
opacity: 0.8;
|
|
transform: scale(1.2);
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .v3-img-preview-toolbar[data-v-15ccadb3] {
|
|
z-index: 205;
|
|
position: absolute;
|
|
bottom: 10%;
|
|
font-size: 26px;
|
|
width: 100%;
|
|
display: flex;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .v3-img-preview-toolbar[data-v-15ccadb3] section[data-v-15ccadb3] {
|
|
height: 44px;
|
|
bottom: 10%;
|
|
padding: 0 22px;
|
|
display: flex;
|
|
align-items: center;
|
|
border-radius: 22px;
|
|
background: rgba(0, 0, 0, 0.3);
|
|
color: #c3c3c3;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .v3-img-preview-toolbar[data-v-15ccadb3] section[data-v-15ccadb3] svg[data-v-15ccadb3] {
|
|
box-sizing: content-box;
|
|
padding: 0 10px;
|
|
transition: all 0.2s;
|
|
}
|
|
.v-images-wrap[data-v-15ccadb3] .v3-img-preview-toolbar[data-v-15ccadb3] section[data-v-15ccadb3] svg[data-v-15ccadb3][data-v-15ccadb3]:hover {
|
|
transform: scale(1.2);
|
|
}
|
|
@keyframes rotate-15ccadb3 {
|
|
from {
|
|
transform: rotate(0deg);
|
|
}
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
`),Ke.render=function(e,t,n,a,o,i){return O(),be(tn,{name:"fade"},{default:Fe(()=>[e.visible?(O(),_("div",rr,[xe((O(),_("svg",or,ir,512)),[[Ee,e.imgState==="loading"]]),I("div",{ref:"imgContainer",style:Te(e.dragStyle),class:"img-container"},[xe(I("img",{class:"img-content",onDragstart:t[0]||(t[0]=Be(()=>{},["prevent"])),src:e.src,style:Te(`transform: scale(${e.imgScale}) rotate(${e.imgRotate}deg);`),alt:""},null,44,lr),[[Ee,e.imgState==="success"]]),xe((O(),_("svg",{class:"icon img-content img-error",onDragstart:t[1]||(t[1]=Be(()=>{},["prevent"])),"aria-hidden":"true",style:Te(`transform: scale(${e.imgScale}) rotate(${e.imgRotate}deg);`)},sr,36)),[[Ee,e.imgState==="error"]])],4),e.showCloseBtn?(O(),_("svg",{key:0,class:"icon close-btn","aria-hidden":"true",onClick:t[2]||(t[2]=Be(function(){return e.handleClose&&e.handleClose(...arguments)},["stop"]))},cr)):G("",!0),e.visibleArrowBtn?(O(),_("div",{key:1,class:"arrow arrow-left",onClick:t[3]||(t[3]=r=>e.toggleImg(!1))},ur)):G("",!0),e.visibleArrowBtn?(O(),_("div",{key:2,class:"arrow arrow-right",onClick:t[4]||(t[4]=r=>e.toggleImg(!0))},dr)):G("",!0),e.showToolbar?(O(),_("div",fr,[I("section",null,[(O(),_("svg",{class:"icon","aria-hidden":"true",onClick:t[5]||(t[5]=r=>e.handleScale(-.1,!1))},gr)),(O(),_("svg",{class:"icon","aria-hidden":"true",onClick:t[6]||(t[6]=r=>e.handleScale(.1,!1))},pr)),(O(),_("svg",{class:"icon","aria-hidden":"true",onClick:t[7]||(t[7]=function(){return e.initImgSize&&e.initImgSize(...arguments)})},hr)),(O(),_("svg",{class:"icon","aria-hidden":"true",onClick:t[8]||(t[8]=r=>e.handleRotate(!1))},mr)),(O(),_("svg",{class:"icon","aria-hidden":"true",onClick:t[9]||(t[9]=r=>e.handleRotate(!0))},vr))])])):G("",!0)],512)):G("",!0)]),_:1})},Ke.__scopeId="data-v-15ccadb3";let yn={};const Ut="v3-img-preview-container-id";let me={};function bn(e){if(me._instance)return!1;Array.isArray(e)&&(e={images:e}),typeof e=="string"&&(e={url:e}),e=Object.assign(Object.assign({},yn),e);let t=document.getElementById(Ut);return t||(t=document.createElement("div"),t.id=Ut,document.body.appendChild(t)),me=On(Ke,Object.assign(Object.assign({},e),{on_unmount_v3_ima_preview_app:()=>me.unmount()})),me.mount(t),me}(()=>{const e=Ke;return e.install=(t,n)=>{yn=n,t.config.globalProperties.$v3ImgPreviewFn=bn},e})();let Vt=pt(),et=Me(),Kt=P(!1),Ht=P(!1),qt=P(!1);function yr(){return{openVideo:()=>{Kt.value=!0},dialogVideoVisible:Kt,openText:()=>{Ht.value=!0},dialogTextVisible:Ht,openOffice:i=>{if(Y.getFileSuffix(i.name)==="pdf")qt.value=!0;else{let r=Vt.zfileConfig.officePreview.previewUrl(i.url);window.open(r)}},dialogOfficeVisible:qt,openImage:i=>{let r=[],l=0;Vt.zfileConfig.imagePreview.mode==="only"?r.push(i.url):et.filterFileByType("image").forEach((g,f)=>{i.name===g.name&&(l=f),r.push(g.url)}),bn({images:r,index:l})},openAudio:()=>{et.updateAudioList(et.filterFileByType("audio"))}}}const se=Tn("zfile-pwd-cache",{}),{encodeAllIgnoreSlashes:Wt}=ua();let ce=Me(),Se=ht();const tt=An(Se.config.siteName);let ct=pt();const{clearSelection:br}=vn(),{openAudio:wr,openImage:Sr,openOffice:Vr,openText:Cr,openVideo:kr}=yr(),H=P([]),ue=P(!1),Gt=P(!1);let ut=Le([]);if(ut.length===0)for(let e=0;e<ct.zfileConfig.skeleton.size;e++)ut.push({});let q=Le({path:"",password:"",orderBy:"",orderDirection:""});const Yt=P({}),Zt=P(!1);function bt(e,t){const{storageListAsFileList:n}=fa(e,t),a=c=>c.type==="FILE"||c.type==="FOLDER",o=({prop:c,order:y})=>{q.orderBy=c,q.orderDirection=y==="descending"?"desc":"asc",l()},i=L(()=>t.params.fullpath?"/"+t.params.fullpath.join("/"):"/"),r=L(()=>t.params.storageKey),l=c=>{if(!r.value)return;ue.value=!0,q.path=i.value;let y=c||{};y.storageKey=r.value,y.path=i.value,y.password=y.password||v(),y.orderBy=q.orderBy,y.orderDirection=q.orderDirection;let x=r.value;$a(y).then(E=>{let A=E.data.passwordPattern;if(d(A,y.password),x!==r.value)return;r.value!==ce.oldStorageKey&&ce.updateOldStorageKey(r.value);let R=E.data.files,w=q.path;if(w!==""&&w!=="/"){let C=De.basename(De.resolve(i.value,"../"));R.unshift({name:C||"/",path:De.resolve(w,"../"),type:"BACK"})}ce.updateFileList(R),ue.value=!1,Gt.value=!0,H.value=[],t.params.fullpath?tt.value=Se.config.siteName+" | "+t.params.fullpath[t.params.fullpath.length-1]:tt.value=Se.config.siteName+" | \u9996\u9875"}).catch(E=>{let A=E.response.data;A.code===Y.responseCode.INVALID_PASSWORD?(N.warning("\u5BC6\u7801\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\uFF01"),T()):A.code===Y.responseCode.REQUIRED_PASSWORD?(N.warning("\u6B64\u6587\u4EF6\u5939\u9700\u8981\u5BC6\u7801\uFF0C\u8BF7\u8F93\u5165\u5BC6\u7801\uFF01"),T()):N.error(A.msg)})},s=()=>{let c={storageKey:t.params.storageKey,path:i.value};Na(c).then(y=>{Yt.value=y.data}).finally(()=>{Zt.value=!0})},g=c=>{if(!!c.name)if(ce.updateCurrentClickRow(c),c.type==="FILE"){const{batchDownloadFile:y}=wn(e,t);switch(c.fileType){case"video":kr();break;case"image":Sr(c);break;case"text":Cr();break;case"audio":wr(c);break;default:y(c)}br()}else if(c.type==="ROOT")e.push(c.path);else if(c.type==="BACK"){let y=Ue("/"+r.value+"/"+c.path);y=Wt(y),e.push(y)}else{let y=Ue("/"+r.value+"/"+c.path+"/"+c.name);y=Wt(y),e.push(y)}},f=({row:c,rowIndex:y})=>(c.index=y,H.value.indexOf(c)!==-1?"select-row":""),p=L(()=>H.value.length>0?H.value[H.value.length-1]:null),S=L(()=>H.value.filter(c=>c.type==="FILE")),m=L(()=>H.value.filter(c=>c.type==="FOLDER")),b=c=>{H.value=c};let k=L(()=>{let c=ct.zfileConfig.skeleton.enable,y=ct.zfileConfig.skeleton.show;return c?y==="always"?ue.value:Gt.value?!1:ue.value:!1}),z=L(()=>k.value?!1:ue.value),T=()=>{Z.prompt("\u6B64\u6587\u4EF6\u5939\u5DF2\u52A0\u5BC6\uFF0C\u8BF7\u8F93\u5165\u5BC6\u7801","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",inputType:"password",inputValidator(c){return!!c},inputErrorMessage:"\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A."}).then(({value:c})=>{l({password:c})}).catch(()=>{if((q.path==="/"||q.path==="")&&Se.config.rootShowStorage===!0)ce.updateFileList(n.value),e.push("/"),tt.value=Se.config.siteName+" | \u9996\u9875",ue.value=!1;else{let c=De.resolve(q.path,"../");e.push("/"+r.value+c)}})},v=()=>{for(let c of Object.keys(se.value))if(c===r.value){for(let y of Object.keys(se.value[c]))if(ja(i.value,y))return se.value[c][y]}return""},d=(c,y)=>{c&&(se.value[r.value]||(se.value[r.value]={}),se.value[r.value][c]=y)};const u=L(()=>{let c=0,y=0,x=0,E=0,A=ce.fileList;for(let R=0;R<A.length;R++){let w=A[R];w.type==="FOLDER"?E++:w.type==="FILE"&&(x++,y+=w.size)}return c=E+x,{total:c,size:y,fileCount:x,dirCount:E}}),h=L(()=>{let c=H.value.length,y=S.value.length,x=m.value.length,E=c===1,A=c>1;return{isSingleSelect:E,isMultiSelect:A,isAllFile:y===c,isAllFolder:x===c}});return{currentPath:i,storageKey:r,loadFile:l,openRow:g,searchParam:q,sortChangeMethod:o,checkSelectable:a,selectRow:p,selectRows:H,selectFiles:S,selectFolders:m,selectRowsChange:b,tableRowClassName:f,skeletonLoading:k,skeletonData:ut,basicLoading:z,statistics:u,selectStatistics:h,storageConfig:Yt,initStorageConfig:Zt,loadFileConfig:s}}const de=P([]),Xt=P(!1);function wn(e,t){const{currentPath:n,storageKey:a,loadFile:o,storageConfig:i,selectRows:r,selectRow:l,selectFolders:s,selectFiles:g}=bt(e,t),f=d=>{if(!r.value&&r.value.length===0){N.warning("\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6");return}let u;d.name?u=`\u662F\u5426\u786E\u8BA4\u4E0B\u8F7D\u6587\u4EF6 ${d.name}\uFF1F`:r.value.length===1?u=`\u662F\u5426\u786E\u8BA4\u4E0B\u8F7D\u6587\u4EF6 ${r.value[0].name}\uFF1F`:r.value.length>1&&(u=`\u662F\u5426\u786E\u8BA4\u6279\u91CF\u4E0B\u8F7D ${r.value.length} \u4E2A\u6587\u4EF6\uFF1F`),Z.confirm(u,"\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"info",callback:h=>{h==="confirm"&&(d.name?p(d.url):r.value.forEach(c=>{c.type==="FILE"&&p(c.url)}))}})},p=d=>{const u=document.createElement("iframe");u.style.display="none",u.style.height=0,u.src=d,document.body.appendChild(u),setTimeout(()=>{u.remove()},5*60*1e3)},S=()=>{Z.prompt(`\u5728 <b>${n.value}</b> \u4E0B\u521B\u5EFA\u6587\u4EF6\u5939\uFF0C\u8BF7\u8F93\u5165\u8981\u521B\u5EFA\u7684\u6587\u4EF6\u5939\u540D\u79F0`,"\u63D0\u793A",{dangerouslyUseHTMLString:!0,confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",draggable:!0,inputValidator(d){return d?d.includes("/")?"\u6587\u4EF6\u5939\u540D\u79F0\u4E0D\u80FD\u5305\u542B /":!0:"\u6587\u4EF6\u5939\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"}}).then(({value:d})=>{let u={storageKey:a.value,path:n.value,name:d};ha(u).then(()=>{N.success("\u521B\u5EFA\u6210\u529F")}).finally(()=>{o()})})},m=()=>{let d=l.value;if(d===null){N.warning("\u8BF7\u5148\u9009\u4E2D\u4E00\u4E2A\u6587\u4EF6\u6216\u6587\u4EF6\u5939\uFF01");return}Z.prompt(`\u5C06 <b>${d.name}</b> \u4FEE\u6539\u4E3A\uFF1A`,"\u63D0\u793A",{dangerouslyUseHTMLString:!0,confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",inputValue:d.name,inputValidator(u){return!!u},inputErrorMessage:"\u6A21\u677F\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A."}).then(({value:u})=>{let h={storageKey:a.value,path:n.value,name:d.name,newName:u},c;d.type==="FILE"?c=ya:d.type==="FOLDER"&&(c=ba),c(h).then(()=>{N.success("\u91CD\u547D\u540D\u6210\u529F")}).finally(()=>{o()})})},b=()=>{N.warning("\u6682\u672A\u5B9E\u73B0")},k=()=>{N.warning("\u6682\u672A\u5B9E\u73B0")},z=()=>{if(!i.value.enableFileOperator)return;if(r.value.length===0){N.warning("\u8BF7\u5148\u81F3\u5C11\u9009\u4E2D\u4E00\u4E2A\u6587\u4EF6\u6216\u6587\u4EF6\u5939\uFF01");return}let d="\u662F\u5426\u786E\u8BA4\u6279\u91CF\u5220\u9664 ";s.value.length>0&&(d+=" "+s.value.length+" \u4E2A\u6587\u4EF6\u5939(\u5982\u6587\u4EF6\u5939\u975E\u7A7A\uFF0C\u53EF\u80FD\u4F1A\u5220\u9664\u5931\u8D25)"),s.value.length>0&&g.value.length>0&&(d+="\uFF0C"),g.value.length>0&&(d+=g.value.length+" \u4E2A\u6587\u4EF6"),d+="?",de.value=[],Z.confirm(d,"\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",draggable:!0,callback:h=>{h==="confirm"&&(r.value.length>1?(Xt.value=!0,r.value.forEach(c=>{u(c).then(()=>{de.value.push({name:c.name,status:!0})}).catch(()=>{de.value.push({name:c.name,status:!1})})})):u(l.value).then(c=>{N.success("\u5220\u9664\u6210\u529F"),o()}))}});const u=h=>{let c={storageKey:a.value,path:n.value,name:h.name};return h.type==="FOLDER"?va(c):ma(c)}},T=()=>{de.value=[],o()},v=L(()=>Math.floor(de.value.length/r.value.length*100));return{batchDownloadFile:f,rename:m,newFolder:S,moveTo:b,copyTo:k,batchDelete:z,batchDeleteResult:de,batchDeleteDialogShow:Xt,batchDeleteCloseAction:T,batchDeletePercentage:v}}pt();let xr=ht(),te=Me();const{clearSelection:dt,toggleRowSelection:Ie,toggleAllSelection:Er}=vn(),Tr=gt("Meta"),Ar=gt("Control"),Lr=gt("Shift");let zr=L(()=>Tr.value||Ar.value),ft,_e;window.addEventListener("keydown",function(e){var t;e.key==="Escape"&&Oe()?dt():e.key==="a"&&(e.metaKey||e.ctrlKey)&&Oe()?(e.preventDefault(),Er()):e.key==="Delete"&&Oe()?ft&&((t=_e==null?void 0:_e.value)==null?void 0:t.length)>0&&(e.preventDefault(),ft()):e.key==="Backspace"&&Oe()&&te.fileList.length>0&&te.fileList[0].type==="BACK"&&Cn(te.fileList[0])},!1);const Oe=()=>Mr()&&Sn()===!1,Mr=()=>document.querySelector(".zfile-index-body:hover"),Sn=()=>!!document.querySelector(".el-popup-parent--hidden"),Ce=P(-1),ke=P(-1),{pressed:Pr}=Ln();je(()=>Pr.value,(e,t)=>{e===!1&&t===!0&&(Ce.value=-1,ke.value=-1)});let Cn;function Kr(e,t){const{skeletonLoading:n,openRow:a,selectRows:o,selectRow:i,currentPath:r}=bt(e,t);ft=wn(e,t).batchDelete,_e=o;const l=(p,S)=>{var k;if(S===void 0){a(p);return}let m=S.type==="selection";if(!m&&xr.config.fileClickMode==="click"){a(p);return}if(n.value)return;let b=o.value.length===1&&((k=i.value)==null?void 0:k.name)===p.name;if(Lr.value){let z=te.fileList.findIndex(T=>T.name===i.value.name);if(z!==null){let T=te.fileList.findIndex(u=>u.name===p.name),v=Math.min(T,z),d=Math.max(T,z);for(let u=v+1;u<d;u++){let h=te.fileList[u];Ie(h,!0)}}}else!zr.value&&!b&&!m&&dt();Ie(p)};return Cn=l,{tableClickRow:l,tableDbClickRow:p=>{n.value||a(p)},tableHoverRow:(p,S,m,b)=>{if(b.buttons===1&&Ce.value!==-1){if(ke.value===-1){dt();let d=te.fileList[Ce.value];Ie(d,!0)}let k=p.index,z=ke.value>=0?ke.value:k-1,T=Math.min(z,k),v=Math.max(z,k);for(let d=T;d<=v;d++){let u=te.fileList[d];Ie(u,!0)}ke.value=k}},tableLeaveRow:(p,S,m,b)=>{b.buttons===1&&Ce.value===-1&&(Ce.value=p.index)}}}const Q=P(!1),nt=P(""),J=Le([]),re=new Map,at=new Map;let Rr=0,ve=Me(),ye=P(!1);function Hr(e,t){const{currentPath:n,storageKey:a,storageConfig:o}=bt(e,t),i=v=>{v=document.querySelector("body");const d=w=>{var D,j;if(y(),ye.value=!1,Sn()||o.value.enableFileOperator===!1||!a.value||Q.value)return;w.stopPropagation(),w.preventDefault();const C=Yn.service({text:"\u6587\u4EF6\u8BFB\u53D6\u4E2D...",background:"rgba(0, 0, 0, .3)"}),M=((D=w.clipboardData)==null?void 0:D.items)||((j=w.dataTransfer)==null?void 0:j.items);h(M).then(F=>{if($e(()=>{C.close()}),F.length===0)return;let B=[];F.forEach((ne,pe)=>{ne.name===".DS_Store"&&B.push(pe)});const qe=()=>{Q.value=!0,F.forEach(ne=>{z({file:ne})})};B.length>0?Z.confirm(`\u68C0\u6D4B\u5230\u6709 ${B.length} \u4E2A .DS_Store \u6587\u4EF6\uFF0C\u662F\u5426\u4E0A\u4F20\u65F6\u8DF3\u8FC7\u8FD9\u4E9B\u6587\u4EF6`,"\u63D0\u793A",{confirmButtonText:"\u8DF3\u8FC7\u8FD9\u4E9B\u6587\u4EF6",cancelButtonText:"\u4F9D\u65E7\u4E0A\u4F20",type:"success",callback:ne=>{if(ne==="confirm")for(let pe=B.length-1;pe>=0;pe--){let kn=B[pe];F.splice(kn,1)}qe()}}):F.length>100?Z.confirm(`\u6587\u4EF6\u6570\u91CF\u4E3A ${F.length} \u4E2A\uFF0C\u662F\u5426\u786E\u8BA4\u4E0A\u4F20\uFF1F`,"\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"success",callback:ne=>{ne==="confirm"&&qe()}}):qe()})};let u=null;v.addEventListener("dragenter",w=>{!a.value||Q.value||o.value.enableFileOperator!==!1&&(u=w.target,c(),w.stopPropagation(),w.preventDefault(),ye.value=!0)},!1),v.addEventListener("dragover",function(w){!a.value||Q.value||o.value.enableFileOperator!==!1&&(w.stopPropagation(),w.preventDefault(),ye.value=!0)},!1),v.addEventListener("dragleave",function(w){!a.value||Q.value||o.value.enableFileOperator!==!1&&(u===w.target&&(y(),ye.value=!1),w.stopPropagation(),w.preventDefault())},!1),v.addEventListener("drop",d,!1),v.addEventListener("paste",d,!1);const h=async w=>{let C=[],M=[];if(w){let D=new Array(...w);for(let j=0;j<D.length;j++){let F=D[j],B=null;if(F.webkitGetAsEntry)B=F.webkitGetAsEntry();else if(F.getAsEntry)B=F.getAsEntry();else{N.warning("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u62D6\u62FD\u4E0A\u4F20");return}M.push(B)}if(M.length>0)for(let j=0;j<M.length;j++){let F=M[j];if(F){let B=await R(F);Array.isArray(B)?A(B,C):C.push(B)}}}return C},c=()=>{v.classList.add("dragging-over")},y=()=>{v.classList.remove("dragging-over")};function x(w){return new Promise((C,M)=>{w.file(D=>{C(D)})})}function E(w){return new Promise((C,M)=>{w.readEntries(D=>{C(D)})})}function A(w,C){for(let M=0;M<w.length;M++)Array.isArray(w[M])?A(w[M],C):C.push(w[M])}async function R(w){let C=w.fullPath||"",M=[];if(w.isFile){let D=await x(w);return D.dropUploadPath=C,D}else if(w.isDirectory){let D=w.createReader(),j=await E(D);for(let F=0;F<j.length;F++){let B=await R(j[F]);M.push(B)}return M}}},r=()=>{Q.value=!0,nt.value="file"},l=()=>{Q.value=!0,nt.value="folder",$e(()=>{document.getElementsByClassName("el-upload__input")[0].webkitdirectory=!0})},s=v=>{let d=n.value;if(v.webkitRelativePath||v.dropUploadPath){let h=(v.webkitRelativePath||v.dropUploadPath).split("/");h.forEach((c,y)=>{let x=y===0,E=h.length-1===y;x||E||c&&(d+="/"+c)})}let u={storageKey:a.value,path:Ue(d),name:v.name,size:v.size};wa(u).then(h=>{const c=Rr++;let y={name:v.name,size:v.size,speed:"-",progress:0,loaded:0,status:"uploading",startTime:Date.now(),index:c};J.push(y),re.set(c,ie.CancelToken.source()),at.set(c,J[J.length-1]);const{on:x}=wt(`cancel-upload-${c}`);x(()=>{let w=re.get(c);w&&(w.cancel(),J.find((C,M)=>{let D=C.name===v.name;return D&&J.splice(M,1),D}))});let E=["local","webdav","ftp","sftp"],A=["s3","tencent","aliyun","qiniu","minio","huawei"],R=["sharepoint","sharepoint-china","onedrive","onedrive-china"];E.includes(ve.currentStorageSource.type.key)?g(v,h.data,c):A.includes(ve.currentStorageSource.type.key)?f(v,h.data,c):R.includes(ve.currentStorageSource.type.key)?S(v,h.data,c):ve.currentStorageSource.type.key==="upyun"&&m(v,h.data,c)})},g=(v,d,u)=>{let h=new FormData;h.append("file",v),ie.post(d,h,{cancelToken:re.get(u).token,onUploadProgress:c=>{p(c,u)}})},f=(v,d,u)=>{ie.put(d,v,{withCredentials:!1,cancelToken:re.get(u).token,onUploadProgress:h=>{p(h,u)}})},p=(v,d)=>{let u=at.get(d);u.size=v.total,u.loaded=v.loaded,u.progress=Math.round(v.loaded/v.total*100),u.speed=Y.fileSizeFormat(Math.round(v.loaded/(Date.now()-u.startTime)*1e3)),u.progress===100&&(u.status="finished",u.endTime=Date.now())},S=(v,d,u)=>{let h=1,c=0,y=0,x=v.size;const E=104857599,A=()=>{c+E>=x?y=x:y=c+E,h>1&&re.set(u,ie.CancelToken.source());let R=v.slice(c,y);ie.put(`${d}`,R,{cancelToken:re.get(u).token,timeout:1e7,headers:{"Content-Type":"application/octet-stream","Content-Range":`bytes ${c}-${y-1}/${v.size}`},type:"sync",withCredentials:!1,onUploadProgress:w=>{if(w.lengthComputable){let C=at.get(u);const M=w.loaded+c;C.size=x,C.loaded=M,C.progress=Math.round(M/x*100),C.speed=Y.fileSizeFormat(Math.round(M/(Date.now()-C.startTime)*1e3)),C.progress===100&&(C.status="finished",C.endTime=Date.now())}}}).then(w=>{w.status===202?(c+=E,h+=1,A()):w.status}).catch(w=>{})};A()},m=(v,d,u)=>{let h=JSON.parse(d),c=new FormData;c.append("name",v.name),c.append("authorization",h.signature),c.append("policy",h.policy),c.append("file",v),ie.post(h.url,c,{withCredentials:!1,cancelToken:re.get(u).token,onUploadProgress:y=>{p(y,u)}})},b=L(()=>{let v=J.length,d=0,u=0;return J.forEach(h=>{h.status==="uploading"?d++:h.status==="finished"&&u++}),{totalSize:v,totalUploading:d,totalFinish:u}}),k=L(()=>J.sort((v,d)=>{let u=v.status==="uploading",h=d.status==="uploading";if(!u&&!h)return v.startTime-d.startTime;if(u&&!h)return-1;if(!u&&h)return 1;if(u&&h)return v.endTime-d.endTime})),z=v=>{let d=ve.fileList.find(u=>{if(u.name===v.file.name)return u});if(d){sa({zIndex:9999,title:"\u63D0\u793A",message:`\u5F53\u524D\u76EE\u5F55\u5DF2\u5B58\u5728\u6587\u4EF6 ${d.name}, \u8DF3\u8FC7\u4E0A\u4F20.`,type:"warning"});return}s(v.file)};return{visible:Q,uploadMode:nt,openUploadDialog:r,openUploadFolderDialog:l,cancelUpload:v=>{Z.confirm(`\u662F\u5426\u786E\u5B9A\u53D6\u6D88\u6587\u4EF6 ${v.name} \u4E0A\u4F20\uFF1F`,"\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u8FD4\u56DE",type:"warning",callback:d=>{d==="confirm"&&wt(`cancel-upload-${v.index}`).emit()}})},dropState:ye,listenDropFile:i,beforeUpload:z,uploadFile:s,uploadProgressInfoSorted:k,uploadProgressInfoStatistics:b}}export{ua as a,ht as b,bt as c,wn as d,Hr as e,vn as f,Kr as g,yr as h,fa as i,Ue as j,Nr as l,jr as r,Ur as s,Me as u};
|