import{d as e,b as n}from"./app-DTeOhhdM.js";import{l as y}from"./defualtLogo-C0dU5cUD.js";function w({sales:t,auth:u}){var m,x,l;const N=r=>{var o,h,b,s,g;return((o=r==null?void 0:r.product)==null?void 0:o.name)??((b=(h=r==null?void 0:r.attribute)==null?void 0:h.product)==null?void 0:b.name)??((g=(s=r==null?void 0:r.arribute)==null?void 0:s.product)==null?void 0:g.name)??(r==null?void 0:r.name)??(r==null?void 0:r.product_name)??"—"},i={name:e.name,address:e.address,phone:e.phone,slogan:e.slogan},a=((m=t==null?void 0:t.details)==null?void 0:m.map(r=>({name:N(r),quantity:r.qty??1,note:r.note??r.remark??""})))??[],j=t!=null&&t.created_at?new Date(t.created_at).toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):"",c=((x=t==null?void 0:t.table)==null?void 0:x.name)??((l=t==null?void 0:t.table)==null?void 0:l.label)??(t==null?void 0:t.table_name)??(t==null?void 0:t.order_type)??"",d=(t==null?void 0:t.order_slot)??null,p=(t==null?void 0:t.table_order_key)??(c&&d?`${c} #${d}`:null);return n.jsxs("div",{className:"w-[80mm] max-w-[80mm] mx-auto break-after-avoid-page hidden print:bg-white print:relative print:block print:w-[80mm]",children:[n.jsx("style",{children:`
                @media print {
                    @page { size: 80mm auto; margin: 0; padding: 0; }
                    body { margin: 0; padding: 0; }
                    .print-3inch { width: 80mm !important; max-width: 80mm !important; font-size: 12px !important; color: #000 !important; }
                    .print-3inch * { color: inherit !important; }
                    .print-3inch p, .print-3inch span, .print-3inch div { color: #000 !important; font-weight: 500 !important; }
                    .print-3inch .font-semibold, .print-3inch .font-bold { font-weight: 700 !important; }
                    .print-3inch .font-medium { font-weight: 600 !important; }
                }
            `}),n.jsxs("div",{className:"print-3inch text-center py-2 border-b-2 border-gray-800",children:[e.companyLogo&&n.jsx("img",{src:e.companyLogo||y,alt:"Logo",className:"w-10 h-10 mx-auto mb-1 object-contain"}),n.jsx("h2",{className:"text-base font-bold uppercase tracking-wide leading-tight",children:i.name}),i.slogan&&n.jsx("p",{className:"text-[10px] text-gray-600 italic mt-0.5",children:i.slogan})]}),n.jsxs("div",{className:"print-3inch text-center py-1.5 border-b-2 border-amber-600 bg-amber-50/80",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-amber-900",children:"KITCHEN ORDER"}),n.jsxs("div",{className:"text-[10px] mt-1 space-y-0.5 text-gray-700",children:[t!=null&&t.invoice_no?n.jsxs("p",{children:[n.jsx("span",{className:"font-semibold",children:"Invoice #:"})," ",t.invoice_no]}):null,n.jsxs("p",{children:[n.jsx("span",{className:"font-semibold",children:"Date & Time:"})," ",j]}),p&&n.jsxs("p",{children:[n.jsx("span",{className:"font-semibold",children:"Slot No.:"})," ",p]})]})]}),n.jsxs("div",{className:"print-3inch py-1",children:[n.jsx("p",{className:"text-[10px] font-bold uppercase mb-1 border-b border-gray-400 pb-0.5",children:"Selected items"}),n.jsxs("div",{className:"text-[10px] font-semibold grid grid-cols-12 gap-0.5 py-0.5 border-b border-gray-400",children:[n.jsx("div",{className:"col-span-8",children:"Item"}),n.jsx("div",{className:"col-span-4 text-center",children:"Qty"})]}),a.length===0?n.jsx("p",{className:"text-[10px] text-gray-500 py-2",children:"No items selected"}):a.map((r,o)=>n.jsx("div",{className:"border-b border-gray-200 py-0.5 text-[10px]",children:n.jsxs("div",{className:"grid grid-cols-12 gap-x-1 items-baseline",children:[n.jsxs("div",{className:"col-span-8 min-w-0",children:[n.jsx("p",{className:"font-medium leading-tight",children:r.name}),r.note&&n.jsxs("p",{className:"text-[9px] text-amber-700 italic",children:["Note: ",r.note]})]}),n.jsx("div",{className:"col-span-4 text-center font-bold",children:r.quantity})]})},o))]}),n.jsx("div",{className:"print-3inch text-center py-1.5 mt-1 border-t border-gray-400",children:n.jsx("p",{className:"text-[10px] font-bold text-gray-600",children:"— KITCHEN COPY —"})})]})}export{w as default};
