import{u as M,c as T,b as O,j as t,M as V}from"./index-D9pJRAs5.js";import{r as o}from"./vendor-D6aTFYy9.js";import D from"./MaterialDetailModal-DhtW5v5P.js";import{P as E,F,a as $}from"./PrintingSection-CGZUWw5-.js";import{P as Z}from"./PageHeader-qe8kxWqe.js";import{S as z}from"./StatCard-B6PlblaT.js";import{q as w,ba as b,V as f,aw as A,a2 as q,X as B}from"./ui-CtYVlq7P.js";import"./pdf-Bz_mU5mG.js";const W=()=>{const{t:s}=M(),{paperTypes:d,finishingOptions:m,printingOptions:g}=T(),{theme:v}=O(),p=v.mode==="dark",[i,j]=o.useState("paper"),[a,y]=o.useState(""),[n,h]=o.useState(null),[u,r]=o.useState(null),C=d.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())||e.description.toLowerCase().includes(a.toLowerCase())),k=m.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())||e.description&&e.description.toLowerCase().includes(a.toLowerCase())),N=g.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())||e.machineModel.toLowerCase().includes(a.toLowerCase())),l=e=>h(e),I=()=>{},L=()=>{},S=[{key:"paper",label:s("inventory.catalog.paper"),icon:w},{key:"finishing",label:s("inventory.catalog.finishing"),icon:b},{key:"printing",label:s("inventory.catalog.printing"),icon:f}],P=[{label:s("inventory.catalog.paperTypes"),value:d.length,icon:w,gradient:"from-blue-500 to-cyan-600"},{label:s("inventory.catalog.finishingOptions"),value:m.length,icon:b,gradient:"from-violet-500 to-purple-600"},{label:s("inventory.catalog.printingMethods"),value:g.length,icon:f,gradient:"from-emerald-500 to-teal-600"}];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-6 pb-20 animate-fade-in",children:[t.jsx(Z,{title:s("inventory.catalog.title"),subtitle:s("inventory.catalog.subtitle"),description:s("inventory.catalog.description"),icon:A,gradient:"from-indigo-600 via-blue-600 to-cyan-600"}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-6",children:P.map((e,c)=>t.jsx(z,{label:e.label,value:e.value,icon:e.icon,gradient:e.gradient},c))}),t.jsxs("div",{className:`rounded-3xl border shadow-sm p-6 ${p?"bg-slate-900 border-slate-800":"bg-white border-slate-100"}`,children:[t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-stretch sm:items-center gap-6 mb-8",children:[t.jsx("div",{className:`flex p-1.5 rounded-2xl overflow-x-auto whitespace-nowrap custom-scrollbar ${p?"bg-slate-800 border border-slate-700":"bg-slate-100 border border-slate-200"}`,children:S.map(e=>{const c=e.icon,x=i===e.key;return t.jsxs("button",{onClick:()=>j(e.key),className:`flex items-center gap-2.5 px-4 py-2.5 rounded-xl text-sm font-bold transition-all duration-300 ${x?"bg-white dark:bg-slate-700 text-indigo-600 dark:text-white shadow-sm scale-[1.02]":"text-slate-500 hover:text-indigo-600 hover:bg-white/50 dark:text-slate-400 dark:hover:text-white dark:hover:bg-slate-700/50"}`,children:[t.jsx(c,{className:`h-4.5 w-4.5 ${x?"text-indigo-500":"text-slate-400"}`}),t.jsx("span",{children:e.label})]},e.key)})}),t.jsx("div",{className:"w-full sm:max-w-md",children:t.jsx(V,{placeholder:s("inventory.catalog.search"),value:a,onChange:e=>y(e.target.value),icon:q,className:"w-full"})})]}),t.jsxs("div",{className:"min-h-[400px]",children:[i==="paper"&&t.jsx(E,{paperTypes:C,onViewItem:l,viewMode:"card",showPhotos:!0,isCustomerView:!0}),i==="finishing"&&t.jsx(F,{finishingOptions:k,onViewItem:l,viewMode:"card",showPhotos:!0,isCustomerView:!0}),i==="printing"&&t.jsx($,{printingOptions:N,onViewItem:l,viewMode:"card",isCustomerView:!0})]})]})]}),n&&t.jsx(D,{item:n,isOpen:!!n,onClose:()=>h(null),onEdit:I,onDelete:L,onZoomImage:r}),u&&t.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/90 p-4 animate-fade-in",onClick:()=>r(null),children:[t.jsx("button",{onClick:()=>r(null),className:"absolute top-6 right-6 p-2 rounded-full bg-white/10 hover:bg-white/20 transition-colors",children:t.jsx(B,{className:"h-8 w-8 text-white"})}),t.jsx("img",{src:u,alt:"Zoomed",className:"max-w-full max-h-[90vh] object-contain rounded-lg shadow-2xl"})]})]})};export{W as default};
