(()=>{(self.webpackChunkics_operations=self.webpackChunkics_operations||[]).push([[179],{1843:(C,m,e)=>{"use strict";e.d(m,{Z:()=>p});var t=e(5881),r=e.n(t),a=e(2354),d=e.n(a),c=d()(r());c.push([C.id,"",""]),c.locals={"brand-primary-navy":"#182d55","brand-primary-teal":"#6ec6aa","brand-secondary-buttercup":"#f2a71e","brand-secondary-cornflowerblue":"#3e8ccc","brand-secondary-seagull":"#85d3ea","brand-secondary-apple":"#7dc242","brand-secondary-tropicalrainforest":"#007d59","brand-neutral-athensgray":"#eff0f3","brand-neutral-westar":"#e3e1dd","brand-neutral-iceberg":"#daf0f4","grayscale-white":"#fff","grayscale-gray200":"#f8f8f8","grayscale-gray300":"#e4e4e4","grayscale-gray400":"#cecece","grayscale-gray600":"#adadad","grayscale-gray700":"#6c6c6c","grayscale-gray800":"#333","grayscale-black":"#000","status-positive-main":"#319b51","status-positive-light":"#50fd84","status-positive-dark":"#277c41","status-positive-darker":"#1c5934","status-negative-main":"#df5d5f","status-negative-light":"#ef5350","status-negative-dark":"#d1292c","status-negative-darker":"#991e20","status-information-main":"#3e8ccc","status-information-light":"#1294ff","status-information-dark":"#2d71a9","status-information-darker":"#21547d","status-warning-main":"#f2a71e","status-warning-light":"#f7a50f","status-warning-dark":"#bc7e0b","status-warning-darker":"#6b4705"};const p=c},400:(C,m,e)=>{"use strict";e.d(m,{Z:()=>p});var t=e(5881),r=e.n(t),a=e(2354),d=e.n(a),c=d()(r());c.push([C.id,"",""]),c.locals={fontFamily:"Tahoma,Calibri,Arial"};const p=c},3755:(C,m,e)=>{"use strict";e.d(m,{s:()=>p});var t=e(4119),r=e(3452),a=e(1732);const d=A=>async I=>{try{const{accessToken:v}=await r.U.acquireTokenSilent({scopes:[A]});if(!v){const S=new Error("Empty access token received from acquireTokenSilent");throw console.error("[appendAuthToken] Empty access token",{scope:A}),S}return I.set("Authorization",`Bearer ${v}`),I}catch(v){const S=(0,a.h)(v);throw console.error("[appendAuthToken] Token acquisition failed",{scope:A,name:S.name,code:S.errorCode||S.code,message:S.message}),v}};var c=e(6902);const p=(A,I={})=>{const{scope:v=c.D.scope,injectCompanyHeader:S=!0}=I;return(0,t.ni)({baseUrl:A,prepareHeaders:async(N,x)=>{try{const R=await d(v)(N);if(S){const B=x.getState().session?.selectedCompanyId;B&&R.set("Tcmis-Company-ID",B)}return R}catch(L){const R=(0,a.h)(L);throw console.error("[baseQueryWithAuth] Failed to prepare auth headers",{baseUrl:A,scope:v,name:R.name,code:R.errorCode||R.code,message:R.message}),L}}})}},829:(C,m,e)=>{"use strict";e.d(m,{GW:()=>R,fY:()=>B,OR:()=>M,Pg:()=>y,Xn:()=>T});var t=e(3755);const r=D=>D.query({query:()=>({url:"/user"})});var a=e(6902),d=e(9665);const c=D=>D.query({query:({role:U})=>({url:"/users",params:{role:U}})});var p=e(1386);const A=!1,I="multiple",v=[{companyId:"HostCompany",personnelId:2,status:"A",defaultFacilityId:"FAC_DE_01",defaultHub:"HUB_DE_01",adminRole:"User",dataSource:"TCMIS",lockoutDate:null,defaultOpsEntityId:"OPS_DE_01",itarRole:"User",msdsQcRole:"User"},{companyId:"ACME_US",personnelId:1,status:"A",defaultFacilityId:"FAC_US_01",defaultHub:"HUB_US_01",adminRole:"Admin",dataSource:"TCMIS",lockoutDate:null,defaultOpsEntityId:"OPS_US_01",itarRole:"Admin",msdsQcRole:"Admin"},{companyId:"BOEING_UK",personnelId:1,status:"A",defaultFacilityId:"FAC_UK_01",defaultHub:"HUB_UK_01",adminRole:"User",dataSource:"TCMIS",lockoutDate:null,defaultOpsEntityId:"OPS_UK_01",itarRole:"User",msdsQcRole:"User"}],S=D=>window.location.host.startsWith("localhost")&&A?(console.warn(`[DEV] Using mocked /user/companies response (mode: ${I})`),D.query({queryFn:async()=>{await new Promise(W=>setTimeout(W,400));let V;return I==="none"?V=[]:I==="single"?V=[v[0]]:V=v,(0,p.Cv)(`[DEV] Returning ${V.length} companies`),{data:V}}})):D.query({query:()=>({url:"/user/companies"})}),N=!1,x=[{personnelId:2,companyId:"HostCompany",facilityId:"testfacility1",facilityName:"Test Facility 1",preferredAccountSysId:"testaccountsys1",preferredAccountSysDesc:"Test Preferred Account System",defaultApplication:"DefaultApp1",defaultApplicationDesc:"Default Application 1",adminRole:"Admin"}],L=D=>window.location.host.startsWith("localhost")&&N?(console.warn("[DEV] Using mocked /users/:personnelId/facilities response"),D.query({queryFn:async V=>(await new Promise(W=>setTimeout(W,400)),(0,p.Cv)(`[DEV] Returning ${x.length} facilities for personnelId=${V}`),{data:x})})):D.query({query:V=>({url:`/users/${V}/facilities`})}),R=(0,d.LC)({reducerPath:"iamApi",baseQuery:(0,t.s)(a.D.api.iam),endpoints:D=>({getUserWorkContext:r(D),getAuthorizedUsersForRoles:c(D),getUserCompanies:S(D),getUserFacilities:L(D)})}),{useGetUserWorkContextQuery:M,useGetAuthorizedUsersForRolesQuery:B,useGetUserCompaniesQuery:u,useLazyGetUserCompaniesQuery:y,useGetUserFacilitiesQuery:h,useLazyGetUserFacilitiesQuery:T}=R},4890:(C,m,e)=>{"use strict";e.d(m,{wU:()=>L,_o:()=>u,hr:()=>R,Ov:()=>B,E6:()=>M});var t=e(3755),r=e(6902);const a=r.D.api.logistics,d=null,c={Prefer:"code=200, dynamic=true",Accept:"application/json"},p={Prefer:"code=200",Accept:"application/json"},A=y=>y.query({query:({receiptId:h})=>{console.log("[getReceipt] Fetching receipt with ID:",h);const T={url:`${a}/receipts/${h}`,headers:c};return console.log("[getReceipt] Request configuration:",{url:T.url,headers:Object.keys(T.headers||{})}),T},transformResponse:(h,T,D)=>(console.log("[getReceipt] Successfully received receipt data for ID:",D.receiptId),console.log("[getReceipt] Response data:",{receiptId:h?.id||"N/A",status:h?.returnReceiptId||"N/A",responseSize:JSON.stringify(h).length}),h),transformErrorResponse:(h,T,D)=>{const U=h;return console.log("[getReceipt] Error fetching receipt with ID:",D.receiptId),console.log("[getReceipt] Error details:",{status:U.status,error:U.error,data:U.data}),h}}),I=y=>y.query({query:()=>({url:"/receipts/documenttypes"})}),v=null,S=y=>y.query({query:({assignedTo:h,hub:T,operatingEntity:D,receivingStatus:U,assignedToUser:z,inventoryGroups:V=[]})=>{const W=new URLSearchParams;W.append("operatingEntity",D),W.append("hub",T),W.append("assignedTo",h);for(let k=0;ky.query({query:h=>{console.log("[getReceiptStatusViewsById] Starting query with receiptId:",h);const T=`/receipts/views/status/${h}`;return console.log("[getReceiptStatusViewsById] Generated URL:",T),{url:T}},transformResponse:h=>(console.log("[getReceiptStatusViewsById] Raw response received:",h),h),transformErrorResponse:h=>(console.log("[getReceiptStatusViewsById] Error response:",h),h)});var x=e(9665);const L=(0,x.LC)({reducerPath:"logisticsApi",baseQuery:(0,t.s)(r.D.api.logistics),endpoints:y=>({getReceipt:A(y),getReceiptStatusViews:S(y),getReceiptStatusViewsById:N(y),getReceiptDocumentTypes:I(y)})}),{useGetReceiptQuery:R,useLazyGetReceiptStatusViewsQuery:M,useLazyGetReceiptStatusViewsByIdQuery:B,useGetReceiptDocumentTypesQuery:u}=L},3239:(C,m,e)=>{"use strict";e.d(m,{L:()=>c,r:()=>p});var t=e(3755),r=e(6902),a=e(9665),d=e(7260);const c=(0,a.LC)({reducerPath:"microsoftGraphApi",baseQuery:(0,t.s)(r.D.api.microsoftGraph,{scope:d.f1,injectCompanyHeader:!1}),endpoints:A=>({currentUser:A.query({query:()=>"me"})})}),{useCurrentUserQuery:p}=c},3452:(C,m,e)=>{"use strict";e.d(m,{U:()=>c});var t=e(1825),r=e(9600),a=e(6902);const d={auth:{clientId:a.D.authentication.clientId,authority:a.D.authentication.authority,redirectUri:window.location.origin,postLogoutRedirectUri:window.location.origin},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1}},c=new t.L(d);c.handleRedirectPromise().then(p=>{p&&c.setActiveAccount(p.account)}).catch(p=>{console.error("Redirect authentication error:",p)}),c.addEventCallback(p=>{if(p.eventType===r.t.LOGIN_SUCCESS&&p.payload){const I=p.payload.account;c.setActiveAccount(I)}})},7260:(C,m,e)=>{"use strict";e.d(m,{X3:()=>d,f1:()=>a,s5:()=>c});const t=null,r={prod:"api://b42aa4a0-7833-4601-91e0-cd9e26b96401/ICSService.DefaultScope",dev:"api://a390d735-8347-4ef1-8a65-875d1410e88c/ICSService.DefaultScope",localhost:"api://a390d735-8347-4ef1-8a65-875d1410e88c/ICSService.DefaultScope"},a="User.Read",d=p=>r[p]||r.prod,c=p=>[d(p),a]},888:(C,m,e)=>{"use strict";e.d(m,{V:()=>t});const t=(r,a)=>{if(console.log(`[getEnvironmentFromHost] Input host: "${r}"`),console.log(`[getEnvironmentFromHost] Input namespace: "${a}"`),r.startsWith("localhost"))return console.log("[getEnvironmentFromHost] Localhost detected - returning dev environment"),"localhost";const d=r.split(".")[0];console.log(`[getEnvironmentFromHost] Host part: "${d}"`);let c;return d==="chemops"?c="prod":d.startsWith("chemops-")?c=d.replace("chemops-",""):c="prod",console.log(`[getEnvironmentFromHost] Determined environment: "${c}"`),c}},6902:(C,m,e)=>{"use strict";e.d(m,{D:()=>A});var t=e(888),r=e(7260);const a={namespace:"ics-operations-app",authentication:{clientId:"18a25ed5-b469-4694-a8a6-475fdf28e31a",authority:"https://login.microsoftonline.com/c7354023-f985-41a6-966e-da42877461b4"},api:{microsoftGraph:"https://graph.microsoft.com/v1.0",logistics:"https://chemops-dev.incora.com/chemicals/api/logistics",iam:"https://chemops-dev.incora.com/chemicals/api/iam",customerOps:"https://chemops-dev.incora.com/chemicals/api/customer-ops"},scope:(0,r.X3)("dev")},d={namespace:"ics-operations-app",authentication:{clientId:"a14295c2-fc21-4cf7-892d-73bd92cf2086",authority:"https://login.microsoftonline.com/c7354023-f985-41a6-966e-da42877461b4"},api:{microsoftGraph:"https://graph.microsoft.com/v1.0",logistics:"https://chemops.incora.com/chemicals/api/logistics",iam:"https://chemops.incora.com/chemicals/api/iam",customerOps:"https://chemops.incora.com/chemicals/api/customer-ops"},scope:(0,r.X3)("prod")},c={namespace:"ics-operations-app",authentication:{clientId:"18a25ed5-b469-4694-a8a6-475fdf28e31a",authority:"https://login.microsoftonline.com/c7354023-f985-41a6-966e-da42877461b4"},api:{microsoftGraph:"https://graph.microsoft.com/v1.0",logistics:"https://chemops-dev.incora.com/chemicals/api/logistics",iam:"https://chemops-dev.incora.com/chemicals/api/iam",customerOps:"https://chemops-dev.incora.com/chemicals/api/customer-ops"},scope:(0,r.X3)("dev")},A=(()=>{if(console.log("Configuration initialization started"),console.log("Current host:",window.location.host),console.log("Full location:",window.location.href),window.location.host.startsWith("localhost"))return console.log("Localhost detected - using development configuration"),console.log("Development configuration loaded:",a),{...a,scope:(0,r.X3)("localhost")};console.log("Non-localhost environment detected");const I=(0,t.V)(window.location.host,"ics-operations-app");console.log("Environment detected:",I);let v,S;return I==="prod"?(console.log("Loading production configuration"),v=d,S=(0,r.X3)("prod")):(console.log("Loading development configuration"),v=c,S=(0,r.X3)(I)||(0,r.X3)("dev")),console.log("Final configuration loaded:",v),{...v,scope:S}})()},4822:(C,m,e)=>{"use strict";e.d(m,{mA:()=>p,I0:()=>r,Tt:()=>A,TE:()=>u,v9:()=>a});var t=e(3583);const r=t.I0,a=t.v9;var d=e(9288),c=e(8051);const p=()=>{const{instance:h,accounts:T}=(0,d.Fp)(),[D,U]=(0,c.useState)(h.getActiveAccount()??T[0]??null);return(0,c.useEffect)(()=>{const z=h.getActiveAccount();if(z){U(z);return}T.length>0?(h.setActiveAccount(T[0]),U(T[0])):U(null)},[T,h]),D},A=h=>{(0,c.useEffect)(()=>{document.title=h},[h])};var I=(h=>(h.Default="Default",h.QATechnician="ics-qa-technician",h.QASupervisor="ics-qa-supervisor",h.InventoryManager="Inventory Manager",h))(I||{});const{Default:v,QATechnician:S,QASupervisor:N,InventoryManager:x}=I,L={"user.read":[v],"user.write":[v],"sds.read":[v],"warehouse-operations.read":[S,N,x],"inbound-quality.read":[S,N],"inbound-quality.assign":[N],"receiving.read":[S,N,x],"qvr.read":[S,N]},R=h=>Object.entries(L).reduce((T,[D,U])=>((U.includes(h)||U.includes(I.Default))&&T.push(D),T),[]),M=h=>h.reduce((D,U)=>[...D,...R(U)],[]).filter((D,U,z)=>z.indexOf(D)===U),B=h=>!h||h.length===0?[I.Default]:h,u=()=>{const h=p(),T=B(h?.idTokenClaims?.roles),D=M(T);return{hasPermission:W=>(W||(W="user.read"),!0),hasRole:W=>T.includes(W),getPermissions:()=>D}};var y=e(8343)},8343:(C,m,e)=>{"use strict";e.d(m,{Q:()=>I});var t=e(8051),r=e(8868),a=e(9288),d=e(829),c=e(5029),p=e(1386),A=e(1732);const I=()=>{const v=(0,r.I0)(),{accounts:S}=(0,a.Fp)(),{isInitialized:N}=(0,r.v9)(R=>R.session),[x]=(0,d.Pg)(),L=(0,t.useRef)(!1);(0,t.useEffect)(()=>((0,p.Cv)("[BOOTSTRAP MOUNT]"),()=>{(0,p.Cv)("[BOOTSTRAP UNMOUNT]")}),[]),(0,t.useEffect)(()=>{if((0,p.Cv)("[BOOTSTRAP EFFECT] Running initialization check"),S.length===0){(0,p.Cv)("[SessionBootstrap] No authenticated accounts, skipping initialization");return}if(N){(0,p.Cv)("[SessionBootstrap] Session already initialized");return}if(L.current){(0,p.Cv)("[SessionBootstrap] Initialization already attempted");return}(0,p.Cv)("[SessionBootstrap] Starting session initialization..."),L.current=!0,(async()=>{try{(0,p.Cv)("[SessionBootstrap] Fetching companies...");const M=await x().unwrap();if(!M||!Array.isArray(M)){(0,p.H)("[SessionBootstrap] Invalid companies response:",M),v((0,c.o4)("Unable to retrieve your company access. Please contact support."));return}if((0,p.Cv)("[SessionBootstrap] Companies fetched:",M.length),M.length===0){(0,p.Ki)("[SessionBootstrap] User has no companies"),v((0,c.o4)("You do not have access to any companies. Please contact your administrator."));return}typeof M[0].personnelId=="number"&&((0,p.Cv)("[SessionBootstrap] Setting personnelId:",M[0].personnelId),v((0,c.y8)(M[0].personnelId))),(0,p.Cv)("[SessionBootstrap] Auto-selecting first company:",M[0].companyId),v((0,c.ht)(M[0])),v((0,c.Uv)(M)),(0,p.Cv)("[SessionBootstrap] Session initialization complete")}catch(M){(0,p.H)("[SessionBootstrap] Error during initialization:",M);let B="Unable to load user companies. Please try again or contact support.";const u=(0,A.h)(M);u.name==="TypeError"||u.message&&(u.message.includes("fetch")||u.message.includes("network"))?B="Network error: Unable to connect to the service. Please check your internet connection.":u.status===401||u.status===403?B="You do not have permission to access this application. Please contact support.":u.status!==void 0&&u.status>=500?B="Service unavailable. Please try again later.":u.dataMessage?B=u.dataMessage:u.message&&u.message.length<200&&(B=u.message),v((0,c.o4)(B))}})()},[S.length,N,v,x])}},7589:(C,m,e)=>{"use strict";var t=e(9470),r=e(8051),a=e(8236),d=e(1632),c=e(7924);const p=({children:o})=>(0,t.jsx)(c.Z,{sx:{display:"flex"},children:o});var A=e(2522),I=e(2097),v=e(6367),S=e(5344),N=e(366),x=e(5909),L=e(1155),R=e(4822),M=e(3813),B=e(9951),u=e(2485),y=e(2322);const h=(0,M.ZP)(B.Z)(()=>({"& .MuiTypography-root":{fontSize:"0.875rem"}})),T=({icon:o,label:i,path:g})=>{const s=(0,R.v9)(Z=>Z.portal.sideNavOpen),P=(0,d.s0)(),{pathname:E}=(0,d.TH)();return(0,t.jsxs)(u.Z,{disableRipple:!0,selected:E===g,onClick:()=>P(g),sx:Z=>({minHeight:48,justifyContent:s?"space-evenly":"center",margin:"0.25rem","&.MuiButtonBase-root.MuiListItemButton-root":{borderRadius:"0.25rem",":hover:not(.Mui-selected)":{backgroundColor:Z.palette.primary.light,filter:"brightness(1.2)",opacity:.8,"& .MuiListItemIcon-root, .MuiListItemText-root":{color:Z.palette.grey[400]}},"&.Mui-selected":{backgroundColor:Z.palette.primary.main,"& .MuiListItemIcon-root, .MuiListItemText-root":{color:Z.palette.getContrastText(Z.palette.primary.main)}}}}),children:[(0,t.jsx)(y.Z,{sx:{minWidth:0,mr:s?"0.5rem":"auto",justifyContent:"center",opacity:s?.7:1},children:o}),(0,t.jsx)(h,{primary:i,sx:{opacity:s?1:0}})]},i)},D=({links:o})=>{const{hasPermission:i}=(0,R.TE)();return(0,t.jsx)(t.Fragment,{children:o.map(g=>i(g.permission)?(0,t.jsx)(T,{...g},g.label):null)})};var U=e(3192);const z="15rem",V=o=>({width:z,transition:o.transitions.create("width",{easing:o.transitions.easing.sharp,duration:o.transitions.duration.enteringScreen}),overflowX:"hidden"}),W=o=>({transition:o.transitions.create("width",{easing:o.transitions.easing.sharp,duration:o.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${o.spacing(7)} + 1px)`,[o.breakpoints.up("sm")]:{width:`calc(${o.spacing(8)} + 1px)`}}),k=(0,M.ZP)(U.ZP,{shouldForwardProp:o=>o!=="open"})(({theme:o,open:i})=>({width:z,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",...i&&{...V(o),"& .MuiDrawer-paper":V(o)},...!i&&{...W(o),"& .MuiDrawer-paper":W(o)}})),Oe=(0,M.ZP)("div")(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",backgroundColor:o.palette.primary.light,padding:o.spacing(0,1),...o.mixins.toolbar}));var oe=e(3841);const Le={sideNavOpen:!0},ge=(0,oe.oM)({name:"portal",initialState:Le,reducers:{toggleDrawer(o){o.sideNavOpen=!o.sideNavOpen}}}),{toggleDrawer:fe}=ge.actions,be=ge.reducer;var Ze=e(1233),Ue=e(8095),Fe=e(6974),Ne=e(3070);const Be=[{label:"Warehouse Operations",links:[{icon:(0,t.jsx)(Ze.Z,{}),label:"Invoice Problem Management",path:"/warehouse-operations/invoice-problem-management",permission:"user.write"},{icon:(0,t.jsx)(Ue.Z,{}),label:"SecuraStock",path:"/warehouse-operations/secura-stock",permission:"user.write"}]}],We={links:[{icon:(0,t.jsx)(Fe.Z,{}),label:"Account",path:"/account"},{icon:(0,t.jsx)(Ne.Z,{}),label:"Logout",path:"/logout"}]};var he=e(7150),$=e(5444);const Ge=({label:o,open:i})=>(0,t.jsx)($.Z,{fontWeight:"bold",fontSize:"0.6rem",sx:i?{m:"1rem",opacity:.8}:{m:"1rem",textAlign:"center",visibility:"hidden"},children:o.toUpperCase()},o),ye=()=>(0,t.jsx)(A.Z,{sx:{marginTop:"0.75rem"}}),we=()=>{const o=(0,R.v9)(s=>s.portal.sideNavOpen),i=(0,R.I0)(),g=(0,d.s0)();return(0,t.jsxs)(k,{variant:"permanent",open:o,sx:{fontSize:"0.875rem"},children:[(0,t.jsx)(Oe,{children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(I.Z,{onClick:()=>g("/"),sx:{marginRight:"4rem"},children:(0,t.jsx)("img",{alt:"Incora Logo",src:he,style:{maxHeight:"2.0rem"}})}),(0,t.jsx)(v.Z,{onClick:()=>i(fe()),children:(0,t.jsx)(N.Z,{})})]}):(0,t.jsx)(v.Z,{color:"inherit","aria-label":"open drawer",onClick:()=>i(fe()),sx:{marginRight:"0.25rem"},children:(0,t.jsx)(x.Z,{})})}),(0,t.jsx)(A.Z,{}),(0,t.jsxs)(S.Z,{component:"nav","data-testid":"side-nav",children:[(0,t.jsx)(T,{icon:(0,t.jsx)(L.Z,{}),path:"/",label:"Home"}),(0,t.jsx)(ye,{}),Be.map(s=>(0,t.jsxs)("div",{children:[s?.label?(0,t.jsx)(Ge,{label:s.label,open:o}):null,(0,t.jsx)(D,{...s}),(0,t.jsx)(ye,{})]},s.label))]}),(0,t.jsx)(S.Z,{sx:{mt:"auto"},component:"nav",children:(0,t.jsx)(D,{...We})})]})};var ve=e(9902);const Ve=({children:o})=>(0,t.jsx)(ve.Z,{disableGutters:!0,maxWidth:!1,sx:{maxWidth:"100%",height:"100vh",overflow:"auto"},children:o}),ze=({children:o})=>(0,t.jsxs)(p,{children:[(0,t.jsx)(we,{}),(0,t.jsx)(Ve,{children:o})]}),X=o=>(0,t.jsx)(ze,{children:o});var xe=e(9540),n=e(4776),l=e(3661);const f=(0,M.ZP)(l.Z)(({theme:o})=>({backgroundColor:o.palette.primary.light,boxShadow:"none",zIndex:o.zIndex.drawer+1})),K=o=>(0,t.jsxs)(r.Fragment,{children:[(0,t.jsx)(f,{position:"relative",children:(0,t.jsx)(n.Z,{children:(0,t.jsx)("img",{alt:"Incora Logo",src:he,style:{maxHeight:"2rem",paddingLeft:"2rem"}})})}),(0,t.jsx)(c.Z,{sx:{pt:1},children:o.children})]}),q=o=>(0,t.jsx)(K,{children:o});var Q=e(5110);const Ke=(0,Q.ZP)(()=>Promise.all([e.e(216),e.e(267)]).then(e.bind(e,4640)),{resolveComponent:o=>o.Form}),Ot=(0,Q.ZP)(()=>e.e(713).then(e.bind(e,9648)),{resolveComponent:o=>o.Summary}),Lt=(0,Q.ZP)(()=>e.e(12).then(e.bind(e,8960)),{resolveComponent:o=>o.Specifications}),bt=(0,Q.ZP)(()=>Promise.all([e.e(216),e.e(567)]).then(e.bind(e,632)),{resolveComponent:o=>o.ReceiptDetails}),Zt=(0,Q.ZP)(()=>Promise.all([e.e(216),e.e(47)]).then(e.bind(e,8306)),{resolveComponent:o=>o.Notes}),Ut=[{id:"qvr",path:"/qvr/:receiptId",children:[{id:"qvr-form",index:!0,element:q((0,t.jsx)(Ke,{}))},{id:"qvr-summary",path:"summary",element:q((0,t.jsx)(Ot,{}))},{id:"qvr-specification",path:"specification",element:q((0,t.jsx)(Lt,{}))},{id:"qvr-receipt-details",path:"receipt-details",element:q((0,t.jsx)(bt,{}))},{id:"qvr-notes",path:"notes",element:q((0,t.jsx)(Zt,{}))}]}],Ft=(0,Q.ZP)(()=>Promise.all([e.e(216),e.e(378)]).then(e.bind(e,1982)),{resolveComponent:o=>o.Account}),Nt=[{id:"account",path:"/account",element:X((0,t.jsx)(Ft,{}))}];var Qe=e(3755),Bt=e(6902),He=e(9665);const Wt=o=>o.query({query:i=>{const g=new URLSearchParams;return i["delivery-date-max"]&&g.append("delivery-date-max",i["delivery-date-max"]),i["delivery-date-min"]&&g.append("delivery-date-min",i["delivery-date-min"]),i.facilityId&&g.append("facility-id",i.facilityId),i.page!==void 0&&g.append("page",i.page.toString()),i.shipment!==void 0&&g.append("shipment",i.shipment.toString()),i.size!==void 0&&g.append("size",i.size.toString()),i.sort&&i.sort.forEach(s=>g.append("sort",s)),i.workArea&&g.append("work-area",i.workArea),{url:"/put-away-errors",params:g}}});var G=e(1386);const Gt=!1,at=[{id:0,name:"string",description:"string",facilityId:"string",facilityName:"string",inventoryGroup:"string",inventoryGroupName:"string",vendorId:"string",vendorCabinetId:"string"},{id:1,name:"string",description:"string",facilityId:"string",facilityName:"string",inventoryGroup:"string",inventoryGroupName:"string",vendorId:"string",vendorCabinetId:"string"},{id:2,name:"string",description:"string",facilityId:"string",facilityName:"string",inventoryGroup:"string",inventoryGroupName:"string",vendorId:"string",vendorCabinetId:"string"}],wt=o=>window.location.host.startsWith("localhost")&&Gt?(console.warn("[DEV] Using mocked /facilities/:facilityId/work-areas response"),o.query({queryFn:async s=>(await new Promise(P=>setTimeout(P,400)),(0,G.Cv)(`[DEV] Returning ${at.length} work areas for facilityId=${s}`),{data:at})})):o.query({query:s=>({url:`/facilities/${s}/work-areas`})}),Vt=o=>o.mutation({query:i=>({url:"/counts",method:"POST",body:i})}),Ce=(0,He.LC)({reducerPath:"customerOpsApi",baseQuery:(0,Qe.s)(Bt.D.api.customerOps),endpoints:o=>({getPutAwayErrors:Wt(o),getWorkAreasByFacility:wt(o),createCount:Vt(o)})}),{useGetPutAwayErrorsQuery:zt,useLazyGetPutAwayErrorsQuery:fn,useGetWorkAreasByFacilityQuery:hn,useLazyGetWorkAreasByFacilityQuery:Kt,useCreateCountMutation:Qt}=Ce;var H=e(8868);const Ht={tabIndex:0,selection:[],showFilters:!1,rows:[]},rt=(0,oe.oM)({name:"invoiceProblemManagement",initialState:Ht,reducers:{setTabIndex(o,i){o.tabIndex=i.payload,o.selection=[]},setSelection(o,i){o.selection=i.payload},setShowFilters(o,i){o.showFilters=i.payload},setRows(o,i){o.rows=i.payload},reset(o){o.tabIndex=0,o.selection=[],o.showFilters=!1,o.rows=[]}}}),{setTabIndex:kt,setSelection:$t,setShowFilters:Xt,setRows:yn,reset:vn}=rt.actions,Yt=rt.reducer,ct="Awaiting Put Away",lt=[ct,"Awaiting Delivery Confirmation","Missing Price","MR Over Issued","PO Line Over Received","Receipt Over Issued"],Jt="Something went wrong fetching data! Please contact support.",qt="Loading data...";var _t=e(2704),eo=e(8860),ne=e(8810),Ie=e(4263),to=e(7271),Y=e(5236),oo=e(7316),no=e(9197),dt=e(9722),ut=e(4008),mt=e(6105),pt=e(2866),gt=e(5815),ft=e(5688),ke=e(8305),io=e(1369),ht=e(6928);function so(o){if(!o)return"-";const i=ht.ou.fromISO(String(o));return i.isValid?i.toLocaleString(ht.ou.DATE_MED):String(o)}const ao=()=>{const o=(0,ft.Z)();return(0,t.jsxs)(ut.D,{sx:{borderRadius:"0.4rem 0.4rem 0 0",backgroundColor:o.palette.grey[800],color:o.palette.common.white},children:[(0,t.jsx)(mt.S,{sx:{color:"inherit"}}),(0,t.jsx)(pt.M,{sx:{color:"inherit"}})]})},ro=({rows:o,onSelectionChange:i})=>{const g=[{field:"cabinetName",headerName:"Cabinet",flex:1.2,minWidth:180,renderCell:s=>(0,t.jsx)(ke.Z,{title:String(s.value),placement:"bottom-start",children:(0,t.jsx)(c.Z,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%"},children:s.value})})},{field:"mrNumber",headerName:"MR Number",flex:.7,minWidth:120},{field:"mrLine",headerName:"MR Line",flex:.7,minWidth:120},{field:"quantity",headerName:"Quantity",flex:.7,minWidth:100},{field:"partNumber",headerName:"Part Number",flex:1,minWidth:140},{field:"partDescription",headerName:"Part Description",flex:1.2,minWidth:180},{field:"itemId",headerName:"Item ID",flex:.7,minWidth:100},{field:"dateDelivered",headerName:"Date Delivered",flex:.9,minWidth:140,valueFormatter:({value:s})=>so(s),renderCell:s=>(0,t.jsx)(io.Z,{size:"small",label:String(s.formattedValue??s.value)})},{field:"errorDetail",headerName:"Error Detail",flex:1.2,minWidth:180},{field:"shipmentId",headerName:"Shipment ID",flex:.7,minWidth:100},{field:"issueId",headerName:"Issue ID",flex:.7,minWidth:100},{field:"receiptId",headerName:"Receipt ID",flex:.7,minWidth:100},{field:"poNumber",headerName:"PO Number",flex:.7,minWidth:120},{field:"poLine",headerName:"PO Line",flex:.7,minWidth:120}];return(0,t.jsx)(gt.K,{rows:o,columns:g,getRowId:s=>s.id,autoHeight:!0,checkboxSelection:!0,disableRowSelectionOnClick:!0,pageSizeOptions:[10,25,50,100],initialState:{pagination:{paginationModel:{page:0,pageSize:10}}},onRowSelectionModelChange:s=>{i(s.map(String))},density:"standard",showCellVerticalBorder:!0,slots:{toolbar:ao},sx:{"--unstable_DataGrid-radius":0,width:"100%",backgroundColor:s=>s.palette.common.white,border:"1px solid rgba(0,0,0,0.2)",".MuiDataGrid-columnHeader, .MuiDataGrid-cell":{textAlign:"center"},".MuiDataGrid-columnHeaderTitle":{width:"100%",textAlign:"center"}}})};var ie=e(7362),$e=e(8199),yt=e(8908);const co=({onSearch:o})=>(0,t.jsxs)(ie.ZP,{container:!0,spacing:2,children:[(0,t.jsx)(ie.ZP,{item:!0,xs:12,md:4,children:(0,t.jsx)($e.Z,{label:"Company",fullWidth:!0,disabled:!0,placeholder:"(future)"})}),(0,t.jsx)(ie.ZP,{item:!0,xs:12,md:4,children:(0,t.jsx)($e.Z,{label:"Facility",fullWidth:!0,disabled:!0,placeholder:"(future)"})}),(0,t.jsx)(ie.ZP,{item:!0,xs:12,md:4,children:(0,t.jsx)($e.Z,{label:"Area / Building",fullWidth:!0,disabled:!0,placeholder:"(future)"})}),(0,t.jsx)(ie.ZP,{item:!0,xs:12,children:(0,t.jsx)(A.Z,{})}),(0,t.jsx)(ie.ZP,{item:!0,xs:12,display:"flex",justifyContent:"flex-end",children:(0,t.jsx)(c.Z,{children:(0,t.jsx)(I.Z,{variant:"contained",endIcon:(0,t.jsx)(yt.Z,{}),onClick:o,children:"Search"})})})]}),lo=()=>{const o=(0,H.I0)(),i=(0,H.v9)(j=>j.invoiceProblemManagement.tabIndex),g=(0,H.v9)(j=>j.invoiceProblemManagement.selection),s=(0,H.v9)(j=>j.invoiceProblemManagement.showFilters),P=(0,H.v9)(j=>j.invoiceProblemManagement.rows);(0,r.useEffect)(()=>{},[i]);const E=lt[i]===ct,Z=new Date,J=Z.getUTCFullYear(),w=Z.getUTCMonth(),re=new Date(Date.UTC(J,w-1,1,0,0,0)),Me=new Date(Date.UTC(J,w+1,0,23,59,59)),je=re.toISOString().replace(/\.\d{3}Z$/,"Z"),tt=Me.toISOString().replace(/\.\d{3}Z$/,"Z"),te=zt({"delivery-date-min":je,"delivery-date-max":tt},{skip:!E}),ce=te.data,le=te.isLoading,ot=te.error,nt=(0,r.useMemo)(()=>ce&&Array.isArray(ce)?ce.flatMap(j=>Array.isArray(j.putAwayErrors)?j.putAwayErrors.map(F=>({id:`${j.facilityId}-${F.issueId}-${F.receiptId}-${F.itemId}`,cabinetName:F.cabinetName??"",mrNumber:F.mrNumber??0,mrLine:F.mrLine??"",quantity:F.quantity??0,partNumber:F.partNumber??"",partDescription:F.partDescription??"",itemId:F.itemId??0,dateDelivered:F.dateDelivered??"",errorDetail:F.errorDetail??"",shipmentId:F.shipmentId??0,issueId:F.issueId??0,receiptId:F.receiptId??0,poNumber:F.poNumber??0,poLine:F.poLine??0})):[]):P,[ce,P]);let Te=P,me=!1,de=null;E&&(me=le,de=ot,Te=nt);const it=()=>{console.log("Submit action with rows:",g)},st=()=>{console.log("Print action with rows:",g)};return(0,t.jsxs)(c.Z,{sx:{p:2},children:[(0,t.jsx)($.Z,{variant:"h5",fontWeight:600,sx:{mb:1},children:"Invoice Problem Management"}),(0,t.jsx)(_t.Z,{value:i,onChange:(j,F)=>{o(kt(F))},variant:"fullWidth",allowScrollButtonsMobile:!0,TabScrollButtonProps:{sx:j=>({color:j.palette.primary.main,opacity:.85,"&:hover":{color:j.palette.primary.dark}})},sx:{py:"10px","& .MuiTab-root":{textTransform:"none",fontWeight:600},"& .Mui-selected":j=>({background:j.palette.grey[200],borderRadius:1})},children:lt.map(j=>(0,t.jsx)(eo.Z,{label:j},j))}),(0,t.jsx)(ne.Z,{elevation:0,sx:j=>({background:j.palette.common.white,border:"1px solid rgba(0,0,0,0.2)",borderRadius:1,mb:1,px:1}),children:(0,t.jsxs)(n.Z,{disableGutters:!0,sx:{justifyContent:"space-between",mb:1},children:[(0,t.jsxs)(Ie.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,t.jsx)(v.Z,{onClick:()=>o(Xt(!s)),children:(0,t.jsx)(oo.Z,{})}),(0,t.jsxs)($.Z,{variant:"body2",color:"text.secondary",children:[g.length," selected"]})]}),(0,t.jsxs)(Ie.Z,{direction:"row",spacing:1,children:[(0,t.jsx)(I.Z,{variant:"outlined",startIcon:(0,t.jsx)(no.Z,{}),onClick:st,disabled:g.length===0,children:"Print Packing List"}),(0,t.jsx)(I.Z,{variant:"contained",startIcon:(0,t.jsx)(dt.Z,{}),onClick:it,disabled:g.length===0,children:"Submit"})]})]})}),(0,t.jsxs)(to.Z,{in:s,unmountOnExit:!0,children:[(0,t.jsx)(Y.Z,{severity:"info",sx:{mb:2},children:"Filters are provided as a prepared section for future requirements. They are not required at the moment."}),(0,t.jsx)(co,{onSearch:()=>{}}),(0,t.jsx)(A.Z,{sx:{my:2}})]}),(0,t.jsxs)(ne.Z,{elevation:0,sx:j=>({background:j.palette.common.white,border:"1px solid rgba(0,0,0,0.2)",borderRadius:1,p:1}),children:[!!de&&(0,t.jsxs)(Y.Z,{severity:"error",sx:{mt:2},children:[(0,t.jsx)($.Z,{variant:"subtitle2",fontWeight:600,gutterBottom:!0,children:"Error"}),Jt]}),me&&!de&&(0,t.jsx)(Y.Z,{severity:"info",sx:{mt:2},children:qt}),!me&&!de&&(0,t.jsx)(ro,{rows:Te,onSelectionChange:j=>o($t(j))})]})]})};var Se=e(829);const uo={selectedFacilityId:null,selectedRowId:null,showResults:!1},vt=(0,oe.oM)({name:"securaStock",initialState:uo,reducers:{setSelectedFacilityId(o,i){o.selectedFacilityId=i.payload,o.showResults=!1,o.selectedRowId=null},setSelectedRowId(o,i){o.selectedRowId=i.payload},setShowResults(o,i){o.showResults=i.payload},reset(o){o.selectedFacilityId=null,o.selectedRowId=null,o.showResults=!1}}}),{setSelectedFacilityId:mo,setSelectedRowId:Xe,setShowResults:xt,reset:Dn}=vt.actions,po=vt.reducer;var ue=e(1240);const go=()=>{const o=(0,ft.Z)();return(0,t.jsxs)(ut.D,{sx:{borderRadius:"0.4rem 0.4rem 0 0",backgroundColor:o.palette.grey[800],color:o.palette.common.white},children:[(0,t.jsx)(mt.S,{sx:{color:"inherit"}}),(0,t.jsx)(pt.M,{sx:{color:"inherit"}})]})},fo=({rows:o,selectedRowId:i,onSelectionChange:g})=>{const s=[{field:"name",headerName:"Name",flex:1,minWidth:150,renderCell:E=>(0,t.jsx)(ke.Z,{title:String(E.value),placement:"bottom-start",children:(0,t.jsx)(c.Z,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%"},children:E.value})})},{field:"description",headerName:"Description",flex:1.5,minWidth:200,renderCell:E=>(0,t.jsx)(ke.Z,{title:String(E.value),placement:"bottom-start",children:(0,t.jsx)(c.Z,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%"},children:E.value})})},{field:"inventoryGroupName",headerName:"Inventory Group",flex:1.2,minWidth:150},{field:"vendorId",headerName:"Vendor",flex:1,minWidth:150},{field:"vendorCabinetId",headerName:"Vendor Cabinet ID",flex:1,minWidth:150}],P=i?[i]:[];return(0,t.jsx)(gt.K,{rows:o,columns:s,getRowId:E=>E.id.toString(),autoHeight:!0,checkboxSelection:!0,disableRowSelectionOnClick:!0,pageSizeOptions:[10,25,50,100],initialState:{pagination:{paginationModel:{page:0,pageSize:10}}},rowSelectionModel:P,onRowSelectionModelChange:E=>{if(E.length>0){const Z=E[E.length-1];g(String(Z))}else g(null)},density:"standard",showCellVerticalBorder:!0,slots:{toolbar:go},sx:{"--unstable_DataGrid-radius":0,width:"100%",backgroundColor:E=>E.palette.common.white,border:"1px solid rgba(0,0,0,0.2)",".MuiDataGrid-columnHeader, .MuiDataGrid-cell":{textAlign:"center"},".MuiDataGrid-columnHeaderTitle":{width:"100%",textAlign:"center"}}})};var ho=e(6465),yo=e(5492),vo=e(584),Ct=e(61);const xo=({facilities:o,selectedFacilityId:i,facilitiesLoading:g,facilitiesError:s,workAreasLoading:P,isSearchDisabled:E,onFacilityChange:Z,onSearch:J})=>(0,t.jsxs)(ne.Z,{elevation:0,sx:w=>({background:w.palette.common.white,border:"1px solid rgba(0,0,0,0.2)",borderRadius:1,p:2,mb:2}),children:[(0,t.jsxs)(Ie.Z,{direction:"row",spacing:2,alignItems:"flex-end",justifyContent:"space-between",children:[(0,t.jsxs)(ho.Z,{disabled:g,sx:{minWidth:200},children:[(0,t.jsx)(yo.Z,{id:"facility-select-label",children:"Facility"}),(0,t.jsxs)(vo.Z,{labelId:"facility-select-label",id:"facility-select",value:i||"",label:"Facility",onChange:w=>Z(w.target.value),children:[(0,t.jsx)(Ct.Z,{value:"",children:(0,t.jsx)("em",{children:"Select a facility"})}),o.map(w=>(0,t.jsx)(Ct.Z,{value:w.facilityId,children:w.facilityName},w.facilityId))]})]}),(0,t.jsx)(I.Z,{variant:"contained",startIcon:P?(0,t.jsx)(ue.Z,{size:20,color:"inherit"}):(0,t.jsx)(yt.Z,{}),onClick:J,disabled:E,sx:{minWidth:120},children:"Search"})]}),!!s&&(0,t.jsxs)(Y.Z,{severity:"error",sx:{mt:2},children:[(0,t.jsx)($.Z,{variant:"subtitle2",fontWeight:600,gutterBottom:!0,children:"Error Loading Facilities"}),"Failed to load facilities. Please try refreshing the page."]})]}),Co=()=>{const o=(0,H.I0)(),i=(0,H.v9)(b=>b.session.personnelId),g=(0,H.v9)(b=>b.session.companies),s=(0,H.v9)(b=>b.securaStock.selectedFacilityId),P=(0,H.v9)(b=>b.securaStock.selectedRowId),E=(0,H.v9)(b=>b.securaStock.showResults),[Z,J]=(0,r.useState)([]),[w,re]=(0,r.useState)([]),[Me,je]=(0,Se.Xn)(),[tt,te]=Kt(),[ce,le]=Qt();(0,r.useEffect)(()=>{i&&Me(i).unwrap().then(b=>{J(b)}).catch(b=>{console.error("Failed to load facilities:",b)})},[i,Me]);const ot=b=>{o(mo(b))},nt=()=>{s&&(o(xt(!1)),o(Xe(null)),tt(s).unwrap().then(b=>{re(b),o(xt(!0))}).catch(b=>{console.error("Failed to load work areas:",b)}))},Te=()=>{if(!P||!s||!i)return;const b=w.find(pe=>pe.id.toString()===P);if(!b)return;const Tt=g.length>0?g[0].companyId:"";if(!Tt){console.error("No company ID available");return}const gn={source:"auto",personnelId:i,workArea:b.id?.toString(),facilityId:s,companyId:Tt};ce(gn).unwrap().then(pe=>{console.log("Count created successfully:",pe),o(Xe(null))}).catch(pe=>{console.error("Failed to create count:",pe)})},me=!s||te.isLoading,de=!P||le.isLoading||!E,it=je.isLoading,st=je.error,j=te.isLoading,F=te.error,mn=le.error,pn=le.isSuccess;return(0,t.jsxs)(c.Z,{sx:{p:2},children:[(0,t.jsx)($.Z,{variant:"h5",fontWeight:600,sx:{mb:2},children:"SecuraStock"}),(0,t.jsx)(xo,{facilities:Z,selectedFacilityId:s,facilitiesLoading:it,facilitiesError:st,workAreasLoading:j,isSearchDisabled:me,onFacilityChange:ot,onSearch:nt}),E&&(0,t.jsx)(ne.Z,{elevation:0,sx:b=>({background:b.palette.common.white,border:"1px solid rgba(0,0,0,0.2)",borderRadius:1,px:2,py:1,mb:2}),children:(0,t.jsxs)(Ie.Z,{direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[(0,t.jsx)($.Z,{variant:"body2",color:"text.secondary",children:P?"1 selected":"0 selected"}),(0,t.jsx)(I.Z,{variant:"contained",startIcon:le.isLoading?(0,t.jsx)(ue.Z,{size:20,color:"inherit"}):(0,t.jsx)(dt.Z,{}),onClick:Te,disabled:de,children:"Submit"})]})}),pn&&(0,t.jsx)(Y.Z,{severity:"success",sx:{mb:2},children:"Count created successfully!"}),!!mn&&(0,t.jsxs)(Y.Z,{severity:"error",sx:{mb:2},children:[(0,t.jsx)($.Z,{variant:"subtitle2",fontWeight:600,gutterBottom:!0,children:"Error Creating Count"}),"Failed to create count. Please try again."]}),E&&(0,t.jsxs)(ne.Z,{elevation:0,sx:b=>({background:b.palette.common.white,border:"1px solid rgba(0,0,0,0.2)",borderRadius:1,p:1}),children:[!!F&&(0,t.jsxs)(Y.Z,{severity:"error",sx:{mt:2},children:[(0,t.jsx)($.Z,{variant:"subtitle2",fontWeight:600,gutterBottom:!0,children:"Error Loading Work Areas"}),"Failed to load work areas. Please try again."]}),j&&!F&&(0,t.jsx)(Y.Z,{severity:"info",sx:{mt:2},children:"Loading work areas..."}),!j&&!F&&w.length===0&&(0,t.jsx)(Y.Z,{severity:"info",sx:{mt:2},children:"No work areas found for the selected facility."}),!j&&!F&&w.length>0&&(0,t.jsx)(fo,{rows:w,selectedRowId:P,onSelectionChange:b=>o(Xe(b))})]})]})};var Io=e(2743);const So=()=>((0,R.Tt)("Unauthorized"),(0,t.jsx)(ve.Z,{sx:{pt:5},children:(0,t.jsx)(ne.Z,{children:(0,t.jsxs)(Y.Z,{severity:"error",children:[(0,t.jsx)(Io.Z,{children:"Authorization"}),"You are not authorized to view this content."]})})})),Ye=({children:o,permission:i})=>{const{hasPermission:g}=(0,R.TE)();return g(i)?o:(0,t.jsx)(So,{})},Eo=(0,Q.ZP)(()=>Promise.all([e.e(216),e.e(371)]).then(e.bind(e,7207)),{resolveComponent:o=>o.InboundQuality}),Do=[{id:"warehouse-operations",path:"/warehouse-operations",children:[{id:"warehouse-operations",index:!0,element:X((0,t.jsx)(xe.LoadableNotFound,{}))},{id:"inbound-quality",path:"inbound-quality",element:X((0,t.jsx)(Ye,{permission:"inbound-quality.read",children:(0,t.jsx)(Eo,{})}))},{id:"invoice-problem-management",path:"invoice-problem-management",element:X((0,t.jsx)(Ye,{permission:"user.write",children:(0,t.jsx)(lo,{})}))},{id:"secura-stock",path:"secura-stock",element:X((0,t.jsx)(Ye,{permission:"user.write",children:(0,t.jsx)(Co,{})}))}]}];var Je=e(9288);const Po=({children:o})=>{const i=(0,d.s0)(),g=(0,d.TH)(),{accounts:s}=(0,Je.Fp)();(0,G.Cv)(`[GUARD] path=${g.pathname}`);const{selectedCompanyId:P,isInitialized:E,initError:Z}=(0,H.v9)(J=>J.session);return(0,r.useEffect)(()=>{if(s.length===0){(0,G.Cv)("[CompanyGuard] No authenticated accounts, skipping guard logic");return}if(!E){(0,G.Cv)("[CompanyGuard] Session not initialized yet, waiting...");return}if((0,G.Cv)("[CompanyGuard] Guard check:",{path:g.pathname,isInitialized:E,initError:Z,selectedCompanyId:P}),Z){(0,G.Cv)("[CompanyGuard] Initialization error detected, redirecting to login"),i("/login",{replace:!0});return}},[E,Z,P,s.length,g.pathname,i]),E?Z?((0,G.Cv)("[CompanyGuard] Init error present, redirecting..."),(0,t.jsx)(c.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh"},children:(0,t.jsx)(ue.Z,{})})):P?((0,G.Cv)("[CompanyGuard] Rendering children (init successful, company selected)"),(0,t.jsx)(t.Fragment,{children:o})):((0,G.Cv)("[CompanyGuard] Waiting for company auto-selection..."),(0,t.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"100vh",gap:2},children:[(0,t.jsx)(ue.Z,{}),(0,t.jsx)(c.Z,{sx:{color:"text.secondary"},children:"Loading your account..."})]})):((0,G.Cv)("[CompanyGuard] Rendering loading spinner (not initialized)"),(0,t.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"100vh",gap:2},children:[(0,t.jsx)(ue.Z,{}),(0,t.jsx)(c.Z,{sx:{color:"text.secondary"},children:"Loading your account..."})]}))},Ao=(0,Q.ZP)(()=>Promise.all([e.e(216),e.e(177)]).then(e.bind(e,6490)),{resolveComponent:o=>o.Home}),Ro=(0,Q.ZP)(()=>e.e(227).then(e.bind(e,5107)),{resolveComponent:o=>o.SDS}),Mo=(0,Q.ZP)(()=>Promise.all([e.e(216),e.e(535)]).then(e.bind(e,4401)),{resolveComponent:o=>o.Login}),jo=(0,Q.ZP)(()=>e.e(170).then(e.bind(e,9841)),{resolveComponent:o=>o.Logout}),To=[{id:"login",path:"/login",element:(0,t.jsx)(Mo,{})},{id:"logout",path:"/logout",element:(0,t.jsx)(jo,{})},{id:"protected",element:(0,t.jsx)(Po,{children:(0,t.jsx)(d.j3,{})}),children:[{id:"home",path:"/",element:X((0,t.jsx)(Ao,{}))},{id:"sds",path:"/sds",element:X((0,t.jsx)(Ro,{}))},...Ut,...Nt,...Do,{id:"not-found",path:"*",element:X((0,t.jsx)(xe.LoadableNotFound,{}))}]}],Oo=()=>(0,d.V$)(To);var Lo=e(8343);const bo=({children:o})=>((0,Lo.Q)(),(0,t.jsx)(t.Fragment,{children:o})),Zo=()=>{const o=(0,R.mA)(),i=(0,d.TH)(),g=(0,d.s0)(),{inProgress:s}=(0,Je.Fp)(),P=(0,r.useRef)(!1),E=(0,R.v9)(re=>re.session.initError);(0,G.Cv)(`[APP] path=${i.pathname}, account=${o?"true":"false"}, inProgress=${s}`);const Z=i.pathname==="/login",J=i.pathname==="/logout",w=Z||J;return(0,r.useEffect)(()=>{if((0,G.Cv)("[APP EFFECT] Running navigation logic"),P.current&&(Z||i.pathname==="/")&&(P.current=!1,(0,G.Cv)("[APP] Navigation completed, flag reset")),s!=="none"){(0,G.Cv)("[APP EFFECT] Skipping - MSAL in progress");return}if(P.current){(0,G.Cv)("[APP EFFECT] Skipping - navigation already performed");return}if(!o&&!w){(0,G.Cv)("[APP NAVIGATE] -> /login (not authenticated)"),P.current=!0,g("/login");return}if(o&&Z&&!E){(0,G.Cv)("[APP NAVIGATE] -> / (authenticated on login page)"),P.current=!0,g("/");return}(0,G.Cv)("[APP EFFECT] No navigation needed")},[o,i.pathname,s,E,Z,w,g]),s!=="none"&&Z?null:(0,t.jsx)("div",{"data-testid":"app-test-id",children:(0,t.jsx)(bo,{children:(0,t.jsx)(Oo,{})})})};var Ee=e(280);typeof document<"u"&&(document.cookie="i18next=; Max-Age=0; Path=/; SameSite=Strict; Secure"),Ee.z2.use((0,Ee.Xf)((o,i)=>e(2071)(`./${o.replace("-","_")}/${i}.json`))).use(Ee.qB).use(Ee.Db).init({fallbackLng:"en-US",debug:!1,load:"currentOnly",ns:["translation"],defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","queryString","navigator","htmlTag"],caches:["localStorage"],cookieOptions:{secure:!0,sameSite:"strict"}}});const Pn=null;var Uo=e(6588),Fo=e(5527),No=e(2204),Bo=e(8346),_=e(3683),Wo=e(3379),It=e.n(Wo),Go=e(7795),St=e.n(Go),wo=e(569),Et=e.n(wo),Vo=e(3565),Dt=e.n(Vo),zo=e(9216),Pt=e.n(zo),Ko=e(4589),At=e.n(Ko),De=e(1843),se={};se.styleTagTransform=At(),se.setAttributes=Dt(),se.insert=Et().bind(null,"head"),se.domAPI=St(),se.insertStyleElement=Pt();var An=It()(De.Z,se);const O=De.Z&&De.Z.locals?De.Z.locals:void 0;var Pe=e(400),ae={};ae.styleTagTransform=At(),ae.setAttributes=Dt(),ae.insert=Et().bind(null,"head"),ae.domAPI=St(),ae.insertStyleElement=Pt();var Rn=It()(Pe.Z,ae);const Qo=Pe.Z&&Pe.Z.locals?Pe.Z.locals:void 0;var Rt=e(3834);const Ho=o=>{switch(o){case"ar_AE":return _.gP;case"de_DE":return _.y1;case"fr_FR":return _.gQ;case"it_IT":return _.KL;case"pl_PL":return _.sv;case"tr_TR":return _.Xl;case"zh_CN":return _.U1;default:return _._z}},ko=({children:o})=>{const[,i]=(0,Rt.$G)(),g=(0,No.Z)({typography:{fontFamily:Qo.fontFamily},palette:{common:{black:O["grayscale-black"],white:O["grayscale-white"]},primary:{main:O["brand-primary-navy"],contrastText:O["grayscale-white"]},secondary:{main:O["brand-primary-teal"]},neutral:{main:O["grayscale-gray700"],dark:O["grayscale-gray800"]},error:{main:O["status-negative-main"],light:O["status-negative-light"],dark:O["status-negative-dark"],darker:O["status-negative-darker"]},warning:{main:O["status-warning-main"],light:O["status-warning-light"],dark:O["status-warning-dark"],darker:O["status-warning-darker"]},info:{main:O["status-information-main"],light:O["status-information-light"],dark:O["status-information-dark"],darker:O["status-information-darker"]},success:{main:O["status-positive-main"],light:O["status-positive-light"],dark:O["status-positive-dark"],darker:O["status-positive-darker"]},grey:{200:O["grayscale-gray200"],300:O["grayscale-gray300"],400:O["grayscale-gray400"],600:O["grayscale-gray600"],700:O["grayscale-gray700"],800:O["grayscale-gray800"]},background:{default:"rgb(239, 240, 243)",paper:O["grayscale-white"]}},components:{MuiTab:{styleOverrides:{root:({theme:s})=>({background:s.palette.common.white,borderRadius:".4rem",boxShadow:s.shadows[1],borderBottom:".1rem",borderBottomColor:s.palette.grey[400],borderBottomStyle:"solid",fontWeight:"bold","&.Mui-selected":{backgroundColor:s.palette.secondary.main,color:s.palette.common.white}})}},MuiDataGrid:{styleOverrides:{root:({theme:s})=>({"& .Mui-even":{backgroundColor:s.palette.grey[200]},"& .MuiDataGrid-pinnedColumnHeaders .MuiDataGrid-columnHeader":{backgroundColor:s.palette.primary.main},"& .MuiDataGrid-columnHeader":{backgroundColor:s.palette.primary.light,color:s.palette.common.white},"& .MuiDataGrid-columnHeader--dragging":{color:s.palette.common.black},"& .MuiDataGrid-iconSeparator":{color:s.palette.common.white},"& .MuiDataGrid-sortIcon":{color:s.palette.common.white},"& .MuiDataGrid-menuIconButton":{color:s.palette.common.white},"& .MuiDataGrid-cell:focus-within":{outline:"none"},"& .MuiDataGrid-cell:focus":{outline:"none"},"& .row-status--greyed":{backgroundColor:s.palette.grey[600]}," & .row-status--greyed:hover":{backgroundColor:s.palette.grey[400]}})}},MuiInputBase:{styleOverrides:{input:({theme:s})=>({"&.MuiFilledInput-input.Mui-disabled":{WebkitTextFillColor:s.palette.grey[700]}})}},MuiInputLabel:{styleOverrides:{root:({theme:s})=>({"&.MuiInputLabel-root.Mui-disabled":{color:s.palette.grey[700]}})}},MuiDrawer:{styleOverrides:{paper:({theme:s})=>({backgroundColor:s.palette.grey[400]})}}}},Ho(i.resolvedLanguage));return(0,t.jsx)(Bo.Z,{theme:g,children:o})};var $o=e(7262),Xo=e(9488);const Yo=({children:o})=>{const[,i]=(0,Rt.$G)(),g=i.language.toLowerCase().replace("_","-");return(0,t.jsx)($o._,{dateAdapter:Xo.Y,adapterLocale:g,dateFormats:{monthShort:"MMM M"},children:o})};var Jo=e(1846);const qo=({children:o})=>(0,t.jsx)(Jo.VK,{children:o});var _o=e(4119);const en=o=>o.query({query:({itemId:i,inventoryGroup:g})=>`/item/${i}/inventorygroup/${g}/parts`}),Ae=(0,He.LC)({reducerPath:"catalogApi",baseQuery:(0,Qe.s)("https://stoplight.io/mocks/incora/catalog-api/70635011"),endpoints:o=>({catalogParts:en(o)})}),{useCatalogPartsQuery:Mn}=Ae,tn=o=>o.query({query:({itemId:i,radianPo:g,poLine:s})=>`/item/${i}/po/${g}/poline/${s}/customernotes`}),Re=(0,He.LC)({reducerPath:"fulfillmentApi",baseQuery:(0,Qe.s)("https://stoplight.io/mocks/incora/fulfillment-api/73869180"),endpoints:o=>({customerNotes:tn(o)})}),{useCustomerNotesQuery:jn}=Re;var qe=e(4890),_e=e(3239),on=e(9545),nn=e(137),sn=e(5029);const Mt=(0,oe.xC)({reducer:{portal:be,qvrForm:on.ZP,inboundQuality:nn.ZP,invoiceProblemManagement:Yt,securaStock:po,session:sn.ZP,[Ae.reducerPath]:Ae.reducer,[Re.reducerPath]:Re.reducer,[qe.wU.reducerPath]:qe.wU.reducer,[_e.L.reducerPath]:_e.L.reducer,[Se.GW.reducerPath]:Se.GW.reducer,[Ce.reducerPath]:Ce.reducer},middleware:o=>o({serializableCheck:{ignoredActions:["qvrForm/uploadDocuments"]}}).concat([Ae.middleware,Re.middleware,qe.wU.middleware,_e.L.middleware,Se.GW.middleware,Ce.middleware])});(0,_o.sj)(Mt.dispatch);var an=e(3583);const rn=({children:o})=>(0,t.jsx)(an.zt,{store:Mt,children:o});var ee=e(3452),et=e(9600);const cn=({children:o})=>((0,r.useEffect)(()=>{if(!ee.U.getActiveAccount()){const s=ee.U.getAllAccounts();s.length===1&&ee.U.setActiveAccount(s[0])}const g=ee.U.addEventCallback(s=>{if(s.eventType===et.t.LOGIN_SUCCESS||s.eventType===et.t.ACQUIRE_TOKEN_SUCCESS||s.eventType===et.t.SSO_SILENT_SUCCESS){const P=s.payload;if(P&&typeof P=="object"&&"account"in P&&P.account){const E=P.account;E&&(ee.U.setActiveAccount(E),(0,G.Cv)("[AuthContextProvider] Active account set after login:",E.username))}}});return()=>{g&&ee.U.removeEventCallback(g)}},[]),(0,t.jsx)(Je.rL,{instance:ee.U,children:o})),ln=({children:o})=>(0,t.jsx)(rn,{children:(0,t.jsx)(cn,{children:(0,t.jsx)(qo,{children:(0,t.jsx)(Uo.Z,{injectFirst:!0,children:(0,t.jsx)(Yo,{children:(0,t.jsxs)(ko,{children:[(0,t.jsx)(Fo.ZP,{}),o]})})})})})});var dn=e(1442),un=e(4553);un.T.setLicenseKey("d8e46f3df97261c934293ecedb7e6280Tz02Mjk3NyxFPTE3MTE2NDc2ODY5MDMsUz1wcmVtaXVtLExNPXN1YnNjcmlwdGlvbixLVj0y");const jt=document.getElementById("root");if(!jt)throw new Error("Failed to find the root element");(0,a.s)(jt).render((0,t.jsx)(r.StrictMode,{children:(0,t.jsx)(r.Suspense,{fallback:(0,t.jsx)(dn.g,{}),children:(0,t.jsx)(ln,{children:(0,t.jsx)(Zo,{})})})}))},8815:(C,m,e)=>{"use strict";e.d(m,{ou:()=>t.ou});var t=e(6928)},280:(C,m,e)=>{"use strict";e.d(m,{Db:()=>r.Db,Xf:()=>c.Z,ei:()=>t.$,qB:()=>d.Z,z2:()=>a.ZP});var t=e(9089),r=e(1336),a=e(6894),d=e(1660),c=e(3477)},9288:(C,m,e)=>{"use strict";e.d(m,{Fp:()=>t.Fp,rL:()=>t.rL});var t=e(3047)},3583:(C,m,e)=>{"use strict";e.d(m,{I0:()=>t.I0,v9:()=>t.v9,zt:()=>t.zt});var t=e(8868)},3834:(C,m,e)=>{"use strict";e.d(m,{$G:()=>r,iu:()=>a,y4:()=>d});var t=e(280);const r=t.ei,a=Object.freeze({"ar-AE":"\u0639\u0631\u0628\u064A","de-DE":"Deutsch","en-US":"English (US)","en-GB":"English (UK)","fr-FR":"Fran\xE7ais","it-IT":"Italiano","pl-PL":"Polski","tr-TR":"T\xFCrk","zh-CN":"\u4E2D\u56FD\u4EBA"}),d=Object.keys(a)},1442:(C,m,e)=>{"use strict";e.d(m,{g:()=>d});var t=e(9470),r=e(493),a=e(1240);const d=()=>(0,t.jsx)(r.Z,{open:!0,sx:{height:"100vh",width:"100vw",position:"fixed",top:0,left:0,zIndex:1e4,display:"flex",justifyContent:"center",alignItems:"center"},children:(0,t.jsx)(a.Z,{size:"10em"})})},9540:(C,m,e)=>{"use strict";e.r(m),e.d(m,{LoadableNotFound:()=>v,NotFound:()=>I});var t=e(9470),r=e(7362),a=e(5236),d=e(2743),c=e(3834),p=e(4822),A=e(5110);const I=()=>{(0,p.Tt)("Not Found");const[S]=(0,c.$G)();return(0,t.jsxs)(r.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(r.ZP,{item:!0,xs:!0}),(0,t.jsx)(r.ZP,{item:!0,xs:6,children:(0,t.jsxs)(a.Z,{severity:"error",sx:{marginTop:"3em"},children:[(0,t.jsx)(d.Z,{children:S("missingpage.title","Content Not Found")}),S("noKey.message"," Sorry it seems that the content you are looking for is not available.")]})}),(0,t.jsx)(r.ZP,{item:!0,xs:!0})]})},v=(0,A.ZP)(()=>Promise.resolve().then(e.bind(e,9540)),{resolveComponent:S=>S.NotFound})},2697:()=>{"use strict"},9545:(C,m,e)=>{"use strict";e.d(m,{kx:()=>u,ZP:()=>xe,iH:()=>be,zF:()=>Oe,Fv:()=>k,sb:()=>Ze,bv:()=>ye,j:()=>$,z3:()=>Ne,oE:()=>Fe,RU:()=>Ue,g$:()=>ge,aQ:()=>Le,Ub:()=>We,w1:()=>we,on:()=>Ge,L9:()=>oe,Ik:()=>Ve,I0:()=>he,dx:()=>ze,mz:()=>Be,_l:()=>ve,Ws:()=>X,GA:()=>fe});var t=e(3841);const a={catalogPartShelfLifeVerification:[{id:"",company:"",catalog:"",catalogPartNumber:"",perMfg:"",basis:"",duration:"",customerStorageTemperature:"",partVerified:!1,receiptPartExpireDate:"",verified:!1}]},d={ghsLabelRequirements:[],specifications:[],nonConformanceCodes:[]},c={id:0,type:"",flowDown:0,description:"",reviewDate:"",catalog:"",company:""},p={id:"",date:"",link:"",type:"",name:"",company:"",delete:!1,file:void 0},A={description:{value:"",verified:!1},notes:{internal:"",external:""},flowDowns:[c]};var I=e(2697);const x={receiptData:{itemVerification:A,inboundDocuments:[p],receivedVerification:{quantity:{ordered:"",received:"",verified:!1},manufacturerLot:{value:"",verified:!1},deliveryTicket:{value:"",verified:!1}},shelfLifeBasis:{dateOfReceipt:""}},complianceChecks:d,catalogPartData:a},L={submitted:!1,current:!1};var R=e(8815),M=e(7939),B=e(4890);const u=[{name:"Receipt Data",steps:["Verify Item","Review & Categorize Inbound Documents","Verify Received","Shelf Life Basis Date"]},{name:"Compliance Checks",steps:["GHS Label Requirements","Verify Specifications","Non-Conformance Codes"]},{name:"Compliance Checks",steps:["Catalog Part Shelf Life Verification"]}],y={initialized:!1,form:x,section:0,step:0},h=(0,t.oM)({name:"qvrForm",initialState:y,reducers:{initializeQVRForm(n,l){n.initialized||(n.initialized=!0,n.form=l.payload)},setQVRForm(n,l){n.form=l.payload},setSectionAndStep(n,l){if(l.payload.section<0||l.payload.section>u.length-1)return;const f=u[l.payload.section].steps;l.payload.step<0||l.payload.step>f.length-1||(n.section=l.payload.section,n.step=l.payload.step)},setSection(n,l){l.payload<0||l.payload>u.length-1||(n.section=l.payload)},setStep(n,l){const f=u[n.section].steps;l.payload<0||l.payload>f.length-1||(n.step=l.payload)},previousStep(n){n.step>0?n.step-=1:n.section>0&&(n.section-=1,n.step=u[n.section].steps.length-1)},nextStep(n){const l=u[n.section].steps;n.step({id:crypto.randomUUID(),date:R.ou.fromMillis(K.lastModified).toISODate(),name:K.name,file:"File"}));n.form.receiptData.inboundDocuments.push(...f)},deleteDocument(n,l){const f=[...n.form.receiptData.inboundDocuments],K=f.findIndex(Ke=>Ke.id===l.payload),q=f[K];q.delete=!0,q.file!==void 0&&f.splice(K,1),n.form.receiptData.inboundDocuments=f},restoreDocument(n,l){n.form.receiptData.inboundDocuments=n.form.receiptData.inboundDocuments.map(f=>(f.id===l.payload&&(f.delete=!1),f))},setDocumentType(n,l){n.form.receiptData.inboundDocuments=n.form.receiptData.inboundDocuments.map(f=>(f.id===l.payload.id&&(f.type=l.payload.type,(0,M.E)(f.name)&&(f.name=l.payload.type)),f))},setDocumentName(n,l){n.form.receiptData.inboundDocuments=n.form.receiptData.inboundDocuments.map(f=>(f.id===l.payload.id&&(f.name=l.payload.name),f))},setDocumentCompany(n,l){n.form.receiptData.inboundDocuments=n.form.receiptData.inboundDocuments.map(f=>(f.id===l.payload.id&&(f.company=l.payload.company),f))},toggleQuantityReceivedVerified(n){n.form.receiptData.receivedVerification.quantity.verified=!n.form.receiptData.receivedVerification.quantity.verified},setManufacturerLot(n,l){n.form.receiptData.receivedVerification.manufacturerLot.value=l.payload},toggleManufacturerLotVerified(n){n.form.receiptData.receivedVerification.manufacturerLot.verified=!n.form.receiptData.receivedVerification.manufacturerLot.verified},setDeliveryTicket(n,l){n.form.receiptData.receivedVerification.deliveryTicket.value=l.payload},toggleDeliveryTicketVerified(n){n.form.receiptData.receivedVerification.deliveryTicket.verified=!n.form.receiptData.receivedVerification.deliveryTicket.verified},setDateOfReceipt(n,l){n.form.receiptData.shelfLifeBasis.dateOfReceipt=l.payload},setReceiptPartExpireDate(n,l){n.form.catalogPartData.catalogPartShelfLifeVerification=n.form.catalogPartData.catalogPartShelfLifeVerification.map(f=>(f.id===l.payload.id&&(f.receiptPartExpireDate=l.payload.date),f))},toggleReceiptPartVerified(n,l){n.form.catalogPartData.catalogPartShelfLifeVerification=n.form.catalogPartData.catalogPartShelfLifeVerification.map(f=>(f.id===l.payload&&(f.verified=!f.verified),f))},toggleGhsLabelVerified(n,l){n.form.complianceChecks.ghsLabelRequirements.includes(l.payload)?n.form.complianceChecks.ghsLabelRequirements=n.form.complianceChecks.ghsLabelRequirements.filter(f=>f!==l.payload):n.form.complianceChecks.ghsLabelRequirements=[...n.form.complianceChecks.ghsLabelRequirements,l.payload]},toggleNonConformanceCodes(n,l){const f=n.form.complianceChecks.nonConformanceCodes.findIndex(K=>K.id===l.payload);n.form.complianceChecks.nonConformanceCodes[f].isApplied=!n.form.complianceChecks.nonConformanceCodes[f].isApplied},toggleSpecifications(n,l){const f=n.form.complianceChecks.specifications.findIndex(K=>K.id===l.payload.id);n.form.complianceChecks.specifications[f].verifiedCertificates.includes(l.payload.certificate)?n.form.complianceChecks.specifications[f].verifiedCertificates=n.form.complianceChecks.specifications[f].verifiedCertificates.filter(K=>K!==l.payload.certificate):n.form.complianceChecks.specifications[f].verifiedCertificates=[...n.form.complianceChecks.specifications[f].verifiedCertificates,l.payload.certificate]}},extraReducers:n=>{n.addMatcher(B.wU.endpoints.getReceipt.matchFulfilled,(l,{payload:f})=>{T(l,f)})}}),T=(n,l)=>{n.form.complianceChecks.ghsLabelRequirements?.length===0&&(n.form.complianceChecks.ghsLabelRequirements=l.quality?.ghsLabels.verified??[]),n.form.complianceChecks.nonConformanceCodes?.length===0&&(n.form.complianceChecks.nonConformanceCodes=l.quality?.nonConformanceCodes??[]),n.form.complianceChecks.specifications?.length===0&&(n.form.complianceChecks.specifications=l.quality?.specifications.map(f=>({id:f.purchasedSpecification.specificationRef.id,verifiedCertificates:f.latestVerifiedCertificates??[]}))??[])},{initializeQVRForm:D,setQVRForm:U,setSection:z,setStep:V,setSectionAndStep:W,previousStep:k,nextStep:Oe,toggleDescriptionVerified:oe,setInternalNote:Le,setExternalNote:ge,uploadDocuments:fe,deleteDocument:be,restoreDocument:Ze,setDocumentType:Ue,setDocumentName:Fe,setDocumentCompany:Ne,toggleQuantityReceivedVerified:Be,setManufacturerLot:We,toggleManufacturerLotVerified:he,setDeliveryTicket:$,toggleDeliveryTicketVerified:Ge,setDateOfReceipt:ye,setReceiptPartExpireDate:we,toggleReceiptPartVerified:ve,toggleGhsLabelVerified:Ve,toggleNonConformanceCodes:ze,toggleSpecifications:X}=h.actions,xe=h.reducer},5927:(C,m,e)=>{"use strict";e.d(m,{Lc:()=>d,qJ:()=>r,sA:()=>t,vB:()=>a});const t={InReceiving:"In Receiving",QaReady:"QA Ready",SentForReimaging:"Sent for Reimaging",PutAwayReady:"Put Away Ready"},r=[t.InReceiving,t.QaReady,t.SentForReimaging,t.PutAwayReady],a={All:"All",MyAssignments:"My Assignments",Unassigned:"Unassigned"},d=[a.All,a.MyAssignments,a.Unassigned]},137:(C,m,e)=>{"use strict";e.d(m,{$9:()=>I,Bu:()=>v,Ow:()=>p,RM:()=>A,ZP:()=>B,_e:()=>N,co:()=>M,ei:()=>R,kA:()=>S,lA:()=>L,n0:()=>x,pg:()=>c});var t=e(3841),r=e(5927);const a={operatingEntity:{selected:"",error:!1},distributionCenter:{selected:"",error:!1,inventoryGroups:{selected:[]}},statuses:{selected:[],error:!1},assignment:{selected:r.vB.All,error:!1},receiptIdSearchValue:void 0},d=(0,t.oM)({name:"inboundQuality",initialState:a,reducers:{setOperatingEntity:(u,y)=>({...u,operatingEntity:{...u.operatingEntity,selected:y.payload,error:!1},distributionCenter:{...u.distributionCenter,selected:"",inventoryGroups:{...u.distributionCenter.inventoryGroups}}}),setDistributionCenter:(u,y)=>({...u,distributionCenter:{...u.distributionCenter,selected:y.payload,error:!1,inventoryGroups:{...u.distributionCenter.inventoryGroups}}}),setInventoryGroups:(u,y)=>{u.distributionCenter.inventoryGroups.selected=y.payload},setStatuses:(u,y)=>{u.statuses.selected=y.payload,u.statuses.error=!1},setAssignment:(u,y)=>{u.assignment.selected=y.payload,u.assignment.error=!1},setReceiptIdSearchValue:(u,y)=>{u.receiptIdSearchValue=y.payload,u.isReceiptIdSearch=!0},setOperatingEntityError:(u,y)=>{u.operatingEntity.error=y.payload},setDistributionCenterError:(u,y)=>{u.distributionCenter.error=y.payload},setStatusesError:(u,y)=>{u.statuses.error=y.payload},setIsReceiptIdSearch:(u,y)=>{u.isReceiptIdSearch=y.payload},setReceiptIdSearchError:(u,y)=>{u.isReceiptIdSearchError=y.payload}}}),{setOperatingEntity:c,setDistributionCenter:p,setInventoryGroups:A,setStatuses:I,setAssignment:v,setReceiptIdSearchValue:S,setOperatingEntityError:N,setDistributionCenterError:x,setStatusesError:L,setIsReceiptIdSearch:R,setReceiptIdSearchError:M}=d.actions,B=d.reducer},5029:(C,m,e)=>{"use strict";e.d(m,{CB:()=>S,Mi:()=>I,Ov:()=>v,Uv:()=>c,ZP:()=>N,ht:()=>p,o4:()=>A,y8:()=>d});var t=e(3841);const r={personnelId:null,companies:[],selectedCompanyId:null,isInitialized:!1,initError:null},a=(0,t.oM)({name:"session",initialState:r,reducers:{setPersonnelId(x,L){x.personnelId=L.payload},setCompanies(x,L){x.companies=L.payload,x.isInitialized=!0},setSelectedCompany(x,L){x.selectedCompanyId=L.payload.companyId},setInitializationError(x,L){x.initError=L.payload,x.isInitialized=!0},clearInitError(x){x.initError=null},clearSession(x){x.personnelId=null,x.companies=[],x.selectedCompanyId=null,x.isInitialized=!1,x.initError=null}}}),{setPersonnelId:d,setCompanies:c,setSelectedCompany:p,setInitializationError:A,clearInitError:I,clearSession:v}=a.actions,S=x=>{const{selectedCompanyId:L,companies:R}=x.session;return L?R.find(M=>M.companyId===L)??null:null},N=a.reducer},1732:(C,m,e)=>{"use strict";e.d(m,{h:()=>r});function t(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function r(a){const d={};return t(a)&&(typeof a.name=="string"&&(d.name=a.name),typeof a.message=="string"&&(d.message=a.message),(typeof a.code=="string"||typeof a.code=="number")&&(d.code=a.code),(typeof a.errorCode=="string"||typeof a.errorCode=="number")&&(d.errorCode=a.errorCode),typeof a.status=="number"&&(d.status=a.status),a.data!==void 0&&(d.data=a.data,t(a.data)&&typeof a.data.message=="string"&&(d.dataMessage=a.data.message))),d}},7939:(C,m,e)=>{"use strict";e.d(m,{E:()=>t});const t=r=>!r||r.trim().length===0},1386:(C,m,e)=>{"use strict";e.d(m,{Cv:()=>r,H:()=>d,Ki:()=>a});const t=window.location.host.startsWith("localhost"),r=(...c)=>{t&&console.log(...c)},a=(...c)=>{t&&console.warn(...c)},d=(...c)=>{console.error(...c)}},2071:(C,m,e)=>{var t={"./ar_AE/translation.json":[6611,611],"./de_DE/translation.json":[9061,61],"./en_GB/translation.json":[9758,758],"./en_US/translation.json":[5916,916],"./fr_FR/translation.json":[6606,606],"./it_IT/translation.json":[1640,640],"./pl_PL/translation.json":[4778,778],"./tr_TR/translation.json":[6908,908],"./zh_CN/translation.json":[9871,871]};function r(a){if(!e.o(t,a))return Promise.resolve().then(()=>{var p=new Error("Cannot find module '"+a+"'");throw p.code="MODULE_NOT_FOUND",p});var d=t[a],c=d[0];return e.e(d[1]).then(()=>e.t(c,19))}r.keys=()=>Object.keys(t),r.id=2071,C.exports=r},7150:(C,m,e)=>{"use strict";C.exports=e.p+"bffc5e001d7d9eab09d5.png"}},C=>{var m=t=>C(C.s=t);C.O(0,[363,328,216],()=>m(7589));var e=C.O()}]);})();