1import{j as e}from"./vendor-radix-j51FbGWj.js";import{b as ye,r as c}from"./vendor-react-CzwWGMlW.js";import{L as Ie,C as Be,a as Oe,b as Ke,P as _e,c as Je,A as qe,p as Ge,e as Xe,f as Ye,i as Ze}from"./vendor-charts-CCcLMIy6.js";import{e as Ue,z as q,B as se,C as $,b as E,A as Qe,l as et,f as ne,g as oe,h as fe,a as re,d as tt}from"./index-CMgi7Nl8.js";import{E as st}from"./vendor-excel-BmHXwAT0.js";import{s as at}from"./saveFile-CuSvqsta.js";import{S as je,a as be,b as Ne,c as we,d as G}from"./select-DjZg9c5p.js";import{T as lt,a as nt,b as ae,c as R,d as ot,e as D}from"./table-DvS7udR6.js";import{D as rt}from"./DateRangeFilter-Dlv7tvuJ.js";import{P as ct}from"./Pagination-CWVXwee7.js";import{k as h}from"./vendor-utils-DYobRrOj.js";import{Q as Ce,bI as dt,a7 as it,R as mt,b as xt,i as F,b8 as ht,T as De,au as ve,aC as le,X as ut,a9 as pt,aL as gt}from"./vendor-icons-CaDFxAI1.js";import"./index-DSoekHNq.js";Be.register(Oe,Ke,_e,Je,qe,Ge,Xe,Ye,Ze);const ft=()=>e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-muted border-t-primary"}),e.jsx(pt,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-5 h-5 text-primary"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ÐагÑÑзка даннÑÑ
о поÑÑавкаÑ
..."})]}),V=({icon:d,title:v,value:C,subtitle:k,trend:S,trendUp:M,className:u=""})=>e.jsxs($,{className:`relative overflow-hidden ${u}`,children:[e.jsxs(E,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:v}),e.jsx("p",{className:"text-2xl font-bold",children:C}),k&&e.jsx("p",{className:"text-xs text-muted-foreground",children:k})]}),e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(d,{className:"w-5 h-5 text-primary"})})]}),S!==void 0&&e.jsxs("div",{className:`flex items-center gap-1 mt-2 text-xs ${M?"text-emerald-600":"text-red-500"}`,children:[M?e.jsx(De,{className:"w-3 h-3"}):e.jsx(ve,{className:"w-3 h-3"}),e.jsx("span",{children:S})]})]}),e.jsx("div",{className:"absolute -right-4 -bottom-4 w-24 h-24 rounded-full bg-primary/5"})]}),jt=({selectedShipper:d,selectedConsignee:v,shippers:C,consignees:k,onShipperChange:S,onConsigneeChange:M,showHighDifferenceOnly:u,onHighDifferenceChange:X,deliveriesWithHighDifference:x,loading:z})=>e.jsxs($,{children:[e.jsx(ne,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(gt,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(oe,{className:"text-base",children:"ФилÑÑÑÑ"})]}),(d!=="all"||v!=="all"||u)&&e.jsx(re,{variant:"secondary",className:"text-xs",children:"ÐкÑивнÑ"})]})}),e.jsxs(E,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ÐÑÑзооÑпÑавиÑелÑ"}),e.jsxs(je,{value:d,onValueChange:S,disabled:z,children:[e.jsx(be,{className:"h-9",children:e.jsx(Ne,{placeholder:"ÐÑе компании"})}),e.jsxs(we,{children:[e.jsx(G,{value:"all",children:"ÐÑе компании"}),C.map(m=>e.jsx(G,{value:m,children:m},m))]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ÐÑÑзополÑÑаÑелÑ"}),e.jsxs(je,{value:v,onValueChange:M,disabled:z,children:[e.jsx(be,{className:"h-9",children:e.jsx(Ne,{placeholder:"ÐÑе компании"})}),e.jsxs(we,{children:[e.jsx(G,{value:"all",children:"ÐÑе компании"}),k.map(m=>e.jsx(G,{value:m,children:m},m))]})]})]})]}),x>0&&e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(F,{className:"w-4 h-4 text-amber-600"}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:["ÐбнаÑÑжено ÑаÑÑ
ождений: ",x]}
1),e.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:"ÐоÑÑавки Ñ ÑазниÑей обÑемов более 15%"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(tt,{id:"showHighDifferenceOnly",checked:u,onCheckedChange:X}),e.jsx("label",{htmlFor:"showHighDifferenceOnly",className:"text-xs cursor-pointer text-amber-700 dark:text-amber-300",children:"ТолÑко ÑаÑÑ
ождениÑ"})]})]})]})]}),bt=({userQuotas:d})=>{const v=ye.useRef(null),[C,k]=c.useState(!1),[S,M]=c.useState(null),[u,X]=c.useState(null),[x,z]=c.useState(()=>{const s=new Date,n=new Date(s.getFullYear(),s.getMonth(),1,0,0,0,0),t=new Date;return t.setHours(23,59,59,999),{startDate:n,endDate:t}}),[m,Ae]=c.useState("all"),[N,Re]=c.useState("all"),[g,ce]=c.useState([]),[j,Y]=c.useState(null),[de,Z]=c.useState(1),[H]=c.useState(10),[P,ke]=c.useState(!1),ie=c.useCallback(async()=>{try{k(!0),M(null);const s=await Ue.get("/api/reports/deliveries",{params:{startDate:h(x.startDate,"yyyy-MM-dd"),endDate:h(x.endDate,"yyyy-MM-dd")}});X(s.data),ce(s.data)}catch(s){M(s.message),q.error("ÐÑибка пÑи загÑÑзке даннÑÑ
")}finally{k(!1)}},[x]),Se=c.useCallback(s=>{z(s)},[]),Me=c.useCallback(()=>{if(!(!x.startDate||!x.endDate)){if(x.startDate>x.endDate){q.error("ÐаÑа наÑала не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð±Ð¾Ð»ÑÑе даÑÑ ÐºÐ¾Ð½Ñа");return}Y(null),Z(1),ie()}},[x,ie]);c.useEffect(()=>{if(!u)return;const s=u.filter(n=>{const t=m==="all"||n.shipperCompanyName===m,r=N==="all"||n.consigneeCompanyName===N;let a=!0;if(P){const l=n.woodTypes.reduce((p,w)=>p+w.volume,0),f=n.acceptWoodTypes.reduce((p,w)=>p+w.volume,0);a=(f>0?Math.abs(l-f)/f*100:0)>15}return t&&r&&a});ce(s)},[u,m,N,P]);const We=c.useMemo(()=>u?[...new Set(u.map(s=>s.shipperCompanyName))].sort():[],[u]),Te=c.useMemo(()=>u?[...new Set(u.map(s=>s.consigneeCompanyName))].sort():[],[u]),A=c.useMemo(()=>{if(!g.length)return null;const s=g.filter(l=>!l.isErroneousShipment),n=s.reduce((l,f)=>l+f.woodTypes.reduce((y,p)=>y+p.volume,0),0),t=s.reduce((l,f)=>l+f.acceptWoodTypes.reduce((y,p)=>y+p.volume,0),0),r=s.filter(l=>l.hasCorrections).length,a=g.filter(l=>l.isErroneousShipment).length;return{totalSent:n,totalAccepted:t,corrected:r,erroneous:a,total:g.length}},[g]),T=c.useMemo(()=>{if(!g.length)return null;const n=g.filter(r=>!r.isErroneousShipment).reduce((r,a)=>{const l=h(new Date(a.sentDate),"yyyy-MM-dd"),f=a.woodTypes.reduce((p,w)=>p+w.volume,0),y=a.acceptWoodTypes.reduce((p,w)=>p+w.volume,0);return r[l]||(r[l]={sentVolume:0,acceptedVolume:0}),r[l].sentVolume+=f,r[l].acceptedVolume+=y,r},{}),t=Object.keys(n).sort();return{labels:t.map(r=>h(new Date(r),"dd.MM")),datasets:[{label:"ÐÑпÑавлено",data:t.map(r=>n[r].sentVolume),borderColor:"rgb(34, 197, 94)",backgroundColor:"rgba(34, 197, 94, 0.1)",fill:!0,tension:.3,pointRadius:4,pointHoverRadius:6},{label:"ÐÑинÑÑо",data:t.map(r=>n[r].acceptedVolume),borderColor:"rgb(59, 130, 246)",backgroundColor:"rgba(59, 130, 246, 0.1)",fill:!0,tension:.3,pointRadius:4,pointHoverRadius:6}],rawLabels:t}},[g]),Ve=c.useMemo(()=>({responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"top",labels:{usePointStyle:!0,padding:20}},title:{display:!1},tooltip:{mode:"index",intersect:!1,backgroundColor:"rgba(0, 0, 0, 0.8)",padding:12,cornerRadius:8,titleFont:{size:13},bodyFont:{size:12},callbacks:{label:s=>`${s.dataset.label}: ${s.parsed.y.toFixed(3)} м³`}}},scales:{y:{beginAtZero:!0,grid:{color:"rgba(0, 0, 0, 0.05)"},ticks:{callback:s=>`${s} м³`,font:{size:11}}},x:{grid:{display:!1},ticks:{font:{size:11}}}},onClick:(s,n)=>{if(n.length>0&&T){const t=n[0].index,r=T.rawLabels[t];Y(r)}}}),[T]),b=c.useMemo(()=>j?g.filter(s=>{const n=new Date(s.sentDate);return h(n,"yyyy-MM-dd")===j}):g,[g,j]),U=c.useMemo(()=>g.filter(s=>{const n=s.woodTypes.reduce((a,l)=>a+l.volume,0),t=s.acceptWoodTypes.reduce((a,l)=>a+l.volume,0);return(t>0?Math.abs(n-t)/t*100:0)>15}).length,[g]),Q=de*H,me=Q-H,xe=b.slice(me,Q),Fe=c.useCallback(s=>{Z(s),v.current&&v.current.scrollIntoView({behavior:"smooth",block:"start"})},[]);c.useEffect(()=>{Z(1)},[m,N,j,P]);const he=c.useCallback(s=>{if(!s.length)return[];const n=[];
1return s.forEach(t=>{if(!t.woodTypes.length&&!t.acceptWoodTypes.length){n.push({...t,docNo:t.id||"-",sentWoodName:"-",sentWoodVolume:0,acceptedWoodName:"-",acceptedWoodVolume:0});return}if(t.woodTypes.length&&!t.acceptWoodTypes.length){t.woodTypes.forEach(a=>{n.push({...t,docNo:t.id||"-",sentWoodName:a.name,sentWoodVolume:a.volume,acceptedWoodName:"-",acceptedWoodVolume:0})});return}if(!t.woodTypes.length&&t.acceptWoodTypes.length){t.acceptWoodTypes.forEach(a=>{n.push({...t,docNo:t.id||"-",sentWoodName:"-",sentWoodVolume:0,acceptedWoodName:a.name,acceptedWoodVolume:a.volume})});return}const r=new Set;t.woodTypes.forEach(a=>{const l=t.acceptWoodTypes.find(f=>f.name===a.name);l&&(n.push({...t,docNo:t.id||"-",sentWoodName:a.name,sentWoodVolume:a.volume,acceptedWoodName:l.name,acceptedWoodVolume:l.volume}),r.add(a.name))}),t.woodTypes.filter(a=>!r.has(a.name)).forEach(a=>{n.push({...t,docNo:t.id||"-",sentWoodName:a.name,sentWoodVolume:a.volume,acceptedWoodName:"-",acceptedWoodVolume:0})}),t.acceptWoodTypes.filter(a=>!r.has(a.name)).forEach(a=>{n.push({...t,docNo:t.id||"-",sentWoodName:"-",sentWoodVolume:0,acceptedWoodName:a.name,acceptedWoodVolume:a.volume})})}),n},[]),$e=c.useCallback(async()=>{try{const s=he(b.filter(o=>!o.isErroneousShipment)),n=new st.Workbook;n.creator="ÐеÑСТÐТ",n.lastModifiedBy="ÐеÑСТÐТ",n.created=new Date,n.modified=new Date;const t=n.addWorksheet("ÐÑÑÐµÑ Ð¾ поÑÑÐ°Ð²ÐºÐ°Ñ ");t.mergeCells("A1:K1");const r=t.getCell("A1");r.value="ÐÑÑÐµÑ Ð¾ поÑÑÐ°Ð²ÐºÐ°Ñ Ð´ÑевеÑинÑ",r.font={name:"Arial",size:16,bold:!0},r.alignment={horizontal:"center"},t.mergeCells("A2:K2");const a=t.getCell("A2");a.value=`ÐеÑиод: Ñ ${h(x.startDate,"dd.MM.yyyy")} по ${h(x.endDate,"dd.MM.yyyy")}`,a.font={name:"Arial",size:12},a.alignment={horizontal:"center"};let l=3;if(m!=="all"||N!=="all"){t.mergeCells(`A${l}:K${l}`);const o=t.getCell(`A${l}`);o.value="ФилÑÑÑÑ: "+(m!=="all"?`ÐÑÑзооÑпÑавиÑелÑ: ${m}`:"")+(m!=="all"&&N!=="all"?", ":"")+(N!=="all"?`ÐÑÑзополÑÑаÑелÑ: ${N}`:""),o.font={name:"Arial",size:12,italic:!0},l++}if(j){t.mergeCells(`A${l}:K${l}`);const o=t.getCell(`A${l}`);o.value=`ÐÑбÑана даÑа: ${h(new Date(j),"dd.MM.yyyy")}`,o.font={name:"Arial",size:12,italic:!0},l++}l++;const f=["â докÑменÑа","ÐÑпÑавлена","ÐÑинÑÑа","ÐÑÑзооÑпÑавиÑелÑ","ÐÑÑзополÑÑаÑелÑ","ТÑанÑпоÑÑ","СоÑÑÐ¸Ð¼ÐµÐ½Ñ Ð¾ÑпÑавленнÑй","ÐбÑем оÑпÑавленнÑй (м³)","СоÑÑÐ¸Ð¼ÐµÐ½Ñ Ð¿ÑинÑÑÑй","ÐбÑем пÑинÑÑÑй (м³)","СÑаÑÑÑ ÐºÐ¾ÑÑекÑиÑовки"];t.getRow(l).values=f,t.getRow(l).font={name:"Arial",size:12,bold:!0},t.getRow(l).alignment={horizontal:"center"},t.getRow(l).fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFE6E6E6"}},t.columns=[{width:15},{width:20},{width:20},{width:30},{width:30},{width:15},{width:25},{width:20},{width:25},{width:20},{width:20}];let y=0,p=0,w=l+1;s.forEach((o,He)=>{const Pe=w+He,K=o.sentWoodVolume>0?Number(o.sentWoodVolume):0,_=o.acceptedWoodVolume>0?Number(o.acceptedWoodVolume):0;y+=K,p+=_;const W=t.getRow(Pe);W.values=[o.docNo,h(new Date(o.sentDate),"dd.MM.yyyy HH:mm"),o.acceptedDate?h(new Date(o.acceptedDate),"dd.MM.yyyy HH:mm"):"-",o.shipperCompanyName+(o.departureNo?` 2â ${o.departureNo}`:""),o.consigneeCompanyName+(o.destinationNo?` 3â ${o.destinationNo}`:""),o.transport,o.sentWoodName,K>0?K:"-",o.acceptedWoodName,_>0?_:"-",o.isErroneousShipment?"ÐозвÑÐ°Ñ Ð¿Ð¾ÑÑавки":o.hasCorrections?"СкоÑÑекÑиÑован":"-"],W.eachCell({includeEmpty:!0},J=>{J.alignment={vertical:"middle",wrapText:!0},J.border={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}}});const ee=W.getCell(8);ee.alignment={...ee.alignment,horizontal:"right"},K>0&&(ee.numFmt="0.000");const te=W.getCell(10);if(te.alignment={...te.alignment,horizontal:"right"},_>0&&(te.numFmt="0.000"),o.hasCorrections){W.eachCell({includeEmpty:!0},Le=>{Le.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFF2CC"}}});const J=W.getCell(11);J.font={bold:!0,color:{argb:"FFB7782A"}}}});let i=w+s.length+1;const ue=t.getRow(i);t.mergeCells(`A${i}:K${i}`),ue.getCell("A").value=`ÐÑего ÑÑÑок: ${s.length} (ÑникалÑнÑÑ Ð¿Ð¾ÑÑавок: ${b.length})`,ue.getCell("A").font={name:"Arial",size:12,bold:!0},i++;const L=t.getRow(i);t.mergeCells(`A${i}:G${i}`),L.getCell("A").value="ÐбÑий обÑем оÑпÑавленнÑй:",L.getCell("A").font={bold:!0},L.getCell("A").alignment={horizontal:"right"};const I=L.getCell("H");I.value=y,I.font={bold:!0},I.numFmt='0.000 "м³"',I.alignment={horizontal:"right"},i++;const B=t.getRow(i);t.mergeCells(`A${i}:I${i}`),B.getCell("A").value="ÐбÑий обÑем пÑинÑÑÑй:",B.getCell("A").font={bold:!0},B.getCell("A").alignment={horizontal:"right"};const O=B.getCell("J");O.value=p,O.font={bold:!0},O.numFmt='0.000 "м³"',O.alignment={horizontal:"right"},i++;const pe=b.filter(o=>o.hasCorrections).length;if(pe>0){const o=t.getRow(i);t.mergeCells(`A${i}:K${i}`),o.getCell("A").value=`Ð Ñом ÑиÑле ÑкоÑÑекÑиÑованнÑÑ : ${pe}`,o.getCell("A").font={name:"Arial",size:12,italic:!0,color:{argb:"FFB7782A"}},i++}const ge=t.getRow(i);t.mergeCells(`A${i}:K${i}`),ge.getCell("A").value=`ÐоÑÑавок Ñ ÑазниÑей обÑемов более 15%: ${U}`,ge.getCell("A").font={name:"Arial",size:12,italic:!0,color:{argb:"FFFF0000"}};const Ee=await n.xlsx.writeBuffer(),ze=`ÐÑÑеÑ_поÑÑавки_${h(new Date,"yyyy-MM-dd_HH-mm")}.xlsx`;at(new Blob([Ee]),ze),q.success("ÐÑÑÐµÑ ÑÑпеÑно ÑÐ¾Ñ Ñанен")}catch(s){console.error("ÐÑибка пÑи ÑкÑпоÑÑе в Excel:",s),q.error("ÐÑибка пÑи Ñоздании Excel-Ñайла")}},[he,b,x,m,N,j,U]);return e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"ÐÑÑÐµÑ Ð¿Ð¾ поÑÑавкам"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Ðнализ обÑемов оÑпÑавленной и пÑинÑÑой дÑевеÑинÑ"})]}),u&&e.jsxs(se,{variant:"outline",onClick:$e,disabled:b.length===0||d&&d.maxReports!==-1,
3className:"gap-2",title:d&&d.maxReports!==-1?"ÐкÑпоÑÑ Ð´Ð¾ÑÑÑпен на плаÑном ÑаÑиÑе":"",children:[d&&d.maxReports!==-1?e.jsx(Ce,{className:"w-4 h-4"}):e.jsx(dt,{className:"w-4 h-4"}),"ÐкÑпоÑÑ Ð² Excel"]})]}),e.jsx($,{children:e.jsx(E,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(it,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:"ÐеÑиод оÑÑеÑа"})]}),e.jsx(rt,{dateRange:x,onDateRangeChange:Se,loading:C})]}),e.jsxs(se,{onClick:Me,disabled:C||!x.startDate||!x.endDate||d&&d.maxReports!==-1&&d.remainingReports===0,className:"gap-2 min-w-[180px]",children:[C?e.jsx(mt,{className:"w-4 h-4 animate-spin"}):d&&d.maxReports!==-1&&d.remainingReports===0?e.jsx(Ce,{className:"w-4 h-4"}):e.jsx(xt,{className:"w-4 h-4"}),d&&d.maxReports!==-1&&d.remainingReports===0?"ÐÐ¸Ð¼Ð¸Ñ Ð¸ÑÑеÑпан":"СÑоÑмиÑоваÑÑ Ð¾ÑÑеÑ"]})]})})}),C?e.jsx(ft,{}):S?e.jsxs(Qe,{variant:"destructive",children:[e.jsx(F,{className:"h-4 w-4"}),e.jsx(et,{children:S})]}):u&&e.jsxs(e.Fragment,{children:[A&&e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx(V,{icon:ht,title:"ÐÑего поÑÑавок",value:A.total,subtitle:"за вÑбÑаннÑй пеÑиод"}),e.jsx(V,{icon:De,title:"ÐÑпÑавлено",value:`${A.totalSent.toFixed(3)} м³`,subtitle:"обÑий обÑем"}),e.jsx(V,{icon:ve,title:"ÐÑинÑÑо",value:`${A.totalAccepted.toFixed(3)} м³`,subtitle:"обÑий обÑем"}),e.jsx(V,{icon:le,title:"СкоÑÑекÑиÑовано",value:A.corrected,subtitle:"докÑменÑов",className:A.corrected>0?"border-amber-200 dark:border-amber-800":""}),A.erroneous>0&&e.jsx(V,{icon:F,title:"ÐÑибоÑнÑе",value:A.erroneous,subtitle:"не ÑÑÑÐµÐ½Ñ Ð² иÑогаÑ
",className:"border-red-200 dark:border-red-800"})]}),e.jsx(jt,{selectedShipper:m,selectedConsignee:N,shippers:We,consignees:Te,onShipperChange:Ae,onConsigneeChange:Re,showHighDifferenceOnly:P,onHighDifferenceChange:ke,deliveriesWithHighDifference:U,loading:C}),e.jsxs($,{children:[e.jsx(ne,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(oe,{className:"text-base",children:"Ðинамика обÑемов"}),e.jsx(fe,{children:"ÐликниÑе на ÑоÑÐºÑ Ð³ÑаÑика Ð´Ð»Ñ ÑилÑÑÑаÑии по даÑе"})]}),j&&e.jsxs(se,{variant:"outline",size:"sm",onClick:()=>Y(null),className:"gap-2",children:[e.jsx(ut,{className:"w-3 h-3"}),"СбÑоÑиÑÑ: ",h(new Date(j),"dd.MM.yyyy")]})]})}),e.jsx(E,{children:e.jsx("div",{className:"h-[350px]",children:T?e.jsx(Ie,{data:T,options:Ve}):e.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"ÐÐµÑ Ð´Ð°Ð½Ð½ÑÑ
Ð´Ð»Ñ Ð¾ÑобÑажениÑ"})})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 px-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"w-3 h-3 rounded bg-amber-100 border border-amber-300"}),e.jsx(le,{className:"w-3.5 h-3.5 text-amber-600"}),e.jsx("span",{children:"СкоÑÑекÑиÑован"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"w-3 h-3 rounded bg-red-100 border border-red-300"}),e.jsx(F,{className:"w-3.5 h-3.5 text-red-600"}),e.jsx("span",{children:"ÐозвÑÐ°Ñ Ð½Ð° Ñклад"})]})]}),e.jsxs($,{ref:v,children:[e.jsx(ne,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(oe,{className:"text-base",children:"СпиÑок поÑÑавок"}),e.jsx(fe,{children:j?`ÐÐ¾ÐºÐ°Ð·Ð°Ð½Ñ Ð¿Ð¾ÑÑавки за ${h(new Date(j),"dd.MM.yyyy")}`:`ÐÑего запиÑей: ${b.length}`})]}),e.jsxs(re,{variant:"outline",className:"text-xs",children:[me+1,"â",Math.min(Q,b.length)," из ",b.length]})]})}),e.jsxs(E,{className:"p-0",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(lt,{children:[e.jsx(nt,{children:e.jsxs(ae,{className:"bg-muted/50",children:[e.jsx(R,{className:"font-semibold",children:"ÐÑпÑавлена"}),e.jsx(R,{className:"font-semibold",children:"ÐÑинÑÑа"}),e.jsx(R,{className:"font-semibold",children:"ÐÑÑзооÑпÑавиÑелÑ"}),e.jsx(R,{className:"font-semibold",children:"ÐÑÑзополÑÑаÑелÑ"}),e.jsx(R,{className:"font-semibold",children:"ТÑанÑпоÑÑ"}),e.jsx(R,{className:"font-semibold text-right",children:"ÐÑпÑавлено"}),e.jsx(R,{className:"font-semibold text-right",children:"ÐÑинÑÑо"}),e.jsx(R,{className:"font-semibold w-10"})]})}),e.jsx(ot,{children:xe.length===0?e.jsx(ae,{children:e.jsx(D,{colSpan:8,className:"h-32 text-center text-muted-foreground",children:"ÐÐµÑ Ð´Ð°Ð½Ð½ÑÑ
Ð´Ð»Ñ Ð¾ÑобÑажениÑ"})}):xe.map((s,n)=>{const t=s.woodTypes.reduce((a,l)=>a+l.volume,0),r=s.acceptWoodTypes.reduce((a,l)=>a+l.volume,0);return e.jsxs(ae,{className:s.isErroneousShipment?"bg-red-50 dark:bg-red-950/20 hover:bg-red-100 dark:hover:bg-red-950/30":s.hasCorrections?"bg-amber-50 dark:bg-amber-950/20 hover:bg-amber-100 dar
3k:hover:bg-amber-950/30":"",children:[e.jsxs(D,{className:"font-medium",children:[h(new Date(s.sentDate),"dd.MM.yyyy"),e.jsx("span",{className:"block text-xs text-muted-foreground",children:h(new Date(s.sentDate),"HH:mm")})]}),e.jsx(D,{children:s.acceptedDate?e.jsxs(e.Fragment,{children:[h(new Date(s.acceptedDate),"dd.MM.yyyy"),e.jsx("span",{className:"block text-xs text-muted-foreground",children:h(new Date(s.acceptedDate),"HH:mm")})]}):e.jsx("span",{className:"text-muted-foreground",children:"â"})}),e.jsxs(D,{children:[e.jsx("div",{className:"font-medium",children:s.shipperCompanyName}),s.departureNo&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["â ",s.departureNo]})]}),e.jsxs(D,{children:[e.jsx("div",{className:"font-medium",children:s.consigneeCompanyName}),s.destinationNo&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["â ",s.destinationNo]})]}),e.jsx(D,{children:e.jsx(re,{variant:"outline",className:"font-normal",children:s.transport})}),e.jsxs(D,{className:"text-right",children:[e.jsxs("div",{className:"font-medium text-emerald-600",children:[t.toFixed(3)," м³"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.woodTypes.map(a=>a.name).join(", ")})]}),e.jsxs(D,{className:"text-right",children:[e.jsxs("div",{className:"font-medium text-blue-600",children:[r.toFixed(3)," м³"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.acceptWoodTypes.map(a=>a.name).join(", ")})]}),e.jsxs(D,{className:"text-center",children:[s.hasCorrections&&e.jsx(le,{className:"w-4 h-4 text-amber-600",title:"СкоÑÑекÑиÑован"}),s.isErroneousShipment&&e.jsx(F,{className:"w-4 h-4 text-red-600",title:"ÐозвÑÐ°Ñ Ð½Ð° Ñклад"})]})]},s.id||n)})})]})}),b.length>H&&e.jsx("div",{className:"border-t p-4",children:e.jsx(ct,{totalItems:b.length,itemsPerPage:H,currentPage:de,paginate:Fe})})]})]})]})]})},Vt=ye.memo(bt);export{Vt 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.