import{P as Ne,br as ci,a as L,d as se,b6 as Ct,u as et,c as g,bs as At,_ as Et,U as Ze,a8 as fe,Y as z,bc as Yt,af as qt,ad as Ot,h as G,bt as di,b as tt,ae as fi,bu as vi,av as Zt,bb as zn,r as _,b3 as Te,ai as je,aa as Kt,ap as mi,an as _n,bv as Dn,ab as ze,y as le,aI as gi,bw as pi,s as ve,bx as hi,by as xe,bz as Nn,e as vt,bA as yi,ac as Xt,bB as bi,W as q,bm as wi,bC as Si,bD as en,aA as Ci,bE as Ai,bF as Ei,aj as Pt,b4 as Ie,bG as Oi,bH as tn,bI as Pi,bJ as xi,aw as ki,bK as Ii,bL as $i,bM as Mi,a6 as xt,bN as Li,$ as mt,bO as zi,X as F,bP as kt,bQ as _i,x as nt,bR as Tn,bo as ae,am as Be,bS as me,bT as Di,bU as It,bV as nn,aJ as Bn,bj as rn,bk as Ni,bW as Ge,bX as Ti,bi as $t,bY as Bi,bZ as re,B as Mt,b_ as Fi,v as Fn,K as ji,b$ as jn,a0 as Qi,Z as st,c0 as Ri,c1 as Vi,c2 as Ui,c3 as Hi,c4 as Gi,c5 as Wi,a1 as Ji,a2 as Yi,o as T,z as Y,c6 as qi,c7 as Zi,c8 as Ki,c9 as Xi,ca as er,bd as tr,l as J,cb as Ue,J as ce,m as M,E as Lt,cc as an,cd as nr,ce as ir,cf as rr,N as Fe,C as Q,t as N,n as D,T as Qn,cg as ar,ch as lr,M as Rn,q as Z,V as Vn,ci as or,A as sr}from"./index-9fc801b7.js";import{e as ur,f as cr,t as dr,h as Un}from"./db-63f67577.js";import{t as ut,l as ke}from"./index-82db850c.js";import{b as fr}from"./_baseIteratee-429a7bd1.js";var Hn=function(){return{arrow:{type:[Boolean,Object],default:void 0},trigger:{type:[Array,String]},overlay:Ne.any,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},align:{type:Object},getPopupContainer:Function,prefixCls:String,transitionName:String,placement:String,overlayClassName:String,overlayStyle:{type:Object,default:void 0},forceRender:{type:Boolean,default:void 0},mouseEnterDelay:Number,mouseLeaveDelay:Number,openClassName:String,minOverlayWidthMatchTrigger:{type:Boolean,default:void 0},destroyPopupOnHide:{type:Boolean,default:void 0},onVisibleChange:{type:Function},"onUpdate:visible":{type:Function}}},ct=ci(),vr=function(){return L(L({},Hn()),{},{type:ct.type,size:String,htmlType:ct.htmlType,href:String,disabled:{type:Boolean,default:void 0},prefixCls:String,icon:Ne.any,title:String,loading:ct.loading,onClick:{type:Function}})},mr=["type","disabled","loading","htmlType","class","overlay","trigger","align","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:visible"],gr=Ze.Group;const Ke=se({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:Ct(vr(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:["icon","leftButton","rightButton","overlay"],setup:function(e,n){var i=n.slots,r=n.attrs,s=n.emit,m=function(S){s("update:visible",S),s("visibleChange",S)},c=et("dropdown-button",e),p=c.prefixCls,h=c.direction,P=c.getPopupContainer;return function(){var C,S,b=L(L({},e),r),l=b.type,a=l===void 0?"default":l,o=b.disabled,d=b.loading,u=b.htmlType,A=b.class,f=A===void 0?"":A,O=b.overlay,y=O===void 0?(C=i.overlay)===null||C===void 0?void 0:C.call(i):O,x=b.trigger,E=b.align,w=b.visible;b.onVisibleChange;var v=b.placement,k=v===void 0?h.value==="rtl"?"bottomLeft":"bottomRight":v,I=b.href,$=b.title,j=b.icon,K=j===void 0?((S=i.icon)===null||S===void 0?void 0:S.call(i))||g(At,null,null):j,R=b.mouseEnterDelay,X=b.mouseLeaveDelay,oe=b.overlayClassName,de=b.overlayStyle,ye=b.destroyPopupOnHide,U=b.onClick;b["onUpdate:visible"];var W=Et(b,mr),ee={align:E,disabled:o,trigger:o?[]:x,placement:k,getPopupContainer:P.value,onVisibleChange:m,mouseEnterDelay:R,mouseLeaveDelay:X,visible:w,overlayClassName:oe,overlayStyle:de,destroyPopupOnHide:ye},te=g(Ze,{type:a,disabled:o,loading:d,onClick:U,htmlType:u,href:I,title:$},{default:i.default}),ne=g(Ze,{type:a,icon:K},null);return g(gr,L(L({},W),{},{class:fe(p.value,f)}),{default:function(){return[i.leftButton?i.leftButton({button:te}):te,g(Ae,ee,{default:function(){return[i.rightButton?i.rightButton({button:ne}):ne]},overlay:function(){return y}})]}})}}});var Gn=se({compatConfig:{MODE:3},name:"ADropdown",inheritAttrs:!1,props:Ct(Hn(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:["overlay"],setup:function(e,n){var i=n.slots,r=n.attrs,s=n.emit,m=et("dropdown",e),c=m.prefixCls,p=m.rootPrefixCls,h=m.direction,P=m.getPopupContainer,C=z(function(){var a=e.placement,o=a===void 0?"":a,d=e.transitionName;return d!==void 0?d:o.indexOf("top")>=0?"".concat(p.value,"-slide-down"):"".concat(p.value,"-slide-up")}),S=function(){var o,d,u,A=e.overlay||((o=i.overlay)===null||o===void 0?void 0:o.call(i)),f=Array.isArray(A)?A[0]:A;if(!f)return null;var O=f.props||{};Yt(!O.mode||O.mode==="vertical","Dropdown",'mode="'.concat(O.mode,`" is not supported for Dropdown's Menu.`));var y=O.selectable,x=y===void 0?!1:y,E=O.expandIcon,w=E===void 0?(d=f.children)===null||d===void 0||(u=d.expandIcon)===null||u===void 0?void 0:u.call(d):E,v=typeof w<"u"&&Zt(w)?w:g("span",{class:"".concat(c.value,"-menu-submenu-arrow")},[g(zn,{class:"".concat(c.value,"-menu-submenu-arrow-icon")},null)]),k=Zt(f)?qt(f,{mode:"vertical",selectable:x,expandIcon:function(){return v}}):f;return k},b=z(function(){var a=e.placement;if(!a)return h.value==="rtl"?"bottomRight":"bottomLeft";if(a.includes("Center")){var o=a.slice(0,a.indexOf("Center"));return Yt(!a.includes("Center"),"Dropdown","You are using '".concat(a,"' placement in Dropdown, which is deprecated. Try to use '").concat(o,"' instead.")),o}return a}),l=function(o){s("update:visible",o),s("visibleChange",o)};return function(){var a,o,d=e.arrow,u=e.trigger,A=e.disabled,f=e.overlayClassName,O=(a=i.default)===null||a===void 0?void 0:a.call(i)[0],y=qt(O,Ot({class:fe(O==null||(o=O.props)===null||o===void 0?void 0:o.class,G({},"".concat(c.value,"-rtl"),h.value==="rtl"),"".concat(c.value,"-trigger"))},A?{disabled:A}:{})),x=fe(f,G({},"".concat(c.value,"-rtl"),h.value==="rtl")),E=A?[]:u,w;E&&E.indexOf("contextmenu")!==-1&&(w=!0);var v=di({arrowPointAtCenter:tt(d)==="object"&&d.pointAtCenter,autoAdjustOverflow:!0}),k=fi(L(L(L({},e),r),{},{builtinPlacements:v,overlayClassName:x,arrow:d,alignPoint:w,prefixCls:c.value,getPopupContainer:P.value,transitionName:C.value,trigger:E,onVisibleChange:l,placement:b.value}),["overlay","onUpdate:visible"]);return g(vi,k,{default:function(){return[y]},overlay:S})}}});Gn.Button=Ke;const Ae=Gn;Ae.Button=Ke;Ae.install=function(t){return t.component(Ae.name,Ae),t.component(Ke.name,Ke),t};function pr(){var t=document.documentElement.clientWidth,e=window.innerHeight||document.documentElement.clientHeight;return{width:t,height:e}}function Wn(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}function hr(t){var e=_(null),n=Te(L({},t)),i=_([]),r=function(m){e.value===null&&(i.value=[],e.value=Kt(function(){var c;i.value.forEach(function(p){c=L(L({},c),p)}),Ot(n,c),e.value=null})),i.value.push(m)};return je(function(){e.value&&Kt.cancel(e.value)}),[n,r]}function ln(t,e,n,i){var r=e+n,s=(n-i)/2;if(n>i){if(e>0)return G({},t,s);if(e<0&&ri)return G({},t,e<0?s:-s);return{}}function yr(t,e,n,i){var r=pr(),s=r.width,m=r.height,c=null;return t<=s&&e<=m?c={x:0,y:0}:(t>s||e>m)&&(c=L(L({},ln("x",n,t,s)),ln("y",i,e,m))),c}var on=Symbol("previewGroupContext"),zt={provide:function(e){mi(on,e)},inject:function(){return _n(on,{isPreviewGroup:_(!1),previewUrls:z(function(){return new Map}),setPreviewUrls:function(){},current:_(null),setCurrent:function(){},setShowPreview:function(){},setMousePosition:function(){},registerImage:null,rootClassName:""})}},br=se({compatConfig:{MODE:3},name:"PreviewGroup",inheritAttrs:!1,props:{previewPrefixCls:String,preview:{type:[Boolean,Object],default:!0},icons:{type:Object,default:function(){return{}}}},setup:function(e,n){var i=n.slots,r=z(function(){var E={visible:void 0,onVisibleChange:function(){},getContainer:void 0,current:0};return tt(e.preview)==="object"?Zn(e.preview,E):E}),s=Te(new Map),m=_(),c=z(function(){return r.value.visible}),p=z(function(){return r.value.getContainer}),h=function(w,v){var k,I;(k=(I=r.value).onVisibleChange)===null||k===void 0||k.call(I,w,v)},P=Dn(!!c.value,{value:c,onChange:h}),C=ze(P,2),S=C[0],b=C[1],l=_(null),a=z(function(){return c.value!==void 0}),o=z(function(){return Array.from(s.keys())}),d=z(function(){return o.value[r.value.current]}),u=z(function(){return new Map(Array.from(s).filter(function(E){var w=ze(E,2),v=w[1].canPreview;return!!v}).map(function(E){var w=ze(E,2),v=w[0],k=w[1].url;return[v,k]}))}),A=function(w,v){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;s.set(w,{url:v,canPreview:k})},f=function(w){m.value=w},O=function(w){l.value=w},y=function(w,v){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,I=function(){s.delete(w)};return s.set(w,{url:v,canPreview:k}),I},x=function(w){w==null||w.stopPropagation(),b(!1),O(null)};return le(d,function(E){f(E)},{immediate:!0,flush:"post"}),gi(function(){S.value&&a.value&&f(d.value)},{flush:"post"}),zt.provide({isPreviewGroup:_(!0),previewUrls:u,setPreviewUrls:A,current:m,setCurrent:f,setShowPreview:b,setMousePosition:O,registerImage:y}),function(){var E=Ot({},(pi(r.value),r.value));return g(ve,null,[i.default&&i.default(),g(Yn,L(L({},E),{},{"ria-hidden":!S.value,visible:S.value,prefixCls:e.previewPrefixCls,onClose:x,mousePosition:l.value,src:u.value.get(m.value),icons:e.icons,getContainer:p.value}),null)])}}});const Jn=br;var Se={x:0,y:0},wr=L(L({},hi()),{},{src:String,alt:String,rootClassName:String,icons:{type:Object,default:function(){return{}}}}),Sr=se({compatConfig:{MODE:3},name:"Preview",inheritAttrs:!1,props:wr,emits:["close","afterClose"],setup:function(e,n){var i=n.emit,r=n.attrs,s=Te(e.icons),m=s.rotateLeft,c=s.rotateRight,p=s.zoomIn,h=s.zoomOut,P=s.close,C=s.left,S=s.right,b=_(1),l=_(0),a=hr(Se),o=ze(a,2),d=o[0],u=o[1],A=function(){return i("close")},f=_(),O=Te({originX:0,originY:0,deltaX:0,deltaY:0}),y=_(!1),x=zt.inject(),E=x.previewUrls,w=x.current,v=x.isPreviewGroup,k=x.setCurrent,I=z(function(){return E.value.size}),$=z(function(){return Array.from(E.value.keys())}),j=z(function(){return $.value.indexOf(w.value)}),K=z(function(){return v.value?E.value.get(w.value):e.src}),R=z(function(){return v.value&&I.value>1}),X=_({wheelDirection:0}),oe=function(){b.value=1,l.value=0,u(Se),i("afterClose")},de=function(){b.value++,u(Se)},ye=function(){b.value>1&&b.value--,u(Se)},U=function(){l.value+=90},W=function(){l.value-=90},ee=function(B){B.preventDefault(),B.stopPropagation(),j.value>0&&k($.value[j.value-1])},te=function(B){B.preventDefault(),B.stopPropagation(),j.value0&&k($.value[j.value-1]):B.keyCode===Xt.RIGHT&&j.value0?ye():H<0&&de()})}),Nn(function(){Me()}),function(){var H=e.visible,B=e.prefixCls,ie=e.rootClassName;return g(yi,L(L({},r),{},{transitionName:"zoom",maskTransitionName:"fade",closable:!1,keyboard:!0,prefixCls:B,onClose:A,afterClose:oe,visible:H,wrapClassName:ne,rootClassName:ie,getContainer:e.getContainer}),{default:function(){return[g("ul",{class:"".concat(e.prefixCls,"-operations")},[rt.map(function(ue){var we=ue.icon,ge=ue.onClick,Oe=ue.type,Pe=ue.disabled;return g("li",{class:fe(Qe,G({},"".concat(e.prefixCls,"-operations-operation-disabled"),Pe&&(Pe==null?void 0:Pe.value))),onClick:ge,key:Oe},[vt(we,{class:Ee})])})]),g("div",{class:"".concat(e.prefixCls,"-img-wrapper"),style:{transform:"translate3d(".concat(d.x,"px, ").concat(d.y,"px, 0)")}},[g("img",{onMousedown:at,onDblclick:ot,ref:f,class:"".concat(e.prefixCls,"-img"),src:K.value,alt:e.alt,style:{transform:"scale3d(".concat(b.value,", ").concat(b.value,", 1) rotate(").concat(l.value,"deg)")}},null)]),R.value&&g("div",{class:fe("".concat(e.prefixCls,"-switch-left"),G({},"".concat(e.prefixCls,"-switch-left-disabled"),j.value<=0)),onClick:ee},[C]),R.value&&g("div",{class:fe("".concat(e.prefixCls,"-switch-right"),G({},"".concat(e.prefixCls,"-switch-right-disabled"),j.value>=I.value-1)),onClick:te},[S])]}})}}});const Yn=Sr;var Cr=["icons","maskClassName"],qn=function(){return{src:String,wrapperClassName:String,wrapperStyle:{type:Object,default:void 0},rootClassName:String,prefixCls:String,previewPrefixCls:String,previewMask:{type:[Boolean,Function],default:void 0},placeholder:Ne.any,fallback:String,preview:{type:[Boolean,Object],default:!0},onClick:{type:Function},onError:{type:Function}}},Zn=function(e,n){var i=L({},e);return Object.keys(n).forEach(function(r){e[r]===void 0&&(i[r]=n[r])}),i},Ar=0,Kn=se({compatConfig:{MODE:3},name:"Image",inheritAttrs:!1,props:qn(),emits:["click","error"],setup:function(e,n){var i=n.attrs,r=n.slots,s=n.emit,m=z(function(){return e.prefixCls}),c=z(function(){return"".concat(m.value,"-preview")}),p=z(function(){var U={visible:void 0,onVisibleChange:function(){},getContainer:void 0};return tt(e.preview)==="object"?Zn(e.preview,U):U}),h=z(function(){var U;return(U=p.value.src)!==null&&U!==void 0?U:e.src}),P=z(function(){return e.placeholder&&e.placeholder!==!0||r.placeholder}),C=z(function(){return p.value.visible}),S=z(function(){return p.value.getContainer}),b=z(function(){return C.value!==void 0}),l=function(W,ee){var te,ne;(te=(ne=p.value).onVisibleChange)===null||te===void 0||te.call(ne,W,ee)},a=Dn(!!C.value,{value:C,onChange:l}),o=ze(a,2),d=o[0],u=o[1];le(d,function(U,W){l(U,W)});var A=_(P.value?"loading":"normal");le(function(){return e.src},function(){A.value=P.value?"loading":"normal"});var f=_(null),O=z(function(){return A.value==="error"}),y=zt.inject(),x=y.isPreviewGroup,E=y.setCurrent,w=y.setShowPreview,v=y.setMousePosition,k=y.registerImage,I=_(Ar++),$=z(function(){return e.preview&&!O.value}),j=function(){A.value="normal"},K=function(W){A.value="error",s("error",W)},R=function(W){if(!b.value){var ee=Wn(W.target),te=ee.left,ne=ee.top;x.value?(E(I.value),v({x:te,y:ne})):f.value={x:te,y:ne}}x.value?w(!0):u(!0),s("click",W)},X=function(){u(!1),b.value||(f.value=null)},oe=_(null);le(function(){return oe},function(){A.value==="loading"&&oe.value.complete&&(oe.value.naturalWidth||oe.value.naturalHeight)&&j()});var de=function(){};je(function(){le([h,$],function(){if(de(),!x.value)return function(){};de=k(I.value,h.value,$.value),$.value||de()},{flush:"post",immediate:!0})}),Nn(function(){de()});var ye=function(W){return bi(W)?W+"px":W};return function(){var U=e.prefixCls,W=e.wrapperClassName,ee=e.fallback,te=e.src,ne=e.placeholder,Qe=e.wrapperStyle,Ee=e.rootClassName,rt=i.width,$e=i.height,at=i.crossorigin,Re=i.decoding,Ve=i.alt,lt=i.sizes,ot=i.srcset,Me=i.usemap,H=i.class,B=i.style,ie=p.value,be=ie.icons,ue=ie.maskClassName,we=Et(ie,Cr),ge=fe(U,W,Ee,G({},"".concat(U,"-error"),O.value)),Oe=O.value&&ee?ee:h.value,Pe={crossorigin:at,decoding:Re,alt:Ve,sizes:lt,srcset:ot,usemap:Me,class:fe("".concat(U,"-img"),G({},"".concat(U,"-img-placeholder"),ne===!0),H),style:L({height:$e},B)};return g(ve,null,[g("div",{class:ge,onClick:$.value?R:function(ui){s("click",ui)},style:L({width:ye(rt),height:ye($e)},Qe)},[g("img",L(L(L({},Pe),O.value&&ee?{src:ee}:{onLoad:j,onError:K,src:te}),{},{ref:oe}),null),A.value==="loading"&&g("div",{"aria-hidden":"true",class:"".concat(U,"-placeholder")},[ne||r.placeholder&&r.placeholder()]),r.previewMask&&$.value&&g("div",{class:["".concat(U,"-mask"),ue]},[r.previewMask()])]),!x.value&&$.value&&g(Yn,L(L({},we),{},{"aria-hidden":!d.value,visible:d.value,prefixCls:c.value,onClose:X,mousePosition:f.value,src:Oe,alt:Ve,getContainer:S.value,icons:be,rootClassName:Ee}),null)])}}});Kn.PreviewGroup=Jn;const Er=Kn;var Or={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z"}},{tag:"path",attrs:{d:"M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z"}}]},name:"rotate-left",theme:"outlined"};const Pr=Or;function sn(t){for(var e=1;e{document.addEventListener(...t),xt(()=>document.removeEventListener(...t))},ca="data:image/png;base64,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",He=new WeakMap;function da(t,e){return{useHookShareState:i=>{const r=Li();mt(r),He.has(r)||(He.set(r,Te(t(r,i??(e==null?void 0:e())))),xt(()=>{He.delete(r)}));const s=He.get(r);return mt(s),{state:s,toRefs(){return zi(s)}}}}}var fa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 000 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0013.5-4.7L863.9 169a7.9 7.9 0 00-8.9-8.9zM416.6 562.3a8.03 8.03 0 00-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 00-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}}]},name:"arrows-alt",theme:"outlined"};const va=fa;function hn(t){for(var e=1;e(t.DATE_ASC="date-asc",t.DATE_DESC="date-desc",t.NAME_ASC="name-asc",t.NAME_DESC="name-desc",t.SIZE_ASC="size-asc",t.SIZE_DESC="size-desc",t.CREATED_TIME_ASC="created-time-asc",t.CREATED_TIME_DESC="created-time-desc",t))(ni||{});const Ra=(t,e)=>{const n=t.type==="dir"?1:0;return(e.type==="dir"?1:0)-n},On=(t,e)=>{const n=Date.parse(t.date),i=Date.parse(e.date);return n-i},Pn=(t,e)=>{const n=Date.parse(t.created_time),i=Date.parse(e.created_time);return n-i},xn=(t,e)=>{const n=t.name.toLowerCase(),i=e.name.toLowerCase();return n.localeCompare(i)},kn=(t,e)=>t.bytes-e.bytes,_e=(t,e)=>{const n=(i,r)=>{switch(e){case"date-asc":return On(i,r);case"date-desc":return On(r,i);case"created-time-asc":return Pn(i,r);case"created-time-desc":return Pn(r,i);case"name-asc":return xn(i,r);case"name-desc":return xn(r,i);case"size-asc":return kn(i,r);case"size-desc":return kn(r,i);default:throw new Error(`Invalid sort method: ${e}`)}};return t.slice().sort((i,r)=>Ra(i,r)||n(i,r))},Le=async t=>(await kt.get("/files",{params:{folder_path:t}})).data,Va=async t=>(await kt.post("/delete_files",{file_paths:t})).data,ii=async(t,e)=>(await kt.post("/move_files",{file_paths:t,dest:e})).data;var gt={},Ua={get exports(){return gt},set exports(t){gt=t}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT */(function(t,e){(function(n,i){t.exports=i})(_i,function(){var n={};n.version="0.3.5";var i=n.settings={minimum:.08,easing:"linear",positionUsing:"",speed:200,trickle:!0,trickleSpeed:200,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};n.configure=function(l){var a,o;for(a in l)o=l[a],o!==void 0&&l.hasOwnProperty(a)&&(i[a]=o);return this},n.status=null,n.set=function(l){var a=n.isStarted();l=r(l,i.minimum,1),n.status=l===1?null:l;var o=n.render(!a),d=o.querySelector(i.barSelector),u=i.speed,A=i.easing;return o.offsetWidth,c(function(f){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),p(d,m(l,u,A)),l===1?(p(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout(function(){p(o,{transition:"all "+u+"ms linear",opacity:0}),setTimeout(function(){n.remove(),f()},u)},u)):setTimeout(f,u)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var l=function(){setTimeout(function(){n.status&&(n.trickle(),l())},i.trickleSpeed)};return i.trickle&&l(),this},n.done=function(l){return!l&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(l){var a=n.status;return a?a>1?void 0:(typeof l!="number"&&(a>=0&&a<.2?l=.1:a>=.2&&a<.5?l=.04:a>=.5&&a<.8?l=.02:a>=.8&&a<.99?l=.005:l=0),a=r(a+l,0,.994),n.set(a)):n.start()},n.trickle=function(){return n.inc()},function(){var l=0,a=0;n.promise=function(o){return!o||o.state()==="resolved"?this:(a===0&&n.start(),l++,a++,o.always(function(){a--,a===0?(l=0,n.done()):n.set((l-a)/l)}),this)}}(),n.getElement=function(){var l=n.getParent();if(l){var a=Array.prototype.slice.call(l.querySelectorAll(".nprogress")).filter(function(o){return o.parentElement===l});if(a.length>0)return a[0]}return null},n.getParent=function(){if(i.parent instanceof HTMLElement)return i.parent;if(typeof i.parent=="string")return document.querySelector(i.parent)},n.render=function(l){if(n.isRendered())return n.getElement();P(document.documentElement,"nprogress-busy");var a=document.createElement("div");a.id="nprogress",a.className="nprogress",a.innerHTML=i.template;var o=a.querySelector(i.barSelector),d=l?"-100":s(n.status||0),u=n.getParent(),A;return p(o,{transition:"all 0 linear",transform:"translate3d("+d+"%,0,0)"}),i.showSpinner||(A=a.querySelector(i.spinnerSelector),A&&b(A)),u!=document.body&&P(u,"nprogress-custom-parent"),u.appendChild(a),a},n.remove=function(){n.status=null,C(document.documentElement,"nprogress-busy"),C(n.getParent(),"nprogress-custom-parent");var l=n.getElement();l&&b(l)},n.isRendered=function(){return!!n.getElement()},n.getPositioningCSS=function(){var l=document.body.style,a="WebkitTransform"in l?"Webkit":"MozTransform"in l?"Moz":"msTransform"in l?"ms":"OTransform"in l?"O":"";return a+"Perspective"in l?"translate3d":a+"Transform"in l?"translate":"margin"};function r(l,a,o){return lo?o:l}function s(l){return(-1+l)*100}function m(l,a,o){var d;return i.positionUsing==="translate3d"?d={transform:"translate3d("+s(l)+"%,0,0)"}:i.positionUsing==="translate"?d={transform:"translate("+s(l)+"%,0)"}:d={"margin-left":s(l)+"%"},d.transition="all "+a+"ms "+o,d}var c=function(){var l=[];function a(){var o=l.shift();o&&o(a)}return function(o){l.push(o),l.length==1&&a()}}(),p=function(){var l=["Webkit","O","Moz","ms"],a={};function o(f){return f.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(O,y){return y.toUpperCase()})}function d(f){var O=document.body.style;if(f in O)return f;for(var y=l.length,x=f.charAt(0).toUpperCase()+f.slice(1),E;y--;)if(E=l[y]+x,E in O)return E;return f}function u(f){return f=o(f),a[f]||(a[f]=d(f))}function A(f,O,y){O=u(O),f.style[O]=y}return function(f,O){var y=arguments,x,E;if(y.length==2)for(x in O)E=O[x],E!==void 0&&O.hasOwnProperty(x)&&A(f,x,E);else A(f,y[1],y[2])}}();function h(l,a){var o=typeof l=="string"?l:S(l);return o.indexOf(" "+a+" ")>=0}function P(l,a){var o=S(l),d=o+a;h(o,a)||(l.className=d.substring(1))}function C(l,a){var o=S(l),d;h(l,a)&&(d=o.replace(" "+a+" "," "),l.className=d.substring(1,d.length-1))}function S(l){return(" "+(l&&l.className||"")+" ").replace(/\s+/gi," ")}function b(l){l&&l.parentNode&&l.parentNode.removeChild(l)}return n})})(Ua);const Ha=gt,dt=new Map,V=nt(),In=new BroadcastChannel("iib-image-transfer-bus"),De=encodeURIComponent,pe=(t,e=!1)=>`/infinite_image_browsing/file?path=${De(t.fullpath)}&t=${De(t.date)}${e?`&disposition=${De(t.name)}`:""}`,Ga=(t,e)=>`/infinite_image_browsing/image-thumbnail?path=${De(t.fullpath)}&size=${e}&t=${De(t.date)}`,{eventEmitter:Je,useEventListen:pt}=Tn(),{useHookShareState:he}=da(()=>{const t=_({tabIdx:-1,paneIdx:-1}),e=z(()=>ke(n.value)),n=_([]),i=z(()=>{var b;return n.value.map(l=>l.curr).slice((b=V.conf)!=null&&b.is_win?1:0)}),r=z(()=>It(...i.value)),s=_(ni.CREATED_TIME_DESC),m=z(()=>{var d;if(!e.value)return[];const b=((d=e.value)==null?void 0:d.files)??[],l=s.value,{walkFiles:a}=e.value,o=u=>V.onlyFoldersAndImages?u.filter(A=>A.type==="dir"||re(A.name)):u;return t.value.walkMode&&a?a.map(u=>_e(o(u),l)).flat():_e(o(b),l)}),c=_([]),p=_(-1),h=_(!0),P=_(),C=_(!1);return{previewing:_(!1),spinning:C,canLoadNext:h,multiSelectedIdxs:c,previewIdx:p,basePath:i,currLocation:r,currPage:e,stack:n,sortMethod:s,sortedFiles:m,scroller:_(),stackViewEl:_(),walkModePath:P,props:t,...Tn()}});function Hl(t,e){const{previewIdx:n,eventEmitter:i,canLoadNext:r,previewing:s}=he().toRefs(),{state:m}=he(),c=z(()=>(e==null?void 0:e.files.value)??m.sortedFiles),p=z(()=>(e==null?void 0:e.scroller.value)??m.scroller);let h=null;const P=(l,a)=>{var o;s.value=l,h!=null&&!l&&a&&((o=p.value)==null||o.scrollToItem(h),h=null)},C=()=>{t.walkMode&&!b("next")&&r&&(ae.info(F("loadingNextFolder")),i.value.emit("loadNextDir",!0))};Xe("keydown",l=>{var a;if(s.value){let o=n.value;if(["ArrowDown","ArrowRight"].includes(l.key))for(o++;c.value[o]&&!re(c.value[o].name);)o++;else if(["ArrowUp","ArrowLeft"].includes(l.key))for(o--;c.value[o]&&!re(c.value[o].name);)o--;if(re((a=c.value[o])==null?void 0:a.name)??""){n.value=o;const d=p.value;d&&!(o>=d.$_startIndex&&o<=d.$_endIndex)&&(h=o)}C()}});const S=l=>{var o;let a=n.value;if(l==="next")for(a++;c.value[a]&&!re(c.value[a].name);)a++;else if(l==="prev")for(a--;c.value[a]&&!re(c.value[a].name);)a--;if(re((o=c.value[a])==null?void 0:o.name)??""){n.value=a;const d=p.value;d&&!(a>=d.$_startIndex&&a<=d.$_endIndex)&&(h=a)}C()},b=l=>{var o;let a=n.value;if(l==="next")for(a++;c.value[a]&&!re(c.value[a].name);)a++;else if(l==="prev")for(a--;c.value[a]&&!re(c.value[a].name);)a--;return re((o=c.value[a])==null?void 0:o.name)??""};return pt("removeFiles",async()=>{var l;s.value&&!m.sortedFiles[n.value]&&(ae.info(F("manualExitFullScreen"),5),await Be(500),(l=document.querySelector(".ant-image-preview-operations-operation .anticon-close"))==null||l.click(),n.value=-1)}),{previewIdx:n,onPreviewVisibleChange:P,previewing:s,previewImgMove:S,canPreview:b}}function Gl(t){const e=_(),{scroller:n,stackViewEl:i,stack:r,currPage:s,currLocation:m,sortMethod:c,useEventListen:p,walkModePath:h,eventEmitter:P}=he().toRefs();le(()=>r.value.length,Ie((y,x)=>{var E;y!==x&&((E=n.value)==null||E.scrollToItem(0))},300));const C=async y=>{if(await o(y),t.walkMode){await Be();const[x]=_e(s.value.files,c.value).filter(E=>E.type==="dir");x&&await o(x.fullpath),await P.value.emit("loadNextDir")}};je(async()=>{var y;if(!r.value.length){const x=await Le("/");r.value.push({files:x.files,curr:"/"})}e.value=new Ha,e.value.configure({parent:i.value}),t.path&&t.path!=="/"?await C(t.path):(y=V.conf)!=null&&y.home&&o(V.conf.home)}),le(m,Ie(y=>{const x=V.tabList[t.tabIdx].panes[t.paneIdx];x.path=y;const E=x.path.split("/").pop(),w=()=>{var v;if(!t.walkMode){const k=Ge(y);for(const[I,$]of Object.entries(V.pathAliasMap))if(k.startsWith($))return k.replace($,I);return E}return"Walk: "+(((v=V.quickMovePaths.find(k=>k.dir===h.value))==null?void 0:v.zh)??E)};x.name=me("div",{style:"display:flex;align-items:center"},[me(ba),me("span",{class:"line-clamp-1",style:"max-width: 256px"},w())]),V.recent=V.recent.filter(v=>v.key!==x.key),V.recent.unshift({path:y,key:x.key}),V.recent.length>20&&(V.recent=V.recent.slice(0,20))},300));const S=()=>Mt(m.value),b=async y=>{var x,E;if(y.type==="dir")try{(x=e.value)==null||x.start();const{files:w}=await Le(y.fullpath);r.value.push({files:w,curr:y.name})}finally{(E=e.value)==null||E.done()}},l=y=>{for(;y(mt(V.conf,"global.conf load failed"),V.conf.is_win?y.toLowerCase()==x.toLowerCase():y==x),o=async y=>{var E,w;const x=r.value.slice();try{Di(y)||(y=It(((E=V.conf)==null?void 0:E.sd_cwd)??"/",y));const v=nn(y),k=r.value.map(I=>I.curr);for(k.shift();k[0]&&v[0]&&a(k[0],v[0]);)k.shift(),v.shift();for(let I=0;Ia(j.name,I));if(!$)throw console.error({frags:v,frag:I,stack:Bn(r.value)}),new Error(`${I} not found`);await b($)}}catch(v){throw ae.error(F("moveFailedCheckPath")+(v instanceof Error?v.message:"")),console.error(y,nn(y),s.value),r.value=x,v}},d=rn(async()=>{var y,x,E;try{if((y=e.value)==null||y.start(),h.value)l(0),await C(h.value);else{const{files:w}=await Le(r.value.length===1?"/":m.value);ke(r.value).files=w}(x=n.value)==null||x.scrollToItem(0),ae.success(F("refreshCompleted"))}finally{(E=e.value)==null||E.done()}});Ni("return-to-iib",rn(async()=>{var y,x;if(!t.walkMode)try{(y=e.value)==null||y.start();const{files:E}=await Le(r.value.length===1?"/":m.value);ke(r.value).files.map(v=>v.date).join()!==E.map(v=>v.date).join()&&(ke(r.value).files=E,ae.success(F("autoUpdate")))}finally{(x=e.value)==null||x.done()}})),p.value("refresh",d);const u=y=>{t.walkMode&&(h.value=y),C(y)},A=z(()=>V.quickMovePaths.map(y=>({...y,path:Ge(y.dir)}))),f=z(()=>{const y=Ge(m.value);return A.value.find(E=>E.path===y)});return{addToSearchScanPathAndQuickMove:async()=>{const y=f.value;if(y){if(!y.can_delete)return;await ur(m.value),ae.success(F("removeComplete"))}else await cr(m.value),ae.success(F("addComplete"));await Fi.emit("updateGlobalSetting")},searchPathInfo:f,refresh:d,copyLocation:S,back:l,openNext:b,currPage:s,currLocation:m,to:o,stack:r,scroller:n,quickMoveTo:u}}function Wl(t){const{scroller:e,sortedFiles:n,stack:i,sortMethod:r,currLocation:s,currPage:m,stackViewEl:c,canLoadNext:p,previewIdx:h}=he().toRefs(),{state:P}=he(),C=_(!1),S=_("grid"),b={line:F("detailList"),grid:F("previewGrid"),"large-size-grid":F("largePreviewGrid")},l={value:w=>w,text:w=>F("sortBy")+" "+Qa[w].toLocaleLowerCase()},a=272,o=64,d=a*2,{width:u}=Ti(c),A=z(()=>{const w=u.value;if(!(S.value==="line"||!w))return~~(w/(S.value==="grid"?a:d))}),f=z(()=>{const w=S.value;if(w==="line")return{first:80,second:void 0};const v=w==="grid"?a:d;return{first:v+o,second:v}}),O=_(!1),y=async()=>{var w;if(!(O.value||!t.walkMode||!p.value))try{O.value=!0;const v=i.value[i.value.length-2],k=_e(v.files,r.value),I=k.findIndex($=>{var j;return $.name===((j=m.value)==null?void 0:j.curr)});if(I!==-1){const $=k[I+1],j=It(s.value,"../",$.name),K=await Le(j),R=m.value;R.curr=$.name,R.walkFiles||(R.walkFiles=[R.files]),R.walkFiles.push(K.files),console.log("curr page files length",(w=m.value)==null?void 0:w.files.length)}}catch(v){console.error("loadNextDir",v),p.value=!1}finally{O.value=!1}},x=async(w=!1)=>{const v=e.value,k=()=>w?h.value:(v==null?void 0:v.$_endIndex)??0;for(;!n.value.length||k()>n.value.length-20&&p.value;)await Be(100),await y()};P.useEventListen("loadNextDir",x);const E=Ie(()=>x(),300);return{gridItems:A,sortedFiles:n,sortMethodConv:l,viewModeMap:b,moreActionsDropdownShow:C,viewMode:S,gridSize:a,sortMethod:r,largeGridSize:d,onScroll:E,loadNextDir:y,loadNextDirLoading:O,canLoadNext:p,itemSize:f}}function Jl(){const{currLocation:t,sortedFiles:e,currPage:n,multiSelectedIdxs:i,eventEmitter:r}=he().toRefs(),s=()=>{i.value=[]};return Xe("click",s),Xe("blur",s),le(n,s),{onFileDragStart:(p,h)=>{const P=Bn(e.value[h]);console.log("onFileDragStart set drag file ",p,h,P);const C=[P];let S=P.type==="dir";if(i.value.includes(h)){const b=i.value.map(l=>e.value[l]);C.push(...b),S=b.some(l=>l.type==="dir")}p.dataTransfer.setData("text/plain",JSON.stringify({includeDir:S,loc:t.value,path:ua(C,"fullpath").map(b=>b.fullpath)}))},onDrop:async p=>{var P;const h=JSON.parse(((P=p.dataTransfer)==null?void 0:P.getData("text"))||"{}");if(console.log(h),h.path&&typeof h.includeDir<"u"&&h.loc){const C=t.value;if(h.loc===C)return;const S=me("div",[me("div",`${F("moveSelectedFilesTo")}${C}`),me("ol",h.path.map(b=>b.split(/[/\\]/).pop()).map(b=>me("li",b)))]);Fn.confirm({title:F("confirm"),content:S,maskClosable:!0,async onOk(){await ii(h.path,C),Je.emit("removeFiles",{paths:h.path,loc:h.loc}),await r.value.emit("refresh")}})}},multiSelectedIdxs:i}}function Yl(t,{openNext:e}){const n=_(!1),i=_(""),{sortedFiles:r,previewIdx:s,multiSelectedIdxs:m,stack:c,currLocation:p,spinning:h,previewing:P}=he().toRefs(),C=Ge;pt("removeFiles",({paths:a,loc:o})=>{if(C(o)!==C(p.value))return;const d=ke(c.value);d&&(d.files=d.files.filter(u=>!a.includes(u.fullpath)),d.walkFiles&&(d.walkFiles=d.walkFiles.map(u=>u.filter(A=>!a.includes(A.fullpath)))))}),pt("addFiles",({files:a,loc:o})=>{if(C(o)!==C(p.value))return;const d=ke(c.value);d&&d.files.unshift(...a)});const S=$t(),b=async(a,o,d)=>{s.value=d,V.fullscreenPreviewInitialUrl=pe(o);const u=m.value.indexOf(d);if(a.shiftKey){if(u!==-1)m.value.splice(u,1);else{m.value.push(d),m.value.sort((O,y)=>O-y);const A=m.value[0],f=m.value[m.value.length-1];m.value=sa(A,f+1)}a.stopPropagation()}else a.ctrlKey||a.metaKey?(u!==-1?m.value.splice(u,1):m.value.push(d),a.stopPropagation()):await e(o)},l=async(a,o,d)=>{var y,x,E;const u=pe(o),A=p.value,f=()=>{let w=[];return m.value.includes(d)?w=m.value.map(v=>r.value[v]):w.push(o),w},O=async w=>{if(!h.value)try{h.value=!0,await Ui(o.fullpath),In.postMessage("iib_hidden_img_update_trigger");const v=setTimeout(()=>Hi.warn({message:F("long_loading"),duration:20}),5e3);await Gi(),clearTimeout(v),In.postMessage(`iib_hidden_tab_${w}`)}catch(v){console.error(v),ae.error("发送图像失败,请携带console的错误消息找开发者")}finally{h.value=!1}};if(`${a.key}`.startsWith("toggle-tag-")){const w=+`${a.key}`.split("toggle-tag-")[1],{is_remove:v}=await dr({tag_id:w,img_path:o.fullpath}),k=(x=(y=V.conf)==null?void 0:y.all_custom_tags.find(I=>I.id===w))==null?void 0:x.name;ae.success(F(v?"removedTagFromImage":"addedTagToImage",{tag:k}));return}switch(a.key){case"previewInNewWindow":return window.open(u);case"download":return window.open(pe(o,!0));case"copyPreviewUrl":return Mt(parent.document.location.origin+u);case"send2txt2img":return O("txt2img");case"send2img2img":return O("img2img");case"send2inpaint":return O("inpaint");case"send2extras":return O("extras");case"send2savedDir":{const w=V.quickMovePaths.find(I=>I.key==="outdir_save");if(!w)return ae.error(F("unknownSavedDir"));const v=Vi(w.dir,(E=V.conf)==null?void 0:E.sd_cwd),k=f();await ii(k.map(I=>I.fullpath),v),Je.emit("removeFiles",{paths:k.map(I=>I.fullpath),loc:p.value}),Je.emit("addFiles",{files:k,loc:v});break}case"send2controlnet-img2img":case"send2controlnet-txt2img":{const w=Ri(),v=Wi(),k=a.key.split("-")[1];k==="img2img"?v.switch_to_img2img():v.switch_to_txt2img(),await Be(100);const $=w.querySelector(`#${k}_controlnet`).querySelector(".label-wrap");$.className.includes("open")||($.click(),await Be(100)),$.scrollIntoView();const K=await(await fetch(pe(o))).blob(),R=new File([K],"image.jpg",{type:K.type,lastModified:Date.now()}),X=new DataTransfer;X.items.add(R);const oe=new ClipboardEvent("paste",{clipboardData:X,bubbles:!0});$.dispatchEvent(oe);break}case"openWithWalkMode":{dt.set(A,c.value);const w=V.tabList[t.tabIdx],v={type:"local",key:st(),path:o.fullpath,name:F("local"),stackKey:A,walkMode:!0};w.panes.push(v),w.key=v.key;break}case"openInNewTab":{dt.set(A,c.value);const w=V.tabList[t.tabIdx],v={type:"local",key:st(),path:o.fullpath,name:F("local"),stackKey:A};w.panes.push(v),w.key=v.key;break}case"openOnTheRight":{dt.set(A,c.value);let w=V.tabList[t.tabIdx+1];w||(w=Qi({panes:[],key:""}),V.tabList[t.tabIdx+1]=w);const v={type:"local",key:st(),path:o.fullpath,name:F("local"),stackKey:A};w.panes.push(v),w.key=v.key;break}case"viewGenInfo":{n.value=!0,i.value=await S.pushAction(()=>jn(o.fullpath)).res;break}case"openWithLocalFileBrowser":{await ji(o.fullpath);break}case"deleteFiles":{const w=f();await new Promise(v=>{Fn.confirm({title:F("confirmDelete"),maskClosable:!0,content:me("ol",{style:"max-height:50vh;overflow:auto;"},w.map(k=>k.fullpath.split(/[/\\]/).pop()).map(k=>me("li",k))),async onOk(){const k=w.map(I=>I.fullpath);await Va(k),ae.success(F("deleteSuccess")),Je.emit("removeFiles",{paths:k,loc:p.value}),v()}})});break}}return{}};return Xe("keydown",a=>{var o,d;if(P.value){const u=[];if(a.shiftKey&&u.push("Shift"),a.ctrlKey&&u.push("Ctrl"),a.code.startsWith("Key")||a.code.startsWith("Digit")){u.push(a.code);const A=u.join(" + "),f=(o=Object.entries(V.shortcut).find(O=>O[1]===A))==null?void 0:o[0];if(f){a.stopPropagation(),a.preventDefault();const O=s.value,y=r.value[O];switch(f){case"deleteInFullScreenPreviewMode":return pe(y)===V.fullscreenPreviewInitialUrl?ae.warn(F("fullscreenRestriction")):l({key:"deleteFiles"},y,O);case"toggleLikeTagInFullScreenPreviewMode":{const x=(d=V.conf)==null?void 0:d.all_custom_tags.find(E=>E.name==="like");return l({key:`toggle-tag-${x.id}`},y,O)}}}}}}),{onFileItemClick:b,onContextMenuClick:l,showGenInfo:n,imageGenInfo:i,q:S}}const ql=()=>{const{stackViewEl:t}=he().toRefs(),e=_(-1);return Bi(t,n=>{var r;let i=n.target;for(;i.parentElement;)if(i=i.parentElement,i.tagName.toLowerCase()==="li"&&i.classList.contains("file-item-trigger")){const s=(r=i.dataset)==null?void 0:r.idx;s&&Number.isSafeInteger(+s)&&(e.value=+s);return}}),{showMenuIdx:e}};function Wa(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);var n=t.indexOf("Trident/");if(n>0){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}var r=t.indexOf("Edge/");return r>0?parseInt(t.substring(r+5,t.indexOf(".",r)),10):-1}let Ye;function ht(){ht.init||(ht.init=!0,Ye=Wa()!==-1)}var it={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){ht(),Pt(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",Ye&&this.$el.appendChild(t),t.data="about:blank",Ye||this.$el.appendChild(t)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!Ye&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const Ja=qi();Ji("data-v-b329ee4c");const Ya={class:"resize-observer",tabindex:"-1"};Yi();const qa=Ja((t,e,n,i,r,s)=>(T(),Y("div",Ya)));it.render=qa;it.__scopeId="data-v-b329ee4c";it.__file="src/components/ResizeObserver.vue";function qe(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?qe=function(e){return typeof e}:qe=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(t)}function Za(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $n(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n2&&arguments[2]!==void 0?arguments[2]:{},i,r,s,m=function(p){for(var h=arguments.length,P=new Array(h>1?h-1:0),C=1;C1){var h=c.find(function(C){return C.isIntersecting});h&&(p=h)}if(r.callback){var P=p.isIntersecting&&p.intersectionRatio>=r.threshold;if(P===r.oldResult)return;r.oldResult=P,r.callback(P,p)}},this.options.intersection),Pt(function(){r.observer&&r.observer.observe(r.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),t}();function ai(t,e,n){var i=e.value;if(i)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var r=new al(t,i,n);t._vue_visibilityState=r}}function ll(t,e,n){var i=e.value,r=e.oldValue;if(!ri(i,r)){var s=t._vue_visibilityState;if(!i){li(t);return}s?s.createObserver(i,n):ai(t,{value:i},n)}}function li(t){var e=t._vue_visibilityState;e&&(e.destroyObserver(),delete t._vue_visibilityState)}var ol={beforeMount:ai,updated:ll,unmounted:li},sl={itemsLimit:1e3},ul=/(auto|scroll)/;function oi(t,e){return t.parentNode===null?e:oi(t.parentNode,e.concat([t]))}var ft=function(e,n){return getComputedStyle(e,null).getPropertyValue(n)},cl=function(e){return ft(e,"overflow")+ft(e,"overflow-y")+ft(e,"overflow-x")},dl=function(e){return ul.test(cl(e))};function Ln(t){if(t instanceof HTMLElement||t instanceof SVGElement){for(var e=oi(t.parentNode,[]),n=0;n{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const t=this.$_lastUpdateScrollPosition;typeof t=="number"&&this.$nextTick(()=>{this.scrollToPosition(t)})},beforeUnmount(){this.removeListeners()},methods:{addView(t,e,n,i,r){const s=Zi({id:gl++,index:e,used:!0,key:i,type:r}),m=Ki({item:n,position:0,nr:s});return t.push(m),m},unuseView(t,e=!1){const n=this.$_unusedViews,i=t.nr.type;let r=n.get(i);r||(r=[],n.set(i,r)),r.push(t),e||(t.nr.used=!1,t.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(t){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const e=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});e(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&e()},this.updateInterval))}},handleVisibilityChange(t,e){this.ready&&(t||e.boundingClientRect.width!==0||e.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(t,e=!1){const n=this.itemSize,i=this.gridItems||1,r=this.itemSecondarySize||n,s=this.$_computedMinItemSize,m=this.typeField,c=this.simpleArray?null:this.keyField,p=this.items,h=p.length,P=this.sizes,C=this.$_views,S=this.$_unusedViews,b=this.pool,l=this.itemIndexByKey;let a,o,d,u,A;if(!h)a=o=u=A=d=0;else if(this.$_prerender)a=u=0,o=A=Math.min(this.prerender,p.length),d=null;else{const v=this.getScroll();if(e){let $=v.start-this.$_lastUpdateScrollPosition;if($<0&&($=-$),n===null&&$v.start&&(K=R),R=~~((j+K)/2);while(R!==X);for(R<0&&(R=0),a=R,d=P[h-1].accumulator,o=R;oh&&(o=h)),u=a;uh&&(o=h),u<0&&(u=0),A>h&&(A=h),d=Math.ceil(h/i)*n}}o-a>sl.itemsLimit&&this.itemsLimitError(),this.totalSize=d;let f;const O=a<=this.$_endIndex&&o>=this.$_startIndex;if(O)for(let v=0,k=b.length;v=o)&&this.unuseView(f));const y=O?null:new Map;let x,E,w;for(let v=a;v=I.length)&&(f=this.addView(b,v,x,k,E),this.unuseView(f,!0),I=S.get(E)),f=I[w],y.set(E,w+1)),C.delete(f.nr.key),f.nr.used=!0,f.nr.index=v,f.nr.key=k,f.nr.type=E,C.set(k,f),$=!0;else if(!f.nr.used&&(f.nr.used=!0,f.nr.index=v,$=!0,I)){const j=I.indexOf(f);j!==-1&&I.splice(j,1)}f.item=x,$&&(v===p.length-1&&this.$emit("scroll-end"),v===0&&this.$emit("scroll-start")),n===null?(f.position=P[v-1].accumulator,f.offset=0):(f.position=Math.floor(v/i)*n,f.offset=v%i*r)}return this.$_startIndex=a,this.$_endIndex=o,this.emitUpdate&&this.$emit("update",a,o,u,A),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:O}},getListenerTarget(){let t=Ln(this.$el);return window.document&&(t===window.document.documentElement||t===window.document.body)&&(t=window),t},getScroll(){const{$el:t,direction:e}=this,n=e==="vertical";let i;if(this.pageMode){const r=t.getBoundingClientRect(),s=n?r.height:r.width;let m=-(n?r.top:r.left),c=n?window.innerHeight:window.innerWidth;m<0&&(c+=m,m=0),m+c>s&&(c=s-m),i={start:m,end:m+c}}else n?i={start:t.scrollTop,end:t.scrollTop+t.clientHeight}:i={start:t.scrollLeft,end:t.scrollLeft+t.clientWidth};return i},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,wt?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(t){let e;const n=this.gridItems||1;this.itemSize===null?e=t>0?this.sizes[t-1].accumulator:0:e=Math.floor(t/n)*this.itemSize,this.scrollToPosition(e)},scrollToPosition(t){const e=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,i,r;if(this.pageMode){const s=Ln(this.$el),m=s.tagName==="HTML"?0:s[e.scroll],c=s.getBoundingClientRect(),h=this.$el.getBoundingClientRect()[e.start]-c[e.start];n=s,i=e.scroll,r=t+m+h}else n=this.$el,i=e.scroll,r=t;n[i]=r},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((t,e)=>t.nr.index-e.nr.index)}}};const pl={key:0,ref:"before",class:"vue-recycle-scroller__slot"},hl={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function yl(t,e,n,i,r,s){const m=Xi("ResizeObserver"),c=er("observe-visibility");return tr((T(),J("div",{class:Fe(["vue-recycle-scroller",{ready:r.ready,"page-mode":n.pageMode,[`direction-${t.direction}`]:!0}]),onScrollPassive:e[0]||(e[0]=(...p)=>s.handleScroll&&s.handleScroll(...p))},[t.$slots.before?(T(),J("div",pl,[Ue(t.$slots,"before")],512)):ce("v-if",!0),(T(),Y(an(n.listTag),{ref:"wrapper",style:rr({[t.direction==="vertical"?"minHeight":"minWidth"]:r.totalSize+"px"}),class:Fe(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:M(()=>[(T(!0),J(ve,null,Lt(r.pool,p=>(T(),Y(an(n.itemTag),nr({key:p.nr.id,style:r.ready?{transform:`translate${t.direction==="vertical"?"Y":"X"}(${p.position}px) translate${t.direction==="vertical"?"X":"Y"}(${p.offset}px)`,width:n.gridItems?`${t.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${t.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&r.hoverKey===p.nr.key}]]},ir(n.skipHover?{}:{mouseenter:()=>{r.hoverKey=p.nr.key},mouseleave:()=>{r.hoverKey=null}})),{default:M(()=>[Ue(t.$slots,"default",{item:p.item,index:p.nr.index,active:p.nr.used})]),_:2},1040,["style","class"]))),128)),Ue(t.$slots,"empty")]),_:3},8,["style","class"])),t.$slots.after?(T(),J("div",hl,[Ue(t.$slots,"after")],512)):ce("v-if",!0),g(m,{onNotify:s.handleResize},null,8,["onNotify"])],34)),[[c,s.handleVisibilityChange]])}si.render=yl;si.__file="src/components/RecycleScroller.vue";const St=se({__name:"ContextMenu",props:{file:null,idx:null,selectedTag:null,disableDelete:{type:Boolean}},emits:["contextMenuClick"],setup(t,{emit:e}){const n=t,i=nt(),r=z(()=>{var s;return(((s=i.conf)==null?void 0:s.all_custom_tags)??[]).reduce((m,c)=>[...m,{...c,selected:!!n.selectedTag.find(p=>p.id===c.id)}],[])});return(s,m)=>{const c=Qn,p=ar,h=lr,P=Rn;return T(),Y(P,{onClick:m[0]||(m[0]=C=>e("contextMenuClick",C,t.file,t.idx))},{default:M(()=>[g(c,{key:"deleteFiles",disabled:t.disableDelete},{default:M(()=>[Q(N(s.$t("deleteSelected")),1)]),_:1},8,["disabled"]),t.file.type==="dir"?(T(),J(ve,{key:0},[g(c,{key:"openInNewTab"},{default:M(()=>[Q(N(s.$t("openInNewTab")),1)]),_:1}),g(c,{key:"openOnTheRight"},{default:M(()=>[Q(N(s.$t("openOnTheRight")),1)]),_:1}),g(c,{key:"openWithWalkMode"},{default:M(()=>[Q(N(s.$t("openWithWalkMode")),1)]),_:1})],64)):ce("",!0),t.file.type==="file"?(T(),J(ve,{key:1},[D(re)(t.file.name)?(T(),J(ve,{key:0},[g(c,{key:"viewGenInfo"},{default:M(()=>[Q(N(s.$t("viewGenerationInfo")),1)]),_:1}),g(p),g(c,{key:"send2txt2img"},{default:M(()=>[Q(N(s.$t("sendToTxt2img")),1)]),_:1}),g(c,{key:"send2img2img"},{default:M(()=>[Q(N(s.$t("sendToImg2img")),1)]),_:1}),g(c,{key:"send2inpaint"},{default:M(()=>[Q(N(s.$t("sendToInpaint")),1)]),_:1}),g(c,{key:"send2extras"},{default:M(()=>[Q(N(s.$t("sendToExtraFeatures")),1)]),_:1}),g(h,{key:"send2controlnet",title:s.$t("sendToControlNet")},{default:M(()=>[g(c,{key:"send2controlnet-txt2img"},{default:M(()=>[Q(N(s.$t("t2i")),1)]),_:1}),g(c,{key:"send2controlnet-img2img"},{default:M(()=>[Q(N(s.$t("i2i")),1)]),_:1})]),_:1},8,["title"]),g(c,{key:"send2savedDir"},{default:M(()=>[Q(N(s.$t("send2savedDir")),1)]),_:1}),g(p),g(h,{key:"toggle-tag",title:s.$t("toggleTag")},{default:M(()=>[(T(!0),J(ve,null,Lt(D(r),C=>(T(),Y(c,{key:`toggle-tag-${C.id}`},{default:M(()=>[Q(N(C.name)+" ",1),C.selected?(T(),Y(D(ei),{key:0})):(T(),Y(D(ti),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"]),g(c,{key:"openWithLocalFileBrowser"},{default:M(()=>[Q(N(s.$t("openWithLocalFileBrowser")),1)]),_:1})],64)):ce("",!0),g(c,{key:"previewInNewWindow"},{default:M(()=>[Q(N(s.$t("previewInNewWindow")),1)]),_:1}),g(c,{key:"download"},{default:M(()=>[Q(N(s.$t("download")),1)]),_:1}),g(c,{key:"copyPreviewUrl"},{default:M(()=>[Q(N(s.$t("copySourceFilePreviewLink")),1)]),_:1})],64)):ce("",!0)]),_:1})}}}),bl=["data-idx"],wl={key:0},Sl={class:"more"},Cl={key:1,class:"preview-icon-wrap"},Al={class:"profile"},El={class:"name line-clamp-1"},Ol={class:"basic-info"},Pl={class:"name line-clamp-1"},xl={class:"basic-info"},kl=se({__name:"FileItem",props:{file:null,idx:null,selected:{type:Boolean,default:!1},showMenuIdx:null,viewMode:{default:"grid"},fullScreenPreviewImageUrl:null},emits:["update:showMenuIdx","fileItemClick","dragstart","previewVisibleChange","contextMenuClick"],setup(t,{emit:e}){const n=t,i=nt(),r=_([]),s=()=>{var p;((p=n==null?void 0:n.file)==null?void 0:p.type)==="file"&&m.pushAction(()=>Un(n.file.fullpath)).res.then(h=>{r.value=h})},m=$t(),c=z(()=>n.viewMode==="grid"?[i.gridThumbnailSize,i.gridThumbnailSize].join("x"):[i.largeGridThumbnailSize,i.largeGridThumbnailSize].join("x"));return(p,h)=>{const P=Ae,C=Vr;return T(),Y(P,{trigger:["contextmenu"],visible:D(i).longPressOpenContextMenu?typeof t.idx=="number"&&t.showMenuIdx===t.idx:void 0,"onUpdate:visible":h[4]||(h[4]=S=>typeof t.idx=="number"&&e("update:showMenuIdx",S?t.idx:-1))},{overlay:M(()=>[g(St,{file:t.file,idx:t.idx,"selected-tag":r.value,onContextMenuClick:h[3]||(h[3]=(S,b,l)=>e("contextMenuClick",S,b,l))},null,8,["file","idx","selected-tag"])]),default:M(()=>[(T(),J("li",{class:Fe(["file file-item-trigger",{clickable:t.file.type==="dir",selected:t.selected,grid:t.viewMode==="grid"||t.viewMode==="large-size-grid","large-grid":t.viewMode==="large-size-grid"}]),"data-idx":t.idx,key:t.file.name,draggable:"true",onDragstart:h[1]||(h[1]=S=>e("dragstart",S,t.idx)),onContextmenu:s,onClickCapture:h[2]||(h[2]=S=>e("fileItemClick",S,t.file,t.idx))},[t.viewMode!=="line"?(T(),J("div",wl,[g(P,null,{overlay:M(()=>[g(St,{file:t.file,idx:t.idx,"selected-tag":r.value,onContextMenuClick:h[0]||(h[0]=(S,b,l)=>e("contextMenuClick",S,b,l))},null,8,["file","idx","selected-tag"])]),default:M(()=>[Z("div",Sl,[g(D(At))])]),_:1}),D(re)(t.file.name)?(T(),Y(C,{key:t.file.fullpath,class:Fe(`idx-${t.idx}`),src:D(i).enableThumbnail?D(Ga)(t.file,D(c)):D(pe)(t.file),fallback:D(ca),preview:{src:t.fullScreenPreviewImageUrl,onVisibleChange:(S,b)=>e("previewVisibleChange",S,b)}},null,8,["class","src","fallback","preview"])):(T(),J("div",Cl,[t.file.type==="file"?(T(),Y(D(mn),{key:0,class:"icon center"})):(T(),Y(D(pn),{key:1,class:"icon center"}))])),Z("div",Al,[Z("div",El,N(t.file.name),1),Z("div",Ol,[Z("div",null,N(t.file.size),1),Z("div",null,N(t.file.date),1)])])])):(T(),J(ve,{key:1},[t.file.type==="file"?(T(),Y(D(mn),{key:0,class:"icon"})):(T(),Y(D(pn),{key:1,class:"icon"})),Z("div",Pl,N(t.file.name),1),Z("div",xl,[Z("div",null,N(t.file.size),1),Z("div",null,N(t.file.date),1)])],64))],42,bl))]),_:1},8,["visible"])}}});const Zl=Vn(kl,[["__scopeId","data-v-d94f3bd3"]]);function Il(t,e,n,i){const r={x:0,y:0};let s=0,m=0,c=typeof(i==null?void 0:i.width)=="number"?i.width:0,p=typeof(i==null?void 0:i.height)=="number"?i.height:0,h=typeof(i==null?void 0:i.left)=="number"?i.left:0,P=typeof(i==null?void 0:i.top)=="number"?i.top:0,C=!1;const S=u=>{u.stopPropagation(),u.preventDefault(),!(!t.value||!e.value)&&(s=u instanceof MouseEvent?u.clientX:u.touches[0].clientX,m=u instanceof MouseEvent?u.clientY:u.touches[0].clientY,c=t.value.offsetWidth,p=t.value.offsetHeight,r.x=e.value.offsetLeft,r.y=e.value.offsetTop,document.documentElement.addEventListener("mousemove",b),document.documentElement.addEventListener("touchmove",b),document.documentElement.addEventListener("mouseup",l),document.documentElement.addEventListener("touchend",l))},b=u=>{if(!t.value||!e.value)return;const A=c+((u instanceof MouseEvent?u.clientX:u.touches[0].clientX)-s),f=p+((u instanceof MouseEvent?u.clientY:u.touches[0].clientY)-m),O=r.x+((u instanceof MouseEvent?u.clientX:u.touches[0].clientX)-s),y=r.y+((u instanceof MouseEvent?u.clientY:u.touches[0].clientY)-m);t.value.style.width=`${A}px`,t.value.style.height=`${f}px`,e.value.style.left=`${O}px`,e.value.style.top=`${y}px`,i!=null&&i.onResize&&i.onResize(A,f)},l=()=>{document.documentElement.removeEventListener("mousemove",b),document.documentElement.removeEventListener("touchmove",b),document.documentElement.removeEventListener("mouseup",l),document.documentElement.removeEventListener("touchend",l)},a=u=>{u.stopPropagation(),u.preventDefault(),!(!t.value||!n.value)&&(C=!0,h=t.value.offsetLeft,P=t.value.offsetTop,s=u instanceof MouseEvent?u.clientX:u.touches[0].clientX,m=u instanceof MouseEvent?u.clientY:u.touches[0].clientY,document.documentElement.addEventListener("mousemove",o),document.documentElement.addEventListener("touchmove",o),document.documentElement.addEventListener("mouseup",d),document.documentElement.addEventListener("touchend",d))},o=u=>{if(!t.value||!n.value||!C)return;const A=h+((u instanceof MouseEvent?u.clientX:u.touches[0].clientX)-s),f=P+((u instanceof MouseEvent?u.clientY:u.touches[0].clientY)-m);t.value.style.left=`${A}px`,t.value.style.top=`${f}px`,i!=null&&i.onDrag&&i.onDrag(A,f)},d=()=>{C=!1,document.documentElement.removeEventListener("mousemove",o),document.documentElement.removeEventListener("touchmove",o),document.documentElement.removeEventListener("mouseup",d),document.documentElement.removeEventListener("touchend",d)};return je(()=>{!t.value||!i||(typeof i.width=="number"&&(t.value.style.width=`${i.width}px`),typeof i.height=="number"&&(t.value.style.height=`${i.height}px`),typeof i.left=="number"&&(t.value.style.left=`${i.left}px`),typeof i.top=="number"&&(t.value.style.top=`${i.top}px`))}),xt(()=>{document.documentElement.removeEventListener("mousemove",b),document.documentElement.removeEventListener("touchmove",b),document.documentElement.removeEventListener("mouseup",l),document.documentElement.removeEventListener("touchend",l),document.documentElement.removeEventListener("mousemove",o),document.documentElement.removeEventListener("touchmove",o),document.documentElement.removeEventListener("mouseup",d),document.documentElement.removeEventListener("touchend",d)}),le(()=>[t.value,e.value,n.value],([u,A,f])=>{u&&A&&(A.addEventListener("mousedown",S),A.addEventListener("touchstart",S)),u&&f&&(f.addEventListener("mousedown",a),f.addEventListener("touchstart",a))}),{handleResizeMouseDown:S,handleDragMouseDown:a}}const $l={class:"container"},Ml={class:"action-bar"},Ll={key:0,class:"icon",style:{cursor:"pointer"}},zl={key:0,"flex-placeholder":""},_l={key:1,class:"action-bar"},Dl={key:0,class:"gen-info"},Nl=se({__name:"fullScreenContextMenu",props:{file:null,idx:null},emits:["contextMenuClick"],setup(t,{emit:e}){const n=t,i=nt(),r=_(),s=_([]),m=z(()=>{var l;return(((l=i.conf)==null?void 0:l.all_custom_tags)??[]).reduce((a,o)=>[...a,{...o,selected:!!s.value.find(d=>d.id===o.id)}],[])}),c=$t(),p=_("");le(()=>{var l;return(l=n==null?void 0:n.file)==null?void 0:l.fullpath},async l=>{l&&(c.tasks.forEach(a=>a.cancel()),c.pushAction(()=>jn(l)).res.then(a=>{p.value=a}))},{immediate:!0});const h=l=>{l&&c.pushAction(()=>Un(n.file.fullpath)).res.then(a=>{s.value=a})},P=_(),C=_(),S=or("fullScreenContextMenu.vue-drag",{left:100,top:100,width:512,height:384,expanded:!0});Il(r,P,C,{...S.value,onDrag:Ie(function(l,a){S.value={...S.value,left:l,top:a}},300),onResize:Ie(function(l,a){S.value={...S.value,width:l,height:a}},300)});function b(l){return l.parentNode}return(l,a)=>{const o=Ae,d=Ze,u=Qn,A=Rn;return T(),J("div",{ref_key:"el",ref:r,class:Fe(["full-screen-menu",{"unset-size":!D(S).expanded}]),onWheelCapture:a[5]||(a[5]=sr(()=>{},["stop"]))},[Z("div",$l,[Z("div",Ml,[Z("div",{ref_key:"dragHandle",ref:C,class:"icon",style:{cursor:"grab"}},[g(D(Aa))],512),Z("div",{class:"icon",style:{cursor:"pointer"},onClick:a[0]||(a[0]=f=>D(S).expanded=!D(S).expanded)},[D(S).expanded?(T(),Y(D(xa),{key:0})):(T(),Y(D(Ma),{key:1}))]),g(o,{onVisibleChange:h,"get-popup-container":b},{overlay:M(()=>[g(St,{file:t.file,idx:t.idx,"selected-tag":s.value,"disable-delete":D(pe)(t.file)===D(i).fullscreenPreviewInitialUrl,onContextMenuClick:a[1]||(a[1]=(f,O,y)=>e("contextMenuClick",f,O,y))},null,8,["file","idx","selected-tag","disable-delete"])]),default:M(()=>[D(S).expanded?ce("",!0):(T(),J("div",Ll,[g(D(At))]))]),_:1}),D(S).expanded?(T(),J("div",zl)):ce("",!0),D(S).expanded?(T(),J("div",_l,[g(o,{trigger:["hover"],"get-popup-container":b,onVisibleChange:h},{overlay:M(()=>[g(A,{onClick:a[2]||(a[2]=f=>e("contextMenuClick",f,t.file,t.idx))},{default:M(()=>[(T(!0),J(ve,null,Lt(D(m),f=>(T(),Y(u,{key:`toggle-tag-${f.id}`},{default:M(()=>[Q(N(f.name)+" ",1),f.selected?(T(),Y(D(ei),{key:0})):(T(),Y(D(ti),{key:1}))]),_:2},1024))),128))]),_:1})]),default:M(()=>[g(d,null,{default:M(()=>[Q(N(l.$t("toggleTag")),1)]),_:1})]),_:1}),g(o,{trigger:["hover"],"get-popup-container":b},{overlay:M(()=>[g(A,{onClick:a[3]||(a[3]=f=>e("contextMenuClick",f,t.file,t.idx))},{default:M(()=>[g(u,{key:"send2txt2img"},{default:M(()=>[Q(N(l.$t("sendToTxt2img")),1)]),_:1}),g(u,{key:"send2img2img"},{default:M(()=>[Q(N(l.$t("sendToImg2img")),1)]),_:1}),g(u,{key:"send2inpaint"},{default:M(()=>[Q(N(l.$t("sendToInpaint")),1)]),_:1}),g(u,{key:"send2extras"},{default:M(()=>[Q(N(l.$t("sendToExtraFeatures")),1)]),_:1}),g(u,{key:"send2savedDir"},{default:M(()=>[Q(N(l.$t("send2savedDir")),1)]),_:1}),g(u,{key:"deleteFiles",disabled:D(pe)(t.file)===D(i).fullscreenPreviewInitialUrl},{default:M(()=>[Q(N(l.$t("deleteSelected")),1)]),_:1},8,["disabled"]),g(u,{key:"previewInNewWindow"},{default:M(()=>[Q(N(l.$t("previewInNewWindow")),1)]),_:1}),g(u,{key:"download"},{default:M(()=>[Q(N(l.$t("download")),1)]),_:1}),g(u,{key:"copyPreviewUrl"},{default:M(()=>[Q(N(l.$t("copySourceFilePreviewLink")),1)]),_:1})]),_:1})]),default:M(()=>[g(d,null,{default:M(()=>[Q(N(D(F)("openContextMenu")),1)]),_:1})]),_:1}),g(d,{onClick:a[4]||(a[4]=f=>D(Mt)(p.value))},{default:M(()=>[Q(N(l.$t("copyPrompt")),1)]),_:1})])):ce("",!0)]),D(S).expanded?(T(),J("div",Dl,N(p.value),1)):ce("",!0)]),D(S).expanded?(T(),J("div",{key:0,class:"mouse-sensor",ref_key:"resizeHandle",ref:P},[g(D(ga))],512)):ce("",!0)],34)}}});const Kl=Vn(Nl,[["__scopeId","data-v-10ae8e66"]]);export{Ae as D,Vl as L,Ul as R,Rl as S,Gl as a,Wl as b,Jl as c,Yl as d,Hl as e,ql as f,dt as g,Qa as h,si as i,Zl as j,Kl as k,pt as l,Ql as s,pe as t,he as u};