1 line
5.1 KiB
JavaScript
1 line
5.1 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86606,e=>{"use strict";var s=e.i(43476),r=e.i(71645),t=e.i(76639),l=e.i(19455),a=e.i(25147),d=e.i(3116),i=e.i(75254);let n=(0,i.default)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),o=(0,i.default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);var c=e.i(83086),m=e.i(6120),x=e.i(52664),u=e.i(31334);function f(){let[e,i]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=()=>{let e=(0,m.getPendingOfflineReport)();e&&e.gain>.1?(i(e),setTimeout(()=>(0,u.sfx)("decodeSuccess"),300)):e&&(0,m.consumeOfflineReport)()},s=setTimeout(e,1500),r=()=>e();return window.addEventListener("echo-nexus-offline-report",r),()=>{clearTimeout(s),window.removeEventListener("echo-nexus-offline-report",r)}},[]);let f=()=>{(0,m.consumeOfflineReport)(),i(null)};if(!e)return null;let h=e.gain<e.rate*e.elapsedSec*e.eff-.01;return(0,s.jsx)(t.Dialog,{open:!!e,onOpenChange:e=>!e&&f(),children:(0,s.jsxs)(t.DialogContent,{className:"bg-gradient-to-br from-[#0f0a2e]/95 to-[#050410]/95 border-emerald-400/30 max-w-[400px]",children:[(0,s.jsxs)(t.DialogHeader,{children:[(0,s.jsx)("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-emerald-400 via-cyan-400 to-blue-400 rounded-t-xl"}),(0,s.jsxs)(t.DialogTitle,{className:"flex items-center gap-2 text-emerald-100",children:[(0,s.jsx)(c.Sparkles,{className:"h-4 w-4 text-emerald-300"}),"欢迎回来,无人机"]}),(0,s.jsx)(t.DialogDescription,{className:"text-muted-foreground",children:"在你离开的这段时间里,采矿机群持续运转…"})]}),(0,s.jsxs)("div",{className:"space-y-3 py-1",children:[(0,s.jsxs)("div",{className:"relative rounded-xl border border-emerald-400/30 bg-emerald-500/5 p-4 overflow-hidden",children:[(0,s.jsx)("div",{className:"pointer-events-none absolute -top-8 -right-8 h-24 w-24 rounded-full bg-emerald-500/20 blur-2xl"}),(0,s.jsxs)("div",{className:"relative flex items-center gap-3",children:[(0,s.jsx)("div",{className:"h-12 w-12 rounded-xl bg-emerald-500/15 border border-emerald-400/40 flex items-center justify-center shrink-0",children:(0,s.jsx)(a.Gem,{className:"h-6 w-6 text-emerald-300"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"text-[11px] text-muted-foreground",children:"离线采集获得"}),(0,s.jsxs)("div",{className:"text-2xl font-bold font-mono text-emerald-200 tabular-nums leading-tight",children:["+",(0,x.formatNum)(e.gain)]}),(0,s.jsx)("div",{className:"text-[10px] text-muted-foreground/80",children:"记忆晶体"})]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[(0,s.jsxs)("div",{className:"rounded-lg border border-white/10 bg-black/30 px-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-muted-foreground mb-1",children:[(0,s.jsx)(d.Clock,{className:"h-3 w-3"}),"离线时长"]}),(0,s.jsx)("div",{className:"font-mono font-semibold text-foreground",children:(0,m.formatDuration)(e.rawElapsedSec)}),e.capped&&(0,s.jsx)("div",{className:"text-[9px] text-amber-400/80 mt-0.5",children:"已达 8h 上限"})]}),(0,s.jsxs)("div",{className:"rounded-lg border border-white/10 bg-black/30 px-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-muted-foreground mb-1",children:[(0,s.jsx)(n,{className:"h-3 w-3"}),"采集速率"]}),(0,s.jsxs)("div",{className:"font-mono font-semibold text-foreground",children:[(0,x.formatNum)(e.rate),"/s"]}),(0,s.jsxs)("div",{className:"text-[9px] text-muted-foreground/70 mt-0.5",children:["效率 ",Math.round(100*e.eff),"%"]})]})]}),h&&(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-amber-400/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-200",children:[(0,s.jsx)(o,{className:"h-3.5 w-3.5 shrink-0 mt-0.5"}),(0,s.jsx)("span",{children:"仓库已满,部分离线产出被截断。升级仓库容量或解码晶体可避免浪费。"})]}),(0,s.jsxs)("div",{className:"rounded-lg border border-white/10 bg-black/20 px-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-[11px]",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"当前晶体"}),(0,s.jsxs)("span",{className:"font-mono text-foreground tabular-nums",children:[(0,x.formatNum)(e.crystalsAfter)," / ",(0,x.formatNum)(e.crystalCap)]})]}),(0,s.jsx)("div",{className:"mt-1.5 h-1.5 rounded-full bg-white/10 overflow-hidden",children:(0,s.jsx)("div",{className:"h-full bg-gradient-to-r from-emerald-500 to-cyan-400 transition-all",style:{width:`${Math.min(100,e.crystalsAfter/e.crystalCap*100)}%`}})})]})]}),(0,s.jsx)("div",{className:"flex justify-end gap-2 mt-1",children:(0,s.jsxs)(l.Button,{onClick:f,className:"bg-emerald-500 hover:bg-emerald-600 text-white border-emerald-400/50",children:[(0,s.jsx)(a.Gem,{className:"h-3.5 w-3.5 mr-1"}),"领取收益"]})})]})})}e.s(["OfflineReportDialog",()=>f],86606)},54777,e=>{e.n(e.i(86606))}]); |