_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[27],{"5GSB":function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/aw_ctq/quote",function(){return a("Xgwz")}])},Xgwz:function(e,t,a){"use strict";a.r(t);var l=a("vJKn"),c=a.n(l),r=a("rg98"),n=a("cpVT"),i=a("nKUr"),o=a("Bf37"),s=a("pP19"),b=a("B56x"),d=a("q1tI"),j=a("KXw/"),p=a("j0jx"),O=a("s0+Y");function u(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,l)}return a}function h(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?u(Object(a),!0).forEach((function(t){Object(n.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):u(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var x=function(e){var t=e.t,a=e.pageConfig,l=e.Content,c=e.ErrorView,r={title:t("quote:pageTitle"),headerTitle:t("quote:pageTitle"),header:"relative",bottomNav:!0},n=Object(d.useState)(1),o=n[0],s=n[1],b=Object(d.useState)(10),u=b[0],x=b[1],f=Object(d.useState)(!1),g=f[0],m=f[1],v=Object(d.useState)(null),w=v[0],y=v[1],P=Object(p.e)({pageSize:u||10,currentPage:o||1});return Object(d.useEffect)((function(){m(P.loading),!P.loading&&P.data&&y(P.data.ctqQuoteList)}),[P]),Object(O.a)("company_quotes")?Object(i.jsx)(j.a,h(h({pageConfig:a||r},e),{},{children:Object(i.jsx)(l,{t:t,loading:g,data:w,page:o,perPage:u,setPage:s,setPerPage:x,checkB2BPermission:O.a})})):Object(i.jsx)(c,h({statusCode:404},e))},f=a("3PeG"),g=a("PsDL"),m=a("nCZa"),v=a("kKAo"),w=a("/EAt"),y=a("Imu7"),P=a("sRsu"),k=a("Uf6+"),N=a("xMA7"),q=a("ELmG"),C=a("/z3n"),z=a.n(C),R=a("CarD"),S=a.n(R),D=a("8C4M"),T=a.n(D),_=a("RJ8S"),E=a.n(_),L=a("bWLx"),B=a("H2TA"),A=a("R/WZ"),M=a("viY9"),I=a("tr08"),W=a("yP8F"),V=a("y23C"),G=a("Th4q"),J=a.n(G),U=a("TSYQ"),X=a.n(U),F=a("bOoQ"),K=a("hlie"),H=a("znFL"),Q=a("LVa3"),Y=a("VZJq");function Z(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,l)}return a}function $(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(a),!0).forEach((function(t){Object(n.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Z(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var ee=Object(A.a)((function(e){var t,a,l;return{root:$($({},Y.h),{},{position:"relative",background:W.d,padding:"35px 40px",borderRadius:10}),container:$($({marginTop:"20px"},Y.h),{},{display:"flex",width:"100%",fontSize:"12px",padding:"20px 20px 40px 20px",backgroundColor:W.d}),flexRow:$({},Y.i),content:$($($({},Y.i),Object(Y.f)(0,0,70,0)),{},{flexWrap:"wrap"}),colorPrimary:{color:W.l},appBar:{backgroundColor:"white",boxShadow:"none",borderBottom:"1px solid ".concat(W.e),flexGrow:1},pageTitle:{fontWeight:700,textAlign:"center",color:W.l,textTransform:"uppercase",position:"absolute",left:"50px",right:"50px"},wishlistWrapper:{},footer:Object(n.a)({display:"flex",alignItems:"center",justifyItems:"left",background:W.d,textAlign:"center"},e.breakpoints.up("sm"),{position:"unset"}),tableContainer:{boxShadow:"none",background:W.d},tableOuterContainer:{paddingTop:20},table:Object(n.a)({width:"100%"},e.breakpoints.down("sm"),{borderTop:"0px"}),tableRowHead:Object(n.a)({border:"none !important"},e.breakpoints.down("sm"),{display:"none !important"}),tableRowResponsive:Object(n.a)({},e.breakpoints.down("sm"),{display:"grid !important",padding:10}),tableCellResponsive:(t={borderBottom:"1px solid rgba(224, 224, 224, 1)"},Object(n.a)(t,e.breakpoints.down("sm"),{padding:"8px 0"}),Object(n.a)(t,"color",W.a),t),tableCellResponsiveLast:(a={border:"none"},Object(n.a)(a,e.breakpoints.down("sm"),{borderBottom:"1px solid rgba(224, 224, 224, 1)",padding:"8px 0"}),Object(n.a)(a,"color",W.a),a),tableBody:{backgroundColor:"#ffffff"},containerSkeleton:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",height:"100%",marginTop:"30%"},mobLabel:(l={},Object(n.a)(l,e.breakpoints.up("md"),{display:"none"}),Object(n.a)(l,"width","50%"),Object(n.a)(l,"minWidth","150px"),Object(n.a)(l,"maxWidth","200px"),Object(n.a)(l,"position","relative"),Object(n.a)(l,"paddingRight",20),Object(n.a)(l,"&::after",{content:"':'",display:"block",position:"absolute",right:"8px",top:0}),l),pointTitle:Object(n.a)({fontSize:".75rem"},e.breakpoints.up("md"),{fontSize:"1.5rem"}),pointTitle2:Object(n.a)({fontSize:".75rem"},e.breakpoints.up("md"),{fontSize:"1.25rem"}),blue:{backgroundColor:W.b,color:"white !important"},btnContainer:{textAlign:"right"},btnAdd:{backgroundColor:W.b,margin:"30px 0","&:hover":{backgroundColor:W.b}},valueEdit:{color:W.b,cursor:"pointer"}}})),te=a("SpDg"),ae=function(){return Object(i.jsx)(i.Fragment,{children:Object(i.jsx)(P.a,{children:Object(i.jsxs)(f.a,{colSpan:9,children:[Object(i.jsx)(te.a,{variant:"text",width:"100%",height:30}),Object(i.jsx)(te.a,{variant:"text",width:"100%",height:30}),Object(i.jsx)(te.a,{variant:"text",width:"100%",height:30}),Object(i.jsx)(te.a,{variant:"text",width:"100%",height:30}),Object(i.jsx)(te.a,{variant:"text",width:"100%",height:30}),Object(i.jsx)(te.a,{variant:"text",width:"100%",height:30}),Object(i.jsx)(te.a,{variant:"text",width:"100%",height:30}),Object(i.jsx)(te.a,{variant:"text",width:"100%",height:30})]})})})};function le(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,l)}return a}function ce(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?le(Object(a),!0).forEach((function(t){Object(n.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):le(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var re=Object(B.a)((function(){return{head:{backgroundColor:W.b,color:W.q},body:{fontSize:14}}}))(f.a),ne=Object(A.a)((function(e){return{root:{flexShrink:0,marginLeft:e.spacing(2.5)}}})),ie=J()({}),oe=Object(M.a)({overrides:{MuiTablePagination:{toolbar:Object(n.a)({display:"flex"},ie.up("sm"),{justifyContent:"center"}),spacer:{flex:"none"}}}});function se(e){var t=ne(),a=Object(I.a)(),l=e.count,c=e.page,r=e.rowsPerPage,n=e.onChangePage;return Object(i.jsxs)("div",{className:t.root,children:[Object(i.jsx)(g.a,{onClick:function(e){n(e,1)},disabled:1===c,"aria-label":"first page",children:"rtl"===a.direction?Object(i.jsx)(E.a,{}):Object(i.jsx)(z.a,{})}),Object(i.jsx)(g.a,{onClick:function(e){n(e,c-1)},disabled:1===c,"aria-label":"previous page",children:"rtl"===a.direction?Object(i.jsx)(T.a,{}):Object(i.jsx)(S.a,{})}),Object(i.jsx)(g.a,{onClick:function(e){n(e,c+1)},disabled:c===Math.ceil(l/r),"aria-label":"next page",children:"rtl"===a.direction?Object(i.jsx)(S.a,{}):Object(i.jsx)(T.a,{})}),Object(i.jsx)(g.a,{onClick:function(e){n(e,Math.max(0,Math.ceil(l/r)))},disabled:c===Math.ceil(l/r),"aria-label":"last page",children:"rtl"===a.direction?Object(i.jsx)(z.a,{}):Object(i.jsx)(E.a,{})})]})}var be=function(e){var t=ee(),a=Object(V.a)("sm"),l=e.t,c=e.loading,r=e.data,n=e.page,o=e.perPage,s=e.setPage,b=e.setPerPage,d=e.checkB2BPermission,j=null==r?void 0:r.totalData;return Object(i.jsx)(Q.a,ce(ce({},e),{},{children:Object(i.jsx)("div",{className:t.container,children:Object(i.jsx)(L.a,{theme:oe,children:Object(i.jsx)(m.a,{component:v.a,className:t.tableContainer,children:Object(i.jsxs)(w.a,{className:t.table,size:"small",children:[Object(i.jsx)(y.a,{children:Object(i.jsxs)(P.a,{className:t.tableRowHead,children:[Object(i.jsx)(re,{align:"left",children:Object(i.jsx)(F.default,{variant:"span",type:"bold",color:"black",children:l("quote:table:id")})}),Object(i.jsx)(re,{align:"left",children:Object(i.jsx)(F.default,{variant:"span",type:"bold",color:"black",children:l("quote:table:name")})}),Object(i.jsx)(re,{align:"left",children:Object(i.jsx)(F.default,{variant:"span",type:"bold",color:"black",children:l("quote:table:owner")})}),Object(i.jsx)(re,{align:"left",children:Object(i.jsx)(F.default,{variant:"span",type:"bold",color:"black",children:l("quote:table:created")})}),Object(i.jsx)(re,{align:"left",children:Object(i.jsx)(F.default,{variant:"span",type:"bold",color:"black",children:l("quote:table:status")})}),Object(i.jsx)(re,{align:"left",children:Object(i.jsx)(F.default,{variant:"span",type:"bold",color:"black",children:l("quote:table:lastUpdate")})}),Object(i.jsx)(re,{align:"left",children:Object(i.jsx)(F.default,{variant:"span",type:"bold",color:"black",children:l("quote:table:quoteTotal")})}),Object(i.jsx)(re,{align:"left",children:Object(i.jsx)(F.default,{variant:"span",type:"bold",color:"black",children:l("quote:table:actions")})})]})}),Object(i.jsx)(k.a,{className:t.tableBody,children:c?Object(i.jsx)(ae,{}):Object(i.jsx)(i.Fragment,{children:r&&r.items.map((function(e,c){return Object(i.jsxs)(P.a,{className:t.tableRowResponsive,children:[Object(i.jsx)(f.a,{className:X()(t.tableCellResponsive,!a&&t.blue),align:"left","data-th":Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",children:l("quote:table:id")}),children:Object(i.jsxs)("div",{className:t.flexRow,children:[Object(i.jsx)("div",{className:t.mobLabel,children:Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",color:"black",children:l("quote:table:id")})}),Object(i.jsx)("div",{className:t.value,children:Object(i.jsx)(F.default,{variant:"span",letter:"capitalize",color:"black",children:e.id||"-"})})]})}),Object(i.jsx)(f.a,{className:t.tableCellResponsive,align:"left","data-th":Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",children:l("quote:table:name")}),children:Object(i.jsxs)("div",{className:t.flexRow,children:[Object(i.jsx)("div",{className:t.mobLabel,children:Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",color:"black",children:l("quote:table:name")})}),Object(i.jsx)("div",{className:t.value,children:Object(i.jsx)(F.default,{variant:"span",letter:"capitalize",color:"black",children:e.name||"-"})})]})}),Object(i.jsx)(f.a,{className:t.tableCellResponsive,align:"left","data-th":Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",children:l("quote:table:owner")}),children:Object(i.jsxs)("div",{className:t.flexRow,children:[Object(i.jsx)("div",{className:t.mobLabel,children:Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",color:"black",children:l("quote:table:owner")})}),Object(i.jsx)("div",{className:t.value,children:Object(i.jsx)(F.default,{variant:"span",letter:"capitalize",color:"black",children:e.customer_name||"-"})})]})}),Object(i.jsx)(f.a,{className:t.tableCellResponsive,align:"left","data-th":Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",children:l("quote:table:created")}),children:Object(i.jsxs)("div",{className:t.flexRow,children:[Object(i.jsx)("div",{className:t.mobLabel,children:Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",color:"black",children:l("quote:table:created")})}),Object(i.jsx)("div",{className:t.value,children:Object(i.jsx)(F.default,{variant:"span",letter:"capitalize",color:"black",children:e.created_at||"-"})})]})}),Object(i.jsx)(f.a,{className:t.tableCellResponsive,align:"left","data-th":Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",children:l("quote:table:status")}),children:Object(i.jsxs)("div",{className:t.flexRow,children:[Object(i.jsx)("div",{className:t.mobLabel,children:Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",color:"black",children:l("quote:table:status")})}),Object(i.jsx)("div",{className:t.value,children:Object(i.jsx)(F.default,{variant:"span",letter:"capitalize",color:"black",children:e.status||"-"})})]})}),Object(i.jsx)(f.a,{className:t.tableCellResponsive,align:"left","data-th":Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",children:l("quote:table:lastUpdate")}),children:Object(i.jsxs)("div",{className:t.flexRow,children:[Object(i.jsx)("div",{className:t.mobLabel,children:Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",color:"black",children:l("quote:table:lastUpdate")})}),Object(i.jsx)("div",{className:t.value,children:Object(i.jsx)(F.default,{variant:"span",letter:"capitalize",color:"black",children:e.last_updated||"-"})})]})}),Object(i.jsx)(f.a,{className:t.tableCellResponsive,align:"left","data-th":Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",children:l("quote:table:quoteTotal")}),children:Object(i.jsxs)("div",{className:t.flexRow,children:[Object(i.jsx)("div",{className:t.mobLabel,children:Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",color:"black",children:l("quote:table:quoteTotal")})}),Object(i.jsx)("div",{className:t.value,children:Object(i.jsx)(F.default,{variant:"span",letter:"capitalize",color:"black",children:Object(H.a)(e.quote_total||0)})})]})}),Object(i.jsx)(f.a,{className:t.tableCellResponsive,align:"left","data-th":Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",children:l("quote:table:actions")}),children:Object(i.jsxs)("div",{className:t.flexRow,children:[Object(i.jsx)("div",{className:t.mobLabel,children:Object(i.jsx)(F.default,{align:"center",type:"bold",letter:"capitalize",color:"black",children:l("quote:table:actions")})}),d("company_quotes_view")&&Object(i.jsx)("div",{className:t.valueEdit,children:Object(i.jsx)(F.default,{variant:"span",letter:"capitalize",color:"black",children:Object(i.jsx)(K.a,{href:"/aw_ctq/edit/".concat(e.id),children:"View"})})})]})})]},c)}))})}),Object(i.jsx)(N.a,{children:Object(i.jsx)(P.a,{children:Object(i.jsx)(q.a,{rowsPerPageOptions:[1,5,10,25,{label:"All",value:r&&r.totalData}],colSpan:8,count:j,rowsPerPage:o,page:n,SelectProps:{inputProps:{"aria-label":"rows per page"},native:!0},labelDisplayedRows:function(){return"Page ".concat(n," of ").concat(Math.max(0,Math.ceil(j/o)))},onChangePage:function(e,t){s(t)},onChangeRowsPerPage:function(e){b(parseInt(e.target.value,10)),s(1)},ActionsComponent:se})})})]})})})})}))};function de(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,l)}return a}var je=function(e){return Object(i.jsx)(x,function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?de(Object(a),!0).forEach((function(t){Object(n.a)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):de(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({Content:be,ErrorView:b.a},e))};je.getInitialProps=Object(r.a)(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{namespacesRequired:["common","customer","quote","validate"],withAuth:!0});case 1:case"end":return e.stop()}}),e)})));var pe=Object(o.a)({ssr:!1})(Object(s.withTranslation)()(je));t.default=pe}},[["5GSB",4,2,1,3,0]]]);