1(this["webpackJsonpone-free-ui"]=this["webpackJsonpone-free-ui"]||[]).push([[53],{1151:function(e,t,n){"use strict";var a=n(15),i=n(1149),c=n(1169),l=n(313),r=n(21),o=n(2);t.a=function(e){var t=Object(l.a)().t,n=e.backgroundColor,s=e.label,d=e.handleDelete;return s?Object(o.jsx)(i.a,{style:{height:"auto",padding:"5px 10px",borderRadius:"18px",color:n,border:"2px solid ".concat(n),backgroundColor:Object(r.Z)(n,.1),fontFamily:"Inter-Bold"},label:t(a.a.capitalize(s)),onDelete:d,deleteIcon:Object(o.jsx)(c.a,{})}):""}},1152:function(e,t,n){"use strict";var a=n(9),i=n(3),c=n(381),l=n(1368),r=n(1372),o=n(1371),s=n(1367),d=n(1369),u=n(1370),b=n(10),j=n(8),m=n(0),p=n.n(m),x=n(313),v=n(1166),O=n(2),f=Object(c.a)((function(e){var t;return{tableHeaderRow:(t={fontFamily:"Inter-Bold, sans-serif",whiteSpace:"pre-wrap",textAlign:"center",verticalAlign:"top"},Object(i.a)(t,e.breakpoints.down("sm"),{border:"none",display:"flex",flexDirection:"column",alignItems:"center",padding:"0"}),Object(i.a)(t,"& > div",Object(i.a)({"& > label":{fontFamily:"Inter-Regular"},"& > div:nth-of-type(1)":{borderBottom:"1px solid ".concat(e.palette.utility.main)}},e.breakpoints.down("sm"),{minHeight:"50px",display:"flex",flexDirection:"column",alignItems:"center",width:"100%","& > div:nth-of-type(1)":{display:"none"},"& > input":{marginTop:"20px",maxWidth:"100%",width:"85%","&::placeholder":{color:"black"}}})),t),tableBody:{"& tr:nth-of-type(odd)":{background:e.palette.utility.rowOdd}},tableRow:Object(i.a)({},e.breakpoints.down("sm"),{borderBottom:"1px solid ".concat(e.palette.background.border)}),tableBodyRow:Object(i.a)({whiteSpace:"pre-wrap",textAlign:"center"},e.breakpoints.down("sm"),{border:"none",display:"flex",flexDirection:"column",alignItems:"center",padding:"0"}),inputPage:{margin:"0px 10px",width:"70px",textAlign:"center",border:"1px solid ".concat(e.palette.utility.main),background:e.palette.background.main,padding:"5px 7px",borderRadius:"3px",fontWeight:"400"},selectPageSize:{margin:"0px 10px",border:"1px solid ".concat(e.palette.utility.main),background:e.palette.background.main,padding:"7px",borderRadius:"3px",fontWeight:"400"},pagination:Object(i.a)({color:e.palette.text.main,fontFamily:"Inter-Bold"},e.breakpoints.down("sm"),{display:"flex",flexDirection:"column","& > *":{margin:"10px 0"}}),emptyRowsPlaceholder:{height:"80px",backgroundColor:e.palette.background.main}}}));t.a=function(e){var t,n,i,c=e.columns,m=e.onRowClick,h=void 0===m?function(){}:m,g=e.data,N=e.tablePagination,w=void 0!==N&&N,y=e.page,k=void 0===y?1:y,C=e.onChangePage,S=e.pageSize,I=void 0===S?10:S,R=e.pageSizes,F=void 0===R?b.z:R,H=e.changePageSize,T=e.noDataText,A=void 0===T?b.gc:T,D=e.classWrapper,P=e.classRow,E=e.rowProps,z=void 0===E?function(){return{}}:E,B=e.cellProps,W=void 0===B?function(){return{}}:B,L=e.error,M=void 0===L?null:L,_=e.editInvoiceItemIndex,V=void 0===_?void 0:_,Y=e.editInvoiceItemId,G=void 0===Y?void 0:Y,U=Object(x.a)().t,q=f(e),J=Array.isArray(g)&&g||[],Q=Object(v.useTable)({columns:c,data:J}),X=Q.getTableProps,Z=Q.headerGroups,K=Q.rows,$=Q.prepareRow;return Object(O.jsxs)("div",{className:D||"",children:[Object(O.jsx)(s.a,{className:"flex flex-1 striped",children:Object(O.jsxs)(l.a,Object(a.a)(Object(a.a)({},X()),{},{children:[Object(O.jsx)(d.a,{children:Z.map((function(e){return Object(O.jsx)(u.a,Object(a.a)(Object(a.a)({},e.getHeaderGroupProps()),{},{className:q.tableHead,children:e.headers.map((function(e){return Object(O.jsx)(o.a,Object(a.a)(Object(a.a)({},e.getHeaderProps()),{},{className:Object(j.a)(q.tableHeaderRow,(null===e||void 0===e?void 0:e.classHeader)||""),children:e.render("Header")}))}))}))}))}),Object(O.jsx)(r.a,{className:q.tableBody,children:K.length>0?K.map((function(e,t){return $(e),Object(O.jsxs)(p.a.Fragment,{children:[Object(O.jsx)(u.a,Object(a.a)(Object(a.a)({},e.getRowProps(z(e))),{},{className:Object(j.a)(q.tableRow,P||""),onClick:function(t){return h(t,e)},children:e.cells.map((function(n){var i;return Object(O.jsxs)(o.a,Object(a.a)(Object(a.a)({},n.getCellProps(W(e))),{},{className:Object(j.a)(q.tableBodyRow,(null===n||void 0===n||null===(i=n.column)||void 0===i?void 0:i.className)||""),children:[n.render("Cell"),M&&t===V&&n.column.id===G&&Object(O.jsx)("div",{className:"text-10 text-red-500 \n relative md:absolute max-w-160 text-left self-end \n lg:mr-0 mr-16 sm:mr-40 -mt-4 md:mt-0",children:"* ".concat(M)})]}),n.column.id)}))}))," "]},e.id)})):Object(O.jsx)(u.a,{children:Object(O.jsx)(o.a,{className:Object(j.a)(q.emptyRowsPlaceholder,"text-center"),colSpan:"100%",children:U(A)})})})]}))}),(w&&K.length>0||w&&0!==(null===w||void 0===w?void 0:w.totalPages)&&k>((null===w||void 0===w?void 0:w.totalPages)||0))&&Object(O.jsxs)("div",{className:Object(j.a)(q.pagination,"flex m-10 items-center"),children:[Object(O.jsxs)("span",{children:[Object(O.jsx)("span",{children:U("Page Size")}),Object(O.jsx)("select",{"aria-label":"rows per page",className:q.selectPageSize,value:I,onChange:function(e){return H(e)},children:F.map((function(e){return Object(O.jsxs)("option",{value:e,children:[e," ",U("rows")]},e)}))})]}),Object(O.jsxs)("span",{children:[Object(O.jsx)("span",{className:"ml-10",children:U("Page")}),Object(O.jsx)("input",{className:q.inputPage,"aria-label":"jump to page",type:"number",onChange:function(e){return C(e)},value:k,max:null===w||void 0===w?void 0:w.totalPages,min:1}),Object(O.jsxs)("span",{children:[" / ",null!==(t=null===w||void 0===w?void 0:w.totalPages)&&void 0!==t?t:0]})]}),Object(O.jsx)("span",{className:"w-64"}),Object(O.jsxs)("span",{className:"px-10",children:[U("Number of items"),": ",null!==(n=null===w||void 0===w?void 0:w.numberOfElements)&&void 0!==n?n:0]}),Object(O.jsxs)("span",{id:"total-of-items",className:"px-10",children:[U("Total of items"),": ",null!==(i=null===w||void 0===w?void 0:w.totalElements)&&void 0!==i?i:0]})," "]})]})}},1153:function(e,t,n){"use strict";var a=n(381),i=n(623),c=n(396),l=n(109),r=n(8),o=n(1140),s=n(313),d=n(46),u=n(2),b=Object(a.a)((function(e){return{root:{backgroundColor:e.palette.background.main,color:e.palette.text.main,"& .titleText":{fontFamily:"PlusJakartaSans-Bold !important"}}}}));t.a=function(e){var t=Object(s.a)().t,n=b();return Object(u.jsx)(u.Fragment,{children:Object(u.jsx)("div",{className:Object(r.a)(n.root,"flex items-center w-full"),children:Object(u.jsxs)("div",{className:"w-full mt-12",children:[e.linkBack&&Object(u.jsxs)(l.a,{className:"font-bold flex items-center sm:mb-12",component:d.a,role:"button",to:e.linkBack,color:"inherit",children:[Object(u.jsx)(c.a,{className:"mr-4 text-20",children:"arrow_back"}),t(e.titleBack)]}),e.title&&Object(u.jsx)("div",{className:"headline",children:Object(u.jsxs)("div",{className:"flex items-center",children:[e.icon&&Object(u.jsx)(c.a,{className:"text-24 sm:text-32 mr-12",children:e.icon}),Object(u.jsx)(o.a.span,{initial:{scale:.6},animate:{scale:1,transition:{delay:.2}},className:"text-24 sm:text-32 uppercase titleText",children:t(e.title)})]})}),Object(u.jsxs)("div",{className:"my-10",children:[e.button&&!e.buttonHidden&&Object(u.jsx)(i.a,{component:d.a,to:e.link,className:"whitespace-no-wrap mr-20 ",variant:"contained",color:"primary",children:Object(u.jsx)("span",{children:t(e.button)})}),e.refresh&&Object(u.jsx)(i.a,{id:"refresh",className:"ml-2 m-0",variant:"outlined",color:"primary",onClick:e.handleRefresh,children:Object(u.jsx)(c.a,{className:"",children:"refresh"})}),e.isClearFilter&&Object(u.jsxs)(i.a,{id:"clearFilters",className:"ml-2 m-0",variant:"outlined",color:"primary",onClick:function(){var e=window.location.search.includes("tenantType")?"tenantType=".concat(window.location.search.split("tenantType=")[1].split("&")[0]):"";window.location.search=e},children:[Object(u.jsx)(c.a,{children:"filter_alt"})," Clear"]})]})]})})})}},1154:function(e,t,n){"use strict";var a=n(3),i=n(1132),c=n(10),l=n(52),r=n(16),o=n(2);var s=function(e){var t=Object(r.c)(l.f),n=Object(r.c)(l.c),a=Object(r.c)((function(e){return e.auth.user.data})).role;return Object(o.jsx)("div",{className:e.classes.header,children:e.header&&Object(o.jsx)(i.a,{theme:a===c.kd.contractor_company.name?n:t,children:e.header})})},d=n(9),u=n(19),b=n(108),j=n(1144),m=n(1147),p=n(8),x=n(0),v=n.n(x),O=n(233),f=n(59);var h=function(e){var t=Object(f.a)(),n=Object(r.c)(Object(l.e)(t.palette.primary.main)),a=e.classes;return Object(o.jsxs)(o.Fragment,{children:[e.header&&Object(o.jsx)(i.a,{theme:n,
1children:Object(o.jsx)("div",{className:Object(p.a)(a.sidebarHeader,e.variant),children:e.header})}),e.content&&Object(o.jsx)(O.a,{className:a.sidebarContent,enable:e.innerScroll,children:e.content})]})};function g(e,t){var n=Object(x.useState)(!1),a=Object(u.a)(n,2),i=a[0],c=a[1],l=e.classes;Object(x.useImperativeHandle)(t,(function(){return{toggleSidebar:r}}));var r=function(){c(!i)};return Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)(j.a,{lgUp:"permanent"===e.variant,children:Object(o.jsx)(m.a,{variant:"temporary",anchor:e.position,open:i,onOpen:function(e){},onClose:function(e){return r()},disableSwipeToOpen:!0,classes:{root:Object(p.a)(l.sidebarWrapper,e.variant),paper:Object(p.a)(l.sidebar,e.variant,"left"===e.position?l.leftSidebar:l.rightSidebar)},ModalProps:{keepMounted:!0},container:e.rootRef.current,BackdropProps:{classes:{root:l.backdrop}},style:{position:"absolute"},children:Object(o.jsx)(h,Object(d.a)({},e))})}),"permanent"===e.variant&&Object(o.jsx)(j.a,{mdDown:!0,children:Object(o.jsx)(b.a,{variant:"permanent",className:Object(p.a)(l.sidebarWrapper,e.variant),open:i,classes:{paper:Object(p.a)(l.sidebar,e.variant,"left"===e.position?l.leftSidebar:l.rightSidebar)},children:Object(o.jsx)(h,Object(d.a)({},e))})})]})}var N=Object(x.forwardRef)(g),w=n(381),y=200,k=Object(w.a)((function(e){var t;return{"@global":{"#fuse-main":{height:function(e){return e.innerScroll&&"100vh"}}},root:{display:"flex",flexDirection:"row",minWidth:0,minHeight:"100%",position:"relative",flex:"1 1 auto",height:"auto",backgroundColor:e.palette.background.main},innerScroll:{height:"100%"},topBg:Object(a.a)({position:"absolute",left:0,right:0,top:0,height:y,pointerEvents:"none",backgroundSize:"200px auto !important",backgroundRepeat:"no-repeat !important",backgroundPosition:"bottom 60px right 10px !important",backgroundColor:"".concat(e.palette.background.main," !important")},e.breakpoints.down("md"),{backgroundImage:"none !important"}),contentWrapper:(t={display:"flex",flexDirection:"column",padding:"0 3.2rem",flex:"1 1 100%",zIndex:2,maxWidth:"100%",minWidth:0,minHeight:0},Object(a.a)(t,e.breakpoints.down("sm"),{padding:"0 1.6rem"}),Object(a.a)(t,e.breakpoints.down("xs"),{padding:"0 0.5rem"}),t),header:{height:136,minHeight:136,maxHeight:136,display:"flex",color:e.palette.primary.contrastText},headerSidebarToggleButton:{color:e.palette.primary.contrastText},contentCard:{display:"flex",flex:"1 1 100%",flexDirection:"column",paddingTop:"20px",backgroundColor:e.palette.background.dark,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",minHeight:0,borderRadius:"8px 8px 0 0"},toolbar:{display:"flex",minHeight:64,alignItems:"center",borderBottom:"1px solid ".concat(e.palette.utility.main)},content:{color:e.palette.text.main,flex:"1 1 auto",height:"100%",overflow:"auto","-webkit-overflow-scrolling":"touch"},sidebarWrapper:{position:"absolute",backgroundColor:"transparent",zIndex:5,overflow:"hidden","&.permanent":Object(a.a)({},e.breakpoints.up("lg"),{zIndex:1,position:"relative"})},sidebar:{position:"absolute","&.permanent":Object(a.a)({},e.breakpoints.up("lg"),{backgroundColor:"transparent",position:"relative",border:"none",overflow:"hidden"}),width:240,height:"100%"},leftSidebar:{},rightSidebar:{},sidebarHeader:{height:y,minHeight:y,color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark,"&.permanent":Object(a.a)({},e.breakpoints.up("lg"),{backgroundColor:"transparent"})},sidebarContent:Object(a.a)({display:"flex",flex:"1 1 auto",flexDirection:"column",backgroundColor:e.palette.background.default,color:e.palette.text.primary},e.breakpoints.up("lg"),{overflow:"auto","-webkit-overflow-scrolling":"touch"}),backdrop:{position:"absolute"}}})),C=v.a.forwardRef((function(e,t){var n=Object(x.useRef)(null),a=Object(x.useRef)(null),i=Object(x.useRef)(null),c=k(e),l=e.rightSidebarHeader||e.rightSidebarContent,r=e.leftSidebarHeader||e.leftSidebarContent;return v.a.useImperativeHandle(t,(function(){return{rootRef:i,toggleLeftSidebar:function(){n.current.toggleSidebar()},toggleRightSidebar:function(){a.current.toggleSidebar()}}})),Object(o.jsxs)("div",{className:Object(p.a)(c.root,e.innerScroll&&c.innerScroll),ref:i,children:[Object(o.jsx)("div",{className:c.topBg}
1),Object(o.jsxs)("div",{className:"flex container w-full",children:[r&&Object(o.jsx)(N,{position:"left",header:e.leftSidebarHeader,content:e.leftSidebarContent,variant:e.leftSidebarVariant||"permanent",innerScroll:e.innerScroll,classes:c,ref:n,rootRef:i}),Object(o.jsxs)("div",{className:Object(p.a)(c.contentWrapper,r&&(void 0===e.leftSidebarVariant||"permanent"===e.leftSidebarVariant)&&"lg:ltr:pl-0 lg:rtl:pr-0",l&&(void 0===e.rightSidebarVariant||"permanent"===e.rightSidebarVariant)&&"lg:pr-0"),children:[Object(o.jsx)(s,{header:e.header,classes:c}),Object(o.jsxs)("div",{className:Object(p.a)(c.contentCard,e.innerScroll&&"inner-scroll"),children:[e.contentToolbar&&Object(o.jsx)("div",{className:c.toolbar,children:e.contentToolbar}),e.content&&Object(o.jsx)(O.a,{className:c.content,enable:e.innerScroll,scrollToTopOnRouteChange:e.innerScroll,children:e.content})]})]}),l&&Object(o.jsx)(N,{position:"right",header:e.rightSidebarHeader,content:e.rightSidebarContent,variant:e.rightSidebarVariant||"permanent",innerScroll:e.innerScroll,classes:c,ref:a,rootRef:i})]})]})}));C.defaultProps={};t.a=v.a.memo(C)},1155:function(e,t,n){"use strict";var a=n(397),i=n(8),c=n(2);t.a=function(e){var t=e.columnName,n=e.content,l=e.hideColumnName,r=e.cellClass,o=Object(a.m)(e);return Object(c.jsxs)("div",{className:Object(i.a)(o.reactTableCell,l&&"flex justify-center",r),children:[!l&&Ob
1ject(c.jsx)("span",{className:"text-left pl-2",children:t}),n]})}},1163:function(e,t,n){"use strict";var a=n(3),i=n(381),c=n(1098),l=n(623),r=n(396),o=n(1127),s=n(1103),d=n(313),u=n(2),b=Object(i.a)((function(e){var t;return{root:{"& .title":Object(a.a)({fontFamily:"Inter-Bold, sans-serif",fontSize:"1.8rem"},e.breakpoints.down("md"),{fontSize:"1.4rem"}),"& .dialogContent":Object(a.a)({padding:"20px"},e.breakpoints.down("sm"),{padding:"12px"}),"& .dialog-toolbar":{display:"flex",alignItems:"center",height:"55px"},"& .button-back":Object(a.a)({paddingLeft:"10px",marginLeft:"10px"},e.breakpoints.down("md"),{paddingLeft:"5px",marginRight:0}),"& .button-right":Object(a.a)({minWidth:"70px"},e.breakpoints.down("md"),{margin:0,minWidth:0})},disabledFullHeight:Object(a.a)({height:"auto !important"},e.breakpoints.down("md"),{margin:0,width:"100%",maxHeight:"100%"}),paperFullWidth:Object(a.a)({height:"100%"},e.breakpoints.down("md"),{margin:0,width:"100%",maxHeight:"100%"}),paper:(t={},Object(a.a)(t,e.breakpoints.down("md"),{margin:"0 !important",width:"100% !important",height:"100% !important",maxHeight:"100% !important"}),Object(a.a)(t,e.breakpoints.up("lg"),{maxWidth:"1080px"}),t)}}));t.a=function(e){var t=Object(d.a)().t,n=b(),a=e.open,i=e.onClose,j=e.disabledBackButton,m=void 0!==j&&j,p=e.dialogId,x=e.dialogTitle,v=e.dialogContent,O=e.disabledFullHeight,f=void 0!==O&&O;return Object(u.jsxs)(c.a,{id:p,classes:{paperFullWidth:n.paperFullWidth,paper:f?n.disabledFullHeight:n.paper},className:n.root,fullWidth:!0,maxWidth:"md",open:a,onClose:i,children:[Object(u.jsx)("div",{className:"dialog-appBar bg-white",children:Object(u.jsxs)("div",{className:"dialog-toolbar",children:[Object(u.jsxs)(l.a,{id:"dialog_back",variant:"outlined",color:"primary",className:"button-back",onClick:i,disabled:m,children:[Object(u.jsx)(r.a,{className:"",fontSize:"medium",children:"arrow_back"}),Object(u.jsx)("span",{className:"py-2",children:t("Back")})]}),Object(u.jsx)("div",{className:"title ml-2 flex-1 text-center text-black",children:t(x)}),Object(u.jsx)("div",{className:"button-right"})]})}),Object(u.jsx)(o.a,{}),Object(u.jsx)(s.a,{className:"dialogContent",children:v})]})}},1169:function(e,t,n){"use strict";var a=n(0),i=n(44);t.a=Object(i.a)(a.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete")},1171:function(e,t,n){"use strict";var a=n(1098),i=n(1111),c=n(1133),l=n(395),r=n(109),o=n(623),s=n(1127),d=n(381),u=n(1184),b=n(1185),j=n(8),m=n(313),p=n(2),x=Object(d.a)((function(e){return{header:{backgroundColor:e.palette.background.primary,color:e.palette.secondary.contrastText},dialog:{height:"100vh"}}}));t.a=function(e){var t=Object(m.a)().t,n=x(),d=e.preview,v=e.handleClose,O=e.fileLink,f=e.fileName,h=e.showDownload,g=void 0===h||h,N=e.showCloseButton,w=void 0!==N&&N;return Object(p.jsxs)(a.a,{fullWidth:!0,maxWidth:"xl",open:d,onClose:v,children:[Object(p.jsx)(i.a,{className:"relative",children:Object(p.jsxs)(c.a,{className:Object(j.a)(n.header,"flex justify-between"),children:[Object(p.jsx)(l.a,{className:"mr-16",color:"action",onClick:v,children:Object(p.jsx)(u.a,{color:"action"})}),Object(p.jsx)(r.a,{variant:"h6",className:"hidden sm:flex ml-2 flex-1",children:t("Preview")}),O&&g&&Object(p.jsx)(o.a,{role:"button",color:"primary",variant:"contained",href:O||"",download:f||"",endIcon:Object(p.jsx)(b.a,{}),children:t("Download")}),w&&Object(p.jsx)(o.a,{color:"inherit",variant:"outlined",onClick:v,children:t("Close")})]})}),Object(p.jsx)(s.a,{}),O?Object(p.jsx)("object",{type:"application/pdf",className:n.dialog,width:"100%",data:O,children:Object(p.jsxs)("div",{className:"p-10",children:[Object(p.jsx)("p",{children:t("Unfortunately, your device's operating system or web browser does not support previewing this file.")}),Object(p.jsx)(o.a,{color:"inherit",variant:"outlined",children:Object(p.jsx)("a",{href:O,download:f||"",children:t("Click here to Download.")})})]})}):Object(p.jsx)("div",{className:"p-10",children:t("Loading")})]})}},1178:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(2);function i(e){return Object(a.jsx)("span",{className:"hidden md:block",children:e.children})}},1179:function(e,t,n){"use strict";var a=n(8),i=n(313),c=n(2);t.a=function(e){var t=e.id,n=e.name,l=e.value,r=e.flexCol,o=void 0!==r&&r,s=e.cssDiv,d=void 0===s?"":s,u=e.cssName,b=void 0===u?"":u,j=e.cssValue,m=void 0===j?"":j,p=Object(i.a)().t,x=Object(c.jsx)("i",{children:p("(Not Found)")});return Object(c.jsxs)("div",{id:t||n,className:Object(a.a)("my-4 flex justify-between",o?"flex-col sm:min-w-128":"flex-row",d),children:[Object(c.jsx)("p",{className:Object(a.a)("truncate",o?"text-center":"mx-10",b),children:Object(c.jsx)("b",{children:p(n)})}),Object(c.jsx)("p",{className:Object(a.a)("truncate",o?"text-center":"",m),children:null!==l&&void 0!==l?l:x})]})}},1439:function(e,t,n){"use strict";n.r(t);var a=n(19),i=n(3),c=n(25),l=n(381),r=n(623),o=n(396),s=n(1154),d=n(21),u=n(1153),b=n(1179),j=n(234),m=n(238),p=n(406),x=n(26),v=n(143),O=n(8),f=n(65),h=n.n(f),g=n(0),N=n.n(g),w=n(313),y=n(16),k=n(42),C=n(10),S=n(397),I=n(1171),R=n(120),F=n(4),H=n(1),T=n.n(H),A=n(15),D=n(395),P=n(1152),E=n(1109),z=n(310),B=n(1140),W=n(1098),L=n(1111),M=n(1133),_=n(109),V=n(1127),Y=n(1423),G=n(2),U=function(e){var t=Object(w.a)().t,n=Object(S.m)(e),i=e.preview,c=e.handleClose,l=e.file,s=e.showDownload,u=void 0===s||s,b=e.showCloseButton,j=void 0!==b&&b,m=e.fileName,p=Object(g.useState)(null),x=Object(a.a)(p,2),v=x[0],O
1=x[1];Object(g.useEffect)((function(){if(l){var e=new XMLHttpRequest;e.responseType="blob",e.onload=function(){var t=e.response,n=new FileReader;n.onload=function(){var e=n.result;Object(Y.a)(new File([e],"".concat(m),{type:t.type})).then((function(e){O(Object(d.pb)(e))}))},n.readAsArrayBuffer(t)},e.open("GET",l),e.send()}}),[l,m]);var f=null!==v&&void 0!==v&&v.length?Object.keys(v[0]):[];return Object(G.jsxs)(W.a,{fullWidth:!0,maxWidth:"xl",open:i,onClose:c,children:[Object(G.jsx)(L.a,{className:"relative",children:Object(G.jsxs)(M.a,{className:"flex justify-between",children:[Object(G.jsx)(o.a,{className:"mr-16",color:"action",onClick:c,children:"close"}),Object(G.jsx)(_.a,{variant:"h6",className:"hidden sm:flex ml-2 flex-1",children:t("Preview")}),l&&u&&Object(G.jsx)(r.a,{color:"inherit",variant:"outlined",children:Object(G.jsx)("a",{className:n.downloadLink,href:l,download:m||"",children:t("Download")})}),j&&Object(G.jsx)(r.a,{color:"inherit",variant:"outlined",onClick:c,children:t("Close")})]})}),v&&Object(G.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[Object(G.jsx)("thead",{className:"bg-gray-50",children:Object(G.jsx)("tr",{children:f.map((function(e){return Object(G.jsx)("th",{className:"px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase",children:e},e)}))})}),Object(G.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:v.map((function(e,t){return Object(G.jsx)("tr",{className:t%2===0?"bg-gray-50":"bg-white",children:f.map((function(n){return Object(G.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:(e[n]||"").toString().slice(0,40)},"".concat(t,"-").concat(n))}))},t)}))})]}),Object(G.jsx)(V.a,{})]})},q=n(1155),J=n(1178),Q=n(398),X=n(410);var Z=function(e){var t,n,i=Object(w.a)().t,c=Object(y.b)(),l=Object(k.useParams)().expenseId,s=e.expense,u=e.invoice,b=Object(y.c)((function(e){return e.i18n.language})),j=Object(y.c)((function(e){return e.oneFreeApp.utils.unitCodeActive})),p=Object(y.c)((function(e){return e.oneFreeApp.expenses})),x=p.expenseTypes,v=p.expenseSubTypes,O=Object(y.c)((function(e){return e.oneFreeApp.expenses.previewFileId})),f=Object(y.c)((function(e){return e.oneFreeApp.expenses.previewDriversNoteFile})),S=Object(y.c)((function(e){return e.auth.user})).role,R=(Object(Q.a)(),Object(g.useState)(!1)),H=Object(a.a)(R,2),W=H[0],L=H[1],M=Object(g.useState)(!1),_=Object(a.a)(M,2),V=_[0],Y=_[1],Z=Object(g.useState)(""),K=Object(a.a)(Z,2),$=K[0],ee=K[1],te=N.a.useMemo((function(){return(null===s||void 0===s?void 0:s.files)||[]}),[null===s||void 0===s?void 0:s.files]);Object(g.useEffect)((function(){j||c(Object(X.c)())}),[c,j]),Object(g.useEffect)((function(){x||c(Object(m.p)())}),[c,x]),Object(g.useEffect)((function(){v||c(Object(m.o)())}),[c,v]);var ne=null===s||void 0===s?void 0:s.expenseItems,ae=N.a.useMemo((function(){return ne||[]}),[ne]),ie=(null===ae||void 0===ae||null===(t=ae.filter((function(e){return null===e||void 0===e?void 0:e.activeExpenseItemFile})))||void 0===t?void 0:t.length)>0,ce=null===s||void 0===s?void 0:s.files.some((function(e){return"DRIVER_NOTE"===e.fileType})),le=null===ae||void 0===ae?void 0:ae.some((function(e){return!(null!==e&&void 0!==e&&e.invoiceItemId)})),re=Array.isArray(x)&&(null===(n=x.find((function(e){return e.name===C.T.RECEIPTS.name})))||void 0===n?void 0:n.id),oe=Object(g.useCallback)(function(){var e=Object(F.a)(T.a.mark((function e(t){return T.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c(Object(m.g)({expense:s,expenseItemId:ne[t].id})).unwrap();case 2:c(Object(m.k)(l));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c,s,l,ne]),se=(null===s||void 0===s?void 0:s.status)===C.P.DRAFT.value&&(null===u||void 0===u?void 0:u.status)===C.Fb.DRAFT.value&&Object(d.bb)(S)&&le,de=N.a.useMemo((function(){return[{Header:function(){return Object(G.jsx)(J.a,{children:i("Date")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"lineDate",Cell:function(e){return Object(G.jsx)(q.a,{columnName:i("Date"),content:Object(G.jsx)("span",{children:e.value?h()(e.value).format("DD.MM.YYYY"):i("(not set)")})})}},{Header:function(){return Object(G.jsx)(J.a,{children:i("Category")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"expenseTypeId",Cell:function(e){var t,n;return Object(G.jsx)(q.a,{columnName:i("Category"),content:Object(G.jsx)("span",{children:x&&e.value?null===(t=x.find((function(t){return t.id===e.value})))||void 0===t||null===(n=t.lovLangs.find((function(e){return e.lang===b}
1)))||void 0===n?void 0:n.label:i("(not set)")})})}},{Header:function(){return Object(G.jsx)(J.a,{children:i("Type")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"expenseSubTypeId",Cell:function(e){var t,n;return Object(G.jsx)(q.a,{columnName:i("Category"),content:Object(G.jsx)("span",{children:v&&e.value?null===(t=v.find((function(t){return t.id===e.value})))||void 0===t||null===(n=t.lovLangs.find((function(e){return e.lang===b})))||void 0===n?void 0:n.label:i("(not set)")})})}},{Header:function(){return Object(G.jsx)(J.a,{children:i("Description")})},classHeader:"text-12",className:"p-2 sm:p-8 text-right md:max-w-216 md:text-center",accessor:function(e){var t=e.lineDescription,n=e.expenseItemExtn;return null!==n&&void 0!==n&&n.expenseDetails&&Object.values(n.expenseDetails).length>0&&(null===e||void 0===e?void 0:e.expenseTypeId)!==re?n:t},id:"description",Cell:function(e){var t=e.value,n=t.expenseDetails,c=Object(g.useState)(!1),l=Object(a.a)(c,2),r=l[0],s=l[1],u=Object(g.useState)(20),b=Object(a.a)(u,2),j=b[0],m=b[1],p=Object(g.useRef)(null);Object(g.useEffect)((function(){var e;m(null===(e=p.current)||void 0===e?void 0:e.offsetHeight)}),[]);var x={notFull:{maxHeight:j,overflow:"hidden",transition:{duration:.3}},full:{maxHeight:180,overflowY:"auto",transition:{duration:.3}}};return Object(G.jsx)(q.a,{columnName:i("Description"),content:null!=n&&Object.values(n).length>0?Object(G.jsx)(B.a.ul,{variants:x,initial:"notFull",animate:r?"full":"notFull",className:"leading-relaxed",children:Object.entries(Object(d.Eb)(n)).filter((function(e){var t=Object(a.a)(e,2),n=t[0];t[1];return"travelExpenseType"!==n})).map((function(e,t){var n=Object(a.a)(e,2),c=n[0],l=n[1];Object(E.a)(l)&&(l=Object(z.a)(l,"dd.MM.yyyy HH:mm"));var d=C.M[c]?C.M[c]:A.a.startCase(c);return Object(G.jsxs)("li",{ref:0===t?p:null,children:[Object(G.jsx)("span",{className:"font-bold",children:"".concat(i(d),":")})," ",l,0===t&&Object(G.jsx)(D.a,{className:"h-2 w-2 ml-7",onClick:function(){return s((function(e){return!e}))},children:Object(G.jsx)(o.a,{children:r?"expand_less":"expand_more"})})]},c)}))}):t})}},{Header:function(){return Object(G.jsx)(J.a,{children:i("Quantity")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"qty",Cell:function(e){var t;return Object(G.jsx)(q.a,{columnName:i("Quantity"),content:Object(G.jsx)("span",{children:null!==(t=e.value)&&void 0!==t?t:i("(not set)")})})}},{Header:function(){return Object(G.jsx)(J.a,{children:i("Unit")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"unitCodeLovId",Cell:function(e){return Object(G.jsx)(q.a,{columnName:i("Unit"),content:Object(G.jsx)("span",{children:Array.isArray(j)&&Object(d.O)(b,e.value,j)})})}},{Header:function(){return Object(G.jsx)(J.a,{children:i("Tax Percent")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"taxPercent",Cell:function(e){var t;return Object(G.jsx)(q.a,{columnName:i("Tax Percent"),content:Object(G.jsx)("span",{children:null!==(t=Object(d.qb)(e.value))&&void 0!==t?t:i("(not set)")})})}},{Header:function(){return Object(G.jsx)(J.a,{children:i("Line Without Tax Amount")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"lineWithoutTaxAmt",Cell:function(e){return Object(G.jsx)(q.a,{columnName:i("Line Without Tax Amount"),content:Object(G.jsx)("span",{children:e.value?Object(d.s)(e.value):i("(not set)")})})}},{Header:function(){return Object(G.jsx)(J.a,{children:i("Line Total Amount")})},classHeader:"text-12",className:"p-2 sm:p-8",accessor:"lineTotalAmt",Cell:function(e){return Object(G.jsx)(q.a,{columnName:i("Total Amount"),content:Object(G.jsx)("span",{children:e.value?Object(d.s)(e.value):i("(not set)")})})}},{Header:function(){return Object(G.jsx)(J.a,{children:i("File")})},classHeader:!ie&&"hidden",className:!ie&&"hidden",id:"activeExpenseItemFile",accessor:"activeExpenseItemFile",Cell:function(e){var t,n,a;return(null===e||void 0===e?void 0:e.value)&&Object(G.jsx)(q.a,{columnName:i("Preview File"),content:null!==(t=e.value)&&void 0!==t&&t.fileUrl?Object(G.jsxs)("a",{className:"no-underline flex justify-center items-center",target:"_blank",rel:"noopener noreferrer",href:e.value.fileUrl,children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"pageview"}),i("Preview")]}):(null===(n=e.value)||void 0===n?void 0:n.fileName)&&Object(G.jsxs)(r.a,{id:"previewFile-".concat(null===(a=e.value)||void 0===a?void 0:a.id),variant:"outlined",color:"default",className:"p-0 text-xs",onClick:function(){var t;L(!0),c(Object(m.n)({expenseItemFileId:null===(t=e.value)||void 0===t?void 0:t.id}))},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"pageview"}),i("Preview")]})})}},{Header:function(){return Object(G.jsx)(J.a,{children:i("Driversnote File")})},classHeader:!ce&&"hidden",className:!ce&&"hidden",id:"driversNoteFile",accessor:function(e){var t,n;return null===e||void 0===e||null===(t=e.expenseItemExtn)||void 0===t||null===(n=t.expenseDetails)||void 0===n?void 0:n.fileName},Cell:function(e){var t,n=function(e,t){var n=e.find((function(e){return e.fileName===t}));return n?n.id:null}(te,null===e||void 0===e?void 0:e.value);return Object(G.jsx)(q.a,{columnName:i("Preview File"),content:n&&(null===e||void 0===e?void 0:e.value)&&Object(G.jsxs)(r.a,{id:"previewFile-".concat(null===(t=e.value)||void 0===t?void 0:t.id),variant:"outlined",color:"default",className:"p-0 text-xs",onClick:function(){Y(!0),ee(e.value),c(Object(m.j)({expenseFileId:n,expenseId:null===s||void 0===s?void 0:s.id}))},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"pageview"}),i("Preview")]})})}},{Header:function(){return Object(G.jsx)(J.a,{})},classHeader:se?"text-12":"hidden",className:se?"p-2 sm:p-8":"hidden",accessor:"delete",Cell:function(e){var t,n=e.row.index;return!!(null===(t=ne[n])||void 0===t||!t.invoiceItemId)&&Object(G.jsx)(q.a,{content:Object(G.jsx)(D.a,{disableRipple:!0,className:"flex items-center",color:"inherit",onClick:function(){return oe(n)},children:Object(G.jsx)(o.a,{color:"action",children:"clear"})})})}}]}),[ie,ce,i,x,b,v,re,j,c,te,null===s||void 0===s?void 0:s.id,oe,se,ne]);return Object(G.jsxs)(G.Fragment,{children:[Object(G.jsx)(P.a,{columns:de,data:ae}),W&&Object(G.jsx)(I.a,{preview:W,handleClose:function(){c(Object(m.b)()),L(!1)},fileLink:O}),V&&Object(G.jsx)(U,{preview:V,handleClose:function(){c(Object(m.a)()),Y
1(!1)},file:f,fileName:$||"",showCloseButton:!0})]})},K=n(1051),$=n(1163),ee=n(95);var te=function(e){var t=Object(w.a)().t,n=Object(y.b)(),i=e.openRejectionReason,c=e.setOpenRejectionReason,l=e.expenseId,o=e.expense,s=Object(y.c)((function(e){return e.auth.user})).role,u=Object(y.c)((function(e){return e.oneFreeApp.userProfile})).userProfile,j=Object(g.useState)(""),p=Object(a.a)(j,2),v=p[0],f=p[1];return Object(g.useEffect)((function(){o&&i&&n(Object(ee.w)(null===o||void 0===o?void 0:o.claimerId))}),[n,o,i]),Object(G.jsx)(G.Fragment,{children:Object(d.bb)(s)&&Object(G.jsx)($.a,{open:i,onClose:function(){c(!1)},dialogId:"expenseRejectionReason",disabledFullHeight:!0,dialogTitle:"Expense Rejection Reason",dialogContent:Object(G.jsxs)("div",{className:"mb-20",children:[u&&Object(G.jsxs)("div",{children:[Object(G.jsx)(b.a,{name:"User Id",value:u.id,cssDiv:"sm:justify-start",cssName:"sm:min-w-200"}),Object(G.jsx)(b.a,{name:"User Default Lang",value:u.defaultLang,cssDiv:"sm:justify-start",cssName:"sm:min-w-200"}),Object(G.jsx)("div",{className:"m-10",children:"".concat(t("Add Rejection reason")," ").concat("fi"===u.defaultLang?t("in Finnish"):t("in English"))})]}),Object(G.jsx)(K.a,{className:"w-full my-20",type:"text",required:!0,label:t("Reason for rejection?"),id:"RejectionReason",value:v,onChange:function(e){f(e.target.value)},InputLabelProps:{shrink:!0}}),Object(G.jsxs)("div",{className:S.j,children:[Object(G.jsx)(r.a,{type:"submit",className:Object(O.a)(S.a,"sm:mr-10"),id:"rejectExpense",variant:"contained",color:"primary",disabled:!v,onClick:function(){Object(d.m)((function(){n(Object(m.z)({expenseId:l,rejectionReason:v})),n(Object(x.a)()),c(!1)}),"Are you sure to reject this expense?",n)},children:t("Save")}),Object(G.jsx)(r.a,{className:S.a,id:"cancel",variant:"contained",color:"primary",onClick:function(){c(!1)},children:t("Cancel")})]})]})})})},ne=n(159),ae=n(1151);var ie=function(e){var t,n=Object(w.a)().t,a=e.expense,i=e.handleAction,c=Object(y.c)((function(e){return e.auth.user})).role,l=Object(Q.a)();return Object(d.hb)(c)?Object(G.jsx)("div",{className:S.q,children:Object(G.jsx)("div",{className:"mx-12 sm:mr-32 my-5 sm:my-0 flex",children:Object(G.jsx)(ae.a,{backgroundColor:Object(ne.e)(null===a||void 0===a?void 0:a.status),label:null===a||void 0===a?void 0:a.status})})}):Object(G.jsxs)("div",{className:S.q,children:[Object(G.jsxs)("div",{className:"mx-12 sm:mr-32 my-5 sm:my-0 flex",children:[Object(d.bb)(c)&&Object(G.jsx)(ae.a,{backgroundColor:Object(ne.e)(null===a||void 0===a?void 0:a.status),label:null===a||void 0===a?void 0:a.status}),!Object(d.bb)(c)&&Object(G.jsx)("div",{className:"ml-12",children:(null===a||void 0===a?void 0:a.status)===C.P.DRAFT.value&&(null===a||void 0===a?void 0:a.subStatus)===C.R.INVOICE_PENDING.value?Object(G.jsx)(ae.a,{backgroundColor:Object(ne.e)("IN_PROCESS"),label:"In Process"}):Object(G.jsx)(ae.a,{backgroundColor:Object(ne.e)(null===a||void 0===a?void 0:a.status),label:null===a||void 0===a?void 0:a.status})}),Object(d.bb)(c)&&(null===a||void 0===a||null===(t=a.invoice)||void 0===t?void 0:t.parentId)&&Object(G.jsx)("div",{className:"ml-12",children:Object(G.jsx)(ae.a,{backgroundColor:Object(ne.e)("GRUPI_INVOICE"),label:"Grupi Invoice"})})]}),Object(d.bb)(c)&&(null===a||void 0===a?void 0:a.subStatus)&&Object(G.jsx)("div",{className:"sm:mr-32 my-5 sm:my-0",children:Object(G.jsx)(ae.a,{backgroundColor:Object(ne.e)(null===a||void 0===a?void 0:a.subStatus),label:null===a||void 0===a?void 0:a.subStatus})}),(null===a||void 0===a?void 0:a.status)===C.P.DRAFT.value&&Object(G.jsxs)(G.Fragment,{children:[Object(G.jsxs)(r.a,{id:"edit_expense",variant:"contained",color:"secondary",className:S.p,onClick:function(){return i({action:"edit"})},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"edit"}),Object(G.jsx)("span",{children:n("Edit")})]}),(!Object(d.fb)(l)||Object(d.bb)(c))&&!(null!==a&&void 0!==a&&a.invoice)&&Object(G.jsxs)(r.a,{id:"send",variant:"contained",color:"primary",className:S.p,onClick:function(){return i({action:"send"})},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"send"}
1),Object(G.jsx)("span",{children:n("Submit")})]})]}),(null===a||void 0===a?void 0:a.status)===C.P.PENDING.value&&Object(d.bb)(c)&&Object(G.jsx)(G.Fragment,{children:!(null!==a&&void 0!==a&&a.invoice)&&Object(G.jsxs)(G.Fragment,{children:[Object(G.jsxs)(r.a,{id:"verify",variant:"contained",color:"primary",className:S.p,onClick:function(){return i({action:"verify"})},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"done"}),Object(G.jsx)("span",{children:n("Verify")})]}),Object(G.jsxs)(r.a,{id:"reject",variant:"contained",color:"default",className:S.p,onClick:function(){return i({action:"reject"})},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"clear"}),Object(G.jsx)("span",{children:n("Reject")})]}),Object(G.jsxs)(r.a,{id:"draft",variant:"contained",color:"secondary",className:S.p,onClick:function(){return i({action:"draft"})},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"edit"}),Object(G.jsx)("span",{children:n("Draft")})]})]})}),!Object(d.fb)(l)&&!(null!==a&&void 0!==a&&a.invoice)&&((null===a||void 0===a?void 0:a.status)===C.P.DRAFT.value||(null===a||void 0===a?void 0:a.status)===C.P.PENDING.value)&&Object(G.jsxs)(r.a,{id:"cancel",variant:"contained",color:"default",className:Object(O.a)(S.p,"sm:ml-auto"),onClick:function(){return i({action:"cancel"})},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"cancel"}),Object(G.jsx)("span",{children:n("Cancel")})]}),Object(d.bb)(c)&&(null===a||void 0===a?void 0:a.invoice)&&((null===a||void 0===a?void 0:a.status)===C.P.DRAFT.value||(null===a||void 0===a?void 0:a.status)===C.P.PENDING.value)&&Object(G.jsxs)(r.a,{id:"cancel",variant:"contained",color:"default",className:Object(O.a)(S.p,"sm:ml-auto"),onClick:function(){return i({action:"cancel"})},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"cancel"}),Object(G.jsx)("span",{children:n("Cancel")})]})]})},ce=Object(l.a)((function(e){return{expense:Object(i.a)({display:"flex",flexDirection:"row"},e.breakpoints.down("sm"),{flexDirection:"column"}),title:{color:"#0065a5",fontSize:18,fontWeight:"bold",marginBottom:4}}}));t.default=Object(v.a)("oneFreeApp",j.a)((function(e){var t,n,i,l=Object(w.a)().t,j=Object(y.b)(),v=ce(e),f=Object(S.m)(e),N=Object(k.useParams)().expenseId,F=Object(y.c)((function(e){return e.auth.user})).role,H=Object(y.c)((function(e){return e.oneFreeApp.subscription})).userSubscription,T=Object(y.c)((function(e){return e.auth.user.data})).id,A=Object(y.c)((function(e){return e.oneFreeApp.setup})).setupFlow,D=Object(y.c)((function(e){return e.oneFreeApp.expenses.expense})),P=Object(y.c)((function(e){return e.oneFreeApp.expenses.previewFileId})),E=Object(g.useState)(!1),z=Object(a.a)(E,2),B=z[0],W=z[1],L=Object(g.useState)(!1),M=Object(a.a)(L,2),_=M[0],V=M[1],Y=l("(not set)"),U=null===D||void 0===D?void 0:D.invoice;return Object(g.useEffect)((function(){Object(d.bb)(F)||!T||A||j(Object(R.i)(T))}),[j,T,A,F]),Object(g.useEffect)((function(){return j(Object(m.k)(N)),function(){j(Object(m.D)())}}),[j,N]),Object(G.jsx)(s.a,{classes:S.n,header:Object(G.jsx)(u.a,{icon:"email",title:l("Expense {{number}}",{number:N}),titleBack:"Expenses",linkBack:Object(d.bb)(F)||Object(d.hb)(F)?"/expenses/all-employee":"/expenses"}),contentToolbar:Object(G.jsx)(ie,{expense:D,handleAction:function(e){var t;switch(e.action){case"edit":if(U&&(null===U||void 0===U?void 0:U.status)!==C.Fb.DRAFT.value)return void Object(d.X)(j,l);Object(d.fb)(H)?j(Object(p.h)({page:0,size:1,invoiceId:null===D||void 0===D?void 0:D.invoiceId,isAdvance:!0})).unwrap().then((function(e){Array.isArray(null===e||void 0===e?void 0:e.content)&&e.content.length>0?Object(d.T)({t:l,dispatch:j,title:"Message",HTMLMessage:function(){return Object(G.jsx)("div",{children:l("Due to advance salary process, editing of expenses is not possible anymore.")})},okText:null,cancelText:"ok"}):c.a.push("/expenses/".concat(N,"/edit"))})):c.a.push("/expenses/".concat(N,"/edit"));break;case"send":Object(d.bb)(F)||null!==A&&void 0!==A&&null!==(t=A.aspaStatuses)&&void 0!==t&&t.isSetupComplete?Object(d.R)(l,j,(function(){j(Object(m.E)(N)),j(Object(x.a)())}),"Are you sure to submit this expense?"):Object(d.T)({t:l,dispatch:j,title:"",HTMLMessage:function(){return Object(d.W)(l,j,"expense")},okText:null,cancelText:"ok"});break;case"verify":Object(d.m)((function(){j(Object(m.v)(N)),j(Object(x.a)())}),"Are you sure to verify this expense?",j);break;case"paid":Object(d.m)((function(){j(Object(m.y)(N)),j(Object(x.a)())}),"Are you sure to paid this expense?",j);break;case"mark-auto-payment":Object(d.R)(l,j,(function(){j(Object(m.A)(N)),j(Object(x.a)())}),"Are you sure to mark auto payment?");break;case"mark-as-paid":Object(d.R)(l,j,(function(){j(Object(m.y)(N)),j(Object(x.a)())}),"Are you sure to mark as paid?");break;case"reject":V(!0);break;case"cancel":Object(d.R)(l,j,(function(){j(Object(m.w)(N)),j(Object(x.a)())}),"Are you sure to cancel this expense?");break;case"draft":Object(d.R)(l,j,(function(){j(Object(m.x)(N)),j(Object(x.a)())}),l("Are you sure to mark this expense as draft?"))}}}),content:void 0===D?Object(G.jsx)("div",{className:"p-16 sm:p-24 w-full",children:l("Loading")}):null===D?Object(G.jsx)("div",{className:"p-16 sm:p-24 w-full",children:l("Not found")}):Object(G.jsxs)("div",{className:"p-16 sm:p-24 w-full",children:[Object(G.jsx)("div",{className:Object(O.a)(v.title,"mt-5"),children:l("Expense Detail")}),Object(G.jsxs)("div",{className:"my-12 flex flex-col sm:flex-row",children:[Object(G.jsxs)("div",{className:"font-bold mr-5",children:[l("Description"),":"]}),Object(G.jsx)("div",{children:null!==(t=null===D||void 0===D?void 0:D.description)&&void 0!==t?t:Y})]}),(null===D||void 0===D?void 0:D.rejectionReason)&&Object(G.jsxs)("div",{className:"my-12 flex flex-col sm:flex-row",children:[Object(G.jsxs)("div",{className:"font-bold mr-5",children:[l("Reason for rejection"),":"]}),Object(G.jsx)("div",{children:D.rejectionReason})]}),Object(G.jsxs)("div",{className:Object(O.a)(v.expense,"justify-between"),children:[Object(G.jsx)(b.a,{name:l("Date"),value:null!==(n=h()(null===D||void 0===D?void 0:D.expenseDate).format("DD.MM.YYYY"))&&void 0!==n?n:Y,flexCol:!0}),Object(G.jsx)(b.a,{name:l("Reference No."),value:null!==(i=null===D||void 0===D?void 0:D.expenseReference)&&void 0!==i?i:Y,flexCol:!0}),Object(G.jsx)(b.a,{id:"expense_total_amount",name:l("Expense Total Amount"),value:null!==D&&void 0!==D&&D.totalAmt?Object(d.s)(null===D||void 0===D?void 0:D.totalAmt):l("(not set)"),flexCol:!0}),Array.isArray(null===D||void 0===D?void 0:D.files)&&(null===D||void 0===D?void 0:D.files.length)>0&&!Object(d.Y)(D)&&Object(G.jsx)(b.a,{name:l("Receipt File"),value:Object(G.jsxs)(G.Fragment,{children:[Object(G.jsxs)(r.a,{id:"previewFile",variant:"outlined",color:"default",className:Object(O.a)(f.buttonLink,"m-0 p-0"),onClick:function(){return e=null===D||void 0===D?void 0:D.id,W(!0),void j(Object(m.l)({expenseId:e}));var e},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"pageview"}),l("Preview")]}),B&&Object(G.jsx)(I.a,{preview:B,handleClose:function(){W(!1),j(Object(m.b)())},fileLink:P})]}),flexCol:!0})]}),Object(G.jsx)("div",{className:Object(O.a)(v.expense,"justify-between"),children:U&&Object(G.jsxs)(G.Fragment,{children:[Object(G.jsx)(b.a,{name:l("Invoice Status"),value:l(null===U||void 0===U?void 0:U.status),flexCol:!0}),Object(G.jsx)(b.a,{name:l("Invoice Number"),value:Object(G.jsxs)(r.a,{id:"previewInvoice",variant:"text",color:"default",className:"p-0",onClick:function(){return c.a.push("/invoices/".concat(null===U||void 0===U?void 0:U.id))},children:[Object(G.jsx)(o.a,{className:"mr-6",fontSize:"small",children:"pageview"}),null===U||void 0===U?void 0:U.invoiceNumber]}),flexCol:!0}),Object(G.jsx)(b.a,{id:"invoice_sub_total_amount",name:l("Invoice Sub Total Amount"),value:null!==U&&void 0!==U&&U.subTotalAmt?Object(d.s)(null===U||void 0===U?void 0:U.subTotalAmt):l("(not set)"),flexCol:!0}),Object(d.bb)(F)&&Object(G.jsx)(b.a,{name:l("Invoice Biller Amount"),value:null!==U&&void 0!==U&&U.billerAmount?Object(d.s)(null===U||void 0===U?void 0:U.billerAmount):l("(not set)"),flexCol:!0})]})}),Object(G.jsx)("div",{className:Object(O.a)(v.title,"mt-20"),children:l("Expense Items")}),Object(G.jsx)(Z,{expense:D,invoice:U}),Object(G.jsx)(te,{expenseId:N,expense:D,openRejectionReason:_,setOpenRejectionReason:V})]})})}))}}]);
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.