1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3963],{2154:(e,t,l)=>{l.d(t,{A:()=>s});let s={done:"Done",selectDepartment:"Select department",fullCatalogLabel:"Full catalog",restrictedCatalogLabel:"Company specific catalog",fullCatalogDescription:"View the entire product catalog, including all departments.",departments:"Departments",allDepartmentsOption:{id:"all-departments",name:"All Departments"},catalogAccessLabel:{restricted:"Has access to company specific catalog",full:"Has access to full catalog"}}},5235:(e,t,l)=>{l.d(t,{A:()=>c});var s=l(95155),n=l(12115),a=l(12758),o=l.n(a),i=l(27599),r=l(55290);let d=n.forwardRef((e,t)=>{let{className:l="",...n}=e;return(0,s.jsx)(i.bL,{className:(e=>{let{checked:t,disabled:l,className:s}=e;return(0,r.Ay)("focus-visible:ring-ring focus-visible:ring-offset-background disabled:bg-neutral-300 disabled:!border-neutral-600 data-[state=unchecked]:bg-input peer inline-flex h-[24px] w-[48px] shrink-0 cursor-pointer items-center rounded-full border-2 border-neutral-700 bg-white shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed data-[state=checked]:border-blue data-[state=checked]:bg-blue",t&&l?"!bg-neutral-600":"",s)})({className:l,...n}),...n,ref:t,children:(0,s.jsx)(i.zi,{className:(e=>{let{disabled:t,checked:l}=e;return(0,r.Ay)("pointer-events-none block h-4 w-4 rounded-full bg-neutral-700 shadow-lg ring-0 transition-transform","data-[state=checked]:translate-x-[26px] data-[state=unchecked]:translate-x-0.5 data-[state=checked]:bg-white",{"!bg-neutral-600":t,"!bg-neutral-300":l&&t})})(n)})})});d.displayName=i.bL.displayName,d.propTypes={className:o().string,checked:o().bool,disabled:o().bool};let c=d},9100:(e,t,l)=>{l.d(t,{A:()=>c});var s=l(95155);l(12115);var n=l(12758),a=l.n(n),o=l(39017),i=l.n(o),r=l(55290);let d=e=>{let{searchWords:t,textToHighlight:l,highlightClassName:n="",autoEscape:a,className:o}=e;return(0,s.jsx)(i(),{highlightClassName:(0,r.Ay)("bg-transparent font-bold",n),searchWords:t,autoEscape:a,className:o,textToHighlight:l})};d.propTypes={searchWords:a().arrayOf(a().string).isRequired,textToHighlight:a().string.isRequired,highlightClassName:a().string,autoEscape:a().bool,className:a().string};let c=d},21943:(e,t,l)=>{l.d(t,{A:()=>d});var s=l(95155);l(12115);var n=l(12758),a=l.n(n),o=l(67219),i=l.n(o);function r(e){let{width:t="5",height:l="10",fill:n=i().theme.extend.colors.neutral[700]}=e;return(0,s.jsx)("svg",{width:t,height:l,viewBox:"0 0 5 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"left-chevron-section",children:(0,s.jsx)("path",{d:"M3.46667 8.401L0.09 4.743C-0.03 4.61267 -0.03 4.38533 0.09 4.255L3.46667 0.599333C3.526 0.535333 3.604 0.5 3.68667 0.5C3.76967 0.5 3.84767 0.535333 3.90667 0.599C3.967 0.664 4 0.750667 4 0.843C4 0.935333 3.967 1.02167 3.90667 1.08667L0.754333 4.49767L3.906 7.91033C4.02533 8.04067 4.02533 8.271 3.906 8.40133C3.84833 8.46533 3.77067 8.5 3.688 8.5C3.60433 8.5 3.526 8.46533 3.46667 8.401Z",fill:n})})}r.propTypes={width:a().string,height:a().string,fill:a().string};let d=r},24887:(e,t,l)=>{l.d(t,{A:()=>c});var s=l(95155);l(12115);var n=l(12758),a=l.n(n),o=l(55290),i=l(67219),r=l.n(i);let d=e=>{let{width:t="60",height:l="59",color:n=r().theme.extend.colors.primary.blue[500],className:a,containerClass:i,testId:d=""}=e;return(0,s.jsx)("div",{className:(0,o.Ay)("flex h-full w-full items-center justify-center",i),"data-testid":d,children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:l,viewBox:"0 0 60 59",fill:"none",className:(0,o.Ay)("h-12 w-12 animate-spin",a),children:(0,s.jsx)("path",{d:"M52.2457 23.4411C53.423 27.835 53.271 32.4795 51.8088 36.787C50.3466 41.0946 47.6398 44.8718 44.0309 47.641C40.4219 50.4103 36.0729 52.0471 31.5336 52.3447C26.9944 52.6422 22.4689 51.587 18.5294 49.3125C14.5899 47.038 11.4133 43.6464 9.4013 39.5665C7.38935 35.4867 6.63238 30.9019 7.22614 26.3918C7.8199 21.8817 9.73772 17.649 12.7371 14.2289C15.7364 10.8089 19.6826 8.35497 24.0765 7.17761",stroke:n,strokeWidth:"2",strokeLinecap:"round"})})})};d.propTypes={width:a().string,height:a().string,color:a().string,className:a().string,containerClass:a().string,testId:a().string};let c=d},31862:(e,t,l)=>{l.d(t,{A:()=>v});var s=l(95155),n=l(12115),a=l(12758),o=l.n(a),i=l(87509),r=l(14113),d=l(29909),c=l(24887),u=l(87440),p=l(1400),h=l(43181),m=l(35547);let x=[],g=e=>e.customerId,f=e=>{var t,l,a,o,f,v,A,b;let{subAccountDetails:y,customerId:w,filter:C,parentFilter:S,parentAccountObject:T,setSelectedParentId:j,onAddressContainerClick:N,selectedId:I,onValueChangeRadioGroup:E,isSubAccountFetchingLoading:L,selectedIds:k,onCheckboxClick:R,showAddress:D=!0,view:_="",virtualizeThreshold:O=r.$O}=e,F=(0,n.useDeferredValue)(C),H=(0,i.A)((null==y?void 0:y[w])||x,C,e=>e),z=T.customerId,B=(0,n.useCallback)(e=>{j(z),N(e)},[j,N,z]),U=(0,n.useCallback)(e=>{j(e),N(e)},[j,N]),M=R?"".concat(d.A.subAccount,"(").concat(null==H?void 0:H.length,")"):"".concat(d.A.subAccount),P=y&&(null==(t=y[w])?void 0:t.length),V=null!=(o=null==H?void 0:H.length)?o:0,K=V>O,G=(0,n.useCallback)((e,t)=>{var l;return(0,s.jsx)(m.A,{customerId:e.customerId,parentId:w,id:e.customerId,customerName:(null==(l=e.shipToAddressName)?void 0:l.toLowerCase())||e.customerName,addressL1:e.shipToAddressLine1,state:e.shipToState,city:e.shipToCity,zipCode:e.shipToZipCode,filterValue:F,billable:e.billable,selectedIds:k,onCheckboxClick:R,checkbox:!!R,showAddress:D,onAddressContainerClick:B,subAccountsCount:P,accountStatus:null==e?void 0:e.status,department:null==e?void 0:e.department,view:_,ariaSetSize:K?V:void 0,ariaPosInSet:K?t+1:void 0,child:!0},e.customerId)},[w,F,k,R,D,B,P,_,K,V]),Z=(0,n.useMemo)(()=>
1{if(!K)return[];let e=H.findIndex(e=>e.customerId===I);return -1===e?[]:[e]},[K,H,I]),q=null;y[w]&&H&&(q=K?(0,s.jsx)(h.A,{items:H,renderItem:G,getItemKey:g,stickyIndexes:Z,testId:"sub-account-virtual-list",resetScrollKey:F,className:"max-h-[60vh] min-h-[280px] -mr-2 pr-2"}):H.map(G));let W=(null==H?void 0:H.length)===0&&C.length>0?(0,s.jsx)(p.A,{className:"mt-4",children:d.A.noResultForFilterText}):q;return(0,s.jsxs)(u.z6,{className:"gap-y-0","data-testid":"sub-account-details-component",value:I,onValueChange:E,loop:!K,children:[(0,s.jsx)(m.A,{customerId:T.customerId,parentId:w,id:T.customerId,customerName:T.customerName,billable:T.billable,addressL1:null!=(f=T.shipToAddressLine1)?f:"",state:null!=(v=T.shipToState)?v:"",city:null!=(A=T.shipToCity)?A:"",filterValue:S,zipCode:null!=(b=T.shipToZipCode)?b:"",selectedIds:k,onCheckboxClick:R,checkbox:!!R,showAddress:D,subAccountsCount:P,onAddressContainerClick:U,parent:T.childAccountExists&&(null==(l=y[w])?void 0:l.length)>0,accountStatus:T.status,department:T.department,view:_}),T.childAccountExists&&(null==(a=y[w])?void 0:a.length)>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.A,{className:"mt-4 text-sm font-bold text-neutral-700",children:M}),L?(0,s.jsx)("div",{className:"flex h-[20vh] w-full items-center justify-center","data-testid":"account-selector-flyout-loader",children:(0,s.jsx)(c.A,{className:"h-16 w-16"})}):W]})]})},v=f;f.propTypes={setSelectedParentId:o().func,onAddressContainerClick:o().func,subAccountDetails:o().object,onValueChangeRadioGroup:o().func,parentAccountObject:o().object,selectedId:o().string,customerId:o().string,filter:o().string,parentFilter:o().string,isSubAccountFetchingLoading:o().bool,selectedIds:o().array,onCheckboxClick:o().func,showAddress:o().bool,view:o().string,virtualizeThreshold:o().number}},33810:(e,t,l)=>{l.d(t,{A:()=>c});var s=l(95155);l(12115);var n=l(12758),a=l.n(n),o=l(28256),i=l(67219),r=l.n(i);let d=e=>{let{width:t="16",height:l="16",fill:n=r().theme.extend.colors.neutral["700"],className:a}=e,i=r().theme.extend.colors.blue,d=r().theme.extend.colors.primary.blue[500],c=Number(l||t);return(0,s.jsx)(o.J,{className:a,name:"info",size:c,style:{color:n===i?d:n}})};d.propTypes={width:a().string,height:a().string,fill:a().string,className:a().string};let c=d},36019:(e,t,l)=>{l.d(t,{Ay:()=>u,Wv:()=>r,rw:()=>c});var s=l(59267),n=l(11096),a=l(37235);let{productSegmentUrl:o}=n.A.products,i=async(e,t)=>{try{let l={Authorization:"Bearer ".concat(e.accessToken),"Content-Type":"application/json"};e.customToken&&(l.customtoken=e.customToken);let s=await (0,a.iq)(o,l,t);return null==s?void 0:s.data}catch(e){throw{code:"INTERNAL_SERVER_ERROR",message:"getAccountCatalogs Failure",info:"",errors:""}}},r=(0,s.zD)("product-segment/fetchAccountCatalogs",async(e,t)=>{let{accountId:l}=e,{getState:s,rejectWithValue:n}=t;try{let e=s();return await i(e.auth.tokens,{accountId:l})}catch(e){return n(e)}}),d=(0,s.Z0)({name:"product-segment",initialState:{data:null,loading:!1,error:null,hasRestrictedCatalog:!1,selectedAccountHasRestrictedCatalog:!1},reducers:{setHasRestrictedCatalog:(e,t)=>{e.hasRestrictedCatalog=t.payload}},extraReducers:e=>{e.addCase(r.pending,e=>{e.loading=!0,e.data=null,e.error=null}).addCase(r.fulfilled,(e,t)=>{var l,s,n,a,o;e.loading=!1,e.data=null==(l=t.payload)?void 0:l.data,e.hasRestrictedCatalog=(null==(s=t.payload)?void 0:s.total_results)>0,(null==(a=t.meta)||null==(n=a.arg)?void 0:n.isSelectedAccount)&&(e.selectedAccountHasRestrictedCatalog=(null==(o=t.payload)?void 0:o.total_results)>0)}).addCase(r.rejected,(e,t)=>{e.loading=!1,e.error=t.payload})}}),{setHasRestrictedCatalog:c}=d.actions,u=d.reducer},36593:(e,t,l)=>{l.d(t,{Ay:()=>r,LU:()=>d});var s=l(93031),n=l(66525),a=l(49292),o=l(87500);let i=e=>"object"==typeof e&&null!==e&&"consent_status"===e.event,r=e=>{let{UI_CLICK_EVENT:t}=s.A,{track:l}=n.A,{event:i=t}=e;(0,a.A)()?(0,o.Ay)(i,e):l(i,e)},d=e=>{let t,l=!1,s=()=>{l||((()=>{if(!Array.isArray(window.dataLayer))return!1;let e=[...window.dataLayer].reverse().find(i);return(null==e?void 0:e["Google Analytics"])===!0})()?e():t=setTimeout(s,200))};return s(),()=>{l=!0,t&&clearTimeout(t)}}},39721:(e,t,l)=>{l.d(t,{A:()=>a});var s=l(12115),n=l(1213);let a=(e,t)=>{let l=(0,n.d4)(e=>e.account);return(0,s.useMemo)(()=>{var s;if(!(null==l?void 0:l.subAccountDetails))return t;let[n]=Object.values(l.subAccountDetails),a=null==n?void 0:n.find(t=>{let{customerId:l}=t;return l===e});return null==a||null==(s=a.shipToAddressName)?void 0:s.toLowerCase()},[e,t,null==l?void 0:l.subAccountDetails])||t}},41921:(e,t,l)=>{l.d(t,{A:()=>x});var s=l(95155),n=l(12115),a=l(12758),o=l.n(a),i=l(14113),r=l(87440),d=l(43181),c=l(35547);let u=()=>{},p={},h=e=>e.customerId,m=e=>{let{selectedId:t,setSelectedId:l,searchResult:a,filterValue:o,setSelectedParentId:m=u,selectedIds:x=p,onCheckboxClick:g,handleAccordionSelect:f=u,getShippingAddressesOnSearchOrAccountChange:v=u,view:A="",virtualizeThreshold:b=i.$O}=e,y=(0,n.useCallback)(e=>{let s=a.find(t=>t.customerId===e);
1s.parentId?(m(s.parentId),f(s.parentId)):(m(e),f(e)),t!==e&&(v(e),l(e))},[a,t,l,m,f,v]),w=a.length,C=w>b,S=(0,n.useCallback)((e,t)=>{let{customerId:l,parentId:n,department:a,customerName:i,shipToAddressLine1:r,shipToAddressName:d,shipToState:u,shipToZipCode:p,shipToCity:h,billable:m,isParent:f}=e,v=Object.keys(x).includes(l);return(0,s.jsx)(c.A,{checkbox:!!g,customerId:l,parentId:v?l:n,id:l,customerName:n?null==d?void 0:d.toLowerCase():i,addressL1:null!=r?r:"",state:null!=u?u:"",billable:m,zipCode:null!=p?p:"",city:null!=h?h:"",filterValue:o,selectedIds:x,onCheckboxClick:g,onAddressContainerClick:y,parent:v,child:!v,department:a,view:A,ariaSetSize:C?w:void 0,ariaPosInSet:C?t+1:void 0,showParentBadge:f},l)},[x,g,o,y,A,C,w]),T=(0,n.useMemo)(()=>{if(!C)return[];let e=a.findIndex(e=>e.customerId===t);return -1===e?[]:[e]},[C,a,t]);return(0,s.jsx)(r.z6,{className:"gap-y-0",value:t,loop:!C,children:C?(0,s.jsx)(d.A,{items:a,renderItem:S,getItemKey:h,stickyIndexes:T,testId:"search-result-virtual-list",resetScrollKey:o,className:"max-h-[60vh] min-h-[280px] -mr-2 pr-2"}):a.map(S)})},x=m;m.propTypes={selectedId:o().string.isRequired,selectedIds:o().object,onCheckboxClick:o().func,setSelectedId:o().func.isRequired,searchResult:o().array.isRequired,filterValue:o().string.isRequired,setSelectedParentId:o().func,handleAccordionSelect:o().func,getShippingAddressesOnSearchOrAccountChange:o().func,view:o().string,virtualizeThreshold:o().number}},43181:(e,t,l)=>{l.d(t,{A:()=>h});var s=l(95155),n=l(12115),a=l(77859),o=l(63997),i=l(12758),r=l.n(i),d=l(55290),c=l(14113);let u=[],p=e=>{let{items:t,renderItem:l,getItemKey:i,stickyIndexes:r=u,estimateSize:p=c.kH,overscan:h=c.$3,className:m="",testId:x="virtual-list",resetScrollKey:g,onEndReached:f,endReachedThreshold:v=5,footer:A=null}=e,b=(0,n.useRef)(null),y=(0,n.useCallback)(()=>b.current,[]),w=(0,n.useCallback)(()=>p,[p]),C=(0,n.useCallback)(e=>i?i(t[e],e):e,[i,t]),S=(0,n.useMemo)(()=>[...new Set(r)].filter(e=>e>=0).sort((e,t)=>e-t),[r]),T=(0,n.useCallback)(e=>{let t=(0,a.vp)(e);return 0===S.length?t:[...new Set([...S,...t])].sort((e,t)=>e-t)},[S]),j=(0,o.Te)({count:t.length,getScrollElement:y,estimateSize:w,overscan:h,getItemKey:C,rangeExtractor:T}),N=(0,n.useCallback)(e=>{e&&j.measureElement(e)},[j]),I=(0,n.useRef)(!0);(0,n.useEffect)(()=>{if(I.current){I.current=!1;return}j.scrollToOffset(0)},[g]);let E=j.getVirtualItems();return(0,n.useEffect)(()=>{f&&0!==t.length&&0!==E.length&&E[E.length-1].index>=t.length-1-v&&f()},[E,t.length,f,v]),(0,s.jsxs)("div",{ref:b,"data-testid":x,className:(0,d.Ay)("overflow-y-auto overscroll-contain",m),children:[(0,s.jsx)("div",{className:"relative w-full",style:{height:"".concat(j.getTotalSize(),"px")},children:E.map(e=>(0,s.jsx)("div",{"data-index":e.index,ref:N,className:"absolute left-0 top-0 w-full",style:{transform:"translateY(".concat(e.start,"px)")},children:l(t[e.index],e.index)},e.key))}),A]})},h=p;p.propTypes={items:r().array.isRequired,renderItem:r().func.isRequired,getItemKey:r().func,stickyIndexes:r().arrayOf(r().number),estimateSize:r().number,overscan:r().number,className:r().string,testId:r().string,resetScrollKey:r().oneOfType([r().string,r().number]),onEndReached:r().func,endReachedThreshold:r().number,footer:r().node}},53657:(e,t,l)=>{l.d(t,{Ay:()=>r,oD:()=>a,s5:()=>i});var s=l(59267),n=l(26958);let a=(0,s.zD)("subAccounts/getSubAccountDetails",async(e,t)=>{let{getState:l}=t,{accessToken:s,customToken:a}=l().auth.tokens;return(await (0,n.A)(s,a)).data}),o=(0,s.Z0)({name:"subAccounts",initialState:{subAccountsData:[],error:null,isSubAccountLoading:!1},reducers:{clearSubAccountStore(e){e.subAccountsData=[]}},extraReducers:e=>{e.addCase(a.pending,e=>{e.isSubAccountLoading=!0}).addCase(a.fulfilled,(e,t)=>{e.subAccountsData=t.payload.map(e=>{var t,l,s,n;let{id:a,name:o,doNotShip:i,address:{address1:r,address2:d,city:c,state:u,zip:p,country:h,shipToAddressName:m},billingAddress:x,billable:g}=e;return{doNotShip:i,customerId:null==a?void 0:a.toUpperCase(),customerName:null==o?void 0:o.toLowerCase(),shipToAddressLine1:null==r?void 0:r.toLowerCase(),shipToAddressLine2:null==d?void 0:d.toLowerCase(),shipToAddressName:null==m?void 0:m.toLowerCase(),shipToCity:null==c?void 0:c.toLowerCase(),shipToState:u,shipToZipCode:p,shipToCountry:null==h?void 0:h.toLowerCase(),billingAddress:{billToAddressLine1:null==x||null==(t=x.addressLine1)?void 0:t.toLowerCase(),billToAddressLine2:null==x||null==(l=x.addressLine2)?void 0:l.toLowerCase(),billToAddressLine3:null==x||null==(s=x.addressLine3)?void 0:s.toLowerCase(),billToCity:null==x||null==(n=x.city)?void 0:n.toLowerCase(),billToCountry:null==x?void 0:x.country,billToState:null==x?void 0:x.state,billToZipCode:null==x?void 0:x.zipCode},billable:g}}),e.isSubAccountLoading=!1}),e.addCase(a.rejected,(e,t)=>{e.error=t.payload,e.isSubAccountLoading=!1})}}
1),{clearSubAccountStore:i}=o.actions,r=o.reducer},63071:(e,t,l)=>{l.d(t,{A:()=>c});var s=l(95155);l(12115);var n=l(12758),a=l.n(n),o=l(14113),i=l(29909),r=l(82109);let d=e=>{let{billable:t,className:l="shrink-0"}=e;return null==t?null:(0,s.jsx)(r.A,{variant:t?o.Ay.STATUSES.BILLABLE:o.Ay.STATUSES.NON_BILLABLE,className:l,children:t?i.A.billable:i.A.nonBillable})};d.propTypes={billable:a().bool,className:a().string};let c=d},63587:(e,t,l)=>{l.d(t,{A:()=>c});var s=l(95155);l(12115);var n=l(12758),a=l.n(n),o=l(28256),i=l(67219),r=l.n(i);let d=e=>{let{onClick:t,className:l,width:n="24",height:a="24",fill:i=r().theme.extend.colors.primary.blue[500],testId:d="three-dots-icon",orientation:c="vertical"}=e,u=r().theme.extend.colors.blue,p=r().theme.extend.colors.primary.blue[500],h=Number(a||n);return(0,s.jsx)(o.J,{onClick:t,className:l,name:"more",size:h,style:{color:i===u?p:i,transform:"vertical"===c?"rotate(90deg)":void 0},"data-testid":d})};d.propTypes={className:a().string,height:a().string,width:a().string,fill:a().string,testId:a().string,onClick:a().func,orientation:a().oneOf(["vertical","horizontal"])};let c=d},64337:(e,t,l)=>{l.d(t,{A:()=>d});var s=l(95155);l(12115);var n=l(12758),a=l.n(n),o=l(67219),i=l.n(o);function r(e){let{width:t="24",height:l="24",fill:n=i().theme.extend.colors.primary.blue[500],stroke:a=i().theme.extend.colors.white}=e;return(0,s.jsxs)("svg",{"data-testid":"radioIcon",xmlns:"http://www.w3.org/2000/svg",width:t,height:l,viewBox:"0 0 24 24",fill:n,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"11",fill:n,stroke:a,strokeWidth:"2"}),(0,s.jsx)("circle",{cx:"12",cy:"12",r:"8",fill:n})]})}r.propTypes={width:a().string,height:a().string,fill:a().string,stroke:a().string};let d=r},72431:(e,t,l)=>{l.d(t,{RG:()=>y,bL:()=>L,q7:()=>k});var s=l(12115),n=l(92556),a=l(88167),o=l(94446),i=l(3468),r=l(68946),d=l(97602),c=l(70222),u=l(23558),p=l(66218),h=l(95155),m="rovingFocusGroup.onEntryFocus",x={bubbles:!1,cancelable:!0},g="RovingFocusGroup",[f,v,A]=(0,a.N)(g),[b,y]=(0,i.A)(g,[A]),[w,C]=b(g),S=s.forwardRef((e,t)=>(0,h.jsx)(f.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(f.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(T,{...e,ref:t})})}));S.displayName=g;var T=s.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:l,orientation:a,loop:i=!1,dir:r,currentTabStopId:f,defaultCurrentTabStopId:A,onCurrentTabStopIdChange:b,onEntryFocus:y,preventScrollOnEntryFocus:C=!1,...S}=e,T=s.useRef(null),j=(0,o.s)(t,T),N=(0,p.jH)(r),[I,L]=(0,u.i)({prop:f,defaultProp:null!=A?A:null,onChange:b,caller:g}),[k,R]=s.useState(!1),D=(0,c.c)(y),_=v(l),O=s.useRef(!1),[F,H]=s.useState(0);return s.useEffect(()=>{let e=T.current;if(e)return e.addEventListener(m,D),()=>e.removeEventListener(m,D)},[D]),(0,h.jsx)(w,{scope:l,orientation:a,dir:N,loop:i,currentTabStopId:I,onItemFocus:s.useCallback(e=>L(e),[L]),onItemShiftTab:s.useCallback(()=>R(!0),[]),onFocusableItemAdd:s.useCallback(()=>H(e=>e+1),[]),onFocusableItemRemove:s.useCallback(()=>H(e=>e-1),[]),children:(0,h.jsx)(d.sG.div,{tabIndex:k||0===F?-1:0,"data-orientation":a,...S,ref:j,style:{outline:"none",...e.style},onMouseDown:(0,n.mK)(e.onMouseDown,()=>{O.current=!0}),onFocus:(0,n.mK)(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!k){let t=new CustomEvent(m,x);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=_().filter(e=>e.focusable);E([e.find(e=>e.active),e.find(e=>e.id===I),...e].filter(Boolean).map(e=>e.ref.current),C)}}O.current=!1}),onBlur:(0,n.mK)(e.onBlur,()=>R(!1))})})}),j="RovingFocusGroupItem",N=s.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:l,focusable:a=!0,active:o=!1,tabStopId:i,children:c,...u}=e,p=(0,r.B)(),m=i||p,x=C(j,l),g=x.currentTabStopId===m,A=v(l),{onFocusableItemAdd:b,onFocusableItemRemove:y,currentTabStopId:w}=x;return s.useEffect(()=>{if(a)return b(),()=>y()},[a,b,y]),(0,h.jsx)(f.ItemSlot,{scope:l,id:m,focusable:a,active:o,children:(0,h.jsx)(d.sG.span,{tabIndex:g?0:-1,"data-orientation":x.orientation,...u,ref:t,onMouseDown:(0,n.mK)(e.onMouseDown,e=>{a?x.onItemFocus(m):e.preventDefault()}),onFocus:(0,n.mK)(e.onFocus,()=>x.onItemFocus(m)),onKeyDown:(0,n.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void x.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,l){var s;let n=(s=e.key,"rtl"!==l?s:"ArrowLeft"===s?"ArrowRight":"ArrowRight"===s?"ArrowLeft":s);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return I[n]}(e,x.orientation,x.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let l=A().filter(e=>
1e.focusable).map(e=>e.ref.current);if("last"===t)l.reverse();else if("prev"===t||"next"===t){"prev"===t&&l.reverse();let s=l.indexOf(e.currentTarget);l=x.loop?function(e,t){return e.map((l,s)=>e[(t+s)%e.length])}(l,s+1):l.slice(s+1)}setTimeout(()=>E(l))}}),children:"function"==typeof c?c({isCurrentTabStop:g,hasTabStop:null!=w}):c})})});N.displayName=j;var I={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function E(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=document.activeElement;for(let s of e)if(s===l||(s.focus({preventScroll:t}),document.activeElement!==l))return}var L=S,k=N},73363:(e,t,l)=>{l.d(t,{A:()=>g});var s=l(95155),n=l(12115),a=l(12758),o=l.n(a),i=l(85408),r=l(87440),d=l(1400),c=l(9100),u=l(86447);let p=e=>{let{allShippingAddress:t,onSelected:l,selectedAddress:n,className:a,selectedShippingObject:o,addressFilter:p="",radioContainerClassName:h}=e;return(0,s.jsx)(r.z6,{className:"flex flex-col gap-4 overflow-auto ".concat(h),onValueChange:l,children:null==t?void 0:t.map(e=>{var t,l;let{shippingAddress:h}=e,{shipToId:m,address1:x,address2:g,address3:f,city:v,state:A,zip:b,name:y}=h;return(0,s.jsxs)("article",{className:"".concat(a," ").concat(function(e){let{selectedShippingObj:t,selectedAddr:l,shipToId:s,name:n,zip:a}=e;return(t?t.shipToAddressId===s&&t.shipToAddressName===n.toLowerCase()&&t.shipToZipCode===a:l===s)?"border-blue":""}({selectedShippingObj:o,selectedAddr:n,shipToId:m,name:y,zip:b})),"data-testid":"address-container",children:[(0,s.jsx)(r.CU,{value:m,checked:function(e){let{selectedShippingObj:t,selectedAddr:l,shipToId:s,name:n,zip:a}=e;return t?t.shipToAddressId===s&&t.shipToAddressName===n.toLowerCase()&&t.shipToZipCode===a:l===s}({selectedShippingObj:o,selectedAddr:n,shipToId:m,name:y,zip:b}),id:m,className:"mt-[2px]"}),(null==p?void 0:p.length)>1?(0,s.jsx)(i.J,{htmlFor:m,className:"w-full hover:cursor-pointer",children:(0,s.jsxs)("section",{className:"flex flex-col text-sm capitalize",children:[(0,s.jsx)(c.A,{className:"font-bold",searchWords:p.split(" "),autoEscape:!0,textToHighlight:null==(t=(0,u.Q)(y))?void 0:t.toLowerCase()}),(0,s.jsx)(c.A,{searchWords:p.split(" "),autoEscape:!0,textToHighlight:null==x?void 0:x.toLowerCase()}),(0,s.jsx)(c.A,{searchWords:p.split(" "),autoEscape:!0,textToHighlight:null==g?void 0:g.toLowerCase()}),(0,s.jsx)(c.A,{searchWords:p.split(" "),autoEscape:!0,textToHighlight:null==f?void 0:f.toLowerCase()}),(0,s.jsx)(c.A,{testId:"city-state-zip",searchWords:p.split(" "),autoEscape:!0,textToHighlight:"".concat(v.toLowerCase(),", ").concat(A.toUpperCase()," ").concat(b)})]})}):(0,s.jsx)(i.J,{htmlFor:m,className:"w-full hover:cursor-pointer",children:(0,s.jsxs)("section",{className:"text-sm",children:[(0,s.jsx)(d.A,{className:"font-bold capitalize",children:null==(l=(0,u.Q)(y))?void 0:l.toLowerCase()}),(0,s.jsx)(d.A,{className:"capitalize",children:null==x?void 0:x.toLowerCase()}),(0,s.jsx)(d.A,{className:"capitalize",children:null==g?void 0:g.toLowerCase()}),(0,s.jsx)(d.A,{className:"capitalize",children:null==f?void 0:f.toLowerCase()}),(0,s.jsxs)(d.A,{className:"capitalize",testId:"city-state-zip",children:[null==v?void 0:v.toLowerCase(),",\xa0",(0,s.jsx)("span",{className:"uppercase",children:A}),"\xa0",b]})]})})]})})})};p.propTypes={allShippingAddress:o().arrayOf(o().shape({shippingAddress:o().shape({shipToId:o().number,address1:o().string,address2:o().string,city:o().string,state:o().string,zip:o().string})})).isRequired,onSelected:o().func.isRequired,selectedAddress:o().string,className:o().string,selectedShippingObject:o().object,addressFilter:o().string,radioContainerClassName:o().string};var h=l(87509),m=l(29909);let x=e=>{let{addressFilter:t,shippingAddress:l,handleSelectAddress:a,selectedShippingObject:o,selectedAddress:i,className:r,setHasSearchResults:c,radioContainerClassName:u}=e,x=(0,n.useDeferredValue)(t),g=(0,h.A)(l,t,e=>e.shippingAddress);return(0,n.useEffect)(()=>{(null==g?void 0:g.length)&&t?c(!0):(null==g?void 0:g.length)===0&&t?c(!1):c(null)},[g,t]),(null==g?void 0:g.length)>0?(0,s.jsx)(p,{allShippingAddress:g,onSelected:a,selectedAddress:(null==o?void 0:o.shipToAddressId)||i,selectedShippingObject:o,className:r,addressFilter:x,radioContainerClassName:u}
1):(0,s.jsx)(d.A,{className:"mt-4",children:m.A.noResultForFilterText})};x.propTypes={addressFilter:o().string,shippingAddress:o().array,handleSelectAddress:o().func,selectedShippingObject:o().object,selectedAddress:o().string,className:o().string,setHasSearchResults:o().func,radioContainerClassName:o().string};let g=x},82109:(e,t,l)=>{l.d(t,{A:()=>h});var s=l(95155);l(12115);var n=l(83101),a=l(12758),o=l.n(a),i=l(55290),r=l(67219),d=l.n(r),c=l(22485);let u=(0,n.F)("inline-flex items-center justify-center box-content rounded border-0 py-0 px-1 uppercase text-center font-bold\n text-xs lg:text-base transition-colors w-fit font-body lg:leading-5",{variants:{variant:{success:"bg-white text-success",warning:"bg-white text-warning",alert:"bg-white text-alert",shipped:"bg-lighter-yellow text-darker-yellow",delivered:"bg-subtle-green text-green",cancelled:"bg-light-pink text-alert",paid:"bg-lighter-green text-green",pending:"bg-light-pink text-alert",processing:"bg-subtle-orange text-dark-orange","Pending approval":"bg-subtle-orange text-dark-orange","warehouse pickup":"bg-lighter-yellow text-darker-yellow","In Progress":"bg-lighter-yellow text-darker-yellow",invoiced:"bg-lighter-yellow text-darker-yellow","on hold":"bg-subtle-grey text-neutral-700","in review":"bg-subtle-orange text-dark-orange",availableUponRequest:"text-dark-orange",custom:"bg-white text-darker-yellow",deactivated:"bg-subtle-grey text-neutral-700",prepaid:"bg-lighter-green text-green",rejected:"bg-subtle-grey text-neutral-700",onCreditHold:"bg-subtle-grey text-neutral-700",billable:"rounded-[4px] bg-feedback-caution-background px-1 py-0 normal-case gap-1 text-secondary-gold-800 lg:text-xs","non billable":"rounded-[4px] bg-subtle-blue px-1 py-0 normal-case gap-1 text-secondary-500 lg:text-xs",nonPurchasableItem:"bg-subtle-grey text-neutral-700",suspended:"bg-lighter-yellow text-darker-yellow"}}}),p=e=>{let{className:t="",variant:l,children:n,iconComponent:a,tooltipText:o,isNormalCase:r=!1}=e;return a?(0,s.jsxs)("div",{className:(0,i.Ay)(u({variant:l}),"whitespace-nowrap",r&&"normal-case",t),"data-testid":"".concat(l,"-badge"),children:[n,(0,s.jsx)("span",{className:"relative ml-1 inline-flex h-3 w-3 shrink-0 items-center justify-center",children:(0,s.jsx)(c.A,{className:"w-[280px] max-w-[calc(100vw-16px)] whitespace-normal bg-secondary-500 p-2 text-white",arrowClassName:"fill-secondary-500",position:"top",sideOffset:0,collisionPadding:8,trigger:(0,s.jsx)("span",{className:"relative inline-flex h-3 w-3 items-center justify-center",children:(0,s.jsx)(a,{width:"12",height:"12",fill:d().theme.extend.colors["darker-yellow"]})}),children:o})})]}):(0,s.jsx)("div",{className:(0,i.Ay)(u({variant:l}),r&&"normal-case",t),"data-testid":"".concat(l,"-badge"),children:n})};p.propTypes={className:o().string,variant:o().oneOf(["success","warning","alert","shipped","delivered","cancelled","paid","pending","processing","warehouse pickup","In Progress","invoiced","on hold","in review","custom","Pending approval","prepaid","rejected","onCreditHold","billable","non billable","nonPurchasableItem","suspended"]).isRequired,children:o().node.isRequired,iconComponent:o().func,tooltipText:o().string,isNormalCase:o().bool};let h=p},85114:(e,t,l)=>{l.d(t,{A:()=>z});var s=l(95155),n=l(12115),a=l(1213),o=l(12758),i=l.n(o),r=l(86447),d=l(14972),c=l(36019),u=l(15951),p=l(14113),h=l(2662),m=l(29909),x=l(2154),g=l(56083),f=l(95895),v=l(87440),A=l(5235),b=l(63071),y=l(59075),w=l(59412),C=l(1400),S=l(88641),T=l(55290),j=l(99345),N=l(18379),I=l(10569),E=l(22485);let{fullCatalogLabel:L,restrictedCatalogLabel:k}=x.A,R=e=>{let{selectedDepartment:t,disableDepartmentSelector:l,hasFullCatalogAccess:a,hasRestrictedCatalog:o,checkIfSalesRepCookieExist:i,truncateCharLimit:r,onClick:d,dataTestId:c}=e,u=(null==t?void 0:t.name)||"";a&&!u&&(u=o?k:L);let{displayTooltipText:p}=(0,n.useMemo)(()=>{let e=([u].find(Boolean)||"").toLowerCase();return{displayTooltipText:(0,N.A)(e,r).trim()}},[u,r]);return u&&(0,s.jsx)(g.default,{size:"icon",variant:"icon",disabled:l,onClick:d,className:"basis-1/2 justify-start lg:basis-0 lg:justify-normal","data-testid":c,children:(0,s.jsx)(C.A,{className:"relative text-xs text-black lg:text-sm",children:(0,s.jsx)(E.A,{className:"relative mt-3 w-auto bg-primary-blue-500 p-2 text-white lg:left-9",arrowClassName:"absolute visible fill-primary-blue-500",disableTooltip:(0,j.A)(),trigger:(0,s.jsx)(g.default,{variant:"unstyled",size:"unstyled",className:(0,T.Ay)("flex flex-col items-start text-xs capitalize whitespace-nowrap md:flex-row md:items-center md:whitespace-normal",{"cursor-default":l,"md:flex-col md:items-start":i,"text-black":l,"text-blue":!l}),children:(0,s.jsxs)("div",{className:"flex w-full items-center gap-2 whitespace-nowrap",children:[(0,s.jsx)("span",{className:"mr-[6px] font-medium normal-case text-neutral-900","data-testid":"account-user-type",children:m.A.department}),(0,s.jsxs)("span",{className:"flex items-center gap-1 capitalize ".concat(l?"":"underline"),children:[p,!l&&(0,s.jsx)(I.A,{width:"12",height:"6"})]})]})}),children:(0,s.jsx)(C.A,{className:"text-xs font-bold capitalize text-white",children:u.toLowerCase()})})})})};R.propTypes={selectedDepartment:i().object,disableDepartmentSelector:i().bool,hasFull
1CatalogAccess:i().bool,hasRestrictedCatalog:i().bool,checkIfSalesRepCookieExist:i().bool,truncateCharLimit:i().number,onClick:i().func,dataTestId:i().string};var D=l(33810),_=l(67219),O=l.n(_);let F=e=>{let{message:t,className:l}=e;return(0,s.jsx)("article",{className:"w-full rounded-lg border border-l-8 !border-darker-blue bg-subtle-blue ".concat(l),children:(0,s.jsxs)("section",{className:"flex items-center gap-4 px-4 py-4 text-left",children:[(0,s.jsx)("section",{children:(0,s.jsx)(D.A,{width:24,height:24,fill:O().theme.extend.colors["darker-blue"]})}),(0,s.jsx)(C.A,{className:"text-xs text-darker-blue",children:t})]})})};F.propTypes={message:i().string,className:i().string};let H=e=>{var t,l;let{isOpen:o,onCloseFlyout:i,onConfirmSelection:T,selectedDepartment:j,flyoutDisplayAccount:N,onOpenFlyoutFromAccountSelector:I,setIsDeliveryAddressFlyoutOpen:E,setIsFlyoutOpen:L,addressSelected:k,isLoading:D,isNavigatedFromAccountFlyout:_=!1,allDepartmentsOption:O=x.A.allDepartmentsOption}=e,{deviceType:H}=(0,u.A)(),z=p.Ay.ACCOUNT_SELECTOR_DESKTOP_TRUNCATE_LIMIT;H===p.Ay.MOBILE?z=p.Ay.DELIVERY_ADDRESS_MOBILE_TRUNCATE_LIMIT:H===p.Ay.TABLET&&(z=p.Ay.DELIVERY_ADDRESS_TABLET_TRUNCATE_LIMIT);let[B,U]=(0,n.useState)(null==j?void 0:j.id),M=(0,a.wA)(),{data:P,selectedAccountDepartments:V,hasFullCatalogAccess:K,hasFullCatalogAccessForSelectedAccount:G,loading:Z,isFirstLoad:q}=(0,a.d4)(e=>e.departments||{}),{hasRestrictedCatalog:W,selectedAccountHasRestrictedCatalog:Y,loading:Q}=(0,a.d4)(e=>e.productSegment||{}
1),[$,J]=(0,n.useState)(null),[X,ee]=(0,n.useState)(!1),{commonConfig:et}=(0,a.d4)(e=>e.commonStates),el=null==et||null==(t=et[0])?void 0:t.DEPARTMENTS_FEATURE_FLAG;(0,n.useEffect)(()=>{_&&(null==k?void 0:k.customerId)&&el&&(M((0,d.OT)({page:1,pageSize:50,referenceCode:k.customerId,isSelectedAccount:!0})),M((0,c.Wv)({accountId:k.customerId,isSelectedAccount:!0})))},[_,null==k?void 0:k.customerId,M,el]),(0,n.useEffect)(()=>{N&&J(N)},[N]),(0,n.useEffect)(()=>{if(null==j?void 0:j.id)return void U(j.id);if(!_)return void U(null==O?void 0:O.id);if((null==P?void 0:P.length)&&!K){var e;U(null==(e=P[0])?void 0:e.id)}},[null==j?void 0:j.id,o,P,_,null==O?void 0:O.id,K]);let es=null==(l=(P||[]).find(e=>{let{id:t}=e;return t===B}))?void 0:l.name,en={...h.GY,cta_type:h.wX,cta_text:(0,h.Zn)({account:(0,h.TZ)(null!=N?N:k),department:es})};(0,n.useEffect)(()=>{ee(!(null==j?void 0:j.id)&&K)},[null==j?void 0:j.id,K,o]);let ea=(null==V?void 0:V.length)<=+!G,eo=D||Z||!B&&!X||!(null==P?void 0:P.length),ei=W?x.A.restrictedCatalogLabel:x.A.fullCatalogLabel,er=_&&!(Z&&q&&Q),ed=D||Z||Q||_&&!$,ec=(0,r.Q)(null==$?void 0:$.shipToAddressName);return(0,s.jsxs)(y.mj,{open:o,onOpenChange:i,children:[er&&(0,s.jsx)(R,{selectedDepartment:j,disableDepartmentSelector:ea,hasFullCatalogAccess:G,hasRestrictedCatalog:Y,truncateCharLimit:z,onClick:I,dataTestId:"department-flyout-trigger","data-testid":"department-flyout-trigger"}),(0,s.jsxs)(y.Z7,{side:"right",overlayClassName:"bg-black opacity-35",className:"flex flex-col gap-0 overflow-hidden p-0 md:w-[384px]",crossIconClassName:"fixed z-50 top-7 right-7","data-testid":"flyout-content",children:[(0,s.jsxs)("section",{className:"mb-16 flex w-full flex-col gap-4 overflow-x-hidden overflow-y-auto p-4 md:p-6",children:[(0,s.jsx)(y.IL,{className:"fixed top-0 w-full bg-white pb-2 pt-6 text-md-h2 font-bold md:w-[336px]",children:x.A.selectDepartment}),ed?(0,s.jsx)("div",{className:"mx-auto flex min-h-[400px] items-center justify-center",children:(0,s.jsx)(f.A,{width:"64",height:"64"})}):(0,s.jsxs)(s.Fragment,{children:[_&&(0,s.jsxs)("article",{className:"mt-[48px] flex flex-col gap-4 md:w-[335px]",children:[(0,s.jsx)("section",{className:"flex gap-2",children:(0,s.jsxs)("section",{className:"flex w-full flex-col gap-[2px]",children:[(0,s.jsx)(C.A,{className:"text-xs",children:null===m.A||void 0===m.A?void 0:m.A.forUser}),(0,s.jsxs)(C.A,{className:"flex w-full items-start justify-between gap-2 capitalize",children:[(0,s.jsx)("b",{className:"min-w-0 flex-1 text-sm",children:ec}),(0,s.jsx)(b.A,{billable:null==$?void 0:$.billable})]}),(0,s.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,s.jsxs)(C.A,{className:"min-w-0 flex-1 text-sm capitalize",children:[null==$?void 0:$.shipToAddressLine1,", ",null==$?void 0:$.shipToCity,", ",null==$?void 0:$.shipToState,", ",null==$?void 0:$.shipToZipCode]}),(0,s.jsx)("b",{className:"shrink-0 text-right text-xs text-neutral-700",children:null==$?void 0:$.customerId})]}),(0,s.jsx)(C.A,{onClick:()=>{L(!0),E(!1),i()},className:"mt-2 w-fit text-sm text-blue hover:cursor-pointer",children:null===m.A||void 0===m.A?void 0:m.A.changeLabel})]})}),(0,s.jsx)(S.default,{})]}),_&&K&&(0,s.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex w-full items-center justify-between rounded-lg bg-subtle-blue px-4 py-2",children:[(0,s.jsxs)("div",{className:"flex flex-col pr-4",children:[(0,s.jsx)(w.A,{className:"text-sm font-bold text-black",htmlFor:"full-catalog-switch",children:ei}),(0,s.jsx)(C.A,{className:"mt-1 text-sm text-neutral-600 leading-snug",children:x.A.fullCatalogDescription})]}),(0,s.jsx)(A.A,{id:"full-catalog-switch",checked:X,onCheckedChange:e=>{ee(e),e?U():(null==j?void 0:j.id)?U(j.id):(null==P?void 0:P.length)&&U(P[0].id)}})]}),!X&&(0,s.jsx)(F,{message:null===m.A||void 0===m.A?void 0:m.A.departmentChangeHome}),(0,s.jsxs)(C.A,{className:"text-sm text-primary",children:[(0,s.jsx)("span",{className:"font-bold",children:x.A.departments}),(0,s.jsxs)("span",{className:"ml-1 font-normal",children:["(",(null==P?void 0:P.length)||0,")"]})]})]}),(0,s.jsxs)(v.z6,{className:"flex w-full flex-col items-start gap-4 ".concat(_?"":"mt-12"),"data-testid":"departments-radio-group",value:
1B,onValueChange:U,children:[!_&&(0,s.jsxs)("div",{className:"flex h-14 w-full items-center gap-4 rounded-lg border-2 p-4 ".concat(B===O.id?"border-blue":"border-neutral-400"),children:[(0,s.jsx)(v.CU,{"aria-labelledby":"radio-text-all-departments",value:O.id,id:O.id,"data-testid":"all-departments-radio"}),(0,s.jsx)(w.A,{htmlFor:O.id,className:"cursor-pointer text-sm font-bold leading-[18px] text-black",children:O.name})]},O.id),_&&!K&&(0,s.jsx)(F,{message:null===m.A||void 0===m.A?void 0:m.A.departmentChangeHome}),(P||[]).slice().sort((e,t)=>e.id===(null==j?void 0:j.id)?-1:+(t.id===(null==j?void 0:j.id))).map(e=>{let{id:t,name:l}=e,n=_&&X;return(0,s.jsxs)("div",{className:"flex h-14 w-full items-center gap-4 rounded-lg border-2 p-4 ".concat(B===t?"border-blue":"border-neutral-400"," ").concat(n?"pointer-events-none opacity-50":""),children:[(0,s.jsx)(v.CU,{"aria-labelledby":"radio-text-department-".concat(t),value:t,id:t,"data-testid":"department-".concat(t,"-radio"),disabled:n}),(0,s.jsx)(w.A,{htmlFor:t,className:"text-sm font-bold leading-[18px] text-black ".concat(n?"cursor-not-allowed":"cursor-pointer"),children:l})]},t)})]})]})]}),(0,s.jsx)(y.bt,{className:"fixed bottom-0 right-0 max-h-[72px] w-full items-center justify-center rounded-b-lg bg-white px-8 py-4 shadow-[0px_-2px_5px_0px_#1A1A1A26] md:w-[384px] md:px-4",children:(0,s.jsx)(g.default,{testId:"confirm-selection",className:"h-[40px] w-full border ".concat(eo?"":"border-blue"),variant:"secondary",size:"default",onClick:()=>{T(B),_||i()},analyticsData:en,disabled:eo,children:x.A.done})})]})]},"right")};H.propTypes={addressSelected:i().object,isOpen:i().bool.isRequired,onCloseFlyout:i().func.isRequired,onConfirmSelection:i().func.isRequired,selectedDepartment:i().object,flyoutDisplayAccount:i().object,onOpenFlyoutFromAccountSelector:i().func,setIsFlyoutOpen:i().func,setIsDeliveryAddressFlyoutOpen:i().func,isLoading:i().bool,isNavigatedFromAccountFlyout:i().bool,allDepartmentsOption:i().shape({id:i().string,name:i().string})};let z=H},85809:(e,t,l)=>{l.r(t),l.d(t,{default:()=>ei});var s=l(95155),n=l(20063),a=l(12115),o=l(1213),i=l(12758),r=l.n(i),d=l(18101),c=l(30373),u=l(9428),p=l(86447),h=l(8378),m=l(14972),x=l(36019),g=l(53657),f=l(15951),v=l(71070),A=l(55290),b=l(14113),y=l(35726),w=l(18785),C=l(2662),S=l(29909),T=l(56083),j=l(24887),N=l(95895),I=l(63587),E=l(64774),L=l(82109),k=l(59075),R=l(60440),D=l(1400),_=l(99345),O=l(39721),F=l(18379),H=l(21943),z=l(63071),B=l(88641),U=l(39195),M=l(35547),P=l(73363),V=l(86416);let K=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{shipToAddressLine1:t="",shipToCity:l="",shipToState:s="",shipToZipCode:n=""}=e;return"".concat(t?"".concat(t,","):""," ").concat(l,", ").concat(s," ").concat(n)},G=e=>{let{addressSelected:t,handleOutClick:l,handleScroll:n,setIsDeliveryAddressFlyoutOpen:o,isNavigatedFromAccountFlyout:i,setIsFlyoutOpen:r,flyoutDisplayAccount:d,shippingAddress:c,setDeliveryAddressHandler:u,scrolled:h,checkIfSalesRepCookieExist:m,isLoading:x,addressDetails:g,isTokenShipToInActive:v,commonConfigData:A,salesRepSelectedAddress:y,isFetchingShippingAddresses:w,isDepartmentLoading:j,userMustSelectDepartment:I}=e,[E,L]=(0,a.useState)(t),[_,G]=(0,a.useState)(!1),[Z,q]=(0,a.useState)(""),[W,Y]=(0,a.useState)(null),Q=null==t?void 0:t.warehouseId,{UPPERCASE_H:$}=b.Ay,J=()=>{q(""),r(!0),o(!1)},X=()=>{L(t),q(""),G(!1)},ee=(0,a.useMemo)(()=>{var e;let t=null==c?void 0:c.find(e=>{var t;let{shippingAddress:l}=e;return(null==l?void 0:l.shipToId)===(null==E?void 0:E.shipToAddressId)&&(null==l||null==(t=l.name)?void 0:t.toLowerCase())===(null==E?void 0:E.shipToAddressName)&&(null==l?void 0:l.zip)===(null==E?void 0:E.shipToZipCode)});return(null==t?void 0:t.shippingAddress)&&Q!==(null==t||null==(e=t.shippingAddress)?void 0:e.warehouseId)||G(!1),x||(null==c?void 0:c.length)===0||!(null==t?void 0:t.shippingAddress)||!1===W},[c,E,x,W,G]);(0,a.useEffect)(()=>{var e,l;let{shipToId:s="",address1:n="",address2:a="",address3:o="",name:i="",city:r="",country:d="",state:c="",zip:u="",warehouseId:p=""}=null!=(l=null==y?void 0:y.shippingAddress)?l:{},h=y&&(null==(e=Object.keys(y))?void 0:e.length)>0?{shipToAddressId:s,shipToAddressLine1:null==n?void 0:n.toLowerCase(),shipToAddressLine2:null==a?void 0:a.toLowerCase(),shipToAddressLine3:null==o?void 0:o.toLowerCase(),shipToAddressName:null==i?void 0:i.toLowerCase(),shipToCity:null==r?void 0:r.toLowerCase(),shipToCountry:null==d?void 0:d.toLowerCase(),shipToState:c,shipToZipCode:u,warehouseId:p}:t;L(h)},[L,t,c,y]);let et=(0,O.A)(null==d?void 0:d.customerId,null==d?void 0:d.customerName),el=(0,p.Q)(et),es=(0,p.Q)(null==t?void 0:t.shipToAddressName),{deviceType:en}=(0,f.A)(),ea=(null==t?void 0:t.status)===$,eo=b.Ay.ACCOUNT_SELECTOR_DESKTOP_TRUNCATE_LIMIT;en===b.Ay.MOBILE?eo=ea?b.Ay.ACCOUNT_SELECTOR_MOBILE_TRUNCATE_LIMIT_WITH_ON_HOLD_ACCOUNT:b.Ay.ACCOUNT_SELECTOR_MOBILE_TRUNCATE_LIMIT:en===b.Ay.TABLET&&(eo=b.Ay.ACCOUNT_SELECTOR_TABLET_TRUNCATE_LIMIT);let ei=(null==t?void 0:t.customerId)===(null==d?void 0:d.customerId),er=ei?t:d,ed=ei?null==t?void 0:t.billable:null==d?void 0:d.billable,ec=null==er?void 0:er.customerId,eu=K(er);return(0,s.jsxs)(k.Z7,{side:"right","aria-labelledby":"delivery-address-dialog","data-testid":"scrollable-container","aria-describedby":"delivery-address-dialog",className:"overflow-x-hidden px-0 pb-0 md:rounded-lg",crossIcon:!!(null==t?void 0:t.warehouseId)&&!v,overlayClassName:"bg-black opacity-35",closeButtonText:null===S.A||void 0===S.A?void 0:S.A.closeButtonTextForSROnly,crossSvgClassName:"h-8 w-8 p-[6px]",crossIconClassName:"".concat((null==c?void 0:c.length)>(null==A?void 0:A.THRESHOLD_TO_ENABLE_SEARCH_ON_DELIVERY_ADDRESS_SELECTOR)?"fixed":"absolute"," ").concat(h?"top-2 right-0 flex justify-end z-[99] p-4":"top-6 z-50 right-4"," focus:opacity-100 ").concat(x?"hidden":""),onEscapeKeyDown:e=>{(null==t?void 0:t.warehouseId)&&!v?X():e.preventDefault()},onInteractOutside:e=>{m||(X(),l(e))},onScroll:n,setIsFlyoutOpen:e=>{X(),o(e)},children:[(0,s.jsxs)("article",{className:"relative mx-6 flex flex-1 flex-col rounded-lg pb-[80px] md:w-[336px]",children:[(0,s.jsxs)("section",{"data-testid":"delivery-address-header-container",className:"w-full ".concat((null==c?void 0:c.length)>(null==A?void 0:A.THRESHOLD_TO_ENABLE_SEARCH_ON_DELIVERY_ADDRESS_SELECTOR)?"fixed top-0 z-10 w-[inherit] bg-white":""),children:[(0,s.jsx)(R.A,{variant:"h3",as:"h3",className:"".concat((null==c?void 0:c.length)>(null==A?void 0:A.THRESHOLD_TO_ENABLE_SEARCH_ON_DELIVERY_ADDRESS_SELECTOR)?"my-6":"mb-6"," text-[26px] font-bold normal-case leading-8"),children:null===S.A||void 0===S.A?void 0:S.A.selectDeliveryAddress}),!(x||w||!er)&&(0,s.jsxs)("article",{className:"flex w-[calc(100vw-24px-24px)] flex-col gap-4 md:w-[336px]",children:[(0,s.jsxs)("section",{className:"flex gap-2 ".concat(i?"":"flex-col"),children:[i&&(null==g?void 0:g.length)>1&&(0,s.jsx)("section",{role:"presentation",tabIndex:0,onKeyPress:e=>{e.key===b.Ay.ENTER_KEY&&(q(""),r(!0),o(!1))}
1,onClick:J,className:"mt-[2px] cursor-pointer",children:(0,s.jsx)(H.A,{width:"16",height:"16"})}),(0,s.jsxs)("section",{className:"flex w-full flex-col gap-[2px]",children:[(0,s.jsx)(D.A,{className:"text-xs",children:null===S.A||void 0===S.A?void 0:S.A.forUser}),(0,s.jsxs)(D.A,{className:"flex w-full items-start justify-between gap-2 capitalize",children:[(0,s.jsxs)("b",{className:"min-w-0 flex-1 text-sm",children:[ei&&(null==t?void 0:t.shipToAddressName)&&(0,F.A)("".concat(es),eo),!ei&&el]}),(0,s.jsx)(z.A,{billable:ed})]}),(0,s.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,s.jsx)(D.A,{className:"min-w-0 flex-1 text-sm capitalize",children:eu}),(0,s.jsx)("b",{className:"shrink-0 text-right text-xs text-neutral-700",children:ec})]})]}),!i&&(null==g?void 0:g.length)>1&&(0,s.jsx)(D.A,{onClick:J,className:"w-fit text-sm text-blue hover:cursor-pointer",children:null===S.A||void 0===S.A?void 0:S.A.changeLabel})]}),(0,s.jsx)(B.default,{className:"".concat((null==c?void 0:c.length)<(null==A?void 0:A.THRESHOLD_TO_ENABLE_SEARCH_ON_DELIVERY_ADDRESS_SELECTOR)?"mb-4":"")}),(null==c?void 0:c.length)>(null==A?void 0:A.THRESHOLD_TO_ENABLE_SEARCH_ON_DELIVERY_ADDRESS_SELECTOR)&&(0,s.jsx)(M.L,{inputValue:Z,inputOnChangeHandler:e=>(0,U.oQ)(e,q,()=>{}),setFilter:q,label:null===S.A||void 0===S.A?void 0:S.A.addressSearchBoxLabel,className:"mb-4"})]})]}),x||w||!er?(0,s.jsx)("div",{className:"mx-auto flex min-h-[400px] items-center justify-center",children:(0,s.jsx)(N.A,{width:"64",height:"64"})}):(0,s.jsx)("section",{className:"flex flex-col gap-4 ".concat((null==c?void 0:c.length)>(null==A?void 0:A.THRESHOLD_TO_ENABLE_SEARCH_ON_DELIVERY_ADDRESS_SELECTOR)?"".concat(i?"mt-[224px]":"mt-[250px]"):""),children:(0,s.jsxs)("section",{children:[_&&!1!==W&&(0,s.jsx)(V.A,{message:null===S.A||void 0===S.A?void 0:S.A.warehouseChangeHome,className:"mb-4"}),(null==c?void 0:c.length)===0?(0,s.jsx)(D.A,{className:"italic text-neutral-600",children:S.A.noDeliveryAddressText}):(0,s.jsx)(P.A,{addressFilter:Z,shippingAddress:c,handleSelectAddress:e=>{let l=null==c?void 0:c.find(t=>{let{shippingAddress:l}=t;return(null==l?void 0:l.shipToId)===e});if(L((0,p.cb)({...t},l)),Q){var s;G((null==l||null==(s=l.shippingAddress)?void 0:s.warehouseId)!==Q)}},selectedShippingObject:E,setHasSearchResults:Y,className:"flex h-full min-w-[310px] items-start gap-4 roun
1ded-lg border-2 p-4 hover:cursor-pointer md:min-w-[336px]"})]})})]}),(0,s.jsx)(k.bt,{className:"fixed bottom-0 flex h-[72px] w-full items-center justify-center rounded-b-lg bg-white px-8 py-4 shadow-[0_0_4px_0_rgba(0,0,0,0.25)] md:w-[384px] md:pr-8",children:(0,s.jsx)(T.default,{testId:"set-delivery-address-button",variant:"secondary",size:"lg",className:"h-[40px] w-full border md:w-[20rem] ".concat(ee?"":"border-blue"),disabled:ee||j||w,onClick:()=>u(null==E?void 0:E.shipToAddressId),analyticsData:{...C.GY,cta_type:C.BG,cta_text:(0,C.Zn)({account:(0,C.TZ)(null!=d?d:t)})},children:j||w?(0,s.jsx)("div",{className:"mx-auto flex min-h-[20px] items-center justify-center",children:(0,s.jsx)(N.A,{width:"64",height:"40"})}):(0,s.jsx)("div",{children:m&&(null==c?void 0:c.length)>=1||I?null===S.A||void 0===S.A?void 0:S.A.nextLabel:null===S.A||void 0===S.A?void 0:S.A.doneLabel})})})]})};G.propTypes={addressSelected:r().object,handleOutClick:r().func,handleScroll:r().func,setIsDeliveryAddressFlyoutOpen:r().func,isNavigatedFromAccountFlyout:r().bool,setIsFlyoutOpen:r().func,flyoutDisplayAccount:r().object,shippingAddress:r().array,setDeliveryAddressHandler:r().func,scrolled:r().bool,checkIfSalesRepCookieExist:r().bool,isLoading:r().bool,addressDetails:r().array,isTokenShipToInActive:r().bool,commonConfigData:r().array,salesRepSelectedAddress:r().object,isFetchingShippingAddresses:r().bool,isDepartmentLoading:r().bool,userMustSelectDepartment:r().bool};var Z=l(10569),q=l(22485);let W=e=>{let{addressSelected:t,disableDeliveryAddressSelector:l,checkIfSalesRepCookieExist:n,truncateCharLimit:o}=e,{warehouseId:i="",shipToAddressName:r=""}=null!=t?t:{},d=(0,p.Q)(r),{addressLine:c,displayTooltipText:u}=(0,a.useMemo)(()=>{let{shipToAddressLine1:e="",shipToAddressLine2:l="",shipToAddressLine3:s="",shipToState:n="",shipToZipCode:a=""}=null!=t?t:{},i=([e,l,s].find(Boolean)||"").toLowerCase(),r="".concat((0,F.A)(i,o),", ").concat(n||""," ").concat(a||"").trim();return{addressLine:"".concat(i,", ").concat(n||""," ").concat(a||""),displayTooltipText:r}},[t,o]);return(0,s.jsx)(k.kW,{asChild:!0,children:(0,s.jsx)(T.default,{size:"icon",variant:"icon",className:"basis-1/2 justify-start lg:basis-0 lg:justify-normal",children:(0,s.jsx)(D.A,{className:"relative text-xs text-black lg:text-sm",testId:"paragraph-with-tooltip",children:(0,s.jsx)(q.A,{className:"".concat(i?"flex":"hidden"," relative mt-3 w-auto bg-primary-blue-500 p-2 text-white lg:left-9"),arrowClassName:"absolute visible fill-primary-blue-500",disableTooltip:(0,_.A)(),trigger:(0,s.jsx)(T.default,{variant:"unstyled",size:"unstyled",testId:"highlighted-address-text",className:(0,A.Ay)("flex flex-row items-center text-xs capitalize whitespace-nowrap",{"curs
1or-default":l,"md:flex-col md:items-start":n,"text-black":l,"text-blue":!l}),children:(0,s.jsxs)("span",{className:"flex flex-row items-center gap-1 whitespace-nowrap",children:[(0,s.jsx)("span",{className:"mr-[6px] items-start font-medium normal-case text-neutral-900 md:justify-start","data-testid":"account-user-type",children:S.A.deliverTo}),(0,s.jsxs)("section",{className:"flex items-center gap-1",children:[i&&(0,s.jsx)("span",{className:"truncate capitalize ".concat(l?"":"underline"),children:u}),!l&&(0,s.jsx)(Z.A,{width:"12",height:"6"})]})]})}),align:"center",children:(0,s.jsxs)("section",{children:[(0,s.jsx)(D.A,{className:"text-xs font-bold capitalize text-white",children:null==d?void 0:d.toLowerCase()}),(0,s.jsx)(D.A,{className:"text-xs capitalize text-white",children:c})]})})})})})};W.propTypes={addressSelected:r().object,disableDeliveryAddressSelector:r().bool,checkIfSalesRepCookieExist:r().bool,truncateCharLimit:r().number};let Y=e=>{let{shippingAddress:t,addressDetails:l,isDeliveryAddressFlyoutOpen:n,onDeliveryAddressChangeHandler:i,checkIfSalesRepCookieExist:r,handleOutClick:d,handleScroll:c,setIsDeliveryAddressFlyoutOpen:p,setDeliveryAddressHandler:h,scrolled:m,addressSelected:x,isNavigatedFromAccountFlyout:g,setIsFlyoutOpen:v,flyoutDisplayAccount:A,isLoading:y,selectedId:w,setIsDeliveryAddressLoading:C,currentlySelectedShippingAddresses:S,isTokenShipToInActive:T,commonConfigData:j,salesRepSelectedAddress:N,isFetchingShippingAddresses:I,isDepartmentLoading:E,userMustSelectDepartment:L}=e,{deviceType:R}=(0,f.A)(),D=(0,o.wA)();(0,a.useEffect)(()=>{let e=async()=>{C(!0),D((0,u.V1)(w)),C(!1)};(null==t?void 0:t.length)===0&&w&&e()},[w]);let O=b.Ay.ACCOUNT_SELECTOR_DESKTOP_TRUNCATE_LIMIT;R===b.Ay.MOBILE?O=b.Ay.DELIVERY_ADDRESS_MOBILE_TRUNCATE_LIMIT:R===b.Ay.TABLET&&(O=b.Ay.DELIVERY_ADDRESS_TABLET_TRUNCATE_LIMIT);let F=(null==S?void 0:S.length)<=1||!(null==x?void 0:x.warehouseId)||r;return(0,s.jsxs)(k.mj,{open:n,onOpenChange:i,children:[!((0,_.A)()&&F)&&(0,s.jsx)(W,{addressSelected:x,checkIfSalesRepCookieExist:r,disableDeliveryAddressSelector:F,truncateCharLimit:O}),(0,s.jsx)(G,{shippingAddress:t,handleOutClick:d,handleScroll:c,setIsDeliveryAddressFlyoutOpen:p,setDeliveryAddressHandler:h,scrolled:m,isNavigatedFromAccountFlyout:g,setIsFlyoutOpen:v,flyoutDisplayAccount:A,addressSelected:x,checkIfSalesRepCookieExist:r,isLoading:y,addressDetails:l,isTokenShipToInActive:T,commonConfigData:j,salesRepSelectedAddress:N,isFetchingShippingAddresses:I,isDepartmentLoading:E,userMustSelectDepartment:L})]},"center")};Y.propTypes={shippingAddress:r().array,isDeliveryAddressFlyoutOpen:r().bool,onDeliveryAddressChangeHandler:r().func,checkIfSalesRepCookieExist:r().bool,handleOutClick:r().func,handleScroll:r().func,setIsDeliveryAddressFlyoutOpen:r().func,setDeliveryAddressHandler:r().func,addressSelected:r().object,flyoutDisplayAccount:r().object,isLoading:r().bool,scrolled:r().bool,isNavigatedFromAccountFlyout:r().bool,setIsFlyoutOpen:r().func,selectedId:r().string,setIsDeliveryAddressLoading:r().func,currentlySelectedShippingAddresses:r().array,addressDetails:r().array,isTokenShipToInActive:r().bool,commonConfigData:r().array,salesRepSelectedAddress:r().object,isFetchingShippingAddresses:r().bool,isDepartmentLoading:r().bool,userMustSelectDepartment:r().bool};var Q=l(85114),$=l(74568),J=l(40386),X=l(13008);let ee=e=>{var t;let{doNotShowAgain:l,handleCloseAccountSelectedBanner:n,setDoNotShowAgain:a}=e,{commonConfig:i}=(0,o.d4)(e=>e.commonStates),r=null==i||null==(t=i[0])?void 0:t.DEPARTMENTS_FEATURE_FLAG;return(0,s.jsxs)("div",{"data-testid":"account-selected-banner",className:"pointer-events-auto absolute left-0 top-12 mx-2 flex flex-col gap-4 roun
1ded-lg bg-subtle-blue p-4 md:mx-0 md:w-full",children:[(0,s.jsx)("div",{className:"absolute left-1/2 top-0 -mt-2 h-[23px] w-[23px] -translate-x-1/2 rotate-45 rounded bg-subtle-blue"}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-1",children:[(0,s.jsx)("div",{className:"w-11/12 text-base font-bold leading-5 text-black md:w-full",children:r?S.A.banner.title:S.A.bannerNoDepartment.title}),(0,s.jsx)(X.A,{className:"cursor-pointer",onClick:n})]}),(0,s.jsx)("div",{className:"text-sm font-normal leading-[18px] text-black",children:r?S.A.banner.description:S.A.bannerNoDepartment.description})]}),(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)(J.A,{checked:l,onClick:()=>a(!l),"data-testid":"toggle-do-not-show-again"}),S.A.banner.checkboxText]})]})};ee.propTypes={doNotShowAgain:r().bool,setDoNotShowAgain:r().func,handleCloseAccountSelectedBanner:r().func};var et=l(50272);let el=e=>{let{addressSelected:t,addressDetails:l,setSelectedId:n,checkIfSalesRepCookieExist:a,disableAccountSelector:o}=e;return(0,s.jsx)(k.kW,{asChild:!0,children:(0,s.jsx)(T.default,{"aria-label":"account selector - ".concat(t.customerId," - ").concat(t.shipToAddressName||t.customerName),id:"account-selector-modal",size:"icon",variant:"icon",className:"".concat(1===l.length?"hidden":"inline"," flex basis-1/2 justify-start gap-4 lg:basis-0 lg:justify-normal"),onClick:()=>{n(t.customerId)},analyticsData:C.X,children:(0,s.jsx)(et.SA,{accountData:S.A,addressSelected:t,checkIfSalesRepCookieExist:a,disableAccountSelector:o})})})};el.propTypes={addressSelected:r().object,addressDetails:r().array,setSelectedId:r().func,checkIfSalesRepCookieExist:r().bool,disableAccountSelector:r().bool};var es=l(41921),en=l(31862);let ea={heading:b.Ay.SOMETHING_WENT_WRONG,message:b.Ay.PLEASE_TRY_AGAIN,messageType:b.ff,iconTopAlign:!0,cssClass:"fixed"},eo=e=>{var t,l;let{commonConfigData:i,isFlyoutOpen:r,setIsFlyoutOpen:_,checkIfSalesRepCookieExist:O=!1,setParentAccountId:F=()=>{},setUserFlyoutOpen:H,setSelectedAddress:z,selectedAddress:B,disableAccountSelector:P=!1,isDeliveryAddressFlyoutOpen:V,setIsDeliveryAddressFlyoutOpen:K=()=>{},isNavigatedFromAccountFlyout:G,setIsNavigatedFromAccountFlyout:Z=()=>{},setIsNavigatedFromDeliveryAddressFlyout:q=()=>{},isDepartmentFlyoutOpen:W,setIsDepartmentFlyoutOpen:J}=e,{addressDetails:X,addressSelected:et,showAccountSuccessStatus:eo,userSelected:ei,subAccountDetails:er,isSubAccountFetchingLoading:ed,shippingAddress:ec,currentlySelectedShippingAddresses:eu,isTokenShipToInActive:ep,salesRepSelectedAddress:eh,isFetchingShippingAddresses:em,isProfileInfoLoading:ex,userProfileData:eg,showVerifyProfileInfo:ef}=(0,o.d4)(e=>({addressDetails:e.account.addressDetails,addressSelected:e.account.addressSelected,showAccountSuccessStatus:e.account.showAccountSuccessStatus,userSelected:e.account.userSelected,subAccountDetails:e.account.subAccountDetails,isSubAccountFetchingLoading:e.account.isSubAccountFetchingLoading,shippingAddress:e.account.shippingAddress,currentlySelectedShippingAddresses:e.account.currentlySelectedShippingAddresses,isTokenShipToInActive:e.account.isTokenShipToInActive,salesRepSelectedAddress:e.account.salesRepSelectedAddress,isFetchingShippingAddresses:e.account.isFetchingShippingAddresses,isProfileInfoLoading:e.account.isProfileInfoLoading,userProfileData:e.account.userProfileData,showVerifyProfileInfo:e.account.showVerifyProfileInfo}),o.bN),ev=(0,o.wA)(),eA=(0,a.useRef)(new Set),eb=(0,n.useSearchParams)(),ey=(0,n.usePathname)(),ew=(0,n.useRouter)(),[eC,eS]=(0,a.useState)(!1),[eT,ej]=(0,a.useState)(""),[eN,eI]=(0,a.useState)(""),[eE,eL]=(0,a.useState)("item-1"),[ek,eR]=(0,a.useState)(""),[eD,e_]=(0,a.useState)(""),[eO,eF]=(0,a.useState)(""),[eH,ez]=(0,a.useState)(!1),[eB,eU]=(0,a.useState)(!1),[eM,eP]=(0,a.useState)([]),[eV,eK]=(0,a.useState)(!1),[eG,eZ]=(0,a.useState)(!1),{isBannerViewed:eq}=(0,o.d4)(e=>{var t;return(null==(t=e.auth)?void 0:t.user)||{}}),{accessToken:eW,customToken:eY}=(0,o.d4)(e=>{var t;return(null==(t=e.auth)?void 0:t.tokens)||{}}),eQ=(0,o.d4)(e=>{var t;return null==(t=e.auth)?void 0:t.departmentId}),[e$,eJ]=(0,a.useState)(!1),[eX,e0]=(0,a.useState)(""),{data:e1,hasFullCatalogAccess:e2,hasFull
1CatalogAccessForSelectedAccount:e5,selectedAccountDepartments:e4,selectedDepartment:e3,loading:e6}=(0,o.d4)(e=>e.departments||{}),{loading:e8,selectedAccountHasRestrictedCatalog:e7}=(0,o.d4)(e=>e.productSegment||{}),[e9,te]=(0,a.useState)(!1),[tt,tl]=(0,a.useState)(!0),{deviceType:ts}=(0,f.A)(),tn=ts===b.Ay.MOBILE,ta=(0,a.useCallback)(e=>{"function"==typeof J?J(e):te(e)},[J]);(0,a.useEffect)(()=>{if(eQ){let e=null==e4?void 0:e4.find(e=>e.id===String(eQ));e&&ev((0,m.Ge)(e))}else!e5&&(null==e4?void 0:e4.length)>0&&ta(!0)},[e4,eQ,ev,e5]);let to=(0,a.useMemo)(()=>!(P&&(null==eu?void 0:eu.length)<=1||(0,y.A)()||(0,w.A)())&&!ex&&!!(null==eg?void 0:eg.accountSelectionBanner)&&!ef&&!(0,v.hk)(C.tP)&&!!(null==et?void 0:et.customerId),[null==et?void 0:et.customerId,null==eu?void 0:eu.length,P,ex,null==eg?void 0:eg.accountSelectionBanner,ef]),[ti,tr]=(0,a.useState)(!1),[td,tc]=(0,a.useState)(!1),{commonConfig:tu}=(0,o.d4)(e=>e.commonStates),tp=null==tu||null==(t=tu[0])?void 0:t.DEPARTMENTS_FEATURE_FLAG,th=tp&&(null==e1?void 0:e1.length)>+!e2;(0,a.useEffect)(()=>{tc(to)},[to]),(0,a.useEffect)(()=>(td?(window.scrollTo(0,0),document.body.classList.add("overflow-hidden")):document.body.classList.remove("overflow-hidden"),()=>{document.body.classList.remove("overflow-hidden")}),[td]),(0,a.useEffect)(()=>{X.length>=1&&eF(X[0].customerId)},[X]),(0,a.useEffect)(()=>{var e,t;!(X.length>=1)||(X[0].childAccountExists&&!((null==(e=Object.keys(er))?void 0:e.length)>0)||(null==et?void 0:et.customerId))&&!ep||!eq||eV||e$||((null==(t=X[0])?void 0:t.customerId)&&e_(X[0].customerId),_(!0),eJ(!0))},[X.length,eq,er,ep]),(0,a.useEffect)(()=>{eo&&(ev((0,u.j4)(!1)),window.location.reload())},[eo,ev]),(0,a.useEffect)(()=>{(null==B?void 0:B.customerId)?e_(B.customerId):et.customerId&&(e_(et.customerId),eL("item-1")),eP([]),eK(!1),eI("")},[et.customerId,null==B?void 0:B.customerId]),(0,a.useEffect)(()=>{(null==ei?void 0:ei.accountId)||!O?ep&&O&&_(!0):_(!0)},[ei,O,ep,_]),(0,a.useEffect)(()=>{(null==X?void 0:X.length)!==1||X[0].childAccountExists||!((null==ec?void 0:ec.length)>1)||(null==et?void 0:et.warehouseId)||K(!0)},[X,ec,et,K]),(0,a.useEffect)(()=>{var e,t;let l=null==et?void 0:et.customerId,s=null==X||null==(e=X[0])?void 0:e.customerId,n=null==et?void 0:et.childAccountExists,a=null==X||null==(t=X[0])?void 0:t.childAccountExists,o=l&&n&&!O&&!er[l]&&!eA.current.has(l),i=!o&&s&&a&&!O&&!er[s]&&!eA.current.has(s);o&&(null==X?void 0:X.length)>0?(eA.current.add(l),ev((0,u.FX)({account:l}))):i&&(eA.current.add(s),ev((0,u.FX)({account:s})))},[et.customerId,X,null==et?void 0:et.childAccountExists,O,ev,er]),(0,a.useEffect)(()=>{var e,t;O&&(null==X?void 0:X.length)>0&&eE.split("-")[1]>=1&&(null==(e=X[eE.split("-")[1]-1])?void 0:e.childAccountExists)&&ev((0,u.FX)({account:null==(t=X[eE.split("-")[1]-1])?void 0:t.customerId,isSalesRep:O}))},[eE,X,O,ev]),(0,a.useEffect)(()=>{let e=eb.get("openFlyout"),t=new URLSearchParams(eb.toString());if("account"===e){_(!0),t.delete("openFlyout");let e=t.toString();ew.replace(e?"".concat(ey,"?").concat(e):ey)}else if("address"===e){K(!0),t.delete("openFlyout");let e=t.toString();ew.replace(e?"".concat(ey,"?").concat(e):ey)}else if("department"===e){ta(!0),t.delete("openFlyout");let e=t.toString();ew.replace(e?"".concat(ey,"?").concat(e):ey)}else if("user"===e){ev((0,u.qO)({isSalesRep:O,fetchAll:!0})),H(!0),t.delete("openFlyout");let e=t.toString();ew.replace(e?"".concat(ey,"?").concat(e):ey)}},[eb,ew,ey]);let tm=e=>{e.target.scrollTop>10?eS(!0):eS(!1)},tx=(0,a.useCallback)(async e=>{let t=e||(null==et?void 0:et.customerId);ez(!0),tp&&t&&!(0,w.A)()&&(ev((0,m.OT)({page:1,pageSize:50,referenceCode:t})),ev((0,x.Wv)({accountId:t}))),await ev((0,u.V1)(e)),ez(!1)},[ev,tp,null==et?void 0:et.customerId]),tg=null!=(l=null==i?void 0:i.THRESHOLD_TO_VIRTUALIZE_ACCOUNT_LIST)?l:b.$O,tf=e=>(0,U.oQ)(e,eR,ej),tv=(0,a.useCallback)(async e=>{e_(e)},[]),tA=(0,a.useMemo)(()=>{let e=null==X?void 0:X.find(e=>(null==e?void 0:e.customerId)===eD||(null==e?void 0:e.customerAccountNumber)===eD);if(!e){var t;e=null==er||null==(t=er[eO])?void 0:t.find(e=>(null==e?void 0:e.customerId)===eD||(null==e?void 0:e.customerAccountNumber)===eD)}return e},[eD,X,eO,er]),tb=()=>{let e;if(eO!==eD)if(eM.length>0)e=null==eM?void 0:eM.find(e=>{let{customerId:t}=e;return t===eD});else{var t;e=null==(t=er[eO])?void 0:t.find(e=>{let{customerId:t}=e;return t===eD})}else e=null==X?void 0:X.find(e=>{let{customerId:t}=e;return t===eO});return e},ty=e=>null==ec?void 0:ec.find(t=>{let{shippingAddress:l}=t;return e===(null==l?void 0:l.shipToId)}),tw=async(e,t)=>{let l=tb(),s=ty(e),n=await ev((0,u.cd)({parentAccountId:eO!==eD?eO:"",customerAccountNumber:eD,shippingAddressId:e,departmentId:t}));if((null==n?void 0:n.payload)==="Error"){eU(!1),_(!1),Z(!1),K(!1),ev((0,h.rG)(ea));return}ev((0,u.uR)({accountInfo:l,shippingInfo:s}
1)),ev((0,u.cl)(ec)),ev((0,g.s5)()),eU(!1),_(!1),Z(!1),K(!1),ta(!1),ev((0,m.DB)()),(0,v.zy)("blueHeartSkus",{}),ev((0,u.j4)(!0)),(0,v.zy)(C.tP,null==l?void 0:l.customerId)},tC=e=>{(null==et?void 0:et.customerId)&&(null==et?void 0:et.warehouseId)&&!ep?O&&ev((0,u.bS)({})):e.preventDefault()},tS=(0,a.useCallback)(e=>{e!==eD&&(e_(e),tx(e))},[eD,tx]),tT=(0,a.useCallback)(e=>{let t=X.findIndex(t=>t.customerId===e);-1!==t&&(0,U.Ay)("item-".concat(t+1),ej,eR,eL,X,er,ev,O)},[X,er,ev,O]),tj={...C.GY,cta_text:(0,C.Zn)({account:(0,C.TZ)(tA)||eD}),cta_type:eT||eN?C.vR:C.r$};if((null==X?void 0:X.length)===0&&!(0,y.A)()&&!(0,w.A)())return null;let tN=async()=>{(0,v.zy)(C.tP,null==et?void 0:et.customerId),tc(!1),ti&&await (0,c.DI)(eY,eW)};return(0,s.jsxs)(s.Fragment,{children:[td&&(0,s.jsx)("div",{"data-testid":"header-overlay",className:"fixed top-0 left-0 z-50 w-screen h-full bg-black opacity-50","aria-hidden":"false"}),(0,s.jsxs)("section",{"data-testid":"account-selector-container",className:(0,A.Ay)("flex w-full flex-col gap-2 bg-primary-blue-100 py-2","md:flex-row md:items-center md:gap-6",td?"pointer-events-none relative z-[50] min-w-fit px-4 md:mx-8 md:!w-fit-content md:rounded-lg md:px-2":"px-4 md:px-8 lg:px-8 xl:mx-auto",tt&&"max-h-8 py-1 md:max-h-none md:py-2",tt&&!td&&"overflow-hidden"),children:[(0,s.jsx)("div",{className:"sr-only",id:"dialog",children:"account selector dialog"}),(0,s.jsxs)(k.mj,{open:r,onOpenChange:e=>{e&&tx(),(0,U.a6)(e,P,_,eR,ej,e_,et.customerId,eI,eP,eK,Z)},children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsx)(el,{addressDetails:X,addressSelected:et,checkIfSalesRepCookieExist:O,setSelectedId:e_,disableAccountSelector:P})}),(0,s.jsx)(T.default,{variant:"icon",size:"icon","data-testid":"hide-show-account-selector-button",className:"block ml-2 md:hidden",onClick:()=>{tl(e=>!e)},children:(0,s.jsx)(I.A,{})})]}),(0,s.jsxs)(k.Z7,{side:"right","aria-labelledby":"dialog","data-testid":"scrollable-container","aria-describedby":"dialog",className:"px-0 pt-0 pb-0 overflow-x-hidden md:rounded-lg",crossIcon:!!(null==et?void 0:et.customerId)&&!ep,overlayClassName:"bg-black opacity-35",closeButtonText:null===S.A||void 0===S.A?void 0:S.A.closeButtonTextForSROnly,crossSvgClassName:"h-8 w-8 p-[6px]",crossIconClassName:"".concat((null==X?void 0:X.length)>(null==i?void 0:i.THRESHOLD_TO_ENABLE_SEARCH_ON_ACCOUNT_SELECTOR)&&0===eM.length?"fixed":"absolute"," ").concat(eC?"top-2 right-0 flex justify-end z-[99] p-4":"top-6 z-50 right-4"," focus:opacity-100 ").concat(eB||eG?"hidden":""),onEscapeKeyDown:e=>{(null==et?void 0:et.customerId)&&!ep?O&&ev((0,u.bS)({})):e.preventDefault()},onInteractOutside:tC,onScroll:tm,setIsFlyoutOpen:e=>{ev((0,u.bS)({})),_(e)},children:[(0,s.jsxs)("section",{className:"relative mx-6 flex flex-1 flex-col rounded-lg pb-[80px] md:w-[336px]",children:[(0,s.jsxs)("article",{className:"flex flex-col ".concat((null==X?void 0:X.length)>(null==i?void 0:i.THRESHOLD_TO_ENABLE_SEARCH_ON_ACCOUNT_SELECTOR)&&0===eM.length?"fixed top-0 z-10 bg-white":""),children:[(0,s.jsx)("section",{"data-testid":"header-container",className:"mt-6 w-[90%]",children:(0,s.jsx)(R.A,{variant:"h3",as:"h3",className:"mb-6 text-[26px] font-bold normal-case leading-8",children:null===S.A||void 0===S.A?void 0:S.A.selectAccount})}),(null==X?void 0:X.length)>(null==i?void 0:i.THRESHOLD_TO_ENABLE_SEARCH_ON_ACCOUNT_SELECTOR)&&(0,s.jsx)($.A,{label:S.A.searchBoxLabel,placeholder:"",containerClassName:"".concat((null==X?void 0:X.length)>(null==i?void 0:i.THRESHOLD_TO_ENABLE_SEARCH_ON_ACCOUNT_SELECTOR)&&0===eM.length?"w-[calc(100vw-24px-24px)] md:w-[94%]":"w-full"," mb-4"),searchValue:eN,searchValueChange:eI,clearSearchValue:()=>{eI(""),eP([]),eK(!1)},searchOnEnter:!0,onEnterHandler:()=>{let e=async()=>{let e=[];
1if(O){var t;e=await (0,d.uc)(null==(t=(0,v.hk)(b.Jw,!0))?void 0:t.accessToken,eN)}else e=await (0,d.Cg)(eW,eN);let l=e.map(e=>{var t,l,s,n,a,o,i,r,d,c,u,p,h,m,x,g,f;return{...e,customerName:null==e||null==(t=e.customerName)?void 0:t.toLowerCase(),shipToAddressLine1:null==e||null==(l=e.shipToAddressLine1)?void 0:l.toLowerCase(),shipToAddressLine2:null==e||null==(s=e.shipToAddressLine2)?void 0:s.toLowerCase(),shipToAddressLine3:null==e||null==(n=e.shipToAddressLine3)?void 0:n.toLowerCase(),shipToCity:null==e||null==(a=e.shipToCity)?void 0:a.toLowerCase(),shipToCountry:null==e||null==(o=e.shipToCountry)?void 0:o.toLowerCase(),billingAddress:{billToAddressLine1:null==e||null==(r=e.billingAddress)||null==(i=r.addressLine1)?void 0:i.toLowerCase(),billToAddressLine2:null==e||null==(c=e.billingAddress)||null==(d=c.addressLine2)?void 0:d.toLowerCase(),billToAddressLine3:null==e||null==(p=e.billingAddress)||null==(u=p.addressLine3)?void 0:u.toLowerCase(),billToCity:null==e||null==(m=e.billingAddress)||null==(h=m.city)?void 0:h.toLowerCase(),billToState:null==e||null==(x=e.billingAddress)?void 0:x.state,billToZipCode:null==e||null==(g=e.billingAddress)?void 0:g.zipCode,billToCountry:null==e||null==(f=e.billingAddress)?void 0:f.country}}}).filter(e=>!e.doNotShip||""===e.parentId);l.some(e=>{let{customerId:t}=e;return t===eD})||(e_(""),eF("")),eP(l),eZ(!1)};eN.length>=3&&(eK(!0),eZ(!0),e())}})]}),eB?(0,s.jsx)("div",{className:"flex h-[50vh] w-full items-center justify-center lg:h-screen","data-testid":"account-selector-flyout-loader",children:(0,s.jsx)(j.A,{className:"w-16 h-16"})}):eV?eG?(0,s.jsx)("div",{className:"flex h-[70vh] w-full items-center justify-center","data-testid":"account-selector-flyout-loader",children:(0,s.jsx)(j.A,{className:"w-12 h-12"})}):eM.length>0?(0,s.jsx)(es.A,{selectedId:eD,setSelectedId:e_,searchResult:eM,filterValue:eN,setSelectedParentId:eF,handleAccordionSelect:tT,getShippingAddressesOnSearchOrAccountChange:tx,virtualizeThreshold:tg}):(0,s.jsx)("div",{className:"flex items-center w-full mt-48","data-testid":"account-selector-flyout-loader",children:(0,s.jsx)(D.A,{children:S.A.noResultForFilterText})}):(null==X?void 0:X.length)>0?(0,s.jsx)(E.nD,{type:"single",defaultValue:"item-1",value:eE,onValueChange:e=>(0,U.Ay)(e,ej,eR,eL,X,er,ev,O),collapsible:!0,className:"flex w-full flex-col gap-y-[12px] ".concat((null==X?void 0:X.length)>(null==i?void 0:i.THRESHOLD_TO_ENABLE_SEARCH_ON_ACCOUNT_SELECTOR)?"mt-[180px]":""),children:X.map((e,t)=>{var l;return(0,s.jsxs)(E.As,{className:"flex h-auto w-full flex-col gap-y-4 rounded-lg border-[1px] border-[neutral] px-4 py-[16px] ".concat(eE==="item-".concat(t+1)?"border-blue":""),value:"item-".concat(t+1),children:[(0,s.jsx)(E.$m,{className:"w-full p-0 border-none max-h-10",children:(0,s.jsxs)("div",{className:"flex flex-col items-start",children:[(null==e?void 0:e.isNonDigital)&&(0,s.jsx)(L.A,{variant:"deactivated",className:"px-1 capitalize rounded md:text-xs/4 lg:text-xs/4 xl:text-xs/4",children:S.A.nonDigital}),(0,s.jsx)(D.A,{className:"text-base font-bold leading-5 capitalize",children:(0,p.Q)(null==e?void 0:e.customerName)})]})}),(0,s.jsxs)(E.ub,{children:[er&&e.customerId&&(null==(l=er[e.customerId])?void 0:l.length)>(null==i?void 0:i.THRESHOLD_TO_ENABLE_SEARCH_ON_ACCOUNT_SELECTOR)&&(0,s.jsx)(M.L,{inputValue:ek,inputOnChangeHandler:tf,filter:eT,setFilter:ej,setInputValue:eR,label:null===S.A||void 0===S.A?void 0:S.A.subAccountSearchBoxLabel}),(0,s.jsx)(D.A,{className:"text-sm font-bold text-neutral-700",children:(null==e?void 0:e.childAccountExists)?S.A.parentAccount:null}),(0,s.jsx)(en.A,{subAccountDetails:er,customerId:e.customerId,filter:eT,parentFilter:eN,parentAccountObject:e,addressDetails:X,setSelectedParentId:eF,onAddressContainerClick:tS,selectedId:eD,onValueChangeRadioGroup:tv,isSubAccountFetchingLoading:ed,virtualizeThreshold:tg})]})]},null==e?void 0:e.customerId)})}):(0,s.jsx)(D.A,{children:S.A.noResultForFilterText})]}),(0,s.jsx)(k.bt,{className:"fixed bottom-0 flex h-[72px] w-full items-center justify-center rounded-b-lg bg-white px-8 py-4 shadow-[0_0_4px_0_rgba(0,0,0,0.25)] md:w-[384px] md:pr-8",children:(0,s.jsx)(T.default,{testId:"set-account-button",variant:"secondary",size:"lg",className:"h-[40px] w-full md:w-[20rem]",disabled:(null==X?void 0:X.length)===0||!eD||eB||eG||eH,onClick:()=>{let e=tb();if(O){(null==ec?void 0:ec.length)===1?(H(!0),q(!0)):(Z(!0),K(!0)),z(e),F(eO),_(!1),eI(""),eR(""),eK(!1),eP([]);return}if((null==ec?void 0:ec.length)===1)if(th)_(!1),ta(!0);else{var t,l;eU(!0),tw(null==(l=ec[0])||null==(t=l.shippingAddress)?void 0:t.shipToId,(null==e1?void 0:e1.length)===1?e1[0].id:void 0)}else _(!1),Z(!0),K(!0)},analyticsData:!O&&tj,children:eH||e6||e8||ed?(0,s.jsx)("div",{className:"mx-auto flex min-h-[20px] items-center justify-center",children:(0,s.jsx)(N.A,{width:"64",height:"40"})}):(0,s.jsx)("div",{children:(null==ec?void 0:ec.length)!==1||O||th?null===S.A||void 0===S.A?void 0:S.A.nextLabel:null===S.A||void 0===S.A?void 0:S.A.doneLabel})})})]})]},"center"),!(tn&&td)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Y,{shippingAddress:ec,addressDetail
1s:X,addressSelected:et,isDeliveryAddressFlyoutOpen:V,onDeliveryAddressChangeHandler:e=>{!((null==eu?void 0:eu.length)<=1)&&(null==et?void 0:et.warehouseId)&&!O&&(K(e),e?tx(null==et?void 0:et.customerId):Z(e))},setIsDeliveryAddressFlyoutOpen:K,checkIfSalesRepCookieExist:O,handleOutClick:tC,handleScroll:tm,setIsFlyoutOpen:_,isNavigatedFromAccountFlyout:G,flyoutDisplayAccount:tA,setDeliveryAddressHandler:e=>{if(O){let t=ty(e);ev((0,u.bS)(t)),K(!1),H(!0),q(!0);return}th?(e0(e),K(!1),_(!1),ta(!0)):(eU(!0),tw(e,(null==e1?void 0:e1.length)===1?e1[0].id:void 0))},isLoading:eB,setIsDeliveryAddressLoading:ez,selectedId:eD,currentlySelectedShippingAddresses:eu,isTokenShipToInActive:ep,commonConfigData:i,salesRepSelectedAddress:eh,isFetchingShippingAddresses:em,isDepartmentLoading:e6||e8,userMustSelectDepartment:th}),tp&&(0,s.jsx)(Q.A,{addressSelected:et,isOpen:J?W:e9,onCloseFlyout:()=>{ta(!1)},onConfirmSelection:e=>{var t,l;eU(!0),!e&&e2&&ev((0,m.DB)()),tw(eX||(null==ec||null==(l=ec[0])||null==(t=l.shippingAddress)?void 0:t.shipToId),e)},selectedDepartment:e3,flyoutDisplayAccount:tA,onOpenFlyoutFromAccountSelector:()=>{ev((0,m.c6)(e4)),ev((0,m.$B)(e5)),ev((0,x.rw)(e7)),ta(!0)},setIsFlyoutOpen:_,setIsDeliveryAddressFlyoutOpen:K,isLoading:eB,isNavigatedFromAccountFlyout:!0})]}),td&&(0,s.jsx)(ee,{doNotShowAgain:ti,handleCloseAccountSelectedBanner:tN,setDoNotShowAgain:tr})]})]})},ei=eo;eo.propTypes={commonConfigData:r().object,isFlyoutOpen:r().bool.isRequired,setIsFlyoutOpen:r().func.isRequired,setUserFlyoutOpen:r().func.isRequired,checkIfSalesRepCookieExist:r().bool,setSelectedAddress:r().func,selectedAddress:r().object,disableAccountSelector:r().bool,setParentAccountId:r().func,isDeliveryAddressFlyoutOpen:r().bool,setIsDeliveryAddressFlyoutOpen:r().func,isNavigatedFromAccountFlyout:r().bool,setIsNavigatedFromAccountFlyout:r().func,setIsNavigatedFromDeliveryAddressFlyout:r().func,setIsDepartmentFlyoutOpen:r().func,isDepartmentFlyoutOpen:r().bool}},86416:(e,t,l)=>{l.d(t,{A:()=>u});var s=l(95155);l(12115);var n=l(12758),a=l.n(n),o=l(33810),i=l(1400),r=l(67219),d=l.n(r);let c=e=>{let{message:t,className:l}=e;return(0,s.jsx)("article",{className:"mb-4 w-full rounded-lg border border-l-8 !border-darker-blue bg-subtle-blue ".concat(l),children:(0,s.jsxs)("section",{className:"flex items-center gap-4 px-4 py-4 text-left",children:[(0,s.jsx)("section",{children:(0,s.jsx)(o.A,{width:24,height:24,fill:d().theme.extend.colors["darker-blue"]})}),(0,s.jsx)(i.A,{className:"text-xs text-darker-blue",children:t})]})})};c.propTypes={message:a().string,className:a().string};let u=c},87509:(e,t,l)=>{l.d(t,{A:()=>n});var s=l(12115);function n(e,t,l){let n=(0,s.useDeferredValue)(t);return(0,s.useMemo)(()=>(function(e,t,l){if(!t||0===t.trim().length)return e;let s=t.toLowerCase().trim().split(/\s+/);return e.filter(e=>{let t=Object.values(l(e)).toString().toLowerCase();return s.every(e=>t.includes(e))})})(e,n,l),[e,n])}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.