"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[26],{181:(e,s,r)=>{var a=r(0);const{wrapper:t}={wrapper:"Drsy4rsa"},n=({title:e})=>(0,a.jsx)("h1",Object.assign({className:t},{children:e})),{wrapper:i,wrapperRequired:l}={wrapper:"iV1Noxaa",wrapperRequired:"YXv7sfTi"},d=({label:e,htmlFor:s,required:r})=>(0,a.jsxs)("label",Object.assign({htmlFor:s,className:i},{children:[e,r&&(0,a.jsx)("span",Object.assign({className:l},{children:"*"}))]}));var o=r(2),c=r(4),p=r(247),u=r(1);const{wrapper:m}={wrapper:"pEIR0jlq"},h=({errorMessage:e})=>e?(0,a.jsx)("div",Object.assign({className:m},{children:e})):(0,a.jsx)(u.Fragment,{}),{wrapper:w,wrapperBox:j,wrapperBoxError:g,wrapperBoxIcon:b,wrapperBoxIconActive:x,wrapperBoxText:v,wrapperBoxOptions:f,wrapperBoxOptionsItem:N,wrapperBoxOptionsItemActive:O}={wrapper:"OhamljMJ",wrapperBox:"NBjBaQXh",wrapperBoxError:"nK6YAZsD",wrapperBoxIcon:"wRlo2HDt",wrapperBoxIconActive:"osofYxbc",wrapperBoxText:"f1ZaTlhM",wrapperBoxOptions:"YjXWbNOP",wrapperBoxOptionsItem:"DzPjdbeW",wrapperBoxOptionsItemActive:"nutQ5zMK"},A=({options:e,label:s,name:r,required:t,value:n,errorMessage:i,handleChange:l})=>{const[u,m]=(0,o.useState)(n),[A,y]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{const s="United States";if(""===n&&"country"===r&&(m(s),l({target:{name:r,value:s}})),"province"===r){if(0===e.length)return m(""),void l({target:{name:r,value:""}});const s=e[0];s&&(m(s),l({target:{name:r,value:s}}))}}),[u,e.length,r]),0===e.length?null:(0,a.jsxs)("div",Object.assign({className:w,onClick:()=>y((e=>!e))},{children:[(0,a.jsx)(d,{label:s,htmlFor:r,required:t}),(0,a.jsxs)("div",Object.assign({className:(0,p.a)(j,i&&g)},{children:[(0,a.jsx)("span",Object.assign({className:v},{children:u})),(0,a.jsx)("div",Object.assign({className:(0,p.a)(A?x:b)},{children:(0,a.jsx)(c.b,{})})),A&&(0,a.jsx)("div",Object.assign({className:f},{children:e.map((e=>(0,a.jsx)("div",Object.assign({className:(0,p.a)(N,e===u&&O),onClick:()=>(e=>{m(e),l({target:{name:r,value:e}})})(e)},{children:e}),e)))}))]})),(0,a.jsx)(h,{errorMessage:null!=i?i:""})]}))},{wrapper:y,wrapperInput:T,wrapperInputError:S,wrapperCheckbox:D,wrapperCheckboxInput:P,wrapperInputNotFullWidth:k}={wrapper:"ZKlYz7cX",wrapperInput:"CLu0uDOi",wrapperSelect:"LKAET2Fr",wrapperInputError:"p0sjtEVp",wrapperCheckbox:"kzx3koW5",wrapperInputNotFullWidth:"rNsV_87F"},L=e=>{const{label:s,type:r,required:t,placeholder:n,name:i,id:l,handleChange:o,notFullWidth:c,isDefaultAddress:u,autocomplete:m}=e,w="select"===r&&"options"in e,j="text"===r||"email"===r||"password"===r,g="checkbox"===r,b=c,x=e.formErrors[i],v=e.formState[i],f="true"===v,N="password"===r;return(0,a.jsxs)("div",Object.assign({className:(0,p.a)(y,b&&k)},{children:[w&&(0,a.jsx)(A,{options:"province"===i?e.provinces||[]:e.options,label:s,name:i,required:t,handleChange:o,value:null!=v?v:"",errorMessage:null!=x?x:""}),j&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d,{label:s,htmlFor:l,required:t}),(0,a.jsx)("input",{className:(0,p.a)(T,x&&S),name:i,id:l,type:r,placeholder:n,onChange:o,value:v,required:!1,autocomplete:N?m:""}),(0,a.jsx)(h,{errorMessage:null!=x?x:""})]}),g&&!u&&(0,a.jsxs)("div",Object.assign({className:D},{children:[(0,a.jsx)("input",{className:P,name:i,id:l,type:r,placeholder:n,onChange:o,checked:f,required:!1}),(0,a.jsx)(d,{label:s,htmlFor:l,required:t}),(0,a.jsx)(h,{errorMessage:null!=x?x:""})]}))]}))},{wrapper:I,wrapperCTA:F,wrapperPasswordText:C,disabled:E,wrapperToRight:M}={wrapper:"r5Ng0cd9",wrapperCTA:"_RicBryL",wrapperPasswordText:"IIlrPjPL",disabled:"mkNHU2Jy",wrapperToRight:"DanF2mML"},R=({label:e,handlePassword:s,forgotPasswordText:r,disabled:t=!1,alginToRight:n})=>(0,a.jsxs)("div",Object.assign({className:(0,p.a)(I,n&&M)},{children:[r&&(0,a.jsx)("p",Object.assign({onClick:s,className:C},{children:r})),(0,a.jsx)("button",Object.assign({className:(0,p.a)(F,t||""),type:"submit",disabled:t},{children:e}))]}));var B=r(14),U=r(3);const H={email:e=>/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(e)},W=e=>{const s=e&&e.length>0;return s||console.log("customerAccessToken is not defined"),s},_=(e,s,r,a,t,n,i,l,d,o,c)=>{const p=e.reduce(((e,s)=>(e[s.name]="",e)),{}),[u,m]=(0,B.useState)(t||p),[h,w]=(0,B.useState)({}),[j,g]=(0,B.useState)(!1),[b,x]=(0,B.useState)(null),[v,f]=(0,B.useState)(null),N=(s,r)=>{const a=e.find((e=>e.name===s));return a?a.required&&!r.trim()?`*Please enter a valid ${a.label.toLowerCase()}.`:!a.required||((e,s)=>e in H&&H[e](s))(a.type,r)||r.trim()?"":a.errorMessage||"Invalid value.":""},O=()=>{m(p),w({})};return{formState:u,formErrors:h,handleChange:e=>{let s=e.target,r="checkbox"===s.type?String(s.checked):s.value,a=s.name;m((e=>Object.assign(Object.assign({},e),{[a]:r})));const t=N(a,r);w((e=>Object.assign(Object.assign({},e),{[a]:t})))},handleSubmit:h=>{return j=void 0,b=void 0,A=function*(){var j,b,v,A,y;if(h.preventDefault(),x(null),(()=>{const s={};return e.forEach((e=>{var r;const a=N(e.name,null!==(r=u[e.name])&&void 0!==r?r:"");a&&(s[e.name]=a)})),w(s),0===Object.keys(s).length})()){g(!0);try{if("signin"===r){const e=yield(0,U.getLazyState)("customerAccessToken",{email:u.email,password:u.password});if(!e)throw new Error("Wrong email or password");const{accessToken:s,expiresAt:r}=e;a&&a(s,r)}if("create"===r){const e=yield(0,U.getLazyState)("createNewUser",{firstName:u.firstName,lastName:u.lastName,email:u.email,password:u.password,shoppingFor:u.shoppingFor});if((null===(b=null===(j=e.data.customerCreate)||void 0===j?void 0:j.customer)||void 0===b?void 0:b.id)&&(f("Account created successfully"),O()),null===(v=e.data.customerCreate)||void 0===v?void 0:v.customerUserErrors.length){const s=null===(y=null===(A=e.data.customerCreate)||void 0===A?void 0:A.customerUserErrors.find((e=>e.message)))||void 0===y?void 0:y.message;throw new Error(s||"Failed to create account")}}if("resetPassword"===r&&(yield(0,U.getLazyState)("resetPassword",{email:u.email}),m(p)),"createNewAddress"===r&&W(s)){const e="true"===(null==u?void 0:u.defaultAddress);yield(0,U.getLazyState)("addNewAddress",{customerAccessToken:s,setAsDefaultAddress:e,socialLogin:c,address:{firstName:u.firstName,lastName:u.lastName,address1:u.address1,address2:u.address2,city:u.city,province:u.province,country:u.country,zip:u.zip,phone:u.phone}}),e&&i&&i(u),o&&o(u),d&&d()}if("updateAddress"===r&&W(s)){n&&n(u),i&&l&&i(u);const e=null==t?void 0:t.id,r="true"===(null==u?void 0:u.defaultAddress);r&&i&&i(u),yield(0,U.getLazyState)("updateAddress",{customerAccessToken:s,id:e,setAsDefaultAddress:r,socialLogin:c,address:{firstName:u.firstName,lastName:u.lastName,address1:u.address1,address2:u.address2,city:u.city,province:u.province,country:u.country,zip:u.zip,phone:u.phone}}),d&&d()}}catch(e){x(e.message)}finally{g(!1)}}},new((v=void 0)||(v=Promise))((function(e,s){function r(e){try{t(A.next(e))}catch(e){s(e)}}function a(e){try{t(A.throw(e))}catch(e){s(e)}}function t(s){var t;s.done?e(s.value):(t=s.value,t instanceof v?t:new v((function(e){e(t)}))).then(r,a)}t((A=A.apply(j,b||[])).next())}));var j,b,v,A},resetForm:O,isLoading:j,submitError:b,submitCorrect:v}},q=(e,s,r)=>{let a;r?a=new Date(r):(a=new Date,a.setTime(a.getTime()+6048e5));const t=`expires=${a.toUTCString()}`;document.cookie=`${e}=${s}; ${t}; path=/`},z=e=>{document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`},Y="/js/hiko-auth-headless.js",$="rbxactive.myshopify.com",{wrapper:K,error:V,wrapperFormWithHalfWidthLabel:J,correct:X}={wrapper:"TqFCOMiw",error:"rPLcbBL4",correct:"dHrPsGWe",wrapperFormWithHalfWidthLabel:"Bskg3r1E"},G=({formData:e,label:s,handlePassword:r,forgotPasswordText:t,formType:n,onLoginSuccess:i,addressInitState:l,updateAddress:d,formWithHalfWidthLabel:o,isDefaultAddress:c,handleUpdatedDefaultAddress:u,handleShowForm:m,handleAddNewAddress:h,customerAccessToken:w,countries:j,provinces:g,socialLogin:b})=>{const{formState:x,formErrors:v,handleChange:f,handleSubmit:N,resetForm:O,isLoading:A,submitError:y,submitCorrect:T}=_(e,w,n,i,l,d,u,c,m,h,b),S=((e,s,r)=>{var a;if(!s||!r)return[];const t=r.find((s=>s.name.toLowerCase()===e.toLowerCase()));return t&&(null===(a=s.find((e=>e.code.countryCode.toUpperCase()===t.isoCode.toUpperCase())))||void 0===a?void 0:a.provinces.map((e=>e.name)))||[]})(x.country||"",g,j);return(0,a.jsxs)("form",Object.assign({onSubmit:N,className:(0,p.a)(K,o&&J)},{children:[y&&(0,a.jsx)("div",Object.assign({className:V},{children:y})),T&&(0,a.jsx)("div",Object.assign({className:X},{children:T})),e.map(((e,s)=>(0,a.jsx)(L,Object.assign({},e,{provinces:S,notFullWidth:e.notFullWidth,handleChange:f,formErrors:v,formState:x,isDefaultAddress:c}),e.label+s+n))),(0,a.jsx)(R,{label:A?"Processing...":s,handlePassword:r,forgotPasswordText:t,disabled:A,alginToRight:o})]}))},{wrapper:Q}={wrapper:"HHCGItzF"},Z=({formData:e,label:s,title:r})=>(0,a.jsxs)("div",Object.assign({className:Q},{children:[(0,a.jsx)(n,{title:r}),(0,a.jsx)(G,{formData:e,label:s,formType:"create",customerAccessToken:null})]})),{wrapper:ee}={wrapper:"kux4HWcM"},se=({formData:e,label:s,title:r,forgotPasswordText:t,handlePassword:i,onLoginSuccess:l,showResetPassword:d,handleShowResetPassword:o})=>(0,a.jsxs)("div",Object.assign({className:(0,p.a)(ee)},{children:[(0,a.jsx)(n,{title:r}),(0,a.jsx)(G,{formData:e,label:s,forgotPasswordText:t,handlePassword:o,formType:"signin",onLoginSuccess:l,customerAccessToken:null})]})),{wrapper:re,wrapperTitle:ae,wrapperMessage:te}={wrapper:"rcoxlYYq",wrapperTitle:"gEWnbUVH",wrapperMessage:"VBdKuQrC"},ne=({userFirstName:e})=>{const s=e?`Hi, ${e}!`:"Hi!";return(0,a.jsxs)("div",Object.assign({className:re},{children:[(0,a.jsx)("h1",Object.assign({className:ae},{children:"My Account"})),(0,a.jsx)("p",Object.assign({className:te},{children:s}))]}))},ie=e=>{switch(e){case"FULFILLED":return"Completed";case"IN_PROGRESS":return"In Progress";case"ON_HOLD":return"On Hold";case"OPEN":return"Open";case"PARTIALLY_FULFILLED":return"Partially Completed";case"PENDING_FULFILLMENT":return"Pending Fulfillment";case"RESTOCKED":return"Restocked";case"SCHEDULED":return"Scheduled";case"UNFULFILLED":return"Unfulfilled";default:return"Unknown Status"}},le=e=>{const s=new Date(e);return`${(s.getMonth()+1).toString().padStart(2,"0")}/${s.getDate().toString().padStart(2,"0")}/${s.getFullYear().toString().slice(-2)}`},de=e=>{const s=new URL(window.location.href);s.searchParams.has("orderNumber")?s.searchParams.set("orderNumber",e.toString()):s.searchParams.append("orderNumber",e.toString()),window.history.pushState({},"",s.toString()),window.dispatchEvent(new Event("urlchange"))},{wrapper:oe,wrapperOrderNumber:ce,wrapperOrderInfo:pe,wrapperOrderInfoTitle:ue,wrapperButton:me}={wrapper:"N0dasOcQ",wrapperOrderNumber:"zRbui8Oq",wrapperOrderInfo:"E3zoJwhJ",wrapperOrderInfoTitle:"YJTPGmbb",wrapperButton:"cwxkPAfJ"},he=({order:e})=>{const{orderNumber:s,totalPrice:r,processedAt:t,fulfillmentStatus:n,financialStatus:i}=e,l=le(t),d=ie(n);return(0,a.jsxs)("div",Object.assign({className:oe},{children:[(0,a.jsxs)("h2",Object.assign({className:ce},{children:["Order #",s]})),(0,a.jsxs)("div",Object.assign({className:pe},{children:[(0,a.jsx)("p",Object.assign({className:ue},{children:"Date "})),(0,a.jsx)("p",Object.assign({className:ue},{children:l}))]})),(0,a.jsxs)("div",Object.assign({className:pe},{children:[(0,a.jsx)("p",Object.assign({className:ue},{children:"Status "})),(0,a.jsx)("p",Object.assign({className:ue},{children:d}))]})),(0,a.jsxs)("div",Object.assign({className:pe},{children:[(0,a.jsx)("p",Object.assign({className:ue},{children:"Total "})),(0,a.jsxs)("p",Object.assign({className:ue},{children:["$",Number(r.amount).toFixed(2)]}))]})),(0,a.jsx)("div",Object.assign({onClick:()=>de(s),className:me},{children:"View order details"}))]}))},{wrapper:we,wrapperButton:je,wrapperButtonWhite:ge}={wrapper:"EsawHNrJ",wrapperButton:"w97WEoEB",wrapperButtonWhite:"wO3CNRff"},be=({availableForSale:e,productHandle:s,productId:r})=>{const t=`https://landing-pages.yotpo.com/base/#/review?&appkey=J97jPKypdpmHGqgeR4CAzCBh6EcRa42lPCQNXpyd&display_name=&email=&email_type=review_request_link_product&page_title=Please%20write%20a%20review&product_title=${s}&review_accept_one_field=true&review_images=true&review_source=review_request_link_product&review_title_required=true&skip_share=false&sku=${function(e){const s=e.match(/(\d+)/);return s?parseInt(s[0],10):null}(r)||""}&ref=yotpo`,n=`/products/${s}`;return(0,a.jsxs)("div",Object.assign({className:we},{children:[e&&(0,a.jsx)("a",Object.assign({href:n,className:je},{children:"Buy it again"})),(0,a.jsx)("a",Object.assign({href:t,target:"_blank",className:(0,p.a)(je,ge)},{children:"Write a review"}))]}))},{wrapper:xe,wrapperImage:ve,wrapperDetails:fe,wrapperDetailsTitle:Ne,wrapperDetailsOption:Oe,wrapperDetailsQuantity:Ae,wrapperDetailsPrice:ye,wrapperDetailsInfo:Te,wrapperMobile:Se,wrapperDesktop:De,wrapperPriceDesktop:Pe,noBorderBottomLast:ke}={wrapper:"VrlSP1TI",wrapperImage:"lsJh8bSq",wrapperDesktop:"T_KaPYel",wrapperMobile:"SHW4c10x",wrapperDetails:"mV4BPFk3",wrapperDetailsInfo:"wxTj7ROy",wrapperDetailsTitle:"TCKg_do9",wrapperDetailsOption:"iZdnzWiF",wrapperDetailsQuantity:"YzpVl47J",wrapperDetailsPrice:"YKFYDS0Y",wrapperPriceDesktop:"prjAidnx",noBorderBottomLast:"q9_zsciS"},Le=({title:e,variant:s,quantity:r,discountedTotalPrice:t,lastItem:n})=>{var i,l,d;const o=(null===(i=null==s?void 0:s.image)||void 0===i?void 0:i.url)||"",c=(null==s?void 0:s.selectedOptions)||[],u=+t.amount/r,m=(null==s?void 0:s.availableForSale)||!1,h=(null===(l=null==s?void 0:s.product)||void 0===l?void 0:l.handle)||"",w=(null===(d=null==s?void 0:s.product)||void 0===d?void 0:d.id)||"",j="navidium-shipping-protection"!==h&&"Route Package Protection"!==e&&"Package Protection"!==e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",Object.assign({className:(0,p.a)(xe,n&&ke)},{children:[(0,a.jsx)("div",Object.assign({className:ve},{children:(0,a.jsx)("img",{src:o||"https://cdn.shopify.com/s/files/1/1115/2394/files/RBX-Logo-1_7576caa8-6111-4084-bb97-e93deb5dbbf4.png?v=1732748803",alt:e})})),(0,a.jsxs)("div",Object.assign({className:fe},{children:[(0,a.jsxs)("div",Object.assign({className:Te},{children:[(0,a.jsx)("p",Object.assign({className:Ne},{children:e})),j&&c.map((e=>(0,a.jsxs)("p",Object.assign({className:Oe},{children:[e.name,": ",e.value]}),e.name))),(0,a.jsxs)("p",Object.assign({className:Ae},{children:["Quantity: ",r]}))]})),(0,a.jsx)("div",Object.assign({className:Pe},{children:(0,a.jsxs)("p",Object.assign({className:ye},{children:["$",u.toFixed(2)]}))}))]})),(0,a.jsx)("div",Object.assign({className:De},{children:j&&(0,a.jsx)(be,{availableForSale:m,productHandle:h,productId:w})}))]})),(0,a.jsx)("div",Object.assign({className:Se},{children:j&&(0,a.jsx)(be,{availableForSale:m,productHandle:h,productId:w})}))]})},{wrapper:Ie,wrapperButton:Fe,wrapperAddress:Ce,wrapperTitle:Ee}={wrapper:"RgimcXAK",wrapperTitle:"ezzgzv9H",wrapperAddress:"tDxS21Ab",wrapperButton:"oKVpHmyY"},Me=({firstName:e,lastName:s,address1:r,address2:t,city:n,province:i,country:l,zip:d,phone:o,successfulFulfillments:c,provinceCode:p})=>{var u,m,h;const w=null!==(h=null===(m=null===(u=c[0])||void 0===u?void 0:u.trackingInfo[0])||void 0===m?void 0:m.url)&&void 0!==h?h:"";return(0,a.jsxs)("div",Object.assign({className:Ie},{children:[(0,a.jsx)("h3",Object.assign({className:Ee},{children:"Shipping information"})),(0,a.jsxs)("div",Object.assign({className:Ce},{children:[(0,a.jsxs)("p",{children:[e," ",s]}),(0,a.jsx)("p",{children:r}),t&&(0,a.jsx)("p",{children:t}),(0,a.jsxs)("p",{children:[n,", ",p," ",d]}),(0,a.jsx)("p",{children:l})]})),w&&(0,a.jsx)("a",Object.assign({className:Fe,href:w,target:"_blank",rel:"noreferrer"},{children:"Track package"}))]}))},{wrapper:Re,wrapperTitle:Be,wrapperOrderDetails:Ue,wrapperOrderItems:He,wrapperShippingInformation:We,wrapperOrderDetailsDesktop:_e,wrapperReturns:qe}={wrapperShippingInformation:"_5HxHq2H0",wrapperTitle:"olqjTq2z",wrapperOrderItems:"SF_mMi5H",wrapperReturns:"URp7uKAs",wrapperOrderDetails:"FTlpLM3P",wrapperOrderDetailsDesktop:"ZDtEEDKj"},ze=({order:e,lastName:s,firstName:r})=>{const{orderNumber:t,processedAt:n,totalPrice:i,fulfillmentStatus:l,successfulFulfillments:d}=e,o=(e=>{const s=new Date(e);return`Purchased on ${s.toLocaleString("en-US",{month:"long"})} ${s.getUTCDate()}, ${s.getUTCFullYear()}`})(n),c=ie(l);return(0,a.jsxs)("div",Object.assign({className:Re},{children:[(0,a.jsxs)("div",Object.assign({className:_e},{children:[(0,a.jsxs)("div",Object.assign({className:Ue},{children:[(0,a.jsxs)("h1",Object.assign({className:Be},{children:["Order #",t]})),(0,a.jsx)("p",{children:o}),(0,a.jsxs)("p",{children:["Order total: $",Number(i.amount).toFixed(2)]}),(0,a.jsxs)("p",{children:["Status: ",c]})]})),e.shippingAddress&&(0,a.jsx)("div",Object.assign({className:We},{children:(0,a.jsx)(Me,{address1:e.shippingAddress.address1,address2:e.shippingAddress.address2,city:e.shippingAddress.city,province:e.shippingAddress.province,country:e.shippingAddress.country,zip:e.shippingAddress.zip,phone:e.shippingAddress.phone,id:e.shippingAddress.id,provinceCode:e.shippingAddress.provinceCode,successfulFulfillments:d,firstName:r,lastName:s})}))]})),(0,a.jsxs)("div",Object.assign({className:qe},{children:[(0,a.jsx)("p",{children:"Need to make a return?"}),(0,a.jsx)("a",Object.assign({href:`https://returns.rbxactive.com/#/?order=${t}`},{children:"Click here"}))]})),(0,a.jsx)("div",Object.assign({className:He},{children:e.lineItems.map(((s,r)=>(0,a.jsx)(Le,Object.assign({lastItem:r===e.lineItems.length-1},s),s.id)))}))]}))},{wrapper:Ye,wrapperInfo:$e,wrapperInfoParagraph:Ke,wrapperInfoParagraphBold:Ve}={wrapper:"aoyfhoq9",wrapperInfo:"Rx5MBgGO",wrapperInfoParagraph:"yl6D5cZR",wrapperInfoParagraphBold:"WDMla67p"},Je=({totalPrice:e,subtotalPrice:s,currentSubtotalPrice:r,currentTotalTax:t,currentTotalShippingPrice:n})=>{const i=Number(s.amount)-Number(r.amount);return(0,a.jsxs)("div",Object.assign({className:Ye},{children:[(0,a.jsxs)("div",Object.assign({className:$e},{children:[(0,a.jsx)("p",Object.assign({className:Ke},{children:"Subtotal: "})),(0,a.jsxs)("p",Object.assign({className:Ke},{children:["$",Number(s.amount).toFixed(2)]}))]})),i>0&&(0,a.jsxs)("div",Object.assign({className:$e},{children:[(0,a.jsx)("p",Object.assign({className:Ke},{children:"Discount: "})),(0,a.jsxs)("p",Object.assign({className:Ke},{children:["-$",i.toFixed(2)]}))]})),(0,a.jsxs)("div",Object.assign({className:$e},{children:[(0,a.jsx)("p",Object.assign({className:Ke},{children:"Total Tax: "})),(0,a.jsxs)("p",Object.assign({className:Ke},{children:["$",Number(t.amount).toFixed(2)]}))]})),(0,a.jsxs)("div",Object.assign({className:$e},{children:[(0,a.jsx)("p",Object.assign({className:Ke},{children:"Shipping: "})),(0,a.jsxs)("p",Object.assign({className:Ke},{children:["$",Number(n.amount).toFixed(2)]}))]})),(0,a.jsxs)("div",Object.assign({className:$e},{children:[(0,a.jsxs)("p",Object.assign({className:(0,p.a)(Ke,Ve)},{children:["Total:"," "]})),(0,a.jsxs)("p",Object.assign({className:(0,p.a)(Ke,Ve)},{children:["$",Number(e.amount).toFixed(2)]}))]}))]}))},{wrapper:Xe,wrapperTitle:Ge,wrapperTable:Qe,wrapperTableHeader:Ze,wrapperTableHeaderCenter:es,wrapperButtonRight:ss,wrapperButton:rs,wrapperText:as}={wrapper:"vohsL65X",wrapperText:"uF4RIjWO",wrapperTitle:"NnHrdlNJ",wrapperTable:"fUJg18nW",wrapperTableHeader:"UzOHg_PY",wrapperTableHeaderCenter:"CDWYmYyR",wrapperTableRow:"SsXUmYZv",wrapperButton:"LktAouaB",wrapperButtonRight:"hARDZ1hJ"},ts=({orders:e})=>{const s=(null==e?void 0:e.length)>0;return(0,a.jsxs)("div",Object.assign({className:Xe},{children:[(0,a.jsx)("h2",Object.assign({className:Ge},{children:"Order History"})),!s&&(0,a.jsx)("p",Object.assign({className:as},{children:"You haven't placed any orders yet."})),s&&(0,a.jsxs)("table",Object.assign({className:Qe},{children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",Object.assign({className:Ze},{children:"Order"})),(0,a.jsx)("th",Object.assign({className:Ze},{children:"Date"})),(0,a.jsx)("th",Object.assign({className:Ze},{children:"Status"})),(0,a.jsx)("th",Object.assign({className:Ze},{children:"Total"})),(0,a.jsx)("th",Object.assign({className:(0,p.a)(Ze,es)},{children:"Details"}))]})}),(0,a.jsx)("tbody",{children:e.map(((e,s)=>(0,a.jsxs)("tr",{children:[(0,a.jsxs)("td",{children:["#",e.orderNumber]}),(0,a.jsx)("td",{children:le(e.processedAt)}),(0,a.jsx)("td",{children:ie(e.fulfillmentStatus)}),(0,a.jsxs)("td",{children:["$",Number(e.totalPrice.amount).toFixed(2)]}),(0,a.jsx)("td",Object.assign({className:ss},{children:(0,a.jsx)("button",Object.assign({onClick:()=>de(e.orderNumber),className:rs},{children:"View order"}))}))]},s+e.id)))})]}))]}))};const ns=(e,s=[])=>{(0,o.useEffect)((()=>{const s=()=>{e()};return s(),window.addEventListener("popstate",s),window.addEventListener("urlchange",s),()=>{window.removeEventListener("popstate",s),window.removeEventListener("urlchange",s)}}),s)},is=e=>{(0,o.useEffect)((()=>{if(!e)return;let s=0;if(e.current){const{height:r}=e.current.getBoundingClientRect();s=r}return()=>{const e=window.scrollY-s,r=e<0?0:e;window.scrollTo(0,r)}}),[e])},ls=e=>{e&&(0,o.useEffect)((()=>{var s,r,a,t;s=void 0,r=void 0,t=function*(){const s=yield(0,U.getLazyState)("getMultipassToken",{email:e});s&&(e=>{const s=document.createElement("iframe");s.style.display="none",s.src=e,document.body.appendChild(s),setTimeout((()=>{document.body.removeChild(s)}),5e3)})(s)},new((a=void 0)||(a=Promise))((function(e,n){function i(e){try{d(t.next(e))}catch(e){n(e)}}function l(e){try{d(t.throw(e))}catch(e){n(e)}}function d(s){var r;s.done?e(s.value):(r=s.value,r instanceof a?r:new a((function(e){e(r)}))).then(i,l)}d((t=t.apply(s,r||[])).next())}))}),[])},{wrapper:ds,wrapperOrders:os,wrapperTitle:cs,wrapperShippingInformation:ps,wrapperText:us}={wrapper:"MoAcu_na",wrapperShippingInformation:"dx60REeX",wrapperOrders:"mhuhmVPF",wrapperText:"msIXU3z4",wrapperTitle:"GWN1gmZs",wrapperMessage:"osWONGfY"},ms=({orders:e,firstName:s,lastName:r})=>{const[t,n]=(0,o.useState)(null),i=0===(null==e?void 0:e.length);if(ns((()=>{const s=new URL(window.location.href).searchParams.get("orderNumber");if(s){const r=e.find((e=>e.orderNumber===Number(s)));window.scrollTo(0,0),n(null!=r?r:null)}else n(null)}),[e]),t){const e=t.lineItems.reduce(((e,s)=>({amount:e.amount+Number(s.discountedTotalPrice.amount),currencyCode:e.currencyCode})),{amount:0,currencyCode:"USD"});return(0,a.jsxs)("div",Object.assign({className:os},{children:[(0,a.jsx)("h1",Object.assign({className:cs},{children:"Order Summary"})),(0,a.jsx)(ze,{order:t,firstName:s,lastName:r}),(0,a.jsx)("div",Object.assign({className:ps},{children:t.shippingAddress&&(0,a.jsx)(Me,Object.assign({},t.shippingAddress,{firstName:s,lastName:r,successfulFulfillments:t.successfulFulfillments}))})),(0,a.jsx)(Je,{totalPrice:t.totalPrice,subtotalPrice:e,currentSubtotalPrice:t.currentSubtotalPrice,currentTotalTax:t.currentTotalTax,currentTotalShippingPrice:t.currentTotalShippingPrice})]}))}return(0,a.jsxs)("div",Object.assign({className:ds},{children:[i&&(0,a.jsx)("p",Object.assign({className:us},{children:"You haven't placed any orders yet."})),null==e?void 0:e.map((e=>(0,a.jsx)(he,{order:e},e.id))),(0,a.jsx)(ts,{orders:e})]}))},{wrapper:hs,wrapperItem:ws,wrapperItemActive:js,wrapperLink:gs}={wrapper:"BRDgrdvM",wrapperItem:"nAHYxJ5x",wrapperItemActive:"hWfTy0mZ",wrapperLink:"ItP0vB7C"},bs=[{label:"My Orders",param:"orders"},{label:"Profile",param:"profile"},{label:"Rewards",param:"rewards"},{label:"Refer a friend",param:"refer"}],xs=({currentTab:e})=>{const s="orders"===e;return(0,a.jsx)("div",Object.assign({className:hs},{children:bs.map((r=>(0,a.jsx)("div",Object.assign({onClick:()=>((e=>{if("refer"===e)return;const s=new URL(window.location.href);s.searchParams.has("view")?s.searchParams.set("view",e):s.searchParams.append("view",e),window.history.pushState({},"",s.toString()),window.dispatchEvent(new Event("urlchange"))})(r.param),void(s&&(()=>{const e=new URL(window.location.href);e.searchParams.has("orderNumber")&&e.searchParams.delete("orderNumber"),window.history.pushState({},"",e.toString()),window.dispatchEvent(new Event("urlchange"))})())),className:(0,p.a)(ws,r.param===e&&js)},{children:"refer"===r.param?(0,a.jsx)("a",Object.assign({className:gs,href:"#","data-lion-refer":!0},{children:"Refer a friend"})):r.label}),r.param)))}))};var vs=r(106),fs=r(10);const{wrapper:Ns,wrapperHeading:Os,wrapperTitle:As,wrapperMyRewardTitle:ys,wrapperPoints:Ts,wrapperHistory:Ss,wrapperEarnPoints:Ds,wrapperParagraph:Ps}={wrapper:"jaaUNcau",wrapperMyRewardTitle:"pz_wZ8k9",wrapperHeading:"K_i7wUzF",wrapperTitle:"oXVPQf_j",wrapperPoints:"bBgGTyQR",wrapperHistory:"f4qORoq1",wrapperParagraph:"iTMiEbdf",wrapperEarnPoints:"cWMDU8Pl"},ks=({userId:e,email:s})=>{const r={id:e,email:s};(0,vs.a)(r);const[t,n]=(0,o.useState)(!1);return(0,fs.a)(t),(0,o.useEffect)((()=>{const e=document.body,s=new MutationObserver((e=>{let s=!1;for(const r of e)if("childList"===r.type&&(r.addedNodes.length>0||r.removedNodes.length>0)&&document.querySelector(".lion-modal-and-screen")){s=!0;break}n((e=>e!==s?s:e))}));return s.observe(e,{childList:!0,subtree:!0}),()=>{s.disconnect()}}),[]),(0,a.jsxs)("div",Object.assign({className:Ns},{children:[(0,a.jsx)("h1",Object.assign({className:ys},{children:"My rewards"})),(0,a.jsxs)("div",Object.assign({className:Os},{children:[(0,a.jsx)("h3",Object.assign({className:As},{children:"RBX Reward Status"})),(0,a.jsxs)("p",Object.assign({className:Ts},{children:["Your point balance: ",(0,a.jsx)("span",{"data-lion-points":!0}),(0,a.jsx)("span",{children:" points"})]}))]})),(0,a.jsx)("div",{"data-lion-tier-overview":!0}),(0,a.jsxs)("div",Object.assign({className:Ss},{children:[(0,a.jsx)("h3",Object.assign({className:As},{children:"History"})),(0,a.jsx)("div",{"data-lion-history-table":!0})]})),(0,a.jsxs)("div",Object.assign({className:Ds},{children:[(0,a.jsx)("p",Object.assign({className:Ps},{children:"Earn Points"})),(0,a.jsx)("div",{"data-lion-rules-list":!0})]}))]}))},{wrapper:Ls,wrapperLabel:Is,wrapperAddress:Fs,wrapperMobile:Cs,wrapperDesktop:Es}={wrapperLabel:"KQ3ZgYrh",wrapperAddress:"lvNQT4UL"},Ms=({address1:e,address2:s,city:r,country:t,zip:n,provinceCode:i,label:l="Address"})=>(0,a.jsxs)("div",Object.assign({className:Ls},{children:[l&&(0,a.jsx)("p",Object.assign({className:Is},{children:l})),(0,a.jsxs)("div",Object.assign({className:Fs},{children:[(0,a.jsx)("p",{children:e}),s&&(0,a.jsx)("p",{children:s}),(r||i||n)&&(0,a.jsxs)("p",{children:[r,", ",i," ",n]}),(0,a.jsx)("p",{children:t})]}))]})),{wrapper:Rs}={wrapper:"gURfgRDC"},Bs=({handleShowAddNewAddressForm:e})=>(0,a.jsx)("button",Object.assign({onClick:e,className:Rs},{children:"Add New Address"})),{wrapper:Us}={wrapper:"emhdE6wM"},Hs=({handleShowAddNewAddressForm:e})=>(0,a.jsx)("button",Object.assign({onClick:e,className:Us},{children:"Cancel"})),{wrapper:Ws}={wrapper:"t7YaiDsE"},_s=({handleShowAddNewAddressForm:e,handleAddNewAddress:s,handleUpdatedDefaultAddress:r,customerAccessToken:t,addressFromData:n,countries:i,provinces:l,socialLogin:d})=>{const c=(0,o.useRef)(null);return is(c),(0,a.jsxs)("div",Object.assign({ref:c,className:Ws},{children:[(0,a.jsx)(G,{formData:n,formType:"createNewAddress",label:"Add Address",formWithHalfWidthLabel:!0,handleAddNewAddress:s,handleUpdatedDefaultAddress:r,customerAccessToken:t,provinces:l,countries:i,socialLogin:d,handleShowForm:e}),(0,a.jsx)(Hs,{handleShowAddNewAddressForm:e})]}))};var qs=r(37),zs=r(11);const{wrapper:Ys,wrapperOverlay:$s,wrapperCloseIcon:Ks,wrapperMessage:Vs,wrapperMessageDeleteButton:Js,wrapperMessageText:Xs}={wrapper:"PkXG7tqI",wrapperOverlay:"KbovdyJE",wrapperCloseIcon:"x0ta7rd7",wrapperMessage:"nTKzXHI9",wrapperMessageText:"WQeDacfg",wrapperMessageDeleteButton:"VlOcCGQa"},Gs=({showModal:e,handleDeleteAddress:s,handleShowModal:r,address:t})=>{if(!e)return null;const n=(0,o.useRef)(null);return(0,zs.a)(n,(()=>r())),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:$s,onClick:r}),(0,a.jsxs)("div",Object.assign({ref:n,className:Ys},{children:[(0,a.jsx)("div",Object.assign({className:Ks,onClick:r},{children:(0,a.jsx)(qs.a,{})})),(0,a.jsxs)("div",Object.assign({className:Vs},{children:[(0,a.jsx)("span",Object.assign({className:Xs},{children:"Are you sure you want to delete this address?"})),(0,a.jsx)("div",{children:(0,a.jsx)(Ms,Object.assign({},t,{label:""}))}),(0,a.jsx)("button",Object.assign({className:Js,onClick:s},{children:"Delete"}))]}))]}))]})};const{wrapper:Qs,wrapperButtons:Zs,wrapperButton:er,wrapperForm:sr,wrapperAddress:rr,wrapperAddressLabel:ar,wrapperAddressText:tr}={wrapper:"FF1i6Pcy",wrapperAddress:"UgWTkFSg",wrapperAddressLabel:"aSCIYWal",wrapperAddressText:"GdvetQwo",wrapperForm:"WA8QRdaH",wrapperButtons:"vhPlbBKY",wrapperButton:"pEU_Gfxp"},nr=({address:e,label:s,removeAddressById:r,updateAddress:t,handleUpdatedDefaultAddress:n,isDefaultAddress:i,customerAccessToken:l,addressFromData:d,provinces:c,countries:p,socialLogin:u})=>{const{handleDeleteAddress:m,handleShowModal:h,showDeleteAddressModal:w}=((e,s,r,a,t,n)=>{const[i,l]=(0,o.useState)(!1),d=()=>{l((e=>!e))};return{handleDeleteAddress:()=>{return i=void 0,l=void 0,c=function*(){try{if(!s)return void console.log("customerAccessToken is not defined for delete address");if(yield(0,U.getLazyState)("deleteAddress",{id:e,customerAccessToken:s,socialLogin:n}),r(e),d(),window.document.body.style.overflow="visible",a){const e=yield(0,U.getLazyState)("getDefaultAddress",{customerAccessToken:s,socialLogin:n});t(e)}}catch(e){console.log("An error occurred (deleteAddress):",e)}},new((o=void 0)||(o=Promise))((function(e,s){function r(e){try{t(c.next(e))}catch(e){s(e)}}function a(e){try{t(c.throw(e))}catch(e){s(e)}}function t(s){var t;s.done?e(s.value):(t=s.value,t instanceof o?t:new o((function(e){e(t)}))).then(r,a)}t((c=c.apply(i,l||[])).next())}));var i,l,o,c},handleShowModal:d,showDeleteAddressModal:i}})(e.id,l,r,i,n,u),[j,g]=(0,o.useState)(!1),b=(0,o.useRef)(null);is(b);const x=()=>{g((e=>!e))};(0,fs.a)(w);const v=e.firstName,f=e.lastName,N=e.phone,O=v||f;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",Object.assign({ref:b,className:Qs},{children:[(0,a.jsxs)("div",Object.assign({className:rr},{children:[(0,a.jsx)("p",Object.assign({className:ar},{children:s})),O&&(0,a.jsxs)("p",Object.assign({className:tr},{children:[v," ",f]})),(0,a.jsx)(Ms,Object.assign({},e,{label:""})),N&&(0,a.jsx)("p",Object.assign({className:tr},{children:e.phone}))]})),(0,a.jsxs)("div",Object.assign({className:Zs},{children:[(0,a.jsx)("button",Object.assign({onClick:x,className:er},{children:"Edit"})),(0,a.jsx)("span",{children:"|"}),(0,a.jsx)("button",Object.assign({onClick:h,className:er},{children:"Delete"}))]})),j&&(0,a.jsxs)("div",Object.assign({className:sr},{children:[(0,a.jsx)(G,{formData:d,formType:"updateAddress",label:"Update Address",addressInitState:e,updateAddress:t,formWithHalfWidthLabel:!0,handleUpdatedDefaultAddress:n,isDefaultAddress:i,handleShowForm:x,customerAccessToken:l,provinces:c,countries:p,socialLogin:u}),(0,a.jsx)(Hs,{handleShowAddNewAddressForm:x})]}))]})),(0,a.jsx)(Gs,{showModal:w,handleDeleteAddress:m,handleShowModal:h,address:e})]})},ir=e=>{if(!e)return null;const s=e.match(/MailingAddress\/(\d+)/);return s&&s[1]?s[1]:null},{wrapper:lr,wrapperTitle:dr,wrapperForm:or,wrapperTitleMobile:cr,wrapperTitleButton:pr,wrapperAddresses:ur,wrapperCancelButton:mr}={wrapper:"FWA8OX43",wrapperAddresses:"WZAyYI6U",wrapperTitleMobile:"Pql0fMco",wrapperTitleButton:"YgcRGWhT",wrapperTitle:"T6LXVLuU",wrapperForm:"PAGpMJ6_"},hr=({addresses:e,removeAddressById:s,updateAddress:r,handleShowAddNewAddressForm:t,showAddNewAddressForm:n,defaultAddressId:i,handleUpdatedDefaultAddress:l,handleAddNewAddress:d,customerAccessToken:o,addressFromData:c,provinces:u,countries:m,socialLogin:h})=>(0,a.jsxs)("div",Object.assign({className:lr},{children:[!n&&(0,a.jsx)("div",Object.assign({className:dr},{children:(0,a.jsxs)("h3",{children:["My Addresses",(0,a.jsx)("div",Object.assign({className:pr},{children:(0,a.jsx)(Bs,{handleShowAddNewAddressForm:t})}))]})})),e&&(0,a.jsx)("div",Object.assign({className:ur},{children:e.map(((e,t)=>(0,a.jsx)(nr,{address:e,label:ir(e.id)===ir(i)?"Default":`Address ${t+1}`,isDefaultAddress:e.id===i,handleUpdatedDefaultAddress:l,removeAddressById:s,updateAddress:r,customerAccessToken:o,addressFromData:c,provinces:u,countries:m,socialLogin:h})))})),n&&(0,a.jsxs)("div",Object.assign({className:or},{children:[(0,a.jsx)("div",Object.assign({className:(0,p.a)(dr,cr)},{children:(0,a.jsxs)("h3",{children:["My Addresses",(0,a.jsx)(Bs,{handleShowAddNewAddressForm:t})]})})),(0,a.jsx)(_s,{handleShowAddNewAddressForm:t,handleAddNewAddress:d,handleUpdatedDefaultAddress:l,customerAccessToken:o,addressFromData:c,provinces:u,countries:m,socialLogin:h})]}))]})),{wrapper:wr,wrapperMyProfileTitle:jr,wrapperName:gr,wrapperTier:br,wrapperTierIcon:xr,wrapperTierLabel:vr,wrapperPhone:fr,wrapperPhoneLabel:Nr,wrapperPhoneNumber:Or,wrapperEmail:Ar,wrapperEmailLabel:yr,wrapperEmailAddress:Tr,wrapperTierMobile:Sr,wrapperTierDesktop:Dr,wrapperUserInfoDesktop:Pr,wrapperUserInfoDesktopLabel:kr,wrapperUserInfoDesktopValue:Lr,wrapperUserInfoDesktopDetails:Ir,wrapperUserInfoMobile:Fr,wrapperMobile:Cr,wrapperAddressFormDesktop:Er,wrapperAddressFormMobile:Mr}={wrapper:"bz8Ia9gl",wrapperMyProfileTitle:"fK9xk_tP",wrapperUserInfoMobile:"sm2aCn9_",wrapperUserInfoDesktop:"myiz4doe",wrapperName:"goQlw6yl",wrapperTier:"c8ousFjW",wrapperTierDesktop:"e1m6F_HH",wrapperTierIcon:"mjILabgT",wrapperTierLabel:"NDqkX1Xf",wrapperEmail:"uMY7JXvq",wrapperEmailLabel:"n93_hbSm",wrapperEmailAddress:"Ra13EPwR",wrapperPhone:"lIu9eBYi",wrapperPhoneLabel:"UKOGqBLP",wrapperPhoneNumber:"OW2vn6Kl",wrapperAddressFormMobile:"EP9L1awE",wrapperAddressFormDesktop:"mfWkpeJf",wrapperMobile:"UVlAejDZ",wrapperDesktop:"hBmX_6Kg",wrapperTierMobile:"Ikx2tnAc",wrapperUserInfoDesktopDetails:"Id4S3pVQ",wrapperUserInfoDesktopLabel:"mJ7bIGt6",wrapperUserInfoDesktopValue:"ahtY9GIm",wrapperNameMobile:"VuT2ynCd",wrapperNameDesktop:"Ks3yOWMq"},Rr=({email:e,defaultAddress:s,tags:r,addresses:t,customerAccessToken:n,addressFromData:i,countries:l,provinces:d,socialLogin:p})=>{var u,m,h,w,j,g;const[b,x]=(0,o.useState)(t),[v,f]=(0,o.useState)(!1),[N,O]=(0,o.useState)(s),A=null!==(u=null==N?void 0:N.id)&&void 0!==u?u:"",y=()=>{f((e=>!e))},T=null===(h=null===(m=null==r?void 0:r.find((e=>e.includes("tier"))))||void 0===m?void 0:m.split(":")[1])||void 0===h?void 0:h.toLowerCase().trim(),S=e=>{if(!e)return null;const s={preferred:{component:(0,a.jsx)(c.N,{}),label:"Preferred"},elite:{component:(0,a.jsx)(c.O,{}),label:"Elite"},"x-treme":{component:(0,a.jsx)(c.P,{}),label:"X-Treme"}}[e];return s?(0,a.jsxs)("div",Object.assign({className:br},{children:[(0,a.jsx)("div",Object.assign({className:xr},{children:s.component})),(0,a.jsx)("p",Object.assign({className:vr},{children:s.label}))]})):null},D=(null==N?void 0:N.phone)&&(null===(w=null==N?void 0:N.phone)||void 0===w?void 0:w.length)>0,P=(null==N?void 0:N.firstName)&&(null===(j=null==N?void 0:N.firstName)||void 0===j?void 0:j.length)>0,k=(null==N?void 0:N.lastName)&&(null===(g=null==N?void 0:N.lastName)||void 0===g?void 0:g.length)>0,L=N,I=e&&(null==e?void 0:e.length)>0,F=[{label:"Name",value:null==N?void 0:N.firstName,isValueExist:P},{label:"Last Name",value:null==s?void 0:s.lastName,isValueExist:k},{label:"Email",value:e,isValueExist:I},{label:"Address",value:s,isValueExist:L,component:L&&(0,a.jsx)(Ms,Object.assign({},N,{label:""}))},{label:"Phone",value:null==N?void 0:N.phone,isValueExist:D}];return(0,a.jsxs)("div",Object.assign({className:wr},{children:[(0,a.jsxs)("div",Object.assign({className:Dr},{children:[(0,a.jsx)("h1",Object.assign({className:jr},{children:"My Profile"})),T&&S(T)]})),(0,a.jsxs)("div",Object.assign({className:Fr},{children:[(0,a.jsxs)("div",Object.assign({className:gr},{children:[(0,a.jsxs)("p",{children:[null==N?void 0:N.firstName," ",null==N?void 0:N.lastName]}),T&&(0,a.jsx)("div",Object.assign({className:Sr},{children:S(T)}))]})),I&&(0,a.jsxs)("div",Object.assign({className:Ar},{children:[(0,a.jsx)("p",Object.assign({className:yr},{children:"Email"})),(0,a.jsx)("p",Object.assign({className:Tr},{children:e}))]})),L&&(0,a.jsx)(Ms,Object.assign({},N)),D&&(0,a.jsxs)("div",Object.assign({className:fr},{children:[(0,a.jsx)("p",Object.assign({className:Nr},{children:"Phone Number"})),(0,a.jsx)("p",Object.assign({className:Or},{children:null==N?void 0:N.phone}))]}))]})),(0,a.jsx)("div",Object.assign({className:Pr},{children:F.map((({label:e,value:s,isValueExist:r,component:t})=>r&&"Address"===e?(0,a.jsxs)("div",Object.assign({className:Ir},{children:[(0,a.jsx)("p",Object.assign({className:kr},{children:e})),t&&t]})):r?(0,a.jsxs)("div",Object.assign({className:Ir},{children:[(0,a.jsx)("p",Object.assign({className:kr},{children:e})),(0,a.jsx)("p",Object.assign({className:Lr},{children:s}))]})):void 0))})),(0,a.jsx)(hr,{addresses:b,removeAddressById:e=>{const s=null==b?void 0:b.filter((s=>s.id!==e));s&&x(s)},updateAddress:e=>{const s=null==b?void 0:b.map((s=>s.id===e.id?e:s));s&&x(s)},handleShowAddNewAddressForm:y,showAddNewAddressForm:v,defaultAddressId:A,handleUpdatedDefaultAddress:e=>{e&&O(e)},handleAddNewAddress:e=>{const s=[...null!=b?b:[],e];x(s)},customerAccessToken:n,addressFromData:i,countries:l,provinces:d,socialLogin:p}),(0,a.jsx)("div",Object.assign({className:Cr},{children:!v&&(0,a.jsx)(Bs,{handleShowAddNewAddressForm:y})}))]}))},{wrapper:Br,wrapperCancel:Ur,wrapperText:Hr}={wrapper:"_7T01O4Pe",wrapperCancel:"U58Eh7ys",wrapperText:"Ck5cHgRP"},Wr=({formData:e,label:s,title:r,handleShowResetPassword:t})=>(0,a.jsxs)("div",Object.assign({className:Br},{children:[(0,a.jsx)(n,{title:r}),(0,a.jsx)("p",Object.assign({className:Hr},{children:"We will send you an email to reset your password."})),(0,a.jsx)(G,{formData:e,label:s,formType:"resetPassword",customerAccessToken:null}),(0,a.jsx)("button",Object.assign({className:Ur,onClick:t},{children:"Cancel"}))]})),{wrapper:_r,wrapperOverlay:qr,wrapperCloseIcon:zr,wrapperMessage:Yr,wrapperMessageDeleteButton:$r,wrapperMessageText:Kr}={wrapper:"TqHqNBuO",wrapperOverlay:"dtJI8TF3",wrapperCloseIcon:"i3zR72pK",wrapperMessage:"juAFgaak",wrapperMessageText:"psX4Uga7",wrapperMessageDeleteButton:"acPaiUpo"},Vr=({showModal:e,handleLogout:s,handleShowModal:r})=>{if(!e)return null;const t=(0,o.useRef)(null);return(0,zs.a)(t,r),(0,fs.a)(e),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:qr,onClick:r}),(0,a.jsxs)("div",Object.assign({ref:t,className:_r},{children:[(0,a.jsx)("div",Object.assign({className:zr,onClick:r},{children:(0,a.jsx)(qs.a,{})})),(0,a.jsxs)("div",Object.assign({className:Yr},{children:[(0,a.jsx)("span",Object.assign({className:Kr},{children:"Are you sure you want to log out?"})),(0,a.jsx)("button",Object.assign({className:$r,onClick:()=>{r(),s()}},{children:"Logout"}))]}))]}))]})};var Jr=r(38),Xr=function(e,s,r,a){return new(r||(r=Promise))((function(t,n){function i(e){try{d(a.next(e))}catch(e){n(e)}}function l(e){try{d(a.throw(e))}catch(e){n(e)}}function d(e){var s;e.done?t(e.value):(s=e.value,s instanceof r?s:new r((function(e){e(s)}))).then(i,l)}d((a=a.apply(e,s||[])).next())}))};const{wrapper:Gr,wrapperLoggedIn:Qr,wrapperInformation:Zr,wrapperNoLogin:ea,wrapperSignIn:sa,wrapperNavigation:ra,wrapperLogout:aa}={wrapper:"qgTH08x_",wrapperLogout:"iENTJ5fF",wrapperNavigation:"C46DeIwH",wrapperLoggedIn:"urFGy1MA",wrapperNoLogin:"H4gA6_TJ",wrapperSignIn:"e2KbmqOV",wrapperInformation:"wUMVhfyM"};(0,U.createEntrypoint)("account",(({createAccountFromData:e,singInFormData:s,forgotPasswordText:r,resetPasswordFormData:t,provinces:n,addressFromData:i,countries:l,authToken:d,socialLogin:c,publicKey:u})=>{const[m,h]=(0,o.useState)(!1),[w,j]=(0,o.useState)(null),[g,b]=(0,o.useState)(u),[x,v]=(0,o.useState)(c),[f,N]=(0,o.useState)(Y),O=(0,o.useRef)(null),A=(0,o.useRef)(null),y=(0,o.useRef)(null),[T,S]=(0,o.useState)("orders"),[D,P]=(0,o.useState)(d),[k,L]=(0,o.useState)(!1),{isActive:I,toggle:F}=(0,Jr.a)(),C=()=>{L((e=>!e))};ns((()=>{const e=new URL(window.location.href).searchParams.get("view");window.scrollTo({top:0,behavior:"smooth"}),S(null!=e?e:"orders")}));const E=(0,o.useCallback)((e=>Xr(void 0,void 0,void 0,(function*(){var s;if(["login","activate","multipass"].includes(e.detail.action)){const r="activate"===e.detail.action?yield e.detail.customer:e.detail.customer;v(!0),P(null!==(s=null==r?void 0:r.accessToken)&&void 0!==s?s:null),q("socialLogin","true")}else"click"!==e.detail.action&&console.error(`unhandled action ${e.detail.action}`)}))),[]);(0,o.useEffect)((()=>{if(g&&O.current&&"undefined"!=typeof window){if(!document.querySelector(`script[src*="${f}"]`)){const e=document.createElement("script");e.src=`https://apps.hiko.link${f}`,e.async=!0,e.onload=()=>window.HIKO.render(O.current,$,g),document.head.appendChild(e)}var e;e=()=>{"undefined"!=typeof window&&(window.HIKO.logout(),window.HIKO.render(O.current,$,g))},"undefined"!=typeof window&&(A.current=e),"undefined"!=typeof window&&(y.current=()=>{if("undefined"==typeof window)return;const e=document.querySelector(`script[src*="${f}"]`);e&&(e.remove(),window.HIKO.release(),N(`${Y}?t=${Date.now()}`))})}}),[]),(0,o.useEffect)((()=>(document.addEventListener("hiko",E),()=>document.removeEventListener("hiko",E))),[]);const M=(e,s)=>Xr(void 0,void 0,void 0,(function*(){try{if(!e)return;const r=yield(0,U.getLazyState)("getCustomerDetail",{accessToken:e,socialLogin:x});if(j(r),h(!0),d)return;P(e),q("authToken",e,s),(null==r?void 0:r.id)&&(null==r?void 0:r.email)&&(q("userID",r.id,s),q("userEmail",r.email,s))}catch(e){console.error("Error fetching customer details:",e)}}));(0,o.useEffect)((()=>{if(!m)return;const e=new URL(window.location.href);e.searchParams.set("view","orders"),S("orders"),window.history.pushState({},"",e.toString())}),[m]);return(0,o.useEffect)((()=>{D&&M(D)}),[D,x]),(0,a.jsx)("div",Object.assign({className:Gr},{children:m?w?(ls(w.email),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",Object.assign({className:Qr},{children:[(0,a.jsx)("button",Object.assign({className:aa,onClick:F},{children:"Log out"})),(0,a.jsxs)("div",Object.assign({className:ra},{children:[(0,a.jsx)(ne,{userFirstName:w.firstName}),(0,a.jsx)(xs,{currentTab:T})]})),(0,a.jsxs)("div",Object.assign({className:Zr},{children:[(0,a.jsx)("div",{children:"orders"===T&&(0,a.jsx)(ms,{orders:w.orders,firstName:w.firstName,lastName:w.lastName})}),"profile"===T&&(0,a.jsx)(Rr,{email:w.email,defaultAddress:w.defaultAddress,tags:w.tags,addresses:w.addresses,customerAccessToken:D,addressFromData:i,countries:l,provinces:n,socialLogin:x}),(0,a.jsx)("div",Object.assign({style:{display:"rewards"===T?"block":"none"}},{children:(0,a.jsx)(ks,{userId:w.id,email:w.email})}))]}))]})),(0,a.jsx)(Vr,{showModal:I,handleLogout:()=>Xr(void 0,void 0,void 0,(function*(){h(!1),j(null),z("authToken"),z("userID"),z("userEmail"),z("socialLogin");const e=window.location.origin+window.location.pathname;window.history.pushState(null,"",e),window.history.replaceState(null,"",e),setTimeout((()=>{window.location.replace(e)}),50)})),handleShowModal:F})]})):null:(0,a.jsxs)("div",Object.assign({className:(0,p.a)(ea)},{children:[(0,a.jsxs)("div",Object.assign({className:sa},{children:[!k&&(0,a.jsx)(se,{formData:s,forgotPasswordText:r,title:"Sign In",label:"Sign In",onLoginSuccess:M,handleShowResetPassword:C,showResetPassword:k}),(0,a.jsx)("div",{style:{display:k?"none":"block"},id:"hiko-container",ref:O}),k&&(0,a.jsx)(Wr,{title:"Reset your password",label:"Reset Password",formData:t,handleShowResetPassword:C})]})),(0,a.jsx)(Z,{formData:e,title:"Create an account",label:"Create",formType:"create"})]}))}))}))},11:(e,s,r)=>{r.d(s,{a:()=>t});var a=r(2);function t(e,s){(0,a.useEffect)((()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&s(r)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}}),[e,s])}},38:(e,s,r)=>{r.d(s,{a:()=>t});var a=r(2);const t=()=>{const[e,s]=(0,a.useState)(!1),r=(0,a.useCallback)((()=>{s(!0)}),[]),t=(0,a.useCallback)((()=>{s(!1)}),[]);return{isActive:e,toggle:(0,a.useCallback)((()=>{s((e=>!e))}),[e]),setActive:r,setDisabled:t}}}},e=>{e.O(0,[1,2,3,4,5,17],(()=>(181,e(e.s=181)))),e.O()}]);