1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6183],{19224:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/catalog/[companyName]/invoice",function(){return t(91796)}])},75278:function(e,n,t){"use strict";t.d(n,{b:function(){return M},Z:function(){return O}});var r=t(47568),i=t(14924),o=t(70655),l=t(85893),a=t(62400),s=t(81719),c=t(29630),d=t(49837),u=t(44373),v=t(54225),m=t(96486),h=t(67294),f=t(88628),x=t(56027),p=t(828),g=t(96277),y=t(43085),j=t(86501),Z=t(3858),b=t(20986),N=t(9144),C=t(23378),w=t(70754),S=t(26042),P=t(69396),I=t(29620),k=t(77745),z=t(95398),W=t(67836),_=t(76779),q={address1:"",address2:"",city:"",state:"",country:"",postcode:"",name:"",telNo:"",email:"",companyName:"",residential:!1},T=["address1","city","country","postcode"],R=function(e){var n,t,r,o,a,s,c,d,u=e.open,m=e.initialValue,f=e.defaultCompanyName,x=e.onClose,p=e.onSave,g=(0,h.useState)(q),y=g[0],j=g[1],Z=(0,h.useState)({}),b=Z[0],C=Z[1];(0,h.useEffect)((function(){u&&(j(m?(0,S.Z)({},q,m):(0,P.Z)((0,S.Z)({},q),{companyName:f})),C({}))}),[u,m,f]);var w,R,E,M,O,A,B,L,D,H,F=function(e,n){j((function(t){return(0,P.Z)((0,S.Z)({},t),(0,i.Z)({},e,n))}))},G=T.filter((function(e){var n;return!(null===(n=y[e])||void 0===n?void 0:n.toString().trim())})),V=0===G.length;return(0,l.jsxs)(I.Z,{open:u,onClose:x,maxWidth:"sm",fullWidth:!0,children:[(0,l.jsx)(k.Z,{children:"Confirm Ship-to Address"}),(0,l.jsx)(z.Z,{children:(0,l.jsxs)(N.Z,{spacing:2,sx:{mt:1},children:[(0,l.jsxs)(N.Z,{direction:{xs:"column",sm:"row"},spacing:2,children:[(0,l.jsx)(W.Z,{fullWidth:!0,size:"small",label:"Company Name",value:null!==(w=y.companyName)&&void 0!==w?w:"",onChange:function(e){return F("companyName",e.target.value)}}),(0,l.jsx)(W.Z,{fullWidth:!0,size:"small",label:"Recipient Name",value:null!==(R=y.name)&&void 0!==R?R:"",onChange:function(e){return F("name",e.target.value)}})]}),(0,l.jsx)(W.Z,{fullWidth:!0,size:"small",label:"Address Line 1 *",required:!0,value:null!==(E=y.address1)&&void 0!==E?E:"",onChange:function(e){return F("address1",e.target.value)},onBlur:function(){return C((function(e){return(0,P.Z)((0,S.Z)({},e),{address1:!0})}))},error:b.address1&&!(null===(n=y.address1)||void 0===n?void 0:n.trim()),helperText:b.address1&&!(null===(t=y.address1)||void 0===t?void 0:t.trim())?"Required":""}),(0,l.jsx)(W.Z,{fullWidth:!0,size:"small",label:"Address Line 2",value:null!==(M=y.address2)&&void 0!==M?M:"",onChange:function(e){return F("address2",e.target.value)}}),(0,l.jsxs)(N.Z,{direction:{xs:"column",sm:"row"},spacing:2,children:[(0,l.jsx)(W.Z,{fullWidth:!0,size:"small",label:"City *",required:!0,value:null!==(O=y.city)&&void 0!==O?O:"",onChange:function(e){return F("city",e.target.value)},onBlur:function(){return C((function(e){return(0,P.Z)((0,S.Z)({},e),{city:!0})}))},error:b.city&&!(null===(r=y.city)||void 0===r?void 0:r.trim()),helperText:b.city&&!(null===(o=y.city)||void 0===o?void 0:o.trim())?"Required":""}),(0,l.jsx)(W.Z,{fullWidth:!0,size:"small",label:"State / Province",value:null!==(A=y.state)&&void 0!==A?A:"",onChange:function(e){return F("state",e.target.value)}})]}),(0,l.jsxs)(N.Z,{direction:{xs:"column",sm:"row"},spacing:2,children:[(0,l.jsx)(W.Z,{fullWidth:!0,size:"small",label:"Postcode *",required:!0,value:null!==(B=y.postcode)&&void 0!==B?B:"",onChange:function(e){return F("postcode",e.target.value)},onBlur:function(){return C((function(e){return(0,P.Z)((0,S.Z)({},e),{postcode:!0})}))},error:b.postcode&&!(null===(a=y.postcode)||void 0===a?void 0:a.trim()),helperText:b.postcode&&!(null===(s=y.postcode)||void 0===s?void 0:s.trim())?"Required":""}),(0,l.jsx)(W.Z,{fullWidth:!0,size:"small",label:"Country *",required:!0,value:null!==(L=y.country)&&void 0!==L?L:"",onChange:function(e){return F("country",e.target.value)},onBlur:function(){return C((function(e){return(0,P.Z)((0,S.Z)({},e),{country:!0})}))},error:b.country&&!(null===(c=y.country)||void 0===c?void 0:c.trim()),helperText:b.country&&!(null===(d=y.country)||void 0===d?void 0:d.trim())?"Required":""})]}),(0,l.jsxs)(N.Z,{direction:{xs:"column",sm:"row"},spacing:2,children:[(0,l.jsx)(W.Z,{fullWidth:!0,size:"small",label:"Telephone",value:null!==(D=y.telNo)&&void 0!==D?D:"",onCh
1ange:function(e){return F("telNo",e.target.value)}}),(0,l.jsx)(W.Z,{fullWidth:!0,size:"small",label:"Email",value:null!==(H=y.email)&&void 0!==H?H:"",onChange:function(e){return F("email",e.target.value)}})]})]})}),(0,l.jsxs)(_.Z,{children:[(0,l.jsx)(v.Z,{onClick:x,children:"Cancel"}),(0,l.jsx)(v.Z,{variant:"contained",onClick:function(){return p(y)},disabled:!V,children:"Save"})]})]})},E=function(e){var n,t,r=e.value,i=e.onChange,o=(0,g.c34)({fetchPolicy:"cache-and-network",errorPolicy:"all"}),a=o.data,s=o.loading,d=o.error,u=(0,h.useState)(!1),m=u[0],f=u[1],x=(0,h.useState)(!1),p=x[0],y=x[1],j=null===a||void 0===a||null===(n=a.myCompany)||void 0===n?void 0:n.address,Z=null===a||void 0===a||null===(t=a.myCompany)||void 0===t?void 0:t.name;(0,h.useEffect)((function(){var e,n,t,o,l,a,s,c,d;p||r||(null===j||void 0===j?void 0:j.address1)&&(i({address1:null!==(e=j.address1)&&void 0!==e?e:"",address2:null!==(n=j.address2)&&void 0!==n?n:"",city:null!==(t=j.city)&&void 0!==t?t:"",state:null!==(o=j.state)&&void 0!==o?o:"",country:null!==(l=j.country)&&void 0!==l?l:"",postcode:null!==(a=j.postcode)&&void 0!==a?a:"",name:null!==(s=j.name)&&void 0!==s?s:"",telNo:null!==(c=j.telNo)&&void 0!==c?c:"",email:null!==(d=j.email)&&void 0!==d?d:"",companyName:null!==Z&&void 0!==Z?Z:"",residential:!1}),y(!0))}),[p,r,j,Z,i]);var S=(0,h.useMemo)((function(){return!(!r||!j)&&((null!==(e=r.address1)&&void 0!==e?e:"").trim()!==(null!==(n=j.address1)&&void 0!==n?n:"").trim()||(null!==(t=r.city)&&void 0!==t?t:"").trim()!==(null!==(i=j.city)&&void 0!==i?i:"").trim()||(null!==(o=r.postcode)&&void 0!==o?o:"").trim()!==(null!==(l=j.postcode)&&void 0!==l?l:"").trim()||(null!==(a=r.country)&&void 0!==a?a:"").trim()!==(null!==(s=j.country)&&void 0!==s?s:"").trim());var e,n,t,i,o,l,a,s}),[r,j]),P=(0,h.useMemo)((function(){var e,n,t,i;return!!r&&Boolean((null===(e=r.address1)||void 0===e?void 0:e.trim())&&(null===(n=r.city)||void 0===n?void 0:n.trim())&&(null===(t=r.country)||void 0===t?void 0:t.trim())&&(null===(i=r.postcode)||void 0===i?void 0:i.trim()))}),[r]);return(0,l.jsxs)(N.Z,{spacing:1,className:"w-full",children:[(0,l.jsxs)(N.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,l.jsx)(b.hq,{size:16}),(0,l.jsx)(c.Z,{variant:"subtitle2",fontWeight:700,children:"Ship-to address"}),S&&(0,l.jsx)(C.Z,{size:"small",label:"Modified",color:"warning"}),!s&&!P&&(0,l.jsx)(C.Z,{size:"small",label:"Required",color:"error"})]}),s&&!r?(0,l.jsxs)(N.Z,{direction:"row",alignItems:"center",spacing:1,sx:{py:1},children:[(0,l.jsx)(w.Z,{size:16}),(0,l.jsx)(c.Z,{variant:"body2",color:"text.secondary",children:"Loading your account address\u2026"})]}):r?(0,l.jsxs)(N.Z,{sx:{border:1,borderColor:"divider",borderRadius:1,p:1.5,backgroundColor:function(e){return e.palette.background.default}},children:[r.companyName&&(0,l.jsx)(c.Z,{variant:"body2",fontWeight:600,children:r.companyName}),r.name&&(0,l.jsx)(c.Z,{variant:"body2",children:r.name}),(0,l.jsx)(c.Z,{variant:"body2",children:r.address1}),r.address2&&(0,l.jsx)(c.Z,{variant:"body2",children:r.address2}),(0,l.jsx)(c.Z,{variant:"body2",children:[r.city,r.state,r.postcode].filter(Boolean).join(", ")}),(0,l.jsx)(c.Z,{variant:"body2",children:r.country}),r.telNo&&(0,l.jsxs)(c.Z,{variant:"caption",color:"text.secondary",children:["Tel: ",r.telNo]}),r.email&&(0,l.jsxs)(c.Z,{variant:"caption",color:"text.secondary",children:["Email: ",r.email]})]}):(0,l.jsx)(c.Z,{variant:"body2",color:"error",children:"No account address on file. Please add one in \u201cMy Company\u201d settings, or edit below."}),d&&(0,l.jsx)(c.Z,{variant:"caption",color:"error",children:"Could not load your account address. You can still enter one manually."}),(0,l.jsx)(v.Z,{size:"small",variant:"outlined",startIcon:(0,l.jsx)(b.dY,{size:14}),onClick:function(){return f(!0)},children:r?"Edit ship-to address":"Enter ship-to address"}),(0,l.jsx)(R,{open:m,initialValue:r,defaultCompanyName:null!==Z&&void 0!==Z?Z:"",onClose:function(){return f(!1)},onSave:function(e){i(e),f(!1)}})]})},M=(0,s.ZP)(c.Z)((function(e){var n=e.theme;return(0,i.Z)({color:n.palette["catalog-dark"].main,fontWeight:800},n.breakpoints.down("sm"),{fontSize:"0.75rem"})})),O=function(e){var n,t,i,s,b=e.rows,N=e.selectedCartItemIds,C=function(){var e=(0,a.N)(),n=e.onViewRequest,t=e.onViewOrder,i=(0,p.Z)((0,g.n82)(),2),l=i[0],s=i[1],c=s.loading,d=s.client,u=(0,p.Z)((0,g.XHf)(),2),v=u[0],m=u[1],h=m.loading,f=m.client,x=function(){var e=(0,r.Z)((function(e){var t,r,i;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return t=e.orderItemIds,r=e.remarks,[4,l({variables:{requestForQuantityDto:{orderItemIds:t,remarks:r}}})];case 1:return(null===(i=o.sent().data)||void 0===i?void 0:i.requestForQuantity)&&((0,y.x9)("Request sent successfully."),d.cache.evict({fieldName:"allCartItems"}),n()),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),Z=function(){var e=(0,r.Z)((function(e){var n,r,i;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return n=e.orderItemIds,r=e.shipTo,[4,v({variables:{cartItemIds:n,shipTo:null!==r&&void 0!==r?r:void 0}})];case 1:return(null===(i=o.sent().data)||void 0===i?void 0:i.checkOutCatalogCartItems)&&((0,y.x9)("Check out successfully!"),(0,j.ZP)("Payment must be completed within 7 days, otherwise the order will be automatically cancelled.",{duration:8e3,icon:"\u26a0\ufe0f"}),f.cache.evict({fieldName:"allCartItems"}),t()),[2]}}))}));return function(n){return e.apply(this,arguments)}}();return{loading:c,onRequest:x,onCheckOut:Z,checkOutLoading:h}}(),w=C.onRequest,S=C.onCheckOut,P=(0,a.N)().onViewHomepage,I=b.filter((function(e){return null===N||void 0===N?void 0:N.includes(e.id)}
1)),k=(0,Z.L)(I),z=k.total,W=k.convertedTotal,_=(0,h.useState)(null),q=_[0],T=_[1],R=I.length&&(null===I||void 0===I?void 0:I.every((function(e){var n;return null!==(n=null===e||void 0===e?void 0:e.canDirectCheckOut)&&void 0!==n&&n}))),O=Boolean((null===q||void 0===q||null===(n=q.address1)||void 0===n?void 0:n.trim())&&(null===q||void 0===q||null===(t=q.city)||void 0===t?void 0:t.trim())&&(null===q||void 0===q||null===(i=q.country)||void 0===i?void 0:i.trim())&&(null===q||void 0===q||null===(s=q.postcode)||void 0===s?void 0:s.trim())),A=Boolean(R)&&!O,B=function(){var e=(0,r.Z)((function(){return(0,o.__generator)(this,(function(e){switch(e.label){case 0:return N?R?[3,2]:[4,w({orderItemIds:N})]:[2];case 1:case 3:return e.sent(),[2];case 2:return O&&q?[4,S({orderItemIds:N,shipTo:q})]:[2]}}))}));return function(){return e.apply(this,arguments)}}(),L=I.reduce((function(e,n){return e+((0,m.isNil)(n.confirmedQuantity)?n.quantity:n.confirmedQuantity)}),0);return(0,l.jsx)(d.Z,{className:"mx-10 w-full px-6",sx:{minHeight:"50vh",backgroundColor:function(e){return e.palette.background.paper}},children:(0,l.jsxs)("div",{className:"flex flex-col items-center gap-4 p-4",children:[(0,l.jsx)(M,{variant:"h5",children:"Cart totals"}),(0,l.jsxs)("div",{className:"flex w-full flex-row justify-between pt-4",children:[(0,l.jsxs)(M,{variant:"body1",fontWeight:600,children:["Subtotal (",L," items)"]}),(0,l.jsxs)("div",{children:[z.currency," ",(0,f.G)(z.amount)]})]}),R?(0,l.jsx)("div",{className:"text-sm text-red-500 text-left w-full mt-2",children:(0,l.jsx)("ul",{className:"list-disc",children:['Price is <span style="font-weight: bold">PRODUCT COST</span> only.',"This invoice contains in stock item and payment must be made to hold the item within 30 mins of confirmation.","Shipping will be quoted and charged once confirm shipment as a separate payment before shipping out."].map((function(e,n){return(0,l.jsx)("li",{children:(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:e}})},n)}))})}):null,R?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Z,{orientation:"horizontal",sx:{width:"100%"}}),(0,l.jsx)(E,{value:q,onChange:T})]}):null,(0,l.jsx)(u.Z,{orientation:"horizontal",sx:{width:"100%"}}),(0,l.jsxs)("div",{className:"flex w-full flex-row justify-between pt-4",children:[(0,l.jsx)(M,{variant:"h6",children:" Total"}),(0,l.jsxs)("div",{className:"flex flex-col gap-1 text-right",children:[z.currency," ",(0,f.G)(z.amount),!!W&&(0,l.jsxs)(c.Z,{variant:"caption",hidden:z.currency===W.currency,children:["~",W.currency," ",(0,f.G)(W.amount)]})]})]}),(0,l.jsx)(x.Pp,{fullWidth:!0,variant:"contained",onClick:function(){return B()},disabled:!(null===N||void 0===N?void 0:N.length)||A,sx:{"&.Mui-disabled":{color:"white"}},className:"disabled:cursor-not-allowed disabled:opacity-50",children:R?"Check out":"Proceed to request"}),A?(0,l.jsx)(c.Z,{variant:"caption",color:"error",sx:{width:"100%",textAlign:"left"},children:"Please confirm a ship-to address before checking out."}):null,(0,l.jsx)(v.Z,{fullWidth:!0,variant:"text",sx:{color:function(e){return e.palette["catalog-dark"].main}},onClick:function(){return P()},children:"Continue Shopping"})]})})}},7464:function(e,n,t){"use strict";t.d(n,{BT:function(){return u},f2:function(){return v}});var r=t(26042),i=t(69396),o=t(85893),l=t(96277),a=t(96486),s=t(11163),c=t(67294),d=(0,c.createContext)(void 0),u=function(e){var n=e.children,t=e.defaultFilters,u=e.companyId,v=e.storeParamsInUrl,m=void 0!==v&&v,h=(0,s.useRouter)(),f=h.query,x=(0,c.useState)((function(){return m&&f.page?Number(f.page):0})),p=x[0],g=x[1],y=(0,c.useState)((function(){return m&&f.pageSize?Number(f.pageSize):10})),j=y[0],Z=y[1],b=(0,c.useState)((function(){return m&&f.filters?JSON.parse(f.filters):t||{}})),N=b[0],C=b[1],w=(0,c.useState)([]),S=w[0],P=w[1],I=(0,l.Vhd)({variables:{filter:(0,i.Z)((0,r.Z)({},N),{companyId:u}),page:p,perPage:j,sortField:"createdAt",sortOrder:l.Asd.Desc}}),k=I.refetch,z=I.loading,W=I.data,_=(0,c.useMemo)((function(){return{rows:(null===W||void 0===W?void 0:W.allInvoices.invoices)||[],totalRows:(null===W||void 0===W?void 0:W.allInvoices.total)||0}}),[W]),q=_.rows,T=_.totalRows;(0,c.useEffect)((function(){P([])}),[N]);var R=(0,c.useMemo)((function(){return(0,a.debounce)((function(e){var n=e.filters,t=e.page,o=e.pageSize;h.replace({query:(0,i.Z)((0,r.Z)({},h.query),{filters:JSON.stringify(n),page:t,pageSize:o})},void 0,{shallow:!0})}),100)}),[]);(0,c.useEffect)((function(){return m&&R({filters:N,page:p,pageSize:j}),function(){return R.cancel()}}),[m,p,N,j,R]);var E=(0,c.useMemo)((function(){return{rows:q,totalRows:T,filters:N,setFilters:C,page:p,setPage:g,pageSize:j,setPageSize:Z,selectedIds:S,setSelectedIds:P,loading:z,refetch:k,
1companyId:u}}),[q,N,T,p,j,S,z,k,u]);return(0,o.jsx)(d.Provider,{value:E,children:n})},v=(d.Consumer,function(){var e=(0,c.useContext)(d);if(!e)throw new Error("No Context.Provider found when calling useContext.");return e})},4095:function(e,n,t){"use strict";t.d(n,{I4:function(){return Z},Mf:function(){return j}});var r=t(85893),i=t(60813),o=t(5837),l=t(87811),a=t(55031),s=t(67062),c=t(29618),d=t(47028),u=t(61225),v=t(76992),m=t(49837),h=t(96486),f=t(67294),x=t(47116),p=t(2713),g=t(75278),y=t(48030),j=function(e){var n=e.children,t=e.number;return(0,r.jsx)(c.Z,{expandIcon:(0,r.jsx)(l.AD,{className:"mx-1"}),"aria-controls":"".concat(t,"-content"),id:"".concat(t,"-header"),sx:{flexDirection:"row-reverse","& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(90deg)"},"& .MuiAccordionSummary-content":{marginLeft:function(e){return e.spacing(1)}}},children:n})},Z=function(e){var n=e.children,t=e.className;return(0,r.jsx)(d.Z,{className:t,children:n})};n.ZP=function(e){var n,t=e.invoice,l=e.isExpanded,c=void 0===l?void 0:l,d=(0,f.useRef)(null),b=(0,u.Z)((function(e){return e.breakpoints.down("md")})),N=null!==(n=(0,h.get)(t,"salesOrder"))&&void 0!==n?n:(0,h.get)(t,"purchaseOrder"),C=(0,x.useReactToPrint)({copyStyles:!0,content:function(){return d.current},onPrintError:function(e){console.error(e)},documentTitle:"".concat((null===N||void 0===N?void 0:N.number)?"".concat(t.number," - ").concat(null===N||void 0===N?void 0:N.number):"".concat(t.number))}),w=function(){return C()},S=t.id,P=t.number,I=t.createdAt,k=t.status,z=t.company,W=(0,s.p6)(I,"dd-MM-yy");return(0,r.jsxs)(v.Z,{expanded:c,children:[(0,r.jsx)(j,{number:P,children:(0,r.jsxs)("div",{className:"flex h-full w-full items-end gap-2 lg:items-center",children:[(0,r.jsxs)(g.b,{variant:"h6",color:"white",fontWeight:500,children:["Invoice #",(0,r.jsx)(a.Z,{text:"".concat(P),mode:a.r.LIGHT})]}),(0,r.jsx)(p.Np,{variant:"body2",fontWeight:700,children:W}),(0,r.jsxs)("div",{className:"absolute right-3 top-1 lg:top-3",children:[(0,r.jsx)(o.UP,{className:"mb-2 mr-2",size:"small",label:(0,h.startCase)(k),variant:"filled",sx:{color:function(e){return e.palette["catalog-dark"].main},backgroundColor:function(e){return e.palette["catalog-primary"].main}}}),(0,r.jsx)(y.Z,{hidePay:b,hidePrint:b,onPrint:w,invoice:t})]})]})}),(0,r.jsxs)(Z,{className:"relative",children:[(0,r.jsx)("div",{className:"pt-3",children:(0,r.jsx)(m.Z,{ref:d,sx:{maxWidth:"1100px",boxShadow:"none"},children:(0,r.jsx)(i.Z,{company:z,invoiceData:t})})}),(0,r.jsx)("div",{className:"absolute -top-0 right-5",children:(0,r.jsx)(y.Z,{hidePay:!b,hidePrint:!b,onPrint:w,invoice:t})})]})]},S)}},67490:function(e,n,t){"use strict";var r=t(85893),i=t(12508),o=t(49837),l=t(75278);n.Z=function(e){var n=e.header,t=e.children;return(0,r.jsx)(o.Z,{className:"w-full p-4 lg:-ml-4",sx:{minHeight:{xs:"10vh",lg:"50vh"},backgroundColor:function(e){return e.palette.background.paper}},children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3 pl-2",children:[(0,r.jsxs)(l.b,{className:"flex items-center pb-2",variant:"h5",children:[(0,r.jsx)(i.W1,{className:"inline-block pr-1",color:"inherit",size:28}),n||"Search"]}),t]})})}},27809:function(e,n,t){"use strict";var r=t(85893),i=t(3021);n.Z=function(e){var n=e.page,t=e.onChange,o=e.total,l=e.pageSize,a=Math.ceil(o/l);return(0,r.jsx)("div",{className:"mt-2 flex justify-end",children:(0,r.jsx)(i.Z,{count:a,page:n+1,onChange:function(e,n){t(n-1)}})})}},71383:function(e,n,t){"use strict";var r=t(85893),i=t(47018),o=t(63121),l=t(78142),a=t(81719),s=t(29630),c=t(41664),d=t.n(c),u=t(67294),v=t(3431),m=(0,a.ZP)(s.Z)((function(e){return{"&:hover":{fontWeight:600,cursor:"pointer",color:e.theme.palette["catalog-dark"].main,textDecorationLine:"underline"}}}));n.Z=function(e){var n=e.defaultCompanyName,t=e.label,a=void 0===t?"":t,c=(0,l._Y)(),h=(0,o.w)({companyName:n||c}),f=null===h||void 0===h?void 0:h.name,x=(0,u.useMemo)((function(){return f?(0,v.OY)(f):null}),[f]);return f?(0,r.jsx)(i.Z,{title:(0,r.jsxs)("div",{className:"flex items-center justify-start gap-2 pb-6 pt-1 lg:pb-0",children:[!!x&&(0,r.jsx)(d(),{href:x,children:(0,r.jsx)(m,{className:"w-12",variant:"body1",fontWeight:400,children:"Home"})}),(0,r.jsx)("div",{hidden:!a,children:"> "}),(0,r.jsx)(s.Z,{variant:"body1",fontWeight:400,children:a})]})}):null}},91796:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return P},default:function(){return I}});var r=t(85893),i=t(14924),o=t(26042),l=t(69396),a=t(53273),s=t(47018),c=t(29630),d=t(79072),u=t(49837),v=t(91359),m=t(54225),h=t(67294),f=t(5548),x=t(67490),p=t(23585),g=t(27809),y=t(7464),j=t(4095),Z=function(e){var n=(0,y.f2)(),t=n.page,Z=n.pageSize,b=n.setPage,N=n.rows,C=n.totalRows,w=n.loading,S=n.filters,P=n.setFilters,I=(0,f.Z)().onOpenInvoice,k=(0,h.useCallback)((function(e,n){P((function(t){return(0,l.Z)((0,o.Z)({},t),(0,i.Z)({},e,n))}
1))}),[]);return(0,r.jsxs)("div",{children:[(0,r.jsx)(s.Z,{title:(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsx)(c.Z,{variant:"h3",children:"Invoice History"})})}),(0,r.jsx)("div",{className:"py-12"}),(0,r.jsxs)(d.ZP,{container:!0,spacing:4,children:[(0,r.jsx)(d.ZP,{item:!0,xs:12,lg:3,children:(0,r.jsxs)(x.Z,{children:[(0,r.jsx)(a.Z,{name:"number",placeholder:"Search invoice #",value:(null===S||void 0===S?void 0:S.number)||"",onChange:k}),(0,r.jsx)(a.Z,{name:"orderNumber",placeholder:"Search order number",value:(null===S||void 0===S?void 0:S.orderNumber)||"",onChange:k})]})}),(0,r.jsxs)(d.ZP,{item:!0,xs:12,lg:9,className:"relative",children:[(0,r.jsx)(u.Z,{sx:{backgroundColor:function(e){return e.palette["catalog-primary"].main},mb:4},children:(0,r.jsx)(v.Z,{className:"flex flex-row-reverse flex-wrap",children:(0,r.jsx)(m.Z,{color:"secondary",variant:"contained",size:"small",onClick:function(){N&&N.length&&N.forEach((function(e){I(e.number)}))},children:"Print All"})})}),(0,r.jsx)(p.Z,{loading:w}),N.map((function(e){return(0,r.jsx)(j.ZP,{invoice:e},e.id)}))]}),(0,r.jsx)(d.ZP,{item:!0,xs:12,children:(0,r.jsx)(g.Z,{page:t,pageSize:Z,total:C,onChange:b})})]})]})},b=t(71383),N=t(85769),C=t(63121),w=t(78142),S=function(){var e=(0,w._Y)(),n=(0,C.w)({companyName:e}),t=null===n||void 0===n?void 0:n.id;return t?(0,r.jsx)(y.BT,{companyId:t,storeParamsInUrl:!0,children:(0,r.jsxs)("div",{className:"mx-auto max-w-7xl px-4 py-6 lg:px-0",children:[(0,r.jsx)(b.Z,{label:"Invoice"}),(0,r.jsx)(Z,{})]})}):null},P=!0,I=S;S.getLayout=function(e){return(0,r.jsx)(N.Z,{children:e})},S.guestGuard=!1,S.authGuard=!1,S.setConfig=function(){return{mode:"light"}}}},function(e){e.O(0,[2876,630,4980,4577,7536,1524,4231,5428,1718,5836,5734,3747,1717,2268,9591,2512,1090,7247,5780,1280,2020,8507,3021,1115,7384,4738,5686,9495,6732,5646,9714,2068,6778,1039,4503,6446,2180,7297,309,7545,9329,9721,1197,7302,4015,5992,5769,4760,9774,2888,179],(function(){return n=19224,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.