import{_ as e}from"./index.js?v=1763625242172";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{i as l,bf as s,c as t}from"./page_layout.js?v=1763625242172";import{g as o}from"./index199.js?v=1763625242172";import{g as r}from"./index39.js?v=1763625242172";import{_ as i}from"./ShareDetail.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{au as u,dP as n,dU as p,dT as f,aC as d}from"./naive.js?v=1763625242172";import{k as m,i as _,av as v,r as c,c as h,R as j,S as x,X as w,a3 as y,U as M,V as b,j as g,a4 as S,aj as k,F as U,N as D}from"./vue.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./public.js?v=1763625242172";import"./soft2.js?v=1763625242172";import"./soft.js?v=1763625242172";import"./site.js?v=1763625242172";import"./file2.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1763625242172";const C={class:"p-20px"},F=m({__name:"Share",setup(m,{expose:F}){const{t:R}=l.global,L=_("fileStore"),{choosedKeys:N,fileList:q}=L,H=v("shareDetailRef"),K=c(!1),O=h((()=>"dir"==P.value.type?R("file.shareModal.setShareFolder",{name:P.value.nm}):R("file.shareModal.setShareFile",{name:P.value.nm}))),P=c({}),T=c({filename:"",ps:"",password:"",expire:24});async function V(){var e;const{message:a}=await s.post("/files?action=create_download_url",D(T.value),{requestOptions:{loading:R("file.shareModal.creatingShareLink")}});t(a)&&(K.value=!1,null==(e=H.value)||e.open(a),r(L))}function W(){T.value.password=o(8)}return F({open:function(){K.value=!0;const e=q.value.find((e=>N.value[0]==e.nm));P.value=e,T.value.ps=P.value.nm,T.value.filename=P.value.path},close:function(){K.value=!1}}),(l,s)=>{const t=u,o=n,r=p,m=f,_=d,v=a,c=e;return j(),x(U,null,[w(c,{show:b(K),"onUpdate:show":s[3]||(s[3]=e=>k(K)?K.value=e:null),title:b(O),width:560,footer:!0,"confirm-text":b(R)("file.shareModal.create"),onConfirm:V},{default:y((()=>[M("div",C,[w(v,null,{default:y((()=>[w(o,{label:b(R)("file.shareModal.shareName")},{default:y((()=>[w(t,{value:b(T).ps,"onUpdate:value":s[0]||(s[0]=e=>b(T).ps=e)},null,8,["value"])])),_:1},8,["label"]),w(o,{label:b(R)("file.shareModal.expirationDate")},{default:y((()=>[w(m,{value:b(T).expire,"onUpdate:value":s[1]||(s[1]=e=>b(T).expire=e)},{default:y((()=>[w(r,{value:24},{default:y((()=>[g(S(b(R)("file.shareModal.aDay")),1)])),_:1}),w(r,{value:168},{default:y((()=>[g(S(b(R)("file.shareModal.aWeek")),1)])),_:1}),w(r,{value:1130800},{default:y((()=>[g(S(b(R)("file.shareModal.permanent")),1)])),_:1})])),_:1},8,["value"])])),_:1},8,["label"]),w(o,{label:b(R)("file.shareModal.extractionCode"),"show-feedback":!1},{default:y((()=>[w(t,{value:b(T).password,"onUpdate:value":s[2]||(s[2]=e=>b(T).password=e)},null,8,["value"]),w(_,{class:"ml-10px",type:"primary",onClick:W},{default:y((()=>[g(S(b(R)("file.shareModal.random")),1)])),_:1})])),_:1},8,["label"])])),_:1})])])),_:1},8,["show","title","confirm-text"]),w(i,{ref_key:"shareDetailRef",ref:H},null,512)],64)}}});export{F as default};
