Files
filecodebox/themes/2024/assets/SendFileView-1dGxBWlR.js
T
2025-03-30 22:21:38 +08:00

27 lines
24 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{c as L,d as de,r as I,o as ue,w as Te,a as _,b as e,e as C,_ as ge,u as Ie,f as Ae,g as x,n,h as r,i as $e,t as T,j as E,k as U,l as R,m as O,v as se,T as Q,F as J,p as De,q as ae,s as K,x as Fe,X as ne,y as Pe,z as je,A as V}from"./index-CgqZQa96.js";import{u as Be,S as le,C as Ue,c as Re,a as Ve,Q as Le,b as X,E as He}from"./clipboard-BsVvyWeO.js";import{F as ie}from"./file-oKDOd1HK.js";import{T as qe}from"./trash-cjXYkUOS.js";/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Y=L("ClipboardCopyIcon",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ee=L("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ne=L("CloudUploadIcon",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const We=L("SendIcon",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ge=L("TerminalIcon",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]),Oe=de({__name:"BorderProgressBar",props:{progress:{}},setup($){const M=$,j=I(null),o=I(null);let u=null;const w=()=>{if(!u||!o.value||!j.value)return;const g=j.value.clientWidth,f=j.value.clientHeight;o.value.width=g,o.value.height=f;const d=4,l=8;u.lineWidth=d;const v=u.createLinearGradient(0,0,g,f);v.addColorStop(0,"#4f46e5"),v.addColorStop(.5,"#7c3aed"),v.addColorStop(1,"#db2777"),u.strokeStyle="rgba(229, 231, 235, 0.2)",k(u,d/2,d/2,g-d,f-d,l),u.stroke();const b=((g+f)*2-8*l+2*Math.PI*l)*M.progress/100;u.strokeStyle=v,u.lineCap="round",u.lineJoin="round",u.beginPath();let c=b;const m=d/2,z=g-d,D=f-d;if(c>0){const p=Math.min(z-2*l,c);u.moveTo(l+m,m),u.lineTo(p+l+m,m),c-=p}if(c>0){const p=Math.min(Math.PI/2,c/l);u.arc(z-l+m,l+m,l,-Math.PI/2,p-Math.PI/2,!1),c-=p*l}if(c>0){const p=Math.min(D-2*l,c);u.lineTo(z+m,p+l+m),c-=p}if(c>0){const p=Math.min(Math.PI/2,c/l);u.arc(z-l+m,D-l+m,l,0,p,!1),c-=p*l}if(c>0){const p=Math.min(z-2*l,c);u.lineTo(z-p-l+m,D+m),c-=p}if(c>0){const p=Math.min(Math.PI/2,c/l);u.arc(l+m,D-l+m,l,Math.PI/2,Math.PI/2+p,!1),c-=p*l}if(c>0){const p=Math.min(D-2*l,c);u.lineTo(m,D-p-l+m),c-=p}if(c>0){const p=Math.min(Math.PI/2,c/l);u.arc(l+m,l+m,l,Math.PI,Math.PI+p,!1)}u.stroke()};function k(g,f,d,l,v,y){g.beginPath(),g.moveTo(f+y,d),g.lineTo(f+l-y,d),g.arcTo(f+l,d,f+l,d+y,y),g.lineTo(f+l,d+v-y),g.arcTo(f+l,d+v,f+l-y,d+v,y),g.lineTo(f+y,d+v),g.arcTo(f,d+v,f,d+v-y,y),g.lineTo(f,d+y),g.arcTo(f,d,f+y,d,y),g.closePath()}return ue(()=>{o.value&&(u=o.value.getContext("2d"),w())}),Te(()=>M.progress,w),(g,f)=>(C(),_("div",{class:"border-progress-container",ref_key:"container",ref:j},[e("canvas",{ref_key:"canvas",ref:o,class:"border-progress-canvas"},null,512)],512))}}),Qe=ge(Oe,[["__scopeId","data-v-2fbf5085"]]),ce=$=>$>=1024*1024*1024?Math.round($/(1024*1024*1024))+"GB":$>=1024*1024?Math.round($/(1024*1024))+"MB":Math.round($/1024)+"KB",Je={class:"p-8"},Ke={class:"flex justify-center space-x-4 mb-6"},Xe={key:"file",class:"grid grid-cols-1 gap-8"},Ye={key:0,class:"absolute inset-0 w-full h-full"},Ze={class:"block truncate"},et={key:"text",class:"grid grid-cols-1 gap-8"},tt={key:0,class:"flex flex-col"},rt={class:"flex flex-col space-y-3"},ot={class:"relative flex-grow group"},st=["placeholder"],at=["value"],nt={type:"submit",class:"w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-4 px-6 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition-all duration-300 transform hover:scale-105 hover:shadow-lg relative overflow-hidden group"},lt={class:"relative z-10 flex items-center justify-center text-lg"},it={class:"mt-6 text-center"},ct={class:"flex-grow overflow-y-auto p-6"},dt={class:"flex-shrink-0 mr-4"},ut={class:"flex-grow min-w-0 mr-4"},gt={class:"flex-shrink-0 flex space-x-2"},pt=["onClick"],ht=["onClick"],ft=["onClick"],xt={key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-3 sm:p-4 overflow-y-auto"},mt={class:"flex items-center justify-between"},vt={class:"p-4 sm:p-6"},yt={class:"flex items-center mb-3 sm:mb-4"},bt={class:"ml-3 sm:ml-4 min-w-0 flex-1"},wt={class:"grid grid-cols-2 gap-3 sm:gap-4"},kt={class:"flex items-center min-w-0"},_t={class:"flex items-center min-w-0"},Ct={class:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6"},St={class:"space-y-3 sm:space-y-4"},Mt={class:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl p-4 sm:p-5 text-white"},zt={class:"flex items-center justify-between mb-3 sm:mb-4"},Tt={class:"text-2xl sm:text-3xl font-bold tracking-wider text-center break-all"},It={class:"flex items-center justify-between mb-2 sm:mb-3"},At={class:"bg-white p-3 sm:p-4 rounded-lg shadow-sm mb-3 sm:mb-4"},$t=de({__name:"SendFileView",setup($){const M=JSON.parse(localStorage.getItem("config")||"{}"),j=je(),o=$e("isDarkMode"),u=Be(),w=I("file"),k=I(null),g=I(""),f=I(null),d=I("day"),l=I("1"),v=I(0),y=I(!1),b=I(null),c=Ie(),m=Ae(()=>u.shareData),z=I(""),D=()=>{var a;(a=f.value)==null||a.click()},p=async a=>{const t=a.target;if(t.files&&t.files.length>0){const i=t.files[0];if(k.value=i,!W())return;z.value=await N(i),console.log(z.value)}},pe=async a=>{var t;if((t=a.dataTransfer)!=null&&t.files&&a.dataTransfer.files.length>0){const i=a.dataTransfer.files[0];if(k.value=i,!W())return;z.value=await N(i)}},he=async a=>{var i;const t=(i=a.clipboardData)==null?void 0:i.items;if(t)for(const s of t)if(s.kind==="file"){const h=s.getAsFile();if(h){if(h.size===0){c.showAlert("无法读取空文件","error");return}if(h.type.startsWith("image/")){if(k.value=h,!W())return;try{z.value=await N(h),c.showAlert("已从剪贴板添加图片:"+h.name,"success")}catch(S){c.showAlert("文件处理失败","error"),console.error("File hash calculation failed:",S)}}else c.showAlert("目前仅支持粘贴图片文件","warning");break}}else w.value="text",t[0].getAsString(h=>{g.value+=h})},N=async a=>new Promise(t=>{const s=new FileReader;let h=0;const S=Math.ceil(a.size/2097152);s.onload=async F=>{const A=new Uint8Array(F.target.result);try{if(window.isSecureContext){const P=await crypto.subtle.digest("SHA-256",A),G=Array.from(new Uint8Array(P)).map(q=>q.toString(16).padStart(2,"0")).join("");h++,h<S?B():t(G)}else{const P=Z(a);t(P)}}catch{const H=Z(a);t(H)}};const B=()=>{const F=h*2097152,A=F+2097152>=a.size?a.size:F+2097152;s.readAsArrayBuffer(a.slice(F,A))};B()}),Z=a=>{const t=`${a.name}-${a.size}-${a.lastModified}`;let i=0;for(let s=0;s<t.length;s++){const h=t.charCodeAt(s);i=(i<<5)-i+h,i=i&i}return Math.abs(i).toString(16).padStart(64,"0")},fe=(a=d.value)=>{switch(a){case"day":return"输入天数";case"hour":return"输入小时数";case"minute":return"输入分钟数";case"count":return"输入查看次数";case"forever":return"永久";default:return"输入值"}},ee=(a=d.value)=>{switch(a){case"day":return"天";case"hour":return"小时";case"minute":return"分钟";case"count":return"次";case"forever":return"永久";default:return""}},xe=async a=>{var t,i;try{const h=Math.ceil(a.size/5242880),S=await V.post("chunk/upload/init/",{file_name:a.name,file_size:a.size,chunk_size:5242880,file_hash:z.value});if(S.code!==200)throw new Error("初始化切片上传失败");if(S.detail.existed)return S;const B=S.detail.upload_id;for(let A=0;A<h;A++){const P=A*5242880,H=Math.min(P+5242880,a.size),G=a.slice(P,H),q=new FormData;if(q.append("chunk",new Blob([G],{type:a.type})),(await V.post(`chunk/upload/chunk/${B}/${A}`,q,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:Me=>{const ze=Math.round((A*5242880+Me.loaded)*100/a.size);v.value=ze}})).code!==200)throw new Error(`切片 ${A} 上传失败`)}const F=await V.post(`chunk/upload/complete/${B}`,{expire_value:l.value?parseInt(l.value):1,expire_style:d.value});if(F.code!==200)throw new Error("完成上传失败");return F}catch(s){throw console.error("切片上传失败:",s),(i=(t=s.response)==null?void 0:t.data)!=null&&i.detail?c.showAlert(s.response.data.detail,"error"):c.showAlert("上传失败,请稍后重试","error"),s}},me=async a=>{const t=new FormData,i={headers:{"Content-Type":"multipart/form-data"},onUploadProgress:h=>{const S=Math.round(h.loaded*100/h.total);v.value=S}};return t.append("file",a),t.append("expire_value",l.value),t.append("expire_style",d.value),await V.post("share/file/",t,i)},ve=()=>M.openUpload===0&&localStorage.getItem("token")===null?(c.showAlert("游客上传功能已关闭","error"),!1):!0,ye=a=>a.size>M.uploadSize?(c.showAlert(`文件大小超过限制 (${ce(M.uploadSize)})`,"error"),k.value=null,!1):!0,te=(a,t)=>{if(a==="forever"||a==="count")return!0;const i=M.max_save_seconds||0;if(i===0)return!0;let s=0;switch(a){case"minute":s=parseInt(t)*60;break;case"hour":s=parseInt(t)*3600;break;case"day":s=parseInt(t)*86400;break;default:return!1}return s<=i},W=()=>!(!ve()||!ye(k.value)||!te(d.value,l.value)),be=async()=>{var a,t;if(w.value==="file"&&!k.value){c.showAlert("请选择要上传的文件","error");return}if(w.value==="text"&&!g.value.trim()){c.showAlert("请输入要发送的文本","error");return}if(d.value!=="forever"&&!l.value){c.showAlert("请输入过期值","error");return}if(!te(d.value,l.value)){const i=Math.floor(M.max_save_seconds/86400);c.showAlert(`过期时间不能超过${i}`,"error");return}try{let i;if(w.value==="file")M.enableChunk?i=await xe(k.value):i=await me(k.value);else{const s=new FormData;s.append("text",g.value),s.append("expire_value",l.value),s.append("expire_style",d.value),i=await V.post("share/text/",s,{headers:{"Content-Type":"multipart/form-data"}})}if(i&&i.code===200){const s=i.detail.code,h=i.detail.name,S={id:Date.now(),filename:h,date:new Date().toISOString().split("T")[0],size:w.value==="text"?`${(g.value.length/1024).toFixed(2)} KB`:`${(k.value.size/(1024*1024)).toFixed(1)} MB`,expiration:d.value==="forever"?"永久":`${l.value}${ee()}后过期`,retrieveCode:s};u.addShareData(S),c.showAlert(`文件发送成功取件码${s}`,"success"),k.value=null,g.value="",v.value=0,b.value=S,await X(s)}else throw new Error("服务器响应异常")}catch(i){console.error("发送失败:",i),(t=(a=i.response)==null?void 0:a.data)!=null&&t.detail?c.showAlert(i.response.data.detail,"error"):c.showAlert("发送失败,请稍后重试","error")}finally{v.value=0}},we=()=>{j.push("/")},re=()=>{y.value=!y.value},ke=a=>{b.value=a},_e=a=>{const t=u.shareData.findIndex(i=>i.id===a);t!==-1&&u.deleteShareData(t)},Ce=window.location.origin+"/#/",Se=a=>`${Ce}?code=${a.retrieveCode}`,oe=a=>{const i=(parseInt(l.value)||0)+a;i>=1&&(l.value=i.toString())};return ue(()=>{console.log("SendFileView mounted")}),(a,t)=>{const i=Fe("router-link");return C(),_("div",{class:"min-h-screen flex items-center justify-center p-4 overflow-hidden transition-colors duration-300",onPaste:E(he,["prevent"])},[e("div",{class:n(["rounded-3xl shadow-2xl overflow-hidden border w-full max-w-md transition-colors duration-300",[r(o)?"bg-white bg-opacity-10 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200"]])},[e("div",Je,[e("h2",{class:n(["text-3xl font-extrabold text-center mb-8 cursor-pointer transition-colors duration-300",[r(o)?"text-transparent bg-clip-text bg-gradient-to-r from-indigo-300 via-purple-300 to-pink-300":"text-indigo-600"]]),onClick:we},T(r(M).name),3),e("form",{onSubmit:E(be,["prevent"]),class:"space-y-8"},[e("div",Ke,[e("button",{type:"button",onClick:t[0]||(t[0]=s=>w.value="file"),class:n(["px-4 py-2 rounded-lg",w.value==="file"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300"])}," 发送文件 ",2),e("button",{type:"button",onClick:t[1]||(t[1]=s=>w.value="text"),class:n(["px-4 py-2 rounded-lg",w.value==="text"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300"])}," 发送文本 ",2)]),x(Q,{name:"fade",mode:"out-in"},{default:U(()=>[w.value==="file"?(C(),_("div",Xe,[e("div",{class:n(["rounded-xl p-8 flex flex-col items-center justify-center border-2 border-dashed transition-all duration-300 group cursor-pointer relative",[r(o)?"bg-gray-800 bg-opacity-50 border-gray-600 hover:border-indigo-500":"bg-gray-100 border-gray-300 hover:border-indigo-500"]]),onClick:D,onDragover:t[2]||(t[2]=E(()=>{},["prevent"])),onDrop:E(pe,["prevent"])},[e("input",{id:"file-upload",type:"file",class:"hidden",onChange:p,ref_key:"fileInput",ref:f},null,544),v.value>0?(C(),_("div",Ye,[x(Qe,{progress:v.value},null,8,["progress"])])):R("",!0),x(r(Ne),{class:n(["w-16 h-16 transition-colors duration-300",r(o)?"text-gray-400 group-hover:text-indigo-400":"text-gray-600 group-hover:text-indigo-600"])},null,8,["class"]),e("p",{class:n(["mt-4 text-sm transition-colors duration-300 w-full text-center",r(o)?"text-gray-400 group-hover:text-indigo-400":"text-gray-600 group-hover:text-indigo-600"])},[e("span",Ze,T(k.value?k.value.name:"点击或拖放文件到此处上传"),1)],2),e("p",{class:n(["mt-2 text-xs",r(o)?"text-gray-500":"text-gray-400"])}," 支持各种常见格式,最大"+T(r(ce)(r(M).uploadSize)),3)],34)])):(C(),_("div",et,[w.value==="text"?(C(),_("div",tt,[O(e("textarea",{id:"text-content","onUpdate:modelValue":t[3]||(t[3]=s=>g.value=s),rows:"7",class:n(["flex-grow px-4 py-3 rounded-xl placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 resize-none",r(o)?"bg-gray-800 bg-opacity-50 text-white":"bg-white text-gray-900 border border-gray-300"]),placeholder:"在此输入要发送的文本..."},null,2),[[se,g.value]])])):R("",!0)]))]),_:1}),e("div",rt,[e("label",{class:n(["text-sm font-medium",r(o)?"text-gray-300":"text-gray-700"])}," 过期时间 ",2),e("div",ot,[e("div",{class:n(["relative h-11 rounded-xl border transition-all duration-300",r(o)?"bg-gray-800/50 border-gray-700/50 group-hover:border-gray-600":"bg-white border-gray-200 group-hover:border-gray-300"])},[d.value!=="forever"?(C(),_(J,{key:0},[O(e("input",{"onUpdate:modelValue":t[4]||(t[4]=s=>l.value=s),type:"number",placeholder:fe(),min:"1",class:n(["w-full h-full px-4 pr-32 rounded-xl placeholder-gray-400 transition-all duration-300","focus:outline-none focus:ring-2 focus:ring-offset-0","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none","bg-transparent",r(o)?"text-gray-100 focus:ring-indigo-500/70 placeholder-gray-500":"text-gray-900 focus:ring-indigo-500/50 placeholder-gray-400"])},null,10,st),[[se,l.value]]),e("div",{class:n(["absolute right-24 top-0 h-full flex flex-col border-l",[r(o)?"border-gray-700/50":"border-gray-200"]])},[e("button",{type:"button",onClick:t[5]||(t[5]=s=>oe(1)),class:n(["flex-1 px-2 flex items-center justify-center transition-all duration-200",[r(o)?"hover:bg-gray-700/50 text-gray-400 hover:text-gray-200":"hover:bg-gray-50 text-gray-500 hover:text-gray-700"]])},t[12]||(t[12]=[e("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"})],-1)]),2),e("button",{type:"button",onClick:t[6]||(t[6]=s=>oe(-1)),class:n(["flex-1 px-2 flex items-center justify-center transition-all duration-200",[r(o)?"hover:bg-gray-700/50 text-gray-400 hover:text-gray-200":"hover:bg-gray-50 text-gray-500 hover:text-gray-700"]])},t[13]||(t[13]=[e("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)]),2)],2)],64)):R("",!0),O(e("select",{"onUpdate:modelValue":t[7]||(t[7]=s=>d.value=s),class:n(["absolute right-0 top-0 h-full appearance-none cursor-pointer","focus:outline-none focus:ring-2 focus:ring-offset-0",d.value==="forever"?"w-full px-4":"w-24 pl-3 pr-8 border-l",r(o)?"text-gray-100 border-gray-700/50 focus:ring-indigo-500/70 bg-gray-800/50":"text-gray-900 border-gray-200 focus:ring-indigo-500/50 bg-white"])},[(C(!0),_(J,null,ae(r(M).expireStyle,s=>(C(),_("option",{value:s,key:s,class:n([r(o)?"bg-gray-800 text-gray-100":"bg-white text-gray-900"])},T(ee(s)),11,at))),128))],2),[[De,d.value]]),e("div",{class:n(["absolute pointer-events-none",[d.value==="forever"?"right-3":"right-2","top-1/2 -translate-y-1/2"]])},[(C(),_("svg",{class:n(["w-4 h-4 transition-colors duration-300",[r(o)?"text-gray-400":"text-gray-500"]]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},t[14]||(t[14]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))],2)],2)])]),e("button",nt,[t[16]||(t[16]=e("span",{class:"absolute top-0 left-0 w-full h-full bg-white opacity-0 group-hover:opacity-20 transition-opacity duration-300"},null,-1)),e("span",lt,[x(r(We),{class:"w-6 h-6 mr-2"}),t[15]||(t[15]=e("span",null,"安全寄送",-1))])])],32),e("div",it,[x(i,{to:"/",class:"text-indigo-400 hover:text-indigo-300 transition duration-300"},{default:U(()=>t[17]||(t[17]=[K(" 需要取件?点击这里 ")])),_:1})])]),e("div",{class:n(["px-8 py-4 bg-opacity-50 flex justify-between items-center",[r(o)?"bg-gray-800":"bg-gray-100"]])},[e("span",{class:n(["text-sm flex items-center",[r(o)?"text-gray-300":"text-gray-800"]])},[x(r(le),{class:"w-4 h-4 mr-1 text-green-400"}),t[18]||(t[18]=K(" 安全加密 "))],2),e("button",{onClick:re,class:n(["text-sm hover:text-indigo-300 transition duration-300 flex items-center",[r(o)?"text-indigo-400":"text-indigo-600"]])},[t[19]||(t[19]=K(" 发件记录 ")),x(r(Ue),{class:"w-4 h-4 ml-1"})],2)],2)],2),x(Q,{name:"drawer"},{default:U(()=>[y.value?(C(),_("div",{key:0,class:n(["fixed inset-y-0 right-0 w-full sm:w-120 bg-opacity-70 backdrop-filter backdrop-blur-xl shadow-2xl z-50 overflow-hidden flex flex-col",[r(o)?"bg-gray-900":"bg-white"]])},[e("div",{class:n(["flex justify-between items-center p-6 border-b",[r(o)?"border-gray-700":"border-gray-200"]])},[e("h3",{class:n(["text-2xl font-bold",[r(o)?"text-white":"text-gray-800"]])}," 发件记录 ",2),e("button",{onClick:re,class:n(["hover:text-white transition duration-300",[r(o)?"text-gray-400":"text-gray-800"]])},[x(r(ne),{class:"w-6 h-6"})],2)],2),e("div",ct,[x(Pe,{name:"list",tag:"div",class:"space-y-4"},{default:U(()=>[(C(!0),_(J,null,ae(m.value,s=>(C(),_("div",{key:s.id,class:n(["bg-opacity-50 rounded-lg p-4 flex items-center shadow-md hover:shadow-lg transition duration-300 transform hover:scale-102",[r(o)?"bg-gray-800 hover:bg-gray-700":"bg-gray-100 hover:bg-white"]])},[e("div",dt,[x(r(ie),{class:n(["w-10 h-10",[r(o)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])]),e("div",ut,[e("p",{class:n(["font-medium text-lg truncate",[r(o)?"text-white":"text-gray-800"]])},T(s.filename?s.filename:"Text"),3),e("p",{class:n(["text-sm truncate",[r(o)?"text-gray-400":"text-gray-600"]])},T(s.date)+" · "+T(s.size),3)]),e("div",gt,[e("button",{onClick:h=>r(X)(s.retrieveCode),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[r(o)?"hover:bg-blue-400 text-blue-400":"hover:bg-blue-100 text-blue-600"]])},[x(r(Y),{class:"w-5 h-5"})],10,pt),e("button",{onClick:h=>ke(s),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[r(o)?"hover:bg-green-400 text-green-400":"hover:bg-green-100 text-green-600"]])},[x(r(He),{class:"w-5 h-5"})],10,ht),e("button",{onClick:h=>_e(s.id),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[r(o)?"hover:bg-red-400 text-red-400":"hover:bg-red-100 text-red-600"]])},[x(r(qe),{class:"w-5 h-5"})],10,ft)])],2))),128))]),_:1})])],2)):R("",!0)]),_:1}),x(Q,{name:"fade"},{default:U(()=>[b.value?(C(),_("div",xt,[e("div",{class:n(["w-full max-w-2xl rounded-2xl shadow-2xl transform transition-all duration-300 ease-out overflow-hidden",[r(o)?"bg-gray-900 bg-opacity-70":"bg-white bg-opacity-95"]])},[e("div",{class:n(["px-4 sm:px-6 py-3 sm:py-4 border-b",[r(o)?"border-gray-800":"border-gray-100"]])},[e("div",mt,[e("h3",{class:n(["text-lg sm:text-xl font-semibold",[r(o)?"text-white":"text-gray-900"]])}," 文件详情 ",2),e("button",{onClick:t[8]||(t[8]=s=>b.value=null),class:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"},[x(r(ne),{class:n(["w-4 h-4 sm:w-5 sm:h-5",[r(o)?"text-gray-400":"text-gray-500"]])},null,8,["class"])])])],2),e("div",vt,[e("div",{class:n(["rounded-xl p-3 sm:p-4 mb-4 sm:mb-6",[r(o)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[e("div",yt,[e("div",{class:n(["p-2 sm:p-3 rounded-lg",[r(o)?"bg-gray-800":"bg-white"]])},[x(r(ie),{class:n(["w-5 h-5 sm:w-6 sm:h-6",[r(o)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2),e("div",bt,[e("h4",{class:n(["font-medium text-sm sm:text-base truncate",[r(o)?"text-white":"text-gray-900"]])},T(b.value.filename),3),e("p",{class:n(["text-xs sm:text-sm truncate",[r(o)?"text-gray-400":"text-gray-500"]])},T(b.value.size)+" · "+T(b.value.date),3)])]),e("div",wt,[e("div",kt,[x(r(Ee),{class:n(["w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1.5 sm:mr-2 flex-shrink-0",[r(o)?"text-gray-400":"text-gray-500"]])},null,8,["class"]),e("span",{class:n(["text-xs sm:text-sm truncate",[r(o)?"text-gray-300":"text-gray-600"]])},T(b.value.expiration),3)]),e("div",_t,[x(r(le),{class:n(["w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1.5 sm:mr-2 flex-shrink-0",[r(o)?"text-gray-400":"text-gray-500"]])},null,8,["class"]),e("span",{class:n(["text-xs sm:text-sm truncate",[r(o)?"text-gray-300":"text-gray-600"]])}," 安全加密 ",2)])])],2),e("div",Ct,[e("div",St,[e("div",Mt,[e("div",zt,[t[20]||(t[20]=e("h4",{class:"font-medium text-sm sm:text-base"},"取件码",-1)),e("button",{onClick:t[9]||(t[9]=s=>r(Re)(b.value.retrieveCode)),class:"p-1.5 sm:p-2 rounded-full hover:bg-white/10 transition-colors"},[x(r(Y),{class:"w-4 h-4 sm:w-5 sm:h-5"})])]),e("p",Tt,T(b.value.retrieveCode),1)]),e("div",{class:n(["rounded-xl p-3 sm:p-4",[r(o)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[e("div",It,[e("h4",{class:n(["font-medium text-sm sm:text-base flex items-center min-w-0",[r(o)?"text-white":"text-gray-900"]])},[x(r(Ge),{class:"w-4 h-4 sm:w-5 sm:h-5 mr-1.5 sm:mr-2 text-indigo-500 flex-shrink-0"}),t[21]||(t[21]=e("span",{class:"truncate"},"wget下载",-1))],2),e("button",{onClick:t[10]||(t[10]=s=>r(Ve)(b.value.retrieveCode)),class:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors flex-shrink-0"},[x(r(Y),{class:n(["w-4 h-4 sm:w-5 sm:h-5",[r(o)?"text-gray-400":"text-gray-500"]])},null,8,["class"])])]),e("p",{class:n(["text-xs sm:text-sm font-mono break-all line-clamp-2",[r(o)?"text-gray-300":"text-gray-600"]])}," 点击复制wget命令 ",2)],2)]),e("div",{class:n(["rounded-xl p-4 sm:p-5 flex flex-col items-center",[r(o)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[e("div",At,[x(Le,{value:Se(b.value),size:140,level:"M",class:"sm:w-[160px] sm:h-[160px]"},null,8,["value"])]),e("p",{class:n(["text-xs sm:text-sm truncate max-w-full",[r(o)?"text-gray-400":"text-gray-500"]])}," 扫描二维码快速取件 ",2)],2)])]),e("div",{class:n(["px-4 sm:px-6 py-3 sm:py-4 border-t",[r(o)?"border-gray-800":"border-gray-100"]])},[e("button",{onClick:t[11]||(t[11]=s=>r(X)(b.value.retrieveCode)),class:"w-full bg-indigo-600 hover:bg-indigo-700 text-white px-4 sm:px-6 py-2 sm:py-3 rounded-lg text-sm sm:text-base font-medium transition-colors"}," 复制取件链接 ")],2)],2)])):R("",!0)]),_:1})],32)}}}),Ut=ge($t,[["__scopeId","data-v-aaf18f62"]]);export{Ut as default};