sd-webui-infinite-image-bro.../vue/dist/assets/MultiSelectKeep-c6654201.js

4 lines
30 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{b9 as We,c as i,A as ee,v as Y,x as L,n as Ye,J as X,k as he,t as Ge,cc as Ee,cd as Je,b$ as ye,ad as ae,af as R,ce as Ke,r as Q,cf as Qe,C as xe,a9 as G,cg as Ze,ch as Re,R as $,a8 as et,ci as pe,I as se,cj as tt,E as me,ck as nt,cl as at,cb as lt,cm as st,cn as ot,o as rt,d as Be,W as He,co as it,B as Z,L as $e,cp as Se,l as Ce,N as O,O as S,Q as C,Z as h,X as oe,Y as y,cq as ut,U,T as K,S as k,a2 as ce,aa as Me,a1 as ct,cr as Pe,a0 as dt,$ as vt,ag as ft,cs as pt,M as mt,ct as gt,cu as ht,aI as yt,aJ as _t,V as Ve}from"./index-472bd4a5.js";import{u as ue,e as ge,g as B,f as Ie,h as ie,r as wt,t as de,i as bt,s as ve,j as re,_ as kt}from"./FileItem-a2317510.js";import{M as Ue,c as Ot,m as qe,l as Fe,b as Lt,d as Et}from"./functionalCallableComp-b3bf7ff2.js";import{C as xt,g as $t}from"./shortcut-a106f024.js";import{D as St}from"./index-6fad84c5.js";/* empty css */const le=(...e)=>{document.addEventListener(...e),We(()=>document.removeEventListener(...e))};var Ct={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 Mt=Ct;function De(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable}))),n.forEach(function(o){Pt(e,o,a[o])})}return e}function Pt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var _e=function(t,a){var n=De({},t,a.attrs);return i(ee,De({},n,{icon:Mt}),null)};_e.displayName="ArrowsAltOutlined";_e.inheritAttrs=!1;const It=_e;var Ft={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.3 506.3L781.7 405.6a7.23 7.23 0 00-11.7 5.7V476H548V254h64.8c6 0 9.4-7 5.7-11.7L517.7 114.7a7.14 7.14 0 00-11.3 0L405.6 242.3a7.23 7.23 0 005.7 11.7H476v222H254v-64.8c0-6-7-9.4-11.7-5.7L114.7 506.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h222v222h-64.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V548h222v64.8c0 6 7 9.4 11.7 5.7l127.5-100.8a7.3 7.3 0 00.1-11.4z"}}]},name:"drag",theme:"outlined"};const Dt=Ft;function Ae(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable}))),n.forEach(function(o){At(e,o,a[o])})}return e}function At(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var we=function(t,a){var n=Ae({},t,a.attrs);return i(ee,Ae({},n,{icon:Dt}),null)};we.displayName="DragOutlined";we.inheritAttrs=!1;const Tt=we;var zt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"};const Nt=zt;function Te(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable}))),n.forEach(function(o){jt(e,o,a[o])})}return e}function jt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var be=function(t,a){var n=Te({},t,a.attrs);return i(ee,Te({},n,{icon:Nt}),null)};be.displayName="FullscreenExitOutlined";be.inheritAttrs=!1;const Wt=be;var Bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"};const Ht=Bt;function ze(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable}))),n.forEach(function(o){Vt(e,o,a[o])})}return e}function Vt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var ke=function(t,a){var n=ze({},t,a.attrs);return i(ee,ze({},n,{icon:Ht}),null)};ke.displayName="FullscreenOutlined";ke.inheritAttrs=!1;const Ut=ke;var qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M603.3 327.5l-246 178a7.95 7.95 0 000 12.9l246 178c5.3 3.8 12.7 0 12.7-6.5V643c0-10.2-4.9-19.9-13.2-25.9L457.4 512l145.4-105.2c8.3-6 13.2-15.6 13.2-25.9V334c0-6.5-7.4-10.3-12.7-6.5z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"left-circle",theme:"outlined"};const Xt=qt;function Ne(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable}))),n.forEach(function(o){Yt(e,o,a[o])})}return e}function Yt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var Oe=function(t,a){var n=Ne({},t,a.attrs);return i(ee,Ne({},n,{icon:Xt}),null)};Oe.displayName="LeftCircleOutlined";Oe.inheritAttrs=!1;const Nn=Oe;var Gt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M666.7 505.5l-246-178A8 8 0 00408 334v46.9c0 10.2 4.9 19.9 13.2 25.9L566.6 512 421.2 617.2c-8.3 6-13.2 15.6-13.2 25.9V690c0 6.5 7.4 10.3 12.7 6.5l246-178c4.4-3.2 4.4-9.8 0-13z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"right-circle",theme:"outlined"};const Jt=Gt;function je(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable}))),n.forEach(function(o){Kt(e,o,a[o])})}return e}function Kt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var Le=function(t,a){var n=je({},t,a.attrs);return i(ee,je({},n,{icon:Jt}),null)};Le.displayName="RightCircleOutlined";Le.inheritAttrs=!1;const jn=Le,Qt="/infinite_image_browsing/fe-static/assets/fullscreen-7f54b926.svg";function Wn(){const{previewIdx:e,eventEmitter:t,canLoadNext:a,previewing:n,sortedFiles:o,scroller:g,props:x}=ue().toRefs(),{state:M}=ue();let F=null;const j=(p,c)=>{var f;n.value=p,F!=null&&!p&&c&&((f=g.value)==null||f.scrollToItem(F),F=null)},N=()=>{x.value.mode==="walk"&&!_("next")&&a&&(Y.info(L("loadingNextFolder")),t.value.emit("loadNextDir",!0))};le("keydown",p=>{var c;if(n.value){let f=e.value;if(["ArrowDown","ArrowRight"].includes(p.key))for(f++;o.value[f]&&!X(o.value[f].name);)f++;else if(["ArrowUp","ArrowLeft"].includes(p.key))for(f--;o.value[f]&&!X(o.value[f].name);)f--;if(X((c=o.value[f])==null?void 0:c.name)??""){e.value=f;const w=g.value;w&&!(f>=w.$_startIndex&&f<=w.$_endIndex)&&(F=f)}N()}});const P=p=>{var f;let c=e.value;if(p==="next")for(c++;o.value[c]&&!X(o.value[c].name);)c++;else if(p==="prev")for(c--;o.value[c]&&!X(o.value[c].name);)c--;if(X((f=o.value[c])==null?void 0:f.name)??""){e.value=c;const w=g.value;w&&!(c>=w.$_startIndex&&c<=w.$_endIndex)&&(F=c)}N()},_=p=>{var f;let c=e.value;if(p==="next")for(c++;o.value[c]&&!X(o.value[c].name);)c++;else if(p==="prev")for(c--;o.value[c]&&!X(o.value[c].name);)c--;return X((f=o.value[c])==null?void 0:f.name)??""};return ge("removeFiles",async()=>{var p;n.value&&!M.sortedFiles[e.value]&&(Y.info(L("manualExitFullScreen"),5),await Ye(500),(p=document.querySelector(".ant-image-preview-operations-operation .anticon-close"))==null||p.click(),e.value=-1)}),{previewIdx:e,onPreviewVisibleChange:j,previewing:n,previewImgMove:P,canPreview:_}}function fe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Ke(e)}function Bn(){const{currLocation:e,sortedFiles:t,currPage:a,multiSelectedIdxs:n,eventEmitter:o,walker:g}=ue().toRefs(),x=()=>{n.value=[]};return le("click",()=>{B.keepMultiSelect||x()}),le("blur",()=>{B.keepMultiSelect||x()}),he(a,x),{onFileDragStart:(N,P)=>{const _=Ge(t.value[P]);Ie.fileDragging=!0,console.log("onFileDragStart set drag file ",N,P,_);const p=[_];let c=_.type==="dir";if(n.value.includes(P)){const w=n.value.map(D=>t.value[D]);p.push(...w),c=w.some(D=>D.type==="dir")}const f={includeDir:c,loc:e.value||"search-result",path:Ee(p,"fullpath").map(w=>w.fullpath),nodes:Ee(p,"fullpath"),__id:"FileTransferData"};N.dataTransfer.setData("text/plain",JSON.stringify(f))},onDrop:async N=>{if(g.value)return;const P=Je(N);if(!P)return;const _=e.value;if(P.loc===_)return;const p=ye(),c=async()=>p.pushAction(async()=>{await Ot(P.path,_),o.value.emit("refresh"),ae.destroyAll()}),f=()=>p.pushAction(async()=>{await qe(P.path,_),ie.emit("removeFiles",{paths:P.path,loc:P.loc}),o.value.emit("refresh"),ae.destroyAll()});ae.confirm({title:L("confirm")+"?",width:"60vw",content:()=>{let w,D,l;return i("div",null,[i("div",null,[`${L("moveSelectedFilesTo")} ${_}`,i("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[P.path.map(d=>i("li",null,[d.split(/[/\\]/).pop()]))])]),i(Ue,null,null),i("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end"},class:"actions"},[i(R,{onClick:ae.destroyAll},fe(w=L("cancel"))?w:{default:()=>[w]}),i(R,{type:"primary",loading:!p.isIdle,onClick:c},fe(D=L("copy"))?D:{default:()=>[D]}),i(R,{type:"primary",loading:!p.isIdle,onClick:f},fe(l=L("move"))?l:{default:()=>[l]})])])},maskClosable:!0,wrapClassName:"hidden-antd-btns-modal"})},multiSelectedIdxs:n,onFileDragEnd:()=>{Ie.fileDragging=!1}}}function Hn({openNext:e}){const t=Q(!1),a=Q(""),{sortedFiles:n,previewIdx:o,multiSelectedIdxs:g,stack:x,currLocation:M,spinning:F,previewing:j,stackViewEl:N,eventEmitter:P,props:_,deletedFiles:p}=ue().toRefs(),c=xe;ge("removeFiles",({paths:d,loc:r})=>{c(r)!==c(M.value)||!Fe(x.value)||(d.forEach(W=>p.value.add(W)),d.filter(X).forEach(W=>p.value.add(W.replace(/\.\w+$/,".txt"))))}),ge("addFiles",({files:d,loc:r})=>{if(c(r)!==c(M.value))return;const I=Fe(x.value);I&&I.files.unshift(...d)});const f=ye(),w=async(d,r,I)=>{o.value=I,B.fullscreenPreviewInitialUrl=G(r);const W=g.value.indexOf(I);if(d.shiftKey){if(W!==-1)g.value.splice(W,1);else{g.value.push(I),g.value.sort((u,A)=>u-A);const V=g.value[0],s=g.value[g.value.length-1];g.value=wt(V,s+1)}d.stopPropagation()}else d.ctrlKey||d.metaKey?(W!==-1?g.value.splice(W,1):g.value.push(I),d.stopPropagation()):await e(r)},D=async(d,r,I)=>{var b,q,ne;const W=G(r),V=M.value,s={IIB_container_id:parent.IIB_container_id},u=()=>{let v=[];return g.value.includes(I)?v=g.value.map(m=>n.value[m]):v.push(r),v},A=async v=>{if(!F.value)try{F.value=!0,await st(r.fullpath),re.postMessage({...s,event:"click_hidden_button",btnEleId:"iib_hidden_img_update_trigger"}),await ot(),re.postMessage({...s,event:"click_hidden_button",btnEleId:`iib_hidden_tab_${v}`})}catch(m){console.error(m),Y.error("发送图像失败请携带console的错误消息找开发者")}finally{F.value=!1}},T=`${d.key}`;if(T.startsWith("toggle-tag-")){const v=+T.split("toggle-tag-")[1],{is_remove:m}=await Ze({tag_id:v,img_path:r.fullpath}),H=(q=(b=B.conf)==null?void 0:b.all_custom_tags.find(z=>z.id===v))==null?void 0:q.name;await de.refreshTags([r.fullpath]),Y.success(L(m?"removedTagFromImage":"addedTagToImage",{tag:H}));return}else if(T.startsWith("batch-add-tag-")||T.startsWith("batch-remove-tag-")){const v=+T.split("-tag-")[1],m=T.includes("add")?"add":"remove",H=u().map(z=>z.fullpath);await Re({tag_id:v,img_paths:H,action:m}),await de.refreshTags(H),Y.success(L(m==="add"?"addCompleted":"removeCompleted"));return}switch(d.key){case"previewInNewWindow":return window.open(W);case"saveSelectedAsJson":return lt(u());case"openWithDefaultApp":return at(r.fullpath);case"download":{const v=u();nt(v.map(m=>G(m,!0)));break}case"copyPreviewUrl":return me(parent.document.location.origin+W);case"rename":{let v=await Lt(r.fullpath);v=xe(v);const m=de.tagMap;m.set(v,m.get(r.fullpath)??[]),m.delete(r.fullpath),r.fullpath=v,r.name=v.split(/[\\/]/).pop()??"";return}case"send2txt2img":return A("txt2img");case"send2img2img":return A("img2img");case"send2inpaint":return A("inpaint");case"send2extras":return A("extras");case"send2savedDir":{const v=B.quickMovePaths.find(z=>z.key==="outdir_save");if(!v)return Y.error(L("unknownSavedDir"));const m=tt(v.dir,(ne=B.conf)==null?void 0:ne.sd_cwd),H=u();await qe(H.map(z=>z.fullpath),m,!0),ie.emit("removeFiles",{paths:H.map(z=>z.fullpath),loc:M.value}),ie.emit("addFiles",{files:H,loc:m});break}case"send2controlnet-img2img":case"send2controlnet-txt2img":{const v=d.key.split("-")[1];re.postMessage({...s,event:"send_to_control_net",type:v,url:G(r)});break}case"send2outpaint":{a.value=await f.pushAction(()=>pe(r.fullpath)).res;const[v,m]=(a.value||"").split(`
`);re.postMessage({...s,event:"send_to_outpaint",url:G(r),prompt:v,negPrompt:m.slice(17)});break}case"openWithWalkMode":{ve.set(V,x.value);const v=B.tabList[_.value.tabIdx],m={type:"local",key:se(),path:r.fullpath,name:L("local"),stackKey:V,mode:"walk"};v.panes.push(m),v.key=m.key;break}case"openInNewTab":{ve.set(V,x.value);const v=B.tabList[_.value.tabIdx],m={type:"local",key:se(),path:r.fullpath,name:L("local"),stackKey:V};v.panes.push(m),v.key=m.key;break}case"openOnTheRight":{ve.set(V,x.value);let v=B.tabList[_.value.tabIdx+1];v||(v={panes:[],key:"",id:se()},B.tabList[_.value.tabIdx+1]=v);const m={type:"local",key:se(),path:r.fullpath,name:L("local"),stackKey:V};v.panes.push(m),v.key=m.key;break}case"send2BatchDownload":{bt.addFiles(u());break}case"viewGenInfo":{t.value=!0,a.value=await f.pushAction(()=>pe(r.fullpath)).res;break}case"openWithLocalFileBrowser":{await et(r.fullpath);break}case"deleteFiles":{const v=u(),m=async()=>{const H=v.map(z=>z.fullpath);await Et(H),Y.success(L("deleteSuccess")),ie.emit("removeFiles",{paths:H,loc:M.value})};if(v.length===1&&B.ignoredConfirmActions.deleteOneOnly)return m();await new Promise(H=>{ae.confirm({title:L("confirmDelete"),maskClosable:!0,width:"60vw",content:()=>i("div",null,[i("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[v.map(z=>i("li",null,[z.fullpath.split(/[/\\]/).pop()]))]),i(Ue,null,null),i(xt,{checked:B.ignoredConfirmActions.deleteOneOnly,"onUpdate:checked":z=>B.ignoredConfirmActions.deleteOneOnly=z},{default:()=>[L("deleteOneOnlySkipConfirm"),$(" ("),L("resetOnGlobalSettingsPage"),$(")")]})]),async onOk(){await m(),H()}})});break}}return{}},{isOutside:l}=Qe(N);return le("keydown",d=>{var I,W,V;const r=$t(d);if(j.value){const s=(I=Object.entries(B.shortcut).find(u=>u[1]===r&&u[1]))==null?void 0:I[0];if(s){d.stopPropagation(),d.preventDefault();const u=o.value,A=n.value[u];switch(s){case"delete":return G(A)===B.fullscreenPreviewInitialUrl?Y.warn(L("fullscreenRestriction")):D({key:"deleteFiles"},A,u);case"download":return D({key:"download"},A,u);default:{const T=(W=/^toggle_tag_(.*)$/.exec(s))==null?void 0:W[1],b=(V=B.conf)==null?void 0:V.all_custom_tags.find(q=>q.name===T);return b?D({key:`toggle-tag-${b.id}`},A,u):void 0}}}}else!l.value&&["Ctrl + KeyA","Cmd + KeyA"].includes(r)&&(d.preventDefault(),d.stopPropagation(),P.value.emit("selectAll"))}),{onFileItemClick:w,onContextMenuClick:D,showGenInfo:t,imageGenInfo:a,q:f}}function Zt(e,t,a,n){let o=0,g=0,x=typeof(n==null?void 0:n.width)=="number"?n.width:0,M=typeof(n==null?void 0:n.height)=="number"?n.height:0,F=typeof(n==null?void 0:n.left)=="number"?n.left:0,j=typeof(n==null?void 0:n.top)=="number"?n.top:0,N=!1;const P=l=>{l.stopPropagation(),l.preventDefault(),!(!e.value||!t.value)&&(o=l instanceof MouseEvent?l.clientX:l.touches[0].clientX,g=l instanceof MouseEvent?l.clientY:l.touches[0].clientY,x=e.value.offsetWidth,M=e.value.offsetHeight,t.value.offsetLeft,t.value.offsetTop,document.documentElement.addEventListener("mousemove",_),document.documentElement.addEventListener("touchmove",_),document.documentElement.addEventListener("mouseup",p),document.documentElement.addEventListener("touchend",p))},_=l=>{if(!e.value||!t.value)return;let d=x+((l instanceof MouseEvent?l.clientX:l.touches[0].clientX)-o),r=M+((l instanceof MouseEvent?l.clientY:l.touches[0].clientY)-g);e.value.offsetLeft+d>window.innerWidth&&(d=window.innerWidth-e.value.offsetLeft),e.value.offsetTop+r>window.innerHeight&&(r=window.innerHeight-e.value.offsetTop),e.value.style.width=`${d}px`,e.value.style.height=`${r}px`,n!=null&&n.onResize&&n.onResize(d,r)},p=()=>{document.documentElement.removeEventListener("mousemove",_),document.documentElement.removeEventListener("touchmove",_),document.documentElement.removeEventListener("mouseup",p),document.documentElement.removeEventListener("touchend",p)},c=l=>{l.stopPropagation(),l.preventDefault(),!(!e.value||!a.value)&&(N=!0,F=e.value.offsetLeft,j=e.value.offsetTop,o=l instanceof MouseEvent?l.clientX:l.touches[0].clientX,g=l instanceof MouseEvent?l.clientY:l.touches[0].clientY,document.documentElement.addEventListener("mousemove",f),document.documentElement.addEventListener("touchmove",f),document.documentElement.addEventListener("mouseup",w),document.documentElement.addEventListener("touchend",w))},f=l=>{if(!e.value||!a.value||!N)return;const d=F+((l instanceof MouseEvent?l.clientX:l.touches[0].clientX)-o),r=j+((l instanceof MouseEvent?l.clientY:l.touches[0].clientY)-g);d<0?e.value.style.left="0px":d+e.value.offsetWidth>window.innerWidth?e.value.style.left=`${window.innerWidth-e.value.offsetWidth}px`:e.value.style.left=`${d}px`,r<0?e.value.style.top="0px":r+e.value.offsetHeight>window.innerHeight?e.value.style.top=`${window.innerHeight-e.value.offsetHeight}px`:e.value.style.top=`${r}px`,n!=null&&n.onDrag&&n.onDrag(d,r)},w=()=>{N=!1,document.documentElement.removeEventListener("mousemove",f),document.documentElement.removeEventListener("touchmove",f),document.documentElement.removeEventListener("mouseup",w),document.documentElement.removeEventListener("touchend",w)},D=()=>{if(!e.value||!t.value)return;let l=e.value.offsetLeft,d=e.value.offsetTop,r=e.value.offsetWidth,I=e.value.offsetHeight;l+r>window.innerWidth&&(l=window.innerWidth-r,l<0&&(l=0,r=window.innerWidth)),d+I>window.innerHeight&&(d=window.innerHeight-I,d<0&&(d=0,I=window.innerHeight)),e.value.style.left=`${l}px`,e.value.style.top=`${d}px`,e.value.style.width=`${r}px`,e.value.style.height=`${I}px`};return rt(()=>{!e.value||!n||(typeof n.width=="number"&&(e.value.style.width=`${n.width}px`),typeof n.height=="number"&&(e.value.style.height=`${n.height}px`),typeof n.left=="number"&&(e.value.style.left=`${n.left}px`),typeof n.top=="number"&&(e.value.style.top=`${n.top}px`),D(),window.addEventListener("resize",D))}),We(()=>{document.documentElement.removeEventListener("mousemove",_),document.documentElement.removeEventListener("touchmove",_),document.documentElement.removeEventListener("mouseup",p),document.documentElement.removeEventListener("touchend",p),document.documentElement.removeEventListener("mousemove",f),document.documentElement.removeEventListener("touchmove",f),document.documentElement.removeEventListener("mouseup",w),document.documentElement.removeEventListener("touchend",w),window.removeEventListener("resize",D)}),he(()=>[e.value,t.value,a.value],([l,d,r])=>{l&&d&&(d.addEventListener("mousedown",P),d.addEventListener("touchstart",P)),l&&r&&(r.addEventListener("mousedown",c),r.addEventListener("touchstart",c))}),{handleResizeMouseDown:P,handleDragMouseDown:c}}const te=e=>(yt("data-v-b85e2449"),e=e(),_t(),e),Rt={class:"container"},en={class:"action-bar"},tn=["title"],nn=["title"],an=["title"],ln=["src"],sn={key:0,class:"icon",style:{cursor:"pointer"}},on={key:0,"flex-placeholder":""},rn={key:1,class:"action-bar"},un={key:0,class:"gen-info"},cn={class:"info-tags"},dn={class:"name"},vn={class:"value"},fn={key:0,class:"tags-container"},pn=["onClick"],mn=te(()=>C("br",null,null,-1)),gn=te(()=>C("h3",null,"Prompt",-1)),hn=["innerHTML"],yn=te(()=>C("br",null,null,-1)),_n=te(()=>C("h3",null,"Negative Prompt",-1)),wn=["innerHTML"],bn=te(()=>C("br",null,null,-1)),kn=te(()=>C("h3",null,"Params",-1)),On={style:{"font-weight":"600","text-transform":"capitalize"}},Ln={key:0},En={key:1},xn=["title"],$n=Be({__name:"fullScreenContextMenu",props:{file:{},idx:{}},emits:["contextMenuClick"],setup(e,{emit:t}){const a=e,n=He(),o=it(),g=Q(),x=Z(()=>o.tagMap.get(a.file.fullpath)??[]),M=Q(""),F=ye(),j=Q(""),N=Z(()=>j.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")),P=Z(()=>N.value.split(`
`)),_=Z(()=>$e(N.value)),p=Z(()=>{let s=$e(N.value);return delete s.prompt,delete s.negativePrompt,s});he(()=>{var s;return(s=a==null?void 0:a.file)==null?void 0:s.fullpath},async s=>{s&&(F.tasks.forEach(u=>u.cancel()),F.pushAction(()=>pe(s)).res.then(u=>{j.value=u}))},{immediate:!0});const c=Se("iib@fullScreenContextMenu.prompt-tab","structedData"),f=Q(),w=Q(),D={left:100,top:100,width:512,height:384,expanded:!0},l=Se("fullScreenContextMenu.vue-drag",D);l.value&&(l.value.left<0||l.value.top<0)&&(l.value={...D}),Zt(g,f,w,{...l.value,onDrag:Ce(function(s,u){l.value={...l.value,left:s,top:u}},300),onResize:Ce(function(s,u){l.value={...l.value,width:s,height:u}},300)});function d(s){return s.parentNode}function r(s){if(!s)return"";let u="";const A=s.split(/[\n,]+/).map(b=>b.trim()).filter(b=>b);let T=!1;for(let b=0;b<A.length;b++){const q=A[b];T||(T=q.includes("(")),u+=`<span class="${T?"has-parentheses":""}">${q}</span>`,b<A.length-1&&(u+=","),T&&(T=!q.includes(")"))}return u}le("load",s=>{const u=s.target;u.className==="ant-image-preview-img"&&(M.value=`${u.naturalWidth} x ${u.naturalHeight}`)},{capture:!0});const I=Z(()=>{const s=[{name:L("fileName"),val:a.file.name},{name:L("fileSize"),val:a.file.size}];return M.value&&s.push({name:L("resolution"),val:M.value}),s}),W=()=>{const s="Negative prompt:",u=j.value.includes(s)?j.value.split(s)[0]:P.value[0]??"";me(Pe(u.trim()))},V=()=>document.body.requestFullscreen();return(s,u)=>{var z;const A=St,T=R,b=ft,q=pt,ne=mt,v=R,m=gt,H=ht;return O(),S("div",{ref_key:"el",ref:g,class:Me(["full-screen-menu",{"unset-size":!h(l).expanded}]),onWheelCapture:u[6]||(u[6]=vt(()=>{},["stop"]))},[C("div",Rt,[C("div",en,[C("div",{ref_key:"dragHandle",ref:w,class:"icon",style:{cursor:"grab"},title:h(L)("dragToMovePanel")},[i(h(Tt))],8,tn),C("div",{class:"icon",style:{cursor:"pointer"},onClick:u[0]||(u[0]=E=>h(l).expanded=!h(l).expanded),title:h(L)("clickToToggleMaximizeMinimize")},[h(l).expanded?(O(),oe(h(Wt),{key:0})):(O(),oe(h(Ut),{key:1}))],8,nn),C("div",{style:{display:"flex","flex-direction":"column","align-items":"center",cursor:"grab"},class:"icon",title:h(L)("fullscreenview"),onClick:V},[C("img",{src:h(Qt),style:{width:"21px",height:"21px","padding-bottom":"2px"},alt:""},null,8,ln)],8,an),i(A,{"get-popup-container":d},{overlay:y(()=>[i(kt,{file:s.file,idx:s.idx,"selected-tag":x.value,"disable-delete":h(G)(s.file)===h(n).fullscreenPreviewInitialUrl,onContextMenuClick:u[1]||(u[1]=(E,J,Xe)=>t("contextMenuClick",E,J,Xe))},null,8,["file","idx","selected-tag","disable-delete"])]),default:y(()=>[h(l).expanded?U("",!0):(O(),S("div",sn,[i(h(ut))]))]),_:1}),h(l).expanded?(O(),S("div",on)):U("",!0),h(l).expanded?(O(),S("div",rn,[i(A,{trigger:["hover"],"get-popup-container":d},{overlay:y(()=>[i(ne,{onClick:u[2]||(u[2]=E=>t("contextMenuClick",E,s.file,s.idx))},{default:y(()=>{var E;return[((E=h(n).conf)==null?void 0:E.launch_mode)!=="server"?(O(),S(K,{key:0},[i(b,{key:"send2txt2img"},{default:y(()=>[$(k(s.$t("sendToTxt2img")),1)]),_:1}),i(b,{key:"send2img2img"},{default:y(()=>[$(k(s.$t("sendToImg2img")),1)]),_:1}),i(b,{key:"send2inpaint"},{default:y(()=>[$(k(s.$t("sendToInpaint")),1)]),_:1}),i(b,{key:"send2extras"},{default:y(()=>[$(k(s.$t("sendToExtraFeatures")),1)]),_:1}),i(q,{key:"sendToThirdPartyExtension",title:s.$t("sendToThirdPartyExtension")},{default:y(()=>[i(b,{key:"send2controlnet-txt2img"},{default:y(()=>[$("ControlNet - "+k(s.$t("t2i")),1)]),_:1}),i(b,{key:"send2controlnet-img2img"},{default:y(()=>[$("ControlNet - "+k(s.$t("i2i")),1)]),_:1}),i(b,{key:"send2outpaint"},{default:y(()=>[$("openOutpaint")]),_:1})]),_:1},8,["title"])],64)):U("",!0),i(b,{key:"send2BatchDownload"},{default:y(()=>[$(k(s.$t("sendToBatchDownload")),1)]),_:1}),i(b,{key:"send2savedDir"},{default:y(()=>[$(k(s.$t("send2savedDir")),1)]),_:1}),i(b,{key:"deleteFiles",disabled:h(G)(s.file)===h(n).fullscreenPreviewInitialUrl},{default:y(()=>[$(k(s.$t("deleteSelected")),1)]),_:1},8,["disabled"]),i(b,{key:"previewInNewWindow"},{default:y(()=>[$(k(s.$t("previewInNewWindow")),1)]),_:1}),i(b,{key:"copyPreviewUrl"},{default:y(()=>[$(k(s.$t("copySourceFilePreviewLink")),1)]),_:1})]}),_:1})]),default:y(()=>[i(T,null,{default:y(()=>[$(k(h(L)("openContextMenu")),1)]),_:1})]),_:1}),i(v,{onClick:u[3]||(u[3]=E=>t("contextMenuClick",{key:"download"},a.file,a.idx))},{default:y(()=>[$(k(s.$t("download")),1)]),_:1}),j.value?(O(),oe(T,{key:0,onClick:u[4]||(u[4]=E=>h(me)(j.value))},{default:y(()=>[$(k(s.$t("copyPrompt")),1)]),_:1})):U("",!0),j.value?(O(),oe(T,{key:1,onClick:W},{default:y(()=>[$(k(s.$t("copyPositivePrompt")),1)]),_:1})):U("",!0)])):U("",!0)]),h(l).expanded?(O(),S("div",un,[C("div",cn,[(O(!0),S(K,null,ce(I.value,E=>(O(),S("span",{class:"info-tag",key:E.name},[C("span",dn,k(E.name),1),C("span",vn,k(E.val),1)]))),128))]),(z=h(n).conf)!=null&&z.all_custom_tags?(O(),S("div",fn,[(O(!0),S(K,null,ce(h(n).conf.all_custom_tags,E=>(O(),S("div",{class:Me(["tag",{selected:x.value.some(J=>J.id===E.id)}]),onClick:J=>t("contextMenuClick",{key:`toggle-tag-${E.id}`},s.file,s.idx),key:E.id,style:ct({"--tag-color":h(o).getColor(E.name)})},k(E.name),15,pn))),128))])):U("",!0),i(H,{activeKey:h(c),"onUpdate:activeKey":u[5]||(u[5]=E=>dt(c)?c.value=E:null)},{default:y(()=>[i(m,{key:"structedData",tab:s.$t("structuredData")},{default:y(()=>[C("div",null,[_.value.prompt?(O(),S(K,{key:0},[mn,gn,C("code",{innerHTML:r(_.value.prompt??"")},null,8,hn)],64)):U("",!0),_.value.negativePrompt?(O(),S(K,{key:1},[yn,_n,C("code",{innerHTML:r(_.value.negativePrompt??"")},null,8,wn)],64)):U("",!0)]),Object.keys(p.value).length?(O(),S(K,{key:0},[bn,kn,C("table",null,[(O(!0),S(K,null,ce(p.value,(E,J)=>(O(),S("tr",{key:J,class:"gen-info-frag"},[C("td",On,k(J),1),typeof E=="object"?(O(),S("td",Ln,[C("code",null,k(E),1)])):(O(),S("td",En,k(h(Pe)(E)),1))]))),128))])],64)):U("",!0)]),_:1},8,["tab"]),i(m,{key:"sourceText",tab:s.$t("sourceText")},{default:y(()=>[C("code",null,k(j.value),1)]),_:1},8,["tab"])]),_:1},8,["activeKey"])])):U("",!0)]),h(l).expanded?(O(),S("div",{key:0,class:"mouse-sensor",ref_key:"resizeHandle",ref:f,title:h(L)("dragToResizePanel")},[i(h(It))],8,xn)):U("",!0)],34)}}});const Vn=Ve($n,[["__scopeId","data-v-b85e2449"]]),Sn={key:0,class:"float-panel"},Cn={key:0,class:"select-actions"},Mn={key:1},Pn=Be({__name:"MultiSelectKeep",props:{show:{type:Boolean}},emits:["selectAll","reverseSelect","clearAllSelected"],setup(e,{emit:t}){const a=He(),n=()=>{t("clearAllSelected"),a.keepMultiSelect=!1},o=()=>{a.keepMultiSelect=!0};return(g,x)=>{const M=R;return g.show?(O(),S("div",Sn,[h(a).keepMultiSelect?(O(),S("div",Cn,[i(M,{size:"small",onClick:x[0]||(x[0]=F=>t("selectAll"))},{default:y(()=>[$(k(g.$t("select-all")),1)]),_:1}),i(M,{size:"small",onClick:x[1]||(x[1]=F=>t("reverseSelect"))},{default:y(()=>[$(k(g.$t("rerverse-select")),1)]),_:1}),i(M,{size:"small",onClick:x[2]||(x[2]=F=>t("clearAllSelected"))},{default:y(()=>[$(k(g.$t("clear-all-selected")),1)]),_:1}),i(M,{size:"small",onClick:n},{default:y(()=>[$(k(g.$t("exit")),1)]),_:1})])):(O(),S("div",Mn,[i(M,{size:"small",type:"primary",onClick:o},{default:y(()=>[$(k(g.$t("keep-multi-selected")),1)]),_:1})]))])):U("",!0)}}});const Un=Ve(Pn,[["__scopeId","data-v-b04c3508"]]);export{Nn as L,Un as M,jn as R,Bn as a,Hn as b,Wn as c,Vn as f,le as u};