1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5482],{93:(e,t,i)=>{i.d(t,{WarehouseSummaryUI:()=>L});var r=i(95155),n=i(3783),o=i(46759),a=i(22665),l=i(27116),s=i(34971),c=i(58905),d=i(24880),u=i(25719),m=i(27966),f=i(86670),p=i(12158),h=i(3187);let x=(0,f.default)(m.default)` 2 display: flex; 3 flex-direction: row; 4 justify-content: center; 5 align-items: center; 6 margin-top: ${d.i_v}; 7 margin-bottom: ${d.D3H}; 8 column-gap: ${d.iAn}; 9`,v=(0,f.default)(p.Text)` 10 color: #cc0033; 11 font-size: ${d.qED}; 12 font-weight: ${d.Pqj}; 13 margin: 0; 14`,y=(0,f.default)(m.default)` 15 width: 100%; 16`,g=(0,f.default)(m.default)` 17 border: 1px solid ${d.XgP}; 18 display: flex; 19 flex-direction: column; 20 align-items: center; 21 margin-top: 14px; 22 margin-bottom: ${d.pMV}; 23 padding: ${d.Mzk}; 24`,b=(0,f.default)(m.default)` 25 display: flex; 26 width: 100%; 27 justify-content: space-between; 28 margin-top: ${d.D3H}; 29 margin-bottom: ${d.Mzk}; 30 31 & div { 32 color: ${d.S6v} !important; 33 } 34`,w=(0,f.default)(h.Link)` 35 width: auto; 36 text-decoration: underline; 37 color: ${d.S6v}; 38 line-height: 24px; 39`,_=(0,f.default)(m.default)` 40 display: flex; 41 width: 100%; 42 justify-content: center; 43 align-items: center; 44 column-gap: ${d.m72}; 45`,k=(0,f.default)(p.Text,{shouldForwardProp:()=>!0})(({color:e})=>({color:e,lineHeight:d.i_v,whiteSpace:"pre-wrap"})),S=(0,f.default)(p.Text)({color:d.S6v,lineHeight:d.i_v}),T=(0,f.default)(p.Text)({fontSize:d.MkR,fontWeight:d.Pqj});(0,f.default)(u.CostcoBox)(({theme:e})=>({display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:d.m72,[e.breakpoints.down("md")]:{height:"auto",width:"100%",alignItems:"center"}}));let C=(0,f.default)(u.CostcoBox)({display:"flex",flexDirection:"row",flexWrap:"wrap",dd:{margin:0}}),I=(0,f.default)("dl")({display:"flex",flexDirection:"column",margin:0}),E=({info:e,layout:t})=>(0,r.jsx)(u.CostcoBox,{"data-testid":"compact","data-layout":t,display:"flex",flexDirection:"column",sx:{textAlign:"left"},children:e.map(e=>(0,r.jsx)(k,{color:d.sLX,children:e},e))});var j=i(2377),D=i(98210);let A=({info:e})=>(0,r.jsx)(u.CostcoBox,{"data-testid":"compact",display:"flex",flexDirection:"column",sx:{padding:`0 ${d.Mzk}`},children:(0,r.jsx)(I,{children:e.map((e,t)=>{let i=e.split(/(?: )/),n=`${i[0]} `,o=i.slice(1).join(" ");return(0,r.jsxs)(C,{children:[(0,r.jsx)("dt",{children:(0,r.jsx)(k,{color:d.sLX,children:n})}),(0,r.jsx)("dd",{children:(0,r.jsx)(k,{color:d.sLX,children:o},i[1])})]},`warehouse-hours-${t}-${n.trim()}`)})})}),R=e=>(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:(0,r.jsx)("path",{fill:"#CC1F36",fillRule:"evenodd",d:"m17.277 5-1.458.59 3.932 9.732 1.458-.59L17.277 5ZM15.96 6.826H7.166V11.1h8.793V6.826Zm0 4.571h-5.901v3.971h5.9v-3.971Zm.245 1.394h2.247v2.577h-2.247v-2.577ZM5.612 11.397H9.81v3.971H5.612v-3.971Zm-1.135 4.197V8.633c0-.619-.31-1.188-.83-1.523l-1.182-.759a.302.302 0 0 0-.327.507l1.182.76c.346.222.554.602.554 1.015v8.335H22v-1.374H4.477Zm.172 2.596a.938.938 0 1 1 1.875 0 .938.938 0 0 1-1.875 0Zm.486 0a.452.452 0 1 0 .905 0 .452.452 0 0 0-.905 0Zm14.937-.938a.938.938 0 1 0 0 1.876.938.938 0 0 0 0-1.875Zm0 1.39a.452.452 0 1 1 .001-.904.452.452 0 0 1 0 .904Zm-8.354-.3a1.11 1.11 0 1 1 2.222 0 1.11 1.11 0 0 1-2.222 0Zm.576 0a.535.535 0 1 0 1.07 0 .535.535 0 0 0-1.07 0Z",clipRule:"evenodd"})}),M="h3_informative_heading",V="informative_link",B=({cityState:e,link:t,addressLines:i,daysOpen:n,layout:o})=>(0,r.jsxs)(y,{"data-layout":o,"data-testid":"informative",children:[(0,r.jsx)(j.Divider,{sx:{backgroundColor:"#cc0033",height:"6px",width:"100%"}}),(0,r.jsxs)(u.CostcoBox,{alignItems:"center",display:"flex",flexDirection:"column",children:[(0,r.jsxs)(x,{children:[(0,r.jsx)(R,{width:"48",height:"40"}
45),(0,r.jsx)(v,{component:"h2",variant:"t2",children:"In Warehouse"})]}),(0,r.jsx)(S,{variant:"t5",children:"Shop at your local Costco Business Center warehouse."})]}),(0,r.jsxs)(g,{children:[(0,r.jsx)(T,{component:"h3",id:M,children:e}),(0,r.jsxs)(b,{children:[(0,r.jsx)(E,{info:i}),(0,r.jsx)(A,{info:n})]}),t&&(0,r.jsx)(_,{children:(0,r.jsxs)(w,{"aria-labelledby":`${V} ${M}`,href:t,id:V,role:"link",children:["View Warehouse Details",(0,r.jsx)(D.A,{color:d.oKw,height:"20px",width:"20px"})]})})]})]});function L({url:e,headers:t,variant:i="informative",layout:d,moduleSettings:u,locale:m="en-us"}){let{warehouseData:f,isLoading:p}=(0,c.T)(e,t);if(p)return(0,r.jsx)(s.Skeleton,{width:"180px",variant:"textMultipleLines",lines:2});if(!f)return null;let h=`${f.address.city}, ${f.address.territory}`,x=(0,l.w)(f.hours,m),v=(0,l.hU)(f.address),y=u?new n.n({composable_window:[],key_value:u.key_value}).getKeyValueItem(o.GK):void 0,g=(0,a.F)({warehouseData:f,warehousesPageBaseUrl:y??""}),b=g?/^https?:\/\//i.test(g)?g:`${window.location.origin}${g}`:void 0,w=(0,l.uY)(d);return"compact"===i?(0,r.jsx)(E,{info:x??[],layout:w}):"informative"===i?(0,r.jsx)(B,{addressLines:v,cityState:h,daysOpen:x??[],link:b??void 0,layout:w}):null}},8851:(e,t,i)=>{i.d(t,{ChildWrapper:()=>c,Column1:()=>l,Column2:()=>s,Wrapper:()=>a});var r=i(27966),n=i(86670),o=i(24880);let a=(0,n.default)(r.default)(()=>({display:"flex",flexWrap:"wrap",gap:o.i_v,marginBottom:o.i_v,"> *":{maxWidth:"100%"},"@media (max-width: 375px)":{gap:o.Mzk,marginBottom:o.Mzk}})),l=(0,n.default)(r.default)(({includesDivider:e,layoutRatio:t})=>{let i,r=e?`calc(385px - ${o.i_v})`:`calc(385px - ${o.i_v} / 2)`,n=`1 1 calc(50% - ${o.i_v} / 2)`;switch(e&&(n=`1 1 calc(50% - ${o.pMV})`),t){case"33/66":case"25/75":i="1 1 0";break;case"66/33":i="2 2 0";break;case"75/25":i="3 3 0";break;case"50/50":i=n}return{display:"flex",flexDirection:"column",gap:o.i_v,minWidth:r,maxWidth:"100%",flex:i,alignSelf:"flex-start",..."50/50"===t&&{maxWidth:"100%"},"@media (max-width: 375px)":{minWidth:"100%",gap:o.Mzk,flex:"50/50"===t?`1 1 calc(50% - ${o.Mzk} / 2)`:i}}}),s=(0,n.default)(r.default)(({includesDivider:e,layoutRatio:t})=>{let i,r=e?`calc(385px - ${o.i_v})`:`calc(385px - ${o.i_v} / 2)`,n=`1 1 calc(50% - ${o.i_v} / 2)`;e&&(n=`1 1 calc(50% - ${o.i_v})`);let a=`1 1 calc(50% - ${o.Mzk} / 2)`,l={};switch(t){case"33/66":i="2 2 0";break;case"66/33":case"75/25":i="1 1 0";break;case"25/75":i="3 3 0";break;case"50/50":i=n,l.maxWidth="100%"}return{display:"flex",flexDirection:"column",flexWrap:"wrap",gap:o.i_v,maxWidth:"100%",minWidth:r,flex:i,alignContent:"flex-start",alignItems:"flex-start",...l,"@media (max-width: 375px)":{minWidth:"100%",gap:o.Mzk,flex:"50/50"===t?a:i}}}),c=(0,n.default)(r.default)({width:"100%"})},9339:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={callServer:function(){return o.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let o=i(77304),a=i(4060),l=i(77197)},10020:(e,t,i)=>{i.d(t,{AccordionSetUI:()=>k});var r=i(95155),n=i(24880),o=i(90830),a=i(40131),l=i(12115),s=i(27966),c=i(33423),d=i(68736),u=i(86670);let m=(0,u.default)(s.default,{})(()=>({"&:hover":{cursor:"pointer"},display:"flex",overflow:"hidden",transformOrigin:"right center",transition:"transform 0.3s ease",width:"100%",gap:"8px"})),f=(0,u.default)(s.default,{})(()=>({"&:hover":{cursor:"pointer"},display:"flex",flexDirection:"column",overflow:"hidden",transformOrigin:"right center",transition:"transform 0.3s ease",width:"100%"})),p=(0,u.default)(s.default,{})(()=>({display:"flex",justifyContent:"center",minHeight:"40px",minWidth:"50px",width:"50px",marginTop:"8px"})),h=(0,l.forwardRef)(({activeTextBackgroundColor:e,activeTextColor:t,defaultTextBackgroundColor:i,defaultTextColor:n,hoverTextBackgroundColor:o,hoverTextColor:l,icons:s,titles:d,useActiveStyles:u,useHoverStyles:h},x)=>{let{trackEvent:v}=(0,c.z)();return(0,r.jsxs)(m,{onClick:()=>{v({component:{identifier:"Accordion Set",trackedData:[d[0]],type:"ui"},trackType:"navigation"})},ref:x,children:[s&&(0,r.jsx)(p,{children:u?s.activeIconColor:h?s.hoverIconColor:s.defaultIconColor}),(0,r.jsx)(f,{children:d.map(s=>{var c;let d=!["body","caption_v2","disclaimer","body_copy_v2"].includes(s.select_text_type);return(0,r.jsx)(a.MarketingTypography,{color:u?t:h?l:n,component:d?s.select_semantics_type:void 0,variant:s.select_text_type,isMarkdown:!0,sx:{display:"block",backgroundColor:u?e:h?o:i},children:s.markdown_text},null==(c=s._metadata)?void 0:c.uid)})})]})});h.displayName="ItemIconTitle";let x={padding:`${n.iAn} ${n.Mzk} ${n.Mzk} ${n.Mzk}`}
45,v=(0,l.forwardRef)(({activeTextBackgroundColor:e,activeTextColor:t,activeDividerColor:i,defaultTextBackgroundColor:o,defaultTextColor:a,defaultDividerColor:s,hoverTextBackgroundColor:c,hoverTextColor:u,hoverDividerColor:m,icons:f,isActive:p,isExpanded:v,details:y,onChange:g,titles:b},w)=>{let _,[k,S]=(0,l.useState)(!1),[T,C]=(0,l.useState)(!1),I=k||T,E={"&.MuiAccordion-root":{"&:hover":{borderTopColor:`${m} !important`,borderBottomColor:`${m} !important`},"&::before":{backgroundColor:n.XgP},".MuiCollapse-root":{transitionDuration:"01ms !important"},overflow:"hidden",borderOpacity:.5,borderTopColor:`${s} !important`,borderBottomColor:`${s} !important`},"&.MuiAccordion-root.Mui-expanded":{"&::before":{opacity:100},borderTopColor:`${i} !important`,borderBottomColor:`${i} !important`},backgroundColor:n.U_w,boxShadow:"none",margin:0},j=(_=p?e:I?c:o,{"&.MuiButtonBase-root":{"&.MuiAccordionSummary-root":{padding:`${n.Mzk}`},"&:hover":{background:`${_} !important`},background:`${_} !important`,transitionDuration:"0ms"}});return(0,r.jsx)(d.Accordion,{expandIconSx:{color:p?t:a},secondaryComponent:(0,r.jsx)(h,{activeTextBackgroundColor:e,activeTextColor:t,defaultTextBackgroundColor:o,defaultTextColor:a,hoverTextBackgroundColor:c,hoverTextColor:u,icons:f,ref:w,titles:b,useActiveStyles:p,useHoverStyles:I}),accordionDetailsSx:x,accordionSummarySx:j,accordionSx:E,disableGutters:!0,displayTitle:!1,isExpanded:v,onBlur:()=>S(!1),onChange:()=>{g()},onFocus:()=>S(!0),onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),headingSlotTag:"div",children:v?y:null})});v.displayName="AccordionItem";let y=({content:e,icons:t,accordionContentEntries:i,isMultiAccordionOpen:n,bodyBackgroundColor:o,colorConfigHashMap:a})=>{var d;let{trackEvent:u}=(0,c.z)(),[m,f]=(0,l.useState)([]);if(!e||!a)return null;let{accordionactiveTextBackgroundColor:p,accordiondefaultTextBackgroundColor:h,accordionhoverTextBackgroundColor:x,accordionactiveTextColor:y,accordiondefaultTextColor:g,accordionhoverTextColor:b,accordionactiveDividerColor:w,accordiondefaultDividerColor:_,accordionhoverDividerColor:k}=a;return(0,r.jsx)(s.default,{sx:{backgroundColor:(null==(d=null==o?void 0:o.background_color)?void 0:d.hex)||"#FFF"},children:(e??[]).map(e=>{let o,a=e._metadata.uid,l=e.ad_ref[0].uid,s=m.includes(l);return(0,r.jsx)(v,{activeTextBackgroundColor:p,activeTextColor:y,activeDividerColor:w,defaultTextBackgroundColor:h,defaultTextColor:g,defaultDividerColor:_,hoverTextBackgroundColor:x,hoverTextColor:b,hoverDividerColor:k,isActive:s,isExpanded:s,icons:t[a],details:(o=i.find(e=>l in e))?o[l]:void 0,onChange:()=>{var t,i,r,o,a;let s,c;return r=(null==(i=null==(t=e.accordion_title_group)?void 0:t[0])?void 0:i.markdown_text)||"",s=m.includes(l),void(c=(null==(a=("u">typeof window?(null==(o=null==window?void 0:window.digitalData)?void 0:o.pageName)??"":"").split("|")[0])?void 0:a.trim())||"",u({trackType:"navigation",component:{type:"ui",identifier:`${c} Accordion`,trackedData:[(r??"").trim(),s?"Shrink":"Expand"]}}),n?f(e=>e.includes(l)?e.filter(e=>e!==l):[...e,l]):f(e=>e.includes(l)?[]:[l]))},titles:e.accordion_title_group},a)})})};var g=i(44154);let b=(0,u.default)(s.default)(()=>({display:"flex",flexDirection:"column",width:"100%"})),w=(0,u.default)(s.default)(({})=>({})),_=(0,u.default)(s.default)(()=>({paddingBottom:n.Mzk})),k=({header:e,accordion_set:t,isMultiAccordionOpen:i,bodyBackGroundColor:l,svgIconsMap:s={},accordionContentEntries:c,colorConfigHashMap:d})=>{let u=Object.keys(s).reduce((e,t)=>(e[t]=(({icon:e,adobeIcon:t,originalSvg:i,activeIconColor:n,defaultIconColor:o,hoverIconColor:a})=>(e||t)&&i?{activeIconColor:(0,r.jsx)(g.AccordionItemIcon,{color:n,icon:e,adobeIcon:t,originalSvg:i}),defaultIconColor:(0,r.jsx)(g.AccordionItemIcon,{color:o,icon:e,adobeIcon:t,originalSvg:i}),hoverIconColor:(0,r.jsx)(g.AccordionItemIcon,{color:a,icon:e,adobeIcon:t,originalSvg:i})}:{activeIconColor:null,defaultIconColor:null,hoverIconColor:null})(s[t]),e),{});return(0,r.jsx)(o.Analytics,{analyticData:{component:{identifier:"accordion-set",type:"nav"},trackType:"navigation"},children:(0,r.jsxs)(b,{"data-testid":"AccordionSet",children:[(0,r.jsx)(w,{children:e.map((e,t)=>{var i,o,l;return(0,r.jsx)(a.MarketingTypography,{color:(null==(o=null==(i=e.markdown_text.color)?void 0:i.text_color)?void 0:o.hex)||n.hGW,component:e.markdown_text.select_semantics_type,isMarkdown:!0,variant:e.markdown_text.select_text_type,sx:{marginBottom:n.iAn,"&:last-child":{marginBottom:n.Mzk}},children:e.markdown_text.markdown_text},(null==(l=e.markdown_text._metadata)?void 0:l.uid)||t)})}),(0,r.jsx)(_,{children:(0,r.jsx)(y,{content:t,icons:u,accordionContentEntries:c,isMultiAccordionOpen:i,bodyBackgroun
45dColor:l,colorConfigHashMap:d})})]})})}},12854:(e,t,i)=>{i.d(t,{AdWithPopupClient:()=>d});var r=i(95155),n=i(12115),o=i(10874),a=i(49090),l=i(90830),s=i(32605);let c={"& .MuiDialog-paper.MuiPaper-root":{maxWidth:"90%",margin:"0 auto",width:{xs:"90%",md:"1050px",lg:"1200px"}}},d=({baseContent:e,flyoutBodyContent:t,popupTitle:i,popupFooterLinks:d,baseContentTitle:u})=>{let[m,f]=(0,n.useState)(!1),p=function(){let e=()=>"u">typeof window&&!!document.getElementById(s.G),[t,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{let t=()=>i(e());t();let r=new MutationObserver(t);return r.observe(document.body,{childList:!0,subtree:!0}),()=>r.disconnect()},[]),t}();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Analytics,{analyticData:{component:{type:"ui",trackedData:[`${u} Pop-up`]},trackType:"navigation"},children:(0,r.jsx)(o.Button,{sx:{"&:has(> div:only-child:empty)":{display:"none"},cursor:"pointer",display:"flex",width:"100%","& *":{pointerEvents:"none"}},"aria-haspopup":"dialog","data-layout":"ad_with_popup",onClick:()=>f(!0),onKeydown:()=>f(!0),uniqueId:i,variant:"text-button",children:e})}),(0,r.jsx)(a.Modal,{isOpen:m,modalTitle:i,buttons:d,onClose:()=>f(!1),scroll:"body",sx:{opacity:+!p,pointerEvents:p?"none":"auto",...c},children:(0,r.jsx)(n.Suspense,{children:(0,r.jsx)(l.Analytics,{analyticData:{trackType:"ad",title:`${u} Pop-up`},children:t})})})]})}},24524:(e,t,i)=>{i.d(t,{ReferAFriendUI:()=>L});var r=i(95155),n=i(12115);let o={currentView:"SignInView"};function a(e,t){switch(t.type){case"NAVIGATE_TO_VIEW":return{...e,currentView:t.payload};case"LINK_GENERATED":return{...e,currentView:"LinkGeneratedView",isLimitReached:t.payload.isLimitReached,referralLink:t.payload.referralLink};case"RESET_STATE":return{...o};default:return console.warn("Unknown action dispatched to referAFriendReducer: ",t),e}}var l=i(66119),s=i(34462),c=i(82696),d=i(40336);let u={revalidateOnFocus:!1,revalidateOnReconnect:!1};var m=i(14898);let f=["CABC","CABD","USBC","USBD"],p=()=>{let e="CABC";if(!e)throw Error("NEXT_PUBLIC_SITE is required for DPC promo code service.");if(!f.includes(e))throw Error(`NEXT_PUBLIC_SITE must be one of ${f.join(", ")}.`);return e},h=async(e,t,i,r)=>{var n;let o,a;if(!i||""===i.trim())throw Error("Access token is required for DPC promo code service.");let l=(n=e.endpoint,o=n.endsWith("/")?n.slice(0,-1):n,a=t?t.startsWith("/")?t:`/${t}`:t,`${o}${a}`),s={method:"POST",headers:{...e.headers,"Content-Type":e.headers["Content-Type"]||"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(r)};return(0,m.G)(l,s,e.timeout)};var x=i(6310),v=i(42138),y=i(10874),g=i(24880),b=i(40131),w=i(25719),_=i(34971),k=i(95097);let S=()=>(0,r.jsxs)(w.CostcoBox,{children:[(0,r.jsxs)(w.CostcoBox,{sx:{display:"flex",flexDirection:"column",gap:g.Mzk},children:[(0,r.jsx)(_.Skeleton,{variant:k.z.TextHeader}),(0,r.jsx)(_.Skeleton,{variant:k.z.TextHeader}),(0,r.jsx)(_.Skeleton,{variant:k.z.TextMultipleLines,lines:5}),(0,r.jsx)(_.Skeleton,{variant:k.z.TextMultipleLines,lines:5}),(0,r.jsx)(_.Skeleton,{variant:k.z.TextMultipleLines,lines:5}),(0,r.jsx)(_.Skeleton,{variant:k.z.TextMultipleLines,lines:5})]}),(0,r.jsxs)(w.CostcoBox,{sx:{display:"flex",flexDirection:"column",marginTop:g.D3H},children:[(0,r.jsx)(_.Skeleton,{variant:k.z.Checkbox}),(0,r.jsxs)(w.CostcoBox,{sx:{display:"flex",flexDirection:"column",gap:g.D3H,marginTop:g.pMV},children:[(0,r.jsx)(_.Skeleton,{variant:k.z.Button}),(0,r.jsx)(_.Skeleton,{variant:k.z.Button})]})]})]}),T=({checkboxInputRef:e,errorNotificationRef:t,handleCheckboxChange:i,handleGenerateReferralLink:n,isLoading:o,msText:a,state:l,textBuilderElement:s})=>o?(0,r.jsx)(S,{}):(0,r.jsxs)(w.CostcoBox,{sx:{display:"flex",flexDirection:"column",gap:g.Mzk},children:[(0,r.jsx)(b.MarketingTypography,{color:g.H4y,variant:"heading_v2",children:a.getStartedLabel}),(0,r.jsx)(b.MarketingTypography,{sx:{fontWeight:g.awq},component:"h2",variant:"subheading_v2",children:a.termsAndConditionsLabel}),s,(0,r.jsxs)(w.CostcoBox,{sx:{display:"flex",flexDirection:"column",gap:g.pMV},children:[(0,r.jsx)(x.S,{id:"refer-a-friend-checkbox",inputRef:e,label:a.checkboxLabel,isChecked:l.isChecked,onChange:i,hasError:"checkbox-required"===l.error,errorText:"checkbox-required"===l.error?a.checkboxErrorText:void 0}),"generate-failed"===l.error&&(0,r.jsx)(v.Notification,{isRole:!0,message:a.generateFailedMessage,ref:t,severity:"critical"}),"membership-expired"===l.error&&(0,r.jsx)(v.Notification,{isRole:!0,message:(0,r.jsxs)(r.Fragment,{children:[a.membershipExpiredMessage," ",(0,r.jsx)("a",{href:a.membershipExpiredLinkHref,children:a.membershipExpiredLinkLabel})," ",a.membershipExpiredSuffix]}),ref:t,severity:"critical"}),(0,r.jsxs)(w.CostcoBox,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:g.D3H,"& > *":{flex:1}},children:[(0,r.jsx)(y.Button,{disabled:l.isGenerating,onClick:n,children:a.generateButtonLabel}),(0,r.jsx)(y.Button,{href:a.cancelButtonHref,variant:"tertiary",children:a.cancelButtonLabel})]})]})]}),C={isChecked:!1,isGenerating:!1,isVerifying:!1,error:null};function I(e,t){switch(t.type){case"SET_CHECKED":return{...e,isChecked:t.payload,error:t.payload&&"checkbox-required"===e.error?null:e.error};case"SET_GENERATING":return{...e,isGenerating:t.payload};case"SET_VERIFYING":return{...e,isVerifying:t.payload};case"SET_ERROR":return{...e,error:t.payload};case"CLEAR_ERROR":return{...e,error:null};default:return e}}let E=({membershipStatusConfig:e,msText:t,onReferralLinkGenerated:i,referralCodeConfig:o,textBuilderElement:a})=>{let m=(0,n.useRef)(null),f=(0,n.useRef)(null),x=(0,n.useRef)(!1),{getToken:v}=(0,d.A)(),[y,g]=(0,n.useReducer)(I,C),b=(0,n.useMemo)(()=>({async verifyReferralMemberCode(e){try{return await h(o,o.verifyPath,e,{businessUnitCode:p()})}catch(e){throw s.v.error({error:e,endpoint:o.endpoint},"Error verifying member referral code."),e}},async generateReferralMemberCode(e){try{return await h(o,o.generatePath,e,{businessUnitCode:p()})}catch(e){throw s.v.error({error:e,endpoint:o.endpoint},"Error generating member referral code."),e}}}),[o]),{membershipStatus:w,isLoading:_,error:k}=(e=>{let{getToken:t,isLoading:i}=(0,d.A)(),r=(0,n.useMemo)(()=>async function(t){if(!t||""===t.trim())throw Error("Access token is required for membership status service.");let i={method:"GET",headers:{...e.headers,Authorization:`Bearer ${t}`}};try{return await (0,l.$3)(e.endpoint,i,e.timeout,e.cacheEnabled,e.ttl)}catch(t){throw s.v.error({error:t,endpoint:e.endpoint},"Error fetching membership status."),t}},[e]),o=(0,n.useCallback)(async()=>{let e=await t(!0);return e?r(e):null},[t,r]),{data:a,isLoading:m,error:f}=(0,c.u)(i?null:"loyalty/membership-status",o,u);return{membershipStatus:a,isLoading:m,error:f}})(e),S=null==w?void 0:w.isVerified,E=!_&&!k&&!0===S&&!x.current,j=_||y.isGenerating||E||y.isVerifying,D=(null==t?void 0:t.referralLinkBaseUrl)||"",A=(0,n.useCallback)(e=>{if(!e)return"";if(!D)throw Error("Referral link base URL is required for referral code generation.");return`${D}${encodeURIComponent(e)}`},[D]),R=(0,n.useCallback)(async()=>{var e;if(!y.isGenerating){if(!y.isChecked){g({type:"SET_ERROR",payload:"checkbox-required"}),null==(e=m.current)||e.focus();return}if(k||void 0===S)return void g({type:"SET_ERROR",payload:"generate-failed"});if(!S)return void g({type:"SET_ERROR",payload:"membership-expired"});g({type:"CLEAR_ERROR"}),g({type:"SET_GENERATING",payload:!0});try{let e=await v(!0);if(!e)throw Error("Access token was not available.");let t=await b.generateReferralMemberCode(e),r=t.referralCode||"";if(""===r&&!t.referrerIncentiveLimitReached)throw Error("Generated referral code was empty.");i({referralLink:""===r?"":A(r),isLimitReached:!!t.referrerIncentiveLimitReached})}catch{g({type:"SET_ERROR",payload:"generate-failed"})}finally{g({type:"SET_GENERATING",payload:!1})}}},[A,v,S,k,i,b,y.isChecked,y.isGenerating]);return((0,n.useEffect)(()=>
45{if(_)return;if(k)return void g({type:"SET_ERROR",payload:"generate-failed"});if(!0!==S||x.current)return;x.current=!0;let e=!1;return(async()=>{try{let r=await v(!0);if(!r)throw Error("Access token was not available.");if(e)return;g({type:"SET_VERIFYING",payload:!0});let n=await b.verifyReferralMemberCode(r);if(e)return;if(n.referrerIncentiveLimitReached)return void i({referralLink:A(n.referralCode||""),isLimitReached:!0});if(n.referralCode&&((e,t)=>{if(null==e)return!1;let i=parseInt(t,10)||2;return e>0&&e===i})(n.usageCount,t.autoAdvanceUsageCount))return void i({referralLink:A(n.referralCode||""),isLimitReached:!!n.referrerIncentiveLimitReached});g({type:"CLEAR_ERROR"})}catch{e||g({type:"SET_ERROR",payload:"generate-failed"})}finally{e||g({type:"SET_VERIFYING",payload:!1})}})(),()=>{e=!0}},[A,v,_,S,k,null==t?void 0:t.autoAdvanceUsageCount,i,b]),(0,n.useEffect)(()=>{var e,t;if("checkbox-required"===y.error){null==(e=m.current)||e.focus();return}("generate-failed"===y.error||"membership-expired"===y.error)&&(null==(t=f.current)||t.focus())},[y.error]),t)?(0,r.jsx)(T,{checkboxInputRef:m,errorNotificationRef:f,handleCheckboxChange:e=>{g({type:"SET_CHECKED",payload:e.target.checked})},handleGenerateReferralLink:R,isLoading:j,msText:t,state:y,textBuilderElement:a}):(console.error("ModuleSettingsText is required for GenerateLinkView"),null)};var j=i(12158),D=i(65138),A=i(13677),R=i(90162),M=i(53076);let V=({msText:e,referralLink:t="",isLimitReached:i=!1,textBuilderElement:o})=>
45{let[a,l]=(0,n.useState)("idle"),[s,c]=(0,n.useState)(!1),d=(0,n.useRef)(null),u=(0,n.useRef)(null),m=(0,n.useRef)(null),f=!!t.trim();if((0,n.useEffect)(()=>{var e,t,r;if("success"===a){null==(e=u.current)||e.focus();return}if("error"===a){null==(t=m.current)||t.focus();return}i&&(null==(r=d.current)||r.focus())},[a,i]),!e)return console.error("ModuleSettingsText is required for LinkGeneratedView"),null;let p=async()=>{if(l("idle"),!f)return void l("error");try{if("u">typeof navigator&&navigator.clipboard){await navigator.clipboard.writeText(t),l("success");return}if("u">typeof document){let e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select();let i=document.execCommand("copy");document.body.removeChild(e),l(i?"success":"error");return}l("error")}catch{l("error")}};return(0,r.jsxs)(w.CostcoBox,{sx:{display:"flex",flexDirection:"column",gap:g.Mzk},children:[(0,r.jsx)(j.Text,{align:"center",bold:!0,variant:"t3",children:e.inviteHeading}),(0,r.jsx)(j.Text,{bold:!0,variant:"b1",children:e.referralLinkHeading}),(0,r.jsxs)(w.CostcoBox,{sx:{display:"flex",flexDirection:"column",gap:g.m72},children:[(0,r.jsx)(D.A,{id:"referral-link",inputLabelId:"referral-link",isMultiline:!0,label:e.referralLinkLabel,value:t}),(0,r.jsx)(j.Text,{color:"medium",variant:"b3",children:e.referralLinkExpiry})]}),i&&(0,r.jsx)(w.CostcoBox,{"data-testid":"limit-reached-notification",ref:d,tabIndex:-1,children:(0,r.jsx)(v.Notification,{message:e.limitReachedMessage,severity:"alert"})}),"success"===a&&(0,r.jsx)(w.CostcoBox,{"data-testid":"copy-success-notification",ref:u,tabIndex:-1,children:(0,r.jsx)(v.Notification,{icon:(0,r.jsx)(R.w,{"aria-label":"Checkmark-Circle"}),message:e.copySuccessMessage,severity:"success"})}),"error"===a&&(0,r.jsx)(w.CostcoBox,{"data-testid":"copy-error-notification",ref:m,tabIndex:-1,children:(0,r.jsx)(v.Notification,{iconAccessibilityText:e.errorIconAriaLabel,message:e.copyErrorMessage,severity:"critical"})}),(0,r.jsx)(y.Button,{disabled:!f,onClick:p,startIcon:(0,r.jsx)(M.Q,{sx:{height:g.b3d}}),children:e.copyButtonLabel}),(0,r.jsx)(j.Text,{variant:"b2",children:e.shareDescription}),(0,r.jsx)(y.Button,{sx:{alignSelf:"flex-start",color:g.d1D,textDecoration:"underline","&:hover":{textDecoration:"underline"}},onClick:()=>{c(!0)},size:"small",variant:"text-button",children:e.termsAndConditionsLabel}),(0,r.jsx)(A.m,{headerProps:{closeButtonAriaLabel:e.closeButtonAriaLabel,onClose:()=>{c(!1)},title:e.termsAndConditionsLabel,uniqueId:"terms-and-conditions-drawer"},anchor:"right",open:s,scrollArea:"body","aria-label":e.termsAndConditionsLabel,children:o})]})},B=({msText:e})=>e?(0,r.jsxs)(w.CostcoBox,{sx:{display:"flex",flexDirection:"column",gap:g.pMV},children:[(0,r.jsx)(j.Text,{variant:"b1",children:e.signInDescription}),(0,r.jsx)(y.Button,{variant:"primary",href:e.signInButtonHref,children:e.signInButtonLabel})]}):(console.error("ModuleSettingsText is required for SignInView"),null),L=({initialView:e,membershipStatusConfig:t,msText:i,referralCodeConfig:l,textBuilderElement:s})=>{let{isUserSignedIn:c,isLoading:u}=(0,d.A)(),[m,f]=(0,n.useReducer)(a,{...o,currentView:e??"LoadingView"});return(0,n.useEffect)(()=>{if(e)return;let t=!1;return(async()=>{if(u)return f({type:"NAVIGATE_TO_VIEW",payload:"LoadingView"});try{let e=await c();if(t)return;f({type:"NAVIGATE_TO_VIEW",payload:e?"GenerateLinkView":"SignInView"})}catch(e){if(t)return;console.error("ReferAFriendUI: auth check failed",e),f({type:"NAVIGATE_TO_VIEW",payload:"SignInView"})}})(),()=>{t=!0}},[u,e,c]),(0,r.jsx)("div",{"data-testid":"ReferAFriendWidget",children:(()=>{switch(m.currentView){case"LoadingView":return(0,r.jsx)(S,{});case"GenerateLinkView":return(0,r.jsx)(E,{membershipStatusConfig:t,msText:i,onReferralLinkGenerated:e=>{f({type:"LINK_GENERATED",payload:e})},referralCodeConfig:l,textBuilderElement:s});case"LinkGeneratedView":return(0,r.jsx)(V,{isLimitReached:!!m.isLimitReached,msText:i,referralLink:m.referralLink||"",textBuilderElement:s});default:return(0,r.jsx)(B,{msText:i})}})()})}},30133:(e,t,i)=>{i.d(t,{DataRightsUI:()=>tZ});var r=i(95155),n=i(14898),o=i(34462);let a=(e,t)=>`${e.endsWith("/")?e.slice(0,-1):e}${!t||t.startsWith("/")?t:`/${t}`}`,l=async(e,t,i,r)=>{let o=a(e.endpoint,t),l={...e.headers,"Content-Type":e.headers["Content-Type"]||"application/json"};(null==r?void 0:r.accessToken)&&(l.Authorization=`Bearer ${r.accessToken}`);let s={method:"POST",headers:l,body:JSON.stringify(i)};return(0,n.G)(o,s,e.timeout)},s=async(e,t,i)=>{let r=new URL(a(e.endpoint,t));
45Object.entries(i).forEach(([e,t])=>{r.searchParams.set(e,t)});let o={method:"GET",headers:e.headers};return(0,n.G)(r.toString(),o,e.timeout)};var c=i(12115),d=i(69771),u=i(65040),m=i(72055),f=i(13641);let p="Select an option below",h="data-rights-pending-sign-in-journey",x={selectedState:"",behalfOfSelection:"",costcoAccountSelection:""},v=["JourneySelectionView","AcknowledgementView","DSRFormView","EmailVerificationView","IdentityVerificationView"],y=e=>e.trim().toUpperCase(),g=e=>new Set(e.map(y).filter(Boolean)),b="An error occurred while submitting your request. Please try again.",w=async({values:e,memberData:t,sessionId:i,dataRightsRequestClient:r})=>{await (null==r?void 0:r.updateIdentityStatus({sessionId:i,membershipNumber:e["Membership Number"]||"",onBehalfOf:(null==t?void 0:t.onBehalfOf)||!1,firstName:e["First Name"]||"",lastName:e["Last Name"]||"",email:e.Email||"",addressLine1:e["Street Address"]||"",city:e.City||"",state:e.State||"",zipcode:e.Zipcode||""}))},_=async({values:e,isReviewMode:t,memberData:i,sessionId:r,dataRightsRequestClient:n,dispatch:o,serviceNowRedirect:a,serviceNowErrorText:l,onTokenGenerated:s})=>{var c;let d=(null==(c=e.Email)?void 0:c.trim())||"",u=((e,t)=>{var i;if(!e||e.onBehalfOf)return!1;let r=(null==(i=e.email)?void 0:i.trim())||"",n=(t||"").trim(),o=!e.emailVerified,a=!!(n&&n.toLowerCase()!==r.toLowerCase());return o||a})(i,d);if((!t||u)&&o({type:"DSR_SUBMISSION_CAPTURED",payload:e}),u)return n&&d&&r?void o({type:"DSR_REVIEW_STARTED"}):void o({type:"SET_ERROR",payload:"Unable to start email verification. Missing session or email information."});if(!n||!r)return void o({type:"SET_ERROR",payload:"Unable to submit request. Missing session information."});if(!(null==i?void 0:i.identityVerified)){try{await w({values:e,memberData:i,sessionId:r,dataRightsRequestClient:n}),o({type:"IDENTITY_VERIFICATION_STARTED"})}catch{o({type:"SET_ERROR",payload:b})}return}if(t){if(!a)return void o({type:"SET_ERROR",payload:l||"ServiceNow redirect configuration is missing. Unable to complete your request."});try{await w({values:e,memberData:i,sessionId:r,dataRightsRequestClient:n})}catch{o({type:"SET_ERROR",payload:l||b});return}try{let e=await n.generateToken({sessionId:r});if(!(null==e?void 0:e.token))throw Error("DataRights token response did not contain a token.");null==s||s(e.token),o({type:"DSR_FLOW_RESET"})}catch{o({type:"SET_ERROR",payload:l||b})}return}o({type:"DSR_REVIEW_READY"})},k={currentView:v[0],journeySelection:{selectedState:"",behalfOfSelection:"",costcoAccountSelection:""},memberData:void 0,dsrDraftValues:void 0,isDsrReviewMode:!1,emailJustVerified:!1,isSubmitting:!1,error:void 0};function S(e,t){switch(t.type){case"UPDATE_DATA":return{...e,[t.payload.view]:{...e[t.payload.view],...t.payload.data},error:void 0};case"NAVIGATE_TO_VIEW":return{...e,currentView:t.payload,error:void 0};case"SET_MEMBER_DATA":return{...e,memberData:t.payload,error:void 0};case"DSR_SUBMISSION_CAPTURED":return{...e,dsrDraftValues:t.payload,error:void 0};case"DSR_REVIEW_STARTED":return{...e,isDsrReviewMode:!0,currentView:"EmailVerificationView",error:void 0};case"EMAIL_VERIFICATION_COMPLETED":return{...e,memberData:t.payload||e.memberData,isDsrReviewMode:!0,emailJustVerified:!0,currentView:"DSRFormView",error:void 0};case"IDENTITY_VERIFICATION_STARTED":return{...e,isDsrReviewMode:!1,currentView:"IdentityVerificationView",error:void 0};case"IDENTITY_VERIFICATION_COMPLETED":return{...e,memberData:t.payload||e.memberData,isDsrReviewMode:!0,currentView:"DSRFormView",error:void 0};case"DSR_REVIEW_READY":return{...e,isDsrReviewMode:!0,currentView:"DSRFormView",error:void 0};case"DSR_FLOW_RESET":return{...e,dsrDraftValues:void 0,isDsrReviewMode:!1,emailJustVerified:!1,error:void 0};case"RESET_STATE":return{...k};case"SET_SUBMITTING":return{...e,isSubmitting:t.payload,error:void 0};case"SET_ERROR":return{...e,error:t.payload};default:return console.warn("Unknown action dispatched to dataRightsReducer: ",t),e}}var T=i(86670),C=i(24880),I=i(25719);let E=(0,T.default)(I.CostcoBox)({display:"flex",flexDirection:"column",gap:C.i_v,textAlign:"left",width:"100%"});(0,T.default)(I.CostcoBox)({display:"flex",flexDirection:"column",gap:C.Mzk,alignItems:"flex-start"}),(0,T.default)(I.CostcoBox)({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%",'& .MuiButtonBase-root[type="submit"]':{alignSelf:"stretch"}}),(0,T.default)(I.CostcoBox)({width:"100%","& p":{margin:0}}),(0,T.default)(I.CostcoBox)({width:"100%","& ol":{margin:0,paddingInlineStart:C.i_v}});var j=i(84102),D=i(6310),A=i(10874);let R=(0,T.default)(I.CostcoBox)({display:"flex",flexDirection:"column",gap:C.i_v,textAlign:"left",width:"100%"}),M=(0,T.default)(I.CostcoBox)({display:"flex",flexDirection:"column",gap:C.Mzk,alignItems:"flex-start"}),V=(0,T.default)(I.CostcoBox)({width:"100%","& p":{margin:0}}),B=(0,T.default)(I.CostcoBox)({width:"100%","& ol":{margin:0,paddingInlineStart:C.i_v}});function L({continueButtonText:e,msText:t,onContinue:i}
45){let n=t.ackStepsText.replace(/\\n/g,"\n"),[o,a]=(0,c.useState)(!1),[l,s]=(0,c.useState)(!1),d=(0,c.useRef)(null);return(0,r.jsxs)(R,{"data-testid":"acknowledgement-of-terms",children:[(t.ackIntroText||t.ackAuthorizationText)&&(0,r.jsxs)(V,{children:[t.ackIntroText&&(0,r.jsx)(j.T,{markdown:t.ackIntroText}),t.ackAuthorizationText&&(0,r.jsx)(j.T,{markdown:t.ackAuthorizationText})]}),n&&(0,r.jsx)(B,{children:(0,r.jsx)(j.T,{markdown:n})}),(0,r.jsxs)(M,{children:[(0,r.jsx)(D.S,{errorAriaLive:"assertive",errorText:l?t.ackCheckboxErrorMessage:void 0,hasError:l,id:"acknowledgement-of-terms-checkbox",inputRef:d,isChecked:o,isRequired:!0,label:t.ackCheckboxLabel,onChange:(e,t)=>{a(t),t&&s(!1)}}),(0,r.jsx)(A.Button,{onClick:()=>{var e;if(!o){s(!0),null==(e=d.current)||e.focus();return}s(!1),i&&i()},variant:"primary",children:e})]})]})}var N=i(12158),O=i(42138),z=i(13677),P=i(90162),W=i(2377),F=i(95149);let $={marginBottom:C.Mzk,marginTop:C.Mzk},U=e=>{let{digitalMembershipCardImageUrl:t,digitalMembershipCardLabel:i,digitalCardAltText:n,imageAltText:o,membershipCardImageUrl:a,membershipCardLabel:l,membershipCardText:s,visaCardImageUrl:c,visaCardLabel:d,visaCardText:u}=e,m=[{label:l,text:s,altText:o,uniqueId:"membership-card-description",src:a},{label:i,altText:n,src:t},{label:d,text:u,altText:"",uniqueId:"visa-card-description",src:c}];return(0,r.jsx)(I.CostcoBox,{"data-testid":"find-your-membership",children:m.map((e,t)=>(0,r.jsxs)("div",{children:[(0,r.jsx)(N.Text,{bold:!0,component:"h3",sx:{display:"block"},uniqueId:`${e.label}-heading`,variant:"t4",children:e.label}),e.text&&(0,r.jsx)(N.Text,{uniqueId:e.uniqueId,variant:"b2",children:e.text}),(0,r.jsx)(F.A,{alt:e.altText,"data-testid":e.uniqueId,loading:"lazy",src:e.src,isSrcSetEnabled:!1,sx:{height:"85px",margin:`${C.iAn} 0 -8px 0`}}),t!==m.length-1&&(0,r.jsx)(W.Divider,{sx:$})]},e.label))})};U.displayName="FindMembershipUI";var G=i(98872),q=i(12397);let J="findMembershipDrawer",H={membershipNumber:"Membership Number",firstName:"First Name",lastName:"Last Name",email:"Email",addressLine1:"Street Address",city:"City",state:"State",z
45ipcode:"Zipcode"},Z=["membershipNumber","firstName","lastName","email"],Y=e=>(null==e?void 0:e.identityVerified)===!0,K=e=>!!(null==e?void 0:e.membershipNumber),X=(e,t)=>{if(!e)return{};let i=t?new Set(t):void 0;return Object.entries(H).reduce((t,[r,n])=>{if(i&&!i.has(r))return t;let o=e[r];return"string"==typeof o&&o.length>0&&n&&(t[n]=o),t},{})},Q=e=>{var t;return(null==(t=Object.values(e)[0].field_id)?void 0:t.trim())||""},ee=(0,T.default)(I.CostcoBox)({'& .MuiButtonBase-root[type="submit"]':{alignSelf:"stretch"},width:"100%"}),et=(0,T.default)(I.CostcoBox)({display:"flex",flexDirection:"column",gap:C.iAn,width:"100%","& p":{margin:0}}),ei=(0,T.default)(I.CostcoBox)({display:"flex",flexDirection:"column",gap:C.iAn,"& p":{margin:0}}),er=(0,T.default)(A.Button)({alignSelf:"flex-start",marginBottom:C.D3H,paddingLeft:0}),en=(0,T.default)(I.CostcoBox)({marginTop:C.D3H,marginBottom:C.D3H}),eo=(0,T.default)(A.Button)({alignSelf:"flex-start",paddingLeft:0}),ea=(0,T.default)(I.CostcoBox)({display:"flex",alignItems:"center",gap:C.m72,justifyContent:"flex-start",marginTop:C.iAn,color:C.nu$,"& .MuiTypography-root":{color:"inherit"}});
45function el({dsrFormText:e,findMembershipContent:t,formConfigData:i,journeySelection:n,locale:o,onSubmit:a,isReviewMode:l=!1,reviewValues:s,showEmailVerified:d,submitButtonText:u,memberData:m,apiError:f}){let[p,h]=(0,c.useState)(!1),[x,v]=(0,c.useState)(!1),y=(0,c.useRef)(null),g=(0,c.useRef)({}),{flow:b,displayMode:w,readOnlyValues:_,showMembershipHelpButton:k,showEditInformationButton:S,readOnlyFields:T,editableFields:C,handleSubmit:I}=function({formConfigData:e,journeySelection:t,onSubmit:i,reviewValues:r,isEditMode:n=!1,isReviewMode:o=!1,memberData:a}){let l=((e,t)=>(null==e?void 0:e.behalfOfSelection)==="Yes"?"OnBehalfOf":(null==e?void 0:e.costcoAccountSelection)==="No"?"NoAccount":(null==e?void 0:e.costcoAccountSelection)!=="Yes"||K(t)?(null==e?void 0:e.costcoAccountSelection)==="Yes"&&K(t)&&Y(t)?"AccountMembershipVerified":(null==e?void 0:e.costcoAccountSelection)==="Yes"&&K(t)&&(null==t?void 0:t.identityVerified)===!1?"AccountMembershipNotVerified":void 0:"AccountNoMembership")(t,a),s=(({isEditMode:e,isReviewMode:t,flow:i})=>e?"edit":t||"AccountMembershipVerified"===i?"fullReadonlyReview":"mixedReadonly")({isEditMode:n,isReviewMode:o,flow:l}),c="AccountMembershipVerified"===l?X(a):"AccountMembershipNotVerified"===l?X(a,Z):{},d=o?{...c,...r||{}}:c,u=!K(a),m=(null==t?void 0:t.behalfOfSelection)==="No"&&(null==t?void 0:t.costcoAccountSelection)==="No"&&!Y(a),f=(null==e?void 0:e.fields)||[],p=null==e?void 0:e.moduleSettingsData,h=new Set(Object.keys(d||{}).map(e=>e.trim())),x=e=>{var t;return!!(null==(t=null==d?void 0:d[e])?void 0:t.trim())},v=(({formFields:e,shouldShowBirthYear:t,moduleSettingsData:i})=>e.reduce((e,r)=>{if("number_input"in r&&"Birth Year"===r.number_input.field_id.trim()){var n,o,a;let l,s,c;return t?(e.push({...r,number_input:{...r.number_input,validation_rules:(n=r.number_input.validation_rules,l=new Date().getFullYear(),s=(null==(o=null==n?void 0:n.min_val_block)?void 0:o.min_val_err_msg)||(null==i?void 0:i.numberInputMinValidation)||"Please enter a valid Birth Year",c=(null==(a=null==n?void 0:n.max_val_block)?void 0:a.max_val_err_msg)||(null==i?void 0:i.numberInputMaxValidation)||"Please enter a valid Birth Year",{min_val_block:{...(null==n?void 0:n.min_val_block)||{},min_val:l-130,min_val_err_msg:s},max_val_block:{...(null==n?void 0:n.max_val_block)||{},max_val:l,max_val_err_msg:c}})}}),e):e}return e.push(r),e},[]))({formFields:f,shouldShowBirthYear:m,moduleSettingsData:p}),y=(({displayMode:e,filteredFields:t,readOnlyFieldIdSet:i,hasReadOnlyValue:r})=>"edit"===e?[]:"fullReadonlyReview"===e?t.filter(e=>!("hidden_input"in e)):t.filter(e=>{if("hidden_input"in e)return!1;let t=Q(e);return!!t&&i.has(t)&&r(t)}))({displayMode:s,filteredFields:v,readOnlyFieldIdSet:h,hasReadOnlyValue:x}),g=(({displayMode:e,filteredFields:t,readOnlyFieldIdSet:i,hasReadOnlyValue:r})=>"edit"===e?t:"fullReadonlyReview"===e?t.filter(e=>"hidden_input"in e):t.filter(e=>{if("hidden_input"in e)return!0;let t=Q(e);return!(t&&i.has(t))||!r(t)}))({displayMode:s,filteredFields:v,readOnlyFieldIdSet:h,hasReadOnlyValue:x}),b="edit"!==s&&y.length>0,w=async e=>{if(!i)return;let t=(({values:e,readOnlyFields:t,readOnlyValues:i})=>({...t.reduce((e,t)=>{let r=Q(t),n=r?i[r]:"";return r&&"string"==typeof n&&(e[r]=n),e},{}),...e}))({values:e,readOnlyFields:y,readOnlyValues:d});await i(t)};return{flow:l,displayMode:s,readOnlyValues:d,showMembershipHelpButton:u,showEditInformationButton:b,readOnlyFields:y,editableFields:g,handleSubmit:w}}({formConfigData:i,journeySelection:n,onSubmit:a,reviewValues:s,isEditMode:x,isReviewM
45ode:l,memberData:m});if((0,c.useEffect)(()=>{var e;f&&(null==(e=y.current)||e.focus())},[f]),!b)return console.error("Unable to determine DSR form flow"),null;let E=d?{Email:(0,r.jsxs)(ea,{children:[(0,r.jsx)(P.A,{}),(0,r.jsx)(N.Text,{bold:!0,variant:"b2",children:"Email address has been verified"})]})}:void 0;return(0,r.jsxs)(ee,{tabIndex:-1,children:[f&&(0,r.jsx)(O.Notification,{ref:y,severity:"critical",message:f,uniqueId:"data-rights-dsr-api-error"}),(e.ackIntroText||e.dsrInstructionText||e.dsrMemberIdentificationText)&&(0,r.jsxs)(et,{children:[e.ackIntroText&&(0,r.jsx)(j.T,{markdown:e.ackIntroText}),e.dsrInstructionText&&(0,r.jsx)(j.T,{markdown:e.dsrInstructionText}),e.dsrMemberIdentificationText&&(0,r.jsx)(j.T,{markdown:e.dsrMemberIdentificationText})]}),(k||x)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{variant:"text-button","aria-controls":J,"aria-expanded":p,onClick:()=>h(!0),children:e.findMembershipHelpText}),(0,r.jsx)(z.m,{anchor:"right",uniqueId:J,open:p,headerProps:{title:e.findMembershipHelpText,onClose:()=>h(!1),closeButtonAriaLabel:e.findMembershipHelpText},children:(0,r.jsx)(U,{...t})})]}),T.length>0&&(0,r.jsx)(en,{children:(0,r.jsx)(G.FormSummarySection,{fields:T,values:_||{},locale:o,fieldAnnotations:E})}),(0,r.jsx)(q.GenericFormUI,{...i,locale:o,fields:C,initialValues:"edit"===w?{..._,...g.current}:l?s:void 0,onValuesChange:e=>{g.current=e},onSubmit:I,submitButtonText:u,isFullWidth:!0,preSubmitContent:e.identityVerificationText?(0,r.jsxs)(r.Fragment,{children:[S&&"edit"!==w&&(0,r.jsx)(eo,{variant:"text-button",onClick:()=>v(!0),children:e.editInformationButtonText??"Edit Information"}),(0,r.jsx)(ei,{children:(0,r.jsx)(j.T,{markdown:e.identityVerificationText})})]}):void 0},"edit"===w?"edit":"readonly")]})}var es=i(60248);i(11995);var ec=i(27547),ed=i(77157);let eu=(0,T.default)(I.CostcoBox)({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%","& .MuiFormControlLabel-root .MuiFormControlLabel-label, & .MuiFormControlLabel-root .MuiTypography-root, & .MuiFormControlLabel-root .MuiFormControlLabel-label *":{fontWeight:`${C.awq} !important`},'& .MuiButtonBase-root[type="submit"]':{alignSelf:"stretch"}}),em=(0,T.default)("fieldset")` 46 border: 0; 47 margin: 0; 48 min-inline-size: 0; 49 padding: 0; 50 display: flex; 51 flex-direction: column; 52 width: 100%; 53`,ef=(0,T.default)("legend")` 54 margin-bottom: 8px; 55 font-weight: ${C.awq}; 56 font-size: 1rem; 57 line-height: 1.5; 58 color: ${C.hGW}; 59`,ep=[{label:"Yes",value:"Yes"},{label:"No",value:"No"}];function eh({formikProps:e,formId:t,onValuesChange:i,updateValues:n,stateOptions:o,text:a,continueButtonText:l}){let s="No"===e.values.behalfOfSelection;(0,c.useEffect)(()=>{null==i||i(e.values),n({type:"UPDATE_DATA",payload:{view:"journeySelection",data:e.values}})},[e.values,i,n]);let d=a.erroriconarialabel||"Error: ";return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(eu,{children:(0,r.jsxs)(es.Grid,{container:!0,spacing:C.D3H,hasMargin:!1,children:[(0,r.jsx)(es.Grid,{size:{xs:12,md:7,lg:7},"data-private":!0,"data-bi-private":!0,children:(0,r.jsxs)(em,{children:[(0,r.jsx)(ef,{children:a.selectstatelabel}),(0,r.jsx)(ec.A,{name:"selectedState",label:a.statelabel,options:o,uniqueId:t,isRequired:!0,errorIconAriaLabel:d})]})}),(0,r.jsx)(es.Grid,{size:{xs:12,md:7,lg:7},"data-private":!0,"data-bi-private":!0,children:(0,r.jsx)(ed.A,{name:"behalfOfSelection",uniqueId:t,isRequired:!0,options:[...ep],selectedOption:e.values.behalfOfSelection,accessibleLegendText:a.behalfofquestionlabel,accessibleLegendTextProps:{bold:!1},isAccessibleLegendVisible:!0,ariaLabelErrorPrefix:d,onChange:t=>{if("Yes"!==t&&"No"!==t)return;let i="No"===t?e.values.costcoAccountSelection:"";i!==e.values.costcoAccountSelection&&e.setFieldValue("costcoAccountSelection",i),e.setFieldTouched("costcoAccountSelection",!1,!1)}})}),s&&(0,r.jsx)(es.Grid,{size:{xs:12,md:7,lg:7},"data-private":!0,"data-bi-private":!0,children:(0,r.jsx)(ed.A,{name:"costcoAccountSelection",uniqueId:`${t}_costco_account`,isRequired:!0,options:[...ep],selectedOption:e.values.costcoAccountSelection,accessibleLegendText:a.costcoaccountquestionlabel,accessibleLegendTextProps:{bold:!1}
59,isAccessibleLegendVisible:!0,ariaLabelErrorPrefix:d,onChange:()=>void 0})}),(0,r.jsx)(es.Grid,{size:{xs:12},children:(0,r.jsx)(A.Button,{type:"submit",children:l})})]})})})}var ex=i(40336),ev=i(65138),ey=i(40131);let eg=(0,T.default)(I.CostcoBox)({display:"flex",flexDirection:"column",gap:C.i_v,textAlign:"left",width:"100%",maxWidth:"525px"}),eb=(0,T.default)(I.CostcoBox)({maxWidth:"250px",width:"100%"}),ew=(0,T.default)(I.CostcoBox)({display:"flex",flexDirection:"row",gap:C.Mzk,width:"100%","& .MuiButtonBase-root":{flex:1,maxWidth:"250px"}});function e_({code:e,isSendNewCodeDisabled:t=!1,isCodeIncorrect:i,isVerifyDisabled:n=!1,msText:o,onCodeChange:a,onVerifyClick:l,onSendNewCode:s,serviceErrorText:d,resendCooldownRemainingSeconds:u=0}){var m;let f,p,h,x,v=(0,c.useRef)(null),y=u>0;(0,c.useEffect)(()=>{var e;d&&(null==(e=v.current)||e.focus())},[d]);let{bodyText:g,headingText:b,incorrectCodeErrorText:w,inputLabel:_,resendCooldownText:k,sendNewCodeButtonText:S,verifyCodeButtonText:T}=o;return(0,r.jsxs)(eg,{children:[(0,r.jsx)(ey.MarketingTypography,{variant:"subtitle_v2",children:b}),(0,r.jsx)(ey.MarketingTypography,{variant:"body_v2",children:g}),(0,r.jsx)(eb,{children:(0,r.jsx)(ev.A,{id:"email-verification-code",inputLabelId:"email-verification-code-label",label:_,value:e,onChange:e=>a(e.target.value),isError:i,errorText:i?w:void 0,errorTextId:i?"email-verification-code-error-text":void 0})}),d?(0,r.jsx)(O.Notification,{ref:v,isRole:!0,message:d,severity:"critical"}):null,(0,r.jsxs)(ew,{children:[(0,r.jsx)(A.Button,{variant:"secondary",onClick:s,disabled:t,children:S}),(0,r.jsx)(A.Button,{onClick:l,disabled:n,children:T})]}),y?(0,r.jsx)(ey.MarketingTypography,{variant:"caption","aria-live":"polite",children:(m=k,x=(p=Math.floor((f=Math.max(0,Math.floor(u)))/60).toString().padStart(2,"0"),h=(f%60).toString().padStart(2,"0"),`${p}:${h}`),m.includes("{countdown}")?m.replace("{countdown}",x):`${m} ${x}`)}):null]})}let ek=()=>({code:"",isCodeIncorrect:!1,resendAvailableAt:null,currentTime:Date.now(),requestPhase:"initializing",serviceErrorText:""}),eS=(e,t)=>{switch(t.type){case"RESET_FOR_IDENTITY_CHANGE":return{code:"",isCodeIncorrect:!1,resendAvailableAt:null,currentTime:t.payload.now,requestPhase:"initializing",serviceErrorText:""};case"SET_READY":return{...e,requestPhase:"ready"};case"CODE_CHANGED":return{...e,code:t.payload.code,isCodeIncorrect:!1,serviceErrorText:""};case"VERIFY_STARTED":return{...e,requestPhase:"verifying",serviceErrorText:""};case"RESEND_STARTED":return{...e,requestPhase:"resending",serviceErrorText:""};case"REQUEST_FAILED":return{...e,requestPhase:"ready",serviceErrorText:t.payload.errorText};case"CHALLENGE_APPLIED":{let i=(e=>{if(null==e)return 0;let t="string"==typeof e?Number.parseInt(e,10):e;return Number.isFinite(t)?Math.max(0,Math.floor(t)):0})(t.payload.resendAvailableInSeconds);return{...e,code:"",isCodeIncorrect:!1,currentTime:t.payload.now,resendAvailableAt:i>0?t.payload.now+1e3*i:null,requestPhase:"ready"}}case"VERIFY_COMPLETED":return{...e,isCodeIncorrect:!1===t.payload.verified,requestPhase:"ready"};case"TIMER_TICK":return{...e,currentTime:t.payload.now};default:return e}},eT=({dataRightsRequestClient:e,msText:t,onVerificationComplete:i,recipient:n,sessionId:a})=>{let[l,s]=(0,c.useReducer)(eS,void 0,ek),d=(0,c.useRef)(Symbol("email-verification-request-identity")),{resendEmailOpt:u,sendEmailOpt:m,verifyEmailOpt:f}=e,p={headingText:(null==t?void 0:t.headingText)??"Verification Code",bodyText:(null==t?void 0:t.bodyText)??"You will receive a verification code email shortly. Keep this page open and enter the verification code you receive in your email below.",inputLabel:(null==t?void 0:t.inputLabel)??"Verification Code",sendNewCodeButtonText:(null==t?void 0:t.sendNewCodeButtonText)??"Send New Code",verifyCodeButtonText:(null==t?void 0:t.verifyCodeButtonText)??"Verify Code",incorrectCodeErrorText:(null==t?void 0:t.incorrectCodeErrorText)??"Code is incorrect. Please try again.",genericServiceErrorText:(null==t?void 0:t.genericServiceErrorText)??"There was an unexpected error, please try again later.",resendCooldownText:(null==t?void 0:t.resendCooldownText)??"You can request a new code in {countdown}."},h=e=>{s({type:"REQUEST_FAILED",payload:{errorText:e}})},x=(0,c.useCallback)(e=>{s({type:"CHALLENGE_APPLIED",payload:{resendAvailableInSeconds:e.resendAvailableInSeconds,now:Date.now()}})},[]),v=l.resendAvailableAt?Math.max(0,Math.ceil((l.resendAvailableAt-l.currentTime)/1e3)):0;(0,c.useEffect)(()=>
59{if(!l.resendAvailableAt||l.resendAvailableAt<=Date.now())return;let e=setInterval(()=>{let t=Date.now();s({type:"TIMER_TICK",payload:{now:t}}),l.resendAvailableAt&&t>=l.resendAvailableAt&&clearInterval(e)},1e3);return()=>{clearInterval(e)}},[l.resendAvailableAt]);let y=async()=>{let e;if(!a||!l.code.trim())return;let t=d.current;s({type:"VERIFY_STARTED"});try{e=await f({code:l.code,sessionId:a})}catch{if(d.current!==t)return;h(p.genericServiceErrorText);return}if(d.current===t&&(s({type:"VERIFY_COMPLETED",payload:{verified:e.verified}}),e.verified))try{await (null==i?void 0:i())}catch(e){o.v.error({error:e},"EmailVerificationView: onVerificationComplete failed after successful verification.")}},g=async()=>{if(!n||!a)return;let e=d.current;s({type:"RESEND_STARTED"});try{let t=await u({recipient:n,sessionId:a});if(d.current!==e)return;x(t)}catch{if(d.current!==e)return;h(p.genericServiceErrorText)}};if((0,c.useEffect)(()=>{let e,t=(d.current=e=Symbol("email-verification-request-identity"),e);(s({type:"RESET_FOR_IDENTITY_CHANGE",payload:{now:Date.now()}}),n&&a)?(async()=>{try{let e=await m({recipient:n,sessionId:a});if(d.current!==t)return;x(e)}catch{if(d.current!==t)return;h(p.genericServiceErrorText)}})():s({type:"SET_READY"})},[x,n,p.genericServiceErrorText,m,a]),!a)return null;let b="resending"===l.requestPhase,w="verifying"===l.requestPhase,_="initializing"===l.requestPhase,k=!!(n&&a),S=_||b||w||!k||v>0,T=_||b||w||!l.code.trim();return(0,r.jsx)(e_,{code:l.code,isSendNewCodeDisabled:S,isVerifyDisabled:T,isCodeIncorrect:l.isCodeIncorrect,msText:p,onCodeChange:e=>{s({type:"CODE_CHANGED",payload:{code:e}})},onVerifyClick:y,serviceErrorText:l.serviceErrorText,onSendNewCode:g,resendCooldownRemainingSeconds:v})};var eC=i(36571),eI=i(15913);let eE=(0,c.createContext)(null);eE.displayName="MyAccountApiConfig";var ej=i(22188);let eD=(e,t)=>e.replace("{endPoint}","DRR_VALIDATAION"===t?"guest":"").replace(/([^:]\/)\/+/g,"$1"),eA=()=>{let e="VALIDATEMEMBERSHIP",t=(0,c.useContext)(eE),{getVerificationSessionHeader:i,getLoyaltyHeader:r,getStepUpHeader:n,getStatusCheckHeader:o,getNotificationEmailHeader:a,getValidationSessionHeader:l}=(()=>{let{getToken:e}=(0,ex.A)(),t=(0,c.useContext)(eE),i=(0,c.useCallback)((e,t)=>{let i=Error(`Failed to build ${e} headers due to auth token error`);return i.cause=t,i.code="AUTH_TOKEN_HEADER_ERROR",i},[]),r=(0,c.useCallback)(async(r,n,o,a,l,s)=>{var c,d;let u,m=await (0,eC.Z0)(),f=(null==a?void 0:a.authRequired)??!0,p=(0,ej.fb)(null==a?void 0:a.trackingId);try{u=await e(!f,{throwIfMissingToken:f,throwOnError:f})}catch(e){throw i(r,e)}let h=await (0,eC.Rc)(),x=(e=>{var t;if("u">typeof window&&(null==(t=null==e?void 0:e.nonProd_env)?void 0:t.length)){let t=window.location.hostname.match(/-v(.+?)\.costco\./i);if((null==t?void 0:t[1])&&e.nonProd_env.includes(t[1]))return t[1]}return null})(t)||(null==(c=null==t?void 0:t.clientIds_config)?void 0:c.env),v=null==t?void 0:t.clientIds_config,y=(null==(d=null==t?void 0:t.options)?void 0:d.costcoEnv)??x,g={authorization:u?`Bearer ${u}`:"","Content-Type":"application/json","x-lang-id":m,"Costco-Tracking-Id":p};switch(r){case"default":return{...g,authorization:u||"","client-id":null==v?void 0:v.clientId,"X-Request-Id":crypto.randomUUID()};case"membership":return{...g,authorization:u||"","client-id":null==v?void 0:v.clientId,"costco-env":y};case"stepUp":return{authorization:u?`Bearer ${u}`:"","Client-Id":null==v?void 0:v.clientId,"Country-Code":null==v?void 0:v.gmc_countryCode,"Content-Type":"application/json","client-identifier":null==v?void 0:v.sessions_clientIdentifier,"Costco-Env":null==v?void 0:v.envPrf,sessionId:l||""};case"wcs":return{"costco-x-authorization":`Bearer ${u||""}`,"client-identifier":null==v?void 0:v.clientIdentifier,"costco.env":x,"costco-x-wcs-clientid":null==v?void 0:v.clientId,"costco.service":"restcustomer","Content-Type":"application/json","client-id":null==v?void 0:v.clientId,"Costco-Tracking-Id":crypto.randomUUID(),"x-lang-id":m};case"wcsQuery":return{access_token:u||"",...o?{storeId:o}:{},"Content-Type":"application/json","Costco-Tracking-Id":crypto.randomUUID()};case"profile":return{...g,"client-identifier":null==v?void 0:v.gmc_clientIdentifier,"client-id":null==v?void 0:v.clientId,"X-Client-Id":null==v?void 0:v.clientId,"costco-env":null==v?void 0:v.envGcp,"gcp-costco-env":x};case"jwt":return{...g,authorization:u||"","Costco-Sending-Application":`Accounts-${null==v?void 0:v.site}`,"Costco-Env":y,"Costco-X-Wcs-Clientid":null==v?void 0:v.clientId};case"apiController":return{...g,authorization:u||"",clientid:null==v?void 0:v.clientId,resource:n||""};case"dmc":return{...g,"client-id":null==v?void 0:v.clientId,"costco-env":null==v?void 0:v.envGcp,"tracking-id":crypto.randomUUID()};case"gcp":return{...g,"client-id":null==v?void 0:v.clientId,"client-identifier":null==v?void 0:v.mbr_clientIdentifier,"costco-env":null==v?void 0:v.envGcp,"gcp-costco-env":x,"country-code":null==v?void 0:v.gmc_countryCode,...(null==v?void 0:v.costco_gdx_deployment)&&""!==v.costco_gdx_deployment&&{"x-costco-gdx-deployment":v.costco_gdx_deployment}};case"wallet":return{...g,"Costco-Sending-Application":`Accounts-${null==v?void 0:v.site}`,"Costco-X-Wcs-Clientid":null==v?void 0:v.clientId,"Costco.Env":x,"client-identifier":null==v?void 0:v.wallet_clientIdentifier,"X-Request-Id":crypto.randomUUID()};case"walletPayment":return{...g,"client-id":null==v?void 0:v.clientId,"client-identifier":null==v?void 0:v.gmc_payment_clientIdentifier,"costco.env":x};case"payments":return{...g,"client-id":null==v?void 0:v.paymentClientId,"client-identifier":null==v?void 0:v.gmc_payment_clientIdentifier,"costco.env":x};case"product":return{"client-identifier":null==v?void 0:v.gmc_product_clientIdentifier,"costco-env":null==v?void 0:v.envGcp,"Content-Type":"application/json","client-id":null==v?void 0:v.clientId,"X-Request-Id":crypto.randomUUID()};case"addressV2":return{...g,"client-identifier":null==v?void 0:v.address_v2_clientIdentifier,"costco-env":null==v?void 0:v.envGcp};case"preferences":return{...g,"client-identifier":null==v?void 0:v.gmc_clientIdentifier,"costco-env":null==v?void 0:v.envGcp,"x-zip-code":h};case"sessions":return{authorization:u?`Bearer ${u}`:"","Content-Type":"application/json","client-id":null==v?void 0:v.clientId,"client-identifier":null==v?void 0:v.sessions_clientIdentifier,"country-code":null==v?void 0:v.gmc_countryCode,"costco-env":null==v?void 0:v.envPrf};case"wcToken":return{authorization:u,"Content-Type":"application/json","x-lang-id":m,"Costco-Tracking-Id":crypto.randomUUID(),clientid:null==v?void 0:v.clientId,resource:n||"",isNonCostcoCall:!0};case"loyalty":return{authorization:u?`Bearer ${u}`:"","Content-Type":"application/json","client-id":null==v?void 0:v.clientId,"client-identifier":null==v?void 0:v.loyalty_clientIdentifier,"Country-code":null==v?void 0:v.gmc_countryCode,"costco-env":null==v?void 0:v.envGcp};case"notificationEmail":return{authorization:u?`Bearer ${u}`:"","Content-Type":"application/json","client-id":null==v?void 0:v.clientId,"client-identifier":null==v?void 0:v.sessions_clientIdentifier,"Country-code":null==v?void 0:v.gmc_countryCode,"costco-env":null==v?void 0:v.envPrf};case"validateSession":return{authorization:u?`Bearer ${u}`:"","client-id":null==v?void 0:v.clientId,"client-identifier":null==v?void 0:v.sessions_clientIdentifier,"country-code":null==v?void 0:v.gmc_countryCode,"costco-env":null==v?void 0:v.envPrf};case"secureKey":return{authorization:u?`Bearer ${u}`:"","client-id":null==v?void 0:v.clientId,"Content-Type":"application/json","country-code":null==v?void 0:v.gmc_countryCode,"client-identifier":null==v?void 0:v.secureKey_clientIdentifier,"gcp-costco-env":x,"Costco-Tracking-Id":crypto.randomUUID(),"costco-env":null==v?void 0:v.costcoenv_securekey,"x-costco-gdx-deployment":null==v?void 0:v.gdxDeployment,"x-lang-id":m};case"lists":return{...g,authorization:u?`Bearer ${u}`:"","client-id":null==v?void 0:v.clientId,"X-Request-Id":crypto.randomUUID(),"client-identifier":null==v?void 0:v.list_clientIdentifier};case"statusCheck":return{authorization:u?`Bearer ${u}`:"","Client-Id":null==v?void 0:v.clientId,"Country-Code":null==v?void 0:v.gmc_countryCode,"client-identifier":null==v?void 0:v.sessions_clientIdentifier,"costco-env":null==v?void 0:v.envGcp,"membership-number":s};default:return g}},[i,e,t]),n=(0,c.useCallback)(()=>r("default"),[r]),o=(0,c.useCallback)(()=>r("membership"),[r]),a=(0,c.useCallback)(()=>r("wcs"),[r]),l=(0,c.useCallback)((e,t)=>r("wcsQuery",void 0,e,t),[r]),s=(0,c.useCallback)(()=>r("profile"),[r]),d=(0,c.useCallback)(()=>r("jwt"),[r]),u=(0,c.useCallback)(e=>r("apiController",e),[r]),m=(0,c.useCallback)(e=>r("wcToken",e),[r]),f=(0,c.useCallback)(()=>r("dmc"),[r]),p=(0,c.useCallback)(()=>r("gcp"),[r]),h=(0,c.useCallback)(()=>r("walletPayment"),[r]),x=(0,c.useCallback)(()=>r("payments"),[r]),v=(0,c.useCallback)(()=>r("product"),[r]),y=(0,c.useCallback)(e=>r("addressV2",void 0,void 0,e),[r]),g=(0,c.useCallback)(()=>r("preferences"),[r]),b=(0,c.useCallback)(()=>r("wallet"),[r]),w=(0,c.useCallback)(()=>r("loyalty"),[r]),_=(0,c.useCallback)(e=>r("stepUp",void 0,void 0,void 0,e),[r]),k=(0,c.useCallback)(()=>r("sessions"),[r]),S=(0,c.useCallback)(()=>r("notificationEmail"),[r]),T=(0,c.useCallback)(()=>r("validateSession"),[r]),C=(0,c.useCallback)(()=>r("secureKey"),[r]);return{getHeader:n,membershipHeader:o,getWCSHeader:a,getWcsQueryHeader:l,getJWTHeader:d,getApiControllerHeader:u,getDMCHeader:f,getProfileHeader:s,getGCPHeader:p,getPaymentsHeader:x,getProductHeader:v,getAddressV2Header:y,getPreferencesHeader:g,getWalletPaymentHeader:h,getWalletHeader:b,getWcTokenHeader:m,getLoyaltyHeader:w,getVerificationSessionHeader:k,getStepUpHeader:_,getNotificationEmailHeader:S,getValidationSessionHeader:T,getSecureKeyHeader:C,getListHeader:(0,c.useCallback)(()=>r("lists"),[r]),getStatusCheckHeader:(0,c.useCallback)(e=>r("statusCheck",void 0,void 0,void 0,void 0,e),[r])}})(),s=(0,c.useCallback)(async r=>{if(t){let{URL:n,config:o,method:a}=await (0,eC.tI)(t,e,"createVerificationSession"),l=await i(),s={config:o,method:a,url:eD(n,null==r?void 0:r.workflowType),headers:l,body:JSON.stringify(r)};return await (0,eI.i)(s)}},[t,i]),d=(0,c.useCallback)(async i=>{if(t){let{URL:n,config:o,method:a}=await (0,eC.tI)(t,e,"validateMembership"),l={config:o,method:a,url:n,headers:await r(),body:JSON.stringify(i)};return await (0,eI.i)(l)}},[t,r]),u=(0,c.useCallback)(async(i,r,o="")=>{if(t){let{URL:a,config:l,method:s}=await (0,eC.tI)(t,e,"submitStepUpAnswers"),c=await n(i),d={config:l,method:s,url:eD(a.includes("{sessionId}")?a.replace("{sessionId}",i):a,o),headers:c,body:JSON.stringify(r)};return await (0,eI.i)(d)}},[t,n]),m=(0,c.useCallback)(async i=>{if(t){let{URL:r,config:n,method:o}=await (0,eC.tI)(t,e,"sendNotificationEmail"),l={config:n,method:o,url:r,headers:await a(),body:JSON.stringify(i)};return await (0,eI.i)(l)}},[t,a]);return{createVerificationSession:s,validateMembership:d,submitStepUpAnswers:u,sendNotificationEmail
59:m,validateSessionId:(0,c.useCallback)(async(i,r="")=>{if(t){let{URL:n,config:o,method:a}=await (0,eC.tI)(t,e,"validateSessionId"),s=await l(),c={config:o,method:a,url:eD(n.includes("{sessionId}")?n.replace("{sessionId}",i):n,r),headers:s};return await (0,eI.i)(c)}},[t,l]),statusCheck:(0,c.useCallback)(async i=>{if(t){let{URL:r,config:n,method:a}=await (0,eC.tI)(t,e,"statusCheck"),l=await o(i);return await (0,eI.i)({config:n,method:a,url:r,headers:l})}},[t,o])}};var eR=i(63073),eM=i(64134),eV=i(94731),eB=i(27966),eL=i(80061),eN=i(65778),eO=i(70927);let ez={pageTitle:"Verify your identity",pageDescription:"Please verify your identity to continue.",acceptedDocumentsNotice:"The documents you upload will expire on {{expire}}.",acceptedDocumentsTitle:"Accepted documents:",acceptedDocumentsItems:["U.S. Passport","State-issued ID Card","Federal ID"],optionOneTitle:"Option 1: Continue with verification",optionOneDescription:"Verify your identity using your device camera.",optionOneButtonLabel:"Continue with verification",optionTwoTitle:"Option 2: Send me a link",optionTwoDescription:"We'll send a verification link to {{email}}.",optionTwoButtonLabel:"Send me a link",dividerLabel:"or",alreadyVerifiedLabel:"Already verified?",checkStatusButtonLabel:"Check verification status",privacyNotice:"Your privacy is important to us.",customerServiceLinkLabel:"Contact Customer Service",customerServiceLinkUrl:"https://www.costco.com/customer-service.html",continueWithVerificationModalTitle:"Start verification",continueWithVerificationModalParagraphOne:"Follow the instructions to verify your identity.",continueWithVerificationModalParagraphTwo:"Make sure you are in a well-lit area.",continueWithVerificationModalPrimaryButtonLabel:"Start",continueWithVerificationModalSecondaryButtonLabel:"Cancel",continueWithVerificationModalCloseButtonAriaLabel:"Close modal",sendLinkModalTitle:"Verify via email",sendLinkModalDescription:"We'll send a verification link to your email.",sendLinkModalAdditionalText:"Check your email for the link.",sendLinkModalCloseButtonAriaLabel:"Close modal",sendLinkModalContinueLabel:"Continue",sendLinkModalSendAgainLabel:"Send link again",sendLinkModalCancelLabel:"Cancel"};var eP=i(51838),eW=i(33423),eF=i(19253);let e$=({isWebViewAuthFlow:e=!1}={})=>{let[t,i]=(0,c.useState)(null),{getToken:r,isLoading:n}=(0,ex.A)();return(0,c.useEffect)(()=>{let t=!0;return(async()=>{try{if(n)return;let o=e?await r(!0,{throwOnError:!0,throwIfMissingToken:!0}):await r(!0);if(!o||!t)return;let a=(0,eF.s)(o);i(a)}catch{t&&i(null)}})(),()=>{t=!1}},[r,n,e]),t};var eU=i(49090),eG=i(37911);let eq=(e,{base:t,md:i,sm:r})=>({fontSize:t,...i?{[e.breakpoints.down("md")]:{fontSize:i}}:{},...r?{[e.breakpoints.down("sm")]:{fontSize:r}}:{}}),eJ=(e,t,i)=>({fontSize:t,textTransform:"none",[e.breakpoints.up("md")]:{fontSize:i}}),eH=(0,T.default)(eB.default)({flex:1,width:"100%",backgroundColor:C.DJJ}),eZ=(0,T.default)(eB.default)(({theme:e})=>({maxWidth:"600px",width:"100%",margin:"0 auto",backgroundColor:C.DJJ,padding:C.pMV,display:"flex",flexDirection:"column",[e.breakpoints.up("md")]:{maxWidth:"700px"},[e.breakpoints.up("lg")]:{maxWidth:"800px"},[e.breakpoints.down("sm")]:{maxWidth:"100%",padding:C.i_v,margin:0}})),eY=(0,T.default)(eG.default)(({theme:e})=>({fontWeight:700,color:C.weo,lineHeight:"2rem",paddingTop:C.Mzk,marginBottom:C.Mzk,...eq(e,{base:"2rem",md:"2rem",sm:"1.5rem"})})),eK=(0,T.default)(eG.default)(({theme:e})=>({color:C.d1D,lineHeight:"1.6",...eq(e,{base:"1rem",md:"1rem",sm:"0.875rem"})})),eX=(0,T.default)(eB.default)({marginTop:C.i_v,marginBottom:C.i_v}),eQ=(0,T.default)(eG.default)(({theme:e})=>({color:C.d1D,lineHeight:"1.45",marginBottom:C.Mzk,...eq(e,{base:"1rem",md:"1rem",sm:"0.875rem"})})),e0=(0,T.default)(eG.default)(({theme:e})=>({color:C.weo,fontWeight:700,lineHeight:"1.35",marginBottom:C.D3H,...eq(e,{base:"1.375rem",md:"1.2rem",sm:"1.05rem"})})),e1=(0,T.default)("ul")({margin:0,paddingLeft:"1.5rem"}),e2=(0,T.default)("li")(({theme:e})=>({color:C.d1D,lineHeight:"1.45",marginBottom:"0.5rem",...eq(e,{base:"1rem",md:"1rem",sm:"0.875rem"}),"&:last-child":{marginBottom:0}})),e5=(0,T.default)(eB.default)({marginBottom:C.pMV}),e3=(0,T.default)(eG.default)(({theme:e})=>({fontWeight:700,color:C.weo,marginBottom:C.D3H,...eq(e,{base:"1.35rem",md:"1.3rem",sm:"1.05rem"})})),e7=(0,T.default)(eB.default)(({theme:e})=>({marginTop:C.i_v,"& .MuiButton-root":{minHeight:"44px",...eJ(e,"1.1rem","1rem"),[e.breakpoints.up("md")]:{minHeight:"48px"}}})),e8=(0,T.default)(eB.default)({display:"flex",alignItems:"center",gap:C.Mzk,marginBottom:C.pMV}),e9=(0,T.default)(eB.default)({flex:1,height:"1px",backgroundColor:C.Gwm}),e4=(0,T.default)(eG.default)(({theme:e})=>({color:C.d1D,...eq(e,{base:"1.35rem",md:"1.35rem",sm:"1rem"})})),e6=(0,T.default)(eG.default)(({theme:e})=>({fontWeight:700,color:C.weo,marginBottom:C.Mzk,...eq(e,{base:"1.35rem",md:"1.35rem",sm:"1.2rem"})})),te=(0,T.default)(eB.default)(({theme:e})=>({"& .MuiButton-root":{minHeight:"44px",...eJ(e,"1.15rem","1rem"),[e.breakpoints.up("md")]:{minHeight:"48px"}}})),tt=(0,T.default)("a")({color:C._1s,textDecoration:"none","&:hover":{color:C.fvD,textDecoration:"underline"},"&:focus-visible":{color:C.fvD,outline:`2px solid ${C._1s}`,outlineOffset:"2px",textDecoration:"underline"}}
59),ti=(0,T.default)(eB.default)({border:"2px solid #FFCC00",backgroundColor:"#FFF8D2",borderRadius:"4px",padding:C.Mzk}),tr=(0,T.default)(eB.default)(({theme:e})=>({display:"flex",flexDirection:"column",gap:C.D3H,marginTop:C.D3H,[e.breakpoints.up("md")]:{flexDirection:"row",gap:20},"& .MuiButton-root":{fontSize:"1.1rem",textTransform:"none",[e.breakpoints.up("md")]:{fontSize:"1rem"}}})),tn=(0,T.default)(eK)({"&:last-child":{marginBottom:0}}),to=({isContinueModalOpen:e,isSendLinkModalOpen:t,handleContinueModalClose:i,handleSendLinkModalClose:n,handleVisitExternalLink:o,handleSendLinkModalContinue:a,handleSendLinkModalSendAgain:l,continueWithVerificationModalTitle:s,continueWithVerificationModalCloseButtonAriaLabel:c,continueWithVerificationModalPrimaryButtonLabel:d,continueWithVerificationModalSecondaryButtonLabel:u,continueWithVerificationModalParagraphOne:m,continueWithVerificationModalParagraphTwo:f,sendLinkModalTitle:p,sendLinkModalCloseButtonAriaLabel:h,sendLinkModalContinueLabel:x,sendLinkModalSendAgainLabel:v,sendLinkModalCancelLabel:y,resolvedSendLinkModalDescription:g,sendLinkModalAdditionalText:b})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(eU.Modal,{uniqueId:"idverse-continue-verification-modal",isOpen:e,modalTitle:s,onClose:i,closeAriaLabel:c,children:[(0,r.jsx)(tn,{children:m}),(0,r.jsx)(tn,{children:f}),(0,r.jsxs)(tr,{children:[(0,r.jsx)(A.Button,{type:"button",variant:"primary",fullWidth:!0,onClick:o,children:d}),(0,r.jsx)(A.Button,{type:"button",variant:"secondary",fullWidth:!0,onClick:i,children:u})]})]}),(0,r.jsxs)(eU.Modal,{uniqueId:"idverse-send-link-modal",isOpen:t,modalTitle:p,onClose:n,closeAriaLabel:h,children:[(0,r.jsx)(tn,{children:g}),(0,r.jsx)(ti,{children:(0,r.jsx)(eK,{children:b})}),(0,r.jsxs)(tr,{children:[(0,r.jsx)(A.Button,{type:"button",variant:"primary",fullWidth:!0,onClick:a,children:x}),(0,r.jsx)(A.Button,{type:"button",variant:"secondary",fullWidth:!0,onClick:l,children:v}),(0,r.jsx)(A.Button,{type:"button",variant:"tertiary",fullWidth:!0,onClick:n,children:y})]})]})]}),ta=()=>(0,r.jsx)(eV.A,{"aria-hidden":"true","data-testid":"idverse-external-link-icon",sx:{fontSize:"1.25rem"},children:(0,r.jsx)("path",{d:"M19 19H5V5h7V3H5C3.89 3 3 3.9 3 5v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7ZM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7Z"})}),tl=({locale:e,email:t="",expireTime:i="",sessionId:n="",documentCaptureUrl:o="",onVerificationComplete:a})=>{let l,s,d=e$(),{content:u}=(({locale:e="en-us"}={})=>{let[t,i]=(0,c.useState)(ez),[r,n]=(0,c.useState)(!0),o=(0,c.useCallback)(async()=>{n(!0);try{let t=await (0,eO.C)(e);t?i(t):i(ez)}catch(e){console.error("Error fetching IdVerse content:",e),i(ez)}finally{n(!1)}},[e]);return(0,c.useEffect)(()=>{o()},[o]),{content:t,isLoading:r}})({locale:e??"en-us"}),{isContinueModalOpen:m,isSendLinkModalOpen:f,isCheckStatusLoading:p,handleContinueWithVerification:h,handleContinueModalClose:x,handleVisitExternalLink:v,handleSendLink:y,handleCheckStatus:g,handleSendLinkModalClose:b,handleSendLinkModalContinue:w,handleSendLinkModalSendAgain:_}=(({sessionId:e="",documentCaptureUrl:t="",expireTime:i,pollingTimeMs:r,onVerificationComplete:n}={})=>{let{sendNotificationEmail:o,validateSessionId:a}=eA(),{trackEvent:l}=(0,eW.z)(),s=(0,c.useRef)(null),d=(e=>{if("number"==typeof e)return!Number.isFinite(e)||e<=0?"":new Date(Date.now()+60*e*1e3).toISOString();let t=null==e?void 0:e.trim();if(!t)return"";let i=Number(t);return Number.isFinite(i)&&i>0?new Date(Date.now()+60*i*1e3).toISOString():t})(i),u=!!d&&new Date(d)<new Date,[m,f]=(0,c.useState)(!1),[p,h]=(0,c.useState)(!1),[x,v]=(0,c.useState)(!1),[y,g]=(0,c.useState)(u),[b,w]=(0,c.useState)(!1),_=e=>!!e&&new Date(e)<new Date,k=e=>{w(e.isVerified),g(e.isSessionExpired)},S=()=>{s.current&&(clearInterval(s.current),s.current=null)},T=async()=>{S(),v(!1),await (null==n?void 0:n())},C=async()=>{if(!e)return null;let t=await a(e),{isVerified:i}=(null==t?void 0:t.data)||{},r={isVerified:!!i,isSessionExpired:_(d)};return k(r),r.isVerified&&await T(),r},I=async()=>{e&&await o({sessionId:e,emailType:"225",linkURL:t,expiresAt:d})},E=async()=>
59{l({trackType:eP.Re,trackedData:{ui:"My Account | Confirm Identity | Send email link"}}),h(!0),await I()},j=async()=>{if(!e)return;if(_(d))return void k({isVerified:b,isSessionExpired:!0});v(!0);let t=await C();t&&(({isVerified:e,isSessionExpired:t})=>!e&&!t)(t)?e&&(({isVerified:e,isSessionExpired:t})=>!e&&!t)({isVerified:b,isSessionExpired:y})&&(S(),s.current=setInterval(async()=>{let e=await C();e&&(({isVerified:e,isSessionExpired:t})=>!e&&!t)(e)||(S(),v(!1))},r??5e3)):v(!1)},D=async()=>{await j(),h(!1)},A=async()=>{await I(),h(!1)};return(0,c.useEffect)(()=>()=>{S()},[]),(0,c.useEffect)(()=>{y&&(S(),v(!1))},[y]),{isContinueModalOpen:m,isSendLinkModalOpen:p,isCheckStatusLoading:x,handleContinueWithVerification:()=>{l({trackType:eP.Re,trackedData:{ui:"My Account | Confirm Identity | Continue with verification"}}),f(!0)},handleContinueModalClose:()=>{f(!1),S()},handleVisitExternalLink:()=>{if(t){let e=window.open(t,"_blank");e&&(e.opener=null)}f(!1),S()},handleSendLink:E,handleCheckStatus:j,handleSendLinkModalClose:()=>{h(!1),S()},handleSendLinkModalContinue:D,handleSendLinkModalSendAgain:A}})({sessionId:n,documentCaptureUrl:o,expireTime:i,pollingTimeMs:null==u?void 0:u.pollingTime,onVerificationComplete:a}),{pageTitle:k="",pageDescription:S="",acceptedDocumentsNotice:T="",acceptedDocumentsTitle:C="",acceptedDocumentsItems:I=[],optionOneTitle:E="",optionOneDescription:j="",optionOneButtonLabel:D="",optionTwoTitle:R="",optionTwoDescription:M="",optionTwoButtonLabel:V="",dividerLabel:B="",alreadyVerifiedLabel:L="",checkStatusButtonLabel:N="",privacyNotice:z="",customerServiceLinkLabel:P="",customerServiceLinkUrl:W="",continueWithVerificationModalTitle:F="",continueWithVerificationModalParagraphOne:$="",continueWithVerificationModalParagraphTwo:U="",continueWithVerificationModalPrimaryButtonLabel:G="",continueWithVerificationModalSecondaryButtonLabel:q="",continueWithVerificationModalCloseButtonAriaLabel:J="",sendLinkModalTitle:H="",sendLinkModalDescription:Z="",sendLinkModalAdditionalText:Y="",sendLinkModalCloseButtonAriaLabel:K="",sendLinkModalContinueLabel:X="",sendLinkModalSendAgainLabel:Q="",sendLinkModalCancelLabel:ee=""}=u??{},et=W.startsWith("https://")?W:"#",ei=(l=(e=>{var t;let i="string"==typeof e?Number(e):e;if(!i||Number.isNaN(i))return"";let r=new Date(Date.now()+60*i*1e3),n="u">typeof navigator&&navigator.language||new Intl.DateTimeFormat().resolvedOptions().locale,o=new Intl.DateTimeFormat(n,{month:"numeric",day:"numeric",year:"2-digit",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).formatToParts(r),a=e=>{var t;return(null==(t=o.find(t=>t.type===e))?void 0:t.value)??""},l=a("month"),s=a("day"),c=a("year"),d=a("hour"),u=a("minute"),m="pm"===a("dayPeriod").toLowerCase()?"p.m.":"a.m.",f=(null==(t=new Intl.DateTimeFormat("en",{timeZoneName:"long"}).formatToParts(r).find(e=>"timeZoneName"===e.type))?void 0:t.value)??"",p=a("timeZoneName"),h=/^GMT[+-]/.test(p)&&f.split(" ").map(e=>e[0]).join("")||p,x=(()=>{try{let e=new Intl.DisplayNames(["en"],{type:"region"});return Array.from({length:26},(e,t)=>String.fromCharCode(65+t)).flatMap(e=>Array.from({length:26},(t,i)=>e+String.fromCharCode(65+i))).filter(t=>{try{return!!e.of(t)}catch{return!1}}).find(t=>{let i=e.of(t);return i&&f.startsWith(i)})??new Intl.Locale(n).region??""}catch{return new Intl.Locale(n).region??""}})();return`${l}/${s}/${c} at ${d}:${u} ${m} ${h}${x?` (${x})`:""}`})(i),s=`${i} minute${1===Number(i)?"":"s"}`,l?(0,eM.P9)(T,{expire:l,time:s}):T),er=t||("string"==typeof(null==d?void 0:d.email)?d.email:""),en=(0,eM.P9)(M,{email:er}),eo=(0,eM.P9)(Z,{email:er});return(0,r.jsxs)(eB.default,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",position:"relative"},children:[(0,r.jsx)(eH,{children:(0,r.jsxs)(eZ,{children:[(0,r.jsx)(eY,{variant:"h1",children:k.trim()}),(0,r.jsx)(eK,{children:S.trim()}),(0,r.jsx)(eX,{children:(0,r.jsx)(O.Notification,{uniqueId:"idverse-accepted-documents-notification",severity:"alert",sx:{borderWidth:"2px"},message:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eQ,{children:ei}),C.trim()?(0,r.jsx)(e0,{children:C.trim()}):null,I.length>0&&(0,r.jsx)(e1,{children:I.map(e=>(0,r.jsx)(e2,{children:e},e))})]})})}),(0,r.jsxs)(e5,{children:[(0,r.jsx)(e3,{variant:"h2",children:E.trim()}),(0,r.jsx)(eK,{children:j.trim()}),(0,r.jsx)(e7,{children:(0,r.jsx)(A.Button,{type:"button",onClick:h,variant:"primary",fullWidth:!0,startIcon:(0,r.jsx)(ta,{}),children:D.trim()})})]}),(0,r.jsxs)(e5,{children:[(0,r.jsx)(e3,{variant:"h2",children:R.trim()}),(0,r.jsx)(eK,{children:en}),(0,r.jsx)(e7,{children:(0,r.jsx)(A.Button,{type:"button",onClick:y,variant:"primary",fullWidth:!0,children:V.trim()})})]}),(0,r.jsxs)(e8,{children:[(0,r.jsx)(e9,{}),(0,r.jsx)(e4,{children:B.trim()}),(0,r.jsx)(e9,{})]}),(0,r.jsxs)(e5,{children:[(0,r.jsx)(e6,{children:L.trim()}),p&&(0,r.jsx)(eL.y,{label:"Loading",size:eN.HU.Medium,hasBackdrop:!1}),(0,r.jsx)(te,{children:(0,r.jsx)(A.Button,{type:"button",onClick:g,variant:"secondary",fullWidth:!0,disabled:p,children:N.trim()})})]}),(0,r.jsxs)(eK,{children:[z.trim()," ",(0,r.jsx)(tt,{href:et,children:P.trim()}),"."]})]})}),(0,r.jsx)(to,{isContinueModalOpen:m,isSendLinkModalOpen:f,handleContinueModalClose:x,handleSendLinkModalClose:b,handleVisitExter
59nalLink:v,handleSendLinkModalContinue:w,handleSendLinkModalSendAgain:_,continueWithVerificationModalTitle:F,continueWithVerificationModalCloseButtonAriaLabel:J,continueWithVerificationModalPrimaryButtonLabel:G,continueWithVerificationModalSecondaryButtonLabel:q,continueWithVerificationModalParagraphOne:$,continueWithVerificationModalParagraphTwo:U,sendLinkModalTitle:H,sendLinkModalCloseButtonAriaLabel:K,sendLinkModalContinueLabel:X,sendLinkModalSendAgainLabel:Q,sendLinkModalCancelLabel:ee,resolvedSendLinkModalDescription:eo,sendLinkModalAdditionalText:Y})]})},ts={pageTitle:"Confirm Identity",pageDescription:"Please answer the following questions.",noteTitle:"",noteDescription:"",submitButtonLabel:"Submit",cancelButtonLabel:"Cancel",errorMessage:"Unable to verify your answers. Please try again.",fieldValidationErrorRadio:"Please select an option.",fieldValidationErrorSelect:"Please select an option.",fieldValidationErrorText:"Please enter a value.",privacynotice:"Your privacy is important to us.",customerservicelinklabel:"Contact Customer Service",customerservicelinkurl:"https://www.costco.com/customer-service.html",leaveverificationmodaltitle:"Are you sure you want to leave?",leaveverificationmodaldescription:"You selected an option that takes you out of identity confirmation. To confirm your identity later, visit a membership desk at your",leavewarehouselinklabel:"Costco Location",leavewarehouselinkurl:"costco.com",leaveverificationmodallisttitle:"You will lose:",leaveverificationbuttonlabel:"Leave",continueverificationbuttonlabel:"Continue",leaveverificationmodalitemdriverlicense:"Driver License",leaveverificationmodalitempassport:"Passport",leaveverificationmodalitemstateissuedidcard:"State Issued ID Card"},tc=()=>({answers:{},isSubmitting:!1});function td(e,t){switch(t.type){case"SET_VALUE":return{...e,answers:{...e.answers,[t.id]:t.value}};case"SET_SUBMITTING":return{...e,isSubmitting:t.value};case"RESET":return tc();default:return e}}var tu=i(28148);let tm=({locale:e="en-us"}={})=>{let[t,i]=(0,c.useState)(ts),[r,n]=(0,c.useState)(!0),o=(0,c.useCallback)(async()=>{n(!0);try{let t=await (0,tu.E)(e);i(t)}catch{i(ts)}finally{n(!1)}},[e]);return(0,c.useEffect)(()=>{o()},[o]),{content:t,isLoading:r}};var tf=i(91888),tp=i(37677);let th=(0,T.default)("div")({display:"flex",flexDirection:"column",minHeight:"100vh"}),tx=(0,T.default)("div")(({theme:e})=>({position:"fixed",inset:0,zIndex:e.zIndex.modal+1,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:C.Mzk,color:C.DJJ,backgroundColor:"rgba(0, 0, 0, 0.7)"})),tv=(0,T.default)(eB.default)({flex:1,width:"100%",backgroundColor:C.DJJ,padding:0}),ty=(0,T.default)(eB.default)(({theme:e})=>({width:"100%",backgroundColor:C.DJJ,display:"flex",flexDirection:"column",[e.breakpoints.down("sm")]:{padding:0},[e.breakpoints.up("md")]:{maxWidth:"700px",padding:0},[e.breakpoints.up("lg")]:{maxWidth:"800px",padding:0}})),tg=(0,T.default)("h1")(({theme:e})=>({margin:0,fontSize:"1.75rem",fontWeight:600,color:C.weo,marginBottom:C.Mzk,[e.breakpoints.down("sm")]:{fontSize:"1.5rem",marginBottom:C.Mzk},[e.breakpoints.up("lg")]:{fontSize:"2rem"}})),tb=(0,T.default)(eG.default)({fontSize:"0.9375rem",color:C.d1D,lineHeight:"1.6",marginBottom:C.Mzk}),tw=(0,T.default)("div")({fontSize:"0.9375rem",color:C.d1D,lineHeight:"1.6",padding:C.Mzk,border:`1px solid ${C._1s}`,borderRadius:"3px",backgroundColor:"#f0f7ff",display:"block","& strong":{fontWeight:700,marginRight:"4px"},marginBottom:C.Mzk}),t_=(0,T.default)(eG.default)({fontSize:"0.9375rem",color:C.d1D,lineHeight:"1.6",marginTop:C.pMV,marginBottom:C.pMV}),tk=(0,T.default)(eB.default)(({theme:e})=>({marginTop:C.Mzk,marginBottom:C.Mzk,[e.breakpoints.up("md")]:{marginTop:C.Mzk,marginBottom:C.Mzk}})),tS=(0,T.default)("h2")(({theme:e})=>({margin:0,fontSize:C.MkR,fontWeight:700,textTransform:"capitalize",letterSpacing:"0.5px",color:C.d1D,[e.breakpoints.up("md")]:{fontSize:C.x9N}})),tT=(0,T.default)("p")(({theme:e})=>({display:"block",fontSize:"0.9375rem",fontWeight:400,color:C.weo,marginBottom:C.D3H,[e.breakpoints.up("md")]:{fontSize:"1rem",marginBottom:C.D3H}}));(0,T.default)("fieldset")({border:0,margin:0,padding:0,minInlineSize:0}),(0,T.default)("legend")(({theme:e})=>({fontSize:"0.9375rem",fontWeight:500,color:C.weo,marginBottom:C.Mzk,padding:0,[e.breakpoints.up("md")]:{fontSize:"1rem",marginBottom:C.i_v}}));let tC=(0,T.default)(eG.default)({fontSize:"0.8125rem",color:C.syQ,lineHeight:"1.6",marginBottom:C.Mzk}),tI=(0,T.default)(eB.default)(({theme:e})=>({marginBottom:0,"& .MuiTextField-root":{width:"100%"},"& .MuiSelect-root":{width:"100%"},"& .MuiSelect-select, & .MuiNativeSelect-select":{paddingLeft:"13px !important"},"& .MuiFormControl-root + .MuiBox-root":{paddingLeft:"1px !important"},"& .MuiFormGroup-root":{display:"flex",flexDirection:"column",gap:C.Mzk,[e.breakpoints.up("md")]:{gap:C.i_v}}
59,"& .MuiFormControlLabel-root":{margin:0}})),tE=(0,T.default)("form")({display:"flex",flexDirection:"column"}),tj=(0,T.default)("div")({width:"100%","& fieldset":{width:"100%"}}),tD=(0,T.default)(eB.default)(({theme:e})=>({display:"flex",flexDirection:"column",gap:C.D3H,marginTop:C.Mzk,[e.breakpoints.up("md")]:{gap:C.i_v},'& button[type="submit"]':{backgroundColor:C._1s,color:C.DJJ,border:"none","&:hover:not(:disabled)":{backgroundColor:C.fvD},"&:focus-visible":{outline:"2px auto -webkit-focus-ring-color",outlineOffset:"2px"},"&:active:not(:disabled)":{backgroundColor:C.fvD}},'& button[type="button"]':{backgroundColor:"transparent",color:C._1s,border:`2px solid ${C._1s}`,"&:hover:not(:disabled)":{backgroundColor:C.QA7},"&:focus-visible":{outline:`2px solid ${C._1s}`,outlineOffset:"2px"},"&:active:not(:disabled)":{backgroundColor:C.BN3}}})),tA=(0,T.default)("a")({color:C._1s,textDecoration:"underline","&:hover":{color:C.fvD,textDecoration:"underline"},"&:focus-visible":{color:C.fvD,outline:`2px solid ${C._1s}`,outlineOffset:"2px",textDecoration:"underline"}}),tR=({question:e,value:t,hasError:i,errorMessage:n,onValueChange:o})=>{var a,l;let s=`kba-question-${e.id}`;if("radio"===e.type){let l=e.label;return(0,r.jsx)(tj,{children:(0,r.jsx)(tf.z,{uniqueId:`${s}-group`,options:(null==(a=e.options)?void 0:a.map(e=>({label:e.label,value:e.value})))||[],onChange:t=>o(e.id,t),selectedOption:t,accessibleLegendText:l,accessibleLegendId:`${s}-legend`,isAccessibleLegendVisible:!1,errorText:i?n:void 0,ariaLabelErrorPrefix:"Error"})})}return"select"===e.type?(0,r.jsx)(tp.l,{uniqueId:s,label:e.placeholder||"Select option",options:[{text:e.placeholder||"Select option",value:""},...(null==(l=e.options)?void 0:l.map(e=>({text:e.label,value:e.value})))||[]],value:t,onChange:t=>o(e.id,t.target.value),hasError:i,errorText:n||"",errorIconAriaLabel:"Error",autoComplete:"off",isRequired:!0}):(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(ev.A,{id:s,inputLabelId:`${s}-label`,label:e.placeholder||"Enter answer",name:e.name,value:t,onChange:t=>o(e.id,t.target.value),autoComplete:"off",isRequired:!0,isError:i,errorText:n||"",errorIconAriaLabel:"Error"})})};var tM=i(73321);let tV=(0,T.default)("p")({margin:"13px 0",fontSize:C.MkR,color:C.d1D,lineHeight:1.6}),tB=(0,T.default)("h3")({margin:0,fontSize:C.MkR,fontWeight:700,color:C.d1D}),tL=(0,T.default)("ul")({margin:0,paddingLeft:C.i_v,display:"flex",flexDirection:"column",gap:C.Mzk,fontSize:C.MkR,color:C.d1D,lineHeight:1.6}),tN=(0,T.default)("a")({color:C._1s,textDecoration:"underline"}),tO=(0,T.default)(eB.default)(({theme:e})=>({display:"flex",flexDirection:"column",gap:C.D3H,marginTop:C.Mzk,"& .MuiButton-root":{fontSize:"1.1rem",textTransform:"none",[e.breakpoints.up("md")]:{fontSize:"1rem"}}})),tz=[""],tP=({isOpen:e,title:t="",bodyText:i="",warehouseLinkLabel:n="",warehouseLinkUrl:o="",acceptedDocsHeading:a="",acceptedDocsList:l=tz,confirmLabel:s="",cancelLabel:c="",closeAriaLabel:d="",onConfirm:u,onClose:m})=>{let f=(0,tM.useRouter)();return(0,r.jsxs)(eU.Modal,{uniqueId:"kba-cancel-confirmation-modal",isOpen:e,modalTitle:t,onClose:m,closeAriaLabel:d||c,paperProps:{sx:{width:"500px"}},children:[(0,r.jsxs)(tV,{children:[i," ",o&&n&&(0,r.jsx)(tN,{href:o,children:n})," ","with one of the following."]}),(0,r.jsx)(tB,{children:a}),(0,r.jsx)(tL,{children:l.map((e,t)=>(0,r.jsx)("li",{children:e},t))}),(0,r.jsxs)(tO,{children:[(0,r.jsx)(A.Button,{type:"button",variant:"primary",fullWidth:!0,onClick:()=>{u(),f.push("/")},children:s}),(0,r.jsx)(A.Button,{type:"button",variant:"secondary",fullWidth:!0,onClick:m,children:c})]})]})},tW=({kbaData:e,locale:t,onSubmitResult:i,workflowType:n})=>{let{trackEvent:o}=(0,eW.z)(),{content:a}=tm({locale:t??"en-us"}),{pageTitle:l="",pageDescription:s="",noteTitle:d="",noteDescription:u="",submitButtonLabel:m="",cancelButtonLabel:f="",errorMessage:p="",fieldValidationErrorRadio:h="",fieldValidationErrorSelect:x="",fieldValidationErrorText:v="",privacynotice:y="",customerservicelinklabel:g="",customerservicelinkurl:b="",leaveverificationmodaltitle:w="",leaveverificationmodaldescription:_="",leavewarehouselinklabel:k="",leavewarehouselinkurl:S="",leaveverificationmodallisttitle:T="",leaveverificationbuttonlabel:C="",continueverificationbuttonlabel:I="",leaveverificationmodalitemdriverlicense:E="",leaveverificationmodalitempassport:j="",leaveverificationmodalitemstateissuedidcard:D=""}=a??{},{state:R,fieldErrors:M,showServerError:V,visibleQuestions:B,handleValueChange:L,handleSubmit:z,handleCancel:P}=(({kbaData:e,validationErrorMessages:t,onSubmitResult:i,workflowType:r})=>{let{submitStepUpAnswers:n}=eA(),[o,a]=(0,c.useReducer)(td,tc()),[l,s]=(0,c.useState)({}),[d,u]=(0,c.useState)(!1),{authSelectionId:m="",sessionId:f="",questionSet:p}=e||{},[h,x]=(0,c.useState)(m),[v,y]=(0,c.useState)(f),[g,b]=(0,c.useState)(p);(0,c.useEffect)(()=>{x(m),y(f),b(p),a({type:"RESET"}),s({}),u(!1)},[m,p,f]);let w=(null==g?void 0:g.questions)??[],_=(null==g?void 0:g.questionSetId)??"",k=w.map((e,t)=>{var i;let r;return{id:e.questionId,orderLabel:`Question ${t+1}`,label:e.text,type:"singlechoice"===(r=e.type.toLowerCase())?"radio":"text"===r?"text":"select",name:e.questionId,options:null==(i=e.choices)?void 0:i.map(e=>({label:e.text,value:e.choiceId}))}}),S=k.map(e=>e.id),T=async e=>{var l;e.preventDefault();let c=((e,t,i,r={})=>{var n,o,a;let l={},s=(null==(n=r.radio)?void 0:n.trim())||"Select an option.",c=(null==(o=r.select)?void 0:o.trim())||"Select from the list.",d=(null==(a=r.text)?void 0:a.trim())||"Type in your answer.";return t.forEach(t=>{var r,n;if(!(null==(r=e[t])?void 0:r.trim())){let e=null==(n=null==i?void 0:i.find(e=>e.id===t))?void 0:n.type;"select"===e?l[t]=c:"text"===e?l[t]=d:l[t]=s}}),l})(o.answers,S,k,t);if(Object.keys(c).length>0)return void s(c);s({}),u(!1),a({type:"SET_SUBMITTING",value:!0});try{let e,t=(e=k.map(e=>
59{let t=o.answers[e.id].trim();return"text"===e.type?{questionId:String(e.id),textAnswer:t}:{questionId:String(e.id),choices:[{choiceId:String(t)}]}}),{authSelectionId:h,answers:{questionSetId:String(_),questions:e}}),c=await n(v,t,r);if(!c){u(!0),null==i||i({hasIncorrectAnswers:!0});return}let d=c.data,m=null==(l=d.questionSet)?void 0:l.questions;if(null==m?void 0:m.length){let e=d.questionSet;b(e),d.authSelectionId&&x(d.authSelectionId),d.sessionId&&y(d.sessionId),a({type:"RESET"}),s({}),u(!1);return}if(d.DocumentCaptureURL||d.documentCaptureUrl||d.isVerified){null==i||i(d);return}u(!0),null==i||i(d)}catch{u(!0),null==i||i({hasIncorrectAnswers:!0})}finally{a({type:"SET_SUBMITTING",value:!1})}};return{state:o,fieldErrors:l,showServerError:d,visibleQuestions:k,handleValueChange:(e,t)=>{a({type:"SET_VALUE",id:e,value:t}),l[e]&&s(t=>{let i={...t};return delete i[e],i}),d&&u(!1)},handleSubmit:T,handleCancel:()=>{a({type:"RESET"}),s({}),u(!1),window.scrollTo({top:0,behavior:"smooth"})}}})({kbaData:e,validationErrorMessages:{radio:h,select:x,text:v},onSubmitResult:i,workflowType:n}),W=l.trim(),F=s.trim(),$=m.trim(),U=f.trim(),G=p.trim(),q=d.trim(),J=u.trim(),H=y.trim(),Z=g.trim(),Y=(e=>{try{let t=new URL(e.trim());return"https:"===t.protocol&&/(^|\.)costco\.com$/i.test(t.hostname)?t.toString():"#"}catch{return"#"}})(b),[K,X]=(0,c.useState)(!1),Q=(0,c.useRef)(null);return(0,c.useEffect)(()=>{var e;if(0===Object.keys(M).length)return;let t=null==(e=Q.current)?void 0:e.querySelector('[aria-invalid="true"]'),i=(null==t?void 0:t.matches("fieldset"))?t.querySelector('input[type="radio"]'):t;null==i||i.focus()},[M]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(th,{children:[R.isSubmitting&&(0,r.jsxs)(tx,{children:[(0,r.jsx)(eL.y,{size:eN.HU.Medium,hasBackdrop:!1,label:"verify-identity-loading"}),(0,r.jsx)(N.Text,{sx:{textAlign:"center"},children:"Verifying your answers..."})]}),(0,r.jsx)(tv,{children:(0,r.jsxs)(ty,{children:[(0,r.jsx)(tg,{children:W}),(0,r.jsx)(tb,{children:F}),J&&(0,r.jsxs)(tw,{children:[(0,r.jsx)("strong",{children:q})," ",J]}),V&&(0,r.jsx)(O.Notification,{isRole:!0,message:G,severity:"critical",uniqueId:"verify-identity-server-error"}),(0,r.jsxs)(tE,{ref:Q,onSubmit:z,noValidate:!0,children:[B.map(e=>{let t,i;return(0,r.jsxs)(tk,{children:[(0,r.jsx)(tS,{children:e.orderLabel}),(0,r.jsx)(tT,{children:e.label}),e.helpText&&(0,r.jsx)(tC,{children:e.helpText}),(0,r.jsx)(tI,{children:(t=R.answers[e.id]||"",i=!!M[e.id],(0,r.jsx)(tR,{question:e,value:t,hasError:i,errorMessage:M[e.id],onValueChange:L}))})]},e.id)}),(0,r.jsxs)(tD,{children:[(0,r.jsx)(A.Button,{type:"submit",variant:"primary",fullWidth:!0,isLoading:R.isSubmitting,children:R.isSubmitting?"Submitting...":$}),(0,r.jsx)(A.Button,{type:"button",onClick:()=>X(!0),variant:"secondary",fullWidth:!0,children:U})]})]}),H&&Z&&(0,r.jsxs)(t_,{children:[H," ",(0,r.jsx)(tA,{href:Y,children:Z}),"."]})]})})]}),(0,r.jsx)(tP,{isOpen:K,title:w||void 0,bodyText:_||void 0,warehouseLinkLabel:k,warehouseLinkUrl:S,acceptedDocsHeading:T||void 0,acceptedDocsList:[E,j,D].filter(Boolean),confirmLabel:C||void 0,cancelLabel:I||void 0,onConfirm:()=>{o({trackType:eP.Re,trackedData:{ui:"My Account | Membership | Leave Membership Verification"}}),X(!1),P()},onClose:()=>X(!1)})]})};i(91992),i(82849);let tF=(0,T.default)(eB.default)({display:"flex",flexDirection:"column",minHeight:"100vh",maxWidth:"550px",backgroundColor:C.DJJ,padding:C.i_v,marginTop:"2px"}),t$=(0,T.default)(eB.default)({width:"100%",paddingBottom:"20px"}),tU=(0,T.default)(eB.default)({display:"flex",width:"100%",flexDirection:"column",alignItems:"flex-start",gap:C.i_v,flexGrow:1}),tG=({sessionData:e,locale:t,breadcrumbObj:i,workflowType:n,successHandler:o,failureHandler:a})=>{var l,s,d,u;let{content:m}=tm({locale:t??"en-us"}),f=(null==(l=null==m?void 0:m.pageTitle)?void 0:l.trim())??"",p=e$(),h="kba"==(u=e?"questionSet"in e&&(null==(s=e.questionSet)?void 0:s.questionSetId)&&Array.isArray(null==(d=e.questionSet)?void 0:d.questions)?"kba":"DocumentCaptureURL"in e&&e.DocumentCaptureURL?"idverse":"unknown":"unknown")?"kbaQuestionUI":"idverse"===u?"idverseUI":"none",[x,v]=(0,c.useState)(null),y=x?"idverseUI":h,g=x?{...e,...x}:e;if(!g)return null;let b="DocumentCaptureURL"in g?g.DocumentCaptureURL??"":"",w="DocumentCaptureExpiresinMinutes"in g?g.DocumentCaptureExpiresinMinutes??"":"",_=("string"==typeof g.email?g.email:"")||("string"==typeof(null==p?void 0:p.email)?p.email:""),k=i?(0,r.jsx)(t$,{children:(0,r.jsx)(eR.Breadcrumbs,{uniqueId:"verify-identity-breadcrumbs",separator:"/",breadcrumbElements:[{name:i.label,link:i.link},{name:f,link:""}],ariaLabel:"breadcrumbs"})}):null;return(0,r.jsx)(tF,{children:(0,r.jsxs)(c.Suspense,{children:[k,(0,r.jsx)(tU,{children:"idverseUI"===y?(0,r.jsx)(tl,{locale:t,email:_,expireTime:String(w),sessionId:String(g.sessionId??""),documentCaptureUrl:String(b),onVerificationComplete:async()=>{await (null==o?void 0:o({isVerified:!0}))}}):(0,r.jsx)(tW,{kbaData:g,locale:t,onSubmitResult:e=>{if(e.DocumentCaptureURL)return void v({DocumentCaptureURL:e.DocumentCaptureURL,DocumentCaptureExpiresinMinutes:e.DocumentCaptureExpiresinMinutes});if(e.isVerified){null==o||o(e);return}null==a||a(e)},workflowType:n})})]})})},tq="DRR_VALIDATION",tJ=({sessionId:e,membershipNumber:t,locale:i,msText:n,onVerificationComplete:o,onVerificationFailed:a,apiError:l})=>{let s={loadingText:(null==n?void 0:n.loadingText)??"",sessionErrorText:(null==n?void 0:n.sessionErrorText)??"",failedErrorText:(null==n?void 0:n.failedErrorText)??""},{createVerificationSession:d}=eA(),[u,m]=(0,c.useState)(),[f,p]=(0,c.useState)(!0),h=(0,c.useRef)(Symbol("identity-verification-request-identity")),x=(0,c.useRef)(a);x.current=a;let v=(0,c.useRef)(s.sessionErrorText);return(v.current=s.sessionErrorText,(0,c.useEffect)(()=>
59{if(!e){p(!1),m(void 0);return}let i=Symbol("identity-verification-request-identity");return h.current=i,(async()=>{var r,n;p(!0),m(void 0);try{let n=await d({workflowType:tq,data:{deviceSessionId:e,membershipNumber:t},preCheck:!1});if(h.current!==i)return;if(!(null==n?void 0:n.data)){v.current&&(null==(r=x.current)||r.call(x,v.current));return}m(n.data)}catch{if(h.current!==i)return;v.current&&(null==(n=x.current)||n.call(x,v.current))}finally{h.current===i&&p(!1)}})(),()=>{h.current===i&&(h.current=Symbol("identity-verification-request-identity"))}},[d,t,e]),e)?(0,r.jsxs)(es.Grid,{container:!0,spacing:2,hasMargin:!1,children:[l&&(0,r.jsx)(es.Grid,{size:{xs:12},children:(0,r.jsx)(O.Notification,{severity:"critical",message:l,uniqueId:"identity_verification_api_error"})}),f&&s.loadingText&&(0,r.jsx)(es.Grid,{size:{xs:12},children:(0,r.jsx)(N.Text,{variant:"b1",children:s.loadingText})}),!f&&u&&(0,r.jsx)(es.Grid,{size:{xs:12},children:(0,r.jsx)(tG,{sessionData:u,locale:i,workflowType:tq,successHandler:async()=>{await (null==o?void 0:o())},failureHandler:async()=>{s.failedErrorText&&(null==a||a(s.failedErrorText))}})})]}):null},tH=[...v],tZ=({moduleSettings:e,stateOptions:t,dataRightsRequestConfig:i,formId:n="dataRightsForm",initialValues:a,onValuesChange:v,onSubmit:b,validateOnBlur:w,validateOnChange:T,formConfigData:C,findMembershipContent:I})=>{var j,D,A,R,M,V,B,N;let{signIn:O,signOut:z,isUserSignedIn:P,getToken:W}=(0,ex.A)(),{isRecaptchaEnabled:F}=(0,m.N)(),$=F&&(null==C?void 0:C.recaptchaEnabled),U=(0,c.useRef)(null),G=c.useCallback(()=>{var e;null==(e=U.current)||e.reset()},[]),q=(0,f.Je)(e),J=q.continuebuttontext||(0,f.fm)("continuebuttontext",e)||"Continue",H=(0,f.fm)("datarightdonotapplyerror",e)||(0,f.fm)("datarightsdonotapplyerror",e),Z=(e=>{var t,i,r,n,o,a;let l=null==(i=null==(t=e.properties)?void 0:t.find(e=>e.datarightsapplicablestates))?void 0:i.datarightsapplicablestates,s=null==(n=null==(r=e.properties)?void 0:r.find(e=>{var t;return null==(t=e.dataRightsApplicableStates)?void 0:t.length}))?void 0:n.dataRightsApplicableStates;if(l)return new Set(Object.entries(l).filter(([,e])=>e).map(([e])=>y(e)).filter(Boolean));if(null==s?void 0:s.length)return g(s);let c=null==(a=null==(o=e.key_value)?void 0:o.find(e=>"datarightsapplicablestates"===e.key||"datarightapplicablestates"===e.key))?void 0:a.value;return c?g(c.split(",")):new Set})(e),Y={ackIntroText:(0,f.fm)("ackintrotext",e),ackAuthorizationText:(0,f.fm)("ackauthorizationtext",e),ackStepsText:(0,f.fm)("ackstepstext",e),ackCheckboxLabel:(0,f.fm)("ackcheckboxlabel",e),ackCheckboxErrorMessage:(0,f.fm)("ackcheckboxerrormessage",e)},K={ackIntroText:Y.ackIntroText,dsrInstructionText:(0,f.fm)("dsrinstructiontext",e),dsrMemberIdentificationText:(0,f.fm)("dsrmemberidentificationtext",e),editInformationButtonText:(0,f.fm)("editinformationbuttontext",e),findMembershipHelpText:(0,f.fm)("findmembershiptext",e),birthyearInfoText:(0,f.fm)("birthyearinfotext",e),identityVerificationText:(0,f.fm)("identityverificationtext",e)},X={headingText:(0,f.fm)("emailverificationheadingtext",e),bodyText:(0,f.fm)("emailverificationbodytext",e),inputLabel:(0,f.fm)("emailverificationinputlabel",e),sendNewCodeButtonText:(0,f.fm)("emailverificationsendnewcodebuttontext",e),verifyCodeButtonText:(0,f.fm)("emailverificationverifybuttontext",e),incorrectCodeErrorText:(0,f.fm)("emailverificationincorrectcodeerrortext",e),genericServiceErrorText:(0,f.fm)("emailverificationserviceerrortext",e),resendCooldownText:(0,f.fm)("emailverificationresendcooldowntext",e)},Q={loadingText:(0,f.fm)("identityverificationloadingtext",e),sessionErrorText:(0,f.fm)("identityverificationsessionerrortext",e),failedErrorText:(0,f.fm)("identityverificationfailederrortext",e)},ee=(0,f.fm)("createsessionapierrortext",e),et=(0,f.fm)("servicenowredirectapierrortext",e),ei=(e=>{var t;let i=null==(t=e.properties)?void 0:t.find(e=>e.serviceNowUrl&&e.serviceNowQueryParameter);if((null==i?void 0:i.serviceNowUrl)&&i.serviceNowQueryParameter)return{url:i.serviceNowUrl,tokenQueryParameter:i.serviceNowQueryParameter}})(e),er=(0,c.useMemo)(()=>({...x,...a}),[a]),en=(0,c.useMemo)(()=>(e=>{if(!(null==e?void 0:e.length))return[];let t=new Set;return e.filter(e=>{if(!e.value)return!t.has("")&&(t.add(""),!0);let i=e.value.trim().toUpperCase();return!(!i||t.has(i))&&(t.add(i),!0)})})(t),[t]),[eo,ea]=(0,c.useReducer)(S,{...k,currentView:"Yes"===er.costcoAccountSelection?"DSRFormView":tH[0],journeySelection:er}),es=(0,c.useRef)(!1),ec=null==(D=null==(j=eo.dsrDraftValues)?void 0:j.Email)?void 0:D.trim(),ed=(null==(R=null==(A=eo.memberData)?void 0:A.sessionId)?void 0:R.trim())||"",eu="No"===eo.journeySelection.behalfOfSelection&&"Yes"===eo.journeySelection.costcoAccountSelection;(0,c.useEffect)(()=>{ea({type:"UPDATE_DATA",payload:{view:"journeySelection",data:er}})},[er]),(0,c.useEffect)(()=>{es.current||(async()=>{let e=sessionStorage.getItem(h);if(e&&await P())try{let t=JSON.parse(e);es.current=!0,sessionStorage.removeItem(h),ea({type:"UPDATE_DATA",payload:{view:"journeySelection",data:t}}),ea({type:"NAVIGATE_TO_VIEW",payload:"DSRFormView"})}catch{sessionStorage.removeItem(h)}})()},[P]);let em=(0,c.useMemo)(()=>i?{async createSession(e,t){try{return await l(i,i.createSessionPath,e,t?{accessToken:t}:void 0)}catch(e){throw o.v.error({error:e,endpoint:i.endpoint},"Error creating data rights session."),e}},async createGuestSession(e){try{return await l(i,i.createGuestSessionPath,e)}catch(e){throw o.v.error({error:e,endpoint:i.endpoint},"Error creating guest data rights session."),e}},async sendEmailOpt(e){try{return await l(i,i.emailOptSendPath,e)}catch(e){throw o.v.error({error:e,endpoint:i.endpoint},"Error sending email OTP for data rights request."),e}},async resendEmailOpt(e){try{return await l(i,i.emailOptResendPath,e)}catch(e){throw o.v.error({error:e,endpoint:i.endpoint},"Error resending email OTP for data rights request."),e}},async verifyEmailOpt(e){try{return await l(i,i.emailOptVerifyPath,e)}catch(e){throw o.v.error({error:e,endpoint:i.endpoint},"Error verifying email OTP for data rights request."),e}},async updateIdentityStatus(e){try{return await l(i,i.statusIdentityPath,e)}catch(e){throw o.v.error({error:e,endpoint:i.endpoint},"Error updating identity status for data rights request."),e}},async generateToken(e){try{return await s(i,i.generateTokenPath,{sessionId:e.sessionId})}catch(e){throw o.v.error({error:e,endpoint:i.endpoint},"Error generating token for data rights request."),e}}}:void 0,[i]);(0,c.useEffect)(()=>
59{if("DSRFormView"!==eo.currentView||eo.memberData||!em)return;let e=!1;return(async()=>{var t;let i=eo.journeySelection;try{let r=$&&!eu?await (null==(t=U.current)?void 0:t.executeAsync()):void 0;if($&&!eu&&!r)throw Error("reCAPTCHA did not return a token");let n={onBehalfOf:"Yes"===i.behalfOfSelection},o=eu?await em.createSession(n,await W(!0)??void 0):await em.createGuestSession({...n,...r?{recaptcha:r}:{}});e||ea({type:"SET_MEMBER_DATA",payload:o})}catch(t){console.error("DataRights createSession error:",t),$&&!eu&&G(),e||ea({type:"SET_ERROR",payload:ee})}})(),()=>{e=!0}},[ee,em,eo.currentView,eo.journeySelection,eo.memberData,W,eu,G,$]);let ef=async(e,t)=>{try{let e=eo.journeySelection;if("No"===e.behalfOfSelection&&"Yes"===e.costcoAccountSelection){await (null==b?void 0:b(e,t)),sessionStorage.setItem(h,JSON.stringify(e)),await P()&&await z("/LogonForm"),await O("/u/-/RightsRequest");return}await (null==b?void 0:b(e,t)),ea({type:"NAVIGATE_TO_VIEW",payload:"Yes"===e.behalfOfSelection?"AcknowledgementView":"No"===e.costcoAccountSelection?"DSRFormView":"JourneySelectionView"})}finally{t.setSubmitting(!1)}};return"DSRFormView"===eo.currentView?C&&I?(0,r.jsxs)(E,{children:[(0,r.jsx)(el,{dsrFormText:K,findMembershipContent:I,formConfigData:C,journeySelection:eo.journeySelection,locale:C.locale,memberData:eo.memberData,isReviewMode:eo.isDsrReviewMode,reviewValues:eo.dsrDraftValues,showEmailVerified:eo.emailJustVerified,apiError:eo.error,onSubmit:e=>_({values:e,isReviewMode:eo.isDsrReviewMode,memberData:eo.memberData,sessionId:ed,dataRightsRequestClient:em,dispatch:ea,serviceNowRedirect:ei,serviceNowErrorText:et,onTokenGenerated:e=>{let t,i=((t=new URL(ei.url)).searchParams.set(ei.tokenQueryParameter,e),t.toString());window.location.assign(i)}}),submitButtonText:J}),$&&!eu&&(0,r.jsx)(u.n,{ref:U})]}):null:em&&"EmailVerificationView"===eo.currentView&&ec?C&&I?(0,r.jsx)(E,{children:(0,r.jsx)(eT,{dataRightsRequestClient:em,msText:X,onVerificationComplete:()=>{var e,t;ea({type:"EMAIL_VERIFICATION_COMPLETED",payload:eo.memberData?{...eo.memberData,emailVerified:!0,email:(null==(t=null==(e=eo.dsrDraftValues)?void 0:e.Email)?void 0:t.trim())||eo.memberData.email}:void 0})},recipient:ec,sessionId:ed})}):null:"IdentityVerificationView"===eo.currentView?C&&I?(0,r.jsx)(E,{children:(0,r.jsx)(tJ,{sessionId:ed,membershipNumber:(null==(V=null==(M=eo.dsrDraftValues)?void 0:M["Membership Number"])?void 0:V.trim())||(null==(N=null==(B=eo.memberData)?void 0:B.membershipNumber)?void 0:N.trim())||"",locale:C.locale,msText:Q,apiError:eo.error,onVerificationComplete:()=>{ea({type:"IDENTITY_VERIFICATION_COMPLETED",payload:eo.memberData?{...eo.memberData,identityVerified:!0}:void 0})},onVerificationFailed:e=>{ea({type:"SET_ERROR",payload:e})}})}):null:(0,r.jsx)(d.A,{initialValues:er,onSubmit:ef,validateOnBlur:w,validateOnChange:T,validate:e=>{let t={};return e.selectedState||(t.selectedState="State is required"),e.behalfOfSelection||(t.behalfOfSelection=p),"No"!==e.behalfOfSelection||e.costcoAccountSelection||(t.costcoAccountSelection=p),!t.selectedState&&Z.size&&e.selectedState&&!Z.has(e.selectedState)&&(t.selectedState=H),t},formProps:{id:n},scrollToErrorScope:n,children:e=>(0,r.jsxs)(E,{children:[(e=>{switch(eo.currentView){case"JourneySelectionView":return(0,r.jsx)(eh,{formikProps:e,formId:n,onValuesChange:v,updateValues:ea,stateOptions:en,text:q,continueButtonText:J});case"AcknowledgementView":return(0,r.jsx)(L,{msText:Y,continueButtonText:J,onContinue:()=>ea({type:"NAVIGATE_TO_VIEW",payload:"DSRFormView"})});default:return null}})(e),$&&!eu&&(0,r.jsx)(u.n,{ref:U})]})})}},42252:(e,t,i)=>{i.d(t,{ProgressiveFormUI:()=>c});var r=i(95155),n=i(12115),o=i(27966),a=i(10874),l=i(24880),s=i(40131);let c=({steps:e})=>{let t=(0,n.useRef)(null),i=(0,n.useRef)(null),c=(0,n.useRef)(null),d=(0,n.useRef)(!1),u=null==e?void 0:e.reduce((e,t)=>Math.min(e,t.step_number),1/0),[m,f]=(0,n.useState)(u!==1/0&&void 0!==u?u:0),p=null==e?void 0:e.find(e=>e.step_number===m);return((0,n.useEffect)(()=>{var e,r,n;if(!d.current){d.current=!0;return}p&&(p.label?null==(e=t.current)||e.focus():p.textBuilderElement?null==(r=i.current)||r.focus():p.genericFormElement&&(null==(n=c.current)||n.focus()))},[p,m]),(null==e?void 0:e.length)&&p)?(0,r.jsxs)(o.default,{component:"fieldset","data-testid":"ProgressiveForm",sx:{border:"none",margin:0,padding:0,textAlign:"left","& > *:not(:last-child)":{mb:l.Mzk}},children:[p.label&&(0,r.jsx)(o.default,{sx:{padding:0}
59,component:"legend",ref:t,tabIndex:-1,children:(0,r.jsx)(s.MarketingTypography,{variant:"body_v2",children:p.label})}),p.textBuilderElement&&(0,r.jsx)(o.default,{ref:i,tabIndex:-1,children:p.textBuilderElement}),p.genericFormElement&&(0,r.jsx)(o.default,{ref:c,tabIndex:-1,children:p.genericFormElement}),Array.isArray(p.step_options)&&p.step_options.length>0&&(0,r.jsx)(o.default,{sx:{display:"flex",gap:l.Mzk,flexWrap:"wrap"},children:p.step_options.map(e=>(0,r.jsx)(a.Button,{href:e.redirect_url,onClick:()=>{void 0!==e.next_step&&null!==e.next_step&&f(e.next_step)},children:e.label},e._metadata.uid))})]}):(console.error(`ProgressiveFormUI error: could not find step with number ${m}`),null)}},44154:(e,t,i)=>{i.d(t,{AccordionItemIcon:()=>u});var r=i(95155),n=i(68409),o=i(64835),a=i(64134),l=i(12115),s=i(27966),c=i(64290),d=i(6071);let u=({color:e,icon:t,adobeIcon:i,originalSvg:u})=>{let{adobeAssetsFeatureToggle:m}=(0,o.D)(),[f,p]=(0,l.useState)(null);(0,l.useEffect)(()=>{let t=(0,d.zy)(u,e);p(n.sanitize(t))},[e,u]);let h=(0,a.PC)((0,c.C0)(t,i,m));if(!h)return null;let x=(0,d.HC)(h,32,32);return(0,r.jsx)(s.default,{sx:{background:e,alignItems:"center",display:"flex",height:x.height,justifyContent:"center",width:x.width},dangerouslySetInnerHTML:{__html:f??""},"data-testid":"AccordionSet-AccordionItemIcon"})}},58839:(e,t,i)=>{i.d(t,{ErrorNotification:()=>l});var r=i(95155),n=i(27966),o=i(12158),a=i(42138);let l=({errorIssues:e,title:t})=>{let i=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Text,{children:t}),(0,r.jsx)(n.default,{component:"ul",children:e.map(e=>(0,r.jsx)("li",{children:e.message},`${e.type}-${e.stepNumber??"global"}-${e.message}`))})]});return(0,r.jsx)(a.Notification,{severity:"critical",message:i,isRole:!0})}},70067:(e,t,i)=>{i.d(t,{IntersectionLoader:()=>l});var r=i(95155),n=i(51563),o=i(12115),a=i(25719);let l=({children:e})=>{let t=(0,o.useRef)(),[i,l]=(0,o.useState)(!1);return((0,o.useEffect)(()=>{let e=(0,n.rX)(t=>{let i=t[0];i.isIntersecting&&(l(!0),e.unobserve(i.target))},{rootMargin:"600px"}),i=null==t?void 0:t.current;return i&&e.observe(i),()=>{e.disconnect()}},[t,l]),i)?e:(0,r.jsx)(a.CostcoBox,{component:"span",ref:t,sx:{minHeight:"200px"}})};l.displayName="IntersectionLoader"},82538:(e,t,i)=>{i.d(t,{AppointmentSchedulerUI:()=>en});var r=i(95155),n=i(12115),o=i(12158),a=i(24880),l=i(51838),s=i(13641),c=i(25719);let d=5,u="Select Location",m="warehouse",f=function(e){let t=e.key_value.map(e=>"title"===e.key?{...e,value:""}:"body"===e.key||"altbody"===e.key?{...e,value:"Step 2: Choose a Costco Business Center near you."}:e),i={...e,key_value:t},r=e.properties,n=Array.isArray(r)?r[0]:void 0;if(!n||!n.optionDetails||!n.optionDetails.businesscenteroption)return i;let o=r.slice(1);return{...i,properties:[{...n,optionDetails:{...n.optionDetails,businesscenteroption:{...n.optionDetails.businesscenteroption,selectByDefault:!0}}},...o]}}({locale:"en-us",composable_window:[{text_only:{body:"My Warehouse",_metadata:{uid:"cs30628159d51b85da"},development_field_key:"myWarehouse"}},{text_only:{body:"Set My Warehouse",_metadata:{uid:"cs3342b8603b90cd6c"},development_field_key:"setMyWarehouse"}},{text_only:{body:"Open until {closingTime}",_metadata:{uid:"cs03175ec6f5168313"},development_field_key:"openUntil"}},{text_only:{body:"Closed",_metadata:{uid:"cs91e1b539557afc01"},development_field_key:"closed"}},{text_only:{body:"Closed until {openingTime}",_metadata:{uid:"cs397b6956e46cd8aa"},development_field_key:"closedUntil"}},{text_only:{body:"Gold Star & Business hours start at {openingTime}",_metadata:{uid:"cs942b81ede51b7ff1"},development_field_key:"openForGoldAt"}},{text_only:{body:"Executive Member hours start at {openingTime}",_metadata:{uid:"cs4be07484864b9711"},development_field_key:"openForExecutiveAt"}},{text_only:{body:"Open for Executive Members",_metadata:{uid:"cs6b47462c782fb872"},development_field_key:"openForExecutive"}},{text_only:{body:"current warehouse",_metadata:{uid:"cs76b476d6013f72fa"},development_field_key:"warehouseAriaLabelSuffix"}},{text_only:{body:"Sorry, we can't set your warehouse right now. Please try again later.",_metadata:{uid:"cs69a89c99a8aa50a3"},development_field_key:"serviceErrorMessage"}},{text_only:{body:"Closed",_metadata:{uid:"csdaeef4190e45bcae"},development_field_key:"closedForHoliday"}},{text_only:{body:"Closed",_metadata:{uid:"csefaa4a869683f48f"},development_field_key:"closedForEmergency"}},{text_only:{body:"{executiveMember} hours start at {openingTime} daily",_metadata:{uid:"csefaa4a869683f48g"},development_field_key:"executivememberhourslabel"}}],development_key:"find_a_warehouse",key_value:[{key:"title",value:"Find a Warehouse"},{key:"body",value:"Select a warehouse to see items that are available near you."},{key:"altbody",value:"Find and select your local warehouse to see **hours and upcoming holiday closures.**"},{key:"showfilteroptions",value:"Show Filter Options"},{key:"searchfieldlabel",value:"City, State, or Zip"},{key:"drawerfindbuttonlabel",value:"Find"},{key:"hidefilteroptions",value:"Hide Filter Options"},{key:"gasstationoption",value:"Gas Station"},{key:"carwashoption",value:"Car Wash"},{key:"tirecenteroption",value:"Tire Center"},{key:"foodcourtoption",value:"Food Court"},{key:"hearingaidoption",value:"Hearing Aids"},{key:"opticaloption",value:"Optical"},{key:"pharmacyoption",value:"Pharmacy"},{key:"businesscenteroption",value:"Business Center"},{key:"searchfailurecontent",value:"We were unable to find a Costco warehouse near your location. Please try searching again."},{key:"showwarehousedetails",value:"Show Location Details"},{key:"hidewarehousedetails",value:"Hide Location Details"},{key:"services",value:"Services"},{key:"hours",value:"Hours"},{key:"getdirections",value:"Get Directions"},{key:"viewstorepage",value:"All Location Details"},{key:"setwarehousebuttonlabel",value:"Set as My Warehouse"},{key:"viewmorelocations",value:"View More Locations"},{key:"popupfilterlabel",value:"Show Warehouses with:"},{key:"popupfindbuttonlabel",value:"Find a Warehouse"},{key:"drawerarialabel",value:"Find a Warehouse"},{key:"listboxarialabel",value:"suggestions"},{key:"resultsannouncement",value:"Warehouse results updated"},{key:"closebuttonarialabel",value:"close"},{key:"autocompleteattr",value:"postal-code"},{key:"warehousefiltersfieldset",value:"Warehouse filters"},{key:"gasprices",value:"Gas Prices"},{key:"gasregular",value:"Regular"},{key:"gaspremium",value:"Premium"},{key:"gasdiesel",value:"Diesel"}
59,{key:"gaszeroethanol",value:"0% Ethanol"},{key:"warehousespagebaseurl",value:"/w/-"},{key:"openholidaylabel",value:"Open"},{key:"closedholidaylabel",value:"Closed"},{key:"businesshourslabel",value:"Gold Star & Business Member Hours"},{key:"executivememberlabel",value:"Executive Member"},{key:"searchtextemptyalert",value:"We couldn't find what you're looking for. Try entering a different city, state, or ZIP code."},{key:"businesscenterlabel",value:"Business Center"},{key:"warehousecomingsoon",value:"Warehouse Coming Soon!"},{key:"openingxxdays",value:"Opens in 29 days"},{key:"gasstationopen",value:"Gas Station Open"},{key:"gasstationopenuntil",value:"Gas Station Open until"},{key:"gasstationonly",value:"Gas Station Only"},{key:"gasstationcomingsoon",value:"Gas Station Coming Soon!"},{key:"gasstationonlyearlygas",value:"Gas Station Only"}],properties:[{baseOptions:["gasstationoption","carwashoption","tirecenteroption","foodcourtoption","hearingaidoption","opticaloption","pharmacyoption"],extendedOptions:["businesscenteroption"],optionDetails:{gasstationoption:{icon:"Gas",selectByDefault:!1,filterParams:{warehouseLocatorMobileApi:"gas",warehouseLocationsPage:"hasGas"}},carwashoption:{icon:"CarWash",selectByDefault:!1,filterParams:{warehouseLocatorMobileApi:"carwash",warehouseLocationsPage:"hasCarWash"}},tirecenteroption:{icon:"Tires",selectByDefault:!1,filterParams:{warehouseLocatorMobileApi:"auto",warehouseLocationsPage:"hasTires"}},foodcourtoption:{icon:"FoodCourt",selectByDefault:!1,filterParams:{warehouseLocatorMobileApi:"food",warehouseLocationsPage:"hasFood"}},hearingaidoption:{icon:"HearingAids",selectByDefault:!1,filterParams:{warehouseLocatorMobileApi:"hearing",warehouseLocationsPage:"hasHearing"}},opticaloption:{icon:"Optical",selectByDefault:!1,filterParams:{warehouseLocatorMobileApi:"optical",warehouseLocationsPage:"hasOptical"}},pharmacyoption:{icon:"Pharmacy",selectByDefault:!1,filterParams:{warehouseLocatorMobileApi:"pharmacy",warehouseLocationsPage:"hasPharmacy"}},businesscenteroption:{icon:"Truck",selectByDefault:!1,filterParams:{warehouseLocationsPage:"hasBusiness"}}},icons:{warehouseLocationIcon:"Location",myWarehouseIcon:"CheckmarkCircle",expandIcon:"ChevronDown",collapseIcon:"ChevronUp"},defaultLocation:{latitude:47.564661,longitude:-122.32941},warehousePageURL:"/warehouse-locations?fromWLocSubmit=true&numOfWarehouses=10",storeDirectionsURL:"https://maps.google.com/?saddr=Current+Location&daddr=",storePageURL:"/warehouse-locations/",hideScheduledHours:!1,enableModUrlPath:!0}],tags:[],title:"Find a Warehouse",url:"/livepreview/setting/_module_settings/blt1826ad37af51abf2",ACL:{},uid:"blt7cfef422e90b356e",created_by:"bltf58edbcd52eb8088",updated_by:"blt21e7d3728c5d70cc",created_at:"2025-03-08T05:15:23.427Z",updated_at:"2025-08-09T00:54:54.462Z",_version:14,_in_progress:!1,publish_details:[{environment:"blt5f3489218fed07a6",locale:"en-ca",time:"2025-08-09T00:55:32.412Z",user:"blt21e7d3728c5d70cc",version:13,entry_locale:"en-ca"},{environment:"blte7b1558ba1dfc8e0",locale:"en-ca",time:"2025-08-09T00:55:16.334Z",user:"blt2fc33184587e487d",version:13,entry_locale:"en-ca"},{environment:"bltea015badac102fc4",locale:"en-ca",time:"2025-08-09T00:55:32.412Z",user:"blt21e7d3728c5d70cc",version:13,entry_locale:"en-ca"},{environment:"bltf89a500973b14110",locale:"en-ca",time:"2025-08-09T00:55:32.412Z",user:"blt21e7d3728c5d70cc",version:13,entry_locale:"en-ca"},{environment:"blt6080c70791fc632b",locale:"en-ca",time:"2025-08-09T00:55:32.412Z",user:"blt21e7d3728c5d70cc",version:13,entry_locale:"en-ca"},{environment:"blt60c536a5d01302e7",locale:"en-ca",time:"2025-08-09T00:55:32.412Z",user:"blt21e7d3728c5d70cc",version:13,entry_locale:"en-ca"},{environment:"blt5f3489218fed07a6",locale:"en-us",time:"2025-08-09T00:55:31.911Z",user:"blt21e7d3728c5d70cc",version:14},{environment:"blte7b1558ba1dfc8e0",locale:"en-us",time:"2025-08-09T00:54:57.204Z",user:"blt2fc33184587e487d",version:14},{environment:"bltf89a500973b14110",locale:"en-us",time:"2025-08-09T00:55:31.911Z",user:"blt21e7d3728c5d70cc",version:14},{environment:"bltea015badac102fc4",locale:"en-us",time:"2025-08-09T00:55:31.911Z",user:"blt21e7d3728c5d70cc",version:14},{environment:"blt6080c70791fc632b",locale:"en-us",time:"2025-08-09T00:55:31.911Z",user:"blt21e7d3728c5d70cc",version:14},{environment:"blt60c536a5d01302e7",locale:"en-us",time:"2025-08-09T00:55:31.911Z",user:"blt21e7d3728c5d70cc",version:14},{environment:"blte7b1558ba1dfc8e0",locale:"fr-ca",time:"2025-08-06T21:30:12.073Z",user:"blt2fc33184587e487d",version:5,entry_locale:"fr-ca"},{environment:"blt5f3489218fed07a6",locale:"fr-ca",time:"2025-08-09T00:55:32.309Z",user:"blt21e7d3728c5d70cc",version:5,entry_locale:"fr-ca"},{environment:"bltea015badac102fc4",locale:"fr-ca",time:"2025-08-09T00:55:32.309Z",user:"blt21e7d3728c5d70cc",version:5,entry_locale:"fr-ca"},{environment:"bltf89a500973b14110",locale:"fr-ca",time:"2025-08-09T00:55:32.309Z",user:"blt21e7d3728c5d70cc",version:5,entry_locale:"fr-ca"},{environment:"blt6080c70791fc632b",locale:"fr-ca",time:"2025-08-09T00:55:32.309Z",user:"blt21e7d3728c5d70cc",version:5,entry_locale:"fr-ca"},{environment:"blt60c536a5d01302e7",locale:"fr-ca",time:"2025-08-09T00:55:32.309Z",user:"blt21e7d3728c5d70cc",version:5,entry_locale:"fr-ca"}]}),p={currentView:"ButtonView",customerInfo:{},warehouseSelection:{},reviewData:{},confirmation:{},isSubmitting:!1,error:void 0};function h(e,t){switch(t.type){case"UPDATE_DATA":return{...e,[t.payload.view]:{...e[t.payload.view],...t.payload.data},error:void 0};case"NAVIGATE_TO_VIEW":return{...e,currentView:t.payload,error:void 0};case"RESET_STATE":return{...p};case"SET_SUBMITTING":return{...e,isSubmitting:t.payload,error:void 0};case"SET_ERROR":return{...e,error:t.payload};default:return console.warn("Unknown action dispatched to appointmentSchedulerReducer: ",t),e}}var x=i(27966),v=i(86670);let y=(0,v.default)(c.CostcoBox,{shouldForwardProp:e=>"applyBorderStyle"!==e})(({applyBorderStyle:e})=>({display:"flex",borderRadius:"5px",flexDirection:"column",...e&&{padding:a.Mzk,border:`${a.iAn} solid ${a.iCb}`,borderRadius:10}})),g=(0,v.default)(x.default)({width:"100%",maxWidth:"800px"});var b=i(10874);let w=(0,v.default)(o.Text)({color:a.DJJ}),_=(0,v.default)(c.CostcoBox)({display:"flex",flexDirection:"column",alignItems:"center",gap:a.Mzk,padding:a.pMV,textAlign:"center",backgroundColor:a.iCb,justifyContent:"center",width:"100%",borderRadius:"10px"}),k=(0,v.default)(c.CostcoBox)({justifyContent:"center",padding:"28px 18px 100px 18px",width:"100%"}),S=(0,v.default)(b.Button)({":focus, :hover":{backgroundColor:a.DJJ,textDecoration:"none"},backgroundColor:a.DJJ,color:a.iCb,width:"100%"});
59function T({onStartScheduling:e,title:t,description:i,buttonText:n}){return(0,r.jsxs)(_,{"data-testid":"appointment-scheduler-button-view",children:[(0,r.jsxs)(k,{"data-testid":"appointment-scheduler-button-view-box",children:[(0,r.jsx)(w,{component:"span",variant:"t1",bold:!0,children:t}),(0,r.jsx)(w,{variant:"b1",component:"p",children:i})]}),(0,r.jsx)(S,{onClick:e,variant:"primary",children:n})]})}T.displayName="AppointmentSchedulerButtonView";var C=i(12397);let I=(0,v.default)(x.default)({'& .MuiButtonBase-root[type="submit"]':{alignSelf:"stretch"},width:"100%",borderRadius:10});function E({onFormSubmit:e,formReference:t,locale:i,formConfigData:n,msText:o,savedValues:a,onMount:l,hideTitle:s}){return n?(0,r.jsx)(I,{ref:l,tabIndex:-1,children:(0,r.jsx)(C.GenericFormUI,{...n,hideTitle:s,initialValues:a,isFullWidth:!0,locale:i,onSubmit:e,recaptchaEnabled:!1,submitButtonText:(null==o?void 0:o.buttonViewButtonText)||"Schedule Tour"})}):(console.error("GenericFormView: No FormConfigData provided. Form data must be pre-fetched by AppointmentScheduler."),null)}E.displayName="AppointmentSchedulerGenericFormView";var j=i(46887),D=i(3187),A=i(97766),R=i(71013);let M="SuccessView",V=({email:e,locale:t="en-us",msText:i,onNavigate:l,onMount:s})=>{let c=(null==i?void 0:i.successViewTitle)??"",d=(null==i?void 0:i.successViewConfirmationMessage)??"",u=(null==i?void 0:i.successViewSpecialPromotionTitle)??"",m=(null==i?void 0:i.successViewSpecialPromotionDescription)??"",f=(null==i?void 0:i.successViewSpecialPromotionDisclaimer)??"",p=(null==i?void 0:i.successViewCheckInMessage)??"",h=(null==i?void 0:i.successViewLookForwardMessage)??"",v=(null==i?void 0:i.successViewBusinessCenterButtonLabel)??"",y=(null==i?void 0:i.successViewBusinessCenterUrl)??"",g=(0,n.useMemo)(()=>{let t=[{select_text_type:"body_copy_v2",text_alignment:"left",markdown_text:d.replace("{email}",`**${e}**`),color:{background_gradient_style:"no-background",background_color:{hex:a.DJJ},background_gradient_color:{color1:{hex:a.DJJ},color2:{hex:a.DJJ}},text_color:{hex:a.d1D}},_metadata:{uid:"top-confirmation"}}];return{title:c,text_section_config:{text_section_alignment:"left",text_section_type:"full",see_more_see_less_capability:!1,color_config:{},number_of_visible_lines:0},external_link:{title:"",href:""},_metadata:{uid:"top"},text_section_icon:{icon_image:{}},text_section_content:[],multiple_text_section_group:[{color_config:{background_gradient_style:"no-background",background_color:{hex:a.DJJ},background_gradient_color:{color1:{hex:a.DJJ},color2:{hex:a.DJJ}},text_color:{hex:a.d1D}},_metadata:{uid:"top-group"},text_section_content:t}]}},[d,e,c]),w=(0,n.useMemo)(()=>{let e=[{select_text_type:"heading_v2",text_alignment:"left",markdown_text:u,select_semantics_type:"h2",color:{background_gradient_style:"no-background",background_color:{hex:a.DJJ},background_gradient_color:{color1:{hex:a.DJJ},color2:{hex:a.DJJ}},text_color:{hex:a.d1D}},_metadata:{uid:"promo-title"}},{select_text_type:"body_copy_v2",text_alignment:"left",markdown_text:m,color:{background_gradient_style:"no-background",background_color:{hex:a.DJJ},background_gradient_color:{color1:{hex:a.DJJ},color2:{hex:a.DJJ}},text_color:{hex:a.d1D}},_metadata:{uid:"promo-description"}}];return f&&e.push({select_text_type:"caption_v2",text_alignment:"left",markdown_text:f,color:{background_gradient_style:"no-background",background_color:{hex:a.DJJ},background_gradient_color:{color1:{hex:a.DJJ},color2:{hex:a.DJJ}},text_color:{hex:a.d1D}},_metadata:{uid:"promo-disclaimer"}}),{title:"Special Promotion",text_section_config:{text_section_alignment:"left",text_section_type:"full",see_more_see_less_capability:!1,color_config:{},number_of_visible_lines:0},external_link:{title:"",href:""},_metadata:{uid:"promo"},text_section_icon:{icon_image:{}},text_section_content:[],multiple_text_section_group:[{color_config:{background_gradient_style:"no-background",background_color:{hex:a.DJJ},background_gradient_color:{color1:{hex:a.DJJ},color2:{hex:a.DJJ}},text_color:{hex:a.d1D}},_metadata:{uid:"promo-group"},text_section_content:e}]}},[u,m,f]),_=(0,n.useMemo)(()=>{let e=[{select_text_type:"body_copy_v2",text_alignment:"left",markdown_text:p,color:{background_gradient_style:"no-background",background_color:{hex:a.DJJ},background_gradient_color:{color1:{hex:a.DJJ},color2:{hex:a.DJJ}},text_color:{hex:a.d1D}},_metadata:{uid:"checkin-message"}},{select_text_type:"body_copy_v2",text_alignment:"left",markdown_text:h,color:{background_gradient_style:"no-background",background_color:{hex:a.DJJ},background_gradient_color:{color1:{hex:a.DJJ},color2:{hex:a.DJJ}},text_color:{hex:a.d1D}},_metadata:{uid:"forward-message"}}];return{title:"Confirmation Details",text_section_config:{text_section_alignment:"left",text_section_type:"full",see_more_see_less_capability:!1,color_config:{},number_of_visible_lines:0},external_link:{title:"",href:""},_metadata:{uid:"bottom"},text_section_icon:{icon_image:{}},text_section_content:[],multiple_text_section_group:[{color_config:{background_gradient_style:"no-background",background_color:{hex:a.DJJ},background_gradient_color:{color1:{hex:a.DJJ},color2:{hex:a.DJJ}},text_color:{hex:a.d1D}},_metadata:{uid:"bottom-group"},text_section_content:e}]}},[p,h]);return(0,r.jsxs)(j.default,{spacing:a.Mzk,sx:{padding:a.i_v,maxWidth:"800px",margin:"0 auto"},"data-testid":M,children:[(0,r.jsxs)(x.default,{sx:{display:"flex",alignItems:"center",gap:a.Mzk,marginBottom:a.Mzk},children:[(0,r.jsx)(x.default,{component:A.M,sx:{color:a.JBU,width:"32px",height:"32px"},"aria-hidden":"true"}),(0,r.jsx)(o.Text,{component:"h2",variant:"t2-v2",sx:{color:a.JBU}
59,ref:s,tabIndex:-1,children:c})]}),(0,r.jsx)(x.default,{sx:{marginBottom:a.Mzk},children:(0,r.jsx)(R.TextBuilderUI,{data:g,locale:t,hasUCCEnhancement:!0})}),u&&(0,r.jsx)(x.default,{sx:{marginTop:a.i_v,marginBottom:a.i_v,padding:a.Mzk,border:"1px solid #e0e0e0",borderRadius:"4px"},children:(0,r.jsx)(R.TextBuilderUI,{data:w,locale:t,hasUCCEnhancement:!0})}),(0,r.jsx)(x.default,{sx:{marginTop:a.Mzk},children:(0,r.jsx)(R.TextBuilderUI,{data:_,locale:t,hasUCCEnhancement:!0})}),y&&v&&(0,r.jsx)(x.default,{sx:{marginTop:a.pMV,display:"flex",justifyContent:"center"},children:(0,r.jsx)(b.Button,{variant:"primary",onClick:l,component:D.Link,href:y,children:v})})]})};V.displayName=M;var B=i(79402),L=i(16002),N=i(42138),O=i(98872),z=i(65040),P=i(72055),W=i(70546);let F=(0,n.forwardRef)(({errorIconAriaLabel:e,errorMessage:t},i)=>{let l=(0,n.useRef)(null),s=()=>{l.current&&l.current.focus()};return((0,n.useImperativeHandle)(i,()=>({focus:()=>{s()}}),[]),(0,n.useEffect)(()=>{t&&s()},[t]),t)?(0,r.jsx)(N.Notification,{iconAccessibilityText:e,message:(0,r.jsx)(o.Text,{children:t}),ref:l,severity:"critical",sx:{marginBottom:a.Mzk}}):null});F.displayName="ErrorNotification";let $=(0,v.default)(x.default)({display:"flex",flexDirection:"column",gap:a.Mzk,width:"100%"}),U=(0,v.default)(x.default)({display:"flex",flexDirection:"column"}),G=(0,v.default)(x.default)({display:"flex",flexDirection:"column"}),q=(0,v.default)(b.Button)({textDecoration:"underline",alignSelf:"flex-start"}),J=(0,v.default)(b.Button)({width:"100%"});var H=i(33423);function Z({customerInfo:e,warehouse:t,formConfigData:i,onChangeInformation:a,onChangeLocation:c,onSubmitSuccess:d,locale:u,msText:m,onMount:f}){let{trackEvent:p}=(0,H.z)(),{isRecaptchaEnabled:h}=(0,P.N)(),v=h&&(null==i?void 0:i.recaptchaEnabled),y=(0,n.useRef)(null),[g,b]=(0,n.useState)(""),[w,_]=(0,n.use
59State)(""),[k,S]=(0,n.useState)(!1),T=(0,n.useRef)(null),C=(0,n.useCallback)(()=>{var e;null==(e=y.current)||e.reset()},[]),I=(0,n.useCallback)(()=>{var e;b((null==i?void 0:i.moduleSettingsData.recaptchaErrorText)||""),null==(e=T.current)||e.focus()},[null==i?void 0:i.moduleSettingsData.recaptchaErrorText]),E=(0,n.useCallback)(e=>e instanceof W.n&&(e.code===W.v.widgetExpired||e.code===W.v.widgetNotReady||e.code===W.v.executionTimedOut)?(null==i?void 0:i.moduleSettingsData.recaptchaErrorText)??"":(null==i?void 0:i.moduleSettingsData.errorBoundaryMessage)??"",[null==i?void 0:i.moduleSettingsData.errorBoundaryMessage,null==i?void 0:i.moduleSettingsData.recaptchaErrorText]),j=(0,n.useCallback)(e=>{var t;console.error("Recaptcha error:",e),b(E(e)),null==(t=T.current)||t.focus()},[E]),D=t?(0,L.vr)(t):"",A=(0,B.B)({businessCenterLabel:null==m?void 0:m.businessCenterLabel,name:D})||"",R=(null==t?void 0:t.address.line1)||"",M=(0,L.Zr)((null==t?void 0:t.address.city)||""),V=(null==t?void 0:t.address.territory)||"",Y=(null==t?void 0:t.address.postalCode)||"",K=(null==t?void 0:t.phone)||"",X=(0,n.useCallback)(async()=>{var r,n,o,a,c;let m;if(!i)return;if(b(""),_(""),S(!0),v){try{m=await (null==(r=y.current)?void 0:r.executeAsync())}catch(e){console.error("Recaptcha execution error:",e),C(),b(E(e)),null==(n=T.current)||n.focus(),S(!1);return}if(!m){C(),b(i.moduleSettingsData.recaptchaErrorText),null==(o=T.current)||o.focus(),S(!1);return}}let{endpoint:f,timeout:h}=i.serviceConfiguration;try{let r=await (0,s.BR)({endpoint:f,timeout:h,headers:i.serviceConfiguration.required_request_headers},{entryId:i.entryId,locale:u,values:{...e,...(null==t?void 0:t.warehouseId)?{warehouseId:t.warehouseId,"Warehouse Name":A,"Warehouse Address":R,"Warehouse City":M,"Warehouse State":V,"Warehouse Postal Code":Y,"Warehouse Phone":K}:{}},recaptchaToken:v?m:void 0});if(!r.ok){let e=await r.json().catch(()=>({}));console.error("Appointment submission error:",e),v&&C(),_(i.moduleSettingsData.submitFailureText),null==(a=T.current)||a.focus();return}p({trackType:l.Re,trackedData:{ui:"Appointment Scheduler | Schedule a Warehouse Tour | Submit Request"}}),v&&C(),d()}catch(e){console.error("Appointment submission exception:",e),v&&C(),_(i.moduleSettingsData.submitFailureText),null==(c=T.current)||c.focus()}finally{S(!1)}},[i,v,u,e,t,A,R,M,V,Y,K,p,d,C,E]);return i?(0,r.jsxs)($,{"data-testid":"summary-view",children:[(0,r.jsx)(F,{ref:T,errorIconAriaLabel:i.moduleSettingsData.errorIconAriaLabel,errorMessage:g||w}),(0,r.jsxs)(U,{children:[(0,r.jsx)(o.Text,{ref:f,tabIndex:-1,children:null==m?void 0:m.summaryViewTitle}),(0,r.jsx)(q,{variant:"text-button",onClick:a,"data-testid":"summary-view-change-information",children:null==m?void 0:m.editTourInformation}),(0,r.jsx)(q,{variant:"text-button",onClick:c,"data-testid":"summary-view-change-location",sx:{padding:0},children:null==m?void 0:m.editWarehouse})]}),(0,r.jsx)(O.FormSummarySection,{fields:i.fields,values:e,locale:u}),t&&(0,r.jsxs)(G,{"data-testid":"summary-view-warehouse-section",children:[(0,r.jsx)(o.Text,{variant:"b2",bold:!0,children:null==m?void 0:m.businessCenterLocation}),(0,r.jsxs)(x.default,{sx:{marginTop:0},children:[(0,r.jsx)(o.Text,{variant:"b1",sx:{margin:0},children:A}),(0,r.jsx)(o.Text,{variant:"b1",sx:{margin:0},children:R}),(0,r.jsx)(o.Text,{variant:"b1",sx:{margin:0},children:`${M}, ${V} ${Y}`}),K&&(0,r.jsx)(o.Text,{variant:"b1",sx:{margin:0},children:K})]})]}),(0,r.jsx)(N.Notification,{severity:"alert",message:null==m?void 0:m.checkInMessage,"data-testid":"summary-view-checkin-notification"}),v&&(0,r.jsx)(z.n,{ref:y,onError:j,onExpire:I}),(0,r.jsx)(J,{variant:"primary",onClick:X,isLoading:k,"data-testid":"summary-view-submit",children:null==m?void 0:m.summaryViewButtonText})]}):null}Z.displayName="AppointmentSchedulerSummaryView";var Y=i(48463),K=i(18199),X=i(92262);let Q=({warehouse:e,onClick:t,isSelected:i=!1,businessCenterLabel:n})=>{var o,a;let l=i?"Location Selected":u,s=(null==(a=null==(o=e.name)?void 0:o[0])?void 0:a.value)||m,c=(0,B.B)({businessCenterLabel:n,name:s})||m;return(0,r.jsx)(b.Button,{variant:i?"primary":"secondary",onClick:e=>{e.stopPropagation(),t()},fullWidth:!0,uniqueId:`bd-select-location-${e.warehouseId}`,"aria-label":`${l} ${c}`,children:l})};Q.displayName="BDSelectLocationButton";let ee=(0,v.default)("div")({'& [data-testid="warehousedrawer-warehousefilter"]':{display:"none","& + *":{marginTop:a.Mzk}},'& button[data-testid="Button_warehouse-list-view-more"]':{display:"none"}}),et=({locale:e,moduleSettings:t,heightOverride:i,initialBatchSize:o=d,zipCodeOverride:a,setWarehouses:l,onWarehouseSelected:s,onMount:c,persistedSearchText:m,onLocationSearchSubmitted:f})=>{var p,h;
59let[x,v]=(0,n.useState)(null),y=null==(h=null==(p=null==t?void 0:t.key_value)?void 0:p.find(e=>"businesscenterlabel"===e.key))?void 0:h.value,g=(0,n.useCallback)(e=>{v(e.warehouseId),null==s||s(e)},[s]),b=(0,n.useCallback)((e,t)=>(0,r.jsx)(Q,{warehouse:e,onClick:t,isSelected:e.warehouseId===x,businessCenterLabel:y}),[x,y]);return(0,r.jsx)(Y.WarehousesProvider,{children:(0,r.jsx)(ee,{ref:c,tabIndex:-1,children:(0,r.jsx)(K.WarehouseList,{listType:X.J4,locale:e,moduleSettings:t,isInline:!0,syncWithUrl:!1,defaultFiltersVisible:!1,invokeSalesLocationsAPI:!0,enableInfiniteList:!0,infiniteListBatchSize:o,heightOverride:i,zipCodeOverride:a,persistedSearchText:m,onLocationSearchSubmitted:f,setWarehouses:l,renderActionButton:b,onWarehouseSelected:g,customActionAnalyticsLabel:u})})})};function ei({onWarehouseSelected:e,locale:t,moduleSettings:i,zipCodeOverride:n,heightOverride:o,initialBatchSize:a,onMount:l,persistedSearchText:s,onLocationSearchSubmitted:c}){return(0,r.jsx)(et,{locale:t,moduleSettings:i,zipCodeOverride:n,heightOverride:o,initialBatchSize:a,onWarehouseSelected:e,onMount:l,persistedSearchText:s,onLocationSearchSubmitted:c})}let er=["ButtonView","GenericFormView","WarehouseSelectorView","SummaryView","SuccessView"];function en({initialView:e,formReference:t,locale:i,email:d,warehouseModuleSettings:u,msText:m,formConfigData:x}){var v;let{trackEvent:b}=(0,H.z)(),w=u??f,_=(0,n.useRef)(!1),[k,S]=(0,n.useReducer)(h,e?{...p,currentView:e}:p),C=(0,n.useRef)(null),I=(0,n.useRef)(null),j=(0,n.useRef)(null),D=(0,n.useRef)(null),A=(0,n.useRef)(!1);(0,n.useEffect)(()=>{var e,t,i,r;if(!A.current){A.current=!0;return}"GenericFormView"===k.currentView&&(null==(e=C.current)||e.focus()),"WarehouseSelectorView"===k.currentView&&(null==(t=I.current)||t.focus()),"SummaryView"===k.currentView&&(null==(i=j.current)||i.focus()),"SuccessView"===k.currentView&&(null==(r=D.current)||r.focus())},[k.currentView]),(0,n.useEffect)(()=>{"SuccessView"!==k.currentView||_.current&&(_.current=!1,b({trackType:l.Re,trackedData:{uimsg:"Appointment Scheduler | Schedule a Warehouse Tour | Request Submit Success"}}))},[k.currentView,b]);let R=(0,n.useCallback)(e=>{if("start"===e)return void S({type:"RESET_STATE"});let t=er.indexOf(k.currentView);if("next"===e){if(-1===t||t===er.length-1)return;S({type:"NAVIGATE_TO_VIEW",payload:er[t+1]})}else{if(t<=0)return;S({type:"NAVIGATE_TO_VIEW",payload:er[t-1]})}},[k.currentView]),M=(0,n.useCallback)(e=>{S({type:"UPDATE_DATA",payload:{view:"warehouseSelection",data:{warehouse:e}}}),S({type:"NAVIGATE_TO_VIEW",payload:"SummaryView"})},[]),B=(0,n.useCallback)(e=>{S({type:"UPDATE_DATA",payload:{view:"warehouseSelection",data:{locationSearchText:e}}})},[]),L=null==(v=null==m?void 0:m.buttonViewTitle)?void 0:v.trim();return(0,r.jsxs)(y,{applyBorderStyle:"ButtonView"!==k.currentView,children:["SuccessView"!==k.currentView&&"ButtonView"!==k.currentView&&L&&(0,r.jsx)(o.Text,{component:"h2",variant:"t2-v2",sx:{paddingLeft:0,paddingBottom:a.D3H,textAlign:"left"},children:L}),(()=>{switch(k.currentView){case"ButtonView":return(0,r.jsx)(c.CostcoBox,{"data-testid":"appointment-scheduler-button-view",children:(0,r.jsx)(T,{onStartScheduling:()=>{b({trackType:l.Re,trackedData:{ui:"Appointment Scheduler | Schedule a Warehouse Tour | Start"}}),R("next")},title:(null==m?void 0:m.buttonViewTitle)||"",description:(null==m?void 0:m.buttonViewDescription)||"",buttonText:(null==m?void 0:m.buttonViewButtonText)||""})});case"GenericFormView":return(0,r.jsx)(c.CostcoBox,{"data-testid":"appointment-scheduler-form-view",sx:{width:"100%"},children:(0,r.jsx)(E,{onFormSubmit:e=>{S({type:"UPDATE_DATA",payload:{view:"customerInfo",data:e}}),S({type:"NAVIGATE_TO_VIEW",payload:"WarehouseSelectorView"})},formReference:t,locale:i,formConfigData:x,msText:m,savedValues:k.customerInfo,onMount:e=>{C.current=e},hideTitle:!0})});case"WarehouseSelectorView":{let e=(0,s.eg)(k.customerInfo);return(0,r.jsx)(c.CostcoBox,{"data-testid":"appointment-scheduler-warehouse-view",sx:{width:"100%"},children:(0,r.jsx)(g,{children:(0,r.jsx)(ei,{onWarehouseSelected:M,locale:i,moduleSettings:w,zipCodeOverride:e,persistedSearchText:"string"==typeof k.warehouseSelection.locationSearchText?k.warehouseSelection.locationSearchText:void 0,onLocationSearchSubmitted:B,onMount:e=>{I.current=e}})})})}
59case"SummaryView":return(0,r.jsx)(c.CostcoBox,{"data-testid":"appointment-scheduler-summary-view",sx:{width:"100%",textAlign:"left"},children:(0,r.jsx)(g,{children:(0,r.jsx)(Z,{customerInfo:k.customerInfo,warehouse:k.warehouseSelection.warehouse??null,onChangeInformation:()=>S({type:"NAVIGATE_TO_VIEW",payload:"GenericFormView"}),onChangeLocation:()=>S({type:"NAVIGATE_TO_VIEW",payload:"WarehouseSelectorView"}),onSubmitSuccess:()=>{_.current=!0,S({type:"NAVIGATE_TO_VIEW",payload:"SuccessView"})},formConfigData:x,locale:i,msText:m,onMount:e=>{j.current=e}})})});case"SuccessView":var e;let n;return(0,r.jsx)(c.CostcoBox,{"data-testid":"appointment-scheduler-success-view",children:(0,r.jsx)(V,{email:(e=k.customerInfo,"string"==typeof(n=e.email??e.Email)&&n.trim()?n.trim():(null==d?void 0:d.trim())?d.trim():"[email protected]"),locale:i,msText:m,onNavigate:()=>R("start"),onMount:e=>{D.current=e}})});default:return null}})()]})}},98872:(e,t,i)=>{i.r(t),i.d(t,{FormSummarySection:()=>m});var r=i(95155),n=i(12158),o=i(27966),a=i(86670),l=i(24880);let s=(0,a.default)(o.default)({display:"flex",flexDirection:"column",gap:l.Mzk}),c=(0,a.default)(o.default)({display:"flex",flexDirection:"column"});function d({label:e,value:t,extraContent:i}){return t?(0,r.jsxs)(c,{children:[(0,r.jsx)(n.Text,{variant:"b2",bold:!0,children:e}),(0,r.jsx)(n.Text,{variant:"b1",children:t}),i]}):null}function u(e){return Object.values(e)[0]}function m({fields:e,values:t,locale:i,fieldAnnotations:n}){return(0,r.jsx)(s,{children:e.map((e,o)=>{var a,l;let s;if("hidden_input"in e)return null;let c=u(e).field_id;if(!c)return null;let m="string"==typeof(a=t[c])?a:"";return("date_picker"in e&&m&&(l=m,m=isNaN((s=new Date(`${l}T00:00:00Z`)).getTime())?l:new Intl.DateTimeFormat(i,{weekday:"long",year:"numeric",month:"long",day:"numeric",timeZone:"UTC"}).format(s)),m)?(0,r.jsx)(d,{label:u(e).label??"",value:m,extraContent:null==n?void 0:n[c]},`${c}-${o}`):null})})}d.displayName="SummaryField",m.displayName="FormSummarySection"}}]);
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.