import"./rolldown-runtime-BM3Ffeng.js";import{D as e,dt as t,ot as ee}from"./element-plus-vendor-BF9PNysW.js";import{A as n,D as r,G as te,I as i,J as a,N as ne,O as o,P as s,Pt as c,Tt as l,Xt as re,_ as u,bt as ie,et as d,gt as ae,ht as f,k as p,o as m,pt as h,q as g,qt as oe,s as _,y as se}from"./vue-vendor-DMUmTARL.js";import{f as ce,l as v,v as y,yt as b}from"./index-BcZTP2Ia.js";import{t as x}from"./_plugin-vue_export-helper-CWyGVBf-.js";import{C as S,S as C,v as w}from"./useFileData-CeUREevc.js";import{t as le}from"./useShareData-CW-8lVh5.js";import ue from"./MobileActionBar-DXd2Fjvc.js";import{t as T}from"./route-block-D7Rwj2No.js";import{_ as de,a as fe,c as pe,d as E,f as D,g as O,i as k,l as A,n as j,o as M,r as N,s as P,t as F,u as I}from"./ImagePreviewDialog-qUy427HZ.js";import{n as L,t as R}from"./ShareInvalidPanel-Bi6f0CJ-.js";var z=i({__name:`ShareContextmenu`,setup(e){return(e,t)=>(d(),o(M,{mode:`share`}))}}),B={key:1,class:`mx-auto flex w-full max-w-md flex-1 flex-col justify-center space-y-8`},me={class:`space-y-2`},V={__name:`[shareKey]`,setup(i){let x=y(),{toolbarEnabled:T}=C();k();let{shareVerified:M,sharePassword:V,initShare:H,verifySharePassword:he,loadShareFiles:U,shareInvalid:W,shareErrorMsg:ge,clearShareRuntime:_e}=le(),G=b(),ve=v(),{showFileMenu:K}=w(),q=l();fe(q);let{zfileSettingCache:J}=S(),Y=m(),ye=_(),X=l(``),Z=l(),Q=l(!1);g(async()=>{Y.query.pwd&&(X.value=String(Y.query.pwd)),await H(),te(()=>{!M.value&&!W.value&&Z.value?.focus?.()})});let $=async()=>{if(!X.value.trim()){x.warning(`请输入访问密码`);return}Q.value=!0;try{await he(X.value)?(V.value=X.value,M.value=!0,await ye.replace({path:Y.path,query:{...Y.query||{},pwd:X.value}}),await U(Y.query.path||`/`)):x.error(`密码错误，请重新输入`)}finally{Q.value=!1}};h(()=>Y.query.path,e=>{M.value&&U(e||`/`)});let be=()=>window.location.href=`/`;return a(()=>{_e(`share-page-unmount`)}),(te,i)=>{let a=t,l=ee,m=e,h=z,g=P,_=pe,v=A,y=I,b=E,x=D,S=F,C=O,w=de;return d(),n(`div`,{class:`zf-file-index__body h-full`,onContextmenu:i[1]||=(...e)=>c(K)&&c(K)(...e)},[c(W)||!c(M)?(d(),o(L,{key:0},{default:f(()=>[c(W)?(d(),o(R,{key:0,msg:c(ge),"action-text":`返回首页`,onAction:be},null,8,[`msg`])):(d(),n(`div`,B,[i[3]||=r(`div`,{class:`text-center md:text-left`},[r(`h2`,{class:`mb-2 text-2xl font-bold text-primary`},`访问受限`),r(`p`,{class:`text-secondary`},`此分享受密码保护，请输入访问密码`)],-1),s(m,{class:`space-y-6`,onSubmit:se($,[`prevent`])},{default:f(()=>[r(`div`,me,[i[2]||=r(`label`,{class:`ml-0.5 block text-sm font-medium text-regular`},`访问密码`,-1),s(a,{ref_key:`passwordInputRef`,ref:Z,modelValue:c(X),"onUpdate:modelValue":i[0]||=e=>ie(X)?X.value=e:null,type:`password`,placeholder:`请输入密码`,"show-password":``,size:`large`,class:`zf-ds-clean-input`},null,8,[`modelValue`])]),s(l,{type:`primary`,size:`large`,loading:c(Q),class:`!h-[48px] w-full !rounded-lg !text-[15px] !font-semibold !tracking-wide transition-all active:!scale-[0.99]`,onClick:$},{default:f(()=>[ne(re(c(Q)?`验证中...`:`查看文件`),1)]),_:1},8,[`loading`])]),_:1})]))]),_:1})):(d(),n(`div`,{key:1,ref_key:`fileIndexBodyRef`,ref:q,class:oe(`zf-file-index__table--`+(c(ce)?c(G).globalConfig?.mobileLayout:c(G).globalConfig?.layout))},[c(J).view.type===`table`?(d(),o(N,{key:0,"share-mode":!0,class:`zf-file-view`})):p(``,!0),c(J).view.type===`card`?(d(),o(j,{key:1,"share-mode":!0,class:`zf-file-view`})):p(``,!0),s(h),s(g),s(_),s(v),s(y),s(b),s(x),s(S),s(C),ae(s(w,null,null,512),[[u,c(ve).zfileConfig.gallery.showBackTop]]),c(T)?(d(),o(ue,{key:2,mode:`share`})):p(``,!0)],2))],32)}}};typeof T==`function`&&T(V);var H=x(V,[[`__scopeId`,`data-v-273ddeb2`]]);export{H as default};