import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{l as n}from"./api-672io9y2.js";import{r,s as i}from"./utils-BO1RPuol.js";import{t as a}from"./download-CcXpNtZ6.js";import{r as o}from"./Helper-DM8_S2CX.js";import{So as s,Wr as c,da as l,va as u,za as d}from"./index-CsuVxiRQ.js";import{a as f,i as p,n as m,r as h,t as g}from"./offer-cover-page-DADj1NAY.js";import{a as _,i as v,n as y,o as b,t as x}from"./dialog-BT7QjyH-.js";import{t as S}from"./company_stamp-CCGmsRWq.js";var C=e(t(),1),w=e(f(),1),T=i(),E=`https://api.rodinia.absol.in/api`;function D(e){if(e===0)return`ZERO`;let t=[``,`ONE`,`TWO`,`THREE`,`FOUR`,`FIVE`,`SIX`,`SEVEN`,`EIGHT`,`NINE`,`TEN`,`ELEVEN`,`TWELVE`,`THIRTEEN`,`FOURTEEN`,`FIFTEEN`,`SIXTEEN`,`SEVENTEEN`,`EIGHTEEN`,`NINETEEN`],n=[``,``,`TWENTY`,`THIRTY`,`FORTY`,`FIFTY`,`SIXTY`,`SEVENTY`,`EIGHTY`,`NINETY`],r=e=>e<20?t[e]:e<100?n[Math.floor(e/10)]+(e%10?` `+t[e%10]:``):e<1e3?t[Math.floor(e/100)]+` HUNDRED`+(e%100?` AND `+r(e%100):``):e<1e5?r(Math.floor(e/1e3))+` THOUSAND`+(e%1e3?` `+r(e%1e3):``):e<1e7?r(Math.floor(e/1e5))+` LAKH`+(e%1e5?` `+r(e%1e5):``):r(Math.floor(e/1e7))+` CRORE`+(e%1e7?` `+r(e%1e7):``),i=Math.floor(e),a=Math.round((e-i)*100),o=r(i)+` RUPEES`;return a>0&&(o+=` AND `+r(a)+` PAISE`),o+` ONLY`}function O(e){return Number(e).toLocaleString(`en-IN`,{minimumFractionDigits:2,maximumFractionDigits:2})}var k={Valve:[`spec_make`,`spec_valve_type`,`spec_application`,`spec_design_standard`,`spec_testing_standard`,`spec_size`,`spec_class`,`spec_body`,`spec_seat`,`spec_disc`,`spec_shaft`,`spec_end_connection`,`spec_operation`],Actuator:[`spec_size`,`spec_pattern`,`spec_body`,`spec_end_connection`],Pipe:[`spec_size`,`spec_class`,`spec_body`,`spec_operation`],Fitting:[`spec_size`,`spec_class`,`spec_body`,`spec_end_connection`],Gasket:[`spec_size`,`spec_class`,`spec_gasket`],Fastener:[`spec_size`,`spec_class`,`spec_body`],Instrument:[`spec_size`,`spec_class`,`spec_end_connection`,`spec_service`,`spec_operation`],Service:[`spec_service`,`spec_operation`],Other:[`spec_size`,`spec_class`,`spec_pattern`,`spec_body`,`spec_trim`,`spec_seat`,`spec_seal`,`spec_gasket`,`spec_end_connection`,`spec_service`,`spec_operation`]};Object.fromEntries([[`spec_make`,`MAKE`],[`spec_valve_type`,`VALVE TYPE`],[`spec_application`,`APPLICATION`],[`spec_design_standard`,`DESIGN STANDARD`],[`spec_testing_standard`,`TESTING STANDARD`],[`spec_size`,`SIZE`],[`spec_class`,`CLASS`],[`spec_end_connection`,`END CONNECTION`],[`spec_body`,`BODY/ADAPTOR`],[`spec_disc`,`DISC`],[`spec_seat`,`SEAT/SEAL`],[`spec_seal`,`SEAL`],[`spec_trim`,`TRIM`],[`spec_shaft`,`SHAFT`],[`spec_gasket`,`GASKET`],[`spec_pattern`,`PATTERN`],[`spec_operation`,`OPERATIONS`],[`spec_service`,`SERVICE`]]);function A({sq:e,promptPrint:t,onPrintHandled:i}){let f=(0,C.useRef)(null),A=e.line_items||[],[j,M]=(0,C.useState)(!1),[N,P]=(0,C.useState)(!1),[F,I]=(0,C.useState)(null),{data:L}=l(),{data:R}=n(),{data:z}=c(e.client,{skip:!e.client});(0,C.useEffect)(()=>{(async()=>{try{let e=await o(`/masters/specification-config/mapping/`),t=e?.data??e;t&&typeof t==`object`&&(console.log(`Loaded spec config from backend:`,t),I(t))}catch{console.log(`Failed to load spec config, using fallback`)}})()},[]),(()=>{if(!F)return k;let e={};for(let[t,n]of Object.entries(F)){let r=t.charAt(0).toUpperCase()+t.slice(1);e[r]=n}return{...k,...e}})(),(0,C.useEffect)(()=>{t&&M(!0)},[t]);let B=async()=>{P(!0);try{let t=f.current;if(!t)return;let n=1123,r=new p({orientation:`portrait`,unit:`mm`,format:`a4`}),i=t.querySelectorAll(`.a4-page`);for(let e=0;e<i.length;e++){let t=document.createElement(`iframe`);t.style.cssText=`position:fixed;top:-9999px;left:-9999px;width:794px;height:${n}px;border:none;`,document.body.appendChild(t),await new Promise(r=>{let a=t.contentDocument;a.open(),a.write(`<!DOCTYPE html><html><head><style>
* { margin:0; padding:0; box-sizing:border-box; font-family:Calibri,Arial,sans-serif; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
body { background:#fff; color:#000; font-size:14px; }
table { border-collapse:collapse; width:100%; }
.cover-page { width:100%; background:#fff; }
.inner-page { width:100%; background:#fff; display:flex; flex-direction:column; min-height:${n}px; }
.page-header { padding:10px 16px 8px 16px; border-bottom:1px solid #ddd; display:flex; justify-content:space-between; align-items:flex-start; }
.page-body { flex:1; padding:12px 16px; }
.page-footer { border-top:2px solid #1a3a5c; padding:5px 16px; text-align:center; font-size:12px; color:#555; }
.page-footer .company { font-weight:700; color:#1a3a5c; }
.dark-heading { background:#1a3a5c !important; color:#fff !important; font-weight:700; font-size:15px; padding:8px 12px; }
.dark-row td { background:#1a3a5c !important; color:#fff !important; font-weight:700; }
.thead-row th { background:#c8d0d8 !important; }
</style></head><body>${i[e].outerHTML}</body></html>`),a.close(),t.onload=()=>r(),setTimeout(r,800)});let a=t.contentDocument.body.firstElementChild,o=await(0,w.default)(a,{scale:2,useCORS:!0,allowTaint:!0,backgroundColor:`#ffffff`,width:794,height:n,windowWidth:794,windowHeight:n});document.body.removeChild(t);let s=o.toDataURL(`image/jpeg`,.95);e>0&&r.addPage(),r.addImage(s,`JPEG`,0,0,210,297)}let a=r.output(`blob`),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=`Quotation-${e.code}.pdf`,s.click(),URL.revokeObjectURL(o)}finally{P(!1)}},V=()=>{M(!1),i?.(),setTimeout(()=>{let t=f.current;if(!t)return;let n=t.innerHTML,r=new URL(S,window.location.origin).href,i=new URL(m,window.location.origin).href,a=new URL(u,window.location.origin).href,o=new URL(h,window.location.origin).href;n=n.replace(/src="[^"]*company_stamp[^"]*"/g,`src="${r}"`),n=n.replace(/src="[^"]*construction[^"]*"/g,`src="${i}"`),n=n.replace(/src="[^"]*rodina_logo_no_bg[^"]*"/g,`src="${a}"`),n=n.replace(/src="[^"]*finallogo[^"]*"/g,`src="${o}"`);let s=e=>e.replace(/src="[^"]*company_stamp[^"]*"/g,`src="${r}"`).replace(/src="[^"]*construction[^"]*"/g,`src="${i}"`).replace(/src="[^"]*rodina_logo_no_bg[^"]*"/g,`src="${a}"`).replace(/src="[^"]*finallogo[^"]*"/g,`src="${o}"`),c=f.current?.querySelector(`.inner-page`),l=s(f.current?.querySelector(`.cover-page`)?.innerHTML||``),d=s(c?.querySelector(`.page-header`)?.innerHTML||``),p=s(c?.querySelector(`.page-footer`)?.innerHTML||``),g=s(c?.querySelector(`.page-body`)?.innerHTML||``),_=`<!DOCTYPE html><html><head><title>Quotation - ${e.code}</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
body { font-family: Calibri, Arial, sans-serif; background: #fff; font-size: 14px; }
.dark-heading { background: #1a3a5c !important; color: #fff !important; font-weight: 700; font-size: 16px; padding: 9px 12px; }
.dark-row td { color: #fff !important; background: #1a3a5c !important; font-size: 14px; }
.thead-row th { background: #c8d0d8 !important; font-size: 13px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
#cover { page-break-after: always; break-after: page; }
#layout { width: 100%; border-collapse: collapse; table-layout: fixed; }
#layout thead td { padding: 8px 16px 6px; border-bottom: 1px solid #ddd; background: #fff; }
#layout tfoot td { border-top: 2px solid #1a3a5c; padding: 5px 16px; text-align: center; font-size: 12px; color: #555; background: #fff; }
#layout tfoot .company { font-weight: 700; color: #1a3a5c; }
#layout thead { display: table-header-group; }
#layout tfoot { display: table-footer-group; }
#layout tbody { display: table-row-group; }
.page-body { padding: 12px 16px; }
@page { size: A4 portrait; margin: 0; }
@page :first { margin: 0; }
</style></head><body>
<div id="cover">${l}</div>
<table id="layout">
<thead><tr><td><div style="display:flex;justify-content:space-between;align-items:flex-start">${d}</div></td></tr></thead>
<tfoot><tr><td>${p}</td></tr></tfoot>
<tbody><tr><td><div class="page-body" style="font-size:14px;color:#000">${g}</div></td></tr></tbody>
</table>
</body></html>`,v=document.createElement(`iframe`);v.style.cssText=`position:fixed;top:-10000px;left:-10000px;width:210mm;height:297mm;border:none;`,document.body.appendChild(v);let y=v.contentDocument||v.contentWindow?.document;if(!y)return;y.open(),y.write(_),y.close();let b=()=>{setTimeout(()=>document.body.removeChild(v),1e3)};v.onload=()=>{setTimeout(()=>{v.contentWindow?.focus(),v.contentWindow?.print(),b()},500)}},300)};Number(e.subtotal);let H=Number(e.total_tax)||0,U=Number(e.total_discount)||0;Number(e.total_value);let W=Number(e.packing_and_forwarding)||0,G=Number(e.freight_amount)||0,K=Number(e.insurance_amount)||0,q=Number(e.inspection_amount)||0,J=A.reduce((e,t)=>e+Number(t.offer_gross||0),0),Y=W+G+K+q,X=J-U,Z=Math.round(X+H+Y),Q=L?.address?L.address.split(`
`).join(`, `):``;return(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,T.jsxs)(d,{size:`sm`,variant:`outline`,onClick:B,disabled:N,children:[(0,T.jsx)(a,{className:`mr-1 size-4`}),` `,N?`Generating PDF...`:`Download PDF`]}),(0,T.jsxs)(d,{size:`sm`,onClick:()=>M(!0),children:[(0,T.jsx)(s,{className:`mr-1 size-4`}),` Print`]})]}),(0,T.jsx)(x,{open:j,onOpenChange:e=>{e||(M(!1),i?.())},children:(0,T.jsxs)(y,{className:`sm:max-w-md`,children:[(0,T.jsx)(_,{children:(0,T.jsx)(b,{className:`text-2xl font-bold`,children:`Print Quotation`})}),(0,T.jsx)(`div`,{className:`py-4`,children:(0,T.jsx)(`p`,{className:`text-base text-muted-foreground`,children:`Would you like to print this quotation?`})}),(0,T.jsxs)(v,{className:`gap-2 sm:gap-3`,children:[(0,T.jsx)(d,{variant:`outline`,size:`default`,onClick:()=>{M(!1),i?.()},children:`Cancel`}),(0,T.jsxs)(d,{size:`default`,onClick:V,className:`gap-2`,children:[(0,T.jsx)(s,{className:`size-4`}),` Yes, Print`]})]})]})}),(0,T.jsx)(`style`,{children:`
        @media screen {
          .a4-preview-wrap { background: #e8eaed; padding: 24px; }
          .a4-page {
            width: 210mm;
            min-height: 297mm;
            background: #fff;
            margin: 0 auto 24px auto;
            box-shadow: 0 2px 16px rgba(0,0,0,0.15);
            overflow: hidden;
            display: flex;
            flex-direction: column;
          }
          .page-header { padding: 10px 16px 8px 16px; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: flex-start; }
          .page-footer { border-top: 2px solid #1a3a5c; padding: 5px 16px; text-align: center; font-size: 12px; color: #555; }
          .page-footer .company { font-weight: 700; color: #1a3a5c; }
          .page-body { flex: 1; padding: 12px 16px; }
        }
        @media print {
          .a4-preview-wrap { background: none !important; padding: 0 !important; }
          .a4-page { width: 100% !important; box-shadow: none !important; margin: 0 !important; overflow: visible !important; }
          .cover-page { page-break-after: always; break-after: page; }
          .inner-page { page-break-before: always; break-before: page; }
          .inner-page .page-header { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; background: #fff !important; z-index: 100; border-bottom: 1px solid #ddd; padding: 8px 16px 6px 16px; }
          .inner-page .page-footer { position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; background: #fff !important; z-index: 100; border-top: 2px solid #1a3a5c; padding: 5px 16px; text-align: center; font-size: 12px; color: #555; }
          .inner-page .page-body { margin-top: 110px !important; margin-bottom: 60px !important; padding: 0 16px !important; }
          .cover-page .page-header, .cover-page .page-footer { display: none !important; }
        }
      `}),(0,T.jsxs)(`div`,{ref:f,className:`a4-preview-wrap`,children:[(0,T.jsx)(`div`,{className:`a4-page cover-page`,children:(0,T.jsx)(g,{sq:e})}),(0,T.jsx)(`div`,{className:`a4-page inner-page`,children:((t=!1)=>(0,T.jsxs)(`div`,{className:`inner-page`,children:[(0,T.jsxs)(`div`,{className:`page-header`,children:[(0,T.jsxs)(`div`,{style:{fontSize:`13px`,lineHeight:`1.7`,color:`#333`},children:[(0,T.jsxs)(`div`,{children:[`Quotation no.: `,(0,T.jsx)(`strong`,{children:e.code})]}),(0,T.jsxs)(`div`,{children:[`Reference: `,e.tender_code,e.tender_name?` / ${e.tender_name}`:``]}),(0,T.jsxs)(`div`,{children:[`Date: `,r(e.created_at)]}),(0,T.jsx)(`div`,{children:`Page no. 2`})]}),(0,T.jsx)(`div`,{style:{textAlign:`right`},children:(0,T.jsx)(`img`,{src:h,alt:`Logo`,style:{height:`80px`,objectFit:`contain`}})})]}),(0,T.jsxs)(`div`,{className:`page-body`,style:{fontFamily:`Calibri, Arial, sans-serif`,fontSize:`14px`,color:`#000`},children:[(0,T.jsxs)(`div`,{style:{display:`flex`,gap:`40px`,marginBottom:`16px`},children:[(0,T.jsxs)(`div`,{style:{flex:1},children:[(0,T.jsx)(`div`,{style:{fontWeight:700,fontSize:`13px`,marginBottom:`6px`},children:`INVOICE ADDRESS:`}),(0,T.jsxs)(`div`,{style:{fontSize:`13px`,lineHeight:`1.7`},children:[L?.company_name&&(0,T.jsx)(`div`,{children:L.company_name}),L?.address&&(0,T.jsx)(`div`,{style:{whiteSpace:`pre-line`},children:L.address}),L?.state_name&&(0,T.jsxs)(`div`,{children:[L.state_name,L?.pincode?`, ${L.pincode}`:``]})]})]}),(0,T.jsxs)(`div`,{style:{flex:1},children:[(0,T.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`},children:[(0,T.jsx)(`div`,{style:{fontWeight:700,fontSize:`13px`,marginBottom:`6px`},children:`DELIVERY ADDRESS:`}),(0,T.jsxs)(`div`,{style:{fontSize:`13px`},children:[(0,T.jsx)(`div`,{children:`Date:`}),(0,T.jsx)(`div`,{style:{fontWeight:600},children:r(e.created_at)})]})]}),(0,T.jsxs)(`div`,{style:{fontSize:`13px`,lineHeight:`1.7`},children:[(z?.name||e.client_name)&&(0,T.jsx)(`div`,{children:z?.name||e.client_name}),z?.address&&(0,T.jsx)(`div`,{style:{whiteSpace:`pre-line`},children:z.address}),z?.state_name&&(0,T.jsx)(`div`,{children:z.state_name})]})]})]}),(0,T.jsx)(`div`,{style:{background:`#1a3a5c`,color:`#fff`,fontWeight:700,fontSize:`15px`,padding:`8px 12px`,marginBottom:`0`},className:`dark-heading`,children:`Price Specification`}),(0,T.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:`12px`,tableLayout:`fixed`},children:[(0,T.jsxs)(`colgroup`,{children:[(0,T.jsx)(`col`,{style:{width:`40px`}}),(0,T.jsx)(`col`,{}),(0,T.jsx)(`col`,{style:{width:`40px`}}),(0,T.jsx)(`col`,{style:{width:`100px`}}),(0,T.jsx)(`col`,{style:{width:`100px`}})]}),(0,T.jsx)(`thead`,{children:(0,T.jsxs)(`tr`,{style:{background:`#c8d0d8`},className:`thead-row`,children:[(0,T.jsx)(`th`,{style:{border:`1px solid #aaa`,padding:`5px 6px`,textAlign:`left`},children:`Pos.`}),(0,T.jsx)(`th`,{style:{border:`1px solid #aaa`,padding:`5px 6px`,textAlign:`left`},children:`Item`}),(0,T.jsx)(`th`,{style:{border:`1px solid #aaa`,padding:`5px 6px`,textAlign:`center`},children:`Qty`}),(0,T.jsxs)(`th`,{style:{border:`1px solid #aaa`,padding:`5px 6px`,textAlign:`right`},children:[`Unit Price`,(0,T.jsx)(`br`,{}),`INR`]}),(0,T.jsxs)(`th`,{style:{border:`1px solid #aaa`,padding:`5px 6px`,textAlign:`right`},children:[`Total Price`,(0,T.jsx)(`br`,{}),`INR`]})]})}),(0,T.jsx)(`tbody`,{children:A.length===0?(0,T.jsx)(`tr`,{children:(0,T.jsx)(`td`,{colSpan:5,style:{border:`1px solid #aaa`,padding:`12px`,textAlign:`center`,color:`#888`},children:`No line items`})}):A.map((e,t)=>{let n=e.specifications||{};return(0,T.jsxs)(`tr`,{style:{background:t%2==0?`#fff`:`#f7f9fb`},children:[(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`5px 6px`,verticalAlign:`top`,textAlign:`center`},children:t+1}),(0,T.jsxs)(`td`,{style:{border:`1px solid #ccc`,padding:`5px 6px`,verticalAlign:`top`},children:[(0,T.jsx)(`div`,{style:{fontWeight:700,color:`#c8a000`},children:e.item_code}),(0,T.jsx)(`div`,{children:e.item_name||e.item_description}),e.item_description&&e.item_name&&(0,T.jsx)(`div`,{style:{color:`#555`},children:e.item_description}),n.additional_info&&(0,T.jsx)(`div`,{style:{color:`#555`,fontStyle:`italic`},children:n.additional_info})]}),(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`5px 6px`,verticalAlign:`top`,textAlign:`center`},children:Number(e.quantity).toLocaleString()}),(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`5px 6px`,verticalAlign:`top`,textAlign:`right`,fontFamily:`monospace`},children:O(e.offer_price||0)}),(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`5px 6px`,verticalAlign:`top`,textAlign:`right`,fontFamily:`monospace`},children:O(e.offer_gross||0)})]},e.id)})})]}),(0,T.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:`12px`,marginTop:`0`,tableLayout:`fixed`},children:[(0,T.jsxs)(`colgroup`,{children:[(0,T.jsx)(`col`,{style:{width:`40px`}}),(0,T.jsx)(`col`,{}),(0,T.jsx)(`col`,{style:{width:`40px`}}),(0,T.jsx)(`col`,{style:{width:`100px`}}),(0,T.jsx)(`col`,{style:{width:`100px`}})]}),(0,T.jsxs)(`tbody`,{children:[U>0&&(0,T.jsxs)(`tr`,{children:[(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`},colSpan:3}),(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`,textAlign:`right`},children:`Discount`}),(0,T.jsxs)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`,textAlign:`right`,fontFamily:`monospace`},children:[`- `,O(U)]})]}),(0,T.jsxs)(`tr`,{children:[(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`},colSpan:3}),(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`,textAlign:`right`},children:`Tax Amount`}),(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`,textAlign:`right`,fontFamily:`monospace`},children:O(H)})]}),W>0&&(0,T.jsxs)(`tr`,{children:[(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`},colSpan:3}),(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`,textAlign:`right`},children:`P & F`}),(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`,textAlign:`right`,fontFamily:`monospace`},children:O(W)})]}),G>0&&(0,T.jsxs)(`tr`,{children:[(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`},colSpan:3}),(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`,textAlign:`right`},children:`Freight`}),(0,T.jsx)(`td`,{style:{border:`1px solid #ccc`,padding:`4px 6px`,textAlign:`right`,fontFamily:`monospace`},children:O(G)})]}),(0,T.jsxs)(`tr`,{style:{background:`#1a3a5c`},className:`dark-row`,children:[(0,T.jsx)(`td`,{style:{border:`1px solid #aaa`,padding:`6px`,color:`#fff`,fontWeight:700},colSpan:3,children:D(Z)}),(0,T.jsx)(`td`,{style:{border:`1px solid #aaa`,padding:`6px`,textAlign:`right`,color:`#fff`,fontWeight:700},children:`NET AMOUNT`}),(0,T.jsx)(`td`,{style:{border:`1px solid #aaa`,padding:`6px`,textAlign:`right`,color:`#fff`,fontWeight:700,fontFamily:`monospace`},children:O(Z)})]})]})]}),(0,T.jsx)(`div`,{style:{background:`#1a3a5c`,color:`#fff`,fontWeight:700,fontSize:`15px`,padding:`8px 12px`,marginTop:`16px`},className:`dark-heading`,children:`Commercial Terms`}),(0,T.jsx)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,marginBottom:`20px`},children:(0,T.jsxs)(`tbody`,{children:[[{icon:`🕐`,label:`Delivery Time`,value:e.delivery_schedule||``},{icon:`🚚`,label:`Delivery Terms`,value:e.delivery_terms_name||e.delivery_terms||``},{icon:`⏩`,label:`Shipping Method`,value:``},{icon:`💳`,label:`Payment`,value:e.payment_terms_name||e.payment_terms||``},{icon:`📅`,label:`Valid Until`,value:e.validity_date?r(e.validity_date):``},{icon:`💬`,label:`Comments`,value:e.remarks||``}].map(e=>(0,T.jsxs)(`tr`,{children:[(0,T.jsx)(`td`,{style:{width:`40px`,textAlign:`center`,verticalAlign:`middle`,border:`1px solid #ccc`,padding:`8px 4px`,color:`#1a3a5c`,fontSize:`18px`},children:e.icon}),(0,T.jsx)(`td`,{style:{width:`160px`,fontWeight:600,fontSize:`13px`,border:`1px solid #ccc`,padding:`8px 10px`,verticalAlign:`middle`},children:e.label}),(0,T.jsx)(`td`,{style:{fontSize:`13px`,border:`1px solid #ccc`,padding:`8px 10px`,verticalAlign:`middle`},children:e.value})]},e.label)),e.tnc_items?.map((e,t)=>(0,T.jsxs)(`tr`,{children:[(0,T.jsx)(`td`,{style:{width:`40px`,textAlign:`center`,verticalAlign:`middle`,border:`1px solid #ccc`,padding:`8px 4px`,color:`#1a3a5c`,fontSize:`18px`}}),(0,T.jsx)(`td`,{style:{width:`160px`,fontWeight:600,fontSize:`13px`,border:`1px solid #ccc`,padding:`8px 10px`,verticalAlign:`middle`}}),(0,T.jsxs)(`td`,{style:{fontSize:`13px`,border:`1px solid #ccc`,padding:`8px 10px`,verticalAlign:`middle`,color:`#1a6bb5`},children:[t+1,`. `,e.content]})]},e.id))]})}),(0,T.jsxs)(`div`,{style:{marginTop:`16px`,fontSize:`14px`,lineHeight:`1.8`},children:[(0,T.jsx)(`div`,{children:`We trust that you find our quotation of interest and we look forward to receiving your valued purchase order`}),(0,T.jsx)(`div`,{style:{marginTop:`12px`,color:`#1a6bb5`},children:`Best regards`}),(0,T.jsxs)(`div`,{style:{marginTop:`12px`},children:[R?.full_name&&(0,T.jsx)(`div`,{children:R.full_name}),L?.company_name&&(0,T.jsx)(`div`,{children:L.company_name}),L?.email&&(0,T.jsxs)(`div`,{children:[`E-mail: `,(0,T.jsx)(`span`,{style:{color:`#1a6bb5`},children:L.email}),L?.phone?`  /  Phone: ${L.phone}`:``]})]})]}),(0,T.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-end`,marginTop:`16px`},children:[(0,T.jsxs)(`div`,{style:{textAlign:`left`},children:[(0,T.jsx)(`img`,{src:S,alt:`Stamp`,style:{height:`60px`,objectFit:`contain`,marginBottom:`8px`,display:`block`}}),(0,T.jsx)(`div`,{style:{borderTop:`1px solid #666`,paddingTop:`4px`,width:`120px`,fontSize:`13px`,fontWeight:600},children:`Client Signature`})]}),(0,T.jsxs)(`div`,{style:{textAlign:`right`},children:[R?.signature&&(0,T.jsx)(`img`,{src:R.signature.startsWith(`http`)?R.signature:`${E.replace(`/api`,``)}${R.signature.startsWith(`/`)?R.signature:`/${R.signature}`}`,alt:`Signature`,style:{height:`40px`,objectFit:`contain`,marginBottom:`4px`,display:`block`,marginLeft:`auto`}}),(0,T.jsx)(`div`,{style:{borderTop:`1px solid #666`,paddingTop:`4px`,fontSize:`13px`,fontWeight:600},children:`Authorized Signatory`})]})]})]}),(0,T.jsxs)(`div`,{className:`page-footer`,children:[L?.company_name&&(0,T.jsx)(`span`,{className:`company`,children:L.company_name}),L?.address&&(0,T.jsxs)(`span`,{children:[` | `,Q]}),L?.state_name&&(0,T.jsxs)(`span`,{children:[`, `,L.state_name,L?.pincode?` - ${L.pincode}`:``]}),L?.email&&(0,T.jsxs)(`span`,{children:[` | `,L.email]}),L?.phone&&(0,T.jsxs)(`span`,{children:[` | `,L.phone]})]})]}))(!0)})]})]})}export{A as t};