1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2771],{71310:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return oe},default:function(){return ie}});var r=t(85893),a=t(809),c=t.n(a),o=t(92447),i=t(64121),s=t(67294),l=t(11163),u=t(48633),d=t(39704),f=t(42517),h=t(19755),p=t.n(h),m=t(86337),x=t(39838),v=t(30381),g=t.n(v),b=t(25675),_=t(71470),j=t(23259),k=t(64519),y=function(e){var n=e.label,t=e.id,a=e.name,c=e.value,o=e.maxLength,i=e.leftAddOn,s=e.onChange,l=e.rightAddOn,u=e.readonly,d=void 0!==u&&u,f=function(e){var n=e.target.value;s&&s(n)};return(0,r.jsxs)("div",{className:"fc-input-phone-number",children:[(0,r.jsx)("label",{children:n}),(0,r.jsxs)("div",{className:"fc-input-phone-number-control",children:[(null===i||void 0===i?void 0:i.length)>0&&(0,r.jsx)("div",{className:"fc-input-phone-number-control-left-add-on",children:(0,r.jsx)("span",{children:i})}),(0,r.jsx)("input",{readOnly:d,type:"tel",name:a,id:t,maxLength:o,value:c,onChange:function(e){return f(e)}}),null!=l&&(0,r.jsx)("div",{className:"fc-input-phone-number-control-right-add-on",children:l})]})]})},w=t(9198),S=t.n(w),C=(t(91885),{src:"/_next/static/image/public/images/svg/calendar-clear-outline.d2abe3abfafcf15111d8ba483803e31e.svg",height:17,width:17}),T=t(66437),N=t(68641),Z=t(67555),I=t.n(Z),A=(t(39481),t(33271)),D=t(2714),E=t(12573),O=t(59936),R=t(27807),F={content:{maxWidth:450,maxHeight:320}};var q=function(e){e.locale;var n=e.allowCountries,t=(0,f.$G)(["common","account"]).t,a=(0,d.I0)(),i=e.profileData,l=e.privateToken,u=null,h=((0,s.useContext)(m.n),(0,s.useState)(null)),v=h[0],w=h[1],Z=(0,s.useState)(!1),q=Z[0],L=Z[1],P=(0,s.useState)(null),G=P[0],M=P[1],B=(0,s.useState)(null),z=B[0],W=B[1],H=(0,s.useState)(null),U=H[0],$=H[1],J=(0,s.useState)(""),K=J[0],Y=J[1],V=(0,s.useState)(!0),X=V[0],Q=V[1],ee=(0,s.useState)(""),ne=ee[0],te=ee[1],re=(0,s.useState)(!0),ae=re[0],ce=re[1],oe=(0,s.useState)(""),ie=oe[0],se=oe[1],le=(0,s.useState)(""),ue=le[0],de=le[1],fe=(0,s.useState)(""),he=fe[0],pe=fe[1],me=(0,s.useState)(null),xe=me[0],ve=me[1],ge=(0,s.useState)(1),be=ge[0],_e=ge[1],je=(0,s.useState)(!0),ke=je[0],ye=je[1],we=(0,s.useState)(!1),Se=we[0],Ce=we[1],Te=(0,s.useState)(!1),Ne=Te[0],Ze=Te[1],Ie=(0,s.useState)(""),Ae=Ie[0],De=Ie[1],Ee=(0,s.useState)(""),Oe=Ee[0],Re=Ee[1],Fe=(0,s.useState)(""),qe=(Fe[0],Fe[1]),Le=(0,s.useState)(!0),Pe=Le[0],Ge=Le[1],Me=(0,s.useState)(""),Be=Me[0],ze=Me[1],We=(0,s.useState)(!0),He=We[0],Ue=We[1],$e=(0,s.useState)(!1),Je=$e[0],Ke=$e[1],Ye=(0,s.useState)(!1),Ve=Ye[0],Xe=Ye[1],Qe=[{label:"English",value:1},{label:"\u7b80\u4f53\u4e2d\u6587",value:2},{label:"\u7e41\u9ad4\u4e2d\u6587",value:3}];(0,s.useEffect)((function(){return L(!0),null!=l&&null!=i&&($(i),w(l),setTimeout((function(){L(!1)}),1500)),function(){}}),[l,i]),(0,s.useEffect)((function(){if(null!==U){Y(U.firstname),te(U.lastname),pe(U.primary_email),de(U.mobile_code),se(U.mobile_no),_e(U.preferred_language);var e=g()(U.date_of_birth).isValid()?g()(U.date_of_birth).toDate():null;ve(e),ye(null==e);var n=null===U||void 0===U?void 0:U.receive_marketing_announcement;Xe(n),De(U.mobile_code+U.mobile_no),qe(U.mobile_no),Re(U.mobile_code),ze(U.primary_email)}return function(){}}),[U]);var en=function(){var e=(0,o.Z)(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),M(null),W(null),e.prev=3,n={CustomerId:U.id,FirstName:K,LastName:ne,DateOfBirth:null!=xe?g()(xe).format("YYYY-MM-DD"):"",ReceiveMarketingAnnouncement:Ve,PreferredLanguage:be+""},ye(null==xe),e.next=8,a((0,D.UQ)(v,n));case 8:W(t("account:msg_profile_update_success")),L(!1),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(3),L(!1),M(e.t0.message);case 16:case"end":return e.stop()}}),e,null,[[3,12]])})));return function(){return e.apply(this,arguments)}}(),nn=function(){Ue(!0),Ze((function(e){return!e}))},tn=function(){Ge(!0),Ce((function(e){return!e}))};function rn(){return(rn=(0,o.Z)(c().mark((function e(n){var r,o,i,s,l;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),0!==Be.length){e.next=7;break}return Ue(!1),document.getElementById("update_email").focus(),e.abrupt("return");case 7:return e.prev=7,pn(""),_n(""),L(!0),M(null),W(null),sn(!1),yn(null),e.next=17,a((0,E.t1)(v,{email:Be}));case 17:r=e.sent,Object.keys(r).length>0?(i=(o=r).ExpiryDatetime,s=o.NextSendTime,l=o.Guid,_n(l),setTimeout((function(){An(g()(i).diff(g()(s),"seconds",!0)),L(!1),Ce(!1),Ze(!1),dn(!1),Nn(!0)}),1500)):(M(t("common:message_internal_server_error")),L(!1)),e.next=25;break;case 21:e.prev=21,e.t0=e.catch(7),L(!1),M(e.t0.message);case 25:case"end":return e.stop()}}),e,null,[[7,21]])})))).apply(this,arguments)}function an(){return(an=(0,o.Z)(c().mark((function e(n){var r,o,i,s,l,u,d;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),0!==Ae.length){e.next=7;break}return Ge(!1),p()(".tel-input-control").find("input").focus(),e.abrupt("return");case 7:return e.prev=7,e.next=10,a((0,E.oU)(v,{mobile:Ae}));case 10:if(!0!==(null===(r=e.sent)||void 0===r?void 0:r.IsNew)){e.next=26;break}return o={mobile:Ae,code:Oe},pn(""),_n(""),L(!0),M(null),W(null),sn(!1),yn(null),e.next=22,a((0,E.rT)(v,o));case 22:i=e.sent,Object.keys(i).length>0?(l=(s=i).ExpiryDatetime,u=s.NextSendTime,d=s.Guid,_n(d),setTimeout((function(){vn(g()(l).diff(g()(u),"seconds",!0)),L(!1),Ce(!1),Ze(!1),Nn(!1),dn(!0)}),1500)):(M(t("common:message_internal_server_error")),L(!1)),e.next=28;break;case 26:M(t("account:msg_change_mobile_not_available")),L(!1);case 28:e.next=34;break;case 30:e.prev=30,e.t0=e.catch(7),M(e.t0.message),L(!1);case 34:case"end":return e.stop()}}),e,null,[[7,30]])})))).apply(this,arguments)}
1var cn=(0,s.useState)(!1),on=cn[0],sn=cn[1],ln=(0,s.useState)(!1),un=ln[0],dn=ln[1],fn=(0,s.useState)(""),hn=fn[0],pn=fn[1],mn=(0,s.useState)(null),xn=mn[0],vn=mn[1],gn=(0,s.useState)(""),bn=gn[0],_n=gn[1],jn=(0,s.useState)(null),kn=jn[0],yn=jn[1];(0,s.useEffect)((function(){return xn>0&&(u=setTimeout((function(){vn(xn-1)}),1e3)),function(){clearTimeout(u)}}),[xn]);var wn=function(){var e=(0,o.Z)(c().mark((function e(){var n,r,o,i,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return pn(""),_n(""),L(!0),M(null),W(null),sn(!1),yn(null),e.prev=7,e.next=10,a((0,E.rT)(l,{mobile:Ae}));case 10:n=e.sent,Object.keys(n).length>0?(o=(r=n).ExpiryDatetime,i=r.NextSendTime,s=r.Guid,_n(s),vn(g()(o).diff(g()(i),"seconds",!0)),L(!1)):(M(t("common:message_internal_server_error")),L(!1)),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(7),M(e.t0.message),L(!1);case 18:case"end":return e.stop()}}),e,null,[[7,14]])})));return function(){return e.apply(this,arguments)}}(),Sn=function(){var e=(0,o.Z)(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,L(!0),yn(null),W(null),n={MobileCode:Oe,Mobile:Ae,Code:hn,CustomerId:U.id,Guid:bn},e.next=7,a((0,D.KF)(v,n));case 7:e.sent,setTimeout((function(){dn(!1),L(!1),W("".concat(t("account:msg_mobile_number_changed_to"),"<br />+").concat(Ae)),se(Ae),de(Oe)}),2e3),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),yn(e.t0.message),L(!1);case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Cn=(0,s.useState)(!1),Tn=Cn[0],Nn=Cn[1],Zn=(0,s.useState)(null),In=Zn[0],An=Zn[1];(0,s.useEffect)((function(){return In>0&&(u=setTimeout((function(){An(In-1)}),1e3)),function(){clearTimeout(u)}}),[In]);var Dn=function(){var e=(0,o.Z)(c().mark((function e(){var n,t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return pn(""),_n(""),L(!0),M(null),W(null),sn(!1),yn(null),e.prev=7,e.next=10,a((0,E.t1)(l,{email:Be}));case 10:n=e.sent,t=g()(n.ExpiryDatetime).diff(g()(n.NextSendTime),"seconds",!0),An(t),_n(n.Guid),L(!1),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(7),L(!1),yn(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[7,17]])})));return function(){return e.apply(this,arguments)}}(),En=function(){var e=(0,o.Z)(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,L(!0),yn(null),W(null),n={Email:Be,Code:hn,CustomerId:U.id,Guid:bn},e.next=7,a((0,D.Uk)(v,n));case 7:setTimeout((function(){Nn(!1),L(!1),W("".concat(t("account:msg_email_changed_to"),"<br />").concat(Be)),pe(Be)}),2e3),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),L(!1),yn(e.t0.message);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),On=function(){dn((function(e){return!e}))},Rn=function(){Nn((function(e){return!e}))};return(0,r.jsxs)(r.Fragment,{children:[!0===q&&(0,r.jsx)("div",{className:"overlayBackground",children:(0,r.jsx)(A.Z,{})}),null!==G&&(0,r.jsx)(T.Z,{customStyle:N.fW,isOpen:!0,onRequestClose:function(){M(null)},title:t("common:modal_header_error"),children:(0,r.jsxs)("div",{className:"message-modal-container",children:[(0,r.jsx)("p",{children:G}),(0,r.jsx)("div",{style:{marginTop:40},children:(0,r.jsx)(j.Z,{buttonStyle:{textTransform:"uppercase"},title:t("btn_ok"),onClick:function(){M(null)}})})]})}),null!==z&&(0,r.jsx)(T.Z,{showTitle:!1,customStyle:N.Fq,customBodyStyle:{height:"100%"},isOpen:!0,onRequestClose:function(){W(null)},title:t("common:alert_heading_info"),children:(0,r.jsxs)("div",{className:"message-modal-container",children:[(0,r.jsx)("p",{style:{textAlign:"center"},dangerouslySetInnerHTML:{__html:z}}),(0,r.jsx)("div",{style:{marginTop:40},children:(0,r.jsx)(j.Z,{buttonStyle:{textTransform:"uppercase"},title:t("btn_ok"),onClick:function(){W(null)}})})]})}),(0,r.jsxs)("form",{className:"frmProfile",onSubmit:function(e){return e.preventDefault(),0===K.length?(Q(!1),void document.getElementById("firstname").focus()):0===ne.length?(ce(!1),void document.getElementById("lastname").focus()):void en()},children:[(0,r.jsxs)("div",{className:"form-group-row",children:[(0,r.jsx)(k.Z,{required:!0,label:t("account:label_firstname"),id:"firstname",name:"firstname",value:K,onChange:function(e){Y(e),Q(e.length>0)}}),!1===X&&(0,r.jsx)("span",{className:"has-error",children:t("account:msg_field_is_required")})]}),(0,r.jsxs)("div",{className:"form-group-row",children:[(0,r.jsx)(k.Z,{required:!0,label:t("account:label_lastname"),id:"lastname",name:"lastname",value:ne,onChange:function(e){te(e),ce(e.length>0)}}),!1===ae&&(0,r.jsx)("span",{className:"has-error",children:t("account:msg_field_is_required")})]}),(0,r.jsx)("div",{className:"form-group-row",children:(0,r.jsx)(y,{readonly:!0,label:t("account:label_mobile"),id:"phone_number",name:"phone_number",leftAddOn:"+".concat(ue),rightAddOn:(0,r.jsx)("button",{type:"button",className:"button",onClick:function(){De(U.mobile_code+U.mobile_no),Re(U.mobile_code),tn()},children:t("account:btn_change")}),value:ie})}),(0,r.jsx)("div",{className:"form-group-row",children:(0,r.jsx)(k.Z,{readonly:!0,type:"email",label:t("account:label_email"),id:"email",name:"email",value:he,rightAddOn:(0,r.jsx)("button",{type:"button",className:"button",onClick:function(){ze(U.primary_email),nn()},children:t("account:btn_change")}),onChange:function(e){ze(e)}})}),(0,r.jsx)("div",{className:"form-group-row",children:(0,r.jsxs)("div",{className:"fc-input-text",children:[(0,r.jsx)("label",{children:t("account:label_dob")}),(0,r.jsxs)("div",{className:"fc-datepicker ".concat(ke?"":"is-disabled"),children:[(0,r.jsx)(S(),{className:"fc-input-text-control date-picker",minDate:new Date("1900/01/01"),maxDate:new Date,selected:xe,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:150,readOnly:!0,open:Je,shouldCloseOnSelect:!0,dateFormat:"dd MMM yyyy",onChange:function(e){ve(e),Ke((function(e){return!e}))}}),(0,r.jsx)(b.default,{src:C,width:16,height:16,alt:"",onClick:function(){ke&&Ke((function(e){return!e}))}})]})]})}),(0,r.jsx)("div",{className:"form-group-row",children:(0,r.jsxs)("div",{className:"fc-input-text",children:[(0,r.jsx)("label",{children:t("account:label_preferred_language")}),(0,r.jsx)(R.Z,{id:"preferredlanguage",options:Qe,selectedOption:Qe.find((function(e){return e.value==be})),onChange:function(e){_e(e.value)},className:"fc-common-dropdown-selector",menuStyle:{border:0,boxShadow:"0 4px 7px 0px rgba(0, 0, 0, .1)"}})]})}),(0,r.jsx)("div",{className:"form-group-row",children:(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,r.jsx)("span",{children:t("account:label_agree_opt_in_marketing")})}),(0,r.jsx)(O.default,{onChange:function(){Xe((function(e){return!e}))},checked:Ve,uncheckedIcon:!1,checkedIcon:!1,width:46,height:24,handleDiameter:20,onColor:"#d92c27"})]})}),(0,r.jsx)("div",{style:{width:"100%",margin:"0 auto",marginTop:30,marginBottom:10},children:(0,r.jsx)(j.Z,{buttonStyle:{textTransform:"uppercase"},title:t("account:btn_save"),onClick:function(){}})})]}),(0,r.jsx)(T.Z,{customStyle:F,isOpen:Se,onRequestClose:tn,title:t("account:heading_change_mobile_number"),children:(0,r.jsx)("div",{className:"account-profile-modal-container",children:(0,r.jsxs)("form",{className:"frmVerifyAcc",onSubmit:function(e){return an.apply(this,arguments)},children:[(0,r.jsxs)("div",{className:"form-group-row",children:[(0,r.jsxs)("div",{className:"fc-input-text tel-input-control",children:[(0,r.jsxs)("label",{children:[t("account:label_new_mobile_number")," ",(0,r.jsx)("span",{className:"required",children:"*"})]}),(0,r.jsx)(I(),{autoFormat:!1,enableSearch:!0,disableSearchIcon:!1,countryCodeEditable:!1,
1country:"hk",onlyCountries:n,value:Ae,onChange:function(e,n){var t=e.substr(n.dialCode.length,e.length);qe(t),Re(n.dialCode),De(e),Ge(e.length>0)}})]}),!1===Pe&&(0,r.jsx)("span",{className:"has-error",children:t("account:msg_please_enter_valid_phone")})]}),(0,r.jsxs)("div",{style:{marginTop:20},children:[(0,r.jsx)(j.Z,{title:t("account:btn_next"),onClick:function(){}}),(0,r.jsx)("div",{className:"account-cancel-action",children:(0,r.jsx)("a",{href:"#",onClick:tn,children:t("account:btn_link_cancel")})})]})]})})}),(0,r.jsx)(T.Z,{customStyle:F,isOpen:Ne,onRequestClose:nn,title:t("account:heading_change_email"),children:(0,r.jsx)("div",{className:"account-profile-modal-container",children:(0,r.jsxs)("form",{className:"frmVerifyAcc",onSubmit:function(e){return rn.apply(this,arguments)},children:[(0,r.jsxs)("div",{className:"form-group-row",children:[(0,r.jsx)(k.Z,{required:!0,type:"email",label:t("account:label_new_email"),id:"update_email",name:"update_email",value:Be,onChange:function(e){ze(e);var n=(0,x.oH)(e);Ue(n)}}),!1===He&&(0,r.jsx)("span",{className:"has-error",children:t("account:msg_enter_valid_email")})]}),(0,r.jsxs)("div",{style:{marginTop:20},children:[(0,r.jsx)(j.Z,{title:t("account:btn_next"),onClick:function(){}}),(0,r.jsx)("div",{className:"account-cancel-action",children:(0,r.jsx)("a",{href:"#",onClick:nn,children:t("account:btn_link_cancel")})})]})]})})}),(0,r.jsx)(T.Z,{isOpen:un,onRequestClose:On,title:t("account:heading_otp_verification"),children:(0,r.jsxs)("div",{className:"account-modal-otp-container",children:[(0,r.jsxs)("p",{style:{margin:0,textAlign:"center"},children:[t("account:msg_enter_otp"),(0,r.jsx)("br",{}),"+",Ae]}),(0,r.jsx)("div",{className:"account-otp-input",children:(0,r.jsx)(_.Z,{shouldAutoFocus:!0,value:hn,onChange:function(e){pn(e),sn(!1)},numInputs:4,hasErrored:on,errorStyle:{borderColor:"#d92c27",borderRadius:2,borderWidth:2,borderStyle:"solid"},separator:(0,r.jsx)("span",{children:"\xa0\xa0\xa0"}),isInputNum:!0,inputStyle:{width:48,height:48,borderColor:"#CCCCCC",borderRadius:2,borderWidth:1,borderStyle:"solid"},focusStyle:{borderColor:"#222222",borderRadius:2,borderWidth:2,borderStyle:"solid"}})}),null!==kn&&(0,r.jsx)("div",{style:{textAlign:"center"},children:(0,r.jsx)("span",{className:"has-error",children:kn.replace(/\n/g,"<br>")})}),(0,r.jsxs)("div",{style:{maxWidth:280,margin:"0 auto",marginTop:40},children:[(0,r.jsx)(j.Z,{buttonStyle:{textTransform:"uppercase"},title:t("account:btn_verify_proceed"),onClick:function(){4!=hn.length?sn(!0):Sn()}}),(0,r.jsxs)("div",{className:"account-otp-resend-action",children:[(0,r.jsx)("a",{href:"#",onClick:function(){On()},children:t("account:btn_link_cancel")}),(0,r.jsx)("p",{children:t("account:msg_didnt_received_otp")}),xn>0?(0,r.jsx)("span",{children:"(".concat(xn," ").concat(t("account:seconds"),")")}):(0,r.jsx)("a",{href:"#",onClick:wn,children:"".concat(t("account:msg_resend_code"))})]})]})]})}),null!=he&&(0,r.jsx)(T.Z,{isOpen:Tn,onRequestClose:Rn,title:t("account:heading_otp_verification"),children:(0,r.jsxs)("div",{className:"account-modal-otp-container",children:[(0,r.jsxs)("p",{style:{margin:0,textAlign:"center"},children:[t("account:msg_enter_otp"),(0,r.jsx)("br",{}),Be]}),(0,r.jsx)("div",{className:"account-otp-input",children:(0,r.jsx)(_.Z,{shouldAutoFocus:!0,value:hn,onChange:function(e){pn(e),sn(!1)},numInputs:4,hasErrored:on,errorStyle:{borderColor:"#d92c27",borderRadius:2,borderWidth:2,borderStyle:"solid"},separator:(0,r.jsx)("span",{children:"\xa0\xa0\xa0"}),isInputNum:!0,inputStyle:{width:48,height:48,borderColor:"#CCCCCC",borderRadius:2,borderWidth:1,borderStyle:"solid"},focusStyle:{borderColor:"#222222",borderRadius:2,borderWidth:2,borderStyle:"solid"}})}),null!==kn&&(0,r.jsx)("div",{style:{textAlign:"center"},children:(0,r.jsx)("span",{style:{lineHeight:1.2},className:"has-error",dangerouslySetInnerHTML:{__html:kn.replace(/\\n
1/g,"<br/>")}})}),(0,r.jsxs)("div",{style:{maxWidth:280,margin:"0 auto",marginTop:40},children:[(0,r.jsx)(j.Z,{buttonStyle:{textTransform:"uppercase"},title:t("account:btn_verify_proceed"),onClick:function(){4!=hn.length?sn(!0):En()}}),(0,r.jsxs)("div",{className:"account-otp-resend-action",children:[(0,r.jsx)("a",{href:"#",onClick:function(){Rn()},children:t("account:btn_link_cancel")}),(0,r.jsx)("p",{children:t("account:msg_didnt_received_otp")}),In>0?(0,r.jsx)("span",{children:"(".concat(In," ").concat(t("account:seconds"),")")}):(0,r.jsx)("a",{href:"#",onClick:Dn,children:"".concat(t("account:msg_resend_code"))})]})]})]})})]})},L=t(96328),P=t(87618),G=t(90504),M=t(11752),B=t(80129),z=t.n(B),W=t(9669),H=t.n(W),U=t(18228),$=t.n(U),J=(0,M.default)().publicRuntimeConfig;var K=function(e){e.locale;var n=e.profileData,t=e.authSession,a=e.privateToken,i=(0,f.$G)(["common","account"]).t,l=(0,d.I0)(),h=((0,d.v9)((function(e){return e.customer})).customerProfile,(0,s.useContext)(m.n)),p=(0,s.useState)(null),x=(p[0],p[1]),v=(0,s.useState)(null),g=v[0],_=v[1],k=(0,s.use
1State)(null),y=k[0],w=k[1],S=(0,s.useState)(null),C=S[0],Z=S[1],I=(0,s.useState)(!1),D=I[0],R=I[1],F=(0,s.useState)(!1),q=F[0],M=F[1],B=(0,s.useState)(!1),W=B[0],U=B[1],K=(0,s.useState)(!1),Y=(K[0],K[1]),V=(0,s.useState)(null),X=V[0],Q=V[1],ee=(0,s.useState)(!1),ne=ee[0],te=ee[1];function re(e){return ae.apply(this,arguments)}function ae(){return(ae=(0,o.Z)(c().mark((function e(n){var t,r,a;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={access_token:n},r=z().stringify(t),a={method:"get",url:"https://www.googleapis.com/oauth2/v3/userinfo?".concat(r)},e.abrupt("return",H()(a).then((function(e){return e.data})).catch((function(e){return null})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ce(e,n){return oe.apply(this,arguments)}function oe(){return(oe=(0,o.Z)(c().mark((function e(n,t){var r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{U(!1),Q(null),r={SocialType:J.socialType.google,SocialUserId:n.sub,SocialToken:t,SocialCode:"",SocialEmail:null!=(null===n||void 0===n?void 0:n.email)?null===n||void 0===n?void 0:n.email:""},Promise.all([l((0,E._I)(g,r))]).then((function(){U(!0)})).catch((function(e){Q(e.message),console.log(e)}))}catch(a){Q(a.message),console.log(a)}case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(e){return se.apply(this,arguments)}function se(){return(se=(0,o.Z)(c().mark((function e(n){var t,r,a;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={fields:"id,name,email,first_name,last_name,middle_name",access_token:n},r=z().stringify(t),a={method:"get",url:"https://graph.facebook.com/v11.0/me?".concat(r)},e.abrupt("return",H()(a).then((function(e){return e.data})).catch((function(e){return null})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function le(e,n){return ue.apply(this,arguments)}function ue(){return(ue=(0,o.Z)(c().mark((function e(n,t){var r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Q(null),r={SocialType:J.socialType.facebook,SocialUserId:n.id,SocialToken:t,SocialCode:"",SocialEmail:null!=(null===n||void 0===n?void 0:n.email)?null===n||void 0===n?void 0:n.email:""},e.next=5,l((0,E._I)(g,r));case 5:M(!0),R(!1),e.next=15;break;case 9:e.prev=9,e.t0=e.catch(0),R(!1),M(!1),Q(e.t0.message),console.log(e.t0);case 15:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}(0,s.useEffect)((function(){var e=!0;if(!0===e&&null!=h.webAccessData&&null!=a){var n=h.webAccessData;if(x(n),_(a),null!=t){(0,u.w7)({redirect:!1});var r=t.customToken;Z(r)}(0,o.Z)(c().mark((function t(){var r;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l((0,G.iH)(n));case 2:r=t.sent,e&&te(!0===(null===r||void 0===r?void 0:r.Data));case 4:case"end":return t.stop()}}),t)})))()}return function(){e=!1}}),[h,t]),(0,s.useEffect)((function(){var e,t,r,a,c,o;null!=g&&null!=n&&(w(n),M((null===(e=n.social_facebook_user_id)||void 0===e?void 0:e.length)>0||(null===(t=n.social_facebook_email)||void 0===t?void 0:t.length)>0),U((null===(r=n.social_google_user_id)||void 0===r?void 0:r.length)>0||(null===(a=n.social_google_email)||void 0===a?void 0:a.length)>0),Y((null===(c=n.social_apple_user_id)||void 0===c?void 0:c.length)>0||(null===(o=n.social_apple_email)||void 0===o?void 0:o.length)>0));return function(){}}),[g,n]),(0,s.useEffect)((function(){var e=!0;function n(){return(n=(0,o.Z)(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==C){e.next=8;break}if("google"!==C.provider){e.next=8;break}return e.next=4,re(C.accessToken);case 4:if(null==(n=e.sent)){e.next=8;break}return e.next=8,ce(n,C.idToken);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return null!=C&&void 0!=C&&!0===e&&function(){n.apply(this,arguments)}(),function(){Z(null),e=!1}}),[C]);var de=function(){var e=(0,o.Z)(c().mark((function e(n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,R(!0),"Google"!==n){e.next=14;break}if(!0!==W){e.next=9;break}return e.next=6,l((0,E.DK)(g,{SocialType:J.socialType.google}));case 6:setTimeout((function(){U(!1),R(!1)}),3e3),e.next=12;break;case 9:return e.next=11,(0,u.zB)("google",{callbackUrl:"/account/profile/"});case 11:e.sent;case 12:e.next=19;break;case 14:if("Facebook"!==n){e.next=19;break}if(!0!==q){e.next=19;break}return e.next=18,l((0,E.DK)(g,{SocialType:J.socialType.facebook}));case 18:setTimeout((function(){M(!1),R(!1)}),3e3);case 19:e.next=25;break;case 21:e.prev=21,e.t0=e.catch(0),R(!1),console.log(e.t0);case 25:case"end":return e.stop()}}),e,null,[[0,21]])})));return function(n){return e.apply(this,arguments)}}(),fe=function(){var e=(0,o.Z)(c().mark((function e(n){var t,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,R(!0),!0!==q){e.next=8;break}return e.next=5,l((0,E.DK)(g,{SocialType:J.socialType.facebook}));case 5:setTimeout((function(){M(!1),R(!1)}),3e3),e.next=22;break;case 8:if(null===n){e.next=21;break}return t=n.accessToken,e.next=12,ie(t);case 12:if(null==(r=e.sent)){e.next=18;break}return e.next=16,le(r,t);case 16:e.next=19;break;case 18:window.location.reload();case 19:e.next=22;break;case 21:window.location.href="/500/";case 22:e.next=28;break;case 24:e.prev=24,e.t0=e.catch(0),R(!1),console.log(e.t0);case 28:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(n){return e.apply(this,arguments)}}();return(0,r.jsxs)(r.Fragment,{children:[null!==X&&(0,r.jsx)(T.Z,{customStyle:N.fW,isOpen:!0,onRequestClose:function(){Q(null)},title:i("common:modal_header_error"),children:(0,r.jsxs)("div",{className:"error-modal-container",children:[(0,r.jsx)("p",{children:X}),(0,r.jsx)("div",{style:{marginTop:40},children:(0,r.jsx)(j.Z,{buttonStyle:{textTransform:"uppercase"}
1,title:i("btn_ok"),onClick:function(){Q(null)}})})]})}),null!=g&&null!=y&&null===X&&(0,r.jsxs)("div",{style:{position:"relative",zIndex:10},children:[!0===D&&(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:0,left:0,width:"100%",zIndex:30,height:"100%",background:"rgb(255,255,255,0.85)"},children:(0,r.jsx)(A.Z,{})}),(0,r.jsx)("h2",{children:i("account:heading_link_accounts")}),(0,r.jsxs)("div",{style:{position:"relative",zIndex:10},children:[ne&&(0,r.jsxs)("button",{className:"btn-social-account",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,r.jsx)(b.default,{src:L.Z,width:24,height:24,alt:""}),(0,r.jsx)("span",{children:i("account:facebook")})]}),q?(0,r.jsx)(O.default,{onChange:function(){de("Facebook")},checked:q,uncheckedIcon:!1,checkedIcon:!1,width:46,height:24,handleDiameter:20,onColor:"#d92c27"}):(0,r.jsx)($(),{appId:"438128679244051",autoLoad:!1,fields:"public_profile,email",callback:fe,render:function(e){return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(O.default,{onChange:e.onClick,checked:q,uncheckedIcon:!1,checkedIcon:!1,width:46,height:24,handleDiameter:20,onColor:"#d92c27"})})}})]}),(0,r.jsxs)("button",{className:"btn-social-account",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,r.jsx)(b.default,{src:P.Z,width:24,height:24,alt:""}),(0,r.jsx)("span",{children:i("account:google")})]}),(0,r.jsx)(O.default,{onChange:function(){de("Google")},checked:W,uncheckedIcon:!1,checkedIcon:!1,width:46,height:24,handleDiameter:20,onColor:"#d92c27"})]})]})]})]})},Y=t(97366),V=t(7498),X=t(57768),Q=t(81489),ee={content:{maxWidth:500,maxHeight:750}};var ne=function(e){e.locale;var n=e.allowCountries,t=e.profileData,a=e.privateToken,i=(0,f.$G)(["common","account"]).t,l=(0,d.I0)(),u=((0,s.useContext)(m.n),(0,s.useState)(null)),h=u[0],p=u[1],x=(0,s.useState)(!1),v=x[0],g=x[1],_=(0,s.useState)(null),k=_[0],y=_[1],w=(0,s.useState)(null),S=w[0],C=w[1],Z=(0,s.useState)(null),I=Z[0],E=Z[1],O
1=(0,s.useState)(null),R=(O[0],O[1],(0,s.useState)([])),F=R[0],q=R[1],L=(0,s.useState)(!1),P=L[0],G=L[1],M=(0,s.useState)(""),B=M[0],z=M[1],W=(0,s.useState)(null),H=W[0],U=W[1];(0,s.useEffect)((function(){if(g(!0),null!=a&&null!=t){E(t),p(a);var e=t.delivery_addresses.sort((function(e,n){return e.is_default===n.is_default?0:e.is_default?-1:n.is_default?1:void 0}));q(e),setTimeout((function(){g(!1)}),1e3)}return function(){}}),[a,t]);var $=function(){G((function(e){return!e}))};function J(){return(J=(0,o.Z)(c().mark((function e(n){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),y(null),C(null),e.prev=3,t={id:n},e.next=7,l((0,D.iH)(h,t));case 7:setTimeout((function(){K(i("account:msg_delete_address_success"))}),1500),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(3),g(!1),y(e.t0.message);case 14:case"end":return e.stop()}}),e,null,[[3,10]])})))).apply(this,arguments)}function K(e){return Y.apply(this,arguments)}function Y(){return(Y=(0,o.Z)(c().mark((function e(n){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,y(null),e.next=4,l((0,D.Ai)(h));case 4:return t=e.sent,e.next=7,ne();case 7:E(t),C(n),g(!1),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),g(!1),y(e.t0.message);case 16:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}function ne(){return te.apply(this,arguments)}function te(){return(te=(0,o.Z)(c().mark((function e(){var n,t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,g(!0),y(null),e.next=5,l((0,D.N5)(h));case 5:(null===(n=e.sent)||void 0===n?void 0:n.length)>0?(t=n.sort((function(e,n){return e.is_default===n.is_default?0:e.is_default?-1:n.is_default?1:void 0})),q(t)):q([]),g(!1),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),g(!1),y(e.t0.message);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}var re=function(e){var n,t,a,c=null,o=null;a=(0,r.jsxs)(r.Fragment,{children:[e.ReceiverFullName," +",e.MobileCode,e.PhoneNumber,(0,r.jsx)("br",{})]}),(null===(n=e.District)||void 0===n?void 0:n.length)>0&&(c=(0,r.jsxs)(r.Fragment,{children:[null===e||void 0===e?void 0:e.District,(0,r.jsx)("br",{})]})),(null===(t=e.StreetAddress)||void 0===t?void 0:t.length)>0&&(o=(0,r.jsxs)(r.Fragment,{children:[e.StreetAddress,(0,r.jsx)("br",{})]}));var s=i("account:label_home");return 3===parseInt(e.AddressType)?s=i("account:label_landed"):2===parseInt(e.AddressType)&&(s=i("account:label_work")),(0,r.jsxs)("div",{className:"profile-address-container",children:[(0,r.jsx)("div",{style:{width:"95%"},children:(0,r.jsx)("a",{onClick:function(){U(e)},children:(0,r.jsxs)("address",{children:[(0,r.jsxs)("span",{style:{display:"block",fontWeight:700},children:["(",s,")"]}),null!=a&&a,null!=c&&c,null!=o&&o]})})}),(0,r.jsx)("a",{href:"#",onClick:function(n){window.confirm("".concat(i("account:msg_confirmation_delete_address")))&&function(e){J.apply(this,arguments)}(e.Id)},children:(0,r.jsx)(b.default,{src:Q.Z,width:16,height:16,alt:""})})]},e.Id)};return(0,s.useEffect)((function(){return null!=H&&(z("EDIT"),$()),function(){}}),[H]),(0,r.jsxs)(r.Fragment,{children:[!0===v&&(0,r.jsx)("div",{className:"overlayBackground",children:(0,r.jsx)(A.Z,{})}),null!==k&&(0,r.jsx)(T.Z,{customStyle:N.fW,isOpen:!0,onRequestClose:function(){y(null)},title:i("common:modal_header_error"),children:(0,r.jsxs)("div",{className:"message-modal-container",children:[(0,r.jsx)("p",{children:k}),(0,r.jsx)("div",{style:{marginTop:40},children:(0,r.jsx)(j.Z,{buttonStyle:{textTransform:"uppercase"},title:i("btn_ok"),onClick:function(){y(null)}})})]})}),null!==S&&(0,r.jsx)(T.Z,{showTitle:!1,customStyle:N.Fq,customBodyStyle:{height:"100%"},isOpen:!0,shouldCloseOnOverlayClick:!1,onRequestClose:function(){C(null)},title:i("common:alert_heading_info"),children:(0,r.jsxs)("div",{className:"message-modal-container",children:[(0,r.jsx)("p",{style:{textAlign:"center"},dangerouslySetInnerHTML:{__html:S}}),(0,r.jsx)("div",{style:{marginTop:40},children:(0,r.jsx)(j.Z,{buttonStyle:{textTransform:"uppercase"},title:i("btn_ok"),onClick:function(){C(null)}})})]})}),null!=I&&(0,r.jsxs)(r.Fragment,{children:[(null===F||void 0===F?void 0:F.length)>0&&(0,r.jsx)(r.Fragment,{children:F.map((function(e){return re(e)}))}),(0,r.jsx)("div",{style:{maxWidth:240,margin:"0 auto",marginTop:20,marginBottom:10},children:(0,r.jsx)(X.Z,{title:i("account:btn_add_address"),onClick:function(){z("ADD"),$()}})}),(0,r.jsx)(T.Z,{customStyle:ee,isOpen:P,onRequestClose:function(){$(),U(null)},title:i("ADD"===B?"account:heading_add_delivery_address":"account:heading_edit_delivery_address"),children:(0,r.jsx)("div",{className:"profile-modal-add-address-container",children:(null===n||void 0===n?void 0:n.length)>0&&void 0!=n&&(0,r.jsx)(V.Z,{allowCountries:n,onSubmit:function(e){var n=e.isError,t=e.data;U(null),G(!1),!0===n?y(t):(g(!0),K(t))},locale:e.locale,profileData:I,privateToken:h,mode:B,selectedAddress:H,onClick:function(){G(!1)}})})})]})]})},te=t(80221),re=t(18847),ae=(0,M.default)().publicRuntimeConfig,ce=ae.cookiesConstant,oe=(ae.mode,!0),ie=function(e){var n=(0,f.$G)(["common","account"]).t,t=(0,d.I0)(),a=((0,l.useRouter)(),e.privateAccessToken),h=e.isLoggedIn,p=e.siteLangs,m=e.isRequiredCompleteProfile,x=(0,u.kP)(),v=(0,i.Z)(x,2),g=v[0],b=(v[1],(0,d.v9)((function(e){return e.customer}
1)).customerProfile,(0,s.useState)(!0)),_=b[0],k=b[1],y=(0,s.useState)(null),w=y[0],S=y[1],C=(0,s.useState)(null),Z=(C[0],C[1]),I=(0,s.useState)(null),O=I[0],R=I[1],F=(0,s.useState)(null),L=F[0],P=F[1],M=(0,s.useState)(!1),B=M[0],z=M[1],W=(0,s.useState)(null),H=W[0],U=W[1],$=(0,s.useState)([]),J=($[0],$[1]),V=function(){var e=(0,o.Z)(c().mark((function e(n){var r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,null==n){e.next=6;break}return e.next=4,t((0,G.L8)(n));case 4:(null===(r=e.sent)||void 0===r?void 0:r.length)>0&&void 0!=r?U(r):window.location.href="/500/";case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),window.location.href="/500/";case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(n){return e.apply(this,arguments)}}();function Q(){return ee.apply(this,arguments)}function ee(){return(ee=(0,o.Z)(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(E.GK());case 3:(n=e.sent).length>0&&(n[0].isError||(window.localStorage.setItem("userPublicToken",null!==n[0].data?JSON.stringify(n[0].data):""),console.log("set public token"))),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log("renewPublicToken",e.t0.message);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function ae(){return oe.apply(this,arguments)}function oe(){return(oe=(0,o.Z)(c().mark((function e(){var n,t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k(!0),n=JSON.stringify({myCart:[]}),t=JSON.stringify({myBuyLaterCart:[]}),window.localStorage.setItem("_cartSession",n),window.localStorage.setItem("_cartBuyLaterSession",t),window.localStorage.removeItem("_deliveryLoc"),ie(),e.t0=Promise,e.next=8,Q();case 8:e.t1=e.sent,e.t2=[e.t1],e.t0.all.call(e.t0,e.t2).then((function(e){console.log("Promise Done",e),setTimeout((function(){(0,u.w7)({callbackUrl:"/"})}),1500)}));case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,s.useEffect)((function(){function e(){return(e=(0,o.Z)(c().mark((function e(){var r,a,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,k(!0),Z(null),e.next=5,t((0,D.N5)(L));case 5:return(null===(r=e.sent)||void 0===r?void 0:r.length)>0&&J(r),e.next=9,n();case 9:a=e.sent,(o=a).delivery_addresses=(null===r||void 0===r?void 0:r.length)>0?r:[],R(o),k(!1),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),k(!1),Z(e.t0.message);case 20:case"end":return e.stop()}}),e,null,[[0,16]])})))).apply(this,arguments)}function n(){return r.apply(this,arguments)}function r(){return(r=(0,o.Z)(c().mark((function e(){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,k(!0),Z(null),e.next=5,t((0,D.Ai)(L));case 5:return n=e.sent,e.abrupt("return",n);case 9:e.prev=9,e.t0=e.catch(0),e.t0.message.includes("401")?(0,te.N)():(k(!1),Z(e.t0.message));case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}return null!=L&&!0===B&&(R(null),J([]),function(){e.apply(this,arguments)}()),function(){}}),[L,B]),(0,s.useEffect)((function(){var e=!0;return!0===e&&(S(null),!0===m&&S(n("account:msg_account_incomplete")),!0===h?(k(!1),z(!0),P(a),V(a)):window.location.href="/account/signin/"),function(){e=!1}}),[]);var ie=function(){var e=(0,o.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:document.cookie="".concat(ce.cookiesAuth_accessToken,"=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/"),document.cookie="".concat(ce.cookiesAuth_tokenType,"=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/"),document.cookie="".concat(ce.cookiesAuth_expires,"=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/"),document.cookie="".concat(ce.cookiesAuth_isLogin,"=0;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/"),document.cookie="".concat(ce.cookiesAuth_refreshToken,"=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/");case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),se=(0,s.useCallback)((0,o.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==L){e.next=21;break}return e.prev=1,Z(null),k(!0),e.next=6,t((0,D.Rc)(L));case 6:if(!0!==e.sent){e.next=13;break}return e.next=10,window.localStorage.clear();case 10:ae(),e.next=15;break;case 13:Z(n("common:msg_unable_process_your_request")),k(!1);case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(1),k(!1),Z(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[1,17]])}))),[L]);return(0,r.jsxs)(r.Fragment,{children:[!0===_&&(0,r.jsx)("div",{className:"overlayBackgroun
1d",children:(0,r.jsx)(A.Z,{})}),null!==w&&(0,r.jsx)(T.Z,{showTitle:!1,customStyle:N.ty,customBodyStyle:{height:"100%"},isOpen:!0,shouldCloseOnOverlayClick:!1,onRequestClose:function(){S(null)},title:n("common:alert_heading_info"),children:(0,r.jsxs)("div",{className:"message-modal-container",children:[(0,r.jsx)("p",{style:{textAlign:"center"},dangerouslySetInnerHTML:{__html:w}}),(0,r.jsxs)("div",{style:{marginTop:40},children:[(0,r.jsx)(j.Z,{buttonStyle:{textTransform:"uppercase",marginBottom:20},title:n("btn_continue"),onClick:function(){window.location.href="".concat("zh-HK"==(null===p||void 0===p?void 0:p.lang)?"/":"/".concat(null===p||void 0===p?void 0:p.lang,"/"),"account/complete-profile/")}}),(0,r.jsx)(X.Z,{title:n("btn_logout"),onClick:ae})]})]})}),null!=O&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"account-container main",children:(0,r.jsx)("div",{className:"container",children:(0,r.jsxs)("div",{className:"main-container",children:[(0,r.jsxs)("div",{className:"main-profile-container",children:[(0,r.jsx)(Y.Z,{locale:p,profileData:O,privateToken:a}),(0,r.jsx)(re.Z,{isAffiliate:O.affiliate,privateTokenData:a,activeMenu:0,onLogoutPress:ae,onDeleteAccountPress:function(){window.confirm("".concat(n("account:msg_confirmation_delete_account")))&&se()}})]}),null===w&&(0,r.jsxs)("div",{className:"main-member-profile-container",children:[(0,r.jsx)("h2",{children:n("account:edit_profile")}),(0,r.jsxs)("div",{className:"profile-edit-container",children:[(0,r.jsxs)("div",{className:"profile-user-info-container",children:[(0,r.jsx)("div",{className:"profile-form-container",children:null!=H&&(0,r.jsx)(q,{allowCountries:H,locale:p,profileData:O,privateToken:a})}),(0,r.jsx)("div",{className:"profile-social-account-container",children:(0,r.jsx)(K,{locale:p,profileData:O,authSession:g,privateToken:a})})]}),(0,r.jsxs)("div",{className:"profile-address-form-container",children:[(0,r.jsx)("h2",{children:n("account:heading_delivery_address")}),null!=H&&(0,r.jsx)(ne,{allowCountries:H,locale:p,profileData:O,privateToken:a})]})]})]})]})})})})]})}},90504:function(e,n,t){"use strict";t.d(n,{L8:function(){return l},iH:function(){return u}});var r=t(809),a=t.n(r),c=t(92447),o=t(9669),i=t.n(o),s=(0,t(11752).default)().publicRuntimeConfig,l=function(e){return(0,c.Z)(a().mark((function n(){var t,r,c;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=e.access_token,r=e.token_type,c={method:"post",url:"".concat(s.apiEndPoint,"/SignIn/GetSignupCountries"),headers:{Authorization:r+" "+t}},n.abrupt("return",i()(c).then((function(e){var n=e.data,t=[];return null!=n&&n.length>0&&n.map((function(e){t.push(e.CountryCode.toLowerCase())})),t})).catch((function(e){throw new Error(e.message)})));case 3:case"end":return n.stop()}}),n)})))},u=function(e){return(0,c.Z)(a().mark((function n(){var t,r,c;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=e.access_token,r=e.token_type,c={method:"get",url:"".concat(s.apiEndPoint,"/Version/ShowButtonFB"),headers:{Authorization:r+" "+t}},n.abrupt("return",i()(c).then((function(e){return e.data})).catch((function(e){throw new Error(e.message)})));case 3:case"end":return n.stop()}}),n)})))}},39838:function(e,n,t){"use strict";t.d(n,{oH:function(){return a},kt:function(){return c},F7:function(){return o},cO:function(){return i},ZP:function(){return s},b3:function(){return l},SX:function(){return u}});var r=t(64121),a=function(e){return!!e.match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)},c=function(e){var n=e.length>=8,t=!1,r=/^[0-9]\d*$/;if(e.length>0)for(var a=0;a<e.length;a++)if(e[a].match(r)){t=!0;break}var c=!1,o=/^(.*[a-z])$/;if(e.length>0)for(a=0;a<e.length;a++)if(e[a].match(o)){c=!0;break}var i=!1,s=/^(.*[A-Z])$/;if(e.length>0)for(a=0;a<e.length;a++)if(e[a].match(s)){i=!0;break}return{passOneNumber:t,passLength:n,passUpperAndLowerCase:!(!c&&!i),isAllValid:!(!c&&!i||!n||!t)}},o=function(e,n,t){return t.replace(n,e)},i=function(e,n){return e.length>n?e.slice(0,n-1)+"...":e};function s(e){var n=Object.entries(e).filter((function(e){var n=(0,r.Z)(e,2)[1];return void 0!==n&&null!==n})).map((function(e){var n=(0,r.Z)(e,2),t=n[0],a=n[1];return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(String(a)))}));return n.length>0?"?".concat(n.join("&")):""}var l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return!!n.test(e)},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n="",t=5;return e.length<=2?n="".concat(e.charAt(0)).concat("*".repeat(t)):e.length>=2&&(n="".concat(e.charAt(0)).concat("*".repeat(t)).concat(e.charAt(e.length-1))),n}},63157:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/profile",function(){return t(71310)}])},81489:function(e,n){"use strict";n.Z={src:"/_next/static/image/public/images/svg/icons-16-px-trash-outline.734f8e13735b49c74251d4e08ae5c442.svg",height:16,width:16}},96328:function(e,n){"use strict";n.Z={src:"/_next/static/image/public/images/svg/icons8-facebook.373ed29b435cdde833ee555cde1a7047.svg",height:24,width:24}},87618:function(e,n){"use strict";n.Z={src:"/_next/static/image/public/images/svg/icons8-google.7e13f6f74cc4fa52cabea620e9a10225.svg",height:24,width:24}}},function(e){e.O(0,[571,6776,1297,9292,2714,5216,14,7498,9774,2888,179],(function(){return n=63157,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.