1import{j as e}from"./jsx-runtime-0DLF9kdB.js";import{r as u,u as K}from"./index-DM-Ysix_.js";import{G as q}from"./GlassCard-QGEypy6d.js";import{P as Y,i as J}from"./PageTransition-d4Dnod-f.js";import{c as h}from"./cn-fNskMoFt.js";import{A as Q}from"./index-Dc83_iFP.js";import{m as S}from"./proxy-TcOPxGtH.js";import"./i18n-context-DuXOzqEp.js";import{u as Z}from"./hooks-ktRWiHiM.js";import{u as ee,d as te,e as se,c as ae,F as p}from"./components-C61DWoh4.js";import"./use-combine-values-xozz9E_C.js";function O({name:b,value:g,options:I,onChange:k,className:U,placeholder:f}){const[D,y]=u.useState(!1),E=u.useRef(null),x=I.find(o=>o.value===g);return u.useEffect(()=>{const o=L=>{E.current&&!E.current.contains(L.target)&&y(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]),e.jsxs("div",{className:h("relative w-full min-w-[120px]",U),ref:E,children:[b&&e.jsx("input",{type:"hidden",name:b,value:g}),e.jsxs("button",{type:"button",onClick:()=>y(!D),className:"w-full px-4 py-2.5 rounded-xl bg-white/[0.03] hover:bg-white/[0.08] border border-white/10 text-xs text-left outline-none transition-all flex items-center justify-between group active:scale-[0.98]",children:[e.jsx("span",{className:h("truncate",!x&&"text-gray-500"),children:x?x.label:f||"Select..."}),e.jsx("svg",{className:h("w-4 h-4 text-gray-400 transition-transform duration-300 shrink-0 ml-2",D&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),e.jsx(Q,{children:D&&e.jsx(S.div,{initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute z-50 w-full min-w-max mt-2 p-1.5 rounded-2xl bg-[#1A1A1A]/80 backdrop-blur-2xl border border-white/10 shadow-[0_20px_40px_rgba(0,0,0,0.5)]",children:I.map(o=>e.jsx("button",{type:"button",onClick:()=>{o.value!==g&&(k==null||k(o.value)),y(!1)},className:h("w-full text-left px-3 py-2.5 rounded-xl text-xs transition-colors",g===o.value?"bg-[#0071E3]/20 text-[#0071E3] font-bold":"text-gray-300 hover:bg-white/10"),children:o.label},o.value))})})]})}const G=["CREATED","UNPAID","PAID","FULFILLING","SHIPPED","COMPLETED","CANCELLED","REFUNDING","REFUNDED"],ne=["INITIATED","PENDING","SUCCEEDED","FAILED","CANCELLED","REFUNDED"];function be(){var H;const{orders:b,agents:g,q:I,status:k,paymentStatus:U}=ee(),[f,D]=u.useState(b),[y,E]=u.useState(b.length===50),[x,o]=u.useState(null),L=(t,s,d,m,r,c)=>{t.preventDefault(),o({isOpen:!0,intent:s,id:d,actionLabel:m,title:r,message:c})},a=Z(),w=te(),v=K(),V=se(),j=ae(),$=u.useRef(null),P=v.state==="loading"||v.state==="submitting"&&!((H=v.formData)!=null&&H.has("intent")),_=j.state!=="idle";u.useEffect(()=>{D(b),E(b.length===50)},[b]),u.useEffect(()=>{if(j.data&&j.state==="idle"){const t=j.data.orders;t&&(D(s=>{const d=[...s];for(const m of t)d.find(r=>r.id===m.id)||d.push(m);return d}),E(t.length===50))}},[j.data,j.state]),u.useEffect(()=>{const t=new IntersectionObserver(s=>{if(s[0].isIntersecting&&y&&!_){const d=new URLSearchParams(window.location.search);d.set("skip",f.length.toString()),j.load(`/admin/orders?${d.toString()}`)}},{threshold:.1});return $.current&&t.observe($.current),()=>t.disconnect()},[y,_,f.length,j]);const A=(t,s)=>{const d=a(t);return d===t?s:d},F=t=>A(`status.order.${t}`,t),W=t=>A(`status.commission.${t}`,t),M=t=>A(`status.payment.${t}`,t),X=t=>h("text-[10px] font-bold uppercase px-2 py-0.5 rounded-full border inline-block",t==="PAID"||t==="COMPLETED"?"bg-green-500/10 text-green-400 border-green-500/20":t==="FULFILLING"||t==="SHIPPED"?"bg-blue-500/10 text-blue-400 border-blue-500/20":t==="REFUNDING"||t==="REFUNDED"||t==="CANCELLED"?"bg-red-500/10 text-red-400 border-red-500/20":"bg-white/5 text-gray-300 border-white/10"),B=t=>h("text-[10px] font-bold uppercase px-2 py-0.5 rounded-full border inline-block",t==="SUCCEEDED"?"bg-green-500/10 text-green-400 border-green-500/20":t==="PENDING"||t==="INITIATED"?"bg-blue-500/10 text-blue-400 border-blue-500/20":t==="REFUNDED"||t==="FAILED"||t==="CANCELLED"?"bg-red-500/10 text-red-400 border-red-500/20":"bg-white/5 text-gray-300 border-white/10"),z=t=>{var s;return t.sourceType==="STORE_QR"?`åºå®¶ QR${(s=t.store)!=null&&s.code?` / ${t.store.code}`:""}`:t.sourceType?`${t.sourceType}${t.sourceCode?` / ${t.sourceCode}`:""}`:t.salesCode?`æ¥å碼 / ${t.salesCode}`:"ç´æ¥ä¸å®"},R=(t,s)=>{var m,r;const d=((m=t.sourceSnapshot)==null?void 0:m.paymentMode)||((r=s==null?void 0:s.rawCallback)==null?void 0:r.paymentMode)||"";return d==="IN_STORE"?"éå¸ç¾å ´ä»æ¬¾":d==="BANK_TRANSFER"?"è½å¸³å¾
æ ¸å°":d==="ONLINE"?"ç·ä¸ä»æ¬¾":""},T=t=>t.status==="UNPAID"&&Date.now()-new Date(t.createdAt).getTime()>864e5?{label:A("status.order.EXPIRED","失æ (龿æªçµ)"),className:"text-[10px] font-bold uppercase px-2 py-0.5 rounded-full border inline-block bg-gray-500/10 text-gray-400 border-gray-500/20"}:{label:F(t.status),className:X(t.status)};return e.jsxs(Y,{children:[e.jsxs("div",{className:"mb-10 flex flex-col md:flex-row md:items-end md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-gray-500 uppercase tracking-[0.2em] mb-2",children:a("common.management")}),e.jsx("h1",{className:"text-4xl font-heading font-black text-white tracking-tight",children:a("admin.orders.title")}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:a("admin.orders.subtitle")})]}),e.jsxs(p,{method:"get",className:"flex flex-col md:flex-row md:items-center gap-2",onCh
1ange:t=>w(t.currentTarget,{replace:!0}),children:[e.jsx("input",{name:"q",defaultValue:I,placeholder:a("admin.orders.searchPlaceholder"),className:"w-72 max-w-full px-4 py-3 rounded-xl bg-white/[0.02] border border-white/10 text-sm outline-none focus:border-white/30"}),e.jsxs("select",{name:"status",defaultValue:k||"",className:"w-40 px-3 py-3 rounded-xl bg-white/[0.02] border border-white/10 text-sm outline-none focus:border-white/30",children:[e.jsx("option",{value:"",className:"bg-phantom-black text-white",children:a("admin.orders.filter.allStatuses")}),G.map(t=>e.jsx("option",{value:t,className:"bg-phantom-black text-white",children:F(t)},t))]}),e.jsxs("select",{name:"payment_status",defaultValue:U||"",className:"w-44 px-3 py-3 rounded-xl bg-white/[0.02] border border-white/10 text-sm outline-none focus:border-white/30",children:[e.jsx("option",{value:"",className:"bg-phantom-black text-white",children:a("admin.orders.filter.allPayments")}),e.jsx("option",{value:"NONE",className:"bg-phantom-black text-white",children:a("admin.common.noPayment")}),ne.map(t=>e.jsx("option",{value:t,className:"bg-phantom-black text-white",children:M(t)},t))]}),e.jsx("button",{type:"submit",className:h("text-[10px] font-bold uppercase tracking-widest border border-white/10 px-4 py-3 rounded-xl hover:bg-white/10 transition-colors",P?"opacity-60 pointer-events-none":""),children:P?"â¦":a("common.search")})]})]}),e.jsx(S.div,{variants:J,children:e.jsxs(q,{className:"p-0 overflow-hidden",intensity:"low",children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-white/5 bg-white/[0.02]",children:[e.jsx("th",{className:"px-4 py-3 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:a("admin.common.order")}),e.jsx("th",{className:"px-4 py-3 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:a("admin.common.status")}),e.jsx("th",{className:"px-4 py-3 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:a("admin.common.amount")}),e.jsx("th",{className:"px-4 py-3 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:a("admin.common.payment")}),e.jsx("th",{className:"px-4 py-3 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:a("admin.common.sales")}),e.jsx("th",{className:"px-4 py-3 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:a("admin.common.commission")}),e.jsx("th",{className:"px-4 py-3 text-[10px] font-bold text-gray-500 uppercase tracking-widest text-right",children:a("admin.common.actions")})]})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:P?Array.from({length:15}).map((t,s)=>e.jsxs("tr",{className:"border-b border-white/[0.02]",children:[e.jsxs("td",{className:"px-4 py-4",children:[e.jsx("div",{className:"w-24 h-4 shimmer-effect rounded mb-2"}),e.jsx("div",{className:"w-16 h-3 shimmer-effect rounded"})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("div",{className:"w-20 h-5 shimmer-effect rounded-full"})}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsx("div",{className:"w-32 h-4 shimmer-effect rounded mb-2"}),e.jsx("div",{className:"w-24 h-3 shimmer-effect rounded"})]}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsx("div",{className:"w-24 h-4 shimmer-effect rounded mb-2"}),e.jsx("div",{className:"w-20 h-4 shimmer-effect rounded"})]}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsx("div",{className:"w-16 h-4 shimmer-effect rounded mb-2"}),e.jsx("div",{className:"w-12 h-3 shimmer-effect rounded"})]}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsx("div",{className:"w-12 h-4 shimmer-effect rounded mb-2"}),e.jsx("div",{className:"w-12 h-3 shimmer-effect rounded"})]}),e.jsx("td",{className:"px-4 py-4 text-right",children:e.jsx("div",{className:"inline-block w-8 h-8 shimmer-effect rounded-lg"})})]},s)):f.length===0?e.jsx("tr",{children:e.jsx("td",{className:"px-4 py-10 text-center text-gray-600 italic",colSpan:7,children:a("admin.orders.noOrders")})}):f.map(t=>{var C;let s={...t},d=t.payments[0]?{...t.payments[0]}:null;const m=[...V];v.formData&&m.push({formData:v.formData});for(const i of m)if(i.formData&&i.formData.get("id")===t.id){const n=i.formData.get("intent");n==="set-status"?s.status=String(i.formData.get("status")):n==="mark-paid"?(s.status="PAID",d?d.status="SUCCEEDED":d={status:"SUCCEEDED",provider:"MANUA
1L",method:"",paidAt:new Date}):n==="mark-refunded"?(s.status="REFUNDED",d&&(d.status="REFUNDED")):n==="assign-agent"?s.salesAgentId=String(i.formData.get("salesAgentId")):n==="set-sales-code"&&(s.salesCode=String(i.formData.get("salesCode")))}const r=d,c=t.commissions[0];return e.jsxs("tr",{className:"hover:bg-white/[0.02] transition-colors align-top",children:[e.jsxs("td",{className:"px-4 py-4",children:[e.jsx("div",{className:"text-sm font-bold text-white",children:t.orderNumber}),e.jsx("div",{className:"text-[10px] font-mono text-gray-500",children:new Date(t.createdAt).toLocaleString()}),e.jsxs("div",{className:"text-[10px] text-gray-500 truncate",children:[t.shippingName," · ",t.shippingEmail]}),e.jsx("div",{className:"mt-2 inline-flex rounded-full border border-white/10 bg-white/[0.03] px-2 py-0.5 text-[10px] text-blue-200",children:z(t)})]}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsx("div",{className:T(s).className,children:T(s).label}),t.member?e.jsxs("div",{className:"text-[10px] text-gray-500 mt-2",children:[a("admin.common.member"),": ",t.member.name]}):e.jsx("div",{className:"text-[10px] text-gray-600 mt-2 italic",children:a("admin.common.guest")})]}),e.jsxs("td",{className:"px-4 py-4 text-sm font-mono text-gray-300",children:[t.totalAmount.toLocaleString(),e.jsxs("div",{className:"text-[10px] text-gray-500 mt-1",children:[a("admin.common.subtotal")," ",t.subtotalAmount.toLocaleString()," · ",a("admin.common.discount")," ",t.discountAmount.toLocaleString()," · ",a("admin.common.points")," ",t.pointsRedeemed.toLocaleString()]})]}),e.jsx("td",{className:"px-4 py-4",children:r?e.jsxs("div",{children:[e.jsxs("div",{className:"text-xs font-mono text-gray-300",children:[r.provider," / ",r.method||"â"]}),e.jsx("div",{className:"mt-2",children:e.jsx("span",{className:B(r.status),children:M(r.status)})}),r.paidAt?e.jsxs("div",{className:"text-[10px] text-gray-500",children:[a("admin.common.paidAt"),": ",new Date(r.paidAt).toLocaleString()]}):null,R(t,r)?e.jsx("div",{className:"mt-2 text-[10px] text-amber-300",children:R(t,r)}):null]}):e.jsx("div",{className:"text-xs text-gray-600 italic",children:a("admin.common.noPayment")})}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsxs("div",{className:"text-xs font-mono text-gray-300",children:[a("admin.common.code"),": ",s.salesCode||"â"]}),e.jsxs("div",{className:"text-[10px] text-gray-500",children:[a("admin.common.agent"),": ",s.salesAgentId&&((C=g.find(i=>i.id===s.salesAgentId))==null?void 0:C.name)||"â"]}),t.claimedAt?e.jsxs("div",{className:"text-[10px] text-gray-500",children:[a("admin.common.claimed"),": ",new Date(t.claimedAt).toLocaleString()]}):null]}),e.jsx("td",{className:"px-4 py-4",children:c?e.jsxs("div",{children:[e.jsxs("div",{className:"text-xs font-mono text-gray-300",children:[(c.rateBps/100).toFixed(2),"% · ",c.commissionAmount.toLocaleString()]}),e.jsx("div",{className:h("text-[10px] font-bold uppercase px-2 py-0.5 rounded-full border mt-2 inline-block",c.status==="PAID"?"bg-green-500/10 text-green-400 border-green-500/20":c.status==="APPROVED"?"bg-blue-500/10 text-blue-400 border-blue-500/20":c.status==="VOID"?"bg-red-500/10 text-red-400 border-red-500/20":"bg-white/5 text-gray-300 border-white/10"),children:W(c.status)})]}):e.jsx("div",{className:"text-xs text-gray-600 italic",children:a("admin.common.notGenerated")})}),e.jsx("td",{className:"px-4 py-4 text-right",children:e.jsx("div",{className:"flex flex-col gap-3 items-end",children:e.jsxs("details",{className:"w-full md:w-auto",children:[e.jsx("summary",{className:"cursor-pointer select-none text-[10px] font-bold uppercase tracking-widest text-gray-400 hover:text-white",children:a("admin.common.actions")}),e.jsxs("div",{className:"mt-2 flex flex-col gap-2 items-end",children:[e.jsxs(p,{method:"post",className:"flex items-center gap-2",children:[e.jsx("input",{type:"hidden",name:"intent",value:"set-status"}),e.jsx("input",{type:"hidden",name:"id",value:t.id}),e.jsx(O,{name:"status",value:s.status,options:G.filter(i=>i!=="PAID"||s.status==="PAID").map(i=>({label:F(i),value:i})),onChange:i=>{const n=new FormData;n.append("intent","set-status"),n.append("id",t.id),n.append("status",i),w(n,{method:"post",navigate:!1})}})]}),e.jsxs(p,{method:"post",className:"flex items-center gap-2",children:[e.jsx("input",{type:"hidden",name:"intent",value:"assign-agent"}),e.jsx("input",{type:"hidden",name:"id",value:t.id}),e.jsx(O,{name:"salesAgentId",value:s.salesAgentId||"",options:[{label:a("admin.orders.noAgent"),value:""},...g.map(i=>({label:`${i.name}
1 (${i.code})`,value:i.id}))],onChange:i=>{const n=new FormData;n.append("intent","assign-agent"),n.append("id",t.id),n.append("salesAgentId",i),w(n,{method:"post",navigate:!1})}})]}),e.jsxs(p,{method:"post",className:"flex items-center gap-2",children:[e.jsx("input",{type:"hidden",name:"intent",value:"update-shipping"}),e.jsx("input",{type:"hidden",name:"id",value:t.id}),e.jsx("input",{name:"shippingCarrier",defaultValue:t.shippingCarrier||"",placeholder:a("admin.orders.shippingCarrier"),className:"w-28 px-3 py-2 rounded-xl bg-white/[0.02] border border-white/10 text-xs outline-none focus:border-white/30"}),e.jsx("input",{name:"shippingTrackingNo",defaultValue:t.shippingTrackingNo||"",placeholder:a("admin.orders.shippingTracking"),className:"w-40 px-3 py-2 rounded-xl bg-white/[0.02] border border-white/10 text-xs outline-none focus:border-white/30"}),e.jsx("button",{type:"submit",className:"text-[10px] font-bold uppercase tracking-widest border border-white/10 px-3 py-2 rounded-xl hover:bg-white/10 transition-colors",children:a("admin.orders.ship")})]}),e.jsxs(p,{method:"post",className:"flex items-center gap-2",children:[e.jsx("input",{type:"hidden",name:"intent",value:"set-sales-code"}),e.jsx("input",{type:"hidden",name:"id",value:t.id}),e.jsx("input",{name:"salesCode",defaultValue:s.salesCode||"",placeholder:a("admin.orders.salesCode"),className:"w-40 px-3 py-2 rounded-xl bg-white/[0.02] border border-white/10 text-xs outline-none focus:border-white/30"}),e.jsx("button",{type:"submit",className:"text-[10px] font-bold uppercase tracking-widest border border-white/10 px-3 py-2 rounded-xl hover:bg-white/10 transition-colors",children:a("admin.orders.set")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(p,{method:"post",children:[e.jsx("input",{type:"hidden",name:"intent",value:"mark-paid"}),e.jsx("input",{type:"hidden",name:"id",value:t.id}),e.jsx("button",{type:"submit",className:"text-[10px] font-bold uppercase tracking-widest border border-green-500/20 text-green-400 px-3 py-2 rounded-xl hover:bg-green-500/10 transition-colors",children:a("admin.orders.markPaid")})]}),e.jsxs(p,{method:"post",children:[e.jsx("input",{type:"hidden",name:"intent",value:"mark-refunded"}),e.jsx("input",{type:"hidden",name:"id",value:t.id}),e.jsx("button",{type:"button",onClick:i=>L(i,"mark-refunded",t.id,a("admin.orders.markRefunded"),"確èªé款ï¼","æ¤æä½å°ææ¨è¨æ¤è¨å®èéæµçºå·²é款ï¼å¾çºç¡æ³è¼æå¾©åï¼"),className:"text-[10px] font-bold uppercase tracking-widest border border-red-500/20 text-red-400 px-3 py-2 rounded-xl hover:bg-red-500/10 transition-colors",children:a("admin.orders.markRefunded")})]})]})]})]})})})]},t.id)})})]})}),e.jsx("div",{className:"md:hidden divide-y divide-white/5",children:P?Array.from({length:8}).map((t,s)=>e.jsxs(q,{className:"p-4 mx-4 my-2",children:[e.jsxs("div",{className:"flex justify-between mb-4",children:[e.jsx("div",{className:"w-24 h-4 shimmer-effect rounded"}),e.jsx("div",{className:"w-16 h-5 shimmer-effect rounded-full"})]}),e.jsxs("div",{className:"space-y-3 mb-4",children:[e.jsx("div",{className:"w-full h-3 shimmer-effect rounded"}),e.jsx("div",{className:"w-3/4 h-3 shimmer-effect rounded"})]}),e.jsx("div",{className:"w-full h-8 shimmer-effect rounded-lg"})]},`mob-skel-${s}`)):f.length===0?e.jsx("div",{className:"p-8 text-center text-gray-600 italic",children:a("admin.orders.noOrders")}):(()=>{let t="";return f.map(s=>{const d=new Date(s.createdAt).toLocaleDateString("zh-TW",{month:"short",day:"numeric"}),m=d!==t;m&&(t=d);let r={...s},c=s.payments[0]?{...s.payments[0]}:null;const C=[...V];v.formData&&C.push({formData:v.formData});for(const n of C)if(n.formData&&n.formData.get("id")===s.id){const l=n.formData.get("intent");l==="set-status"?r.status=String(n.formData.get("status")):l==="mark-paid"?(r.status="PAID",c&&(c.status="SUCCEEDED")):l==="mark-refunded"?(r.status="REFUNDED",c&&(c.status="REFUNDED")):l==="assign-agent"?r.salesAgentId=String(n.formData.get("salesAgentId")):l==="set-sales-code"&&(r.salesCode=String(n.formData.get("salesCode")))}const i=c;return e.jsxs("div",{children:[m&&e.jsx("div",{className:"sticky top-16 z-20 -mx-4 px-4 py-2 bg-[#000000]/80 backdrop-blur-3xl border-b border-white/5 mb-4 shadow-sm",children:e.jsx("span",{className:"text-xs font-bold text-white tracking-widest",children:d})}),e.jsxs(S.div,{className:"p-6 space-y-6 relative bg-[#1C1C1E] rounded-[24px] mb-4 border border-white/5",drag:"x",dragConstraints:{left:-100,right:0},dragElastic:.2,onDragEnd:(n,l)=>{if(l.offset.x<-80&&r.status==="UNPAID"){if(!window.confirm("確èªå·²æ¶å°æ¬¾é
並以人工æ¨è¨ä»æ¬¾ï¼"))return;const N=new FormData;N.append("intent","mark-paid"),N.append("id",s.id),w(N,{method:"post",navigate:!1})}else if(l.offset.x<-80&&r.status==="PAID"){const N=new FormData;N.append("intent","set-status"),N.append("id",s.id),N.append("status","SHIPPED"),w(N,{method:"post",navigate:!1})}},children:[e.jsx("div",{className:"absolute inset-y-0 -right-2 w-20 flex flex-col items-center justify-center opacity-0 [transform:translateX(100%)] pointer-events-none group-active:opacity-100 transition-opacity",children:r.status==="UNPAID"?e.jsx("div",{className:"bg-green-500/20 text-green-400 p-3 rounded-xl border border-green-500/30",children:e.jsx("span",{className:"text-xs font-bold",children:"ð° æ¶æ¬¾"})}):r.status==="PAID"?e.jsx("div",{className:"bg-blue-500/20 text-blue-400 p-3 rounded-xl border border-blue-500/30",children:e.jsx("span",{className:"text-xs font-bold",children:"ð¦ åºè²¨"})}):null}),e.jsxs("div",{className:"flex justify-between items-start relative z-10",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-bold text-white",children:s.orderNumber}),e.jsx("div",{className:"text-[10px] font-mono text-gray-500",children:new Date(s.createdAt).toLocaleTimeString()}),e.jsx("div",{className:"mt-2 inline-flex rounded-full border border-white/10 bg-white/[0.03] px-2 py-0.5 text-[10px] text-blue-200",children:z(s)})]}),e.jsx("div",{className:T(r).className,children:T(r).label})]}),e.jsxs("div",{className:"space-y-4 bg-white/5 rounded-2xl p-4",children:[e.jsxs("div",{className:"flex justify-between items-center border-b border-white/5 pb-2",children:[e.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-widest",children:a("admin.common.member")}),e.jsx("span",{className:"text-sm text-white",children:s.member?s.member.name:a("admin.common.guest")})]}),e.jsxs("div",{className:"flex justify-between items-center border-b border-white/5 pb-2",children:[e.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-widest",children:a("admin.common.amount")}),e.jsxs("span",{className:"text-sm font-mono text-white",children:["$",s.totalAmount.toLocaleStr
1ing()]})]}),e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-widest",children:a("admin.common.payment")}),e.jsx("div",{className:"text-right",children:i?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-xs text-gray-300 font-mono",children:i.provider}),e.jsx("div",{className:h(B(i.status),"mt-1"),children:M(i.status)}),R(s,i)?e.jsx("div",{className:"mt-2 text-[10px] text-amber-300",children:R(s,i)}):null]}):e.jsx("span",{className:"text-xs text-gray-600 italic",children:a("admin.common.noPayment")})})]})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("details",{className:"w-full",children:[e.jsx("summary",{className:"w-full py-3 bg-white/5 border border-white/10 rounded-xl text-center text-xs font-bold uppercase tracking-widest cursor-pointer select-none",children:a("admin.common.actions")}),e.jsxs("div",{className:"mt-4 space-y-4 pt-4 border-t border-white/5",children:[e.jsxs(p,{method:"post",className:"space-y-2",children:[e.jsx("input",{type:"hidden",name:"intent",value:"set-status"}),e.jsx("input",{type:"hidden",name:"id",value:s.id}),e.jsx("div",{className:"flex gap-2",children:e.jsx(O,{name:"status",value:r.status,options:G.filter(n=>n!=="PAID"||r.status==="PAID").map(n=>({label:F(n),value:n})),onChange:n=>{const l=new FormData;l.append("intent","set-status"),l.append("id",s.id),l.append("status",n),w(l,{method:"post",navigate:!1})}})})]}),e.jsxs(p,{method:"post",className:"space-y-2",children:[e.jsx("input",{type:"hidden",name:"intent",value:"assign-agent"}),e.jsx("input",{type:"hidden",name:"id",value:s.id}),e.jsx("div",{className:"flex gap-2",children:e.jsx(O,{name:"salesAgentId",value:r.salesAgentId||"",options:[{label:a("admin.orders.noAgent"),value:""},...g.map(n=>({label:`${n.name} (${n.code})`,value:n.id}))],onChange:n=>{const l=new FormData;l.append("intent","assign-agent"),l.append("id",s.id),l.append("salesAgentId",n),w(l,{method:"post",navigate:!1})}})})]}),e.jsxs(p,{method:"post",className:"space-y-3",children:[e.jsx("input",{type:"hidden",name:"intent",value:"update-shipping"}),e.jsx("input",{type:"hidden",name:"id",value:s.id}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("input",{name:"shippingCarrier",defaultValue:s.shippingCarrier||"",placeholder:a("admin.orders.shippingCarrier"),className:"px-3 py-3 rounded-xl bg-white/5 border border-white/10 text-xs outline-none"}),e.jsx("input",{name:"shippingTrackingNo",defaultValue:s.shippingTrackingNo||"",placeholder:a("admin.orders.shippingTracking"),className:"px-3 py-3 rounded-xl bg-white/5 border border-white/10 text-xs outline-none"})]}),e.jsx("button",{type:"submit",className:"w-full py-3 bg-white/10 text-white border border-white/20 text-[10px] font-bold uppercase rounded-xl hover:bg-white/20 transition-all",children:a("admin.orders.ship")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-2",children:[e.jsxs(p,{method:"post",children:[e.jsx("input",{type:"hidden",name:"intent",value:"mark-paid"}),e.jsx("input",{type:"hidden",name:"id",value:s.id}),e.jsx("button",{type:"submit",className:"w-full py-3 border border-green-500/20 text-green-400 text-[10px] font-bold uppercase rounded-xl hover:bg-green-500/10 transition-all",children:a("admin.orders.markPaid")})]}),e.jsx("button",{type:"button",onClick:n=>L(n,"mark-refunded",s.id,a("admin.orders.markRefunded"),"確èªé款ï¼","æ¤æä½å°ææ¨è¨æ¤è¨å®èéæµçºå·²é款ï¼å¾çºç¡æ³è¼æå¾©åï¼"),className:"w-full py-3 border border-red-500/20 text-red-400 text-[10px] font-bold uppercase rounded-xl hover:bg-red-500/10 transition-all",children:a("admin.orders.markRefunded")})]})]})]})})]})]},s.id)})})()}),y&&e.jsx("div",{ref:$,className:"py-8 flex justify-center items-center gap-3 text-gray-500 text-xs font-bold uppercase tracking-widest",children:_?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-dashed border-gray-500 animate-spin"}),A("admin.common.loading","Loading...")]}):"Loading more..."})]})}),e.jsx(Q,{children:(x==null?void 0:x.isOpen)&&e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center px-4",children:[e.jsx(S.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},onClick:()=>o(null),className:"absolute inset-0 bg-black/40 backdrop-blur-md cursor-pointer"}),e.jsxs(S.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"relative w-full max-w-sm bg-white/80 dark:bg-black/40 border border-[#E5E5EA] dark:border-white/10 p-8 rounded-[28px] shadow-[0_40px_80px_rgba(0,0,0,0.15)] backdrop-blur-3xl text-center",children:[e.jsx("div",{className:"w-16 h-16 mx-auto bg-red-500/10 rounded-full flex items-center justify-center text-2xl mb-4 text-red-500 shadow-inner",children:"â ï¸"}),e.jsx("h3",{className:"text-[20px] font-bold text-[#1D1D1F] dark:text-white mb-2 tracking-tight",children:x.title}),e.jsx("p",{className:"text-[14px] text-[#8E8E93] leading-relaxed mb-6",children:x.message}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>o(null),className:"flex-1 py-3.5 bg-black/5 dark:bg-white/5 text-[#0071E3] dark:text-white rounded-[14px] font-semibold text-[15px] hover:bg-black/10 dark:hover:bg-white/10 transition-colors",children:"åæ¶"}),e.jsxs(p,{method:"post",className:"flex-1",onSubmit:()=>o(null),children:[e.jsx("input",{type:"hidden",name:"intent",value:x.intent}),e.jsx("input",{type:"hidden",name:"id",value:x.id}),e.jsx("button",{type:"submit",className:"w-full h-full py-3.5 bg-[#FF3B30]/10 text-[#FF3B30] rounded-[14px] font-semibold text-[15px] hover:bg-[#FF3B30]/20 transition-colors",children:x.actionLabel})]})]})]})]})})]})}export{be as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.