From ec76adf27c6eb4dca753cdf9f95b65a849837cf0 Mon Sep 17 00:00:00 2001 From: G Zhang <34325298+GaoshuoZhang@users.noreply.github.com> Date: Mon, 6 Oct 2025 12:38:42 +0800 Subject: [PATCH] Update SendFileView-0AP69Sbg.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 设置上传至本地时axios请求超时时间,解决30秒上传失败问题。 --- themes/2024/assets/SendFileView-0AP69Sbg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/2024/assets/SendFileView-0AP69Sbg.js b/themes/2024/assets/SendFileView-0AP69Sbg.js index af389b62..911ad05c 100644 --- a/themes/2024/assets/SendFileView-0AP69Sbg.js +++ b/themes/2024/assets/SendFileView-0AP69Sbg.js @@ -23,4 +23,4 @@ import{c as N,d as ge,r as I,o as pe,w as $e,a as M,b as t,e as z,_ as he,u as D * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Oe=N("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),Qe=ge({__name:"BorderProgressBar",props:{progress:{}},setup(P){const T=P,U=I(null),s=I(null);let g=null;const S=()=>{if(!g||!s.value||!U.value)return;const u=U.value.clientWidth,f=U.value.clientHeight;s.value.width=u,s.value.height=f;const c=4,l=8;g.lineWidth=c;const y=g.createLinearGradient(0,0,u,f);y.addColorStop(0,"#4f46e5"),y.addColorStop(.5,"#7c3aed"),y.addColorStop(1,"#db2777"),g.strokeStyle="rgba(229, 231, 235, 0.2)",C(g,c/2,c/2,u-c,f-c,l),g.stroke();const k=((u+f)*2-8*l+2*Math.PI*l)*T.progress/100;g.strokeStyle=y,g.lineCap="round",g.lineJoin="round",g.beginPath();let d=k;const x=c/2,$=u-c,j=f-c;if(d>0){const p=Math.min($-2*l,d);g.moveTo(l+x,x),g.lineTo(p+l+x,x),d-=p}if(d>0){const p=Math.min(Math.PI/2,d/l);g.arc($-l+x,l+x,l,-Math.PI/2,p-Math.PI/2,!1),d-=p*l}if(d>0){const p=Math.min(j-2*l,d);g.lineTo($+x,p+l+x),d-=p}if(d>0){const p=Math.min(Math.PI/2,d/l);g.arc($-l+x,j-l+x,l,0,p,!1),d-=p*l}if(d>0){const p=Math.min($-2*l,d);g.lineTo($-p-l+x,j+x),d-=p}if(d>0){const p=Math.min(Math.PI/2,d/l);g.arc(l+x,j-l+x,l,Math.PI/2,Math.PI/2+p,!1),d-=p*l}if(d>0){const p=Math.min(j-2*l,d);g.lineTo(x,j-p-l+x),d-=p}if(d>0){const p=Math.min(Math.PI/2,d/l);g.arc(l+x,l+x,l,Math.PI,Math.PI+p,!1)}g.stroke()};function C(u,f,c,l,y,b){u.beginPath(),u.moveTo(f+b,c),u.lineTo(f+l-b,c),u.arcTo(f+l,c,f+l,c+b,b),u.lineTo(f+l,c+y-b),u.arcTo(f+l,c+y,f+l-b,c+y,b),u.lineTo(f+b,c+y),u.arcTo(f,c+y,f,c+y-b,b),u.lineTo(f,c+b),u.arcTo(f,c,f+b,c,b),u.closePath()}return pe(()=>{s.value&&(g=s.value.getContext("2d"),S())}),$e(()=>T.progress,S),(u,f)=>(z(),M("div",{class:"border-progress-container",ref_key:"container",ref:U},[t("canvas",{ref_key:"canvas",ref:s,class:"border-progress-canvas"},null,512)],512))}}),Je=he(Qe,[["__scopeId","data-v-2fbf5085"]]),ue=P=>P>=1024*1024*1024?Math.round(P/(1024*1024*1024))+"GB":P>=1024*1024?Math.round(P/(1024*1024))+"MB":Math.round(P/1024)+"KB",Ke={class:"p-8"},Xe={class:"flex justify-center space-x-4 mb-6"},Ye={key:"file",class:"grid grid-cols-1 gap-8"},Ze={key:0,class:"absolute inset-0 w-full h-full"},et={class:"block truncate"},tt={key:"text",class:"grid grid-cols-1 gap-8"},rt={key:0,class:"flex flex-col"},ot={class:"flex flex-col space-y-3"},st={class:"relative flex-grow group"},at=["placeholder"],nt=["value"],lt={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"},it={class:"relative z-10 flex items-center justify-center text-lg"},ct={class:"mt-6 text-center"},dt={class:"flex-grow overflow-y-auto p-6"},ut={class:"flex-shrink-0 mr-4"},gt={class:"flex-grow min-w-0 mr-4"},pt={class:"flex-shrink-0 flex space-x-2"},ht=["onClick"],ft=["onClick"],mt=["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"},vt={class:"flex items-center justify-between"},yt={class:"p-4 sm:p-6"},bt={class:"flex items-center mb-3 sm:mb-4"},wt={class:"ml-3 sm:ml-4 min-w-0 flex-1"},kt={class:"grid grid-cols-2 gap-3 sm:gap-4"},_t={class:"flex items-center min-w-0"},St={class:"flex items-center min-w-0"},Ct={class:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6"},Mt={class:"space-y-3 sm:space-y-4"},zt={class:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl p-4 sm:p-5 text-white"},Tt={class:"flex items-center justify-between mb-3 sm:mb-4"},$t={class:"text-2xl sm:text-3xl font-bold tracking-wider text-center break-all"},Dt={class:"flex items-center justify-between mb-2 sm:mb-3"},It={class:"bg-white p-3 sm:p-4 rounded-lg shadow-sm mb-3 sm:mb-4"},At=ge({__name:"SendFileView",setup(P){const T=JSON.parse(localStorage.getItem("config")||"{}"),U=Be(),s=Ae("isDarkMode"),g=Re(),S=I("file"),C=I(null),u=I(""),f=I(null),c=I(T.expireStyle?.[0]||"day"),l=I("1"),y=I(0),b=I(!1),k=I(null),d=De(),x=Ie(()=>g.shareData),$=I(""),j=()=>{f.value?.click()},p=async o=>{const e=o.target;if(e.files&&e.files.length>0){const i=e.files[0];if(C.value=i,!O())return;$.value=await G(i),console.log($.value)}},fe=async o=>{if(o.dataTransfer?.files&&o.dataTransfer.files.length>0){const e=o.dataTransfer.files[0];if(C.value=e,!O())return;$.value=await G(e)}},me=async o=>{const e=o.clipboardData?.items;if(e)for(let i=0;i{const w=h.trim();if(!w)return;const v=document.getElementById("text-content");if(!v){u.value+=w;return}const _=v.selectionStart,F=v.selectionEnd;if(_!==F){const A=u.value.substring(0,_),V=u.value.substring(F);u.value=A+w+V,setTimeout(()=>{const R=_+w.length;v.setSelectionRange(R,R),v.focus()},0)}else{const A=_,V=u.value.substring(0,A),R=u.value.substring(A);u.value=V+w+R,setTimeout(()=>{const W=A+w.length;v.setSelectionRange(W,W),v.focus()},0)}})}},G=async o=>new Promise(e=>{const a=new FileReader;let h=0;const w=Math.ceil(o.size/2097152);a.onload=async _=>{const F=new Uint8Array(_.target.result);try{if(window.isSecureContext){const B=await crypto.subtle.digest("SHA-256",F),V=Array.from(new Uint8Array(B)).map(R=>R.toString(16).padStart(2,"0")).join("");h++,h{const _=h*2097152,F=_+2097152>=o.size?o.size:_+2097152;a.readAsArrayBuffer(o.slice(_,F))};v()}),ee=o=>{const e=`${o.name}-${o.size}-${o.lastModified}`;let i=0;for(let a=0;a{switch(o){case"day":return"输入天数";case"hour":return"输入小时数";case"minute":return"输入分钟数";case"count":return"输入查看次数";case"forever":return"永久";default:return"输入值"}},te=(o=c.value)=>{switch(o){case"day":return"天";case"hour":return"小时";case"minute":return"分钟";case"count":return"次";case"forever":return"永久";default:return""}},ve=(o,e)=>{if(o==="forever")return"永久";if(o==="count")return`${e}次后过期`;const i=new Date,a=parseInt(e);switch(o){case"minute":i.setMinutes(i.getMinutes()+a);break;case"hour":i.setHours(i.getHours()+a);break;case"day":i.setDate(i.getDate()+a);break;default:return`${e}${te(o)}后过期`}const h=i.getFullYear(),w=(i.getMonth()+1).toString().padStart(2,"0"),v=i.getDate().toString().padStart(2,"0"),_=i.getHours().toString().padStart(2,"0"),F=i.getMinutes().toString().padStart(2,"0");return`${h}-${w}-${v} ${_}:${F}过期`},ye=async o=>{try{const i=Math.ceil(o.size/5242880),a=await L.post("chunk/upload/init/",{file_name:o.name,file_size:o.size,chunk_size:5242880,file_hash:$.value});if(a.code!==200)throw new Error("初始化切片上传失败");if(a.detail?.existed)return a;const h=a.detail?.upload_id;for(let v=0;v{const W=Math.round((v*5242880+R.loaded)*100/o.size);y.value=W}})).code!==200)throw new Error(`切片 ${v} 上传失败`)}const w=await L.post(`chunk/upload/complete/${h}`,{expire_value:l.value?parseInt(l.value):1,expire_style:c.value});if(w.code!==200)throw new Error("完成上传失败");return w}catch(e){if(console.error("切片上传失败:",e),e&&typeof e=="object"&&"response"in e){const i=e;i.response?.data?.detail&&d.showAlert(i.response.data.detail,"error")}else d.showAlert("上传失败,请稍后重试","error");throw e}},be=async o=>{const e=new FormData,i={headers:{"Content-Type":"multipart/form-data"},onUploadProgress:h=>{const w=Math.round(h.loaded*100/(h.total||1));y.value=w}};return e.append("file",o),e.append("expire_value",l.value),e.append("expire_style",c.value),await L.post("share/file/",e,i)},we=()=>T.openUpload===0&&localStorage.getItem("token")===null?(d.showAlert("游客上传功能已关闭","error"),!1):!0,ke=o=>o.size>T.uploadSize?(d.showAlert(`文件大小超过限制 (${ue(T.uploadSize)})`,"error"),C.value=null,!1):!0,re=(o,e)=>{if(o==="forever"||o==="count")return!0;const i=T.max_save_seconds||0;if(i===0)return!0;let a=0;switch(o){case"minute":a=parseInt(e)*60;break;case"hour":a=parseInt(e)*3600;break;case"day":a=parseInt(e)*86400;break;default:return!1}return a<=i},O=()=>!(!we()||!ke(C.value)||!re(c.value,l.value)),_e=async()=>{if(S.value==="file"&&!C.value){d.showAlert("请选择要上传的文件","error");return}if(S.value==="text"&&!u.value.trim()){d.showAlert("请输入要发送的文本","error");return}if(c.value!=="forever"&&!l.value){d.showAlert("请输入过期值","error");return}if(!re(c.value,l.value)){const o=Math.floor(T.max_save_seconds/86400);d.showAlert(`过期时间不能超过${o}天`,"error");return}try{let o;if(S.value==="file")T.enableChunk?o=await ye(C.value):o=await be(C.value);else{const e=new FormData;e.append("text",u.value),e.append("expire_value",l.value),e.append("expire_style",c.value),o=await L.post("share/text/",e,{headers:{"Content-Type":"multipart/form-data"}})}if(o&&o.code===200){const e=o.detail?.code||"",i=o.detail?.name||"",a={id:Date.now(),filename:i,date:new Date().toISOString().split("T")[0],size:S.value==="text"?`${(u.value.length/1024).toFixed(2)} KB`:`${(C.value.size/(1024*1024)).toFixed(1)} MB`,expiration:c.value==="forever"?"永久":ve(c.value,l.value),retrieveCode:e};g.addShareDataRecord(a),d.showAlert(`文件发送成功!取件码:${e}`,"success"),C.value=null,u.value="",y.value=0,k.value=a,await Y(e)}else throw new Error("服务器响应异常")}catch(o){if(o&&typeof o=="object"&&"response"in o){const e=o;e.response?.data?.detail&&d.showAlert(e.response.data.detail,"error")}else d.showAlert("发送失败,请稍后重试","error")}finally{y.value=0}},Se=()=>{U.push("/")},oe=()=>{b.value=!b.value},Ce=o=>{k.value=o},Me=o=>{const e=g.shareData.findIndex(i=>i.id===o);e!==-1&&g.deleteShareData(e)},ze=window.location.origin+"/#/",Te=o=>`${ze}?code=${o.retrieveCode}`,se=o=>{const i=(parseInt(l.value)||0)+o;i>=1&&(l.value=i.toString())};return pe(()=>{console.log("SendFileView mounted")}),(o,e)=>{const i=Pe("router-link");return z(),M("div",{class:"min-h-screen flex items-center justify-center p-4 overflow-hidden transition-colors duration-300",onPaste:q(me,["prevent"])},[t("div",{class:n(["rounded-3xl shadow-2xl overflow-hidden border w-full max-w-md transition-colors duration-300",[r(s)?"bg-white bg-opacity-10 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200"]])},[t("div",Ke,[t("h2",{class:n(["text-3xl font-extrabold text-center mb-8 cursor-pointer transition-colors duration-300",[r(s)?"text-transparent bg-clip-text bg-gradient-to-r from-indigo-300 via-purple-300 to-pink-300":"text-indigo-600"]]),onClick:Se},D(r(T).name),3),t("form",{onSubmit:q(_e,["prevent"]),class:"space-y-8"},[t("div",Xe,[t("button",{type:"button",onClick:e[0]||(e[0]=a=>S.value="file"),class:n(["px-4 py-2 rounded-lg",S.value==="file"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300"])}," 发送文件 ",2),t("button",{type:"button",onClick:e[1]||(e[1]=a=>S.value="text"),class:n(["px-4 py-2 rounded-lg",S.value==="text"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300"])}," 发送文本 ",2)]),m(J,{name:"fade",mode:"out-in"},{default:E(()=>[S.value==="file"?(z(),M("div",Ye,[t("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(s)?"bg-gray-800 bg-opacity-50 border-gray-600 hover:border-indigo-500":"bg-gray-100 border-gray-300 hover:border-indigo-500"]]),onClick:j,onDragover:e[2]||(e[2]=q(()=>{},["prevent"])),onDrop:q(fe,["prevent"])},[t("input",{id:"file-upload",type:"file",class:"hidden",onChange:p,ref_key:"fileInput",ref:f},null,544),y.value>0?(z(),M("div",Ze,[m(Je,{progress:y.value},null,8,["progress"])])):H("",!0),m(r(qe),{class:n(["w-16 h-16 transition-colors duration-300",r(s)?"text-gray-400 group-hover:text-indigo-400":"text-gray-600 group-hover:text-indigo-600"])},null,8,["class"]),t("p",{class:n(["mt-4 text-sm transition-colors duration-300 w-full text-center",r(s)?"text-gray-400 group-hover:text-indigo-400":"text-gray-600 group-hover:text-indigo-600"])},[t("span",et,D(C.value?C.value.name:"点击或拖放文件到此处上传"),1)],2),t("p",{class:n(["mt-2 text-xs",r(s)?"text-gray-500":"text-gray-400"])}," 支持各种常见格式,最大"+D(r(ue)(r(T).uploadSize)),3)],34)])):(z(),M("div",tt,[S.value==="text"?(z(),M("div",rt,[Q(t("textarea",{id:"text-content","onUpdate:modelValue":e[3]||(e[3]=a=>u.value=a),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 custom-scrollbar",r(s)?"bg-gray-800 bg-opacity-50 text-white":"bg-white text-gray-900 border border-gray-300"]),placeholder:"在此输入要发送的文本..."},null,2),[[ae,u.value]])])):H("",!0)]))]),_:1}),t("div",ot,[t("label",{class:n(["text-sm font-medium",r(s)?"text-gray-300":"text-gray-700"])}," 过期时间 ",2),t("div",st,[t("div",{class:n(["relative h-12 rounded-2xl border transition-all duration-300 shadow-sm",r(s)?"bg-gray-800/60 border-gray-700/60 group-hover:border-gray-600/80 group-hover:shadow-lg group-hover:shadow-gray-900/20":"bg-white border-gray-200 group-hover:border-gray-300 group-hover:shadow-md group-hover:shadow-gray-200/50"])},[c.value!=="forever"?(z(),M(K,{key:0},[Q(t("input",{"onUpdate:modelValue":e[4]||(e[4]=a=>l.value=a),type:"number",placeholder:xe(),min:"1",class:n(["w-full h-full px-5 pr-32 rounded-2xl 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(s)?"text-gray-100 focus:ring-indigo-500/80 placeholder-gray-500":"text-gray-900 focus:ring-indigo-500/60 placeholder-gray-400"])},null,10,at),[[ae,l.value]]),t("div",{class:n(["absolute right-28 top-0 h-full flex flex-col border-l",[r(s)?"border-gray-700/60":"border-gray-200"]])},[t("button",{type:"button",onClick:e[5]||(e[5]=a=>se(1)),class:n(["flex-1 px-2 flex items-center justify-center transition-all duration-200",[r(s)?"hover:bg-gray-700/60 text-gray-400 hover:text-gray-200":"hover:bg-gray-50 text-gray-500 hover:text-gray-700"]])},e[12]||(e[12]=[t("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"})],-1)]),2),t("button",{type:"button",onClick:e[6]||(e[6]=a=>se(-1)),class:n(["flex-1 px-2 flex items-center justify-center transition-all duration-200",[r(s)?"hover:bg-gray-700/60 text-gray-400 hover:text-gray-200":"hover:bg-gray-50 text-gray-500 hover:text-gray-700"]])},e[13]||(e[13]=[t("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)]),2)],2)],64)):H("",!0),Q(t("select",{"onUpdate:modelValue":e[7]||(e[7]=a=>c.value=a),class:n(["absolute right-0 top-0 h-full appearance-none cursor-pointer transition-all duration-300","focus:outline-none focus:ring-2 focus:ring-offset-0",c.value==="forever"?"w-full px-5 rounded-2xl":"w-28 pl-4 pr-9 border-l rounded-r-2xl",r(s)?"text-gray-100 border-gray-700/60 focus:ring-indigo-500/80 bg-gray-800/60":"text-gray-900 border-gray-200 focus:ring-indigo-500/60 bg-white"]),style:ne({color:r(s)?"#f3f4f6":"#111827",backgroundColor:r(s)?"rgba(31, 41, 55, 0.5)":"#ffffff"})},[(z(!0),M(K,null,le(r(T).expireStyle,a=>(z(),M("option",{value:a,key:a,class:n([r(s)?"bg-gray-800 text-gray-100":"bg-white text-gray-900"]),style:ne({color:r(s)?"#f3f4f6":"#111827",backgroundColor:r(s)?"#1f2937":"#ffffff"})},D(te(a)),15,nt))),128))],6),[[Fe,c.value]]),t("div",{class:n(["absolute pointer-events-none",[c.value==="forever"?"right-3":"right-2","top-1/2 -translate-y-1/2"]])},[(z(),M("svg",{class:n(["w-4 h-4 transition-colors duration-300",[r(s)?"text-gray-400":"text-gray-500"]]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e[14]||(e[14]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))],2)],2)])]),t("button",lt,[e[16]||(e[16]=t("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)),t("span",it,[m(r(Ge),{class:"w-6 h-6 mr-2"}),e[15]||(e[15]=t("span",null,"安全寄送",-1))])])],32),t("div",ct,[m(i,{to:"/",class:"text-indigo-400 hover:text-indigo-300 transition duration-300"},{default:E(()=>e[17]||(e[17]=[X(" 需要取件?点击这里 ",-1)])),_:1,__:[17]})])]),t("div",{class:n(["px-8 py-4 bg-opacity-50 flex justify-between items-center",[r(s)?"bg-gray-800":"bg-gray-100"]])},[t("span",{class:n(["text-sm flex items-center",[r(s)?"text-gray-300":"text-gray-800"]])},[m(r(ce),{class:"w-4 h-4 mr-1 text-green-400"}),e[18]||(e[18]=X(" 安全加密 ",-1))],2),t("button",{onClick:oe,class:n(["text-sm hover:text-indigo-300 transition duration-300 flex items-center",[r(s)?"text-indigo-400":"text-indigo-600"]])},[e[19]||(e[19]=X(" 发件记录 ",-1)),m(r(Ue),{class:"w-4 h-4 ml-1"})],2)],2)],2),m(J,{name:"drawer"},{default:E(()=>[b.value?(z(),M("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(s)?"bg-gray-900":"bg-white"]])},[t("div",{class:n(["flex justify-between items-center p-6 border-b",[r(s)?"border-gray-700":"border-gray-200"]])},[t("h3",{class:n(["text-2xl font-bold",[r(s)?"text-white":"text-gray-800"]])}," 发件记录 ",2),t("button",{onClick:oe,class:n(["hover:text-white transition duration-300",[r(s)?"text-gray-400":"text-gray-800"]])},[m(r(ie),{class:"w-6 h-6"})],2)],2),t("div",dt,[m(je,{name:"list",tag:"div",class:"space-y-4"},{default:E(()=>[(z(!0),M(K,null,le(x.value,a=>(z(),M("div",{key:a.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(s)?"bg-gray-800 hover:bg-gray-700":"bg-gray-100 hover:bg-white"]])},[t("div",ut,[m(r(de),{class:n(["w-10 h-10",[r(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])]),t("div",gt,[t("p",{class:n(["font-medium text-lg truncate",[r(s)?"text-white":"text-gray-800"]])},D(a.filename?a.filename:"Text"),3),t("p",{class:n(["text-sm truncate",[r(s)?"text-gray-400":"text-gray-600"]])},D(a.date)+" · "+D(a.size),3)]),t("div",pt,[t("button",{onClick:h=>r(Y)(a.retrieveCode),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[r(s)?"hover:bg-blue-400 text-blue-400":"hover:bg-blue-100 text-blue-600"]])},[m(r(Z),{class:"w-5 h-5"})],10,ht),t("button",{onClick:h=>Ce(a),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[r(s)?"hover:bg-green-400 text-green-400":"hover:bg-green-100 text-green-600"]])},[m(r(Le),{class:"w-5 h-5"})],10,ft),t("button",{onClick:h=>Me(a.id),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[r(s)?"hover:bg-red-400 text-red-400":"hover:bg-red-100 text-red-600"]])},[m(r(Ne),{class:"w-5 h-5"})],10,mt)])],2))),128))]),_:1})])],2)):H("",!0)]),_:1}),m(J,{name:"fade"},{default:E(()=>[k.value?(z(),M("div",xt,[t("div",{class:n(["w-full max-w-2xl rounded-2xl shadow-2xl transform transition-all duration-300 ease-out overflow-hidden",[r(s)?"bg-gray-900 bg-opacity-70":"bg-white bg-opacity-95"]])},[t("div",{class:n(["px-4 sm:px-6 py-3 sm:py-4 border-b",[r(s)?"border-gray-800":"border-gray-100"]])},[t("div",vt,[t("h3",{class:n(["text-lg sm:text-xl font-semibold",[r(s)?"text-white":"text-gray-900"]])}," 文件详情 ",2),t("button",{onClick:e[8]||(e[8]=a=>k.value=null),class:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"},[m(r(ie),{class:n(["w-4 h-4 sm:w-5 sm:h-5",[r(s)?"text-gray-400":"text-gray-500"]])},null,8,["class"])])])],2),t("div",yt,[t("div",{class:n(["rounded-xl p-3 sm:p-4 mb-4 sm:mb-6",[r(s)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[t("div",bt,[t("div",{class:n(["p-2 sm:p-3 rounded-lg",[r(s)?"bg-gray-800":"bg-white"]])},[m(r(de),{class:n(["w-5 h-5 sm:w-6 sm:h-6",[r(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2),t("div",wt,[t("h4",{class:n(["font-medium text-sm sm:text-base truncate",[r(s)?"text-white":"text-gray-900"]])},D(k.value.filename),3),t("p",{class:n(["text-xs sm:text-sm truncate",[r(s)?"text-gray-400":"text-gray-500"]])},D(k.value.size)+" · "+D(k.value.date),3)])]),t("div",kt,[t("div",_t,[m(r(We),{class:n(["w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1.5 sm:mr-2 flex-shrink-0",[r(s)?"text-gray-400":"text-gray-500"]])},null,8,["class"]),t("span",{class:n(["text-xs sm:text-sm truncate",[r(s)?"text-gray-300":"text-gray-600"]])},D(k.value.expiration),3)]),t("div",St,[m(r(ce),{class:n(["w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1.5 sm:mr-2 flex-shrink-0",[r(s)?"text-gray-400":"text-gray-500"]])},null,8,["class"]),t("span",{class:n(["text-xs sm:text-sm truncate",[r(s)?"text-gray-300":"text-gray-600"]])}," 安全加密 ",2)])])],2),t("div",Ct,[t("div",Mt,[t("div",zt,[t("div",Tt,[e[20]||(e[20]=t("h4",{class:"font-medium text-sm sm:text-base"},"取件码",-1)),t("button",{onClick:e[9]||(e[9]=a=>r(Ve)(k.value.retrieveCode)),class:"p-1.5 sm:p-2 rounded-full hover:bg-white/10 transition-colors"},[m(r(Z),{class:"w-4 h-4 sm:w-5 sm:h-5"})])]),t("p",$t,D(k.value.retrieveCode),1)]),t("div",{class:n(["rounded-xl p-3 sm:p-4",[r(s)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[t("div",Dt,[t("h4",{class:n(["font-medium text-sm sm:text-base flex items-center min-w-0",[r(s)?"text-white":"text-gray-900"]])},[m(r(Oe),{class:"w-4 h-4 sm:w-5 sm:h-5 mr-1.5 sm:mr-2 text-indigo-500 flex-shrink-0"}),e[21]||(e[21]=t("span",{class:"truncate"},"wget下载",-1))],2),t("button",{onClick:e[10]||(e[10]=a=>r(Ee)(k.value.retrieveCode,k.value.filename)),class:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors flex-shrink-0"},[m(r(Z),{class:n(["w-4 h-4 sm:w-5 sm:h-5",[r(s)?"text-gray-400":"text-gray-500"]])},null,8,["class"])])]),t("p",{class:n(["text-xs sm:text-sm font-mono break-all line-clamp-2",[r(s)?"text-gray-300":"text-gray-600"]])}," 点击复制wget命令 ",2)],2)]),t("div",{class:n(["rounded-xl p-4 sm:p-5 flex flex-col items-center",[r(s)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[t("div",It,[m(He,{value:Te(k.value),size:140,level:"M",class:"sm:w-[160px] sm:h-[160px]"},null,8,["value"])]),t("p",{class:n(["text-xs sm:text-sm truncate max-w-full",[r(s)?"text-gray-400":"text-gray-500"]])}," 扫描二维码快速取件 ",2)],2)])]),t("div",{class:n(["px-4 sm:px-6 py-3 sm:py-4 border-t",[r(s)?"border-gray-800":"border-gray-100"]])},[t("button",{onClick:e[11]||(e[11]=a=>r(Y)(k.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)])):H("",!0)]),_:1})],32)}}}),Rt=he(At,[["__scopeId","data-v-619e130d"]]);export{Rt as default}; + */const Oe=N("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),Qe=ge({__name:"BorderProgressBar",props:{progress:{}},setup(P){const T=P,U=I(null),s=I(null);let g=null;const S=()=>{if(!g||!s.value||!U.value)return;const u=U.value.clientWidth,f=U.value.clientHeight;s.value.width=u,s.value.height=f;const c=4,l=8;g.lineWidth=c;const y=g.createLinearGradient(0,0,u,f);y.addColorStop(0,"#4f46e5"),y.addColorStop(.5,"#7c3aed"),y.addColorStop(1,"#db2777"),g.strokeStyle="rgba(229, 231, 235, 0.2)",C(g,c/2,c/2,u-c,f-c,l),g.stroke();const k=((u+f)*2-8*l+2*Math.PI*l)*T.progress/100;g.strokeStyle=y,g.lineCap="round",g.lineJoin="round",g.beginPath();let d=k;const x=c/2,$=u-c,j=f-c;if(d>0){const p=Math.min($-2*l,d);g.moveTo(l+x,x),g.lineTo(p+l+x,x),d-=p}if(d>0){const p=Math.min(Math.PI/2,d/l);g.arc($-l+x,l+x,l,-Math.PI/2,p-Math.PI/2,!1),d-=p*l}if(d>0){const p=Math.min(j-2*l,d);g.lineTo($+x,p+l+x),d-=p}if(d>0){const p=Math.min(Math.PI/2,d/l);g.arc($-l+x,j-l+x,l,0,p,!1),d-=p*l}if(d>0){const p=Math.min($-2*l,d);g.lineTo($-p-l+x,j+x),d-=p}if(d>0){const p=Math.min(Math.PI/2,d/l);g.arc(l+x,j-l+x,l,Math.PI/2,Math.PI/2+p,!1),d-=p*l}if(d>0){const p=Math.min(j-2*l,d);g.lineTo(x,j-p-l+x),d-=p}if(d>0){const p=Math.min(Math.PI/2,d/l);g.arc(l+x,l+x,l,Math.PI,Math.PI+p,!1)}g.stroke()};function C(u,f,c,l,y,b){u.beginPath(),u.moveTo(f+b,c),u.lineTo(f+l-b,c),u.arcTo(f+l,c,f+l,c+b,b),u.lineTo(f+l,c+y-b),u.arcTo(f+l,c+y,f+l-b,c+y,b),u.lineTo(f+b,c+y),u.arcTo(f,c+y,f,c+y-b,b),u.lineTo(f,c+b),u.arcTo(f,c,f+b,c,b),u.closePath()}return pe(()=>{s.value&&(g=s.value.getContext("2d"),S())}),$e(()=>T.progress,S),(u,f)=>(z(),M("div",{class:"border-progress-container",ref_key:"container",ref:U},[t("canvas",{ref_key:"canvas",ref:s,class:"border-progress-canvas"},null,512)],512))}}),Je=he(Qe,[["__scopeId","data-v-2fbf5085"]]),ue=P=>P>=1024*1024*1024?Math.round(P/(1024*1024*1024))+"GB":P>=1024*1024?Math.round(P/(1024*1024))+"MB":Math.round(P/1024)+"KB",Ke={class:"p-8"},Xe={class:"flex justify-center space-x-4 mb-6"},Ye={key:"file",class:"grid grid-cols-1 gap-8"},Ze={key:0,class:"absolute inset-0 w-full h-full"},et={class:"block truncate"},tt={key:"text",class:"grid grid-cols-1 gap-8"},rt={key:0,class:"flex flex-col"},ot={class:"flex flex-col space-y-3"},st={class:"relative flex-grow group"},at=["placeholder"],nt=["value"],lt={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"},it={class:"relative z-10 flex items-center justify-center text-lg"},ct={class:"mt-6 text-center"},dt={class:"flex-grow overflow-y-auto p-6"},ut={class:"flex-shrink-0 mr-4"},gt={class:"flex-grow min-w-0 mr-4"},pt={class:"flex-shrink-0 flex space-x-2"},ht=["onClick"],ft=["onClick"],mt=["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"},vt={class:"flex items-center justify-between"},yt={class:"p-4 sm:p-6"},bt={class:"flex items-center mb-3 sm:mb-4"},wt={class:"ml-3 sm:ml-4 min-w-0 flex-1"},kt={class:"grid grid-cols-2 gap-3 sm:gap-4"},_t={class:"flex items-center min-w-0"},St={class:"flex items-center min-w-0"},Ct={class:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6"},Mt={class:"space-y-3 sm:space-y-4"},zt={class:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl p-4 sm:p-5 text-white"},Tt={class:"flex items-center justify-between mb-3 sm:mb-4"},$t={class:"text-2xl sm:text-3xl font-bold tracking-wider text-center break-all"},Dt={class:"flex items-center justify-between mb-2 sm:mb-3"},It={class:"bg-white p-3 sm:p-4 rounded-lg shadow-sm mb-3 sm:mb-4"},At=ge({__name:"SendFileView",setup(P){const T=JSON.parse(localStorage.getItem("config")||"{}"),U=Be(),s=Ae("isDarkMode"),g=Re(),S=I("file"),C=I(null),u=I(""),f=I(null),c=I(T.expireStyle?.[0]||"day"),l=I("1"),y=I(0),b=I(!1),k=I(null),d=De(),x=Ie(()=>g.shareData),$=I(""),j=()=>{f.value?.click()},p=async o=>{const e=o.target;if(e.files&&e.files.length>0){const i=e.files[0];if(C.value=i,!O())return;$.value=await G(i),console.log($.value)}},fe=async o=>{if(o.dataTransfer?.files&&o.dataTransfer.files.length>0){const e=o.dataTransfer.files[0];if(C.value=e,!O())return;$.value=await G(e)}},me=async o=>{const e=o.clipboardData?.items;if(e)for(let i=0;i{const w=h.trim();if(!w)return;const v=document.getElementById("text-content");if(!v){u.value+=w;return}const _=v.selectionStart,F=v.selectionEnd;if(_!==F){const A=u.value.substring(0,_),V=u.value.substring(F);u.value=A+w+V,setTimeout(()=>{const R=_+w.length;v.setSelectionRange(R,R),v.focus()},0)}else{const A=_,V=u.value.substring(0,A),R=u.value.substring(A);u.value=V+w+R,setTimeout(()=>{const W=A+w.length;v.setSelectionRange(W,W),v.focus()},0)}})}},G=async o=>new Promise(e=>{const a=new FileReader;let h=0;const w=Math.ceil(o.size/2097152);a.onload=async _=>{const F=new Uint8Array(_.target.result);try{if(window.isSecureContext){const B=await crypto.subtle.digest("SHA-256",F),V=Array.from(new Uint8Array(B)).map(R=>R.toString(16).padStart(2,"0")).join("");h++,h{const _=h*2097152,F=_+2097152>=o.size?o.size:_+2097152;a.readAsArrayBuffer(o.slice(_,F))};v()}),ee=o=>{const e=`${o.name}-${o.size}-${o.lastModified}`;let i=0;for(let a=0;a{switch(o){case"day":return"输入天数";case"hour":return"输入小时数";case"minute":return"输入分钟数";case"count":return"输入查看次数";case"forever":return"永久";default:return"输入值"}},te=(o=c.value)=>{switch(o){case"day":return"天";case"hour":return"小时";case"minute":return"分钟";case"count":return"次";case"forever":return"永久";default:return""}},ve=(o,e)=>{if(o==="forever")return"永久";if(o==="count")return`${e}次后过期`;const i=new Date,a=parseInt(e);switch(o){case"minute":i.setMinutes(i.getMinutes()+a);break;case"hour":i.setHours(i.getHours()+a);break;case"day":i.setDate(i.getDate()+a);break;default:return`${e}${te(o)}后过期`}const h=i.getFullYear(),w=(i.getMonth()+1).toString().padStart(2,"0"),v=i.getDate().toString().padStart(2,"0"),_=i.getHours().toString().padStart(2,"0"),F=i.getMinutes().toString().padStart(2,"0");return`${h}-${w}-${v} ${_}:${F}过期`},ye=async o=>{try{const i=Math.ceil(o.size/5242880),a=await L.post("chunk/upload/init/",{file_name:o.name,file_size:o.size,chunk_size:5242880,file_hash:$.value});if(a.code!==200)throw new Error("初始化切片上传失败");if(a.detail?.existed)return a;const h=a.detail?.upload_id;for(let v=0;v{const W=Math.round((v*5242880+R.loaded)*100/o.size);y.value=W}})).code!==200)throw new Error(`切片 ${v} 上传失败`)}const w=await L.post(`chunk/upload/complete/${h}`,{expire_value:l.value?parseInt(l.value):1,expire_style:c.value});if(w.code!==200)throw new Error("完成上传失败");return w}catch(e){if(console.error("切片上传失败:",e),e&&typeof e=="object"&&"response"in e){const i=e;i.response?.data?.detail&&d.showAlert(i.response.data.detail,"error")}else d.showAlert("上传失败,请稍后重试","error");throw e}},be=async o=>{const e=new FormData,i={headers:{"Content-Type":"multipart/form-data"},timeout: 0,onUploadProgress:h=>{const w=Math.round(h.loaded*100/(h.total||1));y.value=w}};return e.append("file",o),e.append("expire_value",l.value),e.append("expire_style",c.value),await L.post("share/file/",e,i)},we=()=>T.openUpload===0&&localStorage.getItem("token")===null?(d.showAlert("游客上传功能已关闭","error"),!1):!0,ke=o=>o.size>T.uploadSize?(d.showAlert(`文件大小超过限制 (${ue(T.uploadSize)})`,"error"),C.value=null,!1):!0,re=(o,e)=>{if(o==="forever"||o==="count")return!0;const i=T.max_save_seconds||0;if(i===0)return!0;let a=0;switch(o){case"minute":a=parseInt(e)*60;break;case"hour":a=parseInt(e)*3600;break;case"day":a=parseInt(e)*86400;break;default:return!1}return a<=i},O=()=>!(!we()||!ke(C.value)||!re(c.value,l.value)),_e=async()=>{if(S.value==="file"&&!C.value){d.showAlert("请选择要上传的文件","error");return}if(S.value==="text"&&!u.value.trim()){d.showAlert("请输入要发送的文本","error");return}if(c.value!=="forever"&&!l.value){d.showAlert("请输入过期值","error");return}if(!re(c.value,l.value)){const o=Math.floor(T.max_save_seconds/86400);d.showAlert(`过期时间不能超过${o}天`,"error");return}try{let o;if(S.value==="file")T.enableChunk?o=await ye(C.value):o=await be(C.value);else{const e=new FormData;e.append("text",u.value),e.append("expire_value",l.value),e.append("expire_style",c.value),o=await L.post("share/text/",e,{headers:{"Content-Type":"multipart/form-data"}})}if(o&&o.code===200){const e=o.detail?.code||"",i=o.detail?.name||"",a={id:Date.now(),filename:i,date:new Date().toISOString().split("T")[0],size:S.value==="text"?`${(u.value.length/1024).toFixed(2)} KB`:`${(C.value.size/(1024*1024)).toFixed(1)} MB`,expiration:c.value==="forever"?"永久":ve(c.value,l.value),retrieveCode:e};g.addShareDataRecord(a),d.showAlert(`文件发送成功!取件码:${e}`,"success"),C.value=null,u.value="",y.value=0,k.value=a,await Y(e)}else throw new Error("服务器响应异常")}catch(o){if(o&&typeof o=="object"&&"response"in o){const e=o;e.response?.data?.detail&&d.showAlert(e.response.data.detail,"error")}else d.showAlert("发送失败,请稍后重试","error")}finally{y.value=0}},Se=()=>{U.push("/")},oe=()=>{b.value=!b.value},Ce=o=>{k.value=o},Me=o=>{const e=g.shareData.findIndex(i=>i.id===o);e!==-1&&g.deleteShareData(e)},ze=window.location.origin+"/#/",Te=o=>`${ze}?code=${o.retrieveCode}`,se=o=>{const i=(parseInt(l.value)||0)+o;i>=1&&(l.value=i.toString())};return pe(()=>{console.log("SendFileView mounted")}),(o,e)=>{const i=Pe("router-link");return z(),M("div",{class:"min-h-screen flex items-center justify-center p-4 overflow-hidden transition-colors duration-300",onPaste:q(me,["prevent"])},[t("div",{class:n(["rounded-3xl shadow-2xl overflow-hidden border w-full max-w-md transition-colors duration-300",[r(s)?"bg-white bg-opacity-10 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200"]])},[t("div",Ke,[t("h2",{class:n(["text-3xl font-extrabold text-center mb-8 cursor-pointer transition-colors duration-300",[r(s)?"text-transparent bg-clip-text bg-gradient-to-r from-indigo-300 via-purple-300 to-pink-300":"text-indigo-600"]]),onClick:Se},D(r(T).name),3),t("form",{onSubmit:q(_e,["prevent"]),class:"space-y-8"},[t("div",Xe,[t("button",{type:"button",onClick:e[0]||(e[0]=a=>S.value="file"),class:n(["px-4 py-2 rounded-lg",S.value==="file"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300"])}," 发送文件 ",2),t("button",{type:"button",onClick:e[1]||(e[1]=a=>S.value="text"),class:n(["px-4 py-2 rounded-lg",S.value==="text"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300"])}," 发送文本 ",2)]),m(J,{name:"fade",mode:"out-in"},{default:E(()=>[S.value==="file"?(z(),M("div",Ye,[t("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(s)?"bg-gray-800 bg-opacity-50 border-gray-600 hover:border-indigo-500":"bg-gray-100 border-gray-300 hover:border-indigo-500"]]),onClick:j,onDragover:e[2]||(e[2]=q(()=>{},["prevent"])),onDrop:q(fe,["prevent"])},[t("input",{id:"file-upload",type:"file",class:"hidden",onChange:p,ref_key:"fileInput",ref:f},null,544),y.value>0?(z(),M("div",Ze,[m(Je,{progress:y.value},null,8,["progress"])])):H("",!0),m(r(qe),{class:n(["w-16 h-16 transition-colors duration-300",r(s)?"text-gray-400 group-hover:text-indigo-400":"text-gray-600 group-hover:text-indigo-600"])},null,8,["class"]),t("p",{class:n(["mt-4 text-sm transition-colors duration-300 w-full text-center",r(s)?"text-gray-400 group-hover:text-indigo-400":"text-gray-600 group-hover:text-indigo-600"])},[t("span",et,D(C.value?C.value.name:"点击或拖放文件到此处上传"),1)],2),t("p",{class:n(["mt-2 text-xs",r(s)?"text-gray-500":"text-gray-400"])}," 支持各种常见格式,最大"+D(r(ue)(r(T).uploadSize)),3)],34)])):(z(),M("div",tt,[S.value==="text"?(z(),M("div",rt,[Q(t("textarea",{id:"text-content","onUpdate:modelValue":e[3]||(e[3]=a=>u.value=a),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 custom-scrollbar",r(s)?"bg-gray-800 bg-opacity-50 text-white":"bg-white text-gray-900 border border-gray-300"]),placeholder:"在此输入要发送的文本..."},null,2),[[ae,u.value]])])):H("",!0)]))]),_:1}),t("div",ot,[t("label",{class:n(["text-sm font-medium",r(s)?"text-gray-300":"text-gray-700"])}," 过期时间 ",2),t("div",st,[t("div",{class:n(["relative h-12 rounded-2xl border transition-all duration-300 shadow-sm",r(s)?"bg-gray-800/60 border-gray-700/60 group-hover:border-gray-600/80 group-hover:shadow-lg group-hover:shadow-gray-900/20":"bg-white border-gray-200 group-hover:border-gray-300 group-hover:shadow-md group-hover:shadow-gray-200/50"])},[c.value!=="forever"?(z(),M(K,{key:0},[Q(t("input",{"onUpdate:modelValue":e[4]||(e[4]=a=>l.value=a),type:"number",placeholder:xe(),min:"1",class:n(["w-full h-full px-5 pr-32 rounded-2xl 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(s)?"text-gray-100 focus:ring-indigo-500/80 placeholder-gray-500":"text-gray-900 focus:ring-indigo-500/60 placeholder-gray-400"])},null,10,at),[[ae,l.value]]),t("div",{class:n(["absolute right-28 top-0 h-full flex flex-col border-l",[r(s)?"border-gray-700/60":"border-gray-200"]])},[t("button",{type:"button",onClick:e[5]||(e[5]=a=>se(1)),class:n(["flex-1 px-2 flex items-center justify-center transition-all duration-200",[r(s)?"hover:bg-gray-700/60 text-gray-400 hover:text-gray-200":"hover:bg-gray-50 text-gray-500 hover:text-gray-700"]])},e[12]||(e[12]=[t("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"})],-1)]),2),t("button",{type:"button",onClick:e[6]||(e[6]=a=>se(-1)),class:n(["flex-1 px-2 flex items-center justify-center transition-all duration-200",[r(s)?"hover:bg-gray-700/60 text-gray-400 hover:text-gray-200":"hover:bg-gray-50 text-gray-500 hover:text-gray-700"]])},e[13]||(e[13]=[t("svg",{class:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)]),2)],2)],64)):H("",!0),Q(t("select",{"onUpdate:modelValue":e[7]||(e[7]=a=>c.value=a),class:n(["absolute right-0 top-0 h-full appearance-none cursor-pointer transition-all duration-300","focus:outline-none focus:ring-2 focus:ring-offset-0",c.value==="forever"?"w-full px-5 rounded-2xl":"w-28 pl-4 pr-9 border-l rounded-r-2xl",r(s)?"text-gray-100 border-gray-700/60 focus:ring-indigo-500/80 bg-gray-800/60":"text-gray-900 border-gray-200 focus:ring-indigo-500/60 bg-white"]),style:ne({color:r(s)?"#f3f4f6":"#111827",backgroundColor:r(s)?"rgba(31, 41, 55, 0.5)":"#ffffff"})},[(z(!0),M(K,null,le(r(T).expireStyle,a=>(z(),M("option",{value:a,key:a,class:n([r(s)?"bg-gray-800 text-gray-100":"bg-white text-gray-900"]),style:ne({color:r(s)?"#f3f4f6":"#111827",backgroundColor:r(s)?"#1f2937":"#ffffff"})},D(te(a)),15,nt))),128))],6),[[Fe,c.value]]),t("div",{class:n(["absolute pointer-events-none",[c.value==="forever"?"right-3":"right-2","top-1/2 -translate-y-1/2"]])},[(z(),M("svg",{class:n(["w-4 h-4 transition-colors duration-300",[r(s)?"text-gray-400":"text-gray-500"]]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e[14]||(e[14]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))],2)],2)])]),t("button",lt,[e[16]||(e[16]=t("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)),t("span",it,[m(r(Ge),{class:"w-6 h-6 mr-2"}),e[15]||(e[15]=t("span",null,"安全寄送",-1))])])],32),t("div",ct,[m(i,{to:"/",class:"text-indigo-400 hover:text-indigo-300 transition duration-300"},{default:E(()=>e[17]||(e[17]=[X(" 需要取件?点击这里 ",-1)])),_:1,__:[17]})])]),t("div",{class:n(["px-8 py-4 bg-opacity-50 flex justify-between items-center",[r(s)?"bg-gray-800":"bg-gray-100"]])},[t("span",{class:n(["text-sm flex items-center",[r(s)?"text-gray-300":"text-gray-800"]])},[m(r(ce),{class:"w-4 h-4 mr-1 text-green-400"}),e[18]||(e[18]=X(" 安全加密 ",-1))],2),t("button",{onClick:oe,class:n(["text-sm hover:text-indigo-300 transition duration-300 flex items-center",[r(s)?"text-indigo-400":"text-indigo-600"]])},[e[19]||(e[19]=X(" 发件记录 ",-1)),m(r(Ue),{class:"w-4 h-4 ml-1"})],2)],2)],2),m(J,{name:"drawer"},{default:E(()=>[b.value?(z(),M("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(s)?"bg-gray-900":"bg-white"]])},[t("div",{class:n(["flex justify-between items-center p-6 border-b",[r(s)?"border-gray-700":"border-gray-200"]])},[t("h3",{class:n(["text-2xl font-bold",[r(s)?"text-white":"text-gray-800"]])}," 发件记录 ",2),t("button",{onClick:oe,class:n(["hover:text-white transition duration-300",[r(s)?"text-gray-400":"text-gray-800"]])},[m(r(ie),{class:"w-6 h-6"})],2)],2),t("div",dt,[m(je,{name:"list",tag:"div",class:"space-y-4"},{default:E(()=>[(z(!0),M(K,null,le(x.value,a=>(z(),M("div",{key:a.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(s)?"bg-gray-800 hover:bg-gray-700":"bg-gray-100 hover:bg-white"]])},[t("div",ut,[m(r(de),{class:n(["w-10 h-10",[r(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])]),t("div",gt,[t("p",{class:n(["font-medium text-lg truncate",[r(s)?"text-white":"text-gray-800"]])},D(a.filename?a.filename:"Text"),3),t("p",{class:n(["text-sm truncate",[r(s)?"text-gray-400":"text-gray-600"]])},D(a.date)+" · "+D(a.size),3)]),t("div",pt,[t("button",{onClick:h=>r(Y)(a.retrieveCode),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[r(s)?"hover:bg-blue-400 text-blue-400":"hover:bg-blue-100 text-blue-600"]])},[m(r(Z),{class:"w-5 h-5"})],10,ht),t("button",{onClick:h=>Ce(a),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[r(s)?"hover:bg-green-400 text-green-400":"hover:bg-green-100 text-green-600"]])},[m(r(Le),{class:"w-5 h-5"})],10,ft),t("button",{onClick:h=>Me(a.id),class:n(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[r(s)?"hover:bg-red-400 text-red-400":"hover:bg-red-100 text-red-600"]])},[m(r(Ne),{class:"w-5 h-5"})],10,mt)])],2))),128))]),_:1})])],2)):H("",!0)]),_:1}),m(J,{name:"fade"},{default:E(()=>[k.value?(z(),M("div",xt,[t("div",{class:n(["w-full max-w-2xl rounded-2xl shadow-2xl transform transition-all duration-300 ease-out overflow-hidden",[r(s)?"bg-gray-900 bg-opacity-70":"bg-white bg-opacity-95"]])},[t("div",{class:n(["px-4 sm:px-6 py-3 sm:py-4 border-b",[r(s)?"border-gray-800":"border-gray-100"]])},[t("div",vt,[t("h3",{class:n(["text-lg sm:text-xl font-semibold",[r(s)?"text-white":"text-gray-900"]])}," 文件详情 ",2),t("button",{onClick:e[8]||(e[8]=a=>k.value=null),class:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"},[m(r(ie),{class:n(["w-4 h-4 sm:w-5 sm:h-5",[r(s)?"text-gray-400":"text-gray-500"]])},null,8,["class"])])])],2),t("div",yt,[t("div",{class:n(["rounded-xl p-3 sm:p-4 mb-4 sm:mb-6",[r(s)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[t("div",bt,[t("div",{class:n(["p-2 sm:p-3 rounded-lg",[r(s)?"bg-gray-800":"bg-white"]])},[m(r(de),{class:n(["w-5 h-5 sm:w-6 sm:h-6",[r(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2),t("div",wt,[t("h4",{class:n(["font-medium text-sm sm:text-base truncate",[r(s)?"text-white":"text-gray-900"]])},D(k.value.filename),3),t("p",{class:n(["text-xs sm:text-sm truncate",[r(s)?"text-gray-400":"text-gray-500"]])},D(k.value.size)+" · "+D(k.value.date),3)])]),t("div",kt,[t("div",_t,[m(r(We),{class:n(["w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1.5 sm:mr-2 flex-shrink-0",[r(s)?"text-gray-400":"text-gray-500"]])},null,8,["class"]),t("span",{class:n(["text-xs sm:text-sm truncate",[r(s)?"text-gray-300":"text-gray-600"]])},D(k.value.expiration),3)]),t("div",St,[m(r(ce),{class:n(["w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1.5 sm:mr-2 flex-shrink-0",[r(s)?"text-gray-400":"text-gray-500"]])},null,8,["class"]),t("span",{class:n(["text-xs sm:text-sm truncate",[r(s)?"text-gray-300":"text-gray-600"]])}," 安全加密 ",2)])])],2),t("div",Ct,[t("div",Mt,[t("div",zt,[t("div",Tt,[e[20]||(e[20]=t("h4",{class:"font-medium text-sm sm:text-base"},"取件码",-1)),t("button",{onClick:e[9]||(e[9]=a=>r(Ve)(k.value.retrieveCode)),class:"p-1.5 sm:p-2 rounded-full hover:bg-white/10 transition-colors"},[m(r(Z),{class:"w-4 h-4 sm:w-5 sm:h-5"})])]),t("p",$t,D(k.value.retrieveCode),1)]),t("div",{class:n(["rounded-xl p-3 sm:p-4",[r(s)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[t("div",Dt,[t("h4",{class:n(["font-medium text-sm sm:text-base flex items-center min-w-0",[r(s)?"text-white":"text-gray-900"]])},[m(r(Oe),{class:"w-4 h-4 sm:w-5 sm:h-5 mr-1.5 sm:mr-2 text-indigo-500 flex-shrink-0"}),e[21]||(e[21]=t("span",{class:"truncate"},"wget下载",-1))],2),t("button",{onClick:e[10]||(e[10]=a=>r(Ee)(k.value.retrieveCode,k.value.filename)),class:"p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors flex-shrink-0"},[m(r(Z),{class:n(["w-4 h-4 sm:w-5 sm:h-5",[r(s)?"text-gray-400":"text-gray-500"]])},null,8,["class"])])]),t("p",{class:n(["text-xs sm:text-sm font-mono break-all line-clamp-2",[r(s)?"text-gray-300":"text-gray-600"]])}," 点击复制wget命令 ",2)],2)]),t("div",{class:n(["rounded-xl p-4 sm:p-5 flex flex-col items-center",[r(s)?"bg-gray-800 bg-opacity-50":"bg-gray-50 bg-opacity-95"]])},[t("div",It,[m(He,{value:Te(k.value),size:140,level:"M",class:"sm:w-[160px] sm:h-[160px]"},null,8,["value"])]),t("p",{class:n(["text-xs sm:text-sm truncate max-w-full",[r(s)?"text-gray-400":"text-gray-500"]])}," 扫描二维码快速取件 ",2)],2)])]),t("div",{class:n(["px-4 sm:px-6 py-3 sm:py-4 border-t",[r(s)?"border-gray-800":"border-gray-100"]])},[t("button",{onClick:e[11]||(e[11]=a=>r(Y)(k.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)])):H("",!0)]),_:1})],32)}}}),Rt=he(At,[["__scopeId","data-v-619e130d"]]);export{Rt as default};