"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[7314],{72081:(e,t,o)=>{o.d(t,{A:()=>r,S:()=>l});var n=o(18047),i=o(52837),a=o(40099);function r(e){return a.createElement("svg",(0,n._)({fill:"currentColor"},e,{viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:e.className}),a.createElement("path",{d:"M5.37 15.63V2.49a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v7.67a20.18 20.18 0 1 1-3.9 21.7.96.96 0 0 1 .57-1.27l1.88-.69c.52-.18 1.1.08 1.31.59a16.19 16.19 0 1 0 2.41-16.86h8.87a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7.37a2 2 0 0 1-2-2Z"}))}var l=(0,i.r)(r)},65404:(e,t,o)=>{o.d(t,{A:()=>r,p:()=>l});var n=o(18047),i=o(52837),a=o(40099);function r(e){return a.createElement("svg",(0,n._)({fill:"currentColor"},e,{viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"flip-rtl "+(e.className?e.className:"")}),a.createElement("path",{d:"m19.26 24 13.66-13.67a1 1 0 0 0 0-1.41l-1.84-1.84a1 1 0 0 0-1.41 0L13.46 23.3a1 1 0 0 0 0 1.42l16.2 16.21a1 1 0 0 0 1.42 0l1.84-1.84a1 1 0 0 0 0-1.41L19.26 24Z"}))}var l=(0,i.r)(r)},94054:(e,t,o)=>{o.d(t,{A:()=>r,t:()=>l});var n=o(18047),i=o(52837),a=o(40099);function r(e){return a.createElement("svg",(0,n._)({fill:"currentColor"},e,{viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:e.className}),a.createElement("path",{d:"M26.07 13.03a1 1 0 0 0-1-1h-2.15a1 1 0 0 0-1 1V26.4a1 1 0 0 0 1 1h2.15a1 1 0 0 0 1-1V13.03ZM22.02 35.39c.55.52 1.2.78 1.97.78.8 0 1.45-.26 1.98-.78.54-.52.81-1.17.81-1.94 0-.8-.27-1.45-.81-1.97a2.62 2.62 0 0 0-1.98-.82c-.77 0-1.42.27-1.97.82a2.67 2.67 0 0 0-.78 1.97c0 .77.26 1.42.78 1.94Z"}),a.createElement("path",{d:"M46 24a22 22 0 1 0-44 0 22 22 0 0 0 44 0Zm-4 0a18 18 0 1 1-36 0 18 18 0 0 1 36 0Z"}))}var l=(0,i.r)(r)},81048:(e,t,o)=>{o.r(t),o.d(t,{default:()=>bm});var n=o(24643),i=(o(14713),o(88091)),a=o(73635),r=o(67518),l=o(13392),s=o(73580),d=o(37434),c=o(48615),p=o(48211),u=o(9173),g=o(25616),h=o(88920),m=o(26956),x=o(92264),f=o(97086),b=o(67805),_=o(58305),y=o(95481),v=o(85349),k=o(75792),C=o(31974),j=o(16680),w=o(26475),S=o(57432),T=o.n(S),L=o(40099),P=o(95719),M=o(32125),A=o(75431),E=o(64336),F=o(58632),I=o(46955),H=o(93411),z=o(47172),D=o(90523);const R=e=>{const{history:t,location:o,isMemoryRouter:i}=e,{useWouterLocation:a,useWouterSearch:r}=(0,E.zB)(e.history),l=(0,L.useMemo)((()=>({history:t,location:o})),[t,o]),s=(0,n.jsx)(D.C.Provider,{value:l,children:(0,n.jsx)(I.Ix,{hook:a,searchHook:r,children:e.children})});return i?(0,n.jsx)(z.CustomRouterContext.Provider,{value:l,children:s}):s},O=e=>{const{history:t}=e,[o,i]=(0,L.useState)(t.location);return(0,L.useLayoutEffect)((()=>{o!==t.location&&i(t.location);const e=t.listen((e=>{i(e)}));return()=>e()}),[]),(0,n.jsx)(R,{history:t,location:o,isMemoryRouter:!0,children:e.children})},W=e=>{var{path:t,exact:o}=e,i=(0,F.__rest)(e,["path","exact"]);let a;return o||"string"!=typeof t||"*"===t||(a=(0,H.q)(t,!0).pattern),(0,n.jsx)(I.qh,Object.assign({},i,{path:null!=a?a:t,component:i.component}))};function B(e){return Array.isArray(e)?e.flatMap((e=>B(e&&e.type===L.Fragment?e.props.children:e))):[e]}const $=({children:e})=>{const{pathname:t}=(0,E.zy)();for(const o of B(e)){if(!(0,L.isValidElement)(o))continue;const[e,n]=(0,I.Di)(H.q,o.props.path,t,!o.props.exact);if(e)return(0,L.cloneElement)(o,{match:[e,n]})}return null};var U=o(34832),N=o(95701),V=o(40661),G=o(84827);const q={"#app":{justifyContent:"center"},"#loginContainer":{display:"flex",alignItems:"center",flexDirection:"column"}},K=e=>({body:{boxSizing:"border-box"},".date-selector .rmc-picker":{height:"250px"},".date-selector .rmc-picker:first-of-type":{position:"absolute",right:e?"unset":0,left:e?"0":"unset",width:"33.3333%"},".date-selector .rmc-picker-indicator":{height:"50px"},".date-selector .rmc-picker-item":{height:"50px",lineHeight:"50px",color:"#161823"},".date-selector":{width:"66%"}});var Z=o(70261),Q=o(62186),J=o(72153),Y=o(97397);const X=(0,Q.default)("div",{target:"esqadv70"})((({theme:e})=>({background:e.colors.BGPrimary,borderRadius:"8px",width:e.isMobile?"300px":"400px",padding:"32px"})),"label:DivContainer;"),ee=(0,Q.default)("h5",{target:"esqadv71"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"24px",lineHeight:"36px",textAlign:"center",margin:"0"}]),"label:H5Title;"),te=(0,Q.default)("p",{target:"esqadv72"})([({theme:e})=>(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{lineHeight:"17px",margin:"16px 0px 24px",textAlign:"center",fontSize:"14px"}],"label:PDesc;"),oe=(0,Q.default)("div",{target:"esqadv73"})({display:"flex",flexDirection:"column"},"label:DivButtonWrapper;"),ne=(0,Q.default)(Y.y,{target:"esqadv74"})({minWidth:"auto",flex:"1",":last-child":{marginTop:"12px"}},"label:StyledButton;"),ie=(0,L.memo)((()=>{const e=(0,g.s)("WebApp_Login"),t=(0,s.Nj)(C.$F),[{showReactiveModal:o,inCancellationResponse:i},{setShowReactiveModal:a,cancelDeleteAccount:r}]=(0,l.Su)(Z.$),d=(0,L.useCallback)((()=>{a({show:!1});const e=(null==i?void 0:i.apply_time)?Math.floor((Date.now()-1e3*i.apply_time)/24/60/60/1e3):null;t.reactiveCancelClick({is_delete:(null==i?void 0:i.isStopAccount)?0:1,num_days_reactive:e})}),[a,t,null==i?void 0:i.isStopAccount,null==i?void 0:i.apply_time]),c=(0,L.useCallback)((()=>{const e=(null==i?void 0:i.apply_time)?Math.floor((Date.now()-1e3*i.apply_time)/24/60/60/1e3):null;t.reactiveConfirmClick({is_delete:(null==i?void 0:i.isStopAccount)?0:1,num_days_reactive:e}),r()}),[r,null==i?void 0:i.apply_time,null==i?void 0:i.isStopAccount,t]);return(0,n.jsx)(y.aF,{visible:o,maskCloseable:!1,onClose:d,children:(0,n.jsxs)(X,{children:[(0,n.jsx)(ee,{children:e("reactivate_h1")}),(0,n.jsx)(te,{children:e("logback_reactivate_desc")}),(0,n.jsxs)(oe,{children:[(0,n.jsx)(ne,{size:"large",buttonTheme:"primary",onClick:c,children:e("reactivate_btn")}),(0,n.jsx)(ne,{size:"large",onClick:d,children:e("common_registration_phone_input_popup_button")})]})]})})}));var ae=o(12527);const re=(0,Q.default)("div",{target:"e1lgic6i0"})({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",marginTop:"40px",fontWeight:600},"label:DivBack;");re.defaultProps=Object.assign(Object.assign({},re.defaultProps),{"data-e2e":"back-btn"});const le=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),t=(0,j.mZ)((e=>e.loginModalShow)),o=(0,E.W6)(),i=(0,E.W5)([k.tH.loginQRcode,k.tH.loginPhoneOrEmail,k.tH.signupPhoneOrEmail]),a=(0,L.useCallback)((()=>{o.goBack()}),[o]),r=(0,L.useCallback)((e=>{13===e.keyCode&&o.goBack()}),[o]);return t||!i?null:(0,n.jsxs)(re,{onClick:a,onKeyDown:r,tabIndex:0,role:"link",children:[(0,n.jsx)(ae.A,{}),e("common_login_back")]})}));var se=o(55462),de=o(60484),ce=o(3089),pe=o(66909),ue=o(49057),ge=o(33805),he=o(71281),me=o(90341),xe=o(35267),fe=o(68252),be=o(67937),_e=o(87702),ye=o(4474),ve=o(94777);const ke=(0,Q.default)("div",{target:"e1vllrfx0"})((({theme:e})=>[{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"20px",fontWeight:"semibold",lineHeight:"130%",letterSpacing:"0.093px",cursor:"pointer",color:e.colors.TextPrimary,fontFamily:"TikTokFont"}]),"label:DivShowMore;");ke.defaultProps=Object.assign(Object.assign({},ke.defaultProps),{"data-e2e":"see-more-btn"});const Ce=(0,Q.default)("div",{target:"e1vllrfx1"})((({theme:e})=>({display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",marginBottom:"10px",gap:e.isMobile?"8px":"12px"})),"label:DivIconButtonListContainer;"),je=(0,Q.default)("div",{target:"e1vllrfx2"})((({theme:e})=>[{width:"28px",height:"28px",display:"flex",marginInlineStart:"-4px",justifyContent:"center",alignItems:"center",fill:e.colors.BGSecondary,border:"1px solid",borderColor:e.colors.LineSecondary,borderRadius:"14px",cursor:"pointer",transform:"ltr"===e.direction?"unset":"rotateY(180deg)","> *":{color:e.colors.TextTertiaryAlt}}]),"label:DivIconShowMore;"),we=(0,Q.default)("div",{target:"e1vllrfx3"})((({theme:e})=>[{width:"28px",height:"28px",display:"flex",marginInlineEnd:"-4px",justifyContent:"center",alignItems:"center",fill:e.colors.BGSecondary,border:"1px solid",borderColor:e.colors.LineSecondary,borderRadius:"14px",cursor:"pointer",transform:"ltr"===e.direction?"unset":"rotateY(180deg)","> *":{color:e.colors.TextTertiaryAlt}}]),"label:DivIconShowLess;"),Se=(0,Q.default)("div",{target:"e1vllrfx4"})((({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid",borderColor:"rgba(22, 24, 35, .12)",borderRadius:"50%",cursor:"pointer",width:e.isMobile?"54px":"62px",height:e.isMobile?"54px":"62px","&:hover":{opacity:.8}})),"label:DivIconButton;");var Te=o(94337);const Le={loginHome:"login",loginPhoneOrEmail:"login",loginPhone:"login",loginEmail:"login",loginPhonePassword:"login",loginDownloadApp:"login",loginTwoStepVerify:"login",loginForgetEmailPassword:"login",loginForgetPhonePassword:"login",loginQRcode:"login",loginSSO:"login",loginWithSignedEmail:"login",loginPhoneDigit:"login",loginReset:"login",loginGuestMode:"login",tvLoginHome:"login",tvLoginEmail:"login",tvLoginPhone:"login",phoneResetDigit:"login",emailResetDigit:"login",resetPassword:"login",signupHome:"signup",signupPhoneOrEmail:"signup",signupPhone:"signup",signupEmail:"signup",signupAgeGate:"signup",signupAgeGateConfirm:"signup",signupPolicyConfirm:"signup",signupCreateAccount:"signup",signupCreateUsername:"signup",signupCreatePassword:"signup",signupPrivateOn:"signup",signupPhoneDigit:"signup",signupEmailDigit:"signup",signupEmailCreatePassword:"signup",signupCountrySelector:"signup",signupInterestSelector:"signup",oauth:"delay_start_until_manually_called",oauthLine:"delay_start_until_manually_called",accountDeactivate:"delay_start_until_manually_called",logout:"delay_start_until_manually_called",linkPhoneOrEmail:"delay_start_until_manually_called",linkPhone:"delay_start_until_manually_called",linkEmail:"delay_start_until_manually_called",linkPhoneDigit:"delay_start_until_manually_called",linkEmailDigit:"delay_start_until_manually_called"},Pe=e=>{const t=(0,k.Bd)(e);return t&&t.name in Le?Le[t.name]:"unknown"},Me=(e=!0)=>{const t=Te.Mh.useInstance(),o=(0,se.sZ)();return(0,L.useEffect)((()=>{!o&&e&&t.reportActualFMP()}),[t,e,o]),(0,L.useCallback)((()=>{o||t.reportActualFMP()}),[t,o])};var Ae=o(45596),Ee=o(30721),Fe=o(84987);const Ie={id:"logo-with-text-34b02873",use:"logo-with-text-34b02873-usage",viewBox:"0 0 150 37",content:''};function He(e){const t=(0,L.useContext)(Fe.X);return(0,L.useLayoutEffect)((()=>(t.add(Ie),()=>{t.remove("logo-with-text-34b02873")})),[]),(0,n.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,n.jsx)("use",{xlinkHref:"#logo-with-text-34b02873"},void 0)}),void 0)}var ze=o(32877),De=o.n(ze),Re=o(88874),Oe=o(64319),We=o(10336);function Be(e,t){return(0,l.Ph)(Oe.t,{selector:t=>{const o=t;return De()(o,...e())},dependencies:t})}function $e(){const{ttpConfig:e}=Be((()=>["ttpConfig"]),[]);let t=null;return(0,f.fU)()||(t=(0,Re.YI)(We.dI)),(0,L.useMemo)((()=>Object.assign(Object.assign({},null==t?void 0:t.config.ttpConfig),e)),[e,t])}var Ue=o(21189),Ne=o(42204);const Ve=(0,Q.default)("a",{target:"e15g97fd0"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont"}),{fontWeight:600,fontSize:"14px",lineHeight:"17px",display:"flex",alignItems:"center",WebkitTapHighlightColor:"transparent","&:focus":{outline:"none"},"&:focus-visible":{outline:`2px solid ${e.colors.Negative}`}}]),"label:AHelpTag;");Ve.defaultProps=Object.assign(Object.assign({},Ve.defaultProps),{"data-e2e":"feedback-entrance"});const Ge="24px",qe=(0,Q.default)(Ue.A,{target:"e15g97fd1"})((({isMobileUiOptimize:e,theme:t})=>[{width:e?Ge:"20px",height:e?Ge:"20px",color:t.colors.TextPrimary,transform:"rtl"===t.direction?"rotateY(180deg)":"unset"},t.isMobile&&(0,J.jJ)({min:Ne.L7,style:{width:"32px",height:"32px"}})]),"label:StyledHelpIcon;"),Ke=(0,Q.default)("span",{target:"e15g97fd2"})({marginInlineStart:"7px",color:"TextQuaternary"},"label:SpanHelpText;");var Ze;!function(e){e.ForYou="https://www.tiktok.com/foryou",e.Support="https://support.tiktok.com",e.Feedback="https://www.tiktok.com/feedback"}(Ze||(Ze={}));const Qe=(0,L.memo)((function(){var e;const t=(0,g.s)("WebApp_Login"),{forceLogin:o,phoenix:i}=Be((()=>["forceLogin","phoenix"]),[]),{language:a}=(0,de.L$)((0,ue.W)((()=>["language"]),[])),{isMobile:r}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{isMobileUiOptimize:l}=(0,h.Eo)(),d=function(){const e=(0,s.Nj)(C.$F),t=(0,L.useCallback)((t=>{var o;e.helpCenterClick({texts:(null===(o=t.target)||void 0===o?void 0:o.textContent)||"?",document_title:"login"})}),[e]);return t}(),p=o?`https://support.tiktok.com/${a}`:`https://www.tiktok.com/feedback/?lang=${a}`,u=[k.tH.signupPolicyConfirm,k.tH.signupPrivateOn,k.tH.signupAgeGateConfirm,k.tH.signupCreateAccount];return(null===(e=(0,E.W5)(u))||void 0===e?void 0:e.isExact)||i?null:(0,n.jsxs)(Ve,{href:p,target:"_blank",rel:"noopener noreferrer",className:"help-center",onClick:d,children:[(0,n.jsx)(qe,{isMobileUiOptimize:l&&r}),!r&&(0,n.jsx)(Ke,{children:t("common_registration_feedback")})]})}));var Je=o(93427);const Ye=(0,Q.default)("header",{target:"e1x3uhsi0"})((({isMobileUiOptimize:e,theme:t})=>[{position:"fixed",width:"100%",top:0,left:0,height:e?52:44,background:`${t.colors.BGPrimary}`,padding:"0 16px",zIndex:2},(0,J.jJ)({min:Ne.L7,style:{height:"80px"}})]),"label:HeaderWrapper;"),Xe=(0,Q.default)("div",{target:"e1x3uhsi1"})((({align:e,isMobileUiOptimize:t,theme:o})=>[(0,J.mp)({direction:o.direction,start:"left"===e?"16px":"unset",end:"right"===e?"16px":"unset"}),{display:"flex",alignItems:"center",fontSize:t?"24px":"20px",position:"absolute",top:"12px",gap:"0px 20px"},(0,J.jJ)({min:Ne.L7,style:[{top:"24px"},(0,J.mp)({direction:o.direction,start:"left"===e?"48px":"unset",end:"right"===e?"48px":"unset"})]})]),"label:DivIconGroup;"),et=(0,Q.default)("div",{target:"e1x3uhsi2"})({display:"flex"},"label:DivIcon;"),tt=(0,Q.default)(ae.A,{target:"e1x3uhsi3"})((({theme:e})=>[{transform:"rtl"===e.direction?"rotateZ(180deg)":"unset"},(0,J.jJ)({min:Ne.L7,style:{width:"32px",height:"32px"}})]),"label:StyledBackIcon;"),ot=(0,Q.default)(a.A,{target:"e1x3uhsi4"})([(0,J.jJ)({min:Ne.L7,style:{width:"32px",height:"32px"}})],"label:StyledXMark;"),nt=(0,Q.default)("div",{target:"e1x3uhsi5"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextPrimary"}),{fontSize:"17px",textAlign:"center",lineHeight:"44px",fontWeight:700}]),"label:DivTitle;");nt.defaultProps=Object.assign(Object.assign({},nt.defaultProps),{"data-e2e":"header-text"});const it=(0,Q.default)("div",{target:"e1x3uhsi6"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont"}),{position:"absolute",left:"50%",transform:"translateX(-50%)"},(0,J.jJ)({min:Ne.L7,style:{top:"192px"}}),(0,J.Ee)({max:720,style:{top:"56px"}}),(0,J.Ee)({min:1770,style:{top:"537px"}})]),"label:DivLogoWithText;"),at=({title:e,showClose:t,isSheet:o,showLeft:i=!0,showRight:a=!0,backIcon:r=!0,LeftIcon:l,onClose:d})=>{const{language:c,env:p}=(0,de.L$)((0,ue.W)((()=>["language","env"]),[])),{redirectUrl:u,hideHomePage:g}=Be((()=>["redirectUrl","hideHomePage"]),[]),{isMobileUiOptimize:m}=(0,h.Eo)(),{pathname:x}=(0,E.zy)(),f=(0,Je.$H)(x),_=(0,E.W5)([k.tH.loginPhoneOrEmail])&&g,y=(0,s.Nj)(C.$F),{isTtincar:v}=(0,Ee.Qt)(),j=(0,E.W6)(),w=(0,L.useCallback)((()=>{t?(y.loginNotifyClose({isSignUp:f?"1":"0",e2eInfo:b.nf.getTrackingInfo()}),d?d():(0,Je.ik)(c,"boe"===(null==p?void 0:p.type),u)):j.goBack()}),[j,t,d,c,u,p,Je.$H]),S=(0,L.useCallback)((()=>l?(0,n.jsx)(l,{}):t?(0,n.jsx)(ot,{"data-e2e":"close-btn"}):r?(0,n.jsx)(tt,{"data-e2e":"back-btn"}):null),[l,r,t]),T={isMobileUiOptimize:m};return(0,n.jsxs)(Ye,Object.assign({},T,{children:[!_&&i&&!o&&(0,n.jsx)(Xe,Object.assign({align:"left",onClick:w},T,{children:S()})),!v&&e&&(0,n.jsx)(nt,{children:e}),v&&(0,n.jsx)(it,{children:(0,n.jsx)(He,{width:152,height:35})}),!g&&a&&(0,n.jsxs)(Xe,Object.assign({align:"right"},T,{children:[(0,n.jsx)(Qe,{}),!_&&i&&o&&(0,n.jsx)(et,Object.assign({onClick:w},T,{children:S()}))]}))]}))};var rt=o(71507),lt=o(18047),st=o(52837),dt=(0,st.r)((function(e){return L.createElement("svg",(0,lt._)({fill:"currentColor"},e,{viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:e.className}),L.createElement("path",{d:"M24 12.5a11.5 11.5 0 1 0 7.4 20.31 2.5 2.5 0 1 1 3.2 3.83A16.5 16.5 0 1 1 40.5 24a2.5 2.5 0 0 1-5 0A11.5 11.5 0 0 0 24 12.5Z"}))}));let ct,pt;function ut(e,t,o,n){var i,a;if(e>t)return n;const r=Math.floor((e+t)/2);pt||(ct=document.createElement("canvas"),pt=ct.getContext("2d"));const l=window.getComputedStyle(o),s=null!==(i=l.fontWeight)&&void 0!==i?i:"",d=null!==(a=l.fontFamily)&&void 0!==a?a:"";return pt.font=`${s} ${r}px ${d}`,Math.ceil(pt.measureText(o.innerText).width){r(ut(t,e,i.current,0))}),[e,t]);return(0,L.useEffect)((()=>(window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)})),[s]),(0,L.useEffect)((()=>{r(ut(t,e,i.current,0))}),[e,t,o]),(0,n.jsx)("div",{ref:i,style:l,children:o})},ht="rgb(208, 209, 211)",mt="rgb(227, 227, 229)",xt=({theme:e,buttonTheme:t})=>{switch(t){case"default":return{borderWidth:"1px",borderStyle:"solid",color:e.colors.TextPrimary,borderColor:e.colors.LineSecondary2,backgroundColor:e.colors.BGSecondary2,":hover":{borderColor:ht,backgroundColor:e.colors.BGCreation3},":active":{borderColor:ht,backgroundColor:e.colors.BGMessageIcon},":disabled":{borderColor:mt,backgroundColor:e.colors.BGSecondary2,color:e.colors.TextQuaternary}};case"line":return{borderWidth:"1px",borderStyle:"solid",color:e.colors.Primary,borderColor:e.colors.Primary,backgroundColor:e.colors.BGSecondary2,":hover":{backgroundColor:"rgba(254, 44, 85, 0.06)"},":active":{backgroundColor:"rgba(254, 44, 85, 0.16)"},":disabled":{borderColor:e.colors.LineSecondary2,backgroundColor:e.colors.BGSecondary2,color:e.colors.TextQuaternary,pointerEvents:"none"}};case"coin":return{color:e.colors.ConstTextInverse,backgroundColor:"black",":hover":{},":active":{},":disabled":{}};case"primary":return{border:"none",color:e.colors.ConstTextInverse,backgroundColor:e.colors.Primary,":hover":{background:"linear-gradient(0deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.06)), #FE2C55"},":active":{background:"linear-gradient(0deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12)), #FE2C55"},":disabled":{border:"none",color:e.colors.TextQuaternary,backgroundColor:e.colors.BGInput2,pointerEvents:"none"}};case"secondary":return{border:"none",color:e.colors.TextPrimary,backgroundColor:e.colors.BGSecondary2,":hover":{borderColor:ht,backgroundColor:e.colors.BGCreation3},":active":{borderColor:ht,backgroundColor:e.colors.BGMessageIcon},":disabled":{borderColor:mt,backgroundColor:e.colors.BGSecondary2,color:e.colors.TextQuaternary}};default:return{":hover":{},":active":{},":disabled":{}}}},ft=A.i7` 0%, 100% { opacity: 1; } 50% { opacity: 0.31; } `,bt=(0,Q.default)("div",{target:"e1cgu1qo0"})((({theme:e,isSmallText:t,isPopup:o,isMobileUiOptimize:n,buttonTheme:i="default",showFlashingButton:a})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold",fontFamily:"TikTokFont"}),{fontSize:t?"13px":"15px",borderRadius:"8px",padding:"0 12px",display:"flex",alignItems:"center",justifyContent:"center",height:"44px",position:"relative",cursor:"pointer",marginBottom:o?"8px":"12px",wordBreak:"keep-all",whiteSpace:"nowrap",background:e.colors.BGTertiary,animation:a?`${ft} 0.3s linear 2`:"none"},n&&{marginBottom:o?"":"12px"},e.isMobile&&(0,J.jJ)({min:Ne.aU,style:{height:"72px",marginBottom:"24px",padding:"0 16px",fontSize:"24px"}}),xt({theme:e,buttonTheme:i})]),"label:DivBoxContainer;");bt.defaultProps=Object.assign(Object.assign({},bt.defaultProps),{"data-e2e":"channel-item"});const _t=(0,Q.default)("div",{target:"e1cgu1qo1"})((({theme:e,isMobileUiOptimize:t})=>[(0,J.mp)({direction:e.direction,start:"12px"}),{fontSize:t?"24px":"20px",position:"absolute",display:"flex"},e.isMobile&&(0,J.jJ)({min:Ne.aU,style:[{fontSize:"40px"},(0,J.mp)({direction:e.direction,start:"24px"})]})]),"label:DivIconContainer;"),yt=(0,Q.default)("div",{target:"e1cgu1qo2"})((({theme:e,theme:{direction:t,colors:o}})=>[(0,J.zy)({theme:e,color:"ConstTextInverse"}),{height:"16px",padding:"0 8px",borderRadius:"ltr"===t?"10px 10px 10px 2px":"10px 10px 2px 10px",backgroundColor:o.Secondary,fontSize:"11px",lineHeight:"16px",fontWeight:600,marginTop:"-8px",marginBottom:"-8px",width:"fit-content",marginInlineStart:"auto",marginInlineEnd:"12px",position:"relative",zIndex:1},(0,J.mp)({direction:t})]),"label:DivLastLoginMethodContainer;"),vt=(0,Q.default)("div",{target:"e1cgu1qo3"})((({theme:e})=>[{width:`calc(100% - ${e.isMobile?72:64}px)`,textAlign:"center"}]),"label:DivTextContainer;"),kt=(0,Q.default)("span",{target:"e1cgu1qo4"})({animation:"spin-animation 1s linear infinite",display:"inline-block",width:24,height:24,verticalAlign:"middle"},{"@keyframes spin-animation":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}},"label:SpanSpin;"),Ct=e=>{const{text:t,Icon:o,focusable:i,onClick:a,isPopup:r,customStyles:l,buttonTheme:s,floatingBannerText:d,showFlashingButton:p,loading:u=!1,effect:g}=e,m=(0,L.useRef)(null),[x,f]=(0,L.useState)(!1),{isMobile:b}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{isMobileUiOptimize:_}=(0,h.Eo)(),y=(0,L.useMemo)((()=>({isMobileUiOptimize:b&&_})),[]);(0,L.useEffect)((()=>{null==g||g()}),[]),(0,L.useEffect)((()=>{var e,t,o;(null!==(o=null===(t=null===(e=m.current)||void 0===e?void 0:e.getBoundingClientRect())||void 0===t?void 0:t.width)&&void 0!==o?o:0)>=292&&f(!0)}),[u]);const[v,k]=(0,L.useState)(d);(0,L.useEffect)((()=>{k(d)}),[d]);const C=(0,L.useCallback)((()=>{null==a||a()}),[a]),j=(0,L.useCallback)((e=>{i&&13===e.keyCode&&C()}),[i,C]);return(0,n.jsxs)("div",{children:[v?(0,n.jsx)(yt,{children:v}):(0,n.jsx)(yt,{hidden:!0}),(0,n.jsxs)(bt,Object.assign({onClick:u?void 0:C,onKeyDown:u?void 0:j,tabIndex:i?0:void 0,isSmallText:x,isPopup:r,role:"link",style:l,buttonTheme:null!=s?s:"default",showFlashingButton:p},y,{children:[o&&(0,n.jsx)(_t,Object.assign({},y,{children:(0,n.jsx)(o,{})})),(0,n.jsx)(vt,{ref:m,children:u?(0,n.jsx)(kt,{children:(0,n.jsx)(dt,{size:24})}):(0,n.jsx)(gt,{max:15,text:t})})]}))]})};var jt=o(96689),wt=o(49343),St=o.n(wt);const Tt=(e,t,o,n)=>e?"qr_bottom_right"===e?"164px":"sso"===e||"qr"===e?"312px":"375px":n?"475px":t?"435px":o?"375px":"363px",Lt=(0,Q.default)("div",{target:"exd0a430"})((({isMobile:e,popupType:t,isCountrySelector:o,isGuestModeRedesign:n,isInterestSelector:i})=>({width:Tt(t,o,n,i),margin:"auto",padding:e?"0 30px":"unset",marginTop:o||n||"qr_bottom_right"===t?"unset":"64px"})),"label:DivLoginContainer;"),Pt=(0,Q.default)("div",{target:"exd0a431"})((({isMobile:e})=>({padding:e?"0 30px":"unset"})),"label:DivHomeContainer;"),Mt=(0,Q.default)("div",{target:"exd0a432"})((({isMobileUiOptimize:e,theme:t})=>[(0,J.zy)({theme:t,color:"TextQuaternary"}),e&&{color:"rgba(0, 0, 0, 0.56)"},{fontSize:"15px",lineHeight:"18px",margin:"0px 0 20px",textAlign:"center"},t.isMobile&&(0,J.jJ)({min:Ne.aU,style:{fontSize:"24px",lineHeight:"38px",margin:"0 0 24px"}})]),"label:DivDescriptionContainer;"),At=(0,Q.default)("h2",{target:"exd0a433"})((({theme:e,isMobileUiOptimize:t})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:t?"TikTokFont":"TikTokDisplayFont"}),{fontSize:e.isMobile?"24px":"33px",margin:e.isMobile?"6px auto":"64px auto 16px",fontWeight:"bold",textAlign:"center"},e.isMobile&&(0,J.jJ)({min:Ne.aU,style:[{margin:"unset",fontSize:"32px",lineHeight:"48px"},(0,J.zy)({theme:e,fontFamily:"TikTokFont"})]})]),"label:H2Title;"),Et=(0,Q.default)("div",{target:"exd0a434"})((({hideGuestMode:e,isModal:t})=>[{overflowY:"scroll",padding:"0px 5px 2px 13px",height:t?e?"368px":"256px":"unset"}]),"label:DivLoginOptionContainer;"),Ft=(0,Q.default)("div",{target:"exd0a435"})({padding:"0px 5px 2px 13px",marginBottom:"16px"},"label:DivLoginOptionContainerRedesign;"),It=(0,Q.default)("div",{target:"exd0a436"})({width:"337px",margin:"auto",height:"44px"},"label:DivGuestModeContainer;"),Ht=(0,Q.default)("div",{target:"exd0a437"})({width:"337px",margin:"10px 0px 30px 12px"},"label:DivOtherOptionsContainer;");var zt=o(65504),Dt=o(82450);function Rt(){var e,t;const{region:o}=(0,l.Ph)(Dt.H),{region:n}=(0,de.L$)((0,ue.W)((()=>["region"]),[]));return null!==(t=null===(e=null==o?void 0:o.countryCode)||void 0===e?void 0:e.toUpperCase())&&void 0!==t?t:n}function Ot(){const{ageGateAction:e}=(0,l.Ph)(N.T),t=Rt(),{isMobile:o}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[]));return o&&0!==e?k.tH.signupAgeGate:"KR"===t?k.tH.signupPolicyConfirm:k.tH.signupPhone}const Wt=(0,Q.default)("a",{target:"epl6mg0"})((({theme:e,textTheme:t,underline:o=!0})=>[(0,J.zy)({theme:e,color:"primary"===t?"Primary":"TextSecondary",fontWeight:"semiBold"}),{fontSize:"12px","&:hover, &:focus":{textDecoration:o?"underline":"none",textDecorationColor:"primary"===t?e.colors.Primary:e.colors.TextSecondary},"&:focus":{outline:"none"},"&:focus-visible":{outline:`2px auto ${e.colors.Negative}`}}]),"label:ALink;"),Bt=({path:e,text:t,children:o,className:i,replace:a=!1,textTheme:r,underline:l,isJumpOutside:s=!1,target:d,onClick:c})=>{const p=(0,E.W6)(),u=(0,L.useCallback)((t=>{s||(t.preventDefault(),t.stopPropagation(),null==c||c(),"_blank"!==d?a?p.replace(e):p.push(e):window.open(e,"_blank"))}),[p,e,a,c]);return(0,n.jsxs)(Wt,{onClick:u,href:e,className:i,textTheme:r,underline:l,children:[t,o]})},$t=(0,Q.default)("div",{target:"e1b6crsh0"})((({theme:e,isMobileUiOptimize:t,isModal:o})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextPrimary"}),({popupType:n})=>[{height:n?"52px":"64px",borderTop:e.isMobile||n?"none":`0.5px solid ${e.colors.LineSecondary}`,display:"flex",justifyContent:"center",position:e.isMobile?"unset":o?"absolute":"relative",bottom:e.isMobile?"unset":"0",alignItems:"center",fontSize:"15px",lineHeight:"18px",width:o&&!n?"483px":"100%"},t&&{borderTop:"0.5px solid rgba(22, 24, 35, 0.12)"},e.isMobile&&(0,J.jJ)({min:Ne.aU,style:{height:"64px !important",fontSize:"28px",lineHeight:"44px"}})]]),"label:DivContainer;"),Ut=(0,Q.default)("span",{target:"e1b6crsh1"})((({theme:e})=>[(0,J.mp)({direction:e.direction,marginStart:"5px"}),{fontWeight:600,fontSize:"15px",lineHeight:"18px",color:e.colors.Primary},e.isMobile&&(0,J.jJ)({min:Ne.aU,style:{fontWeight:700,fontSize:"28px",lineHeight:"44px"}})]),"label:SpanLinkText;"),Nt=(0,L.memo)((function({style:e,isPopup:t,isButtonStyle:o=!1,forceReplace:i=!1}){var a,r,s;const{disableSignup:d,hideHomePage:p}=Be((()=>["disableSignup","hideHomePage"]),[]),{isMobile:m}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{loginModalShow:x,popupType:f}=(0,j.mZ)((e=>({loginModalShow:e.loginModalShow,popupType:e.popupType})),M.bN),[{loginModalSwitchPath:b},_]=(0,l.Su)(u.i),{redirectUrl:y,loginType:v}=(0,l.Ph)(Oe.t),C=(0,g.s)("WebApp_Login"),{pathname:w,search:S}=(0,E.zy)(),{isMobileUiOptimize:P}=(0,h.Eo)(),{abTestVersion:A}=null!==(a=(0,ue.W)((()=>["abTestVersion"]),[]))&&void 0!==a?a:{},F=null!==(r=(0,he.qt)(A,"login_modal_ui_revamp"))&&void 0!==r?r:"v1",I=[k.tH.signupAgeGateConfirm,k.tH.signupCreateAccount],H=null===(s=(0,E.W5)(I))||void 0===s?void 0:s.isExact,z=p?[k.tH.loginPhoneOrEmail,k.tH.signupPhoneOrEmail]:[k.tH.loginHome,k.tH.signupHome],D=(0,E.W5)(z),R=m&&!p?null==D?void 0:D.isExact:D&&!H,O=w.includes("signup"),W=C(O?"common_registration_panel_entry_1":"common_login_panel_entry_1"),B=Ot(),$="KR"===Rt()?k.tH.signupPolicyConfirm:k.tH.signupHome,U=p&&"v1"===F?B:$;let N=p?k.tH.loginPhoneOrEmail:k.tH.loginHome;"tv"===v&&y.includes("?")&&"1"===St().parse(y.split("?")[1]).login_improvements&&(N=k.tH.tvLoginHome);const V=`${O?N:U}${S}`,G=(0,jt.K)({query:{enter_method:"sso_auto_popup"},loginPath:"/signup"}),q=(0,L.useCallback)((()=>{!b&&_.setLoginModalSwitchPath(!0)}),[_,b]);return o?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Ae.bm,{children:[(0,n.jsx)(Ae.t_,{}),(0,n.jsx)(Ae.CA,{children:W.replace("%s"," ")}),(0,n.jsx)(Ae.t_,{})]}),(0,n.jsx)(It,{children:(0,n.jsx)(Bt,{path:V,onClick:t?G:q,textTheme:"primary",replace:i,"data-e2e":"botton-sign-up",underline:!1,children:(0,n.jsx)(Ct,{text:C(O?"common_registration_panel_entry_2":"common_registration_username_button"),onClick:T(),buttonTheme:"line",focusable:!0},"login-guest-button")})})]}):d||!R?null:(0,n.jsxs)($t,{popupType:f,isModal:x,style:e,isMobileUiOptimize:P&&m,children:[(0,n.jsx)("div",{"data-e2e":"bottom-text",children:W.replace("%s"," ")}),(0,n.jsx)(Bt,{path:V,onClick:t?G:q,textTheme:"primary",replace:i||"v1"===F&&x,"data-e2e":"botton-sign-up",children:(0,n.jsx)(Ut,{"data-e2e":O?"bottom-login":"bottom-sign-up",children:C(O?"common_registration_panel_entry_2":"common_registration_username_button")})})]})}));var Vt=o(97046),Gt=o(86906),qt=o(85997),Kt=o(44205);const Zt=o.p+"b39f863c2f9173bc73db.png";var Qt=o(29405),Jt=o(32778),Yt=o(44606),Xt=o(3247),eo=o(64162),to=o(4126),oo=o(93995),no=o(35572),io=o(8536),ao=o(63700),ro=o(23999),lo=o(80339),so=o(20259),co=o(26324),po=o(7672),uo=o(55099);let go=class{constructor(e){this.fetch=e}getStrategy({language:e}){return this.fetch.get("/tiktok/linker/component/strategy/get/v1/",{query:{biz_name:"Webapp",page_name:"CTA",language:e,wrappers:JSON.stringify([{name:"wrapper_foryou",params:{url_scheme_params:{},url_fallback_params:{}}}])},baseUrlType:2})}};var ho;go=(0,F.__decorate)([(0,po._)(),(0,F.__metadata)("design:paramtypes",[uo.p])],go);let mo=class extends eo.E{constructor(e){super(),this.service=e,this.defaultState={linkerStrategy:void 0}}setStrategy(e,t){e.linkerStrategy=t}getStrategy(e){return e.pipe((0,no.p)((e=>this.service.getStrategy({language:e}).pipe((0,io.Z)((({status_code:e,strategy:t={}})=>{const o=0===e?t:{};return(0,ao.h)((0,ro.of)(this.getActions().setStrategy(o)))})),(0,lo.q)(this.terminate()),(0,so.W)((()=>(0,ro.of)(this.noop())))))))}};(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,"function"==typeof(ho="undefined"!=typeof ILinkerComponentStrategyStruct&&ILinkerComponentStrategyStruct)?ho:Object]),(0,F.__metadata)("design:returntype",void 0)],mo.prototype,"setStrategy",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",co.c)],mo.prototype,"getStrategy",null),mo=(0,F.__decorate)([(0,oo.n)("CtaModule"),(0,F.__metadata)("design:paramtypes",[go])],mo);const xo=({appType:e,jumpTime:t},o)=>{Xt.u.jump({app_type:e,jump_time:t,status:o?0:1})},fo=(0,L.memo)((({children:e})=>{const[t,o]=(0,l.Su)(mo,{selector:e=>e.linkerStrategy,dependencies:[]}),{language:i}=(0,de.L$)((0,ue.W)((()=>["wid","region","language"]),[])),{onelinkParams:a,schemeParams:r}=(0,Yt.mE)({downloadType:"app_launch"}),s=(0,L.useCallback)((e=>{qt.jA.handleDownloadConfirm({enter_method:"app_launch"}),xo(e,!0)}),[]),d=(0,L.useCallback)((e=>{xo(e,!1)}),[]);return(0,L.useEffect)((()=>{t||o.getStrategy(i)}),[o,t,i]),(0,n.jsx)(Qt.p,{strategy:t,enableApiOptimization:!0,checkOpenTime:50,children:(0,n.jsx)(Jt.F,{schemeParams:r,fallbackURLParams:a,target:"wrapper_foryou",jumpStartHandler:s,jumpFailHandler:d,children:e})})})),bo=(0,Q.default)("div",{target:"euo5c20"})({zIndex:1008,width:"100%",borderRadius:"8px 8px 0 0 ",backgroundColor:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, .06)","&.middle":{width:"310px",borderRadius:"8px"}},"label:DivCtaGuideContainer;"),_o=(0,Q.default)("div",{target:"euo5c21"})({position:"absolute",top:0,left:"50%",width:"64px",height:"64px",padding:"4px",boxSizing:"border-box",borderRadius:"100%",backgroundColor:"#f8f8f8",transform:"translate(-50%, -50%)","& img":{borderRadius:"100%"}},"label:DivIconContainer;"),yo=(0,Q.default)("div",{target:"euo5c22"})({boxSizing:"border-box",width:"100%",padding:"48px 20px 20px",textAlign:"center"},"label:DivInfoContainer;"),vo=(0,Q.default)("p",{target:"euo5c23"})((({theme:e})=>(0,J.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"semiBold"})),{fontSize:"20px",lineHeight:"24px"},"label:PGuideTitle;"),ko=(0,Q.default)("p",{target:"euo5c24"})((({theme:e})=>(0,J.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"normal",color:"TextSecondary"})),{marginTop:"12px",fontSize:"15px",lineHeight:"18px"},"label:PGuideDesc;"),Co=(0,Q.default)("div",{target:"euo5c25"})((({paddingBottom:e})=>({boxSizing:"border-box",width:"100%",padding:"0 20px 20px",paddingBottom:e,textAlign:"center"})),"label:DivGuideBtnContainer;"),jo={width:"100%",height:"44px",border:"none",fontSize:"15px",lineHeight:"44px"},wo=(0,Q.default)("button",{target:"euo5c26"})((({theme:e})=>(0,J.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"semiBold",color:"ConstTextInverse"})),Object.assign(Object.assign({},jo),{borderRadius:"2px",backgroundColor:"#fe2c55"}),"label:ButtonOpenTT;"),So=(0,Q.default)("button",{target:"euo5c27"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"normal"}),Object.assign(Object.assign({},jo),{backgroundColor:"#fff",marginTop:"2px",color:e.colors.ConstTextPrimary})]),"label:ButtonRefuseOrLogin;"),To={padding:"0"},Lo=(0,L.memo)((()=>{const{title:e,desc:t,btnText:o,notNow:i}=(()=>{const e=(0,g.s)("WebApp_Login"),t=e("optimize_web_open_notnow_cta");return{btnText:e("optimize_web_open_tiktok_cta"),title:e("optimize_web_full_app_header"),desc:e("optimize_web_full_app_body"),notNow:t}})(),[a,r]=(0,L.useState)(!1),{isBot:s}=(0,de.L$)((0,c.U)((()=>["isBot"]),[])),{noCtaPopup:d}=(0,l.Ph)(Oe.t),p=(0,L.useCallback)((e=>()=>{r(!1),qt.jA.handleDownloadDismiss({modal_type:"bottom_sheet",enter_method:"app_launch",dismiss_method:e})}),[]),u=(0,L.useCallback)(((e,t)=>{p("icon"===t?"x_close":"click_mask")()}),[p]);return(0,L.useEffect)((()=>{const e=!(0,_.Hd)(Vt.j0),{referrer:t}=document,o=performance.getEntriesByType("navigation")[0],n=o&&o instanceof PerformanceNavigationTiming&&o.redirectCount>0;d||s||!e||t.includes(".tiktok.com")||n||(r(!0),(0,_.J2)(Vt.j0,"1"),qt.jA.handleDownloadShow({modal_type:"bottom_sheet",enter_method:"app_launch"}))}),[s]),(0,n.jsx)(Kt.l,{visible:a,contentStyle:To,closeable:!1,onClose:u,children:(0,n.jsxs)(bo,{"data-e2e":"bottom-cta-container",children:[(0,n.jsx)(_o,{"data-e2e":"bottom-cta-icon",children:(0,n.jsx)("img",{src:Zt,width:56,height:56})}),(0,n.jsxs)(yo,{children:[(0,n.jsx)(vo,{"data-e2e":"bottom-cta-title",children:e}),(0,n.jsx)(ko,{"data-e2e":"bottom-cta-desc",children:t})]}),(0,n.jsxs)(Co,{children:[(0,n.jsx)(Gt.s,{children:(0,n.jsx)(fo,{children:(0,n.jsx)(wo,{"data-e2e":"bottom-cta-confirm-btn",children:o})})}),(0,n.jsx)(So,{"data-e2e":"bottom-cta-cancel-btn",onClick:p("not_now"),children:i})]})]})})}));var Po=o(47236);const Mo=(0,Po.Ay)({resolved:{},chunkName:()=>"login-tip-modal",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!o.m[t]},importAsync:()=>Promise.all([o.e(8873),o.e(2514)]).then(o.bind(o,73212)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return o(t)},resolve:()=>73212});var Ao=o(340),Eo=o(64356),Fo=o(50970),Io=o(24451),Ho=o(87933),zo=o(2668),Do=o(74690),Ro=o(76435),Oo=o(62564),Wo=o(65070),Bo=o(53708),$o=o(91498),Uo=o(52913),No=o(9450),Vo=o(60951);let Go;const qo=[{regex:"WhatsApp(?:[ /]([\\d.]+))?",browserName:"Whatsapp"},{regex:"(?:MessengerForiOS|MESSENGER|FB_IAB/Orca-Android).(?:FBAV)(?:[ /]([\\d.]+))?",browserName:"Messenger"}],Ko=()=>{var e;if(void 0===Go){const t=(()=>{const{userAgent:e}=(0,xe.T6)();for(const{regex:t,browserName:o}of qo)if(e.match(t))return o;return new Vo.UAParser(e).getBrowser().name})();Go=null!==(e=null==t?void 0:t.toLowerCase().replace(" ","_"))&&void 0!==e?e:"$OTHERS"}return Go},Zo=["facebook","instagram","messenger","whatsapp"],Qo=["chrome","chrome_mobile","mobile_chrome"],Jo=["samsung_internet","line","opera","opera_mobi","opera_touch","opera_mini","yandex"],Yo=[...Zo,"edge","firefox","firefox_mobile","mobile_firefox","vivo_browser"],Xo=[...Qo,...Jo,...Yo],en=(new Set(Xo),"one_tap_use_ios_deep_link");var tn=o(10707);const on=e=>(0,tn._)(btoa(JSON.stringify(e)));var nn;!function(e){e.Init="init",e.InProgress="in_progress",e.InProgressWithPopup="in_progress_with_popup",e.Stop="stop",e.Failed="failed"}(nn||(nn={}));let an=class extends eo.E{constructor(e,t,o,n,i,a){super(),this.service=e,this.appContext=t,this.loginReport=o,this.sloSlardar=n,this.loginResult=i,this.t=a,this.defaultState={getTokenLoading:!1,getTokenCalled:!1}}updateState(e,t){return Object.assign(Object.assign({},e),t)}getOneTapToken(e){return e.pipe((0,Io.E)(this.state$,this.appContext.state$),(0,no.p)((([,e,t])=>{var o,n,i,a,r,l;const s=`https://${"t"===(null!==(n=null===(o=t.appContext)||void 0===o?void 0:o.appType)&&void 0!==n?n:"t")?"www.tiktokv.com":"app-va.tiktokv.com"}/redirect?decode_once=1`,d=ye.parse(location.search),c=null!==(i=e.storedState)&&void 0!==i?i:(0,No.r)(d,["enter_method","enter_from","device_platform","ref_hash","redirect_url"]);c.web_id=null===(a=t.appContext)||void 0===a?void 0:a.wid,c.infer_app=Ko(),c.is_home_screen="pwa"===(0,$o.o7)()?"1":"0",c.is_optimize_one_tap_v3="1";const p=b.nf.getTrackingInfo();c.e2e_tracking_info=p,c.click_time=Date.now().toString(),d.tt_not_installed="true";const u="true"===d.coin_spa,g=null!==(l=(0,he.V7)(null===(r=t.appContext)||void 0===r?void 0:r.abTestVersion,"live_recharge_mobile_non_login_redesign_trigger_point"))&&void 0!==l?l:"v1",h=u&&"v3"===g;c.ui_style=h?"half_screen":"full_screen",delete d.back_on_close;const m=new URL(window.location.href),x=h?`${m.origin}${m.pathname}?${ye.stringify(d)}`:`https://www.tiktok.com/login?${ye.stringify(d)}`;return(0,Ho.O)(0,15e4).pipe((0,io.Z)((()=>{var e;return this.service.getOneTapToken({next:null!==(e=c.redirect_url)&&void 0!==e?e:"",state:on(c),web_to_app_redirect_uri:s,web_to_app_fallback_uri:x}).pipe((0,io.Z)((({data:e})=>{const t=e.error_code;return t?(0,zo.$)((()=>({errorCode:t,error:new Error(`Get one tap token failed, error_code ${t}`)}))):(0,ro.of)(this.getActions().updateState({token:e.token,universalLink:e.redirect_url,getTokenErrorCode:void 0}))})),(0,Do.Z)(this.getActions().updateState({getTokenLoading:!0})),(0,lo.q)(this.getActions().updateState({getTokenLoading:!1,storedState:c,getTokenCalled:!0})),(0,Ro.Q)(this.disposeRefresh$))})),(0,Ro.Q)(this.disposeRefresh$),(0,so.W)((e=>{const t=(e=>{if(!e||"object"!=typeof e||!("errorCode"in e))return;const t=e.errorCode;return"number"==typeof t?t:void 0})(e);return(0,ro.of)(this.getActions().updateState({getTokenLoading:!1,getTokenErrorCode:t,storedState:c,getTokenCalled:!0,token:void 0,universalLink:void 0}))})))})))}stopRefreshToken(e){return e.pipe((0,Oo.T)((()=>this.getActions().disposeRefresh$())))}startOneTapPolling(e){return e.pipe((0,Io.E)(this.state$),(0,io.Z)((([{ttpConfig:e,token:t,checkLastUsedToken:o,isCountInAppViewedStatus:n=!0},{authStatus:i}])=>{const{open:a,syncSeverList:r}=e||{},l=a?r:[{name:"gloable",domain:""}];return(0,Wo.p)(l.map((e=>this.service.checkOneTapState({token:t,baseURL:e.domain})))).pipe((0,io.Z)((a=>{const r={token:t,checkLastUsedToken:o,ttpConfig:e,isCountInAppViewedStatus:n};for(const{data:e,message:t}of a){const{status:o,error_code:a}=e;if("error"!==t&&0!==a)return(0,ro.of)({status:o,error_code:a,pollingArgs:r});if(o&&"new"!==o&&("inapp_viewed"!==o||n&&"in_progress_with_popup"!==i))return(0,ro.of)({status:o,pollingArgs:r})}throw new Error("User not confirmed, need to retry")})),(0,Bo.L)({delay:()=>(0,Ho.O)(800)}),(0,Ro.Q)(this.disposePolling$))})),(0,Io.E)(this.state$,this.appContext.state$),(0,io.Z)((([e,{token:t,lastUsedToken:o,getTokenLoading:n},{appContext:i}])=>{if(e.pollingArgs.checkLastUsedToken&&e.pollingArgs.token!==o)return(0,ro.of)(this.noop());const a="error_code"in e?"failed":function(e){switch(e){case"inapp_viewed":return"in_progress_with_popup";case"confirmed":default:return"stop";case"expired":return"failed"}}(e.status),r={authStatus:a,lastUsedToken:t,authErrorCode:"error_code"in e?e.error_code:void 0};if("failed"===a){const o=t===e.pollingArgs.token;o&&(r.token=void 0,r.universalLink=void 0);const i=[this.getActions().updateState(r)];return o&&!n&&i.push(this.getActions().stopRefreshToken(),this.getActions().getOneTapToken()),(0,ao.h)(i)}return"confirmed"===e.status?(r.token=void 0,r.universalLink=void 0,this.loginReport.setPlatform("tiktok"),this.sloSlardar.setPlatform("tiktok"),(0,ao.h)([this.getActions().updateState(r),this.loginResult.getActions().handleLoginResult({error_code:0,region:null==i?void 0:i.region,platform:"tiktok"})])):(0,ao.h)((0,ro.of)(this.getActions().updateState(r)),(0,Ho.O)(800).pipe((0,Oo.T)((()=>this.getActions().startOneTapPolling(e.pollingArgs)))))})))}stopOneTapPolling(e){return e.pipe((0,Oo.T)((()=>this.getActions().disposePolling$())))}};(0,F.__decorate)([(0,to.uk)(),(0,F.__metadata)("design:type",co.c)],an.prototype,"dispose$",void 0),(0,F.__decorate)([(0,to.uk)(),(0,F.__metadata)("design:type",co.c)],an.prototype,"disposePolling$",void 0),(0,F.__decorate)([(0,to.uk)(),(0,F.__metadata)("design:type",co.c)],an.prototype,"disposeRefresh$",void 0),(0,F.__decorate)([(0,to.HI)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Object]),(0,F.__metadata)("design:returntype",Object)],an.prototype,"updateState",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],an.prototype,"getOneTapToken",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],an.prototype,"stopRefreshToken",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",Object)],an.prototype,"startOneTapPolling",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],an.prototype,"stopOneTapPolling",null),an=(0,F.__decorate)([(0,oo.n)("OneTapModule"),(0,F.__param)(5,(0,Ao.y)(Eo.hp)),(0,F.__metadata)("design:paramtypes",[Uo.r,Fo.L,C.$F,Te.le,Z.$,Function])],an);const rn="click_one_tap";var ln=o(47538),sn=o(45613);const dn=()=>{const e=(0,s.Nj)(Te.VU),t=(0,g.s)("WebApp_Login"),o=(0,s.Nj)(C.$F);return(0,L.useCallback)(((n=b.nf.getTrackingInfo())=>{o.failToOpenApp({message:"cannot_open_app",e2eInfo:n}),e.emitOnce("noTTApp_toast",{}),(0,ln.P)(t("webLogin_useApp_noTTApp_toast"))}),[])},cn=()=>{const{ttpConfig:e}=Be((()=>["ttpConfig"]),[]),{startOneTapPolling:t,stopOneTapPolling:o,updateState:n}=(0,l.wA)(an),i=()=>n({authStatus:"stop",authErrorCode:void 0});return{startPollingAndShowPollingPopup:o=>{n({authStatus:"in_progress_with_popup",lastUsedToken:o}),t({token:o,ttpConfig:e,isCountInAppViewedStatus:!1})},stopPolling:()=>{o(),i()},setStopOneTapStatus:i,startPolling:o=>{n({authStatus:"in_progress",lastUsedToken:o}),t({token:o,ttpConfig:e,checkLastUsedToken:!0,isCountInAppViewedStatus:!0})}}},pn=["dev_awrxudrcbk09y7wi"],un=()=>{var e,t,o;const{enableOneTapFromQuery:n,standaloneAid:i}=Be((()=>["enableOneTapFromQuery","standaloneAid"]),[]),a=null!==(t=null===(e=(0,ye.parse)((0,E.zy)().search))||void 0===e?void 0:e.enter_from)&&void 0!==t?t:"",{abTestVersion:r}=(0,de.L$)((0,ue.W)((()=>["abTestVersion"]),[])),l=null!==(o=(0,he.V7)(r,"all_one_tap_login"))&&void 0!==o?o:"v0",{isAndroid:s}=(0,de.L$)((0,c.U)((()=>["isAndroid"]),[])),d=Ko();return!(i||pn.includes(a)||!n&&"v0"===l||s&&"ucbrowser"===d)},gn=()=>{var e;const{pathname:t}=(0,E.zy)(),o=(0,Je.$H)(t),n=(0,sn.VN)(),i=(0,sn.c8)(),{abTestVersion:a,appType:r="t"}=(0,de.L$)((0,ue.W)((()=>["abTestVersion","appType"]),[])),d=null!==(e=(0,he.qt)(a,"one_tap_ios_deep_link"))&&void 0!==e?e:"v0",{ttNotInstalled:p}=(0,de.L$)(Be((()=>["ttNotInstalled"]),[])),{isAndroid:u}=(0,de.L$)((0,c.U)((()=>["isAndroid"]),[])),{getOneTapToken:h,stopRefreshToken:m}=(0,l.wA)(an),{universalLink:x,token:f,lastUsedToken:_,getTokenLoading:y,getTokenErrorCode:v,authStatus:k}=(0,l.Ph)(an),{startPolling:j,stopPolling:w}=cn(),S=(0,s.Nj)(C.$F),T=(0,s.Nj)(Te.VU),L=(0,g.s)("WebApp_Login"),P=dn(),M=()=>i({platform:"tiktok",isSignUp:o});if(!x||!f)return()=>{M(),(0,ln.P)(L("Sorry, something went wrong, please try again later")),S.failToOpenApp({message:"try_again",error_code:null==v?void 0:v.toString(),e2eInfo:b.nf.getTrackingInfo()}),y||(m(),h())};const A=()=>{S.failToOpenApp({message:"app_not_opened",e2eInfo:b.nf.getTrackingInfo()}),T.emitOnce("appNotOpened_toast",{}),(0,ln.P)(L("webLogin_useApp_appNotOpened_toast"))},F=()=>{b.nf.prepareResumeData(rn),location.href=x},I=({redirectTimeoutDuration:e,onRedirectTimeout:t})=>{var o;try{const e="t"===r?"snssdk1180":"snssdk1233",t=null!==(o=new URL(x).searchParams.get("redirect_url"))&&void 0!==o?o:"";window.location.href=`${e}://webview?url=${encodeURIComponent(t)}`}catch(e){console.error("Error when launching by schema",e)}finally{let o;const n=()=>{"hidden"===document.visibilityState&&clearTimeout(o)};o=setTimeout((()=>{"hidden"!==document.visibilityState&&(document.removeEventListener("visibilitychange",n),t())}),e),document.addEventListener("visibilitychange",n,{once:!0})}},H=(e=1e3)=>I({redirectTimeoutDuration:e,onRedirectTimeout:A});return()=>{if(M(),n({platform:"tiktok",signUp:o}),u?(()=>{const e=Ko();Qo.includes(e)?F():Jo.includes(e)?I({redirectTimeoutDuration:1e3,onRedirectTimeout:P}):H()})():(()=>{switch(d){case"v1":return p;case"v2":return"1"===localStorage.getItem(en);case"v3":return"1"===sessionStorage.getItem(en);default:return!1}})()?H(1200):F(),_!==f)return w(),void j(f);"stop"===k&&j(f)}};var hn=o(30543);const mn=(0,Q.default)("span",{target:"e1fnwyrm0"})({position:"absolute",right:8,top:8,color:"#f5f5f5"},"label:SpanCloseIconContainer;"),xn=(0,Q.default)("div",{target:"e1fnwyrm1"})({textAlign:"center"},"label:DivPopupContent;"),fn=(0,Q.default)("div",{target:"e1fnwyrm2"})({height:48,marginBottom:8,display:"flex",alignItems:"center",justifyContent:"center"},"label:DivLoadingIconContainer;"),bn=(0,Q.default)("div",{target:"e1fnwyrm3"})({color:"#f6f6f6",fontWeight:500,fontSize:14,lineHeight:"1.3em",letterSpacing:"0.0067em"},"label:DivPollingText;"),_n=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,s.Nj)(C.$F);return(0,L.useEffect)((()=>{t.pollingOneTapLoginPopupShow({e2eInfo:b.nf.getTrackingInfo()})}),[]),(0,n.jsxs)(xn,{children:[(0,n.jsx)(fn,{children:(0,n.jsx)(G.R,{size:"small"})}),(0,n.jsx)(bn,{children:e("webLogin_appLogin_webapp_loginPrompt")})]})},yn={borderRadius:12,position:"relative",padding:16,width:"70%"},vn=({visible:e,onClose:t})=>(0,n.jsxs)(y.aF,{visible:e,mask:!1,type:"mobile",contentStyle:yn,backgroundColor:"#252525",children:[(0,n.jsx)(mn,{onClick:t,children:(0,n.jsx)(hn.g,{size:16})}),(0,n.jsx)(_n,{})]});var kn=o(94054);const Cn=(0,Q.default)("span",{target:"epqkw870"})({position:"absolute",right:8,top:8},"label:SpanCloseIconContainer;"),jn=(0,Q.default)("div",{target:"epqkw871"})({padding:"24px 20px",display:"flex",flexDirection:"column",gap:16,alignItems:"center",textAlign:"center"},"label:DivContent;"),wn=(0,Q.default)("div",{target:"epqkw872"})({fontWeight:700,fontSize:20,lineHeight:"1.25em",letterSpacing:"0.02em"},"label:DivMainText;"),Sn=(0,Q.default)("button",{target:"epqkw873"})({border:"none",outline:"none",borderTop:"0.5px solid rgba(0, 0, 0, 0.12)",padding:13,fontWeight:500,fontSize:16,lineHeight:"1.3em",backgroundColor:"inherit",display:"block",width:"100%",borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit",color:"inherit"},"label:Button;"),Tn=()=>{const e=(0,s.Nj)(C.$F),t=(0,s.Nj)(Te.le),{authErrorCode:o}=(0,l.Ph)(an);return(0,L.useCallback)((()=>{const n=null!=o?o:8,i=b.nf.getTrackingInfo();e.setPlatform("tiktok"),e.failureOneTapLoginPopupShow({error_code:String(n),e2eInfo:i}),e.loginFailure({error_code:n,e2eInfo:i}),t.loginFailure({errorCode:n,forgetPwd:!1,signUp:!1})}),[o])},Ln=()=>{const e=(0,g.s)("WebApp_Login"),t=Tn();return(0,L.useEffect)((()=>{t()}),[t]),(0,n.jsxs)(jn,{children:[(0,n.jsx)(kn.t,{size:48}),(0,n.jsx)(wn,{children:e("webLogin_appLogin_webapp_loginError")})]})},Pn={textAlign:"center",width:"75%",position:"relative",borderRadius:12},Mn=({visible:e,onClose:t})=>{const o=(0,g.s)("WebApp_Login");return(0,n.jsxs)(y.aF,{type:"mobile",visible:e,maskCloseable:!0,onClose:t,contentStyle:Pn,children:[(0,n.jsx)(Cn,{onClick:t,children:(0,n.jsx)(hn.g,{size:20})}),(0,n.jsx)(Ln,{}),(0,n.jsx)(Sn,{onClick:t,children:o("webLogin_error_btn_OK")})]})},An=(0,Q.default)("div",{target:"ecgdxug0"})({fontWeight:700,fontSize:20,lineHeight:"25px",letterSpacing:"0.015em",marginBottom:12},"label:DivPopupTitle;"),En=(0,Q.default)("div",{target:"ecgdxug1"})({fontSize:15,fontWeight:400,lineHeight:"19.5px",letterSpacing:"0.004em"},"label:DivPopupContent;"),Fn={textAlign:"center",width:"75%",borderRadius:12,padding:20,paddingTop:24},In={marginTop:20,borderRadius:8},Hn=({visible:e})=>{const t=(0,g.s)("WebApp_Login"),{successPopupRedirectUrl:o}=(0,l.Ph)(an),a=(0,s.Nj)(Te.VU),r=(0,s.Nj)(C.$F),d=(0,L.useCallback)((()=>{r.oneTapSuccessPopupClick({e2eInfo:b.nf.getTrackingInfo()})}),[r]),c=(0,L.useCallback)((()=>{a.oneTapLoginSuccessPopupClick("open"),d(),b.nf.setUpLoginSuccessE2ETracking(),location.href=null!=o?o:"https://www.tiktok.com"}),[a,d,o]),p=(0,L.useCallback)((()=>{a.oneTapLoginSuccessPopupClick("close"),d()}),[a,d]);return(0,L.useEffect)((()=>{e&&(a.oneTapLoginSuccessPopupShow(),r.oneTapSuccessPopupShow({e2eInfo:b.nf.getTrackingInfo()}))}),[e]),(0,n.jsxs)(y.aF,{visible:e,mask:!0,type:"mobile",contentStyle:Fn,maskCloseable:!0,onClose:p,children:[(0,n.jsx)(An,{children:t("webLogin_useApp_openWeb_title")}),(0,n.jsx)(En,{children:t("webLogin_useApp_openWeb_desc")}),(0,n.jsx)(i.I0,{label:t("webLogin_useApp_openWeb_button"),variant:"primary",block:!0,size:"large",onClick:c,deprecatedStyle:In})]})},zn=L.createContext(void 0),Dn=(zn.Provider,()=>(0,de.L$)((0,L.useContext)(zn))),Rn=()=>{const{authStatus:e,isLoginSuccessPopupVisible:t}=(0,l.Ph)(an),o="in_progress_with_popup"===e,i="failed"===e,{stopPolling:a,setStopOneTapStatus:r}=cn(),{oneTapFailed:{handler:s}={}}=Dn(),d=Tn();return(0,L.useEffect)((()=>a),[]),(0,L.useEffect)((()=>{i&&s&&s({reportShow:d})}),[s,i]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(vn,{visible:o,onClose:a}),(0,n.jsx)(Hn,{visible:t}),s?null:(0,n.jsx)(Mn,{visible:i,onClose:r})]})};var On=(0,st.r)((function(e){return L.createElement("svg",(0,lt._)({fill:"currentColor"},e,{viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:e.className}),L.createElement("path",{d:"M24 8.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm0 19c-6.18 0-10.98 3.87-13 9.38a1.98 1.98 0 0 0 1.88 2.66h22.24a1.98 1.98 0 0 0 1.87-2.66c-2.01-5.5-6.81-9.38-12.99-9.38Z"}))})),Wn=o(52973),Bn=o(38731),$n=o(92249),Un=o(60182),Nn=o(91272),Vn=o(92662),Gn=o(40815),qn=o(97413),Kn=o(55714),Zn=o(95748),Qn=o(13326),Jn=o.n(Qn);const Yn={id:"single-logo-dark-3ed5e24d",use:"single-logo-dark-3ed5e24d-usage",viewBox:"0 0 25 42",content:''};function Xn(e){const t=(0,L.useContext)(Fe.X);return(0,L.useLayoutEffect)((()=>(t.add(Yn),()=>{t.remove("single-logo-dark-3ed5e24d")})),[]),(0,n.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,n.jsx)("use",{xlinkHref:"#single-logo-dark-3ed5e24d"},void 0)}),void 0)}var ei=o(54888),ti=o(42583),oi=o(68628),ni=o(46657),ii=o(14270),ai=o(59622),ri=o(85969);const li=new class{constructor(){this.generateRandomString=e=>{const t=(0,ri.A)();return(0,_.AP)(`${e}-auth`,t),t},this.getRandomString=e=>(0,_._S)(`${e}-auth`),this.clearData=e=>{(0,_.sc)(`${e}-auth`)}}};var si=o(32066);const di=(e,t)=>{const o=(n=e,`${ii.wW}:${n}`);var n;const i={timestamp:Number(new Date),timeInterval:6e5},a=Object.assign(Object.assign({},t),{expires:i});(0,_.AP)(o,JSON.stringify(a)),(0,_.AP)(e,JSON.stringify(a))},ci=e=>{const t=(0,_._S)(e);try{return JSON.parse(t)}catch(e){return{}}},pi=()=>{const e=(0,ye.stringifyUrl)({url:`${window.location.origin}/oauth/?page=new`,query:{platform:["twitter"],oauthType:0,lang:"en"}});return(0,ye.stringifyUrl)({url:"https://login-us.www.tiktok.com/passport/web/web_login/",query:{platform_app_id:ii.iU.twitter,platform:["twitter"],aid:rt.dd,next:encodeURIComponent(e),action:"login_only"}})},ui=()=>(0,ye.stringifyUrl)({url:"https://access.line.me/oauth2/v2.1/authorize",query:{response_type:"code",client_id:ii.Dt,redirect_uri:`${window.location.origin}/oauthLine/`,state:li.generateRandomString("line"),scope:"openid profile"}}),gi=()=>(0,ye.stringifyUrl)({url:"https://oauth.vk.com/authorize",query:{display:"page",response_type:"token",client_id:ii.g9,redirect_uri:"https://www.tiktok.com/login/",scope:"offline, v",state:li.generateRandomString("vk")}}),hi=()=>(0,ye.stringifyUrl)({url:"https://kauth.kakao.com/oauth/authorize",query:{response_type:"code",client_id:ii.qo,redirect_uri:"https://www.tiktok.com/login",state:JSON.stringify({platform:"kakaotalk",auth:li.generateRandomString("kakaotalk")})}}),mi=e=>{const{isSignUp:t,brandName:o="",platformList:n,enabledAce:i,disable_platform:a,isMobile:r,disableAll:l,os:s,standaloneAid:d}=e;if(l)return[];const c=Boolean(o),p=/mercedes/i.test(o),u=n,g=[];return t&&(g.push("twitter","vk"),r||"mac"===s||g.push("apple"),i&&g.push("facebook")),c&&(g.push("apple","kakaotalk","line","vk"),p&&g.push("facebook","twitter")),a&&g.push(...a.split(",")),d&&g.push("line"),u.filter((e=>!g.includes(e)))},xi=e=>{2===Number(null!=e?e:localStorage.getItem("oauthType"))&&(location.href=`${location.href}&no_refactor=1`)},fi="hello_page_login_way",bi=()=>Boolean((0,_._S)(fi)),_i=()=>{(0,_.AP)(fi,"1")},yi=()=>{if(location.hash){const{state:e,access_token:t,user_id:o}=ye.parse(location.hash.substr(1));if(!e||location.hash.match("accounts.google.com|https://www.googleapis.com/auth"))return;const n=li.getRandomString("vk");let i="ok";return n&&e===n?di("vk",{access_token:null==t?void 0:t.toString(),user_id:null==o?void 0:o.toString()}):i="failed",li.clearData("vk"),window.authDoneClose=!0,i}},vi="webapp_third_auth_page_redirect";function ki(e){var t;if(!(null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t[e]))return;const o=function(e){const t={},o=e.replace(/^[#?]/,"").match(/([^=/&]+)=([^&]+)/g);if(o)for(let e=0;e{var t,o,n,i;const{disableStandaloneAppFlags:a,standaloneAid:r,standaloneAppVersion:l}=e,s=e.os;if(!r)return!1;const d=null===(o=null===(t=a[r])||void 0===t?void 0:t.versionControls)||void 0===o?void 0:o[s],c=null===(i=null===(n=a[r])||void 0===n?void 0:n.hideAll)||void 0===i?void 0:i[s];if(d&&l){const{disableVersions:e=[],enableVersions:t=[]}=d,o=({op:e,version:t})=>!!Ci[e]&&Ci[e](l,t);if(e.some(o))return!0;if(t.some(o))return!1}return void 0!==c&&c};var wi=o(28445),Si=o(77653),Ti=o(31291);let Li=class{constructor(e,t,o){this.loginReport=e,this.fetch=t,this.appContextModule=o,this.initialized=!1}init(){return this.init$||(this.init$=(()=>(0,F.__awaiter)(this,void 0,void 0,(function*(){var e;try{const t=this.appContextModule.state.appContext,n=null!==(e=null==t?void 0:t.appId)&&void 0!==e?e:1180;ii.iU.apple=ii.k0[n];const[i,{data:a}]=yield Promise.all([o.e(9807).then(o.t.bind(o,29345,23)),this.getAppleConfig()]),{client_id:r,state:l}=a;i.auth.init({clientId:r,state:l,redirectURI:"https://www.tiktok.com/oauth",scope:"name email",response_mode:"fragment",usePopup:!0}),window.AppleID=i,this.initialized=!0}catch(e){throw console.error(e),this.init$=void 0,{error_code:-1}}})))()),this.init$}login(){return(0,F.__awaiter)(this,void 0,void 0,(function*(){try{this.initialized||(yield this.init());const e=yield window.AppleID.auth.signIn();return this.tokenToAuthentication(e)}catch(e){return this.loginReport.thirdPartyLoginResult(Object.assign(Object.assign({},e),{status:"popup_closed_by_user"===e.error?2:1,error_desc:e.error})),Object.assign(Object.assign({error_code:-1},e),{error_msg:"user_trigger_new_signin_flow"===e.error?"":e.error,platform:"apple"})}}))}tokenToAuthentication(e){const{authorization:t={}}=e,{id_token:o}=t;return{openid:(0,wi.A)(o).sub,platform_app_id:ii.iU.apple,platform:"apple",id_token:o}}getAppleConfig(){const e=this.fetch.post("https://www.tiktok.com/passport/web/auth/config",{query:{aid:1459,account_sdk_source:"web"},body:St().stringify({platform_app_id:ii.iU.apple,action:"login_only",next:"https://www.tiktok.com/foryou?lang=en"})});return(0,Si.s)(e.pipe((0,Ti.s)(1)))}};Li=(0,F.__decorate)([(0,po._)(),(0,F.__metadata)("design:paramtypes",[C.$F,uo.p,Fo.L])],Li);let Pi=class{constructor(e){this.loginReport=e,this.initialized=!1}init(){return(0,F.__awaiter)(this,void 0,void 0,(function*(){return this.init$||(this.init$=(()=>(0,F.__awaiter)(this,void 0,void 0,(function*(){try{yield o.e(4305).then(o.t.bind(o,1325,23)),window.fbAsyncInit=()=>{window.FB.init({appId:ii.jq,cookie:!0,xfbml:!0,version:"v18.0"})},this.initialized=!0}catch(e){throw console.error(e),this.init$=void 0,e}})))()),this.init$}))}login(){var e,t;return(0,F.__awaiter)(this,void 0,void 0,(function*(){try{this.initialized||(yield this.init());const e=yield new Promise((e=>{window.FB.login((t=>e(t)))}));return"connected"===e.status?{openid:e.authResponse.userID,access_token:e.authResponse.accessToken,platform:"facebook",platform_app_id:ii.iU.facebook}:(console.error(e),{error_code:-1,error_msg:e.message,platform:"facebook"})}catch(o){return this.loginReport.thirdPartyLoginResult(Object.assign(Object.assign({},o),{status:"cancelled"===(null===(e=o.error)||void 0===e?void 0:e.code)?2:1,error_desc:null===(t=o.error)||void 0===t?void 0:t.message})),{error_code:-1,platform:"facebook",error_msg:o.message}}}))}};Pi=(0,F.__decorate)([(0,po._)(),(0,F.__metadata)("design:paramtypes",[C.$F])],Pi);var Mi=o(40812),Ai=o(72916);let Ei=class{constructor(e){this.loginReport=e,this.loadSdk=e=>{window.HELLOJS_REDIRECT_URL=new RegExp(`^${window.location.origin}/(login|signup|oauth|oauthLine|setting)(/[^.]*){0,}(?!/..)([/?#]|$)|^https://accounts.google.com([/?#]|$)`),function(){for(const e of["search","hash"])try{ki(e)}catch(e){}}(),o.e(2675).then(o.t.bind(o,45875,23)).then((({default:t})=>{t.init({facebook:"1862952583919182",google:"1096011445005-sdea0nf5jvj14eia93icpttv27cidkvk.apps.googleusercontent.com",twitter:"rLsbFQ5NHI2IsWZiRc2McRCFc",instagram:"c8785d0dc7df48f298532fddf33d7cb5",vk:"6961453"}),this.helloJS=t,null==e||e()})).catch((t=>{console.error(t),null==e||e()}))}}get helloJS$(){return this.helloJS?(0,ro.of)(this.helloJS):new co.c((e=>{this.loadSdk((()=>{e.next(),e.complete()}))}))}login(e){const{platform:t,display:o}=e;return"page"===o&&_i(),this.helloJS$.pipe((0,io.Z)((()=>(0,oi.H)(this.helloJS(t).login(e)).pipe((0,Ai.n)((e=>this.afterHelloAuthentication(e)))))),(0,so.W)((n=>{var i,a,r,l;return this.loginReport.thirdPartyLoginResult(Object.assign(Object.assign({},n.error),{status:"cancelled"===(null===(i=n.error)||void 0===i?void 0:i.code)?2:1,error_desc:null===(a=n.error)||void 0===a?void 0:a.message})),"blocked"===(null===(r=n.error)||void 0===r?void 0:r.code)&&"popup"===o&&(e.display="page",this.helloJS(t).login(e),_i()),(0,ro.of)(Object.assign({platform:t,error_code:-1,error_msg:null===(l=n.error)||void 0===l?void 0:l.message},n.error))})))}ListenLogin(){return this.helloJS$.pipe((0,Ai.n)((()=>(0,Mi.R)(this.helloJS,"auth.login").pipe((0,Ti.s)(1)))),(0,Ai.n)((e=>((0,_.sc)(fi),this.afterHelloAuthentication(e[0])))))}afterHelloAuthentication(e){return(0,ro.of)(e).pipe((0,Ai.n)((e=>{const{network:t,authResponse:o}=e,n="vk"===t?{v:"5.81"}:void 0;return(0,oi.H)(this.helloJS(t).api("me",n)).pipe((0,Oo.T)((e=>{const{access_token:n="",oauth_token_secret:i=""}=o;return{openid:e.id,access_token:n,access_token_secret:i,platform:t,platform_app_id:ii.iU[t]}})))})))}};Ei=(0,F.__decorate)([(0,po._)(),(0,F.__metadata)("design:paramtypes",[C.$F])],Ei);let Fi=class extends eo.E{constructor(e,t,o,n,i,a,r,l,s,d,c){super(),this.service=e,this.loginResultDealModule=t,this.appBiz=o,this.contextModule=n,this.helloJS=i,this.facebookSdk=a,this.appleSdk=r,this.slardar=l,this.loginReport=s,this.sloSlardar=d,this.t=c,this.defaultState={platform:"",loadingThirdParty:!1}}setLoadingThirdParty(e,t){e.loadingThirdParty=t}handleHelloJSAuth(e){return e.pipe((0,io.Z)((e=>this.helloJS.login(e).pipe((0,P.M)((e=>this.reportThirdGetToken(e))),(0,Oo.T)((e=>e.error_code?"cancelled"===e.code?this.noop():this.loginResultDealModule.getActions().handleLoginResult(e):this.getActions().thirdLogin(e)))))))}handleHelloLoginEvent(e){return e.pipe((0,io.Z)((()=>this.helloJS.ListenLogin().pipe((0,Oo.T)((e=>e.error_code?this.noop():this.getActions().thirdLogin(e)))))))}handleFacebookLogin(e){return e.pipe((0,io.Z)((()=>(0,oi.H)(this.facebookSdk.login()).pipe((0,Oo.T)((e=>(this.reportThirdGetToken(e),this.getActions().thirdLogin(e))))))))}handleAppleLogin(e){return e.pipe((0,io.Z)((({appleToken:e})=>e?(0,ro.of)(this.appleSdk.tokenToAuthentication(e)):(0,oi.H)(this.appleSdk.login())))).pipe((0,P.M)((e=>this.reportThirdGetToken(e))),(0,Oo.T)((e=>e.error_code?"popup_closed_by_user"===e.error?this.noop():this.loginResultDealModule.getActions().handleLoginResult(e):this.getActions().thirdLogin(e))))}handlePopupAuthorize(e){return e.pipe((0,Io.E)(this.appBiz.state$),(0,io.Z)((([{url:e,platform:t},{bizContext:o}])=>{var n;return this.jumpAuthorizationPage({url:e,isSmartPlayer:null===(n=null==o?void 0:o.playerInfo)||void 0===n?void 0:n.isSmartPlayer}).pipe((0,Oo.T)((({closeByUser:e})=>{if(e)return this.loginReport.thirdPartyLoginResult({error_code:-1,status:2,error_desc:"user cancel login"}),this.noop();const o=ci(t);if("twitter"===t){const e=JSON.stringify({oauth_token:o.oauth_token,oauth_verifier:o.oauth_verifier});o.code=ti.o4.encode(e)}return this.getActions().thirdLogin(Object.assign({openid:o.user_id,platform_app_id:ii.iU[t],platform:t},o))})))})))}authPageGoRedirect(e){return e.pipe((0,Io.E)(this.contextModule.state$),(0,Oo.T)((([{platform:e,state:t},{loginType:o,redirectUrl:n}])=>(((e,t)=>{const o=(0,ye.stringifyUrl)({url:`${window.location.origin}/login`,query:t});location.href=o,(0,_.AP)(vi,e)})(e,{type:o,redirect_url:n,state:t}),this.noop()))))}dealPageAuthRedirect(e){return e.pipe((0,Oo.T)((()=>{const e=(0,_._S)(vi);if(!e)return this.noop();if((0,_.sc)(vi),"line"===e){if(!window.location.search)return(0,ln.P)(this.t("Sorry, something went wrong, please try again later")),console.error("Login: Line missing state."),this.noop();{const{state:e}=St().parse(window.location.search.substr(1));if(li.getRandomString("line")!==e)return(0,ln.P)(this.t("Sorry, something went wrong, please try again later")),console.error("Login: Line state validation failed."),this.noop();li.clearData("line")}}const t=ci(e);if("twitter"===e){const e=JSON.stringify({oauth_token:t.oauth_token,oauth_verifier:t.oauth_verifier});t.code=ti.o4.encode(e)}return this.getActions().thirdLogin(Object.assign({platform_app_id:ii.iU[e],platform:e},t))})))}thirdLogin(e){return e.pipe((0,Io.E)(this.contextModule.state$),(0,io.Z)((([e,{isSecurityVerification:t}])=>e.error_code||!e.platform_app_id?(0,ro.of)(this.loginResultDealModule.getActions().handleLoginResult(e)):(ai.K.show(),(t?this.service.thirdVerify(Object.assign(Object.assign({},e),{login_only:!0})):this.service.thirdLogin(Object.assign(Object.assign({},e),{login_only:!0}))).pipe((0,Oo.T)((t=>(t.thirdQuery=Object.assign(Object.assign({},e),{profile_key:t.profile_key}),this.loginReport.setPlatform(e.platform),this.sloSlardar.setPlatform(e.platform),t.platform=e.platform,this.loginResultDealModule.getActions().handleLoginResult(t)))),(0,Do.Z)(this.getActions().setLoadingThirdParty(!0)),(0,lo.q)(this.getActions().setLoadingThirdParty(!1)))))))}jumpAuthorizationPage(e){const{url:t,isSmartPlayer:o}=e;let n="";o||(n="resizable,scrollbars,width=500,height=550,display=popup");const i=window.open(t,"_blank",n);return i?new co.c((e=>{const t=setInterval((()=>{(!i||i.closed||i.authDoneClose)&&(clearInterval(t),e.next({closeByUser:!i.authDoneClose}),i.authDoneClose&&i.close(),e.complete())}),100)})):(0,ni.I)()}reportThirdGetToken(e){var t;const{error_code:o,code:n,error_msg:i,error:a}=e;this.slardar.handleThirdGetToken({error_code:o?-1:0,error_message:null!==(t=null!=n?n:a)&&void 0!==t?t:i})}};(0,F.__decorate)([(0,to.uk)(),(0,F.__metadata)("design:type",co.c)],Fi.prototype,"dispose$",void 0),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Boolean]),(0,F.__metadata)("design:returntype",void 0)],Fi.prototype,"setLoadingThirdParty",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Fi.prototype,"handleHelloJSAuth",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Fi.prototype,"handleHelloLoginEvent",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Fi.prototype,"handleFacebookLogin",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Fi.prototype,"handleAppleLogin",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Fi.prototype,"handlePopupAuthorize",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Fi.prototype,"authPageGoRedirect",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Fi.prototype,"dealPageAuthRedirect",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Fi.prototype,"thirdLogin",null),Fi=(0,F.__decorate)([(0,oo.n)("ThirdPlatformModule"),(0,F.__param)(10,(0,Ao.y)(Eo.hp)),(0,F.__metadata)("design:paramtypes",[Uo.r,Z.$,ei.$,Oe.t,Ei,Pi,Li,Te.VU,C.$F,Te.le,Function])],Fi);const Ii="last_login_method",Hi="Sorry, something went wrong, please try again later",zi=e=>{switch(e){case"QRcode":return"qr";case"email":case"handle":case"phone":case"sms_verification":case"passkey":return"email";case"twitter":return"twitter";case"google":return"google";case"facebook":return"facebook";case"vk":return"vk";case"kakaotalk":return"kakaotalk";case"line":return"line";case"apple":return"apple";case"tiktok":return"tiktok";default:return}};function Di(e){const[t,o]=(0,L.useState)(!1);return{initialized:t,effect:(0,L.useCallback)((()=>(0,F.__awaiter)(this,void 0,void 0,(function*(){try{(0,_.nr)()&&(yield e.init())}finally{o(!0)}}))),[])}}function Ri(e,t,o){const n=null==o?void 0:o.platforms;if(!n)return t;return t.filter((t=>{const o=n[t.toLowerCase()];return!o||!(o.disable||e&&o.disableSignup)}))}const Oi=()=>{var e;const t=(0,s.Nj)(C.$F),o=(0,s.Nj)(Te.le),{pathname:n,query:i}=(0,xe.xw)(),a="true"===i.coin_spa,r=n.startsWith("/coin"),l=(0,ue.W)((()=>["abTestVersion"]),[]),d=null!==(e=(0,he.qt)(null==l?void 0:l.abTestVersion,"live_recharge_mobile_non_login_redesign_trigger_point"))&&void 0!==e?e:"v1",c=a&&("v2"===d||"v3"===d),p=a&&"v3"===d,u=r&&"v3"===d?"half_screen":"full_screen";return(0,L.useEffect)((()=>{t.setUiStyle(u),o.setUiStyle(u)}),[t,o,u]),{isRedesign:c,isSheetStyle:p,vid:d,isCoinSpa:a}},Wi=e=>{var t,o,i;const{isMobile:a,playerInfo:r,os:d}=(0,de.L$)((0,c.U)((()=>["isMobile","os","playerInfo"]),[])),{name:p,isSmartPlayer:u}=(0,de.L$)(r),{platformConfig:m,thirdPlatformConfig:x,lastLoginMethod:f,standaloneAid:b,standaloneAppVersion:_,disableStandaloneAppFlags:y}=Be((()=>["platformConfig","thirdPlatformConfig","lastLoginMethod","standaloneAid","standaloneAppVersion","disableStandaloneAppFlags"]),[]),{isMobileUiOptimize:v}=(0,h.Eo)(),C=zi(null!==(t=null!=f?f:Jn().get(Ii))&&void 0!==t?t:""),{isModal:j}=(0,l.Ph)(Oe.t),w=(0,sn.VN)(),S=(0,sn.c8)(),{handleAppleLogin:T,handlePopupAuthorize:P,handleHelloJSAuth:M,handleFacebookLogin:A,handleHelloLoginEvent:F,dealPageAuthRedirect:I}=(0,l.wA)(Fi),H=(0,g.s)("WebApp_Login"),z=(0,s.Nj)(Li),D=(0,s.Nj)(Pi),R=(0,E.W6)(),{pathname:O,search:W}=(0,E.zy)(),B=(0,ye.parse)(W),$=(0,Je.$H)(O),U=Ot(),N=!$&&(!a||u),{loginQRcode:V,loginPath:G}=(0,L.useMemo)((()=>{const e=j?W:"";return{loginQRcode:k.tH.loginQRcode+e,loginPath:$?U+e:k.tH.loginPhoneOrEmail+e}}),[j,W,$,U]),q=(0,L.useCallback)((e=>()=>{T({appleToken:e})}),[T]);(0,L.useEffect)((()=>(document.addEventListener("AppleIDSignInOnSuccess",q),()=>{document.removeEventListener("AppleIDSignInOnSuccess",q)})),[q]),(0,L.useEffect)((()=>{const e=yi();e&&"failed"===e&&((0,ln.P)(H(Hi)),console.error("Login: VK authorization failed."));const t=(()=>{if(!location.search)return;const{state:e,code:t}=ye.parse(location.search);if(!e)return;const o=(e=>{try{return JSON.parse(e)}catch(e){return null}})(e.toString());if(!o)return;const{platform:n,auth:i}=o;if("kakaotalk"!==n)return;const a=li.getRandomString("kakaotalk");let r="ok";return a&&i!==a?r="failed":di("kakaotalk",{code:null==t?void 0:t.toString(),redirect_uri:"https://www.tiktok.com/login"}),li.clearData("kakaotalk"),window.authDoneClose=!0,r})();t&&"failed"===t&&((0,ln.P)(H(Hi)),console.error("Login: KekaoTalk authorization failed.")),bi()&&F()}),[H,F]),(0,L.useEffect)((()=>{I()}),[I]);const{stopPolling:K}=cn(),Z=(0,L.useCallback)((()=>{S({platform:"QRcode",isSignUp:$}),w({platform:"QRcode",signUp:$}),R.push(V)}),[R,V,S,w,$]),Q=(0,L.useCallback)((()=>{K(),S({platform:"sms_email_handle",isSignUp:$}),R.push(G)}),[R,$,G,S,K]),{abTestVersion:J}=null!==(o=(0,ue.W)((()=>["abTestVersion"]),[]))&&void 0!==o?o:{},Y=null!==(i=(0,he.qt)(J,"enable_fb_sdk"))&&void 0!==i?i:"v1",X=(0,L.useCallback)((e=>()=>{switch(K(),S({platform:e,isSignUp:$}),w({platform:e,signUp:$}),e){case"apple":T({});break;case"twitter":P({url:pi(),platform:"twitter"});break;case"line":P({url:ui(),platform:"line"});break;case"facebook":case"google":if("facebook"===e&&"v2"===Y){A();break}M({force:"google"===e||null,platform:e,display:u?"page":"popup",redirect_uri:"https://www.tiktok.com/login/",scope:""});break;case"vk":P({url:gi(),platform:"vk"});break;case"kakaotalk":P({url:hi(),platform:"kakaotalk"})}}),[w,S,$,T,P,Y,M,u,A,K]),{initialized:ee,effect:te}=Di(z),{initialized:oe,effect:ne}=Di(D),{getTokenCalled:ie}=(0,l.Ph)(an),ae=gn(),{isRedesign:re}=Oi(),le={tiktok:{starlingText:re?"ttlive_enhanceLogin_logInPg_quickLoginBtn":"webLogin_useApp_btn",icon:re?Wn.A:()=>(0,n.jsx)(Xn,{}),onClick:ae,type:"tiktok",loading:!ie},apple:{starlingText:"common_login_panel_button_apple",icon:Bn.A,onClick:X("apple"),type:"apple",loading:!ee,effect:te},email:{starlingText:$?"common_registration_panel_button_phoneoremail":"common_login_panel_button_phoneoremailorusername",icon:v&&a?On:$n.A,onClick:Q,type:"email"},facebook:{starlingText:"common_login_panel_button_facebook",icon:Un.A,onClick:X("facebook"),type:"facebook",loading:!oe,effect:ne},google:{starlingText:"common_login_panel_button_google",icon:Nn.A,onClick:X("google"),type:"google"},kakaotalk:{starlingText:"common_login_panel_button_kakaotalk",icon:Vn.A,onClick:X("kakaotalk"),type:"kakaotalk"},line:{starlingText:"common_login_panel_button_line",icon:Gn.A,onClick:X("line"),type:"line"},phone:{starlingText:$?"common_registration_panel_button_phoneoremail":"common_login_panel_button_phoneoremailorusername",icon:v&&a?On:$n.A,onClick:Q,type:"phone"},qr:{starlingText:"common_login_panel_button_qrcode",icon:qn.A,onClick:Z,type:"qr"},twitter:{starlingText:"common_login_panel_button_twitter",icon:Kn.A,onClick:X("twitter"),type:"twitter"},vk:{starlingText:"common_login_panel_button_vk",icon:Zn.A,onClick:X("vk"),type:"vk"}},se=0!==m.order.length?m.order.toLowerCase().split(","):["facebook","google","apple","twitter","vk","line","kakaotalk"],ce=(0,h.ZO)(),pe=[...mi({isSignUp:$,brandName:p,platformList:Ri($,se,x),enabledAce:ce,disable_platform:B.disable_platform,isMobile:a,standaloneAid:b,disableAll:ji({disableStandaloneAppFlags:y,standaloneAid:b,standaloneAppVersion:_,os:d}),os:d}),"email","phone","tiktok"];return N&&pe.push("qr"),C&&(le[C].lastLoginMethod=!0),e.filter((e=>pe.includes(e))).map((e=>le[e]))},Bi=e=>{var t;const o=(0,ue.W)((()=>["abTestVersion"]),[]),n=null!==(t=(0,he.qt)(null==o?void 0:o.abTestVersion,"last_login_method"))&&void 0!==t?t:"v1",{pathname:i}=(0,E.zy)(),a=(0,Je.$H)(i),{lastLoginMethod:r}=Be((()=>["lastLoginMethod"]),[]);return(0,L.useMemo)((()=>{var t;const o=zi(null!==(t=null!=r?r:Jn().get(Ii))&&void 0!==t?t:"");return"v3"===n&&void 0!==o&&e.includes(o)&&!a?[o,...e.filter((e=>e!==o))]:e}),[e,a,r,n])};var $i=o(57061),Ui=o.n($i),Ni=o(27008),Vi=o(87461);const Gi=(0,Q.default)("h2",{target:"e1521l5b1"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"32px",margin:"16px auto",fontWeight:"bold",textAlign:"center",wordWrap:"break-word"}]),"label:H2Title;"),qi=(0,Q.default)("div",{target:"e1521l5b3"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:"15px",display:"flex",justifyContent:"space-between",marginBottom:"5px"}]),"label:DivDescription;"),Ki=(0,Q.default)("div",{target:"e1521l5b4"})((({theme:e})=>[{marginTop:"20px",border:"1px solid",borderColor:e.colors.LineSecondary2,padding:"13px",borderRadius:"2px",width:"100%",position:"relative",":before":{content:'""',height:"16px",position:"absolute",background:e.colors.BGPrimary,width:"16px",top:"-8px",left:"rtl"===e.direction?"unset":"calc(50% - 8px)",right:"rtl"===e.direction?"calc(50% - 8px)":"unset",borderInlineEnd:`1px solid ${e.colors.LineSecondary2}`,borderTop:`1px solid ${e.colors.LineSecondary2}`,transform:"rotateZ(-45deg)"}}]),"label:DivPhoneNotRegistered;"),Zi=(0,Q.default)("p",{target:"e1521l5b5"})((({theme:e,link:t})=>[{fontSize:"12px",lineHeight:"17px",color:t?e.colors.Primary:e.colors.TextPrimary,fontWeight:600,margin:"0 0 8px",cursor:"pointer"}]),"label:PPhoneNotRegistered;"),Qi=(0,Q.default)("input",{target:"e1521l5b6"})({width:"1px",height:"1px",border:"none",outline:"none",position:"fixed",top:"0px",left:"0px"},"label:InputPasskeyHack;");var Ji,Yi=o(57431),Xi=o(78400),ea=o(88825);!function(e){e.Init="init",e.GetCode="new",e.Scanned="scanned",e.Confirmed="confirmed",e.Expired="expired",e.Refused="refuse",e.Error="error",e.NeedRetry="need_retry"}(Ji||(Ji={}));let ta=class extends eo.E{constructor(e,t,o){super(),this.service=e,this.fetch=t,this.loginSlardar=o,this.defaultState={status:"init",inQrcodePage:!1}}setStatus(e,t){e.status=t}setInQRCodePage(e,t){e.inQrcodePage=t,t&&(e.status="init")}setGetQrcodeResult(e,t){const{qrCodeUrl:o,clientSecret:n,token:i,ttWid:a}=t;e.token=i,e.clientSecret=n,e.qrCodeUrl=o,e.status="new",e.ttWid=a}getQrCodeUrl(e){return e.pipe((0,io.Z)((()=>this.service.getQrCodeUrl({next:"https://www.tiktok.com"}).pipe((0,io.Z)((e=>{const{token:t,qrcode_index_url:o,ttwid_migration_ticket:n}=e;if(!t||!o)return(0,ro.of)(this.getActions().setStatus("need_retry"));const i=function(e=8){const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");let o="";for(let n=0;n{var o;return this.getActions().setGetQrcodeResult({token:t,clientSecret:i,qrCodeUrl:null!==(o=e.short_url)&&void 0!==o?o:c,ttWid:null!=n?n:""})})))}))))))}checkQrConnect(e){return e.pipe((0,Io.E)(this.state$),(0,io.Z)((([{ttpConfig:e,oldStatus:t},{token:o="",clientSecret:n="",ttWid:i=""}])=>this.checkQrcodeRequest({token:o,clientSecret:n,ttpConfig:e,oldStatus:t,ttWid:i}).pipe((0,Oo.T)((e=>{const{status:t,error_code:o,description:n}=e;return o?((0,ln.P)(n),this.getActions().setStatus("error")):this.getActions().setStatus(t)}))))))}shortenQrUrl(e){return this.fetch.post("https://www.tiktok.com/shorten/",{query:{safe_token:"true"},body:(0,wt.stringify)({belong:"tiktok-webapp-qrcode",persist:0,expired_time:3600,targets:e})}).pipe((0,Oo.T)((e=>{var t;return null!==(t=e.data[0])&&void 0!==t?t:{status:"failed",short_url:void 0}})),(0,so.W)((e=>(this.loginSlardar.QRCodeShortenFail({code:`${e.code}`}),(0,ro.of)({status:"failed",short_url:void 0})))))}checkQrcodeRequest(e){const{token:t,clientSecret:o,ttpConfig:n,oldStatus:i,ttWid:a=""}=e,{open:r,syncSeverList:l}=n||{},s=r?l:[{name:"gloable",domain:""}];return(0,Wo.p)(s.map((e=>this.service.checkQrconnect({token:null!=t?t:"",next:"https://www.tiktok.com",baseURL:e.domain,ttWid:a})))).pipe((0,io.Z)((e=>{const t=e.find((e=>e.client_secret===o));for(const n of e){const{status:e,client_secret:a,error_code:r,description:l}=t||n;if(this.state.inQrcodePage&&("init"===e||"new"===e||e===i))throw new Error("user not scanned, need check agin");return a===o?(0,ro.of)({status:e}):r?(0,ro.of)({error_code:r,description:l}):(0,ro.of)({status:e})}return(0,ro.of)(this.noop())})),(0,Xi.l)((e=>e.pipe((0,ea.o)((()=>(0,Ho.O)(800)))))))}};(0,F.__decorate)([(0,to.uk)(),(0,F.__metadata)("design:type",co.c)],ta.prototype,"dispose$",void 0),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,String]),(0,F.__metadata)("design:returntype",void 0)],ta.prototype,"setStatus",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Boolean]),(0,F.__metadata)("design:returntype",void 0)],ta.prototype,"setInQRCodePage",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Object]),(0,F.__metadata)("design:returntype",void 0)],ta.prototype,"setGetQrcodeResult",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],ta.prototype,"getQrCodeUrl",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],ta.prototype,"checkQrConnect",null),ta=(0,F.__decorate)([(0,oo.n)("QRCodeModule"),(0,F.__metadata)("design:paramtypes",[Uo.r,uo.p,Te.VU])],ta);const oa=o.p+"c4c40812758dc8175106.png",na=o.p+"0dbff97a224480a207b4.png";var ia=o(72081),aa=o(78448);const ra="1px solid #F2F2F2",la=(0,Q.default)("div",{target:"eot7zvz0"})((({theme:e,isTtincar:t})=>[{display:"flex",marginTop:"48px",justifyContent:"center",padding:e.isMobile?"0 32px":"unset"},t&&[{justifyContent:"center"},(0,J.jJ)({min:Ne.L7,style:{marginTop:"200px"}}),(0,J.Ee)({max:720,style:{marginTop:"40px"}}),(0,J.Ee)({min:1770,style:{marginTop:"537px"}})]]),"label:DivQRContentBody;"),sa=(0,Q.default)("div",{target:"eot7zvz1"})((({theme:e})=>[{display:"flex",justifyContent:"center",padding:e.isMobile?"0 32px":"unset"},e.isMobile&&(0,J.jJ)({min:Ne.L7,style:{justifyContent:"center",marginTop:"80px"}})]),"label:DivQRPopupContentBody;"),da=(0,Q.default)("div",{target:"eot7zvz2"})((({theme:e})=>[{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:e.isMobile?"0 32px":"unset"}]),"label:DivQRPopupContentBodyVertical;"),ca=(0,Q.default)("h2",{target:"eot7zvz4"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"12px",marginTop:"16px",marginBottom:"14px",textAlign:"center",wordWrap:"break-word"}]),"label:H2QRBottomRightPopupTitle;"),pa=(0,Q.default)("div",{target:"eot7zvz5"})((({theme:e})=>[{width:"100%"},e.isMobile&&(0,J.jJ)({min:Ne.L7,style:[{width:"360px"}]})]),"label:DivTextContainer;"),ua=(0,Q.default)("div",{target:"eot7zvz6"})((({theme:e})=>[{width:"100%",height:"208px",borderRadius:"11px",border:ra,margin:"auto",justifyContent:"center",display:"flex",alignItems:"center"},e.isMobile&&(0,J.jJ)({min:Ne.L7,style:{width:"360px",height:"360px",marginTop:"40px",background:"rgba(242, 242, 242, 1)"}})]),"label:DivCodeImage;"),ga=(0,Q.default)("div",{target:"eot7zvz7"})((({popupType:e})=>({width:"qr_bottom_right"===e?"104px":"311px",height:"qr_bottom_right"===e?"104px":"184px",borderRadius:"11px",border:"qr_bottom_right"===e?"none":ra,margin:"auto",justifyContent:"center",display:"flex",alignItems:"center"})),"label:DivCodePopupImage;"),ha=(0,Q.default)("div",{target:"eot7zvz8"})((({theme:e,showLoginOptionSlider:t})=>({width:"190px",height:"190px",backgroundColor:"#fff",borderRadius:"24px",border:ra,margin:t?"22px auto 14px":"8px auto 8px",boxShadow:e.isDark?"0 2px 15px rgba(255, 255, 255, 0.3), 0 0px 10px rgba(255, 255, 255, 0.5)":"0 2px 12px rgba(0, 0, 0, 0.12)",justifyContent:"center",display:"flex",alignItems:"center"})),"label:DivQRCodePopupImageRedesign;"),ma=(0,Q.default)("img",{target:"eot7zvz9"})((({theme:e,popupType:t})=>[{width:"qr_bottom_right"===t?"104px":"174px",height:"qr_bottom_right"===t?"104px":"174px",borderRadius:"11px",background:"#FFFFFF",padding:"12px",margin:"auto"},e.isMobile&&(0,J.jJ)({min:Ne.L7,style:{width:"280px",height:"280px"}})]),"label:ImgCode;"),xa=(0,Q.default)("div",{target:"eot7zvz11"})((({theme:e})=>[(0,J.mp)({direction:e.direction}),{position:"absolute",display:"flex",flexDirection:"column",width:"176px",height:"176px",backgroundColor:e.colors.BGReverse2,borderRadius:"12px",padding:"0 24px",justifyContent:"center",alignItems:"center"},e.isMobile&&(0,J.jJ)({min:Ne.L7,style:{width:"280px",height:"280px",padding:"0"}})]),"label:DivCodeMask;"),fa=(0,Q.default)("div",{target:"eot7zvz12"})((({theme:e,popupType:t})=>[(0,J.mp)({direction:e.direction}),{position:"absolute",display:"flex",flexDirection:"column",width:"qr_bottom_right"===t?"108px":"152px",height:"qr_bottom_right"===t?"108px":"152px",backgroundColor:e.colors.BGReverse2,borderRadius:"12px",padding:"0 24px",justifyContent:"center",alignItems:"center"}]),"label:DivPopupCodeMask;"),ba=(0,Q.default)("div",{target:"eot7zvz13"})((({theme:e})=>[(0,J.mp)({direction:e.direction}),{position:"absolute",display:"flex",flexDirection:"column",width:"174px",height:"174px",backgroundColor:e.isDark?"rgba(22, 24, 35, 0.7)":"rgba(250, 250, 250, 0.7)",borderRadius:"12px",padding:"0 24px",justifyContent:"center",alignItems:"center"}]),"label:DivPopupCodeMaskRedesign;"),_a=(0,Q.default)("span",{target:"eot7zvz14"})({fontSize:"42px",height:"30px",marginBottom:"24px"},"label:SpanSuccessIcon;"),ya=(0,Q.default)("p",{target:"eot7zvz15"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont"}),{fontWeight:600,lineHeight:"20px",fontSize:"14px",color:e.colors.TextPrimary},e.isMobile&&(0,J.jJ)({min:Ne.L7,style:{fontWeight:700,lineHeight:"44px",fontSize:"28px"}})]),"label:PCodeTip;"),va=(0,Q.default)("p",{target:"eot7zvz16"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont"}),{fontWeight:600,lineHeight:"20px",fontSize:"12px",color:e.colors.TextPrimary}]),"label:PPopupCodeTip;"),ka=(0,Q.default)("div",{target:"eot7zvz17"})({width:"100%",marginTop:"24px"},"label:DivStepContainer;"),Ca=(0,Q.default)("p",{target:"eot7zvz20"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{fontSize:"16px",lineHeight:"20px",marginBottom:"4px",svg:{verticalAlign:"middle"}},e.isMobile&&(0,J.jJ)({min:Ne.L7,style:{lineHeight:"38px",fontSize:"24px"}})]),"label:PStep;"),ja=(0,Q.default)("div",{target:"eot7zvz22"})({fontSize:"20px",lineHeight:1.3,textAlign:"center",fontWeight:500,color:"rgba(0, 0, 0, 1)"},"label:DivText;"),wa=(0,Q.default)(ia.A,{target:"eot7zvz23"})((({theme:e})=>({cursor:"pointer",fill:e.colors.TextPrimary,width:"28px",height:"28px"})),"label:StyledRefreshIcon;"),Sa=(0,Q.default)(aa.A,{target:"eot7zvz24"})({width:"24px",height:"24px",fill:"rgba(11, 224, 155, 1)"},"label:StyledTickIcon;"),Ta=()=>{var e;const t=(0,g.s)("WebApp_Login"),o=(0,g.s)("Webapp"),i=(0,sn.$m)(),{ttpConfig:a}=Be((()=>["ttpConfig"]),[]),r=(0,j.mZ)((e=>e.popupType)),{appId:s,region:d}=(0,de.L$)((0,ue.W)((()=>["appId","region"]),[])),{isMobile:p}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),[{qrCodeUrl:u,status:m},{getQrCodeUrl:x,checkQrConnect:f,setInQRCodePage:_,setStatus:y}]=(0,l.Su)(ta),{handleLoginResult:v}=(0,l.wA)(Z.$),{isTtincar:k}=(0,Ee.Qt)(),{search:C}=(0,E.zy)(),{enter_method:w}=(0,ye.parse)(C),{isInRedesignLoginPopupTreatment:S,showLoginOptionSlider:T}=(0,h.LK)(),[{isModal:P}]=(0,l.Su)(Oe.t),M=null!==(e="mandatory"===w)&&void 0!==e&&e,A=k&&M,F="https://sf-static.tiktokcdn.com/obj/tiktok-web-common-sg/mtact/static/images/tiktok-logo/logo.png",I=(0,L.useCallback)((()=>{x()}),[x]),H=(0,L.useCallback)((()=>{y("init"),x()}),[y]);(0,L.useEffect)((()=>(_(!0),I(),Vi.w.showQrCode(b.nf.getTrackingInfo()),()=>{_(!1)})),[]),(0,L.useEffect)((()=>{"scanned"===m&&(Vi.w.scanQrCode(b.nf.getTrackingInfo()),f({ttpConfig:a,oldStatus:"scanned"})),"confirmed"===m&&(i("QRcode"),v({error_code:0,region:d})),["expired","refuse","error"].includes(m)&&I()}),[f,v,m,a,d,I]),(0,L.useEffect)((()=>{u&&f({ttpConfig:a})}),[f,u,a]);const z=Me(Boolean(u));return"qr_bottom_right"===r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ca,{"data-e2e":"qr-page-title",children:o("desktopWeb_dynamicBottom_scanLogIn")}),(0,n.jsx)(sa,{children:(0,n.jsx)(pa,{children:(0,n.jsxs)(ga,{popupType:r,"data-e2e":"qr-code",children:[u?(0,n.jsx)(Ni.QRCode,{size:100,value:u,qrStyle:"dots",logoImage:F,removeQrCodeBehindLogo:!0,logoPadding:2,logoPaddingStyle:"square",eyeRadius:2,style:{borderRadius:"16px"}}):(0,n.jsx)(ma,{src:1233===s?oa:na,alt:"qrcode",onLoad:z,popupType:r}),"need_retry"===m&&(0,n.jsx)(fa,{popupType:r,onClick:H,children:(0,n.jsx)(_a,{children:(0,n.jsx)(wa,{})})}),["scanned","confirmed"].includes(m)&&(0,n.jsxs)(fa,{popupType:r,children:[(0,n.jsx)(_a,{children:(0,n.jsx)(Sa,{})}),(0,n.jsx)(va,{children:t("common_login_qrcode_status_scanned")})]}),"init"===m&&(0,n.jsx)(fa,{popupType:r,children:(0,n.jsx)(G.R,{center:!0,size:"small"})})]})})})]}):S?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(da,{children:[(0,n.jsxs)(ha,{"data-e2e":"qr-code",showLoginOptionSlider:T,children:[u?(0,n.jsx)(Ni.QRCode,{size:140,value:u,qrStyle:"dots",logoImage:F,removeQrCodeBehindLogo:!0,logoPadding:2,logoPaddingStyle:"square",eyeRadius:2,style:{borderRadius:"20px"}}):(0,n.jsx)(ma,{src:1233===s?oa:na,alt:"qrcode",onLoad:z,popupType:r}),"need_retry"===m&&(0,n.jsx)(ba,{onClick:H,children:(0,n.jsx)(_a,{children:(0,n.jsx)(wa,{})})}),["scanned","confirmed"].includes(m)&&(0,n.jsxs)(ba,{children:[(0,n.jsx)(_a,{children:(0,n.jsx)(Sa,{})}),(0,n.jsx)(va,{children:t("common_login_qrcode_status_scanned")})]}),"init"===m&&(0,n.jsx)(ba,{children:(0,n.jsx)(G.R,{center:!0,size:"small"})})]}),!P&&(0,n.jsxs)(ka,{"data-e2e":"qr-body",children:[(0,n.jsx)(Ca,{children:t("tiktoktv_login_modal_loginscreen_scanqr1")},1),(0,n.jsx)(Ca,{children:t("tiktoktv_login_modal_loginscreen_scanqr2")},2)]})]})}):(0,n.jsxs)(n.Fragment,{children:[p?(0,n.jsx)(at,{showLeft:!A,from:"qr-code",title:t("common_login_qrcode_title")}):(0,n.jsx)(Gi,{"data-e2e":"qr-page-title",children:t("common_login_qrcode_title")}),(0,n.jsx)(la,{isTtincar:k,children:(0,n.jsxs)(pa,{children:[k&&(0,n.jsx)(ja,{children:t("v2_car_onboarding_loginPageQRScan_body")}),(0,n.jsxs)(ua,{"data-e2e":"qr-code",children:[u?(0,n.jsx)(Ui(),{size:k?300:170,value:u,style:{borderRadius:"11px",background:"#FFFFFF",padding:"12px"}}):(0,n.jsx)(ma,{src:1233===s?oa:na,alt:"qrcode",onLoad:z}),"need_retry"===m&&(0,n.jsx)(xa,{onClick:H,children:(0,n.jsx)(_a,{children:(0,n.jsx)(wa,{onClick:H})})}),["scanned","confirmed"].includes(m)&&(0,n.jsxs)(xa,{children:[(0,n.jsx)(_a,{children:(0,n.jsx)(Sa,{})}),(0,n.jsx)(ya,{children:t("common_login_qrcode_status_scanned")})]}),"init"===m&&(0,n.jsx)(xa,{children:(0,n.jsx)(G.R,{center:!0,size:"small"})})]}),!k&&(0,n.jsxs)(ka,{"data-e2e":"qr-body",children:[(0,n.jsx)(Ca,{children:t("tiktoktv_login_modal_loginscreen_scanqr1")},1),(0,n.jsx)(Ca,{children:t("tiktoktv_login_modal_loginscreen_scanqr2")},2)]})]})})]})};var La=o(41476);const Pa=(0,L.memo)((function({disabled:e,children:t}){const{loginModalSwitchPath:o}=(0,l.Ph)(u.i);return o?(0,n.jsx)(La.Ay,{disabled:e,autoFocus:!1,children:t}):(0,n.jsx)(n.Fragment,{children:t})}));function Ma(){var e;const{pathname:t}=(0,E.zy)(),o=(0,Je.$H)(t),{platformConfig:n,platformConfigV2:i,lastLoginMethod:a}=Be((()=>["platformConfig","platformConfigV2","lastLoginMethod"]),[]),{isRedesign:r,isSheetStyle:l}=Oi(),s=r?i:n,d=un();let c=["qr","email",...s.order.toLowerCase().split(",").filter((e=>"instagram"!==e))];const p=zi(null!==(e=null!=a?a:Jn().get("last_login_method"))&&void 0!==e?e:"");return l&&p&&c.includes(p)&&!o&&(c=[p,...c.filter((e=>e!==p))]),d&&!o&&c.unshift("tiktok"),c}const Aa=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,g.s)("Webapp"),{query:o}=(0,xe.xw)(),i="1"===o.pure,{isRedesign:a,isSheetStyle:r}=Oi(),[d,p]=(0,L.useState)(null),[f,_]=(0,L.useState)(!1),{loginType:y}=Be((()=>["loginType"]),[]),{isMobile:v,hashedIP:w}=(0,de.L$)((0,c.U)((()=>["isMobile","playerInfo","hashedIP"]),[])),[S,T]=(0,L.useState)(!1),{isMobileUiOptimize:P}=(0,h.Eo)(),A=(0,l.wA)(u.i),F=Ma(),[{loginModalShow:I,closeCallback:H,isGuestMode:z,isGuestModeUI:D},{setLoginModalShow:R,setCloseCallback:O,setGroupId:W,setIsLoginOnLoadClosed:B}]=(0,j.MR)((e=>({loginModalShow:e.loginModalShow,closeCallback:e.closeCallback,isGuestMode:e.isGuestMode,isGuestModeUI:e.isGuestModeUI})),M.bN),{showLoginOptionButton:$}=(0,h.LK)(),{isInVerification:U,isInBasicTreatment:N}=(0,h.Pl)(),V=(0,pe.TJ)(),G=(0,s.Nj)(C.$F),q=Bi(F);let K=Wi(q);$&&I&&(K=K.filter((e=>"qr"!==e.type)));const{loginTitle:Z,loginSlogan:Q,signUpSlogan:J,signUpTitle:Y,thirdPlatformConfig:X}=Be((()=>["loginTitle","loginSlogan","signUpSlogan","signUpTitle","thirdPlatformConfig"]),[]),{pathname:ee,search:te}=(0,E.zy)(),oe=$e(),ne=(0,ue.W)((()=>["abTestVersion","user","webIdCreatedTime","region"]),[]),ie=(0,de.L$)((0,c.U)((()=>["vgeo"]),[])),{vgeo:ae}=ie,re=(0,ge.oN)(ee),le=(0,he.qt)(null==ne?void 0:ne.abTestVersion,"periodic_login_popup_interval"),se=(0,L.useMemo)((()=>[{expId:"webapp_guest_mode",segmentId:"segment_default",versionId:z?"v12":"v1",propertyList:["cta_style","login_text","signup_text","close_icon"]}]),[z]),{cta_style:Ce="default",login_text:je="pcWeb_guestLogin_without",signup_text:we="pcWeb_guestLogin_withoutSignup"}=(0,L.useMemo)((()=>(0,m.J)(x.a,se)),[se]),[Se,Te]=(0,L.useState)(!1);!function(){const{pathname:e}=(0,E.zy)(),t=(0,Je.$H)(e),{user:o}=(0,de.L$)((0,ue.W)((()=>["user"]),[])),n=(0,s.Nj)(C.$F),i=un(),{getOneTapToken:a}=(0,l.wA)(an);(0,L.useEffect)((()=>{o||!i||t||(n.oneTapShow({e2eInfo:b.nf.getTrackingInfo()}),a())}),[o,i])}(),(0,L.useEffect)((()=>{Te(z||D)}),[z,D]);let Le=Z;"v3"!==le&&"v5"!==le||(Le="login_popup_modal_header"),a&&(Le="ttlive_enhanceLogin_logInPg_title");const Pe=(0,E.W6)(),Ee=(0,L.useMemo)((()=>{var e;return!(null===(e=(0,ye.parse)(te))||void 0===e?void 0:e.hide_left_icon)}),[te]),Fe=(0,Je.$H)(ee),Ie=(0,L.useMemo)((()=>({isMobileUiOptimize:v&&P})),[v,P]),He=(0,L.useCallback)((()=>(0,n.jsx)(At,Object.assign({"data-e2e":Fe?"sign-up-title":"login-title",id:"login-modal-title"},Ie,{children:"non_login"!==y||Fe?e(Fe?Y:Le,{},rt.fN):t(Le,{},rt.fN)}))),[e,Fe,Le,y,Ie,Y,t]),ze=(0,L.useCallback)((()=>{if(I&&"loginm3"!==y)return null;const o=a?"ttlive_enhanceLogin_logInPg_desc":Q,i="loginm3"!==y?e(Fe?J:o,{},rt.R2):t(o,{},rt.R2),r=Fe?"sign-up-desc":"login-desc";return(0,n.jsx)(Mt,Object.assign({"data-e2e":r},Ie,{children:i}))}),[e,a,Fe,I,Q,y,Ie,J,t]),De=(0,L.useCallback)((e=>{9===e.keyCode&&T(!0)}),[]),Re=(0,L.useCallback)((()=>{_(!0),be.j.handleOtherLoginOptionsClick({page_name:re})}),[]),[We,Ue]=(0,L.useState)(!0);(0,L.useEffect)((()=>{var e;Ue(!z&&!D||v||!I||"1"===(null!==(e=localStorage.getItem("guest-mode-flag"))&&void 0!==e?e:"0")&&!D)}),[D,z,v,I]);const Ne=(0,me.eu)(),Ve=(0,L.useCallback)((()=>{var e;R(!1),localStorage.setItem("guest-mode-flag","1"),localStorage.setItem("timeOfLastPopup",Date.now().toString());const t=(0,fe.uh)(ae,!1);G.updateTeaDataCollectionEnabled(t),G.loginNotifyClose({isSignUp:Fe?"1":"0",e2eInfo:b.nf.getTrackingInfo()}),A.setLoginModalInitialState(),H(),O(ve.l),W(void 0),B({isLoginOnLoadClosed:!0}),(U||N)&&V.maybeGenerateAndReportGlobalWidInfo({enterMethod:"post_guest_mode",hashedIP:w,region:null!==(e=null==ne?void 0:ne.region)&&void 0!==e?e:""})}),[R,G,Fe,A,H,O,W,B,Ne]),Ge=(0,h.ZO)(),qe=(0,L.useCallback)(((e,t)=>()=>{var o,n;if(null===(n=(null!==(o=null==X?void 0:X.platforms)&&void 0!==o?o:{})[e])||void 0===n?void 0:n.enableAce)return p(e),void _e.t.handleNotifyShow();"facebook"===e&&!Fe&&Ge?(p(e),_e.t.handleNotifyShow()):t()}),[Fe,Ge,X]),Ke=t=>t.map((t=>(0,n.jsx)(Ct,{text:e(t.starlingText),Icon:t.icon,onClick:qe(t.type,t.onClick),floatingBannerText:!t.lastLoginMethod||(null==ne?void 0:ne.user)||Fe?void 0:e("encouragePreviousLoginPlatform_loginPage_loginBadge_body"),focusable:!0,loading:t.loading,effect:t.effect,buttonTheme:a&&"tiktok"===t.type?"coin":"default"},t.starlingText))),Ze=(0,L.useCallback)((()=>{Te(!1)}),[]),Qe=(0,L.useCallback)((e=>{13===e.keyCode&&Te(!1)}),[Te]);let Ye;const Xe=(0,he.qt)(null==ne?void 0:ne.abTestVersion,"new_guest_mode_hot"),et=(0,he.qt)(null==ne?void 0:ne.abTestVersion,"new_guest_mode_other"),tt=(0,ye.parse)(te).enter_from,ot="homepage_hot"===tt||"explore"===tt;tt&&(ot&&"v1"===Xe||!ot&&"v1"===et)&&(Ye="pcWeb_guestLogin_without");const nt="text"===Ce,it=nt?e(Fe?"common_registration_panel_entry_1":"common_login_panel_entry_1").replace("%s"," "):e("guestmode_signup_or"),lt=nt?"default":Ce,st=Fe?we:null!=Ye?Ye:je,dt=(0,L.useCallback)((()=>{p(null),_e.t.handleTipClose()}),[]),ct=(0,L.useCallback)((()=>{p(null),_e.t.handleGotoPhoneOrEmail();const e=I?te:"",t=k.tH.loginPhoneOrEmail+e;Pe.push(t)}),[I,te,Pe]);Me();const{redirectUrl:pt}=(0,l.Ph)(Oe.t),{onClose:ut}=Dn(),gt=(0,L.useMemo)((()=>ut?()=>ut({redirectUrl:pt}):"1"===o.back_on_close?()=>{Pe.goBack()}:void 0),[ut,pt]),ht=un();return(0,n.jsxs)(n.Fragment,{children:[v&&(0,n.jsx)(at,{showClose:!0,showLeft:Ee,onClose:gt,isSheet:r}),!v&&I&&!Fe&&$&&We?(0,n.jsxs)(Pt,{isMobile:v,onKeyDown:De,children:[He(),(0,n.jsx)(Mt,{children:t(rt.p$.scanQRDescKey,{},rt.p$.scanQRDescDefault)}),(0,n.jsx)(Ta,{}),(0,n.jsxs)(Ae.bm,{children:[(0,n.jsx)(Ae.t_,{}),(0,n.jsx)(Ae.CA,{children:t("guestmode_signup_or",{},"OR")}),(0,n.jsx)(Ae.t_,{})]}),f?(0,n.jsxs)(Ft,{hideGuestMode:We,isModal:I,children:[ze(),(0,n.jsxs)(Pa,{disabled:S,children:[Ke(Se&&!We?K.slice(0,4):K),Se&&!We&&K.length>4&&(0,n.jsx)(ke,{onClick:Ze,onKeyDown:Qe,tabIndex:0,role:"button",children:(0,n.jsx)(ce.A,{})})]})]}):(0,n.jsx)(Ht,{children:(0,n.jsx)(Ct,{text:t(rt.p$.otherOptionsKey,{},rt.p$.otherOptionsDefault),onClick:Re,focusable:!0},rt.p$.otherOptionsKey)})]}):(0,n.jsxs)(Pt,{isMobile:v,onKeyDown:De,children:[He(),(0,n.jsxs)(Et,{hideGuestMode:We,isModal:I,children:[ze(),(0,n.jsxs)(Pa,{disabled:S,children:[Ke(Se&&!We?K.slice(0,4):K),Se&&!We&&K.length>4&&(0,n.jsx)(ke,{onClick:Ze,onKeyDown:Qe,tabIndex:0,role:"button",children:(0,n.jsx)(ce.A,{})})]})]}),(()=>{if(!We)return nt?(0,n.jsx)(Nt,{isButtonStyle:!0}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Ae.bm,{children:[(0,n.jsx)(Ae.t_,{}),(0,n.jsx)(Ae.CA,{children:it}),(0,n.jsx)(Ae.t_,{})]}),(0,n.jsx)(It,{children:(0,n.jsx)(Ct,{text:e(st),onClick:Ve,buttonTheme:lt,focusable:!0},"login-guest-button")})]})})()]}),!(null==oe?void 0:oe.hideCTA)&&v&&!i&&(0,n.jsx)(Lo,{}),(0,n.jsx)(Mo,{isMobile:v,visible:!!d,platform:d,onOtherLogin:ct,onClose:dt}),ht&&(0,n.jsx)(Rn,{})]})};var Ea=o(64840),Fa=o(26027),Ia=o(22784);const Ha={id:"apple-e3f80e82",use:"apple-e3f80e82-usage",viewBox:"0 0 48 48",content:''};function za(e){const t=(0,L.useContext)(Fe.X);return(0,L.useLayoutEffect)((()=>(t.add(Ha),()=>{t.remove("apple-e3f80e82")})),[]),(0,n.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,n.jsx)("use",{xlinkHref:"#apple-e3f80e82"},void 0)}),void 0)}const Da=(0,Q.default)("div",{target:"exattu0"})({display:"flex",alignItems:"center",justifyContent:"center",fontSize:"24px"},"label:DivShowMore;");Da.defaultProps=Object.assign(Object.assign({},Da.defaultProps),{"data-e2e":"see-more-btn"});const Ra={facebook:{text:"common_login_panel_button_facebook",icon:Un.A},google:{text:"common_login_panel_button_google",icon:Nn.A},twitter:{text:"common_login_panel_button_twitter",icon:Kn.A},instagram:{text:"common_login_panel_button_instagram",icon:Fa.A},apple:{text:"common_login_panel_button_apple",icon:()=>(0,n.jsx)(za,{})},line:{text:"common_login_panel_button_line",icon:Gn.A},kakaotalk:{text:"common_login_panel_button_kakaotalk",icon:Vn.A},vk:{text:"common_login_panel_button_vk",icon:Zn.A}},Oa=({signUp:e,platformConfigOverride:t})=>{var o,i;const a=(0,sn.VN)(),r=(0,sn.c8)(),s=(0,g.s)("WebApp_Login"),d=(0,E.W6)();let{platformConfig:p,thirdPlatformConfig:u}=Be((()=>["platformConfig","thirdPlatformConfig"]),[]),m=!1;t&&(p=t,m=!0);const{isMobile:x,playerInfo:f}=(0,de.L$)((0,c.U)((()=>["isMobile","playerInfo"]),[])),{name:b,isSmartPlayer:_}=(0,de.L$)(f),{abTestVersion:y}=null!==(o=(0,ue.W)((()=>["abTestVersion"]),[]))&&void 0!==o?o:{},v=null!==(i=(0,he.qt)(y,"enable_fb_sdk"))&&void 0!==i?i:"v1",{setShowInstagramCantLoginModal:C}=(0,l.wA)(Ia.S),{handleAppleLogin:j,handlePopupAuthorize:w,handleHelloJSAuth:S,handleHelloLoginEvent:T,handleFacebookLogin:P,dealPageAuthRedirect:M}=(0,l.wA)(Fi),[A,F]=(0,L.useState)(!1),I=(e=>{const t={show_num:2,order:"FACEBOOK,GOOGLE,INSTAGRAM,LINE,TWITTER,KAKAOTALK"},{isSignUp:o,platform:n,brandName:i="",platformConfig:a=t,phoenix:r}=e,l=Boolean(i),s=/mercedes/i.test(i),d="FACEBOOK,GOOGLE,TWITTER,APPLE,INSTAGRAM,LINE,KAKAOTALK,VK".toLocaleLowerCase().split(","),c="APPLE,INSTAGRAM".toLocaleLowerCase().split(","),p="LINE,KAKAOTALK,APPLE".toLocaleLowerCase().split(",");l&&(p.push("instagram","vk"),s&&p.push("facebook","twitter"));const u=r?{show_num:4,order:"FACEBOOK,GOOGLE,TWITTER,APPLE"}:a,g={expand:[],fold:[]};if(n){const e=d.find((e=>e===n));return e&&g.expand.push(e),g}const h=u.order.toLocaleLowerCase().split(","),m={expand:[...h.slice(0,u.show_num)],fold:[...h.slice(u.show_num)]};return l&&(m.expand=m.expand.filter((e=>!p.includes(e))),m.fold=m.fold.filter((e=>!p.includes(e)))),o?(m.expand=m.expand.filter((e=>!c.includes(e))),m.fold=m.fold.filter((e=>!c.includes(e)))):m.expand=m.expand.concat(m.fold),m.expand=m.expand.filter((e=>d.includes(e))),m.fold=m.fold.filter((e=>d.includes(e))),m})({platformConfig:p,isSignUp:e,brandName:b}),[H,z]=(0,L.useState)(null),D=(0,L.useCallback)((()=>{const e=pi();w({url:e,platform:"twitter"})}),[w]),R=(0,L.useCallback)((()=>{const e=ui();w({url:e,platform:"line"})}),[w]),O=(0,L.useCallback)((()=>{const e=gi();w({url:e,platform:"vk"})}),[w]),W=(0,L.useCallback)((()=>{const e=hi();w({url:e,platform:"kakaotalk"})}),[w]),B=(0,L.useCallback)((()=>{x?C(!0):d.push({pathname:k.tH.loginDownloadApp,state:{fromIns:!0}})}),[x,C,d]),$=(0,h.ZO)(),U=(0,L.useCallback)((()=>{z(null),_e.t.handleTipClose()}),[]),N=(0,jt.K)({query:{enter_method:"sso_auto_popup"},loginPath:"/login/phone-or-email"}),V=(0,L.useCallback)((()=>{z(null),_e.t.handleGotoPhoneOrEmail(),N()}),[]),G=(0,L.useCallback)((t=>()=>{var o,n,i,l;if(r({platform:t,isSignUp:e}),a({platform:t,signUp:e}),null===(n=(null!==(o=null==u?void 0:u.platforms)&&void 0!==o?o:{})[t])||void 0===n?void 0:n.enableAce)z(t);else switch(t){case"apple":j({});break;case"twitter":D();break;case"line":R();break;case"facebook":case"google":if("facebook"===t&&$){z(t);break}if("facebook"===t&&"v2"===v){P();break}S({force:"google"===t||null,platform:t,display:_?"page":"popup",redirect_uri:"https://www.tiktok.com/login/",scope:null!==(l=null===(i=Ra[t])||void 0===i?void 0:i.scope)&&void 0!==l?l:""});break;case"vk":O();break;case"kakaotalk":W();break;case"instagram":B()}}),[a,r,e,j,D,R,$,v,S,_,O,W,B,P,u]),q=(0,L.useCallback)((()=>{F(!0)}),[]),K=(0,L.useCallback)((e=>()=>{j({appleToken:e})}),[j]);(0,L.useEffect)((()=>(document.addEventListener("AppleIDSignInOnSuccess",K),()=>{document.removeEventListener("AppleIDSignInOnSuccess",K)})),[K]),(0,L.useEffect)((()=>{yi(),bi()&&T()}),[T]),(0,L.useEffect)((()=>{M()}),[M]);const Z=(0,L.useCallback)((e=>{13===e.keyCode&&F(!0)}),[F]);return(0,n.jsxs)(n.Fragment,{children:[I.expand.map((e=>Ra[e]?(0,n.jsx)(Ct,{text:s(Ra[e].text),type:e,Icon:Ra[e].icon,onClick:G(e),isPopup:m,focusable:!0},e):null)),I.fold.length>0&&e&&!A&&(0,n.jsxs)(Da,{onClick:q,onKeyDown:Z,tabIndex:0,role:"button",children:[" ",(0,n.jsx)(ce.A,{})]}),A&&I.fold.map((e=>Ra[e]?(0,n.jsx)(Ct,{text:s(Ra[e].text),Icon:Ra[e].icon,onClick:G(e),focusable:!0},e):null)),(0,n.jsx)(Mo,{isMobile:x,visible:!!H,platform:H,onOtherLogin:V,onClose:U})]})};var Wa=o(92246);const Ba=(0,L.memo)((function({disabled:e,children:t}){const{loginModalSwitchPath:o}=(0,l.Ph)(u.i);return o?(0,n.jsx)(La.Ay,{disabled:e,autoFocus:!1,children:t}):(0,n.jsx)(n.Fragment,{children:t})})),$a=(0,Q.default)("div",{target:"ey83qp81"})((({isMobile:e})=>({padding:e?"0 30px":"unset"})),"label:DivHomeContainer;"),Ua=(0,Q.default)("h2",{target:"ey83qp83"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"18px",margin:"16px auto",fontWeight:"bold",textAlign:"center"}]),"label:H2Title;"),Na=()=>{const e=(0,g.s)("WebApp_Login"),{isModal:t}=(0,l.Ph)(Oe.t),{isMobile:o}=(0,de.L$)((0,c.U)((()=>["isMobile","playerInfo"]),[])),i=(0,s.Nj)(Wa.q),[a,r]=(0,L.useState)(!1),d=(0,E.zy)(),p=(0,L.useMemo)((()=>{var e;return!(null===(e=(0,ye.parse)(d.search))||void 0===e?void 0:e.hide_left_icon)}),[d]);document.body.className=document.body.className.replace(/\s?hidden/g,"");const{pathname:u,search:h}=d,m=(0,Je.$H)(u),x=Ot(),f=(0,jt.K)({query:{enter_method:"sso_auto_popup"},loginPath:"/login/phone-or-email"}),b=(0,jt.K)({query:{enter_method:"sso_auto_popup"},loginPath:i.redirectNewModalPage});(0,L.useEffect)((()=>{i.redirectNewModalPage&&(b(),i.setRedirectNewModalPage())}),[i.redirectNewModalPage]);const _=(0,L.useCallback)((()=>(0,n.jsx)(Ua,{"data-e2e":"login-title",id:"login-modal-title",children:(0,n.jsx)(gt,{max:18,text:e("qr_code_login_prompt_popup_header")})})),[e,m]),{loginPath:y}=(0,L.useMemo)((()=>{const e=t?h:"";return{loginQRcode:k.tH.loginQRcode+e,loginPath:m?x+e:k.tH.loginPhoneOrEmail+e}}),[t,h,m,x]),v=(0,L.useCallback)((e=>{9===e.keyCode&&r(!0)}),[]),C=(0,L.useMemo)((()=>({show_num:2,order:"GOOGLE,FACEBOOK"})),[]);return(0,L.useEffect)((()=>{Ea.r.showSsoModal()}),[]),Me(),(0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsx)(at,{showClose:!0,showLeft:p}),(0,n.jsxs)($a,{isMobile:o,onKeyDown:v,children:[_(),(0,n.jsxs)(Ba,{disabled:a,children:[(0,n.jsx)(Oa,{signUp:m,platformConfigOverride:C}),(0,n.jsx)(Bt,{underline:!1,path:y,children:(0,n.jsx)(Ct,{text:e(m?"common_registration_panel_button_phoneoremail":"common_login_panel_button_phoneoremailorusername"),Icon:$n.A,isPopup:!0,onClick:f,focusable:!0})})]})]})]})};var Va=o(63379),Ga=o(77156);let qa=class extends eo.E{constructor(){super(...arguments),this.defaultState={password:""}}setPassword(e,t){e.password=t}setHasInvalid(e,t){e.hasInvalid=t}setLengthValid(e,t){e.lengthValid=t}setContentValid(e,t){e.contentValid=t}updatePassword(e){return e.pipe((0,io.Z)((({value:e})=>{const{hasInvalid:t,contentValid:o,lengthValid:n}=(0,Ga.lY)(e);return(0,ro.of)(this.getActions().setPassword(e),this.getActions().setHasInvalid(t),this.getActions().setLengthValid(n),this.getActions().setContentValid(o))})))}};(0,F.__decorate)([(0,to.uk)(),(0,F.__metadata)("design:type",co.c)],qa.prototype,"dispose$",void 0),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,String]),(0,F.__metadata)("design:returntype",void 0)],qa.prototype,"setPassword",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Object]),(0,F.__metadata)("design:returntype",void 0)],qa.prototype,"setHasInvalid",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Object]),(0,F.__metadata)("design:returntype",void 0)],qa.prototype,"setLengthValid",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Object]),(0,F.__metadata)("design:returntype",void 0)],qa.prototype,"setContentValid",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],qa.prototype,"updatePassword",null),qa=(0,F.__decorate)([(0,oo.n)("SetPasswordModule")],qa);var Ka=o(8615);let Za=class extends eo.E{constructor(e,t){super(),this.service=e,this.t=t,this.defaultState={bindPhoneLoading:!1,bindEmailLoading:!1}}setSuccess(e){e.success=!0}setErrorMsg(e,t){e.errorMsg=t}setBindPhoneLoading(e,t){e.bindPhoneLoading=t}setBindEmailLoading(e,t){e.bindEmailLoading=t}checkAndBindPhone(e){return e.pipe((0,io.Z)((e=>this.service.validateAndBindPhone(e).pipe((0,Oo.T)((e=>this.getActions().handleCheckResult(Object.assign(Object.assign({},e),{isPhone:!0})))),(0,Do.Z)(this.getActions().setBindPhoneLoading(!0)),(0,lo.q)(this.getActions().setBindPhoneLoading(!1))))))}checkAndBindEmail(e){return e.pipe((0,io.Z)((e=>this.service.validateAndBindEmail(e).pipe((0,Oo.T)((e=>this.getActions().handleCheckResult(Object.assign(Object.assign({},e),{isPhone:!1})))),(0,Do.Z)(this.getActions().setBindEmailLoading(!0)),(0,lo.q)(this.getActions().setBindEmailLoading(!1))))))}handleCheckResult(e){return e.pipe((0,io.Z)((e=>{const{error_code:t,description:o,isPhone:n}=e;return t?(0,ro.of)(this.getActions().setErrorMsg(o)):((0,ln.P)(this.t(n?"login_fb_phoneLinked_toast":"login_fb_emailLinked_toast")),n?Ka._.linkPhoneNumberSuccess():Ka._.linkEmailSuccess(),(0,ro.of)(this.getActions().setSuccess()))})))}};(0,F.__decorate)([(0,to.uk)(),(0,F.__metadata)("design:type",co.c)],Za.prototype,"dispose$",void 0),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object]),(0,F.__metadata)("design:returntype",void 0)],Za.prototype,"setSuccess",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,String]),(0,F.__metadata)("design:returntype",void 0)],Za.prototype,"setErrorMsg",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Boolean]),(0,F.__metadata)("design:returntype",void 0)],Za.prototype,"setBindPhoneLoading",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Boolean]),(0,F.__metadata)("design:returntype",void 0)],Za.prototype,"setBindEmailLoading",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Za.prototype,"checkAndBindPhone",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Za.prototype,"checkAndBindEmail",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],Za.prototype,"handleCheckResult",null),Za=(0,F.__decorate)([(0,oo.n)("BindPhoneOrEmailModule"),(0,F.__param)(1,(0,Ao.y)(Eo.hp)),(0,F.__metadata)("design:paramtypes",[Uo.r,Function])],Za);var Qa=o(44319),Ja=o(30903),Ya=o(3513);const Xa={email_verify:"email",pwd_verify:"password",mobile_sms_verify:"phone",totp_verify:"totp"},er={email:"email_verify",password:"pwd_verify",phone:"mobile_sms_verify",totp:"totp_verify"};let tr=class extends eo.E{constructor(e,t,o,n,i,a){super(),this.service=e,this.third=t,this.login=o,this.loginReport=n,this.phone=i,this.t=a,this.defaultState={loginLoading:!1}}setTwoStepVerifyRes(e,t){var o;const n=t.verify_ways,i={};n.forEach((({verify_way:e,mobile:t,email:o})=>{i[e]=e===er.totp?"totp":null!=t?t:o})),e.verifyWays=i,e.type=t.default_verify_way||(null===(o=n[0])||void 0===o?void 0:o.verify_way),e.isTwoStep=Boolean(null==t?void 0:t.default_verify_way),e.thirdQuery=t.thirdQuery,e.accountQuery=t.accountQuery,e.password=t.password,e.verify_ticket=t.verify_ticket,e.not_login_ticket=t.not_login_ticket,e.sms_code_key=t.sms_code_key,e.resetPwdType=t.resetPwdType,e.email=t.email}setTwoStepType(e,t){e.type=t}setErrorMsg(e,t){e.errorMsg=this.overrideErrorMsg(e,t)}setErrorCode(e,t){e.errorCode=t}setLoginLoading(e,t){e.loginLoading=t}handleTOTPVerifyAndRestPwd(e){return e.pipe((0,Io.E)(this.state$),(0,io.Z)((([e,{verify_ticket:t,resetPwdType:o}])=>{const{code:n,password:i}=e;return this.service.verifyTOTPCode({code:n,verify_ticket:t}).pipe((0,P.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:"totp"}))),(0,Ai.n)((e=>e.error_code?(0,ro.of)(this.getActions().setErrorCode(e.error_code),this.getActions().setErrorMsg(e.description)):(0,ro.of)(this.login.getActions().handleChangePwdByTicket({password:i,ticket:t,type:null!=o?o:"email"})))),(0,Do.Z)(this.getActions().setLoginLoading(!0)),(0,lo.q)(this.getActions().setLoginLoading(!1)))})))}handleTOTPVerifyAndSmsLogin(e){return e.pipe((0,Io.E)(this.state$,this.phone.state$),(0,io.Z)((([e,{sms_code_key:t=""},{mobile:o}])=>this.service.verifyTOTPCode(e).pipe((0,P.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:"totp"}))),(0,Ai.n)((e=>e.error_code?(0,ro.of)(this.getActions().setErrorCode(e.error_code),this.getActions().setErrorMsg(e.description)):this.service.smsLoginContinue({mobile:o,sms_code_key:t}).pipe((0,Oo.T)((e=>this.login.getActions().handleLoginResult(e))),(0,Do.Z)(this.getActions().setLoginLoading(!0)),(0,lo.q)(this.getActions().setLoginLoading(!1))))),(0,Do.Z)(this.getActions().setLoginLoading(!0)),(0,lo.q)(this.getActions().setLoginLoading(!1))))))}handlePasswordVerify(e){return e.pipe((0,Io.E)(this.state$,this.phone.state$),(0,io.Z)((([e,{sms_code_key:t=""},{mobile:o}])=>this.service.accountVerify(e).pipe((0,P.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:"password"}))),(0,Ai.n)((e=>e.error_code?(0,ro.of)(this.getActions().setErrorMsg(e.description)):this.service.smsLoginContinue({mobile:o,sms_code_key:t}).pipe((0,Oo.T)((e=>this.login.getActions().handleLoginResult(e))),(0,Do.Z)(this.getActions().setLoginLoading(!0)),(0,lo.q)(this.getActions().setLoginLoading(!1))))),(0,Do.Z)(this.getActions().setLoginLoading(!0)),(0,lo.q)(this.getActions().setLoginLoading(!1))))))}handleCodeVerify(e){return e.pipe((0,Io.E)(this.state$),(0,io.Z)((([e,{type:t="",thirdQuery:o,accountQuery:n}])=>o||n?(t===er.email?this.service.validateEmailCodeForLogin(e):t===er.totp?this.service.verifyTOTPCode(e):this.service.validateMobileCodeForLogin(e)).pipe((0,P.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:Xa[t]}))),(0,Ai.n)((e=>e.error_code?(0,ro.of)(this.getActions().setErrorCode(e.error_code),this.getActions().setErrorMsg(e.description)):o?(0,ro.of)(this.third.getActions().thirdLogin(o)):n?(0,ro.of)(this.login.getActions().handlePasswordLogin(n)):(0,ro.of)(this.noop()))),(0,Do.Z)(this.getActions().setLoginLoading(!0)),(0,lo.q)(this.getActions().setLoginLoading(!1))):t===er.totp?(0,ro.of)(this.getActions().handleTOTPVerifyAndSmsLogin(e)):(0,ro.of)(this.getActions().handleEmailCodeVerify(e)))))}handleEmailCodeVerify(e){return e.pipe((0,io.Z)((e=>this.service.emailCodeLogin(e).pipe((0,P.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:"email"}))),(0,Oo.T)((e=>this.login.getActions().handleLoginResult(e))),(0,Do.Z)(this.getActions().setLoginLoading(!0)),(0,lo.q)(this.getActions().setLoginLoading(!1))))))}handleSmsCodeVerifyReset(e){return e.pipe((0,io.Z)((e=>this.service.validateMobileCodeForReset(e).pipe((0,P.M)((e=>this.reportTwoStepResult({error_code:e.error_code,type:"phone"}))),(0,Oo.T)((e=>this.login.getActions().handleLoginResult(e))),(0,Do.Z)(this.getActions().setLoginLoading(!0)),(0,lo.q)(this.getActions().setLoginLoading(!1))))))}reportTwoStepResult(e){this.loginReport.twoStepResult({verification_method:e.type,result:e.error_code?"fail":"success",error_code:e.error_code})}overrideErrorMsg(e,t){if(!t||!e.errorCode)return t;if(Ya._j.includes(e.errorCode)&&Ya.rS[e.errorCode]){const t=Ya.rS[e.errorCode];return this.t(t)}return t}};(0,F.__decorate)([(0,to.uk)(),(0,F.__metadata)("design:type",co.c)],tr.prototype,"dispose$",void 0),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Object]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"setTwoStepVerifyRes",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Object]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"setTwoStepType",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,String]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"setErrorMsg",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Number]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"setErrorCode",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Boolean]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"setLoginLoading",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"handleTOTPVerifyAndRestPwd",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"handleTOTPVerifyAndSmsLogin",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"handlePasswordVerify",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"handleCodeVerify",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"handleEmailCodeVerify",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],tr.prototype,"handleSmsCodeVerifyReset",null),tr=(0,F.__decorate)([(0,oo.n)("TwoStepModule"),(0,F.__param)(5,(0,Ao.y)(Eo.hp)),(0,F.__metadata)("design:paramtypes",[Uo.r,Fi,Z.$,C.$F,Qa.U,Function])],tr);let or=class extends eo.E{constructor(e,t){super(),this.service=e,this.history=t,this.defaultState={checkCodeLoading:!1,ticket:"",type:"phone"}}setErrorMsg(e,t){e.errorMsg=t}setTicket(e,t){e.ticket=t}setType(e,t){e.type=t}setForceResetTicket(e,t){e.conditional_login_ticket=t}setCheckCodeLoading(e,t){e.checkCodeLoading=t}checkEmailCodeForReset(e){return e.pipe((0,io.Z)((e=>this.service.validateEmailCodeForReset(e).pipe((0,Oo.T)((e=>(e.resetType="email",this.getActions().handleCheckResult(e)))),(0,Do.Z)(this.getActions().setCheckCodeLoading(!0)),(0,lo.q)(this.getActions().setCheckCodeLoading(!1))))))}checkPhoneCodeForReset(e){return e.pipe((0,io.Z)((e=>this.service.validatePhoneCodeForReset(e).pipe((0,Oo.T)((e=>(e.resetType="phone",this.getActions().handleCheckResult(e)))),(0,Do.Z)(this.getActions().setCheckCodeLoading(!0)),(0,lo.q)(this.getActions().setCheckCodeLoading(!1))))))}checkCodeForForceReset(e){return e.pipe((0,io.Z)((e=>{var{type:t}=e,o=(0,F.__rest)(e,["type"]);return("email"===t?this.service.validateEmailCodeForForceReset(o):this.service.validatePhoneCodeForForceReset(o)).pipe((0,Oo.T)((e=>(e.resetType=t,e.forceTicket=o.conditional_login_ticket,this.getActions().handleCheckResult(e)))),(0,Do.Z)(this.getActions().setCheckCodeLoading(!0)),(0,lo.q)(this.getActions().setCheckCodeLoading(!1)))})))}handleCheckResult(e){return e.pipe((0,io.Z)((e=>{const{ticket:t,description:o,resetType:n,forceTicket:i}=e;return t?(this.history.push(k.tH.resetPassword),(0,ro.of)(this.getActions().setTicket(t),this.getActions().setType(n),this.getActions().setForceResetTicket(i))):(0,ro.of)(this.getActions().setErrorMsg(o))})))}};function nr(e=[]){var t,o;const[{errorMsg:n},i]=(0,l.Su)(Z.$),[{errorMsg:a},r]=(0,l.Su)(Dt.H),[{errorMsg:s},d]=(0,l.Su)(Za),{phone:c,areaCode:p}=(0,l.Ph)(Qa.U),{email:u}=(0,l.Ph)(Va.N),[{code:h},{clearGetCodeError:m}]=(0,l.Su)(Ja.m),{password:x}=(0,l.Ph)(qa),[{errorMsg:f},{setErrorMsg:b,setErrorCode:_}]=(0,l.Su)(tr),{setErrorMsg:y}=(0,l.wA)(or),{abTestVersion:v}=null!==(t=(0,ue.W)((()=>["abTestVersion"]),[]))&&void 0!==t?t:{},C=null!==(o=(0,he.qt)(v,"login_modal_ui_revamp"))&&void 0!==o?o:"v1",[j,w]=(0,L.useState)(""),S=n||a||f||s,T=(0,g.s)("WebApp_Login"),{pathname:P}=(0,E.zy)();return(0,L.useEffect)((()=>{S&&("v1"===C&&P===k.tH.loginHome||P===k.tH.signupAgeGate?(0,ln.P)(T(S)):w(S))}),[T,S,P]),(0,L.useEffect)((()=>{i.clearLoginResult(),r.setErrorMsg(""),d.setErrorMsg(""),m(),w(""),y("")}),[c,p,u,h,i,r,d,x,...e]),(0,L.useEffect)((()=>()=>{i.clearLoginResult(),r.clearSignUpResult(),m(),w(""),b(""),_(0)}),[]),j}function ir(){const{phone:e,areaCode:t}=(0,l.Ph)(Qa.U),{email:o}=(0,l.Ph)(Va.N),[{code:n,getCodeErrorMsg:i},{clearGetCodeError:a}]=(0,l.Su)(Ja.m);return(0,L.useEffect)((()=>{a()}),[e,t,o,n,a]),i}(0,F.__decorate)([(0,to.uk)(),(0,F.__metadata)("design:type",co.c)],or.prototype,"dispose$",void 0),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,String]),(0,F.__metadata)("design:returntype",void 0)],or.prototype,"setErrorMsg",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,String]),(0,F.__metadata)("design:returntype",void 0)],or.prototype,"setTicket",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,String]),(0,F.__metadata)("design:returntype",void 0)],or.prototype,"setType",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,String]),(0,F.__metadata)("design:returntype",void 0)],or.prototype,"setForceResetTicket",null),(0,F.__decorate)([(0,to.h5)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[Object,Boolean]),(0,F.__metadata)("design:returntype",void 0)],or.prototype,"setCheckCodeLoading",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],or.prototype,"checkEmailCodeForReset",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],or.prototype,"checkPhoneCodeForReset",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],or.prototype,"checkCodeForForceReset",null),(0,F.__decorate)([(0,to.Mj)(),(0,F.__metadata)("design:type",Function),(0,F.__metadata)("design:paramtypes",[co.c]),(0,F.__metadata)("design:returntype",void 0)],or.prototype,"handleCheckResult",null),or=(0,F.__decorate)([(0,oo.n)("CheckDigitCodeModule"),(0,F.__metadata)("design:paramtypes",[Uo.r,zt.D])],or);const ar=(0,L.memo)((function(e){const t=(0,L.useCallback)((t=>{var o;t.preventDefault(),null===(o=e.onSubmit)||void 0===o||o.call(e)}),[e]);return(0,n.jsx)("form",{onSubmit:t,style:e.style,children:e.children})}));function rr(e){return L.createElement("svg",(0,lt._)({fill:"currentColor"},e,{viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:e.className}),L.createElement("path",{d:"M38.88 41.7a1 1 0 0 0 1.41 0l1.42-1.4a1 1 0 0 0 0-1.42l-3.86-3.86a24.57 24.57 0 0 0 6.27-9.69 1 1 0 0 0 0-.66C41 15.8 32.66 9 23 9c-3.27 0-6.35.73-9.12 2.05L9.12 6.29a1 1 0 0 0-1.41 0L6.29 7.71a1 1 0 0 0 0 1.41l32.59 32.59Zm-22-27.66A17.8 17.8 0 0 1 23 13c12.75 0 17 12 17 12s-1.38 3.9-4.93 7.25l-4.54-4.55A7.99 7.99 0 0 0 23 17c-.95 0-1.86.16-2.7.47l-3.43-3.43ZM1.87 24.67a24.64 24.64 0 0 1 5.8-9.23l2.77 2.78C7.25 21.46 6 25 6 25s4.25 12 17 12a18 18 0 0 0 5.42-.8l3.05 3.05A21.2 21.2 0 0 1 23 41c-9.83 0-17.93-6.63-21.13-15.67a1 1 0 0 1 0-.66Z"}),L.createElement("path",{d:"M15 25c0-.68.08-1.35.24-1.98l9.74 9.73A8.02 8.02 0 0 1 15 25Z"}))}(0,st.r)(rr);var lr=o(81079),sr=o(23359),dr=o(75778),cr=o(6969);function pr(e){return L.createElement("svg",(0,lt._)({fill:"currentColor"},e,{viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:e.className}),L.createElement("path",{d:"M19 4a10 10 0 1 0 0 20 10 10 0 0 0 0-20ZM19 27C8.06 27 2 34.92 2 41.44 2 45 4 45 11 45h9.5a6 6 0 0 1 1.81-5.48l5.15-4.78a11.5 11.5 0 0 1-.14-5.94A19.06 19.06 0 0 0 19 27Z"}),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.5 24a7.5 7.5 0 0 0-6.34 11.51l-8.07 8.08 2.82 2.82 2.84-2.83 2.84 2.83 2.82-2.82-2.83-2.84 2.55-2.55A7.5 7.5 0 1 0 38.5 24ZM35 31.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0Z"}))}(0,st.r)(pr);const ur=(0,Q.default)("button",{target:"e13mgq8k0"})((({theme:e})=>({flex:"0 0 36px",height:"36px",alignSelf:"center",display:"block",padding:"6px",fontSize:"0px",border:"none",color:e.colors.UIText3,marginRight:"-8px",cursor:"pointer","&:hover":{backgroundColor:e.colors.UIShapeNeutral4}})),"label:ButtonPasskey;"),gr=(0,Q.default)(pr,{target:"e13mgq8k1"})({display:"block",width:"24px",height:"24px"},"label:StyledPasskeyBtn;"),hr=function(){const{handler:e,passkeyType:t}=(0,cr.Ub)(),o=(0,s.Nj)(C.$F),i=(0,L.useCallback)((()=>{e(),o.event(C.$F.EVENTS.PasskeyClick,{login_panel_type:"passkey_login"})}),[e,o]);return"button"!==t?null:(0,n.jsx)(ur,{onClick:i,type:"button",children:(0,n.jsx)(gr,{})})},mr=(0,Q.default)("div",{target:"etcs7ny0"})({position:"relative",marginBottom:"9px"},"label:DivInputContainer;"),xr=(e,t,o)=>e?{background:"transparent",border:"none",borderRadius:"0",paddingInlineStart:"0px",borderBottom:t?"1px solid":"none"}:{borderRadius:"2px",backgroundColor:o.BGInput,border:t?"1px solid":"none",paddingInlineStart:"12px"},fr=(0,Q.default)("input",{target:"etcs7ny1"})((({theme:{colors:e,isMobile:t},border:o=!1,errorState:n=!1,hasIconPadding:i})=>[xr(t,o,e),{"::placeholder":{color:e.TextQuaternary},color:n?e.Negative:e.TextPrimary,lineHeight:"100%",outline:"none",fontSize:"16px",height:"44px",caretColor:e.Primary,width:"100%",borderColor:n?e.Negative:e.LineSecondary2,paddingInlineEnd:i?"24px":"unset"}]),"label:InputContainer;"),br=(0,Q.default)("div",{target:"etcs7ny2"})((({theme:e})=>[(0,J.mp)({direction:e.direction,end:"0"}),{display:"flex",alignItems:"center",position:"absolute",top:0,height:"44px",paddingInlineEnd:e.isMobile?"4px":"16px"}]),"label:DivIconContainer;"),_r=(0,Q.default)("i",{target:"etcs7ny3"})({lineHeight:"0",marginInlineStart:"16px",cursor:"pointer",fontSize:"20px",opacity:"50%"},"label:IPasswordIcon;"),yr=(0,Q.default)("i",{target:"etcs7ny4"})((({theme:e})=>[{fontSize:"16px",lineHeight:"0",color:e.colors.LineInverse}]),"label:IDeleteIcon;"),vr=(0,L.memo)((function(e){const{errorState:t,enablePasskey:o,value:i,placeholder:a,password:r=!1,className:l,border:s=!0,style:d,autocomplete:p,name:u,autoFocus:h,disableDelete:m,readonly:x=!1,onInput:f=()=>{},onChange:b=()=>{}}=e,_=(0,g.s)(),[y,v]=(0,L.useState)("text"),{isMobile:k}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[]));(0,L.useEffect)((()=>{r&&v("password")}),[r]);const C=(0,L.useCallback)((()=>{v("text")}),[]),j=(0,L.useCallback)((()=>{v("password")}),[]),w=(0,L.useCallback)((()=>{const e={target:{value:""}};b(e),f(e)}),[b,f]),S=(0,L.useCallback)((e=>{b(e)}),[b]),T=(0,L.useCallback)((e=>{13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),e.stopPropagation(),"password"===y?C():j())}),[j,C,y]),P=Boolean((null==i?void 0:i.length)&&k&&!m),M=r&&(!k||m),A=M||P;(0,cr.iT)(o);const E=o?[p,"webauthn"].filter(Boolean).join(" "):p;return(0,n.jsxs)(mr,{className:l,style:d,children:[(0,n.jsx)(fr,{autoFocus:h,value:i,type:y,inputMode:e.inputMode,errorState:t,placeholder:a,onChange:S,onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput,onClick:e.onClick,border:s,autoComplete:E,name:u,readOnly:x,hasIconPadding:A}),(0,n.jsxs)(br,{children:[t&&!k&&(0,n.jsx)(sr.A,{fill:"rgba(254, 44, 85, 1.0)"}),M&&("password"===y?(0,n.jsx)(_r,{onClick:C,onKeyDown:T,tabIndex:0,role:"button","aria-label":_("accessibilityLabels_login_modal_eyeClosedIcon"),"aria-pressed":!1,children:(0,n.jsx)(rr,{})}):(0,n.jsx)(_r,{onClick:j,onKeyDown:T,tabIndex:0,role:"button","aria-label":_("accessibilityLabels_login_modal_eyeOpenIcon"),"aria-pressed":!0,children:(0,n.jsx)(lr.A,{})})),P&&(0,n.jsx)(yr,{onClick:w,children:(0,n.jsx)(dr.A,{})}),o&&(0,n.jsx)(hr,{})]})]})}));var kr=o(96973);const Cr=(0,Q.default)("div",{target:"e3v3zbj0"})((({theme:e,type:t})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont"}),{fontSize:"12px",lineHeight:"15px",margin:"4px 0",color:"error"===t?e.colors.Negative:"success"===t?e.colors.Positive:e.colors.TextTertiary,display:"flex",svg:{marginInlineEnd:"4px"}}]),"label:DivTextContainer;"),jr=(0,L.memo)((({text:e,type:t="default",children:o,style:i,errorIcon:a})=>(0,n.jsxs)(Cr,{type:t,style:i,"aria-live":"assertive",children:[a&&(0,n.jsx)(sr.A,{fill:"rgba(254, 44, 85, 1.0)","aria-hidden":!0}),o,(0,n.jsx)("span",{role:"status",children:e})]}))),wr=(0,Q.default)("div",{target:"e1bi0g3c0"})({marginBottom:"9px"},"label:DivContainer;"),Sr=(0,Q.default)("p",{target:"e1bi0g3c1"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"semiBold"}),{margin:"4px 0"}]),"label:PDescriptionTitleContainer;"),Tr=(0,L.memo)((function(e){const{loginErrorText:t="",autoFocus:o,create:i=!0,loginError:a}=e,[{password:r,hasInvalid:s,lengthValid:d,contentValid:p},{updatePassword:u}]=(0,l.Su)(qa),{isMobile:h}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),m=(0,g.s)("WebApp_Login"),[x,f]=(0,L.useState)(!1),b=(0,L.useCallback)((()=>{f(!0)}),[]),_=(0,L.useCallback)((()=>{f(!1)}),[]),y=(0,L.useCallback)((e=>{u({value:e.target.value})}),[u]),v=(0,cr.Yk)("password");(0,L.useEffect)((()=>()=>{u({value:""})}),[]);const k=i&&(!1===d||!1===p)&&(h||!x),C=(!d||!p)&&r||x||h,j=!1!==d||!h&&x?!0===d?"success":"default":"error",w=!1!==p||!h&&x?!0===p?"success":"default":"error";return(0,n.jsxs)(wr,{children:[(0,n.jsx)(vr,{"data-e2e":"passward-input",autoFocus:o,placeholder:m("Password"),onFocus:b,onBlur:_,onChange:y,onClick:v,value:r,errorState:k||Boolean(t)||a,password:!0,autocomplete:"new-password",disableDelete:i}),Boolean(t)&&(0,n.jsx)(jr,{errorIcon:!0,text:m(t),type:"error"}),s&&(0,n.jsx)(jr,{errorIcon:h,text:m("createpw_error_6"),type:"error"}),C&&i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Sr,{children:m("common_registration_password_pc_text")}),(0,n.jsx)(jr,{text:m("common_registration_password_pc_1"),type:j,children:(0,n.jsx)(kr.A,{fill:"success"===j?"rgba(11, 224, 155, 1.0)":"rgba(22,24,35,.5)"})}),(0,n.jsx)(jr,{text:m("createpw_helptext_2"),type:w,children:(0,n.jsx)(kr.A,{fill:"success"===w?"rgba(11, 224, 155, 1.0)":"rgba(22,24,35,.5)"})})]})]})})),Lr=(0,Q.default)(Y.y,{target:"e1w6iovg0"})((({theme:e})=>[{width:"100%",marginTop:e.isMobile?"32px":"21px"}]),"label:StyledButton;"),Pr=e=>{const{children:t}=e,o=(0,F.__rest)(e,["children"]);return(0,n.jsx)(Lr,Object.assign({type:"submit",buttonTheme:"primary",size:"largeNew"},o,{children:t}))},Mr=(0,Q.default)(Bt,{target:"erbpmjz0"})({size:"16px",lineHeight:"21px",fontWeight:"500",color:"black",display:"inline-block"},"label:StyledTvLoginLink;"),Ar=(0,Q.default)("div",{target:"erbpmjz1"})((({theme:e})=>({left:"50%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:e.isMobile?"100%":"",marginTop:e.isMobile?"":"-36px"})),"label:DivTvLoginContainer;"),Er=(0,Q.default)(Pr,{target:"erbpmjz2"})((({theme:e})=>({marginTop:e.isMobile?"24px":"18px",marginBottom:e.isMobile?"80px":"40px",width:"100%",height:"48px",borderRadius:"2px"})),"label:StyledTVloginButton;"),Fr=(0,Q.default)("h1",{target:"erbpmjz3"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont",fontWeight:"bold"}),{fontSize:"24px",lineHeight:"30px",textAlign:"center"}]),"label:H1Title;"),Ir=(0,Q.default)("div",{target:"erbpmjz4"})((({theme:e})=>({width:e.isMobile?"306px":"358px",minHeight:"55px",height:"100%",display:"flex",marginTop:"26px",flexDirection:"column",justifyContent:"center"})),"label:DivInputContainer;"),Hr=(0,Q.default)("div",{target:"erbpmjz6"})((({theme:e})=>({width:e.isMobile?"306px":"358",display:"flex",flexDirection:"column",justifyContent:"center",marginTop:"26px"})),"label:DivLandingLoginBodyContainer;"),zr=(0,Q.default)("div",{target:"erbpmjz7"})((({theme:e})=>({width:e.isMobile?"306px":"326px",display:"flex",flexDirection:"column",justifyContent:"center"})),"label:DivEmailPhoneLoginBodyContainer;"),Dr=(0,Q.default)("div",{target:"erbpmjz8"})((({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:e.isMobile?"333px":"482px"})),"label:DivOrContinueWithContainer;"),Rr=(0,Q.default)("div",{target:"erbpmjz9"})((({theme:e})=>[{width:e.isMobile?"80px":"86px",height:"1px",background:e.colors.LineReverse2}]),"label:DivSeparatorLine;"),Or=(0,Q.default)("div",{target:"erbpmjz10"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokDisplayFont"}),{fontSize:"20px",fontWeight:"400",lineHeight:"26px",color:e.colors.TextTertiary2,margin:"0 15px",whiteSpace:"nowrap"}]),"label:DivSeparatorText;"),Wr=(0,Q.default)("div",{target:"erbpmjz11"})((({theme:e})=>({width:e.isMobile?"100%":"482px",marginTop:e.isMobile?"20px":"24px"})),"label:DivThirdPartyContainer;"),Br=(0,Q.default)("div",{target:"erbpmjz12"})({width:"100%"},"label:DivTvLoginLinkContainer;"),$r=(0,Q.default)("div",{target:"erbpmjz13"})({width:"100%",display:"flex",marginTop:"8px",marginBottom:"24px",justifyContent:"center",alignItems:"center"},"label:DivPhoneNumberTextContainer;"),Ur=(0,Q.default)("h4",{target:"erbpmjz14"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontWeight:"400",fontSize:"15px",lineHeight:"20px",textAlign:"center"}]),"label:H4EnterCodePhoneNumber;"),Nr=(0,Q.default)("h4",{target:"erbpmjz15"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextTertiaryAlt",fontFamily:"TikTokFont"}),{fontWeight:"400",fontSize:"14px",lineHeight:"20px",textAlign:"center",marginRight:"4px"}]),"label:H4EnterCodeDescription;"),Vr=({text:e,path:t,onClick:o,replace:i=!1})=>{const a=(0,L.useCallback)((e=>{13===e.keyCode&&o()}),[o]);return(0,n.jsx)(Mr,{onClick:o,onKeyDown:a,text:e,path:t,replace:i})},Gr=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),t=(0,sn.VN)(),{setEmail:o}=(0,l.wA)(Va.N),{email:i=""}=(0,l.Ph)(Va.N),[a,r]=(0,L.useState)(i),{password:s,hasInvalid:d}=(0,l.Ph)(qa),[{loginLoading:c},{handlePasswordLogin:p}]=(0,l.Su)(Z.$),u=nr([a]),h=(0,L.useCallback)((()=>{const e=(0,Ga.Ro)(a)?a:void 0;t({platform:e?"email":"handle"}),p({username:a.trim(),password:s,email:e})}),[p,t,s,a]),m=(0,L.useCallback)((e=>{r(e.target.value),o(e.target.value)}),[r,o]),x=(0,L.useCallback)((()=>{(0,Ga.Ro)(a)?o(a):o("")}),[a,o]);return Me(),(0,n.jsx)(ar,{onSubmit:h,children:(0,n.jsxs)(Ar,{children:[(0,n.jsx)(Fr,{children:e("tv_webLogin_login_header")}),(0,n.jsxs)(zr,{style:{marginTop:"24px"},children:[(0,n.jsx)(vr,{onChange:m,name:"username",value:a,placeholder:e("Email or Username"),"data-e2e":"email-input"}),(0,n.jsx)(Tr,{create:!1,loginError:Boolean(u)}),u&&(0,n.jsx)(jr,{text:e(u),type:"error"}),(0,n.jsx)(Br,{children:(0,n.jsx)(Vr,{onClick:x,text:e("forget_password"),path:k.tH.loginForgetEmailPassword})}),(0,n.jsx)(Er,{disabled:!a||!s||d,loading:c,"data-e2e":"login-button",style:{marginTop:"48px"},children:e("Login")})]})]})})})),qr=[k.tH.loginEmail,k.tH.loginPhone,k.tH.signupPhone,k.tH.signupEmail,k.tH.loginHome,k.tH.signupHome],Kr="signup-email-consent-label",Zr="phone-country-code-selector-wrapper";var Qr=o(54502),Jr=o(25919);const Yr=(0,Q.default)("ul",{target:"e2hldqz0"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextPrimary"}),{padding:"0",margin:0}]),"label:UlListContainer;"),Xr=(0,Q.default)("li",{target:"e2hldqz1"})((({theme:e,selected:t})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextTertiary2"}),()=>t&&{backgroundColor:"rgba(22, 24, 35, .03)"},{display:"flex",padding:"0 12px",justifyContent:"space-between",alignItems:"center",height:"34px",lineHeight:"34px",fontSize:"13px"},{":hover":{backgroundColor:"rgba(22, 24, 35, .03)"}}]),"label:LiListItem;"),el=(0,Q.default)("span",{target:"e2hldqz2"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary"}),{paddingInlineEnd:"4px"}]),"label:SpanItemName;"),tl=(0,Q.default)("span",{target:"e2hldqz3"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextSecondary"})]),"label:SpanItemCode;"),ol=(0,Q.default)("li",{target:"e2hldqz4"})({margin:0,padding:0,display:"block"},"label:LiAreaCodeOptionWrapper;"),nl=(0,Q.default)("ul",{target:"e2hldqz5"})({margin:0,padding:0,display:"block",listStyleType:"none"},"label:UlAreaCodeOptionsGroupContainer;"),il="area-number-pick-ul",al="#login-phone-search",rl=({filterCountryList:e=[],onSelected:t,searchText:o,currentSelectCode:i,matchSearchArea:a,onKeyDownWithEmptyResult:r})=>{const{isMobile:l}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),s=(0,g.s)("WebApp_Login"),d=RegExp(o.replace("+","\\+"),"ig"),p=(0,L.useCallback)((({code:e,shortname:o})=>()=>{t({code:e,area:o})}),[t]),u=(0,L.useCallback)((e=>{var n,i;if(e.stopPropagation(),9===e.keyCode&&e.shiftKey)return e.preventDefault(),void(null===(n=document.querySelector(al))||void 0===n||n.focus());if(13!==e.keyCode&&32!==e.keyCode)9!==e.keyCode||!o||a||null==r||r();else if(e.target){const o=null===(i=e.target)||void 0===i?void 0:i.getAttribute("id");if(!o)return;const[n,a]=o.split("-");try{t({code:a,area:n})}catch(e){console.error(e)}}}),[a,r,t,o]),h=(0,L.useCallback)((e=>{var t,o,n,i,a;try{const r=Array.from(null!==(o=null===(t=document.querySelector(`#${il}`))||void 0===t?void 0:t.children)&&void 0!==o?o:[]).reverse().find((e=>e.children.length>0));(null===(i=Array.from(null!==(n=null==r?void 0:r.children)&&void 0!==n?n:[]).reverse())||void 0===i?void 0:i[0])===e.target&&(null===(a=document.querySelector(al))||void 0===a||a.focus())}catch(e){console.error(e)}}),[]);return(0,n.jsxs)(Yr,{onKeyDown:u,id:il,role:"listbox",children:[Jr.W.map((t=>{const{label:a,lists:r}=t;return(0,n.jsx)(ol,{children:(0,n.jsx)(nl,{id:a,role:"group",children:r.map(((t,a)=>{const{name:r,code:s,shortname:c}=t;if(-1!==e.indexOf(c))return null;if(o&&!(r.match(d)||`+${s}`.match(d)||c.match(d)))return null;const u=`${i}`==`${s}`;return(0,n.jsx)(Xr,{index:a,id:`${c}-${s}`,selected:u,tabIndex:0,onClick:p({shortname:c,code:s}),onKeyDown:h,role:"option","aria-selected":u,children:l?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(el,{children:r}),(0,n.jsx)(tl,{children:`+${s}`})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(el,{dangerouslySetInnerHTML:{__html:(g=`${r} +${s}`,o?g=g.replace(d,(e=>`${e}`)):g)}}),u&&(0,n.jsx)(Qr.A,{width:16,height:16,fill:"#000"})]})},r+s);var g}))},a)},a)})),o&&!a&&(0,n.jsx)(Xr,{selected:!1,style:{justifyContent:"center"},role:"status",children:s("registration_phone_search_empty")})]})};var ll=o(81825);const sl=(0,Q.default)("div",{target:"emwsnhg0"})((({theme:{colors:e}})=>({top:"45px",height:"35px",width:"326px",boxSizing:"border-box",borderBottom:`1px solid ${e.LineSecondary}`,background:e.BGPrimary,marginTop:"4px",display:"flex",justifyContent:"space-between",flexShrink:0})),"label:DivSearchContainer;"),dl=(0,Q.default)("div",{target:"emwsnhg1"})((({theme:e})=>({margin:"0 15px",color:e.colors.LineInput,display:"flex",alignItems:"center"})),"label:DivSearchIcon;"),cl=(0,Q.default)("input",{target:"emwsnhg2"})((({theme:e})=>({outline:"none",border:"none",flex:"1",color:e.colors.TextPrimary,background:e.colors.BGPrimary,caretColor:e.colors.Primary})),"label:InputSearch;"),pl=({searchText:e,onKeyDownWithEmptyResult:t})=>{const o=(0,g.s)("WebApp_Login"),{matchSearchArea:i}=(0,l.Ph)(Qa.U),{setAreaSearchText:a,selectAreaCode:r}=(0,l.wA)(Qa.U),s=(0,L.useCallback)((e=>{a(e.target.value)}),[a]),d=(0,L.useCallback)((e=>{13===e.keyCode&&i&&r({code:i.code,area:i.shortname})}),[i,r]),c=(0,L.useCallback)((o=>{9===o.keyCode&&(e&&!i||o.shiftKey)&&(null==t||t())}),[i,t,e]);return(0,L.useEffect)((()=>()=>{a("")}),[a]),(0,n.jsxs)(sl,{children:[(0,n.jsx)(dl,{children:(0,n.jsx)(ll.A,{width:14,height:14})}),(0,n.jsx)(cl,{id:"login-phone-search",autoFocus:!0,maxLength:35,onKeyUp:d,placeholder:o("registration_phone_search_placeholder"),onChange:s,onKeyDown:c})]})},ul=(0,Q.default)("div",{target:"e1llxcni0"})((({theme:e,maxHeight:t})=>[(0,J.mp)({direction:e.direction,start:"0"}),{maxHeight:t||"320px",background:e.colors.BGPrimary,border:"0.5px solid rgba(22, 24, 35, 0.12)",boxSizing:"border-box",boxShadow:"0px 2px 12px rgba(0, 0, 0, 0.12)",borderRadius:"4px",position:"absolute",top:"54px",display:"flex",flexDirection:"column",zIndex:2}]),"label:DivSelectorContainer;"),gl=(0,Q.default)("div",{target:"e1llxcni1"})({flex:"1",overflow:"auto"},"label:DivListWrapper;"),hl=(0,Q.default)("div",{target:"e1llxcni2"})({position:"fixed",zIndex:11,top:0,bottom:0,left:0,right:0,background:"#fff",overflowY:"auto"},"label:DivPageSelectorContainer;"),ml=(0,Q.default)("div",{target:"e1llxcni3"})((({theme:e})=>[(0,J.mp)({direction:e.direction,paddingEnd:"32px",paddingStart:"16px"}),{marginTop:"44px",borderTop:`1px solid ${e.colors.LineSecondary}`}]),"label:DivPageSelector;"),xl=e=>(0,n.jsxs)(ul,{id:Zr,maxHeight:e.maxHeight,children:[(0,n.jsx)(pl,{searchText:e.searchText,onKeyDownWithEmptyResult:e.onKeyDownWithEmptyResult}),(0,n.jsx)(gl,{children:(0,n.jsx)(rl,{matchSearchArea:e.matchSearchArea,filterCountryList:e.filterCountryList,onSelected:e.onSelected,currentSelectCode:e.currentSelectCode,searchText:e.searchText,onKeyDownWithEmptyResult:e.onKeyDownWithEmptyResult})})]});function fl(e){const{region:t,appType:o}=(0,de.L$)((0,ue.W)((()=>["region","appType"]),[])),[n,i]=(0,l.Su)(Qa.U),{areaCode:a}=n;(0,L.useEffect)((()=>{if(!a){let n=!1;if(Jr.W.forEach((({lists:e})=>e.forEach((({code:e,shortname:o})=>{o===t&&(n=!0,i.selectAreaCode({code:e,area:o}))})))),!n){let t="m"===o?{code:1,area:"US"}:{code:81,area:"JP"};(null==e?void 0:e.find((e=>e===t.area)))&&(t={code:1,area:"CA"}),i.selectAreaCode(t)}}}),[o,t,a,i,e])}var bl=o(92681);const _l=(0,Q.default)("div",{target:"ewblsjs0"})({marginBottom:"9px"},"label:DivContainer;"),yl=(0,Q.default)(vr,{target:"ewblsjs1"})((({theme:e})=>({flex:1,width:0,marginBottom:"0","& > input":{background:"transparent!important","&:-webkit-autofill":{"-webkit-box-shadow":`0 0 0 30px ${e.isDark?"#3f3f3f":"#f1f1f2"} inset !important`,"-webkit-text-fill-color":e.colors.TextPrimary}}})),"label:StyledBaseInput;");yl.defaultProps=Object.assign(Object.assign({},yl.defaultProps),{"data-e2e":"phone-number-input"});const vl=(0,Q.default)("div",{target:"ewblsjs2"})((({theme:{colors:e},errState:t})=>[{background:e.BGInput,border:`1px solid ${e.LineSecondary2}`,transition:"all 0.3s",borderRadius:"4px",display:"flex"},()=>t?{border:`1px solid ${e.Negative}`,input:{color:e.Negative}}:{}]),"label:DivPhoneInputContainer;"),kl=(0,Q.default)("div",{target:"ewblsjs3"})({position:"relative",cursor:"pointer"},"label:DivAreaSelectionContainer;"),Cl=(0,Q.default)("div",{target:"ewblsjs4"})((({theme:{colors:e,direction:t}})=>[{display:"flex",alignItems:"center",justifyContent:"space-between",position:"relative",padding:"12px",height:"44px","::after":{content:'""',width:"1px",height:"30px",background:e.LineSecondary,right:"rtl"===t?"unset":"0",left:"rtl"===t?"0":"unset",position:"absolute"}}]),"label:DivAreaLabelContainer;"),jl=(0,Q.default)("span",{target:"ewblsjs5"})((({theme:{colors:e}})=>[{fontSize:"16px",lineHeight:1,color:e.TextPrimary,marginInlineEnd:"12px"}]),"label:SpanLabelContainer;"),wl=(0,Q.default)(bl.A,{target:"ewblsjs7"})((({up:e})=>[{transform:e?"rotateZ(180deg)":"rotateZ(0deg)",transition:"all .3S"}]),"label:StyledArrowIcon;"),Sl=(0,L.memo)((function({errorStatus:e,filterCountryList:t,enablePasskey:o}){fl(t);const i=(0,L.useRef)(null),[a,r]=(0,l.Su)(Qa.U),{area:s,areaCode:d,phoneErrorMsg:c,showAreaCodeSelector:p,searchText:u,phone:h,matchSearchArea:m}=a,[x,f]=(0,L.useState)(!1),{checkPhoneNumberFormat:b}=r,{toggleAreaCodeSelector:_,selectAreaCode:y}=r,v=(0,g.s)("WebApp_Login"),k=(0,L.useCallback)((e=>{var t;p&&!(null===(t=null==i?void 0:i.current)||void 0===t?void 0:t.contains(e.target))&&_()}),[p,_]);(0,L.useEffect)((()=>(window.addEventListener("mousedown",k),()=>{window.removeEventListener("mousedown",k)})),[r,k]);const C=(0,L.useCallback)((e=>{b({phone:e.target.value})}),[b]),j=(0,L.useCallback)((()=>{f(!0)}),[]),w=(0,L.useCallback)((()=>{f(!1)}),[]),S=(0,L.useCallback)((({code:e,area:t})=>{y({code:e,area:t})}),[y]),T=(0,L.useCallback)((e=>{13!==e.keyCode&&32!==e.keyCode||_()}),[_]),P=(0,cr.Yk)("phone"),M=Boolean((c||e)&&!x),A=(0,L.useMemo)((()=>`${s} +${d}`),[s,d]);return(0,n.jsxs)(_l,{children:[(0,n.jsxs)(vl,{errState:M,children:[(0,n.jsxs)(kl,{ref:i,children:[(0,n.jsxs)(Cl,{onClick:_,onKeyDown:T,tabIndex:0,role:"button","aria-haspopup":"true","aria-expanded":p,"aria-controls":Zr,"aria-label":v("accessibilityLabels_login_form_placeholder_countryCode",{readPhoneCountryCode:A}),children:[(0,n.jsx)(jl,{children:A}),(0,n.jsx)(wl,{up:p})]}),p&&(0,n.jsx)(xl,{matchSearchArea:m,filterCountryList:t,onSelected:S,currentSelectCode:d,searchText:u,onKeyDownWithEmptyResult:_})]}),(0,n.jsx)(yl,{value:h,border:!1,errorState:M,placeholder:v("phone_number"),onChange:C,onFocus:j,onBlur:w,onClick:P,name:"mobile",autocomplete:"username",type:"tel",enablePasskey:o})]}),M&&(0,n.jsx)(jr,{text:v(c||e||""),type:"error"})]})}));var Tl=o(34393),Ll=o(65404);const Pl=({loginData:e})=>{const{isMobile:t}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),o=e.icon,i=t?24:30;return(0,n.jsx)(Se,{onClick:e.onClick,onKeyDown:e.onClick,tabIndex:0,role:"link",children:(0,n.jsx)(o,{width:i,height:i})})},Ml=({platformConfigOverride:e,foldSize:t=2})=>{let{platformConfig:o}=Be((()=>["platformConfig"]),[]);e&&(o=e);const i=[...o.order.toLowerCase().split(",").filter((e=>"instagram"!==e))],a=Bi(i),r=Wi(a),[l,s]=(0,L.useState)(!1),d={expand:r.filter((e=>a.slice(0,t).includes(e.type))),fold:r.filter((e=>a.slice(t).includes(e.type)))},c=(0,L.useCallback)((()=>{s(!0)}),[]),p=(0,L.useCallback)((()=>{s(!1)}),[]),u=(0,L.useCallback)((e=>{13===e.keyCode&&s(!0)}),[s]),g=(0,L.useCallback)((e=>{13===e.keyCode&&s(!1)}),[s]);return l?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(Ce,{children:[(0,n.jsx)(we,{onClick:p,onKeyDown:g,tabIndex:0,role:"button",children:(0,n.jsx)(Ll.p,{size:16})}),d.fold.map((e=>(0,n.jsx)(Pl,{loginData:e},e.type)))]})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(Ce,{children:[d.expand.map((e=>(0,n.jsx)(Pl,{loginData:e},e.type))),d.fold.length>0&&(0,n.jsx)(je,{onClick:c,onKeyDown:u,tabIndex:0,role:"button",children:(0,n.jsx)(Tl.a,{size:16})})]})})},Al=(0,Q.default)("div",{target:"eybrrr40"})((({theme:e})=>[(0,J.mp)({direction:e.direction,end:"0"}),{width:"20px",position:"fixed",top:"50%",transform:"translateY(-50%)",textAlign:"center"}]),"label:DivLetterListContainer;"),El=(0,Q.default)("div",{target:"eybrrr41"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont"}),{fontWeight:600,fontSize:"12px",lineHeight:"14px",color:"rgba(22, 24, 35, .5)"}]),"label:DivLetterItem;"),Fl=e=>(0,n.jsx)(Al,{children:Jr.W.map((t=>(0,n.jsx)(El,{onClick:e.onClick(t.label),children:t.label},t.label)))}),Il=e=>{const{onClose:t}=e,o=(0,F.__rest)(e,["onClose"]),i=(0,g.s)("WebApp_Login"),a=(0,L.useRef)(null),r=(0,L.useCallback)((e=>()=>{var t,o;const n=document.getElementById(e);null===(t=null==a?void 0:a.current)||void 0===t||t.scrollTo(0,null!==(o=null==n?void 0:n.offsetTop)&&void 0!==o?o:0)}),[]);return(0,n.jsxs)(hl,{ref:a,children:[(0,n.jsx)(at,{onClose:e.onClose,showRight:!1,title:i("select_region"),showClose:!0}),(0,n.jsxs)(ml,{children:[(0,n.jsx)(rl,Object.assign({},o)),(0,n.jsx)(Fl,{onClick:r})]})]})},Hl=(0,Q.default)("div",{target:"eex98o0"})({marginBottom:"12px"},"label:DivContainer;"),zl=(0,Q.default)(vr,{target:"eex98o1"})({flex:1,width:0,marginBottom:"0"},"label:StyledBaseInput;");zl.defaultProps=Object.assign(Object.assign({},zl.defaultProps),{"data-e2e":"phone-number-input"});const Dl=(0,Q.default)("div",{target:"eex98o2"})((({theme:{colors:e},errState:t})=>[{transition:"all 0.3s",display:"flex",borderBottom:"1px solid",input:{color:t?e.Negative:"unset",paddingInlineStart:"8px"},borderColor:t?e.Negative:e.LineSecondary2}]),"label:DivPhoneInputContainer;"),Rl=(0,Q.default)("div",{target:"eex98o3"})((({theme:{colors:e,direction:t}})=>[{display:"flex",alignItems:"center",justifyContent:"space-between",position:"relative",padding:"2px",height:"44px","::after":{content:'""',width:"1px",height:"10px",background:e.LineSecondary,right:"rtl"===t?"unset":"0",left:"rtl"===t?"0":"unset",position:"absolute"}}]),"label:DivAreaLabelContainer;"),Ol=(0,Q.default)("span",{target:"eex98o4"})((({theme:{colors:e}})=>[{fontSize:"15px",lineHeight:1,color:e.TextPrimary,fontWeight:400}]),"label:SpanLabelContainer;"),Wl=(0,Q.default)(ce.A,{target:"eex98o5"})({fontSize:"16px",margin:"0 4px"},"label:StyledArrowIcon;"),Bl=(0,L.memo)((function({filterCountryList:e}){fl(e);const[t,o]=(0,l.Su)(Qa.U),{area:i,areaCode:a,phoneErrorMsg:r,showAreaCodeSelector:s,searchText:d,phone:c,matchSearchArea:p}=t,{checkPhoneNumberFormat:u}=o,{toggleAreaCodeSelector:h,selectAreaCode:m}=o,x=(0,g.s)("WebApp_Login"),f=ir(),b=(0,L.useCallback)((e=>{u({phone:e.target.value.replace(/[^\d]/g,"")})}),[u]),_=(0,L.useCallback)((({code:e,area:t})=>{m({code:e,area:t})}),[m]),y=Boolean(r||f);return(0,n.jsxs)(Hl,{children:[(0,n.jsxs)(Dl,{errState:y,children:[(0,n.jsxs)(Rl,{onClick:h,role:"select",children:[(0,n.jsxs)(Ol,{children:[i," +",a]}),(0,n.jsx)(Wl,{})]}),s&&(0,n.jsx)(Il,{onClose:h,matchSearchArea:p,filterCountryList:e,onSelected:_,currentSelectCode:a,searchText:d}),(0,n.jsx)(zl,{value:c,border:!1,errState:y,placeholder:x("phone_number"),onChange:b,name:"mobile",inputMode:"tel"})]}),y&&(0,n.jsx)(jr,{text:x(r||f||""),type:"error"})]})}));var $l=o(56441);const Ul="email",Nl="phone",Vl=()=>{const e=(0,E.W6)(),{isMobile:t}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{isSecurityVerification:o}=Be((()=>["isSecurityVerification"]),[]),a=(0,g.s)("WebApp_Login"),[{email:r=""},{setEmail:s}]=(0,l.Su)(Va.N),[{phoneErrorMsg:d,phone:p,mobile:u},{setPhoneNumber:h,setPhoneCode:m}]=(0,l.Su)(Qa.U),[{sendCodeLoading:x,getCodeErrorMsg:f},{sendPhoneCodeForLogin:b,sendPhoneCodeForVerify:_}]=(0,l.Su)(Ja.m),[{phoneNotRegistered:y}]=(0,l.Su)(Z.$),[v,C]=(0,L.useState)(p?Nl:Ul),j=(0,L.useCallback)((e=>{C(e)}),[C]),w=(0,L.useCallback)((e=>{s(e.target.value)}),[s]),S=!r,T=Boolean(d)||!u||Boolean(y),P=v===Nl?T:S,M=(0,L.useCallback)((()=>{if(v===Ul)m(""),h(""),e.push(k.tH.tvLoginEmail);else if(!(0,Ga.nP)(p)){const{countDownSecond:t}=(0,$l.o)(u);if(t)e.push(k.tH.tvLoginPhone);else{const e=k.tH.tvLoginPhone;o?_({mobile:u,nextUrl:e}):b({mobile:u,nextUrl:e})}}}),[e,o,u,p,v,b,_,m,h]),A=(0,L.useMemo)((()=>[{id:Ul,title:a("Email"),content:(0,n.jsx)(Ir,{children:(0,n.jsx)(vr,{placeholder:a("Email or Username"),name:"username","data-e2e":"email-input",onChange:w,value:r})})},{id:Nl,title:a("Phone"),content:(0,n.jsx)(Ir,{children:t?(0,n.jsx)(Bl,{}):(0,n.jsx)(Sl,{errorStatus:f})})}]),[a,w,r,t,f]);return Me(),(0,n.jsxs)(Ar,{children:[(0,n.jsx)(Fr,{children:a("tv_webLogin_login_header")}),(0,n.jsxs)(Hr,{children:[(0,n.jsx)(i.eh,{activeTab:v,tabs:A,onChange:j,align:"fitted"}),(0,n.jsx)(ar,{onSubmit:M,children:(0,n.jsx)(Er,{disabled:P,loading:v===Nl&&x,children:a("login_next")})})]}),(0,n.jsxs)(Dr,{children:[(0,n.jsx)(Rr,{}),(0,n.jsx)(Or,{children:a("webapp_orContinueWith")}),(0,n.jsx)(Rr,{})]}),(0,n.jsx)(Wr,{children:(0,n.jsx)(Ml,{foldSize:4})})]})},Gl=(e,t,o)=>{const[n,i]=(0,L.useState)(0),[a,r]=(0,L.useState)(!1),l=(0,L.useRef)({});return(0,L.useEffect)((()=>{const{hasSent:t,countDownSecond:n}=(0,$l.o)(e,o);r(t),i(n)}),[e,o,t]),(0,L.useEffect)((()=>{n>0?(l.current&&clearTimeout(l.current),l.current=setTimeout((()=>{i(n-1)}),1e3)):l.current&&clearTimeout(l.current)}),[n]),{hasSent:a,countDownSecond:n}},ql=(0,Q.default)("input",{target:"e18135wj0"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokDisplayFont"}),{height:"52px",width:"49px",textAlign:"center",backgroundColor:"rgba(0, 0, 0, 0.05)",border:"none",borderRadius:"8px",lineHeight:"25px",fontSize:"20px",outline:"none",caretColor:e.colors.Primary}]),"label:InputSingleDigitInput;"),Kl=(0,Q.default)("div",{target:"e18135wj1"})({width:"25px",height:"1px",backgroundColor:"#000"},"label:DividerDash;"),Zl=(0,Q.default)("div",{target:"e18135wj2"})({display:"flex",justifyContent:"center",alignItems:"center",position:"relative",gap:"6px"},"label:DivSingleDigitInputContainer;"),Ql=Q.default.div` position: relative; display: flex; flex-direction: column; `,Jl="divider",Yl=e=>{e&&e.focus()},Xl=({length:e,errorMsg:t,value:o,chunkSize:i,onChange:a,inputStyle:r})=>{const s=(0,g.s)("WebApp_Login"),d=[],[c,p]=(0,L.useState)([...o]),u=(0,L.useRef)(null),[{getCodeErrorMsg:h},{setCode:m}]=(0,l.Su)(Ja.m);(0,L.useEffect)((()=>()=>{m("")}),[]),(0,L.useEffect)((()=>{""===o&&(p([...o]),Yl(u.current))}),[o]);const x=(e,t)=>{let o=[];0===t&&6===e.length?o=e.split(""):(o=[...c],o[t]=e),p(o);const n=o.join("");m(n),null==a||a(n)},f=(e,t)=>{const o=e.target,n=o.value;if(0===t&&6===n.length)((e,t)=>{x(t,0);let o=0,n=e;for(;o<=5;)n.id===Jl?n=n.nextElementSibling:(n.value=t[o],5===o&&Yl(n),n=n.nextElementSibling,o++)})(o,n);else{x(n.substring(0,1),t);let e=o.nextElementSibling;(null==e?void 0:e.id)===Jl&&(e=e.nextElementSibling),e&&o.value&&Yl(e)}},b=(e,t)=>{switch(e.keyCode){case 8:((e,t)=>{const o=e.target;if(o.value)return void x("",t);let n=o.previousElementSibling;(null==n?void 0:n.id)===Jl&&(n=n.previousElementSibling),Yl(n)})(e,t);break;case 37:(e=>{let t=e.target.previousElementSibling;(null==t?void 0:t.id)===Jl&&(t=t.previousElementSibling),Yl(t)})(e);break;case 39:(e=>{let t=e.target.nextElementSibling;(null==t?void 0:t.id)===Jl&&(t=t.nextElementSibling),Yl(t)})(e)}},_=(0,Ga.$L)(c.join(""))?"common_login_reset_email_verify_title":"",y=t||h||_,v=6===c.length&&Boolean(y);for(let t=0;t0&&tf(e,t),onKeyDown:e=>b(e,t),autoFocus:0===t,error:v,value:c[t]||"",ref:0===t?u:null,style:r},t)),o&&d.push((0,n.jsx)(Kl,{id:Jl}))}return(0,n.jsxs)(Ql,{children:[(0,n.jsx)(Zl,{children:d}),v&&y&&(0,n.jsx)(jr,{style:{width:"100%"},text:s(y),type:"error"})]})},es={height:"52px",width:"46px"},ts={height:"52px",width:"49px"},os=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,sn.VN)(),{isSecurityVerification:o}=Be((()=>["isSecurityVerification"]),[]),{isMobile:i}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{region:a}=(0,de.L$)((0,ue.W)((()=>["region"]),[])),[{phoneNotRegistered:r}]=(0,l.Su)(Z.$),{registerPhone:s}=(0,l.wA)(Dt.H),[d]=(0,l.Su)(Qa.U),{mobile:p,phoneErrorMsg:u}=d,[{sendCodeLoading:h},{sendPhoneCodeForLogin:m,sendPhoneCodeForVerify:x}]=(0,l.Su)(Ja.m),f=nr(),b=(e=>{if(e.length<10)return e;const t=e.length-4-1,o=e.split("");for(let e=t;e>=t-6;e--)o[e]="*";return o.join("")})(p),[{loginLoading:_},{handleSmsLogin:y,handleSmsVerify:v}]=(0,l.Su)(Z.$),C=(0,E.W6)(),j=(0,L.useCallback)((()=>{C.goBack()}),[C]),{countDownSecond:w}=Gl(p,h),S=(0,L.useCallback)((e=>{t({platform:"sms_verification"});const n={mobile:p,phoneCode:e,login_only:!0};o?v(n):y(n)}),[t,p,o,v,y]),T=(0,L.useCallback)((e=>{p&&e&&!u&&!(0,Ga.$L)(e)&&S(e)}),[S,p,u]),P=Boolean(w)||_||h||r,M=(0,L.useCallback)((()=>{P||(o?x({mobile:p}):m({mobile:p}))}),[o,p,P,m,x]),A=(0,L.useCallback)((()=>{s({region:a})}),[s,a]);return Me(),(0,n.jsx)(ar,{onSubmit:M,children:(0,n.jsxs)(Ar,{children:[(0,n.jsx)(Fr,{children:e("tv_webLogin_login_header")}),(0,n.jsxs)($r,{children:[(0,n.jsx)(Nr,{children:e("tv_webLogin_enterCode_bodyv2",{phone_number:""})}),(0,n.jsx)(Ur,{children:b})]}),(0,n.jsxs)(zr,{children:[(0,n.jsx)(Xl,{value:"",length:6,onChange:T,errorMsg:f,inputStyle:i?ts:es}),r&&(0,n.jsxs)(Ki,{children:[(0,n.jsx)(Zi,{children:e("common_login_sms_unregistered_pc_1")}),(0,n.jsx)(Zi,{link:!0,onClick:A,children:e("common_login_sms_unregistered_pc_2")})]}),(0,n.jsx)(Br,{style:{marginTop:"24px"},children:(0,n.jsx)(Vr,{onClick:j,text:e("tv_webLogin_enterCode_altMethod"),path:k.tH.tvLoginHome,replace:!0})}),(0,n.jsx)(Er,{loading:_||h,disabled:P,children:`${e("common_registration_phone_sms_button")}${w?`: ${w}s`:""}`})]})]})})},ns=(0,Q.default)("div",{target:"e1rj4s2h0"})((({theme:e})=>{return[(t=e.isMobile,t?{padding:"0px 32px 32px"}:{})];var t}),"label:DivContainer;"),is=(0,Q.default)("div",{target:"e1rj4s2h1"})((({theme:e})=>{return[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont",fontWeight:"bold"}),(t=e.isMobile,t?{fontSize:"20px",marginTop:"24px"}:{fontSize:"33px"})];var t}),"label:DivTitleContainer;"),as=(0,Q.default)("p",{target:"e1rj4s2h2"})((({theme:e})=>{return[(0,J.zy)({theme:e,color:"TextSecondary",fontFamily:"TikTokFont"}),(t=e.isMobile,t?{fontSize:"14px",lineHeight:"17px",margin:"8px 0"}:{fontSize:"16px",lineHeight:"22px",margin:"16px 0"})];var t}),"label:PDescriptionContainer;"),rs=e=>e?{position:"absolute",bottom:"28px",left:"32px",right:"32px",width:"auto"}:{},ls=({theme:{isMobile:e}})=>[rs(e)],ss=(0,Q.default)(Pr,{target:"e1rj4s2h5"})(ls,"label:StyledTwoStepButton;"),ds=(0,Q.default)("hr",{target:"e1rj4s2h6"})({border:0,margin:0,marginTop:"48px",marginBottom:"30px",borderBottom:"1px solid rgba(22, 24, 35, .12)"},"label:HrDivider;"),cs=(0,Q.default)("p",{target:"e1rj4s2h7"})((({theme:e})=>[(0,J.zy)({theme:e,typography:"P2",fontWeight:"bold",fontFamily:"TikTokFont"}),{margin:0}]),"label:PTitle;");var ps=o(28367);const us=(0,Q.default)("button",{target:"e1gzcpl10"})((({theme:e})=>[(0,J.zy)({color:"TextPrimary",theme:e,fontFamily:"TikTokFont",fontWeight:"semiBold"}),{margin:0,backgroundColor:e.colors.BGInput2,borderColor:e.colors.LineSecondary2,borderWidth:1.5,borderStyle:"solid",borderRadius:"rtl"===e.direction?"4px 0 0 4px":"0px 4px 4px 0px",borderInlineStartWidth:1.5,cursor:"pointer",fontSize:"16px",padding:"0px 16px",height:"44px",flexShrink:0,boxSizing:"content-box","&:disabled":{color:e.colors.TextQuaternary,cursor:"not-allowed"}}]),"label:ButtonSendCode;");us.defaultProps=Object.assign(Object.assign({},us.defaultProps),{"data-e2e":"send-code-button"});const gs=(0,Q.default)(ps.A,{target:"e1gzcpl11"})({marginInlineStart:"4px",fontSize:"20px",verticalAlign:"middle",marginTop:"-2px",animation:"loading-circle-anim linear 1s infinite","@keyframes loading-circle-anim":{"0%":{transform:"rotate(0)"},"100%":{transform:"rotate(360deg)"}}},"label:StyledLoadingCircle;"),hs=(0,L.memo)((function(e){const{text:t,disabled:o,countDownSecond:i=0,loading:a}=e;return(0,n.jsxs)(us,{type:"button",onClick:e.onClick,disabled:Boolean(o)||Boolean(i),lo:!0,children:[t+(i?`: ${i}s`:""),a&&(0,n.jsx)(gs,{})]})})),ms=(0,Q.default)("div",{target:"e2oypfg0"})({transition:"all 0.3s",display:"flex",justifyContent:"space-between"},"label:DivCodeInputContainer;"),xs=(0,Q.default)(vr,{target:"e2oypfg1"})((({theme:e})=>({flex:1,width:0,"& > input":{height:"47px",borderRadius:"rtl"===e.direction?"0 4px 4px 0":"4px 0px 0px 4px"}})),"label:StyledBaseInput;");xs.defaultProps=Object.assign(Object.assign({},xs.defaultProps),{"data-e2e":"digit-code-input"});const fs=(0,L.memo)((function(e){const{errorMsg:t,disabled:o,codeFromNumber:i,loading:a,autoSendFirstTime:r,email:s,isSendCodeHidden:d}=e,c=(0,g.s)("WebApp_Login"),[p,u]=(0,L.useState)(!1),[h,m]=(0,L.useState)(),[{codeFormatError:x,getCodeErrorMsg:f,code:b},{setCode:_}]=(0,l.Su)(Ja.m);(0,L.useEffect)((()=>{m(t)}),[t]),(0,L.useEffect)((()=>{m(f)}),[f]);const{countDownSecond:y,hasSent:v}=Gl(i,a,s);(0,L.useEffect)((()=>{if(r){const{countDownSecond:t}=(0,$l.o)(i,s);!t&&e.onClickSendCode()}return()=>{_("")}}),[]);const k=(0,L.useCallback)((()=>{u(!0)}),[]),C=(0,L.useCallback)((()=>{u(!1)}),[]),j=(0,L.useCallback)((e=>{_(e.target.value)}),[_]),w=(0,cr.Yk)("phone-code"),S=h||x,T=x?!p:Boolean(S);return(0,n.jsxs)("div",{children:[(0,n.jsxs)(ms,{children:[(0,n.jsx)(xs,{placeholder:c("common_login_reset_email_verify_title"),onFocus:k,onBlur:C,onChange:j,onClick:w,value:b,className:"code-input",autoComplete:"off",errorState:T}),!d&&(0,n.jsx)(hs,{loading:a,onClick:e.onClickSendCode,disabled:Boolean(o)||Boolean(y)||a,countDownSecond:y,text:c(v?"common_registration_phone_sms_button":"common_registration_phone_input_button")})]}),T&&S&&(0,n.jsx)(jr,{text:c(S),type:"error"})]})})),bs=(0,Q.default)("p",{target:"e17ptbg00"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"semiBold"}),{fontSize:"20px",lineHeight:"24px",marginTop:"24px",marginBottom:"8px"}]),"label:PTitleContainer;"),_s=(0,Q.default)("p",{target:"e17ptbg01"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextTertiary2",fontFamily:"TikTokFont"}),{fontSize:"14px",lineHeight:"17px",marginBottom:"8px"}]),"label:PDescriptionContainer;"),ys=(0,Q.default)(ps.A,{target:"eo6lrdp0"})({marginInlineStart:"4px",fontSize:"20px",verticalAlign:"middle",marginTop:"-2px",animation:"loading-circle-anim linear 1s infinite","@keyframes loading-circle-anim":{"0%":{transform:"rotate(0)"},"100%":{transform:"rotate(360deg)"}}},"label:StyledLoadingCircle;"),vs=(0,Q.default)("div",{target:"e1ait7k0"})({display:"flex",margin:"20px 0",height:"18px",justifyContent:"space-between"},"label:DivContainer;"),ks=(0,Q.default)("span",{target:"e1ait7k1"})((({theme:e,disabled:t})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"semiBold"}),{color:t?e.colors.TextQuaternary:e.colors.TextPrimary,fontSize:"14px",lineHeight:"18px"}]),"label:SpanText;"),Cs=(0,L.memo)((function(e){const{loading:t,codeFromNumber:o,email:i}=e,{countDownSecond:a}=Gl(o,t,i),r=(0,g.s)("WebApp_Login");return(0,n.jsxs)(vs,{children:[(0,n.jsx)(ks,{onClick:e.onClick,disabled:Boolean(a),children:`${r("common_registration_phone_sms_button")}${a?`: ${a}s`:""}`}),t&&(0,n.jsx)(ys,{})]})})),js=(0,Q.default)("p",{target:"e1tvj6xp0"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextTertiary2",fontFamily:"TikTokFont"}),{fontSize:"14px",lineHeight:"17px",marginBottom:"8px"}]),"label:PDescriptionContainer;"),ws=(0,Q.default)("div",{target:"e1tvj6xp1"})({height:"48px",display:"flex"},"label:DivInputContainer;"),Ss=(0,Q.default)("input",{target:"e1tvj6xp2"})((({theme:e})=>[(0,J.mp)({direction:e.direction,start:"-1000px"}),{opacity:0,position:"absolute"}]),"label:Input;"),Ts=(0,Q.default)("div",{target:"e1tvj6xp3"})((({theme:e,error:t,active:o})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"semiBold"}),{position:"relative",fontSize:"20px",flex:"1",borderBottom:"1px solid",borderBottomColor:t?e.colors.Negative:e.colors.LinePrimary2,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",marginInlineEnd:"10px",":last-child":{marginInlineEnd:"0"},"::before":{content:'""',position:"absolute",height:"16px",width:"2px",background:e.colors.Primary,margin:"auto",display:o?"block":"none",animation:"cursor-animation 1.5s linear infinite"},"@keyframes cursor-animation":{"0%":{opacity:0},"25%":{opacity:0},"50%":{opacity:1},"75%":{opacity:1},"100%":{opacity:0}}}]),"label:DivLabel;"),Ls=(0,L.memo)((function(e){const t=(0,g.s)("WebApp_Login"),{codeFromNumber:o,codeDesc:i,email:a,loading:r,onSubmit:s,showTitle:d=!0,autoSubmit:c=!0,errorMsg:p="",autoSendFirstTime:u,isSendCodeHidden:h}=e,[{code:m,sendCodeLoading:x,getCodeErrorMsg:f=""},{setCode:b}]=(0,l.Su)(Ja.m),_=(0,L.useRef)(null),y=(0,L.useCallback)((()=>{var e;null===(e=_.current)||void 0===e||e.focus()}),[]),v=(0,L.useCallback)((e=>{if(6===m.length&&5===e.target.value.length)b("");else{const t=e.target.value.replace(/[^\d]/g,"");b(t)}}),[b,m]),k=(0,L.useCallback)((e=>{e.persist()}),[]);(0,L.useEffect)((()=>{if(u){const{countDownSecond:t}=(0,$l.o)(o,a);!t&&e.onClickSendCode()}return()=>{b("")}}),[]),(0,L.useEffect)((()=>{6===m.length&&c&&s()}),[m,s,c]);const C=null!=i?i:t("Your code was sent to {code}",{code:o}),j=f||p,w=Boolean(j);return(0,n.jsxs)(n.Fragment,{children:[d&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bs,{children:t("common_login_reset_email_verify_title")}),(0,n.jsx)(js,{children:C})]}),(0,n.jsxs)(ws,{onClick:y,children:[(0,n.jsx)(Ss,{ref:_,onChange:v,type:"tel",autoFocus:!0,value:m,autoComplete:"one-time-code",onAnimationEnd:k}),Array(6).fill("").map(((e,t)=>(0,n.jsx)(Ts,{active:m.length===t,error:w,children:m[t]},t)))]}),(0,n.jsx)(jr,{text:t(j),type:"error"}),!h&&(0,n.jsx)(Cs,{codeFromNumber:o,loading:x||r,onClick:e.onClickSendCode,email:a})]})})),Ps=e=>{const{onSubmit:t}=e,o=(0,F.__rest)(e,["onSubmit"]),{isMobile:i}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[]));return i?(0,n.jsx)(Ls,Object.assign({},o,{onSubmit:e.onSubmit,autoSubmit:!1,showTitle:!1})):(0,n.jsx)(fs,Object.assign({},o))},Ms=(0,Q.default)(Bt,{target:"ep888o80"})({fontSize:"12px",display:"inline-block"},"label:StyledLink;"),As=(0,L.memo)((function(e){const{text:t,path:o,replace:i,textTheme:a}=e;return(0,n.jsx)(Ms,{path:o,text:t,replace:i,textTheme:a,onClick:e.onClick})}));var Es=o(78016);const Fs=(0,Q.default)("div",{target:"e1mtjw290"})((({theme:e})=>({background:e.colors.BGPrimary,borderRadius:"8px",padding:"4px 0 0",textAlign:"center",margin:"auto",overflow:"hidden"})),"label:DivContainer;"),Is=(0,Q.default)("h5",{target:"e1mtjw291"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"20px",lineHeight:"24px",padding:"24px",margin:"0"}]),"label:H5Title;"),Hs=(0,Q.default)(Es.K,{target:"e1mtjw292"})((({theme:e})=>({width:"100%",borderRadius:"0",height:"48px",fontWeight:600,border:"none",borderTop:`1px solid ${e.colors.LineSecondary2}`,"&:last-child":{color:e.colors.TextTertiary2}})),"label:StyledButton;"),zs={width:"80%",maxWidth:"400px",background:"transparent"},Ds=(0,L.memo)((({title:e,visible:t,actions:o})=>{const i=(0,g.s)("WebApp_Login");return(0,n.jsx)(y.aF,{contentStyle:zs,visible:t,maskCloseable:!1,children:(0,n.jsxs)(Fs,{children:[(0,n.jsx)(Is,{children:i(e)}),o.map((({onClick:e,text:t},o)=>(0,n.jsx)(Hs,{onClick:e,children:i(t)},o)))]})})})),Rs=(0,Q.default)("div",{target:"e8ziav60"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:"15px",lineHeight:"18px",margin:"20px 0 -12px 0"}]),"label:DivText;");Rs.defaultProps=Object.assign(Object.assign({},Rs.defaultProps),{"data-e2e":"forgot-passport-button"});const Os=(0,L.memo)((function({onClickForgetEmailPwd:e}){const t=(0,E.W6)(),o=(0,g.s)("WebApp_Login"),[i,a]=(0,L.useState)(!1),r=(0,L.useCallback)((()=>{a(!0)}),[]),l=(0,L.useCallback)((()=>{t.push(k.tH.loginForgetPhonePassword)}),[t]),s=(0,L.useCallback)((()=>{null==e||e(),t.push(k.tH.loginForgetEmailPassword)}),[t,e]),d=(0,L.useMemo)((()=>[{text:"Phone number",onClick:l},{text:"Email",onClick:s},{text:"common_registration_phone_input_popup_button",onClick:()=>a(!1)}]),[s,l]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Rs,{onClick:r,children:[o("forget_password")," "]}),(0,n.jsx)(Ds,{visible:i,actions:d,title:"common_login_reset_popup_title"})]})})),Ws=(0,L.memo)((function(e){const t=(0,g.s)("WebApp_Login"),{isMobile:o}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[]));return o?(0,n.jsx)(Os,{onClickForgetEmailPwd:e.onClickForgetEmailPwd}):(0,n.jsx)(As,{text:t("forget_password"),path:k.tH.loginForgetEmailPassword,onClick:e.onClickForgetEmailPwd})})),Bs=(0,Q.default)("span",{target:"eea75y50"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{display:"inline-block",fontSize:"14px",lineHeight:"17px",margin:"12px 0",paddingInlineEnd:"12px","& + &":{paddingInlineStart:"12px",position:"relative","&::before":Object.assign({content:'""',position:"absolute",height:"12px",width:"1px",top:"2px",background:e.colors.LineSecondary},[(0,J.mp)({start:"0",direction:e.direction})])}}]),"label:SpanOptionsText;"),$s=(0,Q.default)("span",{target:"eea75y51"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{margin:"12px 0",display:"inline-block",fontSize:"14px",fontWeight:600,zIndex:20}]),"label:SpanChangeWayText;"),Us=(0,Q.default)(Es.K,{target:"eea75y52"})((({theme:e})=>({width:"100%",borderRadius:"0",height:"48px",fontWeight:600,border:"none",borderBottom:`1px solid ${e.colors.LineSecondary2}`,"&:last-child":{color:e.colors.TextTertiary2,marginTop:"8px"}})),"label:StyledButton;"),Ns={[er.email]:"twostep_verification_useemail",[er.password]:"twostep_verification_usepassword",[er.phone]:"twostep_verification_usesms",[er.totp]:"twostep_verification_useauthenticator"},Vs=(0,L.memo)((function(e){const t=(0,g.s)("WebApp_Login"),{verifyWays:o=[]}=e;return(0,n.jsx)(n.Fragment,{children:o.map((o=>{const i=`/login/2sv/${Xa[o]}`;return(0,n.jsx)(Bs,{onClick:e.onClickType(o),children:(0,n.jsx)(I.N_,{to:i,children:t(Ns[o])})},o)}))})}));var Gs=o(70461);const qs=(0,Q.default)("div",{target:"e1pjeozo0"})({position:"fixed",left:0,top:0,bottom:0,right:0,overflow:"auto",outline:"0px",zIndex:12,display:"none",transition:"all 500ms cubic-bezier(.075, .82, .165, 1)","&.enter-active":{display:"block"},"&.enter-done":{display:"block"},"&.exit":{display:"block"},"&.exit-active":{display:"none"}},"label:DivPopup;"),Ks=(0,Q.default)("div",{target:"e1pjeozo1"})((({theme:e})=>({position:"absolute",width:"100vw",bottom:0,left:0,right:0,background:e.colors.BGPlaceholderOpaque,borderRadius:"8px 8px 0 0",overflow:"hidden",transition:"all 500ms",zIndex:11,"&.enter-active":{opacity:1,transform:"translateY(100%)"},"&.enter-done":{transform:"translateY(0)"}})),"label:DivContent;"),Zs=(0,Q.default)("div",{target:"e1pjeozo2"})((({theme:{colors:e}})=>({background:e.SDSecondary,position:"absolute",left:0,right:0,top:0,bottom:0})),"label:DivMask;"),Qs=e=>{const{visible:t}=e,o=(0,L.useRef)(null);return(0,n.jsx)(Gs.A,{in:t,timeout:300,children:(0,n.jsxs)(qs,{children:[(0,n.jsx)(Zs,{}),(0,n.jsx)(Gs.A,{in:t,timeout:100,nodeRef:o,children:(0,n.jsx)(Ks,{ref:o,children:e.children})})]})})},Js={[er.email]:"login_send_code_email",[er.phone]:"login_send_code_sms",[er.password]:"twosv_login_switch_pw",[er.totp]:"2_step_verification_alt_method3"},Ys=(0,L.memo)((function(e){const t=(0,g.s)("WebApp_Login"),[o,i]=(0,L.useState)(!1),{verifyWays:a=[],onClickType:r}=e,l=(0,L.useCallback)((()=>{i(!0)}),[]),s=(0,L.useCallback)((()=>{i(!1)}),[]),d=(0,L.useCallback)((e=>()=>{r(e)(),i(!1)}),[r]);return a.length?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Qs,{visible:o,children:(0,n.jsxs)("div",{children:[a.map(((e,o)=>(0,n.jsx)(Us,{onClick:d(e),loading:!1,children:t(Js[e])},o))),(0,n.jsx)(Us,{onClick:s,children:t("step_verification_cancel")})]})}),(0,n.jsx)($s,{onClick:l,children:t("login_try_another_method")})]}):null})),Xs=(0,L.memo)((function(){const[{verifyWays:e={},type:t},{setTwoStepType:o}]=(0,l.Su)(tr),{isMobile:i}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),a=(0,L.useCallback)((e=>()=>{o(e)}),[o]),r=(0,L.useMemo)((()=>({verifyWays:Object.keys(e).filter((e=>e!==t)),onClickType:a})),[t,e,a]);return(0,n.jsxs)(n.Fragment,{children:[i?(0,n.jsx)(Ys,Object.assign({},r)):r.verifyWays.length<2?(0,n.jsx)(Vs,Object.assign({},r)):null,"pwd_verify"===t&&1===Object.keys(e).length&&(0,n.jsx)(Ws,{})]})})),ed={[er.email]:"2_step_verification_alt_method2",[er.password]:"2_step_verification_alt_method4",[er.phone]:"2_step_verification_alt_method1",[er.totp]:"2_step_verification_alt_method3"},td=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),[{verifyWays:t={},type:o},{setTwoStepType:i}]=(0,l.Su)(tr),{isMobile:a}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),r=(0,E.W6)(),s=(0,L.useCallback)(((e,t)=>()=>{i(t),r.push(e)}),[r,i]),d=(0,L.useMemo)((()=>Object.keys(t).filter((e=>e!==o))),[o,t]);return!a&&d.length>1?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ds,{}),(0,n.jsx)(cs,{children:e("2_step_verification_try_alt_method")}),d.map(((t,o)=>{const i=`/login/2sv/${Xa[t]}`;return(0,n.jsx)(Lr,{onClick:s(i,t),size:"small",buttonTheme:"default",children:e(ed[t])},o)}))]}):null})),od=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,s.Nj)(C.$F),[{sendCodeLoading:o,code:i,codeFormatError:a},{sendEmailCodeForReset:r,sendEmailCodeForLogin:d,sendEmailCodeForVerify:c}]=(0,l.Su)(Ja.m),[{verifyWays:p,not_login_ticket:u,verify_ticket:h,password:m="",loginLoading:x},{handleCodeVerify:f}]=(0,l.Su)(tr),{changePwdByEmail:b}=(0,l.wA)(Z.$),_=nr(),y=(0,L.useCallback)((()=>{t.twoStepSubmit({verification_method:"email",forReset:Boolean(m)}),m?b({not_login_ticket:u,verify_ticket:h,emailCode:i,password:m,email:""}):f({code:i,not_login_ticket:u,verify_ticket:h})}),[b,i,f,t,u,m,h]),v=(0,L.useCallback)((()=>{m?r({not_login_ticket:u,verify_ticket:h}):u?d({not_login_ticket:u,verify_ticket:h}):c({verify_ticket:h})}),[m,r,u,d,h,c]);return(0,n.jsxs)(ar,{onSubmit:y,children:[(0,n.jsx)(as,{children:e("common_login_reset_email_verify_title")}),(0,n.jsx)(as,{children:e("common_verify_email_text",{email:null==p?void 0:p.email_verify})}),(0,n.jsx)(Ps,{autoSendFirstTime:!0,email:!0,codeFromNumber:h,loading:o,onClickSendCode:v,onSubmit:y,errorMsg:_}),(0,n.jsx)(Xs,{}),(0,n.jsx)(ss,{disabled:Boolean(a)||!i,loading:x,children:e("login_next")}),(0,n.jsx)(td,{})]})},nd=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,s.Nj)(C.$F),{password:o,hasInvalid:i}=(0,l.Ph)(qa),{isMobile:a}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),[{verify_ticket:r,loginLoading:d},{handlePasswordVerify:p}]=(0,l.Su)(tr),u=nr(),h=(0,L.useCallback)((()=>{t.twoStepSubmit({verification_method:"password",forReset:!1}),p({password:o,verify_ticket:r})}),[p,t,o,r]);return(0,n.jsxs)(ar,{onSubmit:h,children:[(0,n.jsx)(as,{children:e("common_verify_password_text")}),(0,n.jsx)(Tr,{create:!1,loginError:Boolean(u),loginErrorText:a?u:void 0}),(0,n.jsx)(Xs,{}),!a&&(0,n.jsx)(jr,{text:e(u),type:"error"}),(0,n.jsx)(ss,{disabled:Boolean(i)||!o,loading:d,children:e("login_next")}),(0,n.jsx)(td,{})]})},id=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,s.Nj)(C.$F),[{sendCodeLoading:o,code:i,codeFormatError:a},{sendPhoneCodeForTwoStep:r,sendPhoneCodeForResetPwd:d}]=(0,l.Su)(Ja.m),[{verifyWays:c,verify_ticket:p,not_login_ticket:u,password:h,loginLoading:m,accountQuery:x},{handleCodeVerify:f,handleSmsCodeVerifyReset:b}]=(0,l.Su)(tr),_=nr(),y=(0,L.useCallback)((()=>{const e={verify_ticket:p,not_login_ticket:u,mobile:null==x?void 0:x.mobile};h?d(e):r(e)}),[null==x?void 0:x.mobile,u,h,d,r,p]),v=(0,L.useCallback)((()=>{t.twoStepSubmit({verification_method:"phone",forReset:Boolean(h)}),h?b({not_login_ticket:u,verify_ticket:p,code:i,password:h}):f({verify_ticket:p,code:i,not_login_ticket:u})}),[i,f,b,t,u,h,p]);return(0,n.jsxs)(ar,{onSubmit:v,children:[(0,n.jsx)(as,{children:e("common_login_reset_email_verify_title")}),(0,n.jsx)(as,{children:e("common_verify_sms_text",{mobile:null==c?void 0:c.mobile_sms_verify})}),(0,n.jsx)(Ps,{autoSendFirstTime:!0,codeFromNumber:p,loading:o,onClickSendCode:y,onSubmit:v,errorMsg:_}),(0,n.jsx)(Xs,{}),(0,n.jsx)(ss,{disabled:Boolean(a)||!i,loading:m,children:e("login_next")}),(0,n.jsx)(td,{})]})},ad=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,s.Nj)(C.$F),[{sendCodeLoading:o,code:i,codeFormatError:a}]=(0,l.Su)(Ja.m),[{not_login_ticket:r,verify_ticket:d,password:c="",loginLoading:p},{handleCodeVerify:u,handleTOTPVerifyAndRestPwd:h}]=(0,l.Su)(tr),m=nr(),x=(0,L.useCallback)((()=>{t.twoStepSubmit({verification_method:"totp",forReset:Boolean(c)}),c?h({verify_ticket:d,code:i,password:c}):u({code:i,not_login_ticket:r,verify_ticket:d})}),[i,h,u,t,r,c,d]),f=(0,L.useCallback)((()=>{}),[]);return(0,n.jsxs)(ar,{onSubmit:x,children:[(0,n.jsx)(as,{children:e("2_step_verification_body")}),(0,n.jsx)(Ps,{autoSendFirstTime:!0,email:!0,codeFromNumber:d,loading:o,onClickSendCode:f,onSubmit:x,errorMsg:m,isSendCodeHidden:!0}),(0,n.jsx)(Xs,{}),(0,n.jsx)(ss,{disabled:Boolean(a)||!i,loading:p,children:e("login_next")}),(0,n.jsx)(td,{})]})},rd=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,s.Nj)(C.$F),{isMobile:o}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),i=(0,E.W6)(),{isTwoStep:a,verifyWays:r,password:d}=(0,l.Ph)(tr),{type:p}=(0,I.g)(),u=er[p];return(0,L.useEffect)((()=>{u&&(null==r?void 0:r[u])||i.replace(k.tH.loginHome),t.twoStepNotify({verification_method:p,forReset:Boolean(d)})}),[i,t,d,p,r,u]),Me(),(0,n.jsxs)(ns,{children:[o&&(0,n.jsx)(at,{}),(0,n.jsx)(is,{children:e(a?"security_step_verification":"common_verify_title")}),p===Xa.pwd_verify?(0,n.jsx)(nd,{}):p===Xa.email_verify?(0,n.jsx)(od,{}):p===Xa.totp_verify?(0,n.jsx)(ad,{}):(0,n.jsx)(id,{})]})};var ld=o(34728),sd=o(39896),dd=o(2584),cd=o(64738),pd=o(69746);const ud=(0,o(71111).atom)(!1),gd={initialized:!1,eventCommonParams:{},init(e){var t;const o=ye.parse(e),{platform:n,group_id:i,last_group_id:a}=o,r=(0,No.r)(o,["enter_method","enter_from","enter_ref_id","device_platform","ref_hash"]),{enter_from:l}=r,s=(0,F.__rest)(r,["enter_from"]);this.initialized=!0,this.eventCommonParams=Object.assign(Object.assign(Object.assign({},s),{enter_from:null!==(t=null==l?void 0:l.toString())&&void 0!==t?t:"login",platform:n,group_id:null==i?void 0:i.toString(),last_group_id:null==a?void 0:a.toString()}),(0,pd.V)())},setDevicePlatform(e){const t=e?"mobile_web":"desktop_web";this.eventCommonParams.device_platform=t},setEnterMethodForTeaEvents(e){this.eventCommonParams.enter_method=e},setGroupIdForTeaEvents(e){this.eventCommonParams.group_id=e},setLastGroupIdForTeaEvents(e){this.eventCommonParams.last_group_id=e}},hd=({groupId:e,lastGroupId:t,enterMethod:o,closeable:n,predictionPayload:i}={})=>{o&&(e=>{gd.setEnterMethodForTeaEvents(e)})(o);const a=(0,s.Nj)(C.$F),r=(0,s.Nj)(Te.le),l=(0,s.Nj)(Te.VU),[d,c]=(0,cd.useAtom)(ud),p=(0,cr.On)();(0,L.useEffect)((()=>{(e=>{gd.setGroupIdForTeaEvents(e)})(e),a.setGroupId(e)}),[a,e]),(0,L.useEffect)((()=>{(e=>{gd.setLastGroupIdForTeaEvents(e)})(t),a.setLastGroupId(t)}),[a,t]),(0,L.useEffect)((()=>{o&&(r.setEnterMethod(o),a.setEnterMethod(o)),r.setEnterFrom();const e=Number((0,ld.isWebAuthnAvailable)());a.isPasskeyEligible=e,a.loginPanelType="none"===p?"login":"passkey_login",null!=n||a.setCloseable(n),i&&a.setPredictionPayload(i);const t=b.nf.getTrackingInfo(),s=b.nf.getResumeDataSource(),u=()=>{a.loginNotify(Object.assign(Object.assign({},(0,pd.V)()),{is_passkey_eligible:e})),r.loginNotify()};if(!t)return u();if(s===rn&&!d)return c(!0),u();const g=b.nf.getDurationSinceClickTimestampOnce();a.loginNotify(Object.assign(Object.assign({click_to_notify_duration:g,e2eInfo:t},(0,pd.V)()),{is_passkey_eligible:e})),r.loginNotify(),g&&l.sendLoginClickToNotifyDurationPerfMetric(g)}),[])},md=e=>{const t=(0,L.useRef)(void 0),o=(0,s.Nj)(C.$F);(0,L.useEffect)((()=>{if(void 0===t.current||void 0!==e){const t=b.nf.getTrackingInfo();o.enterSignUp({groupId:e,e2eInfo:t})}t.current=e}),[e,o])};var xd=o(10828),fd=o(28591);const bd={login:{title:"log_in",description:"Log in or sign up for an account on TikTok. Start watching to discover real people and real videos that will make your day.",keywords:"Log in, Log in to TikTok"},signup:{title:"sign_up",description:"Sign up for an account or log back into TikTok. Create an account to discover real people and real videos that will make your day.",keywords:"Sign up, Sign up for TikTok"}},_d=(0,L.memo)((({page:e})=>{var t;const o=bd[e],i=(0,g.s)("WebApp_Login"),{language:a}=(0,de.L$)((0,ue.W)((()=>["language"]),[])),{isMobile:r}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{pathname:l}=(0,E.zy)();return(0,n.jsxs)(fd.mg,{htmlAttributes:{lang:a},children:[r&&"loginDownloadApp"===(null===(t=(0,k.Iv)(l))||void 0===t?void 0:t.name)&&(0,n.jsx)("link",{rel:"canonical",href:`${xd.C}/download`},"canonical"),(0,n.jsx)("title",{children:`${i(o.title)} | TikTok`}),(0,n.jsx)("meta",{name:"description",content:i(o.description)}),(0,n.jsx)("meta",{name:"keywords",content:o.keywords})]})}));function yd(e){return L.createElement("svg",(0,lt._)({fill:"currentColor"},e,{viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:e.className}),L.createElement("path",{d:"M4 24a5 5 0 1 1 10 0 5 5 0 0 1-10 0ZM19 24a5 5 0 1 1 10 0 5 5 0 0 1-10 0ZM39 19a5 5 0 1 0 0 10 5 5 0 0 0 0-10Z"}))}(0,st.r)(yd);const vd={id:"single-logo-light-1115c5dd",use:"single-logo-light-1115c5dd-usage",viewBox:"0 0 25 42",content:''};function kd(e){const t=(0,L.useContext)(Fe.X);return(0,L.useLayoutEffect)((()=>(t.add(vd),()=>{t.remove("single-logo-light-1115c5dd")})),[]),(0,n.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,n.jsx)("use",{xlinkHref:"#single-logo-light-1115c5dd"},void 0)}),void 0)}const Cd=(0,Q.default)("div",{target:"e15366060"})({display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:"8px"}},"label:DivIconButtonListContainer;"),jd=(0,Q.default)("div",{target:"e15366061"})((({width:e,height:t,theme:{colors:o}})=>[{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",border:"1px solid",borderColor:o.LineSecondary,borderRadius:"50%",cursor:"pointer",width:`${e}px`,height:`${t}px`,"&:hover":{opacity:.8}}]),"label:DivIconButton;"),wd=({configItem:e,width:t,height:o})=>{const i=e.icon;return(0,n.jsx)(jd,{onClick:e.onClick,onKeyDown:e.onClick,width:t,height:o,tabIndex:0,role:"link",children:(0,n.jsx)(i,{width:t/2,height:o/2})})},Sd=({config:e,width:t,height:o})=>(0,n.jsx)(Cd,{children:e.map((e=>(0,n.jsx)(wd,{configItem:e,width:t,height:o},e.type)))}),Td=(0,Q.default)("div",{target:"e16hbrhj0"})({width:"315px",margin:"auto",height:"44px"},"label:DivGuestModeContainer;"),Ld=(0,Q.default)("div",{target:"e16hbrhj1"})({height:"158px",paddingTop:"56px",paddingBottom:"18px",justifyContent:"space-between",alignItems:"center",display:"flex",flexDirection:"column"},"label:DivStartsOnTikTokContainer;"),Pd=(0,Q.default)("div",{target:"e16hbrhj2"})({display:"flex",flexDirection:"row",flexShrink:"0",alignItems:"center",justifyContent:"center",margin:"16px auto",overflow:"hidden",width:"315px"},"label:DivGuestModeOrContinueWithContainer;"),Md=(0,Q.default)("div",{target:"e16hbrhj3"})((({theme:e})=>[{width:"100%",height:"1px",flexShrink:"0",background:e.colors.LineReverse2}]),"label:DivGuestModeSeparatorLine;"),Ad=(0,Q.default)("div",{target:"e16hbrhj4"})([{margin:"0 6px",whiteSpace:"nowrap"}],"label:DivGuestModeSeparatorText;");var Ed=o(72241);const Fd=(0,L.memo)((function(){const e=Wi(["google","facebook"]),t=(0,jt.K)({isGuestMode:!0}),o=(0,s.Nj)(C.$F),a=(0,L.useCallback)((()=>{o.loginMethodExpand(),t()}),[o,t]),r=(0,L.useMemo)((()=>[...e,{icon:yd,onClick:a,type:"openLogin"}]),[a,e]),[d,{setLoginModalShow:c,setCloseCallback:p,setGroupId:h,setIsLoginOnLoadClosed:m}]=(0,j.MR)((e=>e.closeCallback)),x=(0,g.s)("Webapp"),[{showFlashingButton:f}]=(0,l.Su)(Oe.t),_=(0,l.wA)(u.i),y=(0,L.useCallback)((()=>{c(!1),o.loginNotifyClose({isSignUp:"0",e2eInfo:b.nf.getTrackingInfo()}),_.setLoginModalInitialState(),d(),p(T()),h(void 0),localStorage.setItem("guest-mode-flag","1"),localStorage.setItem("timeOfLastPopup",Date.now().toString()),m({isLoginOnLoadClosed:!0})}),[c,o,_,d,p,h,m]),{value:v}=(0,L.useContext)(Ed.xm),k=(0,L.useMemo)((()=>v?(0,n.jsx)(kd,{width:40,height:48}):(0,n.jsx)(Xn,{width:40,height:48})),[v]);return Me(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Ld,{children:[k,(0,n.jsx)(i.Fm,{type:"H6",color:"TextPrimary",children:x("tiktok_instant_app_loading_status_header")})]}),(0,n.jsx)(Td,{children:(0,n.jsx)(Ct,{text:x("pcWeb_guestLogin_without"),showFlashingButton:f,onClick:y,buttonTheme:"primary",focusable:!0},"login-guest-button")}),(0,n.jsxs)(Pd,{children:[(0,n.jsx)(Md,{}),(0,n.jsx)(Ad,{children:(0,n.jsx)(i.Fm,{type:"P5-Regular",color:"TextQuaternary",children:x("webapp_orContinueWith")})}),(0,n.jsx)(Md,{})]}),(0,n.jsx)(Sd,{config:r,width:44,height:44})]})}));var Id=o(1452),Hd=o(93981);const zd=(0,Q.default)("div",{target:"e10o7n900"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"24px",lineHeight:"32px",margin:"32px auto 12px",fontWeight:"bold",textAlign:"center"}]),"label:DivTitle;"),Dd=(0,Q.default)("div",{target:"e10o7n901"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary"}),{fontSize:"18px",lineHeight:"25px",display:"flex",justifyContent:"space-between",marginBottom:"40px"}]),"label:DivDescription;"),Rd=(0,Q.default)("img",{target:"e10o7n902"})({width:"80%",margin:"0 auto 16px"},"label:ImgQR;"),Od=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),{appType:t}=(0,l.Ph)(Fo.L,{selector:e=>{var t;return{appType:null===(t=e.appContext)||void 0===t?void 0:t.appType}},dependencies:[]}),o="m"===t?Id:Hd;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Dd,{"data-e2e":"instagram-desc",children:e("login_risk_popup_pc_body_2")}),(0,n.jsx)(Rd,{src:o,"data-e2e":"instagram-img"})]})})),Wd=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),t=(0,E.zy)(),{fromIns:o}=t.state||{};return Me(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(zd,{"data-e2e":"instagram-title",children:e(o?"login_new_ins_PC_title":"login_risk_popup_pc_title")}),(0,n.jsx)(Od,{}),(0,n.jsx)(fd.mg,{children:(0,n.jsx)("link",{rel:"canonical",href:`${xd.C}/download`},"canonical")})]})})),Bd=(0,Q.default)("div",{target:"eop2wpq1"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextSecondary",fontFamily:"TikTokFont"}),{marginBottom:"16px",fontSize:"18px",lineHeight:"24px",display:"flex",justifyContent:"space-between"}]),"label:DivDescription;"),$d=()=>{const e=(0,s.Nj)(C.$F),t=(0,g.s)("WebApp_Login"),[{forceResetResponse:o,loginLoading:i},{handleForceResetPwdByEmail:a,handleForceResetPwdByPhone:r,clearForceResetRes:d}]=(0,l.Su)(Z.$),{conditional_login_ticket:c,type:p,email:u,mobile:h}=(0,de.L$)(o),[{sendCodeLoading:m,ticket:x,code:f,codeFormatError:b},{sendPhoneCodeForForceResetPwd:_,sendEmailCodeForForceResetPwd:y}]=(0,l.Su)(Ja.m),{password:v,contentValid:k,lengthValid:j}=(0,l.Ph)(qa),w=nr(),S=(0,L.useCallback)((()=>{"email"===p?y({conditional_login_ticket:c}):_({conditional_login_ticket:c})}),[p,y,c,_]),T=(0,L.useCallback)((()=>{const t={code:f,ticket:null!=x?x:"",password:v,conditional_login_ticket:c};e.forceResetSubmit(),"email"===p?a(t):r(t)}),[f,c,a,r,e,v,x,p]),P=!f||!v||!k||!j||Boolean(b),M="email"===p?t("setting_password_code_email_text",{email:u}):t("setting_password_code_sms_text",{mobile:h}).replace(/(\D{1})(4)(\D{1})/,((e,t,o,n)=>`${t}6${n}`));return(0,L.useEffect)((()=>()=>{d()}),[]),Me(),(0,n.jsxs)(ar,{onSubmit:T,children:[(0,n.jsx)(Gi,{children:t("common_login_reset_password_title")}),(0,n.jsx)(Bd,{children:t("changepw_banner")}),(0,n.jsx)(fs,{email:"email"===p,autoSendFirstTime:!0,disabled:!c,codeFromNumber:c,loading:m,onClickSendCode:S}),(0,n.jsx)(jr,{text:M,type:"default"}),(0,n.jsx)(Tr,{loginError:Boolean(w)}),(0,n.jsx)(jr,{text:t(w),type:"error"}),(0,n.jsx)(Pr,{disabled:P,loading:i,children:t("Login")})]})},Ud=(0,Q.default)("div",{target:"e1419m800"})({marginBottom:"9px",position:"relative"},"label:DivEmailContainer;"),Nd=(0,Q.default)("ul",{target:"e3y4xh60"})((({theme:e})=>({position:"absolute",top:"44px",borderRadius:"4px",background:e.colors.BGPrimary,border:"1px solid",borderColor:e.colors.LineSecondary,zIndex:2,marginTop:"4px",width:"100%",padding:"0"})),"label:UlList;"),Vd=(0,Q.default)("li",{target:"e3y4xh61"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextTertiary2"}),{display:"flex",padding:"0 12px",justifyContent:"space-between",alignItems:"center",height:"34px",lineHeight:"34px",fontSize:"13px",cursor:"pointer"},{":hover":{backgroundColor:"rgba(22, 24, 35, .03)"}}]),"label:LiListItem;"),Gd=(0,L.memo)((function({focused:e}){const{emailSuffixConfig:t}=Be((()=>["emailSuffixConfig"]),[]),[{email:o=""},{setSuggestEmailSuffixConfig:i}]=(0,l.Su)(Va.N),[a,r]=(0,L.useState)(!1);(0,L.useEffect)((()=>{if(e){const e=o.split("@")[1];if(o.includes("@")&&".com"!==e.slice(-4))return void r(!0)}r(!1)}),[e,a,o]);const s=(0,L.useCallback)((e=>()=>{r(!1),i(e)}),[i]);return a?(0,n.jsx)(Nd,{children:t.map(((e,t)=>{var i;return(0,n.jsxs)(Vd,{onClick:s(`@${e}`),children:[null!==(i=null==o?void 0:o.split("@")[0])&&void 0!==i?i:"","@",e]},t)}))}):null})),qd=(0,L.memo)((function(e){const t=(0,g.s)("WebApp_Login"),{isMobile:o}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{emailRegistered:i,errorMsg:a=""}=e,[{emailErrorMsg:r="",email:s=""},{setEmailInfo:d}]=(0,l.Su)(Va.N),[p,u]=(0,L.useState)(!1),h=(0,L.useCallback)((()=>{u(!0)}),[]),m=(0,L.useCallback)((()=>{setTimeout((()=>{u(!1)}),300)}),[]),x=(0,L.useCallback)((e=>{const t=e.target.value;d({email:t,valid:!0})}),[d]);(0,L.useEffect)((()=>{if(!p&&!o){const e=(0,Ga.Ro)(s);d({email:s,valid:e})}}),[o,s,p,d]);const f=(Boolean(r||a)||i)&&(!p||o),b=r||a;return(0,n.jsxs)(Ud,{children:[(0,n.jsx)(vr,{placeholder:t("common_login_reset_email_input_placeholder"),onFocus:h,onBlur:m,onInput:x,value:s,errorState:f,autocomplete:"email",name:"email",type:"email"}),!o&&(0,n.jsx)(Gd,{focused:p}),f&&(0,n.jsx)(jr,{text:t(b),type:"error"})]})})),Kd=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,sn.VN)(),{emailErrorMsg:o,email:i=""}=(0,l.Ph)(Va.N),[{loginLoading:a},{changePwdByEmail:r}]=(0,l.Su)(Z.$),[{sendCodeLoading:s,code:d,codeFormatError:c},{sendEmailCodeForReset:p}]=(0,l.Su)(Ja.m),{password:u,lengthValid:h,contentValid:m}=(0,l.Ph)(qa),x=nr(),f=(0,L.useCallback)((()=>{t({platform:"email",forgetPwd:!0}),r({password:u,email:i,emailCode:d})}),[t,r,u,i,d]),b=(0,L.useCallback)((()=>{p({email:i,email_logic_type:2})}),[i,p]),_=!i||!u||!d||!m||!h||Boolean(c)||Boolean(o);return Me(),(0,n.jsxs)(ar,{onSubmit:f,children:[(0,n.jsx)(Gi,{children:e("common_login_reset_password_title")}),(0,n.jsxs)(qi,{children:[e("setting_password_email_verify_title"),(0,n.jsx)(As,{text:e("forget_password_switch_phone"),path:k.tH.loginForgetPhonePassword,replace:!0})]}),(0,n.jsx)(qd,{}),(0,n.jsx)(fs,{email:!0,disabled:Boolean(o)||!i,codeFromNumber:i,loading:s,onClickSendCode:b}),(0,n.jsx)(Tr,{loginError:Boolean(x)}),(0,n.jsx)(jr,{text:e(x),type:"error"}),(0,n.jsx)(Pr,{disabled:_,loading:a,children:e("Login")})]})},Zd=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,sn.VN)(),[o]=(0,l.Su)(Qa.U),{phoneErrorMsg:i,mobile:a,phone:r}=o,[{sendCodeLoading:s,codeFormatError:d,code:c},{sendPhoneCodeForResetPwd:p}]=(0,l.Su)(Ja.m),[{loginLoading:u},{changePwdByMobile:h}]=(0,l.Su)(Z.$),{password:m,lengthValid:x,contentValid:f}=(0,l.Ph)(qa),b=nr(),_=(0,L.useCallback)((()=>{t({platform:"sms_verification",forgetPwd:!0}),h({password:m,mobile:a,phoneCode:c})}),[t,h,m,a,c]),y=(0,L.useCallback)((()=>{p({mobile:a})}),[a,p]),v=!a||!m||!c||!f||!x||Boolean(i)||Boolean(d);return Me(),(0,n.jsxs)(ar,{onSubmit:_,children:[(0,n.jsx)(Gi,{children:e("common_login_reset_password_title")}),(0,n.jsxs)(qi,{children:[e("setting_bind_phone_input_title"),(0,n.jsx)(As,{text:e("forget_password_switch_email"),path:k.tH.loginForgetEmailPassword,replace:!0})]}),(0,n.jsx)(Sl,{}),(0,n.jsx)(fs,{disabled:Boolean(i)||!r,codeFromNumber:a,loading:s,onClickSendCode:y}),(0,n.jsx)(Tr,{loginError:Boolean(b)}),(0,n.jsx)(jr,{text:e(b),type:"error"}),(0,n.jsx)(Pr,{disabled:v,loading:u,children:e("Login")})]})},Qd=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),t=(0,sn.VN)(),{setEmail:o}=(0,l.wA)(Va.N),[{loginLoading:i},{handlePasswordLogin:a}]=(0,l.Su)(Z.$),{password:r,hasInvalid:s}=(0,l.Ph)(qa),[d,c]=(0,L.useState)(""),p=nr([d]),u=(0,L.useCallback)((()=>{const e=(0,Ga.Ro)(d)?d.trim():void 0;t({platform:e?"email":"handle"}),a({username:d.trim(),password:r,email:e})}),[a,t,r,d]),h=(0,L.useCallback)((e=>{c(e.target.value)}),[]),m=(0,L.useCallback)((()=>{(0,Ga.Ro)(d)&&o(d.trim())}),[d,o]),x=(0,cr.Yk)("email");return(0,n.jsxs)(ar,{onSubmit:u,children:[(0,n.jsx)(vr,{placeholder:e("Email or Username"),onChange:h,onClick:x,name:"username",value:d,"data-e2e":"email-input",enablePasskey:!0}),(0,n.jsx)(Tr,{create:!1,loginError:Boolean(p)}),p&&(0,n.jsx)(jr,{text:e(p),type:"error"}),(0,n.jsx)(Ws,{onClickForgetEmailPwd:m}),(0,n.jsx)(Pr,{disabled:!d||!r||s,loading:i,"data-e2e":"login-button",children:e("Login")})]})})),Jd=()=>{const e=(0,g.s)("WebApp_Login"),{showLoginOptionSlider:t}=(0,h.LK)();Me();const o=(0,sn.$m)();return(0,L.useEffect)((()=>{o("email")}),[]),(0,n.jsxs)(n.Fragment,{children:[!t&&(0,n.jsx)(Gi,{id:"login-modal-title",children:e("Login")}),(0,n.jsxs)(qi,{children:[e("Email or Username")," ",(0,n.jsx)(As,{text:e("common_login_switch_phone"),path:k.tH.loginPhone,replace:!0})]}),(0,n.jsx)(Qd,{})]})};let Yd=!1;function Xd(e,t){const{ttpConfig:o}=Be((()=>["ttpConfig"]),[]),n=(0,E.W6)(),i=function(){const{featureFlags:e}=Be((()=>["featureFlags"]),[]);return!!(null==e?void 0:e.showTipWhenEnterPhoneCodeLogin)&&!Yd}(),[a,r]=(0,L.useState)(null),[l,s]=(0,L.useState)(i),d=(0,L.useCallback)((()=>{r(null),s(!1),Yd=!0}),[s]),c=(0,L.useCallback)(((e=null)=>{r(e),s(!0)}),[s]),p=(0,L.useCallback)((()=>{a&&t?n.push(t):n.push(e),d()}),[n,d,e,a,t]),u=(0,L.useCallback)((e=>!e.isAxiosError||(c(e),!1)),[c]);return o.preferPasswordLogin?{visible:l,closeModal:d,showModal:c,gotoPasswordLogin:p,errorInterceptor:u}:{visible:!1,closeModal:T(),showModal:T(),gotoPasswordLogin:T()}}const ec=(0,Po.Ay)({resolved:{},chunkName:()=>"login-tip-modal",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!o.m[t]},importAsync:()=>Promise.all([o.e(8873),o.e(2514)]).then(o.bind(o,58004)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return o(t)},resolve:()=>58004}),tc=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,sn.VN)(),[{sendCodeLoading:o,code:i,codeFormatError:a},{sendPhoneCodeForLogin:r,sendPhoneCodeForVerify:s}]=(0,l.Su)(Ja.m),[{phoneNotRegistered:d,loginLoading:c},{handleSmsLogin:p,handleSmsVerify:u}]=(0,l.Su)(Z.$),{registerPhone:m}=(0,l.wA)(Dt.H),{isSecurityVerification:x}=Be((()=>["isSecurityVerification"]),[]),{region:f}=(0,de.L$)((0,ue.W)((()=>["region"]),[])),[b]=(0,l.Su)(Qa.U),{mobile:_,phoneErrorMsg:y}=b,v=_&&i&&!y&&!a,C=nr(),j=Xd(k.tH.loginPhonePassword),w=(0,L.useCallback)((()=>{t({platform:"sms_verification"});const e={mobile:_,phoneCode:i,login_only:!0};x?u(e):p(e)}),[p,u,x,t,_,i]),S=(0,L.useCallback)((()=>{const e=j.errorInterceptor;x?s({mobile:_,errorInterceptor:e}):r({mobile:_,errorInterceptor:e})}),[x,_,r,s,j.errorInterceptor]),T=(0,L.useCallback)((()=>{m({region:f})}),[m,f]),{showLoginOptionSlider:P}=(0,h.LK)();Me();const M=(0,sn.$m)();(0,L.useEffect)((()=>{M("sms_verification")}),[]);const A=(0,cr.On)();return(0,n.jsxs)(n.Fragment,{children:[!P&&(0,n.jsx)(Gi,{id:"login-modal-title",children:e("Login")}),(0,n.jsxs)(qi,{children:[e("phone"),(0,n.jsx)(As,{text:e("common_login_switch_email"),path:k.tH.loginEmail,replace:!0,"data-e2e":"email-tab"})]}),(0,n.jsxs)(ar,{onSubmit:w,children:[(0,n.jsx)(Sl,{enablePasskey:!0}),(0,n.jsx)(fs,{disabled:Boolean(y)||!_,codeFromNumber:_,loading:o,errorMsg:C,onClickSendCode:S}),"autofill"===A&&(0,n.jsx)(Qi,{type:"password",tabIndex:-1}),(0,n.jsx)(As,{text:e("login_option_password"),path:k.tH.loginPhonePassword}),(0,n.jsx)(Pr,{disabled:!v,loading:c,"data-e2e":"login-button",children:e("Login")})]}),d&&(0,n.jsxs)(Ki,{children:[(0,n.jsx)(Zi,{children:e("common_login_sms_unregistered_pc_1")}),(0,n.jsx)(Zi,{link:!0,onClick:T,children:e("common_login_sms_unregistered_pc_2")})]}),(0,n.jsx)(ec,Object.assign({},j,{isMobile:!1}))]})},oc=(0,Q.default)("div",{target:"e1c067ot0"})({display:"flex",alignItems:"center",marginTop:"9px"},"label:DivLinksContainer;"),nc=(0,Q.default)("span",{target:"e1c067ot1"})((({theme:e})=>({width:"1px",height:"12px",margin:"0 16px",background:e.colors.LineSecondary})),"label:SpanSplitLine;"),ic=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,sn.VN)(),[{loginLoading:o},{handlePasswordLogin:i}]=(0,l.Su)(Z.$),{phoneErrorMsg:a,phone:r,areaCode:s}=(0,l.Ph)(Qa.U),{password:d,hasInvalid:c}=(0,l.Ph)(qa),p=nr(),u=(0,L.useCallback)((()=>{const e=`+${s} ${r}`;t({platform:"phone"}),i({account:e,password:d,mobile:e})}),[s,i,t,d,r]),{showLoginOptionSlider:m}=(0,h.LK)();Me();const x=(0,sn.$m)();return(0,L.useEffect)((()=>{x("phone")}),[]),(0,n.jsxs)(n.Fragment,{children:[!m&&(0,n.jsx)(Gi,{id:"login-modal-title",children:e("Login")}),(0,n.jsxs)(qi,{children:[e("phone")," ",(0,n.jsx)(As,{text:e("common_login_switch_email"),path:k.tH.loginEmail,replace:!0})]}),(0,n.jsxs)(ar,{onSubmit:u,children:[(0,n.jsx)(Sl,{enablePasskey:!0}),(0,n.jsx)(Tr,{create:!1,loginError:Boolean(p)}),p&&(0,n.jsx)(jr,{text:e(p),type:"error"}),(0,n.jsxs)(oc,{children:[(0,n.jsx)(As,{text:e("forget_password"),path:k.tH.loginForgetPhonePassword}),(0,n.jsx)(nc,{}),(0,n.jsx)(As,{text:e("common_login_password_button"),path:k.tH.loginPhone})]}),(0,n.jsx)(Pr,{disabled:Boolean(a)||!r||!d||c,loading:o,children:e("Login")})]})]})},ac=(0,Q.default)("h2",{target:"eph3mrd0"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:e.isMobile?"20px":"15px",display:"flex",justifyContent:"space-between",marginBottom:"5px"}]),"label:H2Title;"),rc=(0,Q.default)("div",{target:"eph3mrd1"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextTertiary"}),{fontSize:"14px",display:"flex",justifyContent:"space-between",marginBottom:"24px"}]),"label:DivDescription;"),lc=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,sn.VN)(),[{loginLoading:o},{handlePasswordLogin:i}]=(0,l.Su)(Z.$),{email:a}=(0,l.Ph)(Va.N),{isMobile:r}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),[s,d]=(0,L.useState)(""),p=nr([s]),u=(0,L.useCallback)((()=>{t({platform:"email"}),i({email:a,password:s,username:a})}),[a,i,t,s]),m=(0,L.useCallback)((e=>{d(e.target.value)}),[]),{showLoginOptionSlider:x}=(0,h.LK)();return(0,n.jsxs)(ar,{onSubmit:u,children:[!x&&(0,n.jsx)(ac,{children:e("common_registration_email_existing_title")}),r&&(0,n.jsx)(rc,{children:e("common_registration_email_existing_text")}),(0,n.jsx)(vr,{value:a,readonly:!0,disableDelete:!0}),(0,n.jsx)(vr,{placeholder:e("Password"),onChange:m,password:!0,border:!0,errorState:Boolean(p)}),(0,n.jsx)(jr,{text:e(p||(r?"":"common_registration_email_existing_text")),type:p?"error":"default"}),(0,n.jsx)(Ws,{}),(0,n.jsx)(Pr,{disabled:!s,loading:o,children:e("Login")})]})},sc=()=>{const e=(0,g.s)("WebApp_Login");return Me(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Gi,{children:e("Login")}),(0,n.jsx)(lc,{})]})};var dc=o(58542);const cc=(0,Q.default)("div",{target:"enfnoax0"})((({isOriginalLoginContainer:e})=>({maxHeight:"463px",overflowY:"scroll",overflowX:"hidden",margin:"auto",padding:"unset",marginTop:e?"64px":"unset",width:e?"363px":"unset"})),"label:DivLoginContainer;"),pc=(0,Q.default)("h2",{target:"enfnoax4"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"32px",margin:"64px auto 16px",fontWeight:"bold",textAlign:"center"}]),"label:H2TitleRedesign;"),uc=(0,Q.default)("div",{target:"enfnoax5"})({display:"flex",justifyContent:"center",margin:"16px 0px 48px"},"label:DivSegmentControlContainer;"),gc=()=>{var e;const t=(0,g.s)("WebApp_Login"),o=(0,g.s)("Webapp"),{loginTitle:i}=Be((()=>["loginTitle"]),[]),[a,r]=(0,L.useState)("qr"),[l,s]=(0,L.useState)(!1),d=(0,ue.W)((()=>["abTestVersion","user","webIdCreatedTime"]),[]),[c,p]=(0,L.useState)(!1),u=Ma(),m=Bi(u),x=Wi(m).filter((e=>"qr"!==e.type&&"email"!==e.type)),f=(0,ge.oN)(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.pathname),b=(0,L.useMemo)((()=>[{value:"qr",title:o(rt.p$.qrCodeKey,{},rt.p$.qrCodeDefault)},{value:"phone",title:o(rt.p$.phoneKey,{},rt.p$.phoneDefault)},{value:"other",title:o(rt.p$.otherKey,{},rt.p$.otherDefault)}]),[]),_=(0,L.useCallback)((e=>{r(e),"qr"===e?be.j.handleQRLoginTabClick({page_name:f}):"phone"===e?be.j.handlePhoneLoginTabClick({device_platform:"pc",enter_method:"login_redesign"}):"other"===e&&be.j.handleOtherLoginOptionsClick({page_name:f})}),[r]),y=(0,L.useCallback)((()=>(0,n.jsx)(pc,{"data-e2e":"login-title",id:"login-modal-title",children:t(i,{},rt.fN)})),[t,i]),v=(0,h.ZO)(),C=(0,L.useCallback)(((e,t)=>()=>{"facebook"===e&&v?(s(!0),_e.t.handleNotifyShow()):t()}),[v]),j=(0,L.useCallback)((()=>{p(!1)}),[]),w=(0,L.useCallback)((e=>{13===e.keyCode&&p(!1)}),[p]);return(0,n.jsxs)(Ae.rz,{children:[y(),(0,n.jsx)(uc,{children:(0,n.jsx)(dc.DUM,{compact:!1,size:"xs",shape:"rectangle",style:{margin:"0 auto",minHeight:"32px",height:"32px",width:"100%"},value:a,onChange:_,items:b})}),"qr"===a?(0,n.jsxs)($,{children:[(0,n.jsx)(W,{path:k.tH.loginQRcode,component:Ta,exact:!0}),(0,n.jsx)(W,{path:"*",component:Ta})]}):"phone"===a?(0,n.jsxs)($,{children:[(0,n.jsx)(W,{path:k.tH.loginPhoneOrEmail,component:tc,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginPhone,component:tc,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginPhonePassword,component:ic,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginEmail,component:Jd,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginWithSignedEmail,component:lc,exact:!0}),(0,n.jsx)(W,{path:"*",component:tc})]}):"other"===a?(0,n.jsxs)(n.Fragment,{children:[(S=c?x.slice(0,4):x,S.map((e=>(0,n.jsx)(Ct,{text:t(e.starlingText),Icon:e.icon,onClick:C(e.type,e.onClick),floatingBannerText:e.lastLoginMethod&&!(null==d?void 0:d.user)?t("encouragePreviousLoginPlatform_loginPage_loginBadge_body"):void 0,focusable:!0,loading:e.loading,effect:e.effect},e.starlingText)))),c&&x.length>4&&(0,n.jsx)(ke,{onClick:j,onKeyDown:w,tabIndex:0,role:"button",children:(0,n.jsx)(ce.A,{})})]}):null]});var S},hc=(0,L.memo)((()=>{const{enterMethod:e,closeable:t,groupId:o,lastGroupId:i,predictionPayload:a,popupType:r,loginModalShow:s,isGuestMode:d,isGuestModeUI:p}=(0,j.mZ)((e=>({enterMethod:e.enterMethod,closeable:e.closeable,groupId:e.groupId,lastGroupId:e.lastGroupId,predictionPayload:e.predictionPayload,popupType:e.popupType,loginModalShow:e.loginModalShow,isGuestMode:e.isGuestMode,isGuestModeUI:e.isGuestModeUI})),M.bN);hd({enterMethod:e,closeable:t,groupId:o,lastGroupId:i,predictionPayload:a}),(0,se.rF)({pid:"login"});const{forceResetResponse:u}=(0,l.Ph)(Z.$),{isMobile:g}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{pathname:m}=(0,E.zy)(),x=(0,L.useCallback)((e=>{27!==e.keyCode&&e.stopPropagation()}),[]),{showLoginOptionSlider:f}=(0,h.LK)(),b=[k.tH.loginForgetEmailPassword,k.tH.loginForgetPhonePassword,k.tH.loginDownloadApp,k.tH.loginSSO,k.tH.loginGuestMode],[_,y]=(0,L.useState)(!0);return(0,L.useEffect)((()=>{var e;y(!d&&!p||g||!s||"1"===(null!==(e=localStorage.getItem("guest-mode-flag"))&&void 0!==e?e:"0")&&!p)}),[p,d,g,s]),!g&&_&&f&&s&&"qr_bottom_right"!==r?(0,n.jsxs)(cc,{isOriginalLoginContainer:b.includes(m)||m.startsWith("/login/2sv"),children:[(0,n.jsx)(_d,{page:"login"}),(0,n.jsxs)($,{children:[(0,n.jsx)(W,{path:k.tH.loginTwoStepVerify,component:rd,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginForgetEmailPassword,component:u?$d:Kd,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginForgetPhonePassword,component:u?$d:Zd,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginDownloadApp,component:Wd,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginSSO,component:Na,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginGuestMode,component:Fd,exact:!0}),(0,n.jsx)(W,{path:"*",component:gc})]})]}):(0,n.jsxs)(Lt,{isMobile:g,popupType:r,isGuestModeRedesign:m===k.tH.loginGuestMode,onKeyDown:x,children:[(0,n.jsx)(_d,{page:"login"}),(0,n.jsxs)($,{children:[(0,n.jsx)(W,{path:k.tH.loginHome,component:Aa,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginQRcode,component:Ta,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginPhoneOrEmail,component:tc,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginPhone,component:tc,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginPhonePassword,component:ic,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginEmail,component:Jd,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginWithSignedEmail,component:sc,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginTwoStepVerify,component:rd,exact:!0}),(0,n.jsx)(W,{path:k.tH.tvLoginHome,component:Vl,exact:!0}),(0,n.jsx)(W,{path:k.tH.tvLoginEmail,component:Gr,exact:!0}),(0,n.jsx)(W,{path:k.tH.tvLoginPhone,component:os,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginForgetEmailPassword,component:u?$d:Kd,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginForgetPhonePassword,component:u?$d:Zd,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginDownloadApp,component:Wd,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginSSO,component:Na,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginGuestMode,component:Fd,exact:!0}),(0,n.jsx)(W,{path:"*",component:Aa})]})]})}));var mc=o(15942),xc=o(66780),fc=o(50213);const bc=(0,Q.default)("li",{target:"euwmh3o0"})({display:"flex",alignItems:"center",position:"relative",borderBottom:"",padding:"12px 12px",boxSizing:"border-box"},"label:LiGroupItem;"),_c=e=>(0,n.jsx)(bc,{children:(0,n.jsx)(i.Fm,{type:"P3-Semibold",children:e.groupLabel})}),yc=(0,Q.default)("li",{target:"e1x05iuc0"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontWeight:"normal",fontFamily:"TikTokFont",typography:"P3"}),{alignItems:"center",position:"relative",borderBottom:"",padding:"12px 12px",boxSizing:"border-box",":hover":{background:e.colors.BGView}}]),"label:LiGroupItem;"),vc=e=>{const{label:t,defaultChecked:o,onClickRadio:a}=e,r=(0,L.useCallback)((e=>{a(e.target.value)}),[a]);return(0,n.jsx)(yc,{children:(0,n.jsx)(i.v3,{label:t,defaultChecked:o,name:"region",value:t,labelPosition:"before",onChange:r})})},kc=(0,Q.default)("form",{target:"e1mlcez20"})((({theme:{colors:e},isMobile:t,isModal:o})=>({display:"flex",flexDirection:"row",alignItems:"center",padding:"12px 16px",background:e.BGInput,borderRadius:"92px",overflow:"hidden",height:"40px",margin:t?"16px 16px":"16px 10px",position:o?"absolute":"fixed",width:t?"92%":"100%",maxWidth:"400px",top:t?"60px":"90px",zIndex:2})),"label:FormElement;"),Cc=(0,Q.default)("div",{target:"e1mlcez21"})((({theme:{colors:e},isFocused:t})=>({display:"none",position:"absolute",left:"0",top:"0",right:"0",bottom:"0",border:t?`2px solid ${e.Negative}`:`1.5px solid ${e.LinePrimary}`,borderRadius:"92px",zIndex:-1})),"label:DivInputBorder;"),jc=(0,Q.default)("input",{target:"e1mlcez22"})((({theme:{colors:e,typography:t,fontFamilies:o,fontWeights:n},withIcon:i})=>Object.assign(Object.assign({fontFamily:o.TikTokFont,fontWeight:n.normal},t.P2),{border:"none",background:"transparent",outline:"none",padding:"0",width:i?"306px":"346px",color:e.TextPrimary,caretColor:e.Primary,appearance:"textfield",[`:focus ~ ${Cc}`]:{display:"block"},"::placeholder":{color:e.TextTertiary},":placeholder-shown":{textOverflow:"ellipsis"}})),"label:InputElement;");jc.defaultProps=Object.assign(Object.assign({},jc.defaultProps),{"data-e2e":"search-user-input"});const wc=(0,Q.default)("span",{target:"e1mlcez24"})((({theme:{colors:e}})=>({width:"1px",height:"28px",margin:"-3px 0",background:e.LineSecondary})),"label:SpanSplitter;"),Sc=(0,Q.default)("button",{target:"e1mlcez25"})((({theme:{colors:e,direction:t}})=>[{padding:"11px 16px 11px 12px",margin:"-12px -16px",fontSize:"0",cursor:"pointer",outline:"none",border:"none",background:"transparent",":hover":{background:e.BGView},":active":{background:e.BGInput2},"&:focus, :focus-visible":{outline:"none!important"}},(0,J.mp)({direction:t,marginStart:"0"})]),"label:ButtonSearch;");Sc.defaultProps=Object.assign(Object.assign({},Sc.defaultProps),{"data-e2e":"search-button"});const Tc=(0,Q.default)("div",{target:"e1mlcez26"})((({focused:e,theme:t})=>({outline:e?`2px solid ${t.colors.Negative}`:"none"})),"label:DivSearchIconContainer;"),Lc=(0,L.memo)((function({searchValue:e,setSearchValue:t,onSubmit:o,isMobile:i}){const a=(0,g.s)("WebApp_Login"),{colors:s}=(0,r.u)(),d=(0,L.useRef)(null),[{isModal:c}]=(0,l.Su)(Oe.t),p=(0,L.useCallback)((e=>{e.preventDefault(),null==o||o()}),[o]),[u,h]=(0,L.useState)(!1),[m,x]=(0,L.useState)(!1),[f,b]=(0,L.useState)(!1),_=(0,L.useCallback)((e=>()=>{e&&m||h(e)}),[m]),y=(0,L.useCallback)((()=>{x(!0),h(!1)}),[]),v=(0,L.useCallback)((()=>{x(!1)}),[]),k=(0,L.useCallback)((e=>{13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),e.stopPropagation(),null==o||o())}),[o]),C=(0,L.useCallback)((e=>{9===e.keyCode&&b(e.target!==d.current)}),[]),j=(0,L.useRef)(null),w=a("accessibilityLabels_search_button"),S=(0,L.useCallback)((e=>{const o=e.target.value;(e=>!e.startsWith(" "))(o)&&t(o)}),[t,e]);return(0,n.jsxs)(kc,{className:"search-input",action:"/search",onSubmit:p,onKeyUp:C,isMobile:i,isModal:c,children:[(0,n.jsx)(jc,{ref:j,value:e,onChange:S,placeholder:w,name:"q",type:"search",autoComplete:"off",role:"combobox"}),(0,n.jsx)(wc,{}),(0,n.jsx)(Sc,{type:"submit",ref:d,onFocus:_(!0),onBlur:_(!1),onMouseDown:y,onMouseUp:v,onKeyDown:k,"aria-label":a("accessibilityLabels_search_button"),children:(0,n.jsx)(Tc,{focused:u,children:(0,n.jsx)(ll.A,{fill:e?s.TextSecondary:s.TextQuaternary,width:24,height:24})})}),(0,n.jsx)(Cc,{isFocused:f})]})})),Pc=(0,L.memo)((function({disabled:e,children:t}){const{loginModalSwitchPath:o}=(0,l.Ph)(u.i);return o?(0,n.jsx)(La.Ay,{disabled:e,autoFocus:!1,children:t}):(0,n.jsx)(n.Fragment,{children:t})})),Mc=(0,Q.default)("div",{target:"e1r43con0"})((({isMobile:e})=>({padding:e?"0 30px":"unset","@media (max-width: 432px)":{padding:"0 16px"}})),"label:DivHomeContainer;"),Ac=(0,Q.default)("ul",{target:"e1r43con1"})({padding:"0px 0px",margin:0,listStyle:"none",boxSizing:"border-box",userSelect:"none"},"label:UlCountryListContainer;"),Ec=e=>e.reduce(((e,t)=>{const o=t.localizedCountryName[0].toUpperCase().normalize("NFD").replace(/\p{Diacritic}/gu,"");return Object.assign(Object.assign({},e),{[o]:[...e[o]||[],t]})}),{}),Fc=(e,t,o,n)=>{const i=[];return n&&i.push({itemType:"header",label:o},{itemType:"region",label:n.localizedCountryName,region:n}),Object.entries(t).forEach((t=>{const o=t[0].normalize("NFD").replace(/\p{Diacritic}/gu,""),n=t[1].sort((e=>(t,o)=>e.compare(t.localizedCountryName,o.localizedCountryName))(e));i.push({itemType:"header",label:o}),n.forEach((e=>{i.push({itemType:"region",label:e.localizedCountryName,region:e})}))})),i},Ic=()=>{var e;const t=(0,g.s)("WebApp_Login"),{isMobile:o}=(0,de.L$)((0,c.U)((()=>["isMobile","playerInfo"]),[])),{language:i="en"}=null!==(e=(0,ue.W)((()=>["language"]),[]))&&void 0!==e?e:{},a=Intl.Collator(i),[r,d]=(0,L.useState)(!1),[p,u]=(0,L.useState)([]),[h,m]=(0,L.useState)(!1),[{region:x,regionList:f,initializedTTPConfig:b},{fetchRegionList:_,setUserSelectedRegion:y}]=(0,l.Su)(Dt.H),v=(0,L.useCallback)((()=>{_()}),[_]);(0,L.useEffect)((()=>{fc.j.regionSelectionPageShow({enter_from:"sign_up_page"})}),[]),(0,L.useEffect)((()=>{b&&v()}),[b]);const k=(0,L.useCallback)((e=>{9===e.keyCode&&d(!0)}),[]),j=(0,L.useMemo)((()=>{const e=(h?p:f).filter((e=>e.countryCode.toUpperCase()!==(null==x?void 0:x.countryCode.toUpperCase()))),o=p.some((e=>e.countryCode.toUpperCase()===(null==x?void 0:x.countryCode.toUpperCase())));return h&&!o?Fc(a,Ec(e),t("regionOption_selectCountry_list_description")):Fc(a,Ec(e),t("regionOption_selectCountry_list_description"),x)}),[h,p,f,x,a]),w=(0,s.Nj)(C.$F),S=e=>{const t=null==f?void 0:f.find((t=>t.localizedCountryName===e));t&&(y(t),fc.j.selectAccountRegion({enter_from:"sign_up_page",origin_region:null==x?void 0:x.countryCode,region_selected:t.countryCode}),w.setSignUpRegionSourceParams({region_source:1,origin_region:null==x?void 0:x.countryCode,region_selected:t.countryCode}))},T=(0,L.useMemo)((()=>j.flatMap((e=>"header"===e.itemType?(0,n.jsx)(_c,{groupLabel:e.label},e.label):"region"===e.itemType&&e.region?(0,n.jsx)(vc,{label:e.label,onClickRadio:S,defaultChecked:e.region.countryCode.toUpperCase()===(null==x?void 0:x.countryCode.toUpperCase())},e.label):[]))),[j]),[P,M]=(0,L.useState)(""),A=(0,L.useCallback)((()=>{u(f.filter((e=>e.localizedCountryName.toUpperCase().includes(P.toUpperCase())))),m(!0)}),[P]);return Me(),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(Pc,{disabled:r,children:[o&&(0,n.jsx)(at,{title:t("regionOption_selectCountry_list_title"),showRight:!1}),(0,n.jsx)("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:(0,n.jsx)(Lc,{searchValue:P,setSearchValue:M,onSubmit:A,isMobile:o})}),(0,n.jsx)(Mc,{isMobile:o,onKeyDown:k,children:(0,n.jsx)(Ac,{children:T})})]})})};function Hc(){const{registerLimited:e}=(0,l.Ph)(N.T),t=(0,E.W6)();(0,L.useEffect)((()=>{e&&t.replace(k.tH.signupCreateAccount)}),[t,e])}function zc(){const e=Rt(),t=(0,E.W6)(),{validateAge:o}=(0,l.wA)(N.T),[{fromNotRegisterLogin:n,thirdPlatformNotRegistered:i},{registerThirdPlatform:a,registerPhone:r}]=(0,l.Su)(Dt.H),s=(0,L.useCallback)((()=>{"KR"===e?t.push(k.tH.signupPolicyConfirm):"Third"===n&&i?a({ageCheckDone:!0,platform:i.platform,profileKey:i.profileKey,region:e}):"Phone"===n?r({ageCheckDone:!0,region:e}):t.push(k.tH.signupPhoneOrEmail)}),[e,n,t,r,a,i]),d=(0,L.useCallback)((e=>{e||s()}),[s]);return{handleCheckAge:(0,L.useCallback)((()=>{o({canSkip:!1,checkPassCallback:d,region:e})}),[d,o,e]),nextStep:s}}function Dc(){const{initial:e,registerLimited:t,ageGateAction:o}=(0,l.Ph)(N.T),n=(0,E.W6)();(0,L.useEffect)((()=>{e&&!t&&1!==o&&n.replace(k.tH.signupHome)}),[e,o,n,t])}var Rc=o(45102),Oc=o(30615),Wc=o(17417);const Bc=(0,Q.default)("div",{target:"e1nc6q650"})((({theme:e})=>({background:e.colors.BGPrimary,borderRadius:"8px",maxWidth:e.isMobile?"300px":"400px",paddingTop:e.isMobile?"24px":"32px",textAlign:"center"})),"label:DivContainer;"),$c=(0,Q.default)("div",{target:"e1nc6q651"})((({theme:e})=>({display:"flex",padding:e.isMobile?"0":"0 32px 32px 32px"})),"label:DivFooterContainer;"),Uc=(0,Q.default)("div",{target:"e1nc6q652"})((({theme:e})=>({padding:e.isMobile?"12px 20px 20px 20px":"16px 32px 24px 32px"})),"label:DivBodyContainer;"),Nc=(0,Q.default)("h1",{target:"e1nc6q653"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"24px",lineHeight:"30px",padding:e.isMobile?"0 20px":"0 32px"}]),"label:H1ModalTitle;"),Vc=(0,Q.default)("p",{target:"e1nc6q654"})([({theme:e})=>(0,J.zy)({theme:e,color:"TextSecondary",fontFamily:"TikTokFont"}),{fontSize:"16px",lineHeight:"20px",margin:"24px 0",textAlign:"center"}],"label:PDesc;"),Gc=(0,Q.default)("a",{target:"e1nc6q655"})((({theme:e})=>({fontWeight:"bold",color:e.colors.TextSecondary,"&:focus":{outline:"none"},"&:focus-visible":{outline:`2px solid ${e.colors.Negative}`}})),"label:ALink;"),qc={style:"pop",business:"hungary_tos"},Kc={borderWidth:"0.5px",borderRadius:"0",fontWeight:"normal"},Zc=e=>{const t=(0,g.s)("WebApp_Login"),{isMobile:o}=e,{language:i}=(0,de.L$)((0,ue.W)((()=>["language"]),[])),a=Rt(),[r,l]=(0,L.useState)(!1),d="HU"===a&&!r,c=(0,s.Nj)(Rc.W),p=(0,L.useCallback)((()=>{l(!0),c.handleUniversalPopClick(Object.assign(Object.assign({},qc),{button_info:"accept"}))}),[]),u=(0,L.useCallback)((()=>{c.handleUniversalPopClick(Object.assign(Object.assign({},qc),{button_info:"decline"})),(0,Oc.iM)(`https://www.tiktok.com/foryou?lang=${i}`)}),[]);return(0,L.useEffect)((()=>{d&&c.handleUniversalPopShow(qc)}),[d]),d?(0,n.jsx)(y.aF,{visible:!0,maskCloseable:!1,type:o?"mobile":"pc",children:(0,n.jsxs)(Bc,{children:[(0,n.jsx)(Nc,{children:t("HUToS_signupConsent_halfSheet_headline")}),(0,n.jsxs)(Uc,{children:[(0,n.jsx)(Vc,{children:(0,Wc.Jy)(t("HUToS_signupConsent_halfSheet_par1").replace("{s_termsOfService}","TOS_PLACEHOLDER").replace("{s_privacyPolicy}","PP_PLACEHOLDER").replace("{s_cookiesPolicy}","CP_PLACEHOLDER"),{TOS_PLACEHOLDER:(0,n.jsx)(Qc,{href:`https://www.tiktok.com/legal/page/eea/terms-of-service/${i}`,text:t("HUToS_signupConsent_halfSheet_par1tos")}),PP_PLACEHOLDER:(0,n.jsx)(Qc,{href:`https://www.tiktok.com/legal/page/eea/privacy-policy/${i}`,text:t("HUToS_signupConsent_halfSheet_par1pp")}),CP_PLACEHOLDER:(0,n.jsx)(Qc,{href:`https://www.tiktok.com/legal/page/global/cookie-policy/${i}`,text:t("HUToS_signupConsent_halfSheet_par1cp")})})}),(0,n.jsx)(Vc,{children:(0,Wc.Jy)(t("HUToS_signupConsent_halfSheet_par2").replace("{s_summaryOfOurTerms}","SOT_PLACEHOLDER").replace("{s_privacyHighlights}","PH_PLACEHOLDER"),{SOT_PLACEHOLDER:(0,n.jsx)(Qc,{href:`https://www.tiktok.com/legal/page/global/summary-of-terms-and-conditions-eea/${i}`,text:t("HUToS_signupConsent_halfSheet_par2sot")}),PH_PLACEHOLDER:(0,n.jsx)(Qc,{href:"https://www.tiktok.com/privacy/privacy-highlights",text:t("HUToS_signupConsent_halfSheet_par2ph")})})})]}),(0,n.jsxs)($c,{children:[(0,n.jsx)(Pr,{buttonTheme:"default",onClick:u,style:o?Kc:{fontWeight:"500"},children:t("HUToS_signupConsent_halfSheet_declineButton")}),(0,n.jsx)(Pr,{buttonTheme:"default",onClick:p,style:o?Kc:{marginLeft:"8px",fontWeight:"500"},children:t("HUToS_signupConsent_halfSheet_acceptButton")})]})]})}):null};function Qc({href:e,text:t}){return(0,n.jsx)(Gc,{target:"_blank",rel:"noopener noreferrer",href:e,children:t})}const Jc=(0,Q.default)("div",{target:"e7y6k0x0"})((({theme:e,isModal:t})=>[(0,J.zy)({theme:e,fontWeight:"bold",fontFamily:"TikTokDisplayFont"}),{textAlign:"center",fontSize:t?"20px":"32px",lineHeight:t?"24px":"38px"}]),"label:DivTitle;"),Yc=(0,Q.default)("div",{target:"e7y6k0x1"})((({theme:e,isModal:t})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextSecondary"}),{fontSize:t?"14px":"18px",lineHeight:t?"18px":"24px",textAlign:"center",padding:"16px 8px"}]),"label:DivDescription;"),Xc=e=>e?{paddingTop:"32px",width:"300px"}:{marginTop:"110px"},ep=(0,Q.default)("div",{target:"e7y6k0x2"})((({isModal:e=!1})=>[Xc(e)]),"label:DivContainer;"),tp=({isModal:e=!1})=>{const t=(0,g.s)("WebApp_Login"),{setShowAgeConfirm:o}=(0,l.wA)(N.T),i=(0,E.W6)(),a=(0,L.useCallback)((()=>{o(!1),i.push(k.tH.signupCreateAccount)}),[i,o]),r=(0,L.useMemo)((()=>e?{borderLeft:"none",borderRight:"none",borderBottom:"none",borderRadius:"0 0 8px 8px",fontWeight:500}:void 0),[e]);return Me(),(0,n.jsxs)(ep,{isModal:e,children:[(0,n.jsx)(Jc,{isModal:e,children:t("mus_agegate_error_ftc_title")}),(0,n.jsx)(Yc,{isModal:e,children:t("mus_agegate_error_ftc_desc")}),(0,n.jsx)(Pr,{onClick:a,buttonTheme:e?"default":"primary",bottonTheme:"text",style:r,children:t("Continue")})]})};var op=o(68652);const np=(e,t)=>e?{position:"fixed",bottom:"0px",left:"0",right:"0",padding:"12px 32px"}:{marginTop:t||"9px"},ip=(0,Q.default)("div",{target:"eb49p770"})((({theme:e})=>[{paddingBottom:e.isMobile?"64px":"5px",marginTop:e.isMobile?"8px":"unset"}]),"label:DivPolicyContainer;"),ap=(0,Q.default)("h3",{target:"eb49p771"})((({theme:e})=>{return[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont",fontWeight:"bold"}),(t=e.isMobile,t?{fontSize:"17px",lineHeight:"22px",marginBottom:"24px",textAlign:"left"}:{fontSize:"32px",lineHeight:"38px",marginBottom:"32px",textAlign:"center",marginTop:"64px"})];var t}),"label:H3Title;"),rp=(0,Q.default)("div",{target:"eb49p773"})({padding:"12px 0",display:"flex",i:{outline:"unset"}},"label:DivCheckItem;"),lp=(0,Q.default)("div",{target:"eb49p774"})({display:"flex",flexDirection:"column"},"label:DivCheckboxContent;"),sp=(0,Q.default)("p",{target:"eb49p776"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{fontSize:"14px",lineHeight:"18px",display:"inline"}]),"label:PCheckboxContent;"),dp=(0,Q.default)("h4",{target:"eb49p778"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"15px",lineHeight:"19.5px",display:"inline",margin:0}]),"label:H4CheckboxTitle;"),cp=(0,Q.default)("div",{target:"eb49p7710"})((({theme:e,marginTop:t,backgroundColor:o})=>[np(e.isMobile,t),{background:o||e.colors.BGPrimary}]),"label:DivButtonWrapper;"),pp=(0,Q.default)("a",{target:"eb49p7711"})((({theme:e})=>({color:e.colors.Primary,fontSize:"14px",fontWeight:500,"&:visited":{color:e.colors.Primary},"&:focus":{outline:"none"},"&:focus-visible":{outline:`2px solid ${e.colors.Negative}`},display:"flex",alignItems:"center",marginTop:"4px"})),"label:ALink;");var up;!function(e){e.Big="big",e.Small="small"}(up||(up={}));const gp=(0,Q.default)("div",{target:"e14eam340"})((({size:e})=>({width:"big"===e?"32px":"24px",position:"relative",flexShrink:0})),"label:DivCheckboxWrapper;"),hp=(0,Q.default)("input",{target:"e14eam341"})({display:"block",width:"24px",height:"24px",opacity:0},"label:InputCheckbox;"),mp=(e,t)=>"small"===e?{width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px"}:{width:t?"24px":"22px",height:t?"24px":"22px"},xp=(0,Q.default)("label",{target:"e14eam342"})((({theme:e,circle:t=!0,size:o})=>[(0,J.mp)({direction:e.direction,start:"0"}),{position:"absolute",top:0,"-webkit-tap-highlight-color":"transparent"},mp(o,t)]),"label:LabelCheck;"),fp=(0,Q.default)("i",{target:"e14eam343"})((({theme:e,checked:t,circle:o=!0,size:n,focus:i=!1})=>[(0,J.mp)({direction:e.direction,start:"0"}),{position:"absolute",top:0,borderRadius:o?"50%":"unset",border:"1px solid",borderColor:t?e.colors.Primary:e.colors.TextReverse3,marginInlineEnd:"8px",display:"inline-block",background:t?e.colors.Primary:e.colors.BGPrimary,transition:"all .1s",padding:"3px 0",textAlign:"center",boxSizing:"border-box",outline:i?`2px solid ${e.colors.Negative}`:"none"},mp(n,o)]),"label:ICheckboxIcon;"),bp=({id:e,value:t,checked:o,onChange:i,circle:a,size:l="big"})=>{const{colors:s}=(0,r.u)(),[d,c]=(0,L.useState)(!1),p=(0,L.useCallback)((e=>{i(e.target.checked,t)}),[i,t]),u=(0,L.useCallback)((()=>{c(!0)}),[]),g=(0,L.useCallback)((()=>{c(!1)}),[]);return(0,n.jsxs)(gp,{size:l,children:[(0,n.jsx)(hp,{type:"checkbox",value:t,id:e,onClick:p,onFocus:u,onBlur:g,"aria-labelledby":Kr}),(0,n.jsx)(xp,{htmlFor:e,circle:a,size:l,children:(0,n.jsx)(fp,{checked:o,circle:a,size:l,focus:d,children:(0,n.jsx)(Qr.A,{fill:o?"#fff":s.BGPrimary,fontSize:"14px"})})})]})};var _p,yp;!function(e){e.Terms="terms-of-service",e.Privacy="privacy-policy",e.Push="push-policy"}(_p||(_p={})),function(e){e.ToS="tiktok_terms_of_service",e.Privacy="tiktok_privacy_policy",e.Marketing="receive_notifications_of_marketing_content_and_promotions"}(yp||(yp={}));const vp=[{content:"updatedConsent_web_modal_radio2",link:"https://www.tiktok.com/legal/page/row/terms-of-service/ko",linkText:"updatedConsent_web_modal_radio2Link",value:"tiktok_terms_of_service"},{content:"updatedConsent_web_modal_radio3",link:"https://www.tiktok.com/legal/page/global/terms-and-conditions-kr/ko",linkText:"updatedConsent_web_modal_radio3Link",value:"tiktok_privacy_policy"},{content:"updatedConsent_web_modal_radio4",link:"https://www.tiktok.com/legal/page/global/consent-to-collection-and-use-of-your-personal-information-for-marketing-purposes",linkText:"updatedConsent_web_modal_radio4Link",value:"receive_notifications_of_marketing_content_and_promotions"}];function kp({consent:e,language:t,link:o}){return"receive_notifications_of_marketing_content_and_promotions"===e?"ko-KR"===t?`${o}/ko`:`${o}/en`:o}const Cp=()=>{const e=(0,E.W6)(),{isMobile:t}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{language:o="en",region:i=""}=(0,de.L$)((0,ue.W)((()=>["language","region"]),[])),[{fromNotRegisterLogin:a,thirdPlatformNotRegistered:r},{registerThirdPlatform:d,registerPhone:p,setKRMarketingConsent:u}]=(0,l.Su)(Dt.H),h=(0,g.s)("WebApp_Login"),m=(0,s.Nj)(Rc.W),[x,f]=(0,L.useState)([{item:"tiktok_terms_of_service",value:!1},{item:"tiktok_privacy_policy",value:!1},{item:"receive_notifications_of_marketing_content_and_promotions",value:!1}]),b=x.every((e=>!!e.value));(0,L.useEffect)((()=>{m.hanldeKRConsentShow()}),[]);const _=(0,L.useCallback)((()=>{const e=!b;m.hanldeKRConsentClick("total",e),u(e),f(x.map((t=>({item:t.item,value:e}))))}),[b,x,m,u]),y=(0,L.useCallback)(((e,t)=>{const o=Number(t),n=[...x],i=!n[o].value;m.hanldeKRConsentClick(`agree_to_${vp[o].value}`,i),n[o].value=i,"receive_notifications_of_marketing_content_and_promotions"===vp[o].value&&u(i),f(n)}),[x,u,m]),v=(0,L.useCallback)((()=>{m.hanldeKRConsentClickNext(b),"Third"===a&&r?d({ageCheckDone:!0,platform:r.platform,profileKey:r.profileKey,region:i}):"Phone"===a?p({ageCheckDone:!0,region:i}):e.push(k.tH.signupPhone)}),[a,e,p,d,r,i]),C=(0,L.useCallback)((e=>()=>{m.hanldeKRConsentClickSeeDetail("receive_notifications_of_marketing_content_and_promotions"===e?`agree_to_${e}`:e)}),[]),j=(0,L.useMemo)((()=>({width:t?"100%":"unset",marginTop:t?"0":"12px",marginLeft:"auto",marginRight:"auto"})),[t]),w=!!x.find((e=>"tiktok_privacy_policy"===e.item&&!1===e.value))||!!x.find((e=>"tiktok_terms_of_service"===e.item&&!1===e.value));return(0,n.jsxs)(ip,{children:[(0,n.jsx)(ap,{"data-e2e":"policy-confirm-title",children:h("updatedConsent_web_modal_header")}),(0,n.jsxs)(rp,{children:[(0,n.jsx)(bp,{"data-e2e":"policy-confirm-box",circle:!0,checked:b,onChange:_,id:"signup-policy-all"}),(0,n.jsx)(dp,{"data-e2e":"policy-confirm-item",children:h("updatedConsent_web_modal_radio1")})]}),vp.map((({content:e,link:t,linkText:i,value:a},r)=>(0,n.jsx)("div",{children:(0,n.jsxs)(rp,{children:[(0,n.jsx)(bp,{id:`signup-policy-${a}`,value:r.toString(),checked:x[r].value,onChange:y,circle:!0}),(0,n.jsxs)(lp,{children:[(0,n.jsx)(sp,{children:h(e)}),(0,n.jsxs)(pp,{target:"_blank",rel:"noopener noreferrer",href:kp({consent:a,language:o,link:t}),onClick:C(a),children:[h(i),(0,n.jsx)(op.A,{})]})]})]})},r))),(0,n.jsx)(cp,{marginTop:"40px",backgroundColor:"unset",children:(0,n.jsx)(Pr,{disabled:w,onClick:v,style:j,"data-e2e":"next-button",children:h("updatedConsent_web_modal_btn")})})]})};var jp=o(11983);const wp=["Month_1","Month_2","Month_3","Month_4","Month_5","Month_6","Month_7","Month_8","Month_9","Month_10","Month_11","Month_12"],Sp=()=>wp.map(((e,t)=>({value:t+1,key:e}))),Tp=(e=1)=>{let t=31;return 2===e?t=29:-1!==[4,6,9,11].indexOf(e)&&(t=30),Array(t).fill(0).map(((e,t)=>({value:t+1,key:`${t+1}`})))};var Lp=o(65986);const Pp=(0,Q.default)("div",{target:"e1phcp2x0"})((({theme:e})=>({background:e.colors.BGInput,borderRadius:"4px",position:"relative","& + &":{marginInlineStart:"8px"},cursor:"pointer"})),"label:DivSelector;");Pp.defaultProps=Object.assign(Object.assign({},Pp.defaultProps),{"data-e2e":"select-container"});const Mp=(0,Q.default)("div",{target:"e1phcp2x1"})((({hasValue:e,theme:t,error:o})=>({width:"115px",height:"44px",padding:"0 12px",display:"flex",justifyContent:"space-between",alignItems:"center",color:o?t.colors.Negative:e?t.colors.TextPrimary:t.colors.TextQuaternary,fontSize:"16px"})),"label:DivSelectLabel;"),Ap=(0,Q.default)(bl.A,{target:"e1phcp2x2"})((({theme:e,up:t})=>({color:e.colors.TextPrimary,transform:t?"rotateZ(180deg)":"rotateZ(0deg)",transition:"all .3S"})),"label:StyledArrowTriangleDownLargeFill;"),Ep=(0,Q.default)(Qr.A,{target:"e1phcp2x3"})({width:"16px",height:"16px",marginInlineStart:"12px"},"label:StyledSelectIcon;"),Fp=(0,Q.default)("div",{target:"e1phcp2x4"})((({theme:e,show:t})=>[(0,J.mp)({direction:e.direction,end:"0",start:"0"}),{width:"120px",maxHeight:"320px",overflow:"auto",position:"absolute",background:e.colors.BGPrimary,borderRadius:"4px",boxShadow:"0px 2px 12px rgba(0, 0, 0, 0.12)",top:"50px",zIndex:12,display:t?"block":"none",transition:"display .3s"}]),"label:DivOptionsWrapper;");Fp.defaultProps=Object.assign(Object.assign({},Fp.defaultProps),{"data-e2e":"select-list"});const Ip=(0,Q.default)("div",{target:"e1phcp2x5"})((({theme:e,selected:t})=>({height:"34px",overflow:"auto",fontSize:"16px",padding:"0 12px",cursor:"pointer",display:"flex",alignItems:"center",color:e.colors.TextPrimary,background:t?e.colors.BGView:"unset",":hover, :focus":{background:e.colors.BGView}})),"label:DivOption;"),Hp=e=>{const t=(0,g.s)("WebApp_Login"),{placeholder:o,options:i,selectItem:a,onClick:r,error:l,ariaLabel:s}=e,{key:d,value:c}=null!=a?a:{},p=(0,L.useRef)(null),u=(0,L.useRef)(null),[h,m]=(0,L.useState)(!1),{setLoginModalShow:x}=(0,j.b1)(),{isModal:f}=Be((()=>["isModal"]),[]),b=(0,L.useMemo)((()=>e=>e.value===c),[c]),_=(0,L.useMemo)((()=>i.findIndex(b)),[b,i]),y=(0,L.useCallback)((e=>{var t;h&&!(null===(t=null==p?void 0:p.current)||void 0===t?void 0:t.contains(e.target))&&m(!1)}),[h]);(0,L.useEffect)((()=>(window.addEventListener("mousedown",y),()=>{window.removeEventListener("mousedown",y)})),[y]);const v=i.concat().map((({value:e,key:o})=>({value:e,key:t(null!=o?o:"")}))),{keyboardHandler:k,visualFocusIndex:C}=(0,Lp.i)({panelOpen:h,options:v,initialFocusIndex:_,setPanelShow:m,panelContainerRef:u,onSelect:r,isModal:f,setModalShow:x}),w=(0,L.useCallback)((e=>()=>{r(e),m(!1)}),[r,m]),S=(0,L.useCallback)((()=>{m(!h)}),[h]);return(0,n.jsxs)(Pp,{ref:p,tabIndex:0,role:"combobox",onKeyDown:k,"aria-label":s,"aria-expanded":h,"aria-haspopup":"listbox","aria-controls":h?`${o}-options-list-container`:"","aria-activedescendant":C>-1?`${o}-options-item-${C}`:void 0,children:[(0,n.jsxs)(Mp,{onClick:S,hasValue:Boolean(d),error:l,children:[t(null!=d?d:o),(0,n.jsx)(Ap,{up:h})]}),(0,n.jsx)(Fp,{show:h,ref:u,role:"listbox",id:`${o}-options-list-container`,children:i.map(((e,i)=>{var a;return(0,n.jsxs)(Ip,{id:`${o}-options-item-${i}`,selected:c===e.value||C===i,onClick:w(e),role:"option","aria-selected":c===e.value,children:[t(`${null!==(a=e.key)&&void 0!==a?a:e.value}`),c===e.value&&(0,n.jsx)(Ep,{})]},i)}))})]})},zp=(0,Q.default)("div",{target:"e18rms3f0"})({display:"flex",marginBottom:"4px"},"label:DivAgeSelector;"),Dp=(0,Q.default)("div",{target:"e18rms3f1"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:"16px",lineHeight:"22px",marginBottom:"4px"}]),"label:DivTitle;"),Rp=(0,Q.default)("div",{target:"e18rms3f2"})((({theme:e,type:t})=>[(0,J.zy)({theme:e,color:"error"===t?"Negative":"TextTertiary"}),{fontSize:"14px",lineHeight:"20px",marginBottom:"16px"}]),"label:DivDescription;"),Op=Sp(),Wp=(()=>{const e=new Date(1900,0,1,0,0,0),t=new Date((new Date).getFullYear()-1,11,31,0,0,0);return Array(t.getFullYear()-e.getFullYear()+1).fill(t.getFullYear()).map(((e,t)=>({value:e-t,key:""+(e-t)})))})(),Bp=(0,L.memo)((function(){const e=(0,s.Nj)(C.$F),[{ageErrorMsg:t,year:o,month:i,date:a},{setBirthday:r,setMonth:d,setYear:c,setDate:p}]=(0,l.Su)(N.T),u=(0,g.s)("WebApp_Login");(0,L.useEffect)((()=>{i&&o&&a&&r({year:o.value,month:i.value,date:a.value})}),[o,i,a,r]),(0,L.useEffect)((()=>{e.ageGateShow()}),[]);const h=(0,L.useCallback)((e=>{d(e)}),[d]),m=(0,L.useCallback)((e=>{p(e)}),[p]),x=(0,L.useCallback)((e=>{c(e)}),[c]),f=t||"mus_age_gate_tips";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Dp,{children:u("common_registration_agegate_title")}),(0,n.jsxs)(zp,{children:[(0,n.jsx)(Hp,{error:Boolean(t),placeholder:"Month",selectItem:i,options:Op,ariaLabel:u("accessibilityLabels_signup_form_placeholder_month"),onClick:h}),(0,n.jsx)(Hp,{error:Boolean(t),placeholder:"Day",selectItem:a,options:Tp(null==i?void 0:i.value),ariaLabel:u("accessibilityLabels_signup_form_placeholder_day"),onClick:m}),(0,n.jsx)(Hp,{error:Boolean(t),placeholder:"Year",selectItem:o,options:Wp,ariaLabel:u("accessibilityLabels_signup_form_placeholder_year"),onClick:x})]}),(0,n.jsx)(Rp,{type:t?"error":"default",children:u(f)})]})})),$p=(0,Q.default)("h2",{target:"e1lzrlvq0"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokDisplayFont"}),{fontSize:"32px",margin:"16px auto",fontWeight:"bold",textAlign:"center",wordWrap:"break-word"}]),"label:H2Title;"),Up=(0,Q.default)("div",{target:"e1lzrlvq1"})({width:"375px",margin:"auto"},"label:DivLoginContainer;"),Np=(0,Q.default)("div",{target:"e1lzrlvq2"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:"15px",display:"flex",justifyContent:"space-between",marginBottom:"5px"}]),"label:DivDescription;");var Vp,Gp,qp,Kp,Zp;!function(e){e[e.USInvalidAgeConfirmation=1]="USInvalidAgeConfirmation",e[e.USInvalidAgeConfirmationV2=2]="USInvalidAgeConfirmationV2",e[e.USSuccessConfirmationError=3]="USSuccessConfirmationError",e[e.USSuccessConfirmationAdult=4]="USSuccessConfirmationAdult",e[e.USSuccessConfirmationTeen=5]="USSuccessConfirmationTeen",e[e.USSuccessConfirmationMixAge=6]="USSuccessConfirmationMixAge",e[e.USSuccessConfirmationUnderage=7]="USSuccessConfirmationUnderage",e[e.USConfirmationSuccessV2=8]="USConfirmationSuccessV2"}(Vp||(Vp={})),function(e){e[e.DISMISS=1]="DISMISS",e[e.CONTINUE=2]="CONTINUE",e[e.NATIVE=3]="NATIVE",e[e.URL=4]="URL",e[e.EXIT=5]="EXIT"}(Gp||(Gp={})),function(e){e[e.VERTICAL=1]="VERTICAL",e[e.HORIZONTAL=2]="HORIZONTAL"}(qp||(qp={})),function(e){e[e.MINOR=0]="MINOR",e[e.MEDIUM=1]="MEDIUM",e[e.MAJOR=2]="MAJOR"}(Kp||(Kp={})),function(e){e[e.DEFAULT=0]="DEFAULT",e[e.POP=1]="POP",e[e.BUTTOM=2]="BUTTOM"}(Zp||(Zp={}));const Qp=(0,Q.default)("div",{target:"eo2b7p50"})((({theme:e})=>({background:e.colors.BGPrimary,borderRadius:"8px",maxWidth:e.isMobile?"300px":"400px",paddingTop:e.isMobile?"0":"32px",textAlign:"center",overflow:"hidden"})),"label:DivContainer;"),Jp=(0,Q.default)("div",{target:"eo2b7p51"})((({theme:e})=>({display:"flex",padding:e.isMobile?"0":"0 32px 32px 32px",gap:e.isMobile?"0":"8px",overflow:"hidden"})),"label:DivFooterContainer;"),Yp=(0,Q.default)("div",{target:"eo2b7p52"})((({theme:e})=>({padding:e.isMobile?"20px":"0 32px"})),"label:DivBodyContainer;"),Xp=(0,Q.default)("h1",{target:"eo2b7p53"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"24px",lineHeight:"30px",padding:e.isMobile?"0 20px":"0 32px"}]),"label:H1ModalTitle;"),eu=(0,Q.default)("p",{target:"eo2b7p54"})([({theme:e})=>(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),({theme:e})=>({fontSize:"16px",lineHeight:"20px",margin:e.isMobile?"0":"24px 0",textAlign:"center"})],"label:PDesc;"),tu={borderWidth:"0.5px",borderRadius:"0",fontWeight:"normal",margin:"0"},ou={[Gp.CONTINUE]:"continue",[Gp.URL]:"url",[Gp.EXIT]:"exit",[Gp.DISMISS]:"dismiss",[Gp.NATIVE]:"native"},nu=e=>{const{isMobile:t,onContinue:o}=e,{setShowFeedbackModal:i}=(0,l.wA)(N.T),{showFeedbackModal:a,feedbackModal:r={}}=(0,l.Ph)(N.T),{modal:d={},business:c=""}=r,{title:p="",description:u="",options:g}=d,h=(0,E.W6)(),m=(0,s.Nj)(Rc.W),x={style:"pop",business:c},f=(0,L.useCallback)(((e,t)=>()=>{switch(m.handleUniversalPopClick(Object.assign(Object.assign({},x),{button_info:e?ou[e]:""})),e){case Gp.CONTINUE:i(!1),null==o||o();break;case Gp.URL:window.open(t,"_blank");break;case Gp.EXIT:i(!1),h.push(k.tH.signupHome);break;case Gp.DISMISS:default:i(!1)}}),[o,h,i]),b=(0,L.useMemo)((()=>g&&0!==g.length?[...g].reverse().map((e=>(0,n.jsx)(Pr,{buttonTheme:"default",style:t?tu:{fontWeight:"500"},onClick:f(e.option_type,e.option_url),children:e.option_content},e.option_content))):(0,n.jsx)(n.Fragment,{})),[g,t,f]);return(0,L.useEffect)((()=>{a&&m.handleUniversalPopShow(x)}),[a]),(0,n.jsx)(y.aF,{visible:a,maskCloseable:!1,type:t?"mobile":"pc",children:(0,n.jsxs)(Qp,{children:[p&&(0,n.jsx)(Xp,{children:p}),(0,n.jsx)(Yp,{children:(0,n.jsx)(eu,{children:u})}),(0,n.jsx)(Jp,{children:b})]})})},iu=()=>{const e=(0,g.s)("WebApp_Login"),{handleCheckAge:t,nextStep:o}=zc(),{signupLoading:i}=(0,l.Ph)(Dt.H),{birthday:a,ageErrorMsg:r,showErrorByToast:s,checkAgeLoading:d}=(0,l.Ph)(N.T);return(0,L.useEffect)((()=>{r&&s&&jp.F.open({content:e(r),duration:3})}),[r,e,s]),Me(),(0,n.jsxs)(Up,{children:[(0,n.jsx)($p,{children:e("common_login_panel_entry_2")}),(0,n.jsx)(Bp,{}),(0,n.jsx)(nu,{isMobile:!1,onContinue:o}),(0,n.jsx)(Pr,{disabled:!a,loading:i||d,onClick:t,"data-e2e":"next-button",children:e("common_registration_email_input_button")})]})},au=(0,Q.default)("div",{target:"eopmsux0"})({marginBottom:"16px",position:"relative"},"label:DivUsernameContainer;"),ru=(0,Q.default)("div",{target:"eopmsux1"})((({theme:e})=>[(0,J.mp)({direction:e.direction,end:"12px"}),{position:"absolute",boxSizing:"border-box",paddingTop:"14.5px",width:"20px",height:"44px",top:0,div:{position:"absolute",width:"15px",height:"15px",margin:"2px",border:"2px solid rgba(22, 24, 35, .34)",borderRadius:"50%",animation:"lds-ring 1.2s cubic-bezier(.5, 0, .5, 1) infinite",borderColor:"rgba(22, 24, 35, .34) transparent transparent transparent",":nth-of-type(1)":{animationDelay:"-.45s"},":nth-of-type(2)":{animationDelay:"-.3s"},":nth-of-type(3)":{animationDelay:"-.15s"}},"@keyframes lds-ring":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}}]),"label:DivNameCheckLoading;"),lu=(0,Q.default)("div",{target:"e1ulspo0"})((({theme:{colors:e,direction:t}})=>[{position:"relative",marginTop:"11px",borderRadius:"4px",border:"1px solid",background:e.BGPrimary,borderColor:e.LineSecondary,zIndex:2,width:"100%",":before":{content:'""',height:"14px",position:"absolute",background:e.BGPrimary,width:"14px",top:"-7px",left:"rtl"===t?"unset":"14px",right:"rtl"===t?"14px":"unset",zIndex:-1,borderInlineEnd:`1px solid ${e.LineSecondary2}`,borderTop:`1px solid ${e.LineSecondary2}`,transform:"rtl"===t?"rotateZ(45deg)":"rotateZ(-45deg)"}}]),"label:DivSuggestListWrapper;"),su=(0,Q.default)("div",{target:"e1ulspo1"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextTertiary"}),{fontSize:"13px",lineHeight:"17px",padding:"16px 12px 9px"}]),"label:DivLabel;"),du=(0,Q.default)("ul",{target:"e1ulspo2"})({padding:"0",margin:"0",maxHeight:"200px",overflowY:"auto"},"label:UlList;"),cu=(0,Q.default)("li",{target:"e1ulspo3"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextPrimary"}),{display:"flex",padding:"0 12px",justifyContent:"space-between",alignItems:"center",height:"34px",lineHeight:"34px",fontSize:"13px",cursor:"pointer"},{":hover":{backgroundColor:"rgba(22, 24, 35, .03)"}}]),"label:LiListItem;"),pu=(0,L.memo)((function(){var e,t;const[{usernameInfo:o},{setUsername:i}]=(0,l.Su)(Dt.H),a=(0,g.s)("WebApp_Login"),r=(0,L.useCallback)((e=>()=>{i(e)}),[i]);return(null==o?void 0:o.isValid)||!(null===(e=null==o?void 0:o.suggestList)||void 0===e?void 0:e.length)?null:(0,n.jsxs)(lu,{children:[(0,n.jsx)(su,{children:a("common_registration_email_input_suggested")}),(0,n.jsx)(du,{children:null===(t=null==o?void 0:o.suggestList)||void 0===t?void 0:t.map(((e,t)=>(0,n.jsx)(cu,{onClick:r(`${e}`),children:e},t)))})]})})),uu=(0,L.memo)((function({autoFocus:e,ftc:t,placeholder:o,tip:i}){var a,r;const[{usernameInfo:s,username:d,checkNameLoading:p},{validateUsername:u,validateFTCUsername:h,setUsername:m,setUsernameInfo:x}]=(0,l.Su)(Dt.H),{isMobile:f}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),b=(0,g.s)("WebApp_Login"),_=(0,L.useCallback)((e=>{const t=e.target.value;m(t)}),[m]);(0,L.useEffect)((()=>{d?t?h({name:d}):u({name:d}):x(void 0)}),[t,x,d,h,u]);const y=f?"":"common_registration_username_text";return(0,n.jsxs)(au,{children:[(0,n.jsx)(vr,{autoFocus:e,placeholder:b(null!=o?o:"common_registration_username_placeholder"),onChange:_,errorState:s&&!s.isValid&&!p,autoComplete:"off",name:"new-username",value:d,disableDelete:p}),p&&(0,n.jsxs)(ru,{children:[(0,n.jsx)("div",{}),(0,n.jsx)("div",{}),(0,n.jsx)("div",{}),(0,n.jsx)("div",{})]}),(0,n.jsx)(jr,{text:b(null!==(r=null!==(a=null==s?void 0:s.errorMsg)&&void 0!==a?a:i)&&void 0!==r?r:y),type:(null==s?void 0:s.errorMsg)?"error":"default"}),!f&&(0,n.jsx)(pu,{})]})}));var gu=o(35248),hu=o(28889),mu=o(77483);const xu=(0,Q.default)("div",{target:"e1sbfgbz0"})((({theme:e,asText:t,isModal:o,isMobile:n,isGuestModeRedesign:i})=>({width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:e.colors.BGSecondary,padding:t?"unset":i?"0 28px 30px 28px":"16px 30px",marginBottom:t?"12px":o||n||i?"unset":"64px"})),"label:DivAgreement;");xu.defaultProps=Object.assign(Object.assign({},xu.defaultProps),{"data-e2e":"policy-confirm-tips"});const fu=(0,Q.default)("p",{target:"e1sbfgbz1"})((({theme:e,asText:t})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextTertiary"}),{fontSize:"12px",lineHeight:"15px",width:"337px",textAlign:t?"unset":"center"},e.isMobile&&(0,J.jJ)({min:Ne.aU,style:{width:"unset",fontSize:"24px",lineHeight:"38px"}})]),"label:PText;"),bu=(0,Q.default)("a",{target:"e1sbfgbz2"})((({theme:e})=>({color:e.colors.TextPrimary,"&:focus":{outline:"none"},"&:focus-visible":{outline:`2px solid ${e.colors.Negative}`}})),"label:ALink;"),_u=(0,L.memo)((function({i18nKey:e,show:t,asText:o}){var i,a,r,s;const{language:d,abTestVersion:p}=(0,de.L$)((0,ue.W)((()=>["language","abTestVersion"]),[])),{isMobile:u}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),[{region:m,initializedTTPConfig:x},{fetchStoreRegion:f}]=(0,l.Su)(Dt.H),b=null!==(i=(0,he.qt)(p,"sign_up_webapp_region_change"))&&void 0!==i?i:"v1",_=null!==(a=(0,he.qt)(p,"login_modal_ui_revamp"))&&void 0!==a?a:"v1",y=(0,j.mZ)((e=>e.loginModalShow)),v=Rt(),{showLoginOptionSlider:C}=(0,h.LK)(),w="v2"===b,S=(0,L.useCallback)((()=>{f()}),[f]);(0,L.useEffect)((()=>{x&&!m&&S()}),[x]);const T=u?[k.tH.signupHome,k.tH.loginHome,k.tH.tvLoginHome,k.tH.tvLoginEmail,k.tH.tvLoginPhone]:[k.tH.signupPhoneOrEmail,k.tH.signupPhone,k.tH.signupEmail,k.tH.signupHome,k.tH.signupInterestSelector,k.tH.loginHome,k.tH.loginGuestMode,k.tH.tvLoginHome,k.tH.tvLoginEmail,k.tH.tvLoginPhone],P="v1"===_?[]:[k.tH.signupCreateAccount,k.tH.signupCreatePassword,k.tH.signupCreateUsername,k.tH.signupAgeGate,k.tH.signupAgeGateConfirm,k.tH.loginForgetEmailPassword,k.tH.loginForgetPhonePassword,k.tH.signupCountrySelector],M=[k.tH.loginPhoneOrEmail,k.tH.loginPhone,k.tH.loginEmail,k.tH.loginPhonePassword],{pathname:A}=(0,E.zy)(),F=null!==(r=t&&!P.find((e=>e===A.replace(/\/$/,""))))&&void 0!==r?r:T.find((e=>e===A.replace(/\/$/,""))),I=C&&M.find((e=>e===A.replace(/\/$/,""))),H=null!==(s=null==m?void 0:m.countryCode.toUpperCase())&&void 0!==s?s:"",z=(0,Je.$H)(A),D=!("HU"===H&&z)&&(F||I),R=(0,g.s)("WebApp_Login"),O=()=>(0,n.jsx)(n.Fragment,{children:(null==m?void 0:m.enabledRegionOption)?(0,n.jsx)(vu,{text:null==m?void 0:m.localizedCountryName}):null==m?void 0:m.localizedCountryName}),W=()=>(0,n.jsx)(ku,{href:`https://www.tiktok.com/legal/terms-of-use?lang=${d}`,text:R("common_registration_terms_use"),policyType:"terms_of_service"}),B=()=>{const e="TR"===v&&"tr-TR"===d,t=e?"https://www.tiktok.com/legal/page/row/privacy-policy/tr#privacy-policy-addendum-for-tr":`https://www.tiktok.com/legal/privacy-policy?lang=${d}`,o=R(e?"signUpTR_panel_acknowledgement_placeholder3":"common_registration_privacy_policy");return(0,n.jsx)(ku,{href:t,text:o,policyType:"privacy_policy"})};return D?(0,n.jsx)(xu,{asText:o,isModal:y,isMobile:u,isGuestModeRedesign:A===k.tH.loginGuestMode,children:(()=>{if("TR"===H){const e=R("turkeyUsersConsent_chooseInterests_popUp_description").split(/%\d*\$s/);return(0,n.jsxs)(fu,{asText:o,children:[e[0]," ",W(),e[1]," ",B(),e[2]]})}if("US"===H){const t=R(null!=e?e:"common_registration_email_input_agreement").split(/%\d*\$s/);return(0,n.jsxs)(fu,{asText:o,children:[t[0]," ",W(),t[1]," ",B(),t[2]]})}if(w&&(null==m?void 0:m.enabledRegionOption)){if("CO"===H){const e=R("regionOption_signUp_COdisclaimer_description").split(/%\d*\$s/);return(0,n.jsxs)(fu,{asText:o,children:[e[0]," ",O(),e[1]," ",W(),e[2]," ",B(),e[3]]})}if(gu._v.includes(H)){const e=R("regionOption_signUp_disclaimer_description").split(/%\d*\$s/);return(0,n.jsxs)(fu,{asText:o,children:[e[0]," ",O(),e[1]," ",W(),e[2]," ",B(),e[3]," ",(0,n.jsx)(ku,{href:`https://www.tiktok.com/legal/page/global/cookie-policy/${d}`,text:R("regionOption_signUp_disclaimer_placeholder"),policyType:"cookie_policy"}),e[4]]})}{const e=R("regionOption_signUp_nonEUdisclaimer_description").split(/%\d*\$s/);return(0,n.jsxs)(fu,{asText:o,children:[e[0]," ",O(),e[1]," ",W(),e[2]," ",B(),e[3]]})}}{const t=R(null!=e?e:"common_registration_email_input_agreement").split(/%\d*\$s/);return(0,n.jsxs)(fu,{asText:o,children:[t[0]," ",W(),t[1]," ",B(),t[2]]})}})()}):null})),yu="sign_up_page";function vu({text:e}){(0,L.useEffect)((()=>{hu.X.handleAccountRegionEntranceShow(void 0,yu)}),[]);const t=(0,L.useCallback)((()=>{hu.X.handleAccountRegionEntranceClick(yu)}),[]);return(0,n.jsx)(Bt,{path:k.tH.signupCountrySelector,underline:!1,text:e,onClick:t})}function ku({href:e,text:t,policyType:o}){(0,L.useEffect)((()=>{mu.Q.policyLinkShow({enter_from:yu,policy_type:o})}),[]);const i=(0,L.useCallback)((()=>{mu.Q.policyLinkClicked({enter_from:yu,policy_type:o})}),[o]);return(0,n.jsx)(bu,{target:"_blank",rel:"noopener noreferrer",href:e,onClick:i,children:t})}const Cu=()=>{const e=(0,g.s)("WebApp_Login"),[{usernameInfo:t,errorMsg:o,signupLoading:i},{usernameRegister:a}]=(0,l.Su)(Dt.H),{registerLimited:r}=(0,l.Ph)(N.T);Dc();const{password:s,lengthValid:d,contentValid:c}=(0,l.Ph)(qa),p=Rt(),u=(0,L.useCallback)((()=>{a({password:s,region:p})}),[s,a,p]),h=!1===(null==t?void 0:t.isValid)||!s||!c||!d;return Me(),(0,n.jsxs)(ar,{onSubmit:u,children:[(0,n.jsx)($p,{children:e("common_login_panel_entry_2")}),(0,n.jsx)(Np,{children:e("common_login_sms_popup_option_1")}),(0,n.jsx)(uu,{autoFocus:!0,placeholder:e("common_registration_username_placeholder"),tip:"mus_create_account_desc_pc",ftc:!0}),(0,n.jsx)(Tr,{loginError:Boolean(o)}),r&&(0,n.jsx)(_u,{show:!0}),(0,n.jsx)(jr,{text:e(null!=o?o:""),type:"error"}),(0,n.jsx)(Pr,{disabled:h,loading:i,children:e("common_notification_unlogged_button")})]})},ju=(0,Q.default)("div",{target:"e6sea5o0"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:e.isMobile?"normal":"bold"}),{height:e.isMobile?"16px":"44px",lineHeight:e.isMobile?"16px":"44px",textAlign:"center",fontSize:"16px",marginTop:e.isMobile?"unset":"10px",width:"100%",cursor:"pointer"}]),"label:DivTextContainer;"),wu=(0,L.memo)((function(){var e;const t=(0,g.s)("WebApp_Login"),{setLoginSuccess:o}=(0,l.wA)(Z.$),{isMobile:i}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),a=(0,E.W6)(),r=(null===(e=(0,E.W5)(k.tH.signupCreatePassword))||void 0===e?void 0:e.isExact)&&i,s=(0,L.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),r?a.push(k.tH.signupCreateUsername):o()}),[a,r,o]),d=(0,L.useCallback)((e=>{13===e.keyCode&&(e.preventDefault(),e.stopPropagation(),o())}),[o]);return(0,n.jsx)(ju,{onClick:s,onKeyDown:d,tabIndex:0,children:t("common_registration_username_skip")})})),Su=()=>{const e=(0,g.s)("WebApp_Login"),{usernameInfo:t,username:o}=(0,l.Ph)(Dt.H),[{loginLoading:i},{setAccount:a}]=(0,l.Su)(Z.$),{password:r,lengthValid:s,contentValid:d}=(0,l.Ph)(qa),c=(0,L.useCallback)((()=>{a({password:r,username:o})}),[a,r,o]),p=!((null==t?void 0:t.isValid)&&r&&d&&s);return Me(),(0,n.jsxs)(ar,{onSubmit:c,children:[(0,n.jsx)($p,{children:e("common_login_panel_entry_2")}),(0,n.jsx)(Np,{children:e("common_registration_password_title")}),(0,n.jsx)(Tr,{autoFocus:!0}),(0,n.jsx)(Np,{children:e("common_registration_username_title")}),(0,n.jsx)(uu,{}),(0,n.jsx)(Pr,{disabled:p,loading:i,children:e("common_notification_unlogged_button")}),(0,n.jsx)(wu,{})]})},Tu=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),{usernameInfo:t,username:o}=(0,l.Ph)(Dt.H),[{loginLoading:i},{setAccount:a}]=(0,l.Su)(Z.$),r=(0,L.useCallback)((()=>{a({username:o})}),[a,o]),s=!(null==t?void 0:t.isValid);return Me(),(0,n.jsxs)(ar,{onSubmit:r,children:[(0,n.jsx)($p,{children:e("common_login_panel_entry_2")}),(0,n.jsx)(Np,{children:e("common_registration_username_title")}),(0,n.jsx)(uu,{}),(0,n.jsx)(Pr,{disabled:s,loading:i,children:e("common_notification_unlogged_button")}),(0,n.jsx)(wu,{})]})}));var Lu=o(86553),Pu=o(80596);const Mu=(0,Q.default)("div",{target:"e19c4o080"})({marginBottom:"16px",display:"flex"},"label:DivContainer;"),Au=(0,Q.default)("label",{target:"e19c4o081"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextSecondary",fontFamily:"TikTokFont"}),{fontSize:"12px",lineHeight:"16px",display:"inline"}]),"label:LabelCheckboxText;");Au.defaultProps=Object.assign(Object.assign({},Au.defaultProps),{"data-e2e":"collect-email-conconsent-text"});const Eu=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),{emailConsent:t}=Be((()=>["emailConsent"]),[]),o=Rt(),{isMobile:i}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),[{emailConsent:a},{setEmailConsent:r}]=(0,l.Su)(Dt.H),s=(0,L.useCallback)((e=>{Pu.H.clickEmailConsent({checked:e}),r(e)}),[r]);return(0,L.useEffect)((()=>{t&&(Pu.H.showEmailConsent(),["MY","PK","BD"].includes(o)&&r(!0))}),[o,t,r]),t?(0,n.jsxs)(Mu,{children:[(0,n.jsx)(bp,{"data-e2e":"collect-email-conconsent-box",size:i?"small":"big",checked:Boolean(a),onChange:s,id:"email-consent",circle:i}),(0,n.jsx)(Au,{htmlFor:"email-consent",id:Kr,children:e("EDM_onboarding_email_consent_checkbox_list")})]}):null})),Fu=(0,Q.default)("p",{target:"esdrtey0"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary"}),{fontSize:"12px",lineHeight:"15px",marginBottom:"8px",marginTop:"-4px",display:"flex"}]),"label:PRegister;"),Iu=(0,Q.default)("span",{target:"esdrtey1"})((({theme:e})=>[(0,J.zy)({theme:e,color:"Primary"}),{display:"flex",alignItems:"center"}]),"label:SpanLink;"),Hu=()=>{const e=(0,g.s)("WebApp_Login"),{ageGateAction:t,birthday:o}=(0,l.Ph)(N.T),[{errorMsg:i,signupLoading:a},{emailRegister:r}]=(0,l.Su)(Dt.H),{emailErrorMsg:s,email:d=""}=(0,l.Ph)(Va.N),[{sendCodeLoading:c,code:p,codeFormatError:u,emailRegistered:h},{sendEmailCodeForSignup:m}]=(0,l.Su)(Ja.m),{password:x,lengthValid:f,contentValid:b}=(0,l.Ph)(qa),_=Rt(),y=(0,L.useCallback)((()=>{m({email:d,region:_})}),[d,m,_]),v=(0,L.useCallback)((()=>{r({password:x,code:p,email:d,region:_})}),[d,p,r,x,_]),C=!d||!x||!p||!b||!f||Boolean(u)||Boolean(s)||Boolean(!o&&t);Me();const j=(0,sn.$m)();return(0,L.useEffect)((()=>{j("sms_verification")}),[]),(0,n.jsxs)(ar,{onSubmit:v,children:[(0,n.jsx)($p,{children:e("common_login_panel_entry_2")}),Boolean(t)&&(0,n.jsx)(Bp,{}),Boolean(t)&&(0,n.jsx)(nu,{isMobile:!1}),(0,n.jsxs)(Np,{children:[e("email")," ",(0,n.jsx)(As,{text:e("common_registration_switch_phone"),path:k.tH.signupPhone,replace:!0})]}),(0,n.jsx)(qd,{emailRegistered:h}),h&&(0,n.jsxs)(Fu,{children:[e("common_registration_email_existing_title"),",",(0,n.jsx)(Bt,{path:k.tH.loginWithSignedEmail,underline:!1,children:(0,n.jsxs)(Iu,{children:[e("log_in"),(0,n.jsx)(Lu.A,{})]})})]}),(0,n.jsx)(Tr,{}),(0,n.jsx)(fs,{email:!0,disabled:Boolean(s||!d||!o&&t),codeFromNumber:d,loading:c,errorMsg:i,onClickSendCode:y}),(0,n.jsx)(Eu,{}),(0,n.jsx)(Pr,{loading:a,disabled:C,children:e("common_registration_email_input_button")})]})},zu=()=>{const e=(0,g.s)("WebApp_Login"),[{birthday:t,ageGateAction:o}]=(0,l.Su)(N.T),[{sendCodeLoading:i,code:a,codeFormatError:r},{sendPhoneCodeForLogin:s}]=(0,l.Su)(Ja.m),[{loginLoading:d},{handleSmsLogin:c}]=(0,l.Su)(Z.$),p=(0,sn.VN)(),u=Rt(),[h]=(0,l.Su)(Qa.U),{mobile:m,phoneErrorMsg:x,phone:f}=h,b=m&&a&&!x&&!r&&(t||!o),_=nr(),y=(0,L.useCallback)((()=>{p({platform:"sms_verification",signUp:!0}),c({birthday:t,phoneCode:a,mobile:m,login_only:!1,region:u})}),[t,c,p,m,a,u]),v=(0,L.useCallback)((()=>{s({mobile:m,isSignUp:!0,region:u})}),[m,s,u]);Me();const C=(0,sn.$m)();return(0,L.useEffect)((()=>{C("sms_verification")}),[]),(0,n.jsxs)(ar,{onSubmit:y,children:[(0,n.jsx)($p,{children:e("common_login_panel_entry_2")}),Boolean(o)&&(0,n.jsx)(Bp,{platform:"sms_verification"}),Boolean(o)&&(0,n.jsx)(nu,{isMobile:!1}),(0,n.jsxs)(Np,{children:[e("phone")," ",(0,n.jsx)(As,{text:e("common_registration_switch_email"),path:k.tH.signupEmail,replace:!0})]}),(0,n.jsx)(Sl,{}),(0,n.jsx)(fs,{disabled:Boolean(x||!f||!t&&o),codeFromNumber:m,loading:i,errorMsg:_,onClickSendCode:v}),(0,n.jsx)(Pr,{loading:d,disabled:!b,children:e("common_registration_email_input_button")})]})};var Du=o(26290),Ru=o(60163),Ou=o(31209),Wu=o(7892),Bu=o(56070),$u=o(26325),Uu=o(80241);const Nu=(0,Wu.p)("interestSelectorAtom@tiktok/webapp-atoms",{isInterestSelected:{},selectedCount:0}),{useAtomService:Vu,useServiceState:Gu,useServiceDispatchers:qu}=(0,Ou.i)(Nu,((e,t)=>({setItemSelected(e){t(Nu,(t=>({isInterestSelected:Object.assign(Object.assign({},t.isInterestSelected),{[e]:!0}),selectedCount:t.selectedCount+1})))},setItemDeselected(e){t(Nu,(t=>({isInterestSelected:Object.assign(Object.assign({},t.isInterestSelected),{[e]:!1}),selectedCount:t.selectedCount-1})))},submitInterests(){return t=this,o=void 0,i=function*(){try{const t=e(Nu).isInterestSelected,o=Object.entries(t).filter((([,e])=>e)).map((([e])=>e));Uu.o.handleInterestSubmit({},o);const{status_code:n,status_msg:i}=yield function(e){var t,o,n,i,a;return o=this,n=void 0,a=function*(){return Bu.h.post("/api/fyp/interest",{signal:(new AbortController).signal,query:{category_type:null===(t=e.category_type)||void 0===t?void 0:t.join(","),fromWeb:1},baseUrlType:2,headers:{[$u.nk]:Bu.h.csrfToken}})},new((i=void 0)||(i=Promise))((function(e,t){function r(e){try{s(a.next(e))}catch(e){t(e)}}function l(e){try{s(a.throw(e))}catch(e){t(e)}}function s(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i((function(e){e(o)}))).then(r,l)}s((a=a.apply(o,n||[])).next())}))}({category_type:o});if(0!==n)throw new Error(i)}catch(e){console.warn(e)}},new((n=void 0)||(n=Promise))((function(e,a){function r(e){try{s(i.next(e))}catch(e){a(e)}}function l(e){try{s(i.throw(e))}catch(e){a(e)}}function s(t){var o;t.done?e(t.value):(o=t.value,o instanceof n?o:new n((function(e){e(o)}))).then(r,l)}s((i=i.apply(t,o||[])).next())}));var t,o,n,i}}))),Ku="2.5rem",Zu=(0,Q.default)("div",{target:"e1mzwt2j0"})({width:"20rem",maxHeight:`calc(5 * (${Ku} + 1rem))`,gap:"1rem",display:"flex",justifyContent:"center",alignItems:"center",overflowY:"clip",flexWrap:"wrap",paddingTop:"0.5rem"},"label:DivInterestPanelContainer;"),Qu=(0,Q.default)(dc.I05,{target:"e1mzwt2j1"})((({theme:{colors:e},isItemSelected:t})=>({height:Ku,"& > div":{"& > .TUXButton-label":{}},"&.TUXButton.TUXButton":{borderWidth:"1px",borderStyle:"solid",boxShadow:`0px 2px 8px 0px ${e.ShadowSecondary}`,borderColor:t?dc.Tj4.UIText1:dc.Tj4.UIShapeNeutral4,transition:"border-color 0.3s ease-in-out",":not(:hover)":{backgroundColor:dc.Tj4.UIPageFlat3}}})),"label:StyledTUXInterestItem;"),Ju=(0,Q.default)("div",{target:"e1mzwt2j2"})({fontSize:"24px",display:"flex",alignItems:"center","&.icon-enter":{opacity:0,transition:"opacity 0.15s ease-in"},"&.icon-enter-active":{opacity:1},"&.icon-exit":{opacity:1},"&.icon-exit-active":{opacity:0,transition:"opacity 0.15s ease-out"}},"label:DivIconContainer;"),Yu=(0,L.memo)((function({interest:e}){const[t,{setItemSelected:o,setItemDeselected:i}]=Vu((t=>t.isInterestSelected[e.id]),M.bN),a=(0,g.s)("Webapp"),[r,l]=(0,L.useState)(!1),[s,d]=(0,L.useState)(!0),c=(0,L.useCallback)((e=>{e?d(!1):l(!1)}),[]),p=(0,L.useCallback)((e=>{e?d(!0):l(!0)}),[]),u=(0,L.useCallback)((()=>(0,n.jsx)(Ru.A,{children:(0,n.jsx)(Gs.A,{timeout:150,classNames:"icon",mountOnEnter:!0,unmountOnExit:!0,onEnter:()=>c(t),onExited:()=>p(t),children:(0,n.jsxs)(Ju,{children:[r&&(0,n.jsx)(dc.IuZ,{size:"14"}),s&&(0,n.jsx)(dc.mPD,{size:"14",color:"UIText3"})]})},t?"check":"plus")})),[c,p,t,r,s]);return(0,n.jsx)(Qu,{size:"medium",shape:"capsule",variant:"secondary",label:a(e.text_key,{},e.text),trailingIcon:u(),onClick:()=>t?i(e.id):o(e.id),isItemSelected:t})})),Xu=(0,L.memo)((function({interestList:e}){return(0,n.jsx)(Zu,{children:e.map((e=>(0,n.jsx)(Yu,{interest:e},e.id)))})})),eg=(0,Q.default)("div",{target:"erjdrsu0"})({width:"100%",gap:"1.5rem",padding:"1.5rem",display:"flex"},"label:DivInterestSelectorButtonWrapper;");const tg=(0,L.memo)((function({onClose:e,onSkip:t,showContinueButton:o}){const[{selectedCount:i},{submitInterests:a}]=Vu((e=>({selectedCount:e.selectedCount})),M.bN),r=(0,g.s)("Webapp"),[l,s]=(0,L.useState)(!1),d=(0,L.useCallback)((()=>{return t=this,o=void 0,i=function*(){s(!0),yield a(),e()},new((n=void 0)||(n=Promise))((function(e,a){function r(e){try{s(i.next(e))}catch(e){a(e)}}function l(e){try{s(i.throw(e))}catch(e){a(e)}}function s(t){var o;t.done?e(t.value):(o=t.value,o instanceof n?o:new n((function(e){e(o)}))).then(r,l)}s((i=i.apply(t,o||[])).next())}));var t,o,n,i}),[e,a]),c=(0,L.useCallback)((()=>{Uu.o.handleSelectorSkip({}),t()}),[t]);return o?(0,n.jsx)(eg,{children:(0,n.jsx)(dc.I05,{label:r("bricFriction_popUp_noPhone_cont"),onClick:i>0?d:c,loading:l,style:{width:"100%"}})}):(0,n.jsxs)(eg,{children:[(0,n.jsx)(dc.I05,{label:r("pcWeb_chooseInterest_skip_btn"),variant:"secondary",onClick:c,style:{width:"50%"}}),(0,n.jsx)(dc.I05,{label:r("pcWeb_chooseInterest_done_btn"),onClick:d,disabled:0===i,loading:l,style:{width:"50%"}})]})})),og=(0,Q.default)("div",{target:"e4k2dvg0"})({paddingLeft:"1.5rem",paddingRight:"1.5rem"},"label:DivInterestSelectorContainer;"),ng=(0,Q.default)("div",{target:"e4k2dvg1"})({display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"2rem"},"label:DivTitleContainer;"),ig=(0,Q.default)("div",{target:"e4k2dvg2"})({display:"flex",alignItems:"center",justifyContent:"center",height:"17.5rem"},"label:DivInterestPanelContainer;"),ag=(0,Q.default)("div",{target:"e4k2dvg3"})({paddingLeft:"0.75rem",paddingRight:"0.75rem"},"label:DivInterestButtonContainer;"),rg=(0,L.memo)((function(){var e,t,o,i;const a=(0,g.s)("Webapp"),{showContinueButton:r}=(0,h.aO)(),d=(0,l.wA)(u.i),[{closeCallback:p},{setLoginModalShow:m,setCloseCallback:x,setGroupId:f,setIsLoginOnLoadClosed:_}]=(0,j.MR)((e=>({loginModalShow:e.loginModalShow,closeCallback:e.closeCallback,isGuestMode:e.isGuestMode,isGuestModeUI:e.isGuestModeUI})),M.bN),y=(0,s.Nj)(C.$F),v=(0,de.L$)((0,c.U)((()=>["vgeo","interestList","claConfig"]),[])),{vgeo:k}=v;let w=[];try{w=null!==(o=null===(t=JSON.parse(null!==(e=v.interestList)&&void 0!==e?e:JSON.stringify({interest_list:[]})))||void 0===t?void 0:t.interest_list)&&void 0!==o?o:[]}catch(e){console.error("Error parsing interest list...",e)}const S=parseInt(null!==(i=localStorage.getItem("ppe-max-interest-count"))&&void 0!==i?i:"10"),P=(0,me.eu)(),A=(0,L.useCallback)((()=>{m(!1),localStorage.setItem("guest-mode-flag","1"),localStorage.setItem("timeOfLastPopup",Date.now().toString());const e=(0,fe.uh)(k,!1);y.updateTeaDataCollectionEnabled(e),y.loginNotifyClose({isSignUp:"1",e2eInfo:b.nf.getTrackingInfo()}),d.setLoginModalInitialState(),p(),x(T()),f(void 0),_({isLoginOnLoadClosed:!0})}),[m,y,d,p,x,f,_,P]);return(0,n.jsxs)(og,{children:[(0,n.jsx)(ng,{children:(0,n.jsx)(Du.F.H1,{weight:"bold",children:a("pcWeb_chooseInterest_header")})}),(0,n.jsx)(ig,{children:(0,n.jsx)(Xu,{interestList:null==w?void 0:w.slice(0,S)})}),(0,n.jsx)(ag,{children:(0,n.jsx)(tg,{onClose:A,onSkip:A,showContinueButton:r})})]})})),lg=(0,L.memo)((()=>{const{initial:e}=(0,l.Ph)(N.T),t=(0,j.mZ)((e=>e.groupId));md(t),(0,se.rF)({pid:"signup"}),Hc(),function(){const{isMobile:e}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{showAgeConfirm:t}=(0,l.Ph)(N.T),o=(0,E.W6)();(0,L.useEffect)((()=>{t&&!e&&o.push(k.tH.signupAgeGateConfirm)}),[o,t,e])}();const{handlePopupHide:o,handlePopupShow:i}=(0,mc.H)(),a=(0,E.W6)(),{pathname:r}=(0,E.zy)(),s=(0,L.useCallback)((e=>{27!==e.keyCode&&e.stopPropagation()}),[]),d=Rt(),{isModal:p}=(0,l.Ph)(Oe.t),[u,g]=(0,L.useState)(!1);return"KR"!==d||p||u||(g(!0),a.push(k.tH.signupPolicyConfirm)),e||r===k.tH.signupHome?(0,n.jsxs)(Lt,{onKeyDown:s,isCountrySelector:r===k.tH.signupCountrySelector,isInterestSelector:r===k.tH.signupInterestSelector,children:[(0,n.jsx)(_d,{page:"signup"}),(0,n.jsxs)($,{children:[(0,n.jsx)(W,{path:k.tH.signupHome,component:Aa,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupPhoneOrEmail,component:zu,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupPhone,component:zu,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupEmail,component:Hu,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupCreatePassword,component:Su,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupCreateUsername,component:Tu,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupCreateAccount,component:Cu,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupAgeGate,component:iu,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupAgeGateConfirm,component:tp,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupPolicyConfirm,component:Cp,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupCountrySelector,component:Ic,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupInterestSelector,component:rg,exact:!0}),(0,n.jsx)(W,{path:"*",component:Aa})]}),(0,n.jsx)(Zc,{isMobile:!1}),!p&&(0,n.jsx)(xc.H,{hideByDefault:!0,onShow:i,onHide:o})]}):(0,n.jsx)(G.R,{center:!0,style:{margin:"auto"}})})),sg=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(W,{path:k.tH.loginHome,component:hc}),(0,n.jsx)(W,{path:k.tH.signupHome,component:lg}),(0,n.jsx)(ie,{}),(0,n.jsx)(le,{})]});var dg=o(63619),cg=o(48632),pg=o(98183),ug=o(16891);const gg=(0,Q.default)("div",{target:"e1pdjumk0"})((({theme:e})=>[(0,J.mp)({direction:e.direction,start:"0"}),{background:e.colors.BGPrimary,borderRadius:"8px 8px 0 0",width:"100%",padding:"16px",textAlign:"center"}]),"label:DivContainer;"),hg=(0,Q.default)("div",{target:"e1pdjumk1"})((({fill:e})=>({height:"64px",width:"64px",borderRadius:"50%",position:"relative",background:"rgba(22, 24, 35, .03)",display:"inline-block","&::before, &::after":{width:"5px",height:"23px",display:"block",content:'""',background:null!=e?e:"#fe3824",position:"absolute",left:"50%",transform:"translate(-50%, 16px)"},"&::after":{height:"5px",transform:"translate(-50%, 43px)"}})),"label:DivIcon;"),mg=(0,Q.default)("i",{target:"e1pdjumk2"})((({theme:e})=>[(0,J.mp)({direction:e.direction,end:"16px"}),{position:"absolute",top:"16px",cursor:"pointer"}]),"label:IClose;"),xg=(0,Q.default)("p",{target:"e1pdjumk3"})([({theme:e})=>(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{lineHeight:"20px",fontSize:"17px",margin:"24px 0",textAlign:"center"}],"label:PDesc;"),fg={US:{1357:"login_deactivated_popup_website_text_US"},1357:"login_deactivated_popup_website_text_nonUS",1384:"ban_age_gate_removed_pc_text"},bg={1357:"login_deactivated_popup_webapp_text",1384:"ban_age_gate_removed_mobile_text"},_g=(0,L.memo)((()=>{const e=(0,g.s)("WebApp_Login"),[{showRiskModal:t,errorCode:o,showInstagramRisk:i=!1},r]=(0,l.Su)(Ia.S),{region:s,appType:d}=(0,de.L$)((0,ue.W)((()=>["region","appType"]),[])),{isMobile:p}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),u=((e,t,o)=>{var n,i;if(o)return t?bg[o]:null!==(i=null===(n=fg[e])||void 0===n?void 0:n[o])&&void 0!==i?i:fg[o]})(s,p,o)||(i?"login_new_ins_mobile_body":"login_risk_popup_body"),h=(0,L.useCallback)((()=>{r.setShowRiskModal(!1),r.setShowInstagramCantLoginModal(!1)}),[r]),m=(0,L.useCallback)((()=>{const e=(0,pg.cA)({appType:d,enterMethod:"login_anti_spam",pageName:ug.f.commonParams.page_name});(0,pg.Ze)(e)}),[d]);return(0,n.jsx)(Qs,{visible:t||i,maskCloseable:!1,children:(0,n.jsxs)(gg,{"data-e2e":"instagram-modal",children:[(0,n.jsx)(hg,{}),(0,n.jsx)(mg,{onClick:h,"data-e2e":"instagram-modal-close",children:(0,n.jsx)(a.A,{})}),(0,n.jsx)(xg,{"data-e2e":"instagram-modal-desc",children:e(u)}),(0,n.jsx)(Pr,{onClick:m,"data-e2e":"instagram-modal-button",children:e("login_risk_popup_button")})]})})})),yg=()=>{const[{phoneNotRegistered:e=!1},{setPhoneNotRegistered:t}]=(0,l.Su)(Z.$),{registerPhone:o}=(0,l.wA)(Dt.H),i=(0,E.W6)(),a=Rt(),r=(0,L.useCallback)((()=>{t(!1),o({region:a})}),[t,o,a]),s=(0,L.useCallback)((()=>{t(!1),i.goBack()}),[t,i]),d=(0,L.useMemo)((()=>[{text:"common_login_sms_popup_option_1",onClick:r},{text:"common_login_sms_popup_option_2",onClick:s}]),[s,r]);return(0,n.jsx)(Ds,{visible:e,title:"common_login_sms_popup_text",actions:d})},vg=(0,Q.default)("div",{target:"e7p76pd0"})({padding:"0 32px",flex:"1",minHeight:"550x"},"label:DivMobileBody;"),kg=e=>{const{children:t,onSubmit:o}=e,i=(0,F.__rest)(e,["children","onSubmit"]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(at,Object.assign({},i)),(0,n.jsx)(vg,{children:o?(0,n.jsx)(ar,{onSubmit:e.onSubmit,children:t}):t})]})},Cg=()=>{var e;const t=(0,g.s)("WebApp_Login"),o=(0,sn.VN)(),{birthday:i}=(0,l.Ph)(N.T),{mobile:a}=(0,l.Ph)(Qa.U),[{code:r},{sendPhoneCodeForLogin:s,sendPhoneCodeForVerify:d}]=(0,l.Su)(Ja.m),[{loginLoading:c},{handleSmsLogin:p,handleSmsVerify:u}]=(0,l.Su)(Z.$),{isSecurityVerification:h}=Be((()=>["isSecurityVerification"]),[]),m=null===(e=(0,E.W5)(k.tH.signupPhoneDigit))||void 0===e?void 0:e.isExact,x=nr(),f=Rt(),b=(0,L.useCallback)((()=>{h?d({mobile:a}):s({mobile:a,region:f})}),[h,a,f,s,d]),_=(0,L.useCallback)((()=>{o({platform:"sms_verification",signUp:m});const e={birthday:m?i:void 0,mobile:a,phoneCode:r,login_only:!m};h?u(e):p(e)}),[o,m,i,a,r,h,u,p]);return Me(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ls,{codeFromNumber:a,onClickSendCode:b,onSubmit:_,loading:c,errorMsg:x}),!m&&(0,n.jsx)(As,{text:t("login_option_password"),path:k.tH.loginPhonePassword})]})},jg=(0,Q.default)("div",{target:"e1ntpldy0"})((({theme:e})=>({height:"40px",borderBottom:`1px solid ${e.colors.LinePrimary2}`,display:"flex",padding:"0 16px",boxSizing:"border-box",width:"100%",marginInlineStart:"50%",transform:"rtl"===e.direction?"translateX(50%)":"translateX(-50%)",marginBottom:"40px"})),"label:DivTabWrapper;"),wg=(0,Q.default)("div",{target:"e1ntpldy1"})((({theme:e,selected:t})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"semiBold",color:t?"TextPrimary":"TextQuaternary"}),{textAlign:"center",lineHeight:"40px",transition:"all .1s",flex:1,margin:"0 10px",borderBottom:"2px solid",borderBottomColor:t?e.colors.TextPrimary:"transparent",whiteSpace:"nowrap"}]),"label:DivTab;"),Sg=(0,L.memo)((function(e){const{tabs:t,currentTab:o}=e;return(0,n.jsx)(jg,{children:t.map((({text:i,e2e:a},r)=>(0,n.jsx)(wg,{onClick:e.onSwitchTab(r),selected:t[o].text===i,"data-e2e":a,children:i},r)))})})),Tg=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),{phone:t,mobile:o}=(0,l.Ph)(Qa.U),[{sendCodeLoading:i},{sendPhoneCodeForLogin:a,sendPhoneCodeForVerify:r}]=(0,l.Su)(Ja.m),{isSecurityVerification:s}=Be((()=>["isSecurityVerification"]),[]),d=(0,E.W5)(k.tH.signupPhoneOrEmail),c=Xd(k.tH.loginEmail,k.tH.loginPhonePassword),p=(0,L.useCallback)((()=>{const e={mobile:o,nextUrl:d?k.tH.signupPhoneDigit:k.tH.loginPhoneDigit,errorInterceptor:d?void 0:c.errorInterceptor};s?r(e):a(e)}),[s,r,o,a,d,c.errorInterceptor]);return(0,n.jsxs)(ar,{onSubmit:p,children:[(0,n.jsx)(Bl,{}),d&&(0,n.jsx)(_u,{show:!0,asText:!0,i18nKey:"common_registration_phone_input_agreement"}),(0,n.jsx)(Pr,{loading:i,disabled:!t,"data-e2e":"login-button",children:e(d?"common_registration_phone_input_button":"Login")}),!d&&(0,n.jsx)(ec,Object.assign({},c,{isMobile:!0}))]})})),Lg=(0,L.memo)((function(){var e;const t=(0,g.s)("WebApp_Login"),o=(0,E.W6)(),i=(0,E.W5)(`${k.tH.loginPhoneOrEmail}/:type`),a="email"===(null===(e=null==i?void 0:i.params)||void 0===e?void 0:e.type)?1:0,r=(0,L.useMemo)((()=>[{text:t("Phone")},{text:t("common_login_email_input_tab"),e2e:"email-tab"}]),[t]),l=(0,L.useCallback)((e=>()=>{0===e?o.replace(k.tH.loginPhone):o.replace(k.tH.loginEmail)}),[o]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Sg,{tabs:r,currentTab:a,onSwitchTab:l}),0===a&&(0,n.jsx)(Tg,{}),1===a&&(0,n.jsx)(Qd,{})]})})),Pg=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,sn.VN)(),[{loginLoading:o},{handlePasswordLogin:i}]=(0,l.Su)(Z.$),{mobile:a}=(0,l.Ph)(Qa.U),{password:r}=(0,l.Ph)(qa),s=nr(),d=(0,L.useCallback)((()=>{t({platform:"phone"}),i({account:a,password:r,mobile:a})}),[i,t,a,r]);return(0,n.jsxs)(ar,{onSubmit:d,children:[(0,n.jsx)(bs,{children:e("common_login_password_title")}),(0,n.jsx)(Tr,{create:!1,loginError:Boolean(s)}),(0,n.jsx)(jr,{text:e(s),type:"error"}),(0,n.jsx)(Os,{}),(0,n.jsx)(Pr,{loading:o,disabled:!r,children:e("Login")})]})},Mg=()=>{const e=(0,g.s)("WebApp_Login"),{hideHomePage:t,loginTitle:o}=Be((()=>["hideHomePage","loginTitle"]),[]),i=t?o:"Login";return Me(),(0,n.jsxs)(kg,{title:e(i,{},rt.fN),children:[(0,n.jsx)(W,{path:k.tH.loginPhonePassword,component:Pg,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginPhoneOrEmail,component:Lg,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginPhone,component:Lg,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginEmail,component:Lg,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginPhoneDigit,component:Cg,exact:!0})]})},Ag=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),[{sendCodeLoading:t},{sendEmailCodeForReset:o}]=(0,l.Su)(Ja.m),[{emailErrorMsg:i,email:a=""},{setEmailInfo:r}]=(0,l.Su)(Va.N),s=ir(),d=(0,L.useCallback)((()=>{const e=(0,Ga.Ro)(a);r({email:a,valid:e}),e&&o({email:a,email_logic_type:2,nextUrl:k.tH.emailResetDigit})}),[o,a,r]);return(0,n.jsxs)(ar,{onSubmit:d,children:[(0,n.jsx)(bs,{children:e("setting_password_email_verify_title")}),(0,n.jsx)(_s,{children:e("common_login_reset_email_input_text")}),(0,n.jsx)(qd,{errorMsg:s}),(0,n.jsx)(Pr,{loading:t,disabled:Boolean(i)||!a,children:e("common_registration_phone_input_button")})]})})),Eg=(0,L.memo)((function(){const{email:e=""}=(0,l.Ph)(Va.N),[{code:t},{sendEmailCodeForReset:o}]=(0,l.Su)(Ja.m),[{checkCodeLoading:i,errorMsg:a},{checkEmailCodeForReset:r,setErrorMsg:s}]=(0,l.Su)(or);(0,L.useEffect)((()=>{s("")}),[t,s]);const d=(0,L.useCallback)((()=>{o({email:e,email_logic_type:2})}),[e,o]),c=(0,L.useCallback)((()=>{r({email:e,code:t})}),[t,r,e]);return(0,n.jsx)(Ls,{codeFromNumber:e,onClickSendCode:d,onSubmit:c,loading:i,errorMsg:a,email:!0})})),Fg=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),[{code:t},{sendPhoneCodeForForceResetPwd:o,sendEmailCodeForForceResetPwd:i}]=(0,l.Su)(Ja.m),[{forceResetResponse:a},{clearForceResetRes:r}]=(0,l.Su)(Z.$),{conditional_login_ticket:s,mobile:d,email:c,type:p}=(0,de.L$)(a),[{checkCodeLoading:u,errorMsg:h},{checkCodeForForceReset:m,setErrorMsg:x}]=(0,l.Su)(or);(0,L.useEffect)((()=>{x("")}),[t,x]);const f=(0,L.useCallback)((()=>{"email"===p?i({conditional_login_ticket:s}):o({conditional_login_ticket:s})}),[i,o,s,p]),b=(0,L.useCallback)((()=>{m({conditional_login_ticket:s,code:t,type:p})}),[m,s,t,p]);(0,L.useEffect)((()=>()=>{r()}),[]);const _="email"===p?e("setting_password_code_email_text",{email:c}):e("setting_password_code_sms_text",{mobile:d}).replace(/(\D{1})(4)(\D{1})/,((e,t,o,n)=>`${t}6${n}`));return(0,n.jsx)(Ls,{autoSendFirstTime:!0,codeDesc:_,codeFromNumber:s,onClickSendCode:f,onSubmit:b,loading:u,errorMsg:h,email:"email"===p})})),Ig=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),{phone:t,mobile:o}=(0,l.Ph)(Qa.U),[i,{sendPhoneCodeForResetPwd:a}]=(0,l.Su)(Ja.m),{sendCodeLoading:r}=i,s=(0,L.useCallback)((()=>{a({mobile:o,nextUrl:k.tH.phoneResetDigit})}),[a,o]);return(0,n.jsxs)(ar,{onSubmit:s,children:[(0,n.jsx)(bs,{children:e("setting_bind_phone_input_title")}),(0,n.jsx)(_s,{children:e("common_login_reset_phone_input_text")}),(0,n.jsx)(Bl,{}),(0,n.jsx)(Pr,{loading:r,disabled:!t,children:e("common_registration_phone_input_button")})]})})),Hg=(0,L.memo)((function(){const{mobile:e}=(0,l.Ph)(Qa.U),[{code:t},{sendPhoneCodeForResetPwd:o}]=(0,l.Su)(Ja.m),[{checkCodeLoading:i,errorMsg:a},{checkPhoneCodeForReset:r,setErrorMsg:s}]=(0,l.Su)(or);(0,L.useEffect)((()=>{s("")}),[t,s]);const d=(0,L.useCallback)((()=>{o({mobile:e})}),[e,o]),c=(0,L.useCallback)((()=>{r({mobile:e,code:t})}),[e,t,r]);return(0,n.jsx)(Ls,{codeFromNumber:e,onClickSendCode:d,onSubmit:c,loading:i,errorMsg:a})})),zg=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),t=(0,s.Nj)(C.$F),o=(0,sn.VN)(),{password:i,lengthValid:a,contentValid:r}=(0,l.Ph)(qa),{ticket:d,type:c,conditional_login_ticket:p}=(0,l.Ph)(or),[{loginLoading:u},{handleChangePwdByTicket:h,handleForceResetPwd:m}]=(0,l.Su)(Z.$),x=nr(),f=(0,L.useCallback)((()=>{p?(t.forceResetSubmit(),m({ticket:d,password:i,conditional_login_ticket:p,type:c})):(o({platform:"email"===c?"email":"sms_verification"}),h({password:i,ticket:d,type:c}))}),[t,c,p,m,d,i,h]),b=!(d&&i&&a&&r);return(0,n.jsxs)(ar,{onSubmit:f,children:[(0,n.jsx)(bs,{children:e("common_login_reset_password_title")}),(0,n.jsx)(Tr,{autoFocus:!0,loginErrorText:x}),(0,n.jsx)(Pr,{loading:u,disabled:b,children:e("Login")})]})})),Dg=(0,Q.default)("div",{target:"e1ku7a1t0"})((({theme:e})=>[{background:e.colors.BGPlaceholderDefault,padding:"8px 16px",color:e.colors.TextTertiary,width:"100vw",marginInlineStart:"-32px"}]),"label:DivTips;"),Rg=()=>{var e;const t=(0,g.s)("WebApp_Login"),{forceResetResponse:o}=(0,l.Ph)(Z.$),i=(null===(e=(0,E.W5)([k.tH.loginForgetPhonePassword,k.tH.loginForgetEmailPassword]))||void 0===e?void 0:e.isExact)&&o,a=o?"":t("Reset");return Me(),(0,n.jsxs)(kg,{title:a,showLeft:!i,children:[i&&(0,n.jsx)(Dg,{children:t("changepw_banner")}),(0,n.jsx)(W,{path:k.tH.loginForgetEmailPassword,component:o?Fg:Ag,exact:!0}),(0,n.jsx)(W,{path:k.tH.emailResetDigit,component:Eg,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginForgetPhonePassword,component:o?Fg:Ig,exact:!0}),(0,n.jsx)(W,{path:k.tH.phoneResetDigit,component:Hg,exact:!0}),(0,n.jsx)(W,{path:k.tH.resetPassword,component:zg,exact:!0})]})},Og=()=>{const e=(0,g.s)("WebApp_Login");return Me(),(0,n.jsx)(kg,{title:e("Login"),children:(0,n.jsx)(lc,{})})},Wg=(0,L.memo)((()=>{const{enterMethod:e,closeable:t,groupId:o,lastGroupId:i}=(0,j.mZ)((e=>({enterMethod:e.enterMethod,closeable:e.closeable,groupId:e.groupId,lastGroupId:e.lastGroupId})),M.bN);return hd({enterMethod:e,closeable:t,groupId:o,lastGroupId:i}),(0,se.rF)({pid:"login"}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_d,{page:"login"}),(0,n.jsxs)($,{children:[(0,n.jsx)(W,{path:k.tH.loginHome,component:Aa,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginQRcode,component:Ta,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginPhoneOrEmail,component:Mg}),(0,n.jsx)(W,{path:k.tH.loginPhoneDigit,component:Mg,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginWithSignedEmail,component:Og,exact:!0}),(0,n.jsx)(W,{path:k.tH.tvLoginHome,component:Vl,exact:!0}),(0,n.jsx)(W,{path:k.tH.tvLoginEmail,component:Gr,exact:!0}),(0,n.jsx)(W,{path:k.tH.tvLoginPhone,component:os,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginForgetEmailPassword,component:Rg,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginForgetPhonePassword,component:Rg,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginReset,component:Rg}),(0,n.jsx)(W,{path:k.tH.loginTwoStepVerify,component:rd,exact:!0}),(0,n.jsx)(W,{path:k.tH.loginTwoStepVerify,component:rd,exact:!0}),(0,n.jsx)(W,{path:"*",component:Aa})]}),(0,n.jsx)(yg,{})]})})),Bg=()=>{const{showAgeConfirm:e}=(0,l.Ph)(N.T);return(0,n.jsx)(y.aF,{visible:e,children:(0,n.jsx)(tp,{isModal:!0})})};var $g=o(3273);const Ug=(0,Q.default)("div",{target:"e1i2f2310"})({position:"absolute",marginTop:"24px",left:0,right:0},"label:DivWrapper;"),Ng=new Date(1900,0,1,0,0,0),Vg=new Date((new Date).getFullYear()-1,11,31,0,0,0),Gg=Sp(),qg=(0,L.memo)((function(){const e=(0,s.Nj)(C.$F),[{year:t,month:o,date:i},{setBirthday:a,setMonth:r,setYear:d,setDate:c}]=(0,l.Su)(N.T),p=(0,g.s)("WebApp_Login");(0,L.useEffect)((()=>{e.ageGateShow()}),[]);const u=(0,L.useCallback)((e=>{var t;return(0,n.jsx)(L.Fragment,{children:p(null===(t=Gg[e])||void 0===t?void 0:t.key)})}),[p]),h=(0,L.useCallback)((e=>{const t=e.getDate(),o=e.getMonth()+1,n=e.getFullYear();r({value:o,key:String(o-1)}),d({value:n,key:String(n)}),c({value:t,key:String(t)}),a({year:n,month:o,date:t})}),[a,c,r,d]),m=(0,L.useMemo)((()=>{if(!(null==t?void 0:t.value)||!(null==o?void 0:o.value)||!(null==i?void 0:i.value)){const e=new Date;return new Date(Vg.getFullYear(),e.getMonth(),e.getDate())}return new Date(t.value,o.value,i.value)}),[t,o,i]);return(0,n.jsx)(Ug,{children:(0,n.jsx)($g.A,{className:"date-selector",defaultDate:m,mode:"date",maxDate:Vg,minDate:Ng,onDateChange:h,formatMonth:u})})})),Kg=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),{birthday:t,checkAgeLoading:o,ageErrorMsg:i="",showErrorByToast:a}=(0,l.Ph)(N.T),{signupLoading:r}=(0,l.Ph)(Dt.H),{user:s}=(0,de.L$)((0,ue.W)((()=>["user"]),[])),{handleCheckAge:d,nextStep:c}=zc();(0,L.useEffect)((()=>{i&&a&&(0,ln.P)(e(i))}),[a,i,e]);const p=Boolean(i)&&!a;return Me(),(0,n.jsxs)(kg,{title:e("sign_up"),children:[(0,n.jsx)(bs,{"data-e2e":"birthday-text",children:e("common_registration_agegate_title")}),(0,n.jsx)(_s,{"data-e2e":"birthday-desc",children:e("mus_age_gate_tips")}),(0,n.jsx)(vr,{errorState:p,disableDelete:!0,placeholder:e("birthdate_placeholder"),value:t,readonly:!0}),p&&(0,n.jsx)(jr,{text:e(i),type:"error"}),(0,n.jsx)(Pr,{disabled:!t||Boolean(s),onClick:d,loading:r||o,"data-e2e":"next-button",children:e("common_registration_email_input_button")}),(0,n.jsx)(qg,{}),(0,n.jsx)(nu,{isMobile:!0,onContinue:c})]})})),Zg=(0,Q.default)("div",{target:"ekgsvu50"})({height:"30px",overflow:"hidden",marginTop:"32px"},"label:DivWrapper;"),Qg=(0,Q.default)("div",{target:"ekgsvu51"})((({theme:{colors:e}})=>[{position:"relative",background:e.BGPrimary,borderColor:e.LineSecondary,width:"100%",display:"flex",overflowX:"auto",alignItems:"center",paddingBottom:"10px"}]),"label:DivSuggestListWrapper;"),Jg=(0,Q.default)("span",{target:"ekgsvu52"})((({theme:e,disabled:t})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:t?"TextTertiary":"TextPrimary",fontWeight:"semiBold"}),{padding:"6px 10px",fontSize:"13px",lineHeight:"14px",border:`1px solid ${e.colors.LineSecondary2}`,borderRadius:"2px",marginInlineEnd:"8px",whiteSpace:"nowrap"}]),"label:SpanItem;"),Yg=(0,L.memo)((function({labelText:e="common_registration_email_input_suggested",list:t=[],onSelect:o}){const i=(0,g.s)("WebApp_Login");return(0,n.jsx)(Zg,{children:(0,n.jsxs)(Qg,{children:[(0,n.jsx)(Jg,{disabled:!0,children:i(e)}),t.map(((e,t)=>(0,n.jsx)(Jg,{onClick:o(`${e}`),children:e},t)))]})})})),Xg=(0,L.memo)((function(){var e;const[{usernameInfo:t},{setUsername:o}]=(0,l.Su)(Dt.H),i=(0,L.useCallback)((e=>()=>{o(e)}),[o]);return(null==t?void 0:t.isValid)||!(null===(e=null==t?void 0:t.suggestList)||void 0===e?void 0:e.length)?null:(0,n.jsx)(Yg,{onSelect:i,list:null==t?void 0:t.suggestList})})),eh=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),{usernameInfo:t}=(0,l.Ph)(Dt.H),o=(0,E.W6)();Dc();const i=(0,L.useCallback)((()=>{o.push({pathname:k.tH.signupCreatePassword,state:{createAccount:!0}})}),[o]);return Me(),(0,n.jsxs)(kg,{title:e("sign_up"),onSubmit:i,children:[(0,n.jsxs)(bs,{children:[" ",e("common_login_sms_popup_option_1")]}),(0,n.jsxs)(_s,{children:[" ",e("mus_create_account_desc")," "]}),(0,n.jsx)(uu,{ftc:!0}),(0,n.jsx)(Pr,{disabled:!(null==t?void 0:t.isValid),children:e("common_registration_email_input_button")}),(0,n.jsx)(Xg,{})]})})),th=()=>{const e=(0,g.s)("WebApp_Login"),[{loginLoading:t},{setAccount:o}]=(0,l.Su)(Z.$),{usernameRegister:i}=(0,l.wA)(Dt.H),{password:a,lengthValid:r,contentValid:s}=(0,l.Ph)(qa),d=(0,E.zy)(),{createAccount:c}=(0,de.L$)(d.state),p=Rt(),u=(0,L.useCallback)((()=>{c?i({password:a,region:p}):o({password:a,nextUrl:k.tH.signupCreateUsername})}),[o,a,c,i,p]),h=!a||!s||!r;return Me(),(0,n.jsxs)(kg,{LeftIcon:c?void 0:wu,onSubmit:u,title:e("sign_up"),children:[(0,n.jsx)(bs,{children:e("common_registration_password_title")}),(0,n.jsx)(Tr,{autoFocus:!0}),(0,n.jsx)(Pr,{disabled:h,loading:t,children:e("common_registration_email_input_button")})]})},oh=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),{usernameInfo:t,username:o}=(0,l.Ph)(Dt.H),[{loginLoading:i},{setAccount:a}]=(0,l.Su)(Z.$),r=(0,L.useCallback)((()=>{a({username:o})}),[a,o]);return Me(),(0,n.jsxs)(kg,{title:e("sign_up"),onSubmit:r,LeftIcon:wu,children:[(0,n.jsx)(bs,{children:e("common_registration_username_title")}),(0,n.jsx)(_s,{children:e("common_registration_username_text")}),(0,n.jsx)(uu,{}),(0,n.jsx)(Pr,{loading:i,disabled:!(null==t?void 0:t.isValid),children:e("common_notification_unlogged_button")}),(0,n.jsx)(Xg,{})]})})),nh=(0,L.memo)((function(){const{email:e=""}=(0,l.Ph)(Va.N),[{code:t},{sendEmailCodeForSignup:o}]=(0,l.Su)(Ja.m),[{errorMsg:i,signupLoading:a},{emailRegister:r}]=(0,l.Su)(Dt.H),s=(0,E.zy)(),{password:d}=s.state||{},c=Rt(),p=(0,L.useCallback)((()=>{o({email:e,region:c})}),[e,o,c]),u=(0,L.useCallback)((()=>{r({email:e,code:t,password:d,region:c})}),[t,r,e,d,c]);return Me(),(0,n.jsx)(Ls,{autoSendFirstTime:!0,codeFromNumber:e,onClickSendCode:p,onSubmit:u,loading:a,errorMsg:i,email:!0})})),ih=()=>{const e=(0,g.s)("WebApp_Login"),{password:t,lengthValid:o,contentValid:i}=(0,l.Ph)(qa),a=(0,E.W6)(),r=(0,L.useCallback)((()=>{a.push({pathname:k.tH.signupEmailDigit,state:{password:t}})}),[a,t]),s=!t||!i||!o;return Me(),(0,n.jsxs)(ar,{onSubmit:r,children:[(0,n.jsx)(bs,{children:e("common_registration_password_title")}),(0,n.jsx)(Tr,{autoFocus:!0}),(0,n.jsx)(Pr,{disabled:s,children:e("common_notification_unlogged_button")})]})},ah=(0,L.memo)((function(){const{setSuggestEmailSuffixConfig:e}=(0,l.wA)(Va.N),{emailSuffixConfig:t}=Be((()=>["emailSuffixConfig"]),[]),o=(0,L.useCallback)((t=>()=>{e(t)}),[e]),i=t.map((e=>`@${e}`));return(0,n.jsx)(Yg,{list:i,onSelect:o})})),rh=(0,L.memo)((function(){const e=(0,g.s)("WebApp_Login"),[{email:t="",emailErrorMsg:o,checkEmailLoading:i},{checkEmailRegistered:a}]=(0,l.Su)(Va.N),r=ir(),s=(0,L.useCallback)((()=>{a()}),[a]);return(0,n.jsxs)(ar,{onSubmit:s,children:[(0,n.jsx)(qd,{errorMsg:r}),(0,n.jsx)(_u,{show:!0,asText:!0}),(0,n.jsx)(Eu,{}),(0,n.jsx)(Pr,{loading:i,disabled:!t||Boolean(o),"data-e2e":"next-button",children:e("common_registration_email_input_button")}),(0,n.jsx)(ah,{})]})})),lh=(0,L.memo)((function(){var e;const t=(0,g.s)("WebApp_Login"),o=(0,E.W6)(),i=(0,E.W5)(`${k.tH.signupPhoneOrEmail}/:type`),a="email"===(null===(e=null==i?void 0:i.params)||void 0===e?void 0:e.type)?1:0,r=(0,L.useMemo)((()=>[{text:t("Phone")},{text:t("Email"),e2e:"email-tab"}]),[t]),l=(0,L.useCallback)((e=>()=>{0===e?o.replace(k.tH.signupPhone):o.replace(k.tH.signupEmail)}),[o]);return Me(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Sg,{tabs:r,currentTab:a,onSwitchTab:l}),0===a&&(0,n.jsx)(Tg,{}),1===a&&(0,n.jsx)(rh,{})]})})),sh=()=>{const e=(0,g.s)("WebApp_Login");return(0,n.jsxs)(kg,{title:e("sign_up"),children:[(0,n.jsx)(W,{path:k.tH.signupPhoneOrEmail,component:lh}),(0,n.jsx)(W,{path:k.tH.signupPhoneDigit,component:Cg,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupEmailDigit,component:nh,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupEmailCreatePassword,component:ih,exact:!0})]})},dh=(0,L.memo)((function(){return(0,n.jsx)(kg,{showRight:!1,children:(0,n.jsx)(Cp,{})})})),ch=(0,L.memo)((()=>{const e=(0,j.mZ)((e=>e.groupId)),{handlePopupHide:t,handlePopupShow:o}=(0,mc.H)();return md(e),Hc(),(0,se.rF)({pid:"signup"}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_d,{page:"signup"}),(0,n.jsxs)($,{children:[(0,n.jsx)(W,{path:k.tH.signupHome,component:Aa,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupPhoneOrEmail,component:sh}),(0,n.jsx)(W,{path:k.tH.signupPhoneDigit,component:sh,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupEmailDigit,component:sh,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupEmailCreatePassword,component:sh,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupCreatePassword,component:th,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupCreateUsername,component:oh,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupCreateAccount,component:eh,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupAgeGate,component:Kg,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupPolicyConfirm,component:dh,exact:!0}),(0,n.jsx)(W,{path:k.tH.signupCountrySelector,component:Ic,exact:!0}),(0,n.jsx)(W,{path:"*",component:Aa})]}),(0,n.jsx)(Bg,{}),(0,n.jsx)(Zc,{isMobile:!0}),(0,n.jsx)(xc.H,{hideByDefault:!0,onShow:o,onHide:t})]})})),ph=(0,Q.default)("div",{target:"e1apasj50"})({paddingTop:"150px",textAlign:"center"},"label:DivWrapper;"),uh=(0,Q.default)("p",{target:"e1apasj51"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{fontSize:"17px",lineHeight:"20px",marginTop:"20px"}]),"label:PTitleContainer;"),gh=(0,Q.default)("div",{target:"e1apasj52"})([({theme:e})=>(0,J.zy)({theme:e,color:"TextSecondary",fontFamily:"TikTokFont"}),{lineHeight:"17px",marginTop:"12px",textAlign:"center",fontSize:"14px"}],"label:DivContentWrapper;"),hh=(0,Q.default)("div",{target:"e1apasj53"})({position:"absolute",bottom:"32px",left:"32px",right:"32px"},"label:DivButtonWrapper;"),mh=()=>{const e=(0,g.s)("WebApp_Login"),t=(0,E.W6)(),o=(0,E.zy)(),i=(0,s.Nj)(C.$F),[{inCancellationResponse:a},{cancelDeleteAccount:r}]=(0,l.Su)(Z.$);(0,L.useEffect)((()=>{var e;(null===(e=o.state)||void 0===e?void 0:e.init)||t.replace(k.tH.loginHome)}),[o,t]);const d=(0,L.useCallback)((()=>{r();const e=(null==a?void 0:a.apply_time)?Math.floor((Date.now()-1e3*a.apply_time)/24/60/60/1e3):null;i.reactiveConfirmClick({is_delete:(null==a?void 0:a.isStopAccount)?0:1,num_days_reactive:e})}),[r,null==a?void 0:a.apply_time,null==a?void 0:a.isStopAccount,i]),c=(0,L.useCallback)((()=>{t.push(k.tH.loginHome);const e=(null==a?void 0:a.apply_time)?Math.floor((Date.now()-1e3*a.apply_time)/24/60/60/1e3):null;i.reactiveCancelClick({is_delete:(null==a?void 0:a.isStopAccount)?0:1,num_days_reactive:e})}),[t,null==a?void 0:a.apply_time,null==a?void 0:a.isStopAccount,i]);return(0,n.jsx)(kg,{showLeft:!1,showRight:!1,children:(0,n.jsxs)(ph,{children:[(0,n.jsx)(hg,{fill:"rgba(22, 24, 35, 0.45)"}),(0,n.jsx)(uh,{children:e("reactivate_h1")}),(0,n.jsx)(gh,{children:e("logback_reactivate_desc")}),(0,n.jsxs)(hh,{children:[(0,n.jsx)(Pr,{onClick:d,children:e("reactivate_btn")}),(0,n.jsx)(Pr,{buttonTheme:"default",onClick:c,style:{marginTop:"16px"},children:e("common_registration_phone_input_popup_button")})]})]})})};function xh(){return(0,L.useEffect)((()=>{location.reload()}),[]),null}const fh=()=>{const{language:e}=(0,de.L$)((0,ue.W)((()=>["language"]),[])),t="ar"===e||"ur"===e||"he-IL"===e;return function(){var e;const{ttNotInstalled:t,ttNotInstalledToastShown:o}=Be((()=>["ttNotInstalled","ttNotInstalledToastShown"]),[]),{setContext:n}=(0,l.wA)(Oe.t),{abTestVersion:i}=(0,de.L$)((0,ue.W)((()=>["abTestVersion"]),[])),a=null!==(e=(0,he.qt)(i,"one_tap_ios_deep_link"))&&void 0!==e?e:"v0",r=dn(),s=(()=>{const e=(0,E.W6)();return(0,L.useCallback)((t=>{const o=e.location,n=new URLSearchParams(o.search);t(n);const i=n.toString();e.replace({pathname:o.pathname,search:i})}),[e])})();(0,L.useEffect)((()=>{t&&!o&&(n({ttNotInstalledToastShown:!0}),r(),s((e=>{e.delete("tt_not_installed")})),"v2"===a?localStorage.setItem(en,"1"):"v3"===a&&sessionStorage.setItem(en,"1"))}),[])}(),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(fd.mg,{children:[(0,n.jsx)("link",{rel:"stylesheet",href:dg}),(0,n.jsx)("link",{rel:"stylesheet",href:cg})]}),(0,n.jsx)(A.mL,{styles:K(t)}),(0,n.jsx)(W,{path:k.tH.loginHome,component:Wg}),(0,n.jsx)(W,{path:k.tH.signupHome,component:ch}),(0,n.jsx)(W,{path:k.tH.accountDeactivate,component:mh}),(0,n.jsx)(W,{path:"/coin",component:xh}),(0,n.jsx)(_g,{})]})};var bh=o(52401);const _h=(0,Q.default)("div",{target:"e1lgi0990"})({display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},"label:DivOauthBodyContainer;"),yh=(0,L.memo)((function(){const{user:e,language:t,env:o}=(0,de.L$)((0,ue.W)((()=>["user","language","env"]),[])),{redirectUrl:i,aid:a}=(0,l.Ph)(Oe.t),r=(0,s.Nj)(Te.le);return(0,L.useEffect)((()=>{const n=b.BL.getTrackingInfo(),l=e?Object.assign({status:0,error_code:0},n):Object.assign({status:1,error_code:-1,error_desc:"no account info"},n);bh.z.logout(l),r.logout(l);const s=encodeURIComponent((0,Je.M3)(t,"boe"===(null==o?void 0:o.type),i));location.href=`https://${location.host}/passport/web/logout/?aid=${a}&account_sdk_source=web&next=${s}&`}),[i,a,t,e,o,r]),(0,n.jsx)(_h,{children:(0,n.jsx)(G.R,{})})})),vh=(0,Q.default)("div",{target:"e10jupx40"})({display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},"label:DivOauthBodyContainer;"),kh=(0,L.memo)((function(){const{search:e}=(0,E.zy)(),{oauth_token:t,oauth_verifier:o,error:i,oauthType:a,state:r}=(0,ye.parse)(e),d=(0,s.Nj)(C.$F),c=(0,s.Nj)(Te.VU),{authPageGoRedirect:p}=(0,l.wA)(Fi);return(0,L.useEffect)((()=>{xi(null==a?void 0:a.toString()),c.handleThirdGetToken({error_code:t&&o?0:-1,error_message:String(i)}),t&&o?(di("twitter",{oauth_token:t.toString(),oauth_verifier:o.toString()}),window.parent?window.authDoneClose=!0:p({platform:"line",state:r})):d.thirdPartyLoginResult({status:1,error_code:-1,error_desc:null==i?void 0:i.toString()})}),[i,d,t,o,c,a,p]),(0,n.jsx)(vh,{children:(0,n.jsx)(G.R,{})})})),Ch=()=>{const{search:e}=(0,E.zy)(),{code:t,error:o,state:i}=(0,ye.parse)(e),a=(0,s.Nj)(C.$F),r=(0,s.Nj)(Te.VU),{authPageGoRedirect:d}=(0,l.wA)(Fi);return(0,L.useEffect)((()=>{xi(),r.handleThirdGetToken({error_code:t?0:-1,error_message:String(o)}),t?(di("line",{code:null==t?void 0:t.toString()}),window.opener?window.authDoneClose=!0:d({platform:"line",state:i})):a.thirdPartyLoginResult({status:1,error_code:-1,error_desc:String(o)})}),[t,o,a,r,d]),(0,n.jsx)(vh,{children:(0,n.jsx)(G.R,{})})};var jh=o(56578),wh=o(5441),Sh=o(84738);const Th={id:"icon-ee6a017a",use:"icon-ee6a017a-usage",viewBox:"0 0 50 50",content:''};function Lh(e){const t=(0,L.useContext)(Fe.X);return(0,L.useLayoutEffect)((()=>(t.add(Th),()=>{t.remove("icon-ee6a017a")})),[]),(0,n.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,n.jsx)("use",{xlinkHref:"#icon-ee6a017a"},void 0)}),void 0)}const Ph=(0,Q.default)("div",{target:"e6r3pim0"})((({theme:e})=>({margin:e.isMobile?"30px 32px 0":"80px auto 0",maxWidth:"400px"})),"label:DivContainer;"),Mh=(0,Q.default)("div",{target:"e6r3pim1"})((({theme:e})=>({width:"80px",height:"80px",fontSize:"50px",margin:"24px auto",border:`1px solid ${e.colors.LineSecondary}`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"})),"label:DivIcon;"),Ah=(0,Q.default)("div",{target:"e6r3pim2"})((({theme:e})=>[(0,J.zy)({theme:e,fontWeight:"bold",fontFamily:"TikTokDisplayFont"}),{textAlign:"center",fontSize:"24px",lineHeight:"28px",marginBottom:"24px"}]),"label:DivTitle;"),Eh=(0,Q.default)("div",{target:"e6r3pim3"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextSecondary"}),{fontSize:"16px",textAlign:"center",lineHeight:"22px",marginBottom:"12px"}]),"label:DivDescription;"),Fh=(0,Q.default)("span",{target:"e6r3pim4"})((({theme:e})=>[{fontSize:"16px",lineHeight:"22px",color:e.colors.Primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold"}]),"label:SpanLinkText;"),Ih=()=>{const e=(0,g.s)("WebApp_Login"),{handlePrivateConfirm:t}=(0,l.wA)(jh.S),{isElectronApp:o}=(0,wh.B)(),i=(0,L.useCallback)((()=>{t(),Sh.I.privateNotifyClick({result:"ok"})}),[t]),a=(0,L.useCallback)((()=>{Sh.I.privateNotifyClick({result:"learn_more"})}),[]);return(0,L.useEffect)((()=>{Sh.I.privateNotifyShow()}),[]),Me(),(0,n.jsxs)(Ph,{children:[(0,n.jsx)(Mh,{children:(0,n.jsx)(Lh,{})}),(0,n.jsx)(Ah,{children:e("title_private_on")}),(0,n.jsx)(Eh,{children:e("descrip_private_on_signup")}),(0,n.jsx)(Bt,{isJumpOutside:!0,underline:!1,target:o?"_blank":void 0,path:"https://support.tiktok.com/en/account-and-privacy/account-privacy-settings/making-your-account-public-or-private",children:(0,n.jsxs)(Fh,{onClick:a,children:[e("link_learn_more_private_accounts_signup")," >"]})}),(0,n.jsx)(Pr,{onClick:i,bottonTheme:"text",children:e("button_signup_private_on")})]})};var Hh=o(54378),zh=o(56879);const Dh=e=>{b.nf.setUpLoginSuccessE2ETracking(),location.href=e},Rh=(0,L.createContext)(null),Oh=(Rh.Provider,()=>{var e;const t=(()=>{const e=(0,j.mZ)((e=>e.isRedirectToProfilePage)),{language:t,env:o}=(0,de.L$)((0,ue.W)((()=>["language","env"]),[]));return(0,L.useCallback)((({showLoginSuccessToast:n,showOneTapSuccessPopup:i,isShowOneTapSuccessPopup:a,relatedPromises:r,delay1sPromise:l,defaultRedirect:s,url:d})=>{a||n();const c=e=>(0,F.__awaiter)(void 0,void 0,void 0,(function*(){if(a)return i(e);yield Promise.all([...r,l]).catch(T()),s(e)}));if(!e)return c(d);(0,F.__awaiter)(void 0,void 0,void 0,(function*(){var e;const t=yield fetch((0,ye.stringifyUrl)({url:"/node-webapp/api/common-app-context"})),o=yield t.json();return null===(e=null==o?void 0:o.user)||void 0===e?void 0:e.uniqueId})).then((e=>{const n=(0,Je.M3)(t,"boe"===(null==o?void 0:o.type),`${xd.C}/@${e}`);c(n)})).catch((e=>{console.error(`Error Occur when fetching user uniqueId and about to redirect to profile page: ${e}`)}))}),[e,t,o])})(),{handler:o}=null!==(e=(0,L.useContext)(Rh))&&void 0!==e?e:{};return null!=o?o:t});var Wh=o(83062);const Bh=(0,Q.default)("div",{target:"ermvtw20"})((({theme:e})=>({background:e.colors.BGPrimary,borderRadius:"8px",maxWidth:e.isMobile?"300px":"400px",padding:"0px 32px 32px",textAlign:"center"})),"label:DivContainer;"),$h=(0,Q.default)("h5",{target:"ermvtw21"})((({theme:e})=>[(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont",fontWeight:"bold"}),{fontSize:"20px",lineHeight:"24px"}]),"label:H5Title;"),Uh=(0,Q.default)("p",{target:"ermvtw22"})([({theme:e})=>(0,J.zy)({theme:e,color:"TextPrimary",fontFamily:"TikTokFont"}),{lineHeight:"20px",margin:"24px 0",textAlign:"center"}],"label:PDesc;"),Nh=e=>{const t=(0,g.s)("WebApp_Login"),{title:o,text:i,buttonText:a,visible:r,supportText:l}=e,{language:s}=(0,de.L$)((0,ue.W)((()=>["language"]),[])),d={marginTop:"16px"};return(0,n.jsx)(y.aF,{visible:r,maskCloseable:!1,onClose:e.onClose,children:(0,n.jsxs)(Bh,{children:[o&&(0,n.jsx)($h,{children:t(o)}),(0,n.jsx)(Uh,{children:t(i)}),l&&(0,n.jsx)("a",{href:`https://support.tiktok.com?lang=${s}`,target:"_blank",rel:"noopener noreferrer",children:(0,n.jsx)(Pr,{style:d,children:t(null!=a?a:"twosv_recover_pw_popup_btn")})}),(0,n.jsx)(Pr,{buttonTheme:"default",onClick:e.onClose,style:d,children:t(null!=a?a:"OK")})]})})},Vh={inexistent:{title:"age_verify_login_inexistent",subTitle:"age_verify_login_inexistent_intro"},ineligible:{title:"age_verify_login_ineligible",subTitle:"age_verify_login_ineligible_intro"},twoStepVerifyBlock:{title:"twosv_login_sms_block_title",subTitle:"twosv_login_sms_block_content"},TwoStepBlockResetPwd:{title:"twosv_recover_pw_popup_title",subTitle:"twosv_recover_pw_popup_desc",supportText:"twosv_recover_pw_popup_btn"}},Gh=()=>{var e;const t=(0,E.W6)(),[{showAlertMessageType:o},{setShowAlertMessageType:i}]=(0,l.Su)(Oe.t),a=null===(e=(0,E.W5)(k.tH.loginHome))||void 0===e?void 0:e.isExact,r=(0,L.useCallback)((()=>{var e;i("");const{message:o}=(0,ye.parse)(window.location.search),n=new RegExp(`&?message=${o}`);t.replace({pathname:k.tH.loginHome,search:null===(e=window.location)||void 0===e?void 0:e.search.replace(n,"")})}),[t,i]);return(0,L.useEffect)((()=>{o&&!a&&t.push(k.tH.loginHome)}),[o,t,a]),o?(0,n.jsx)(Nh,{supportText:Vh[o].supportText,visible:Boolean(o),title:Vh[o].title,text:Vh[o].subTitle,onClose:r}):null},qh=(0,Q.default)("div",{target:"e1xbfihi0"})({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%",padding:"24px 20px 6px"},"label:DivLinkPhoneOrEmailContainer;"),Kh={wordWrap:"break-word"},Zh=(0,Q.default)("div",{target:"e1xbfihi1"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"bold",fontStyle:"normal"}),Object.assign({fontSize:20,lineHeight:"25px"},Kh)]),"label:DivLinkPhoneOrEmailTitleContainer;"),Qh=(0,Q.default)("div",{target:"e1xbfihi2"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",fontStyle:"normal"}),Object.assign({color:e.colors.TextTertiaryAlt,fontSize:15,lineHeight:"19.5px",marginTop:"12px",marginBottom:"20px",letterSpacing:"0.061px"},Kh)]),"label:DivLinkPhoneOrEmailDescContainer;"),Jh=(0,Q.default)(Y.y,{target:"e1xbfihi3"})({width:"100%",height:"48px",lineHeight:"21px",padding:"8px 14px",borderRadius:"8px",marginBottom:"1px"},"label:StyledLinkButton;"),Yh=(0,Q.default)("div",{target:"e1xbfihi4"})((({isMobile:e})=>({display:"flex",flexDirection:"column",justifyContent:e?"start":"center",alignItems:"center",height:"100%",padding:e?"30px":"48px",textAlign:e?"start":"center"})),"label:DivLinkPhoneContainer;"),Xh=(0,Q.default)("div",{target:"e1xbfihi5"})({height:"100%",padding:"48px"},"label:DivMobileDigitCodeContainer;"),em=(0,Q.default)("div",{target:"e1xbfihi6"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",fontWeight:"bold",fontStyle:"normal"}),Object.assign({fontSize:24,lineHeight:"30px"},Kh)]),"label:DivLinkPhoneTitle;"),tm=(0,Q.default)("div",{target:"e1xbfihi7"})((({theme:e,isMobile:t=!1})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont"}),Object.assign({marginTop:t?"8px":"67px",display:"inline-flex",justifyContent:"center",alignItems:"center",fontSize:"16px",lineHeight:"20.8px",fontWeight:"400"},Kh)]),"label:DivBottomTextContainer;"),om=(0,Q.default)(Bt,{target:"e1xbfihi8"})((({theme:e})=>[(0,J.mp)({direction:e.direction,marginStart:"5px"}),{fontWeight:500,fontSize:"16px",lineHeight:"20.8px",display:"inline-block",":visited":{color:e.colors.Primary}}]),"label:StyledBottomLinkText;"),nm=()=>{const e=(0,g.s)(),{isMobile:t}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{mobile:o,phoneErrorMsg:i}=(0,l.Ph)(Qa.U),[{sendCodeLoading:a,code:r,codeFormatError:s},{sendPhoneCodeForBindAccount:d}]=(0,l.Su)(Ja.m),[{bindPhoneLoading:p},{checkAndBindPhone:u}]=(0,l.Su)(Za),h=nr(),m=o&&r&&!i&&!s,x=(0,L.useCallback)((()=>{if(t){const e=k.tH.linkPhoneDigit;d({mobile:o,nextUrl:e})}else d({mobile:o})}),[t,o,d]),f=(0,L.useCallback)((()=>{u({mobile:o,code:r})}),[o,r,u]),b=(0,L.useMemo)((()=>{var e;return!(null===(e=(0,ye.parse)(location.search))||void 0===e?void 0:e.hide_left_icon)}),[location]);(0,L.useEffect)((()=>{Ka._.clickLinkPhoneNumber()}),[]);const _=(0,L.useMemo)((()=>({maxWidth:"100%",minWidth:t?"unset":"376px"})),[t]);return(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(at,{showLeft:b}),(0,n.jsx)(Yh,{isMobile:t,children:(0,n.jsxs)(ar,{style:_,children:[(0,n.jsx)(em,{children:e("login_fb_noLonger_LinkPhoneReminder")}),(0,n.jsx)(Qh,{children:e("login_fb_noLonger_LoginWithPhoneNextTime")}),t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Bl,{}),(0,n.jsx)(Pr,{disabled:Boolean(i)||!o,loading:a,onClick:x,children:e("login_fb_noLonger_phone_send_cta")}),(0,n.jsxs)(tm,{children:[(0,n.jsx)("div",{children:e("login_fb_noLonger_can'tVerifyPhone")}),(0,n.jsx)(om,{path:k.tH.linkEmail,text:e("login_fb_noLonger_can'tVerifyPhone_useEmail"),textTheme:"primary"})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Sl,{}),(0,n.jsx)(fs,{disabled:Boolean(i)||!o,codeFromNumber:o,loading:a,errorMsg:h,onClickSendCode:x}),(0,n.jsxs)(tm,{children:[(0,n.jsx)("div",{children:e("login_fb_noLonger_can'tVerifyPhone")}),(0,n.jsx)(om,{path:k.tH.linkEmail,text:e("login_fb_noLonger_can'tVerifyPhone_useEmail"),textTheme:"primary"})]}),(0,n.jsx)(Pr,{disabled:!m,loading:p,onClick:f,children:e("login_fb_link_cta")})]})]})})]})},im=()=>{const e=(0,g.s)(),{isMobile:t}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[])),{colors:o}=(0,r.u)(),{emailErrorMsg:i,email:a=""}=(0,l.Ph)(Va.N),[{sendCodeLoading:s,code:d,codeFormatError:p},{sendEmailCodeForBindAccount:u}]=(0,l.Su)(Ja.m),h=nr(),[{bindEmailLoading:m},{checkAndBindEmail:x}]=(0,l.Su)(Za),f=(0,L.useCallback)((()=>{if(t){const e=k.tH.linkEmailDigit;u({email:a,nextUrl:e})}else u({email:a})}),[t,a,u]),b=(0,L.useCallback)((()=>{x({email:a,code:d})}),[a,d,x]),_=(0,L.useCallback)((()=>{Ka._.ClickFeedback()}),[Ka._]),y=(0,L.useMemo)((()=>{var e;return!(null===(e=(0,ye.parse)(location.search))||void 0===e?void 0:e.hide_left_icon)}),[location]),v=!a||!d||Boolean(p)||Boolean(i);(0,L.useEffect)((()=>{Ka._.clickLinkEmail()}),[]);const C=(0,L.useMemo)((()=>({maxWidth:"100%",minWidth:t?"unset":"376px"})),[t]);return(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(at,{showLeft:y}),(0,n.jsx)(Yh,{isMobile:t,children:(0,n.jsxs)(ar,{style:C,children:[(0,n.jsx)(em,{children:e("login_fb_noLonger_LinkEmailAddress")}),(0,n.jsxs)(Qh,{children:[e("login_fb_noLonger_EmailLoginAlternative")," ",(0,n.jsx)("a",{style:{color:o.TextPrimary},target:"_blank",href:"https://www.tiktok.com/feedback",onClick:_,rel:"noopener noreferrer",children:e("login_fb_noLonger_GiveFeedback")})]}),t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(qd,{errorMsg:i}),(0,n.jsx)(Pr,{disabled:Boolean(i)||!a,loading:s,onClick:f,children:e("login_fb_noLonger_phone_send_cta")}),(0,n.jsxs)(tm,{isMobile:t,children:[(0,n.jsx)("div",{children:e("login_fb_noLonger_can'tVerifyEmail")}),(0,n.jsx)(om,{path:k.tH.linkPhone,text:e("login_fb_noLonger_can'tVerifyEmail_usePhone"),textTheme:"primary"})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(qd,{}),(0,n.jsx)(fs,{email:!0,disabled:Boolean(i)||!a,codeFromNumber:a,loading:s,onClickSendCode:f,errorMsg:h}),(0,n.jsxs)(tm,{isMobile:t,children:[(0,n.jsx)("div",{children:e("login_fb_noLonger_can'tVerifyEmail")}),(0,n.jsx)(om,{path:k.tH.linkPhone,text:e("login_fb_noLonger_can'tVerifyEmail_usePhone"),textTheme:"primary"})]}),(0,n.jsx)(Pr,{disabled:v,loading:m,onClick:b,children:e("login_fb_link_cta")})]})]})})]})},am=()=>{const{setLoginModalShow:e,setIsLinkPhoneOrEmail:t,setIsLoginOnLoadClosed:o}=(0,j.b1)(),{isModal:i}=(0,l.Ph)(Oe.t),a=(0,E.W6)(),{search:s}=(0,E.zy)(),{colors:d}=(0,r.u)(),c=(0,g.s)(),p=(0,L.useCallback)((()=>{a.push({pathname:k.tH.linkPhone,search:i?s:""}),t(!1)}),[a,i,s,t]),u=(0,L.useCallback)((()=>{e(!1),o({isLoginOnLoadClosed:!0})}),[e]);return(0,n.jsxs)(qh,{children:[(0,n.jsx)(Zh,{children:c("login_fb_noLonger_LinkPhoneNumber")}),(0,n.jsx)(Qh,{children:c("login_fb_noLonger_LinkPhoneNumberReminder")}),(0,n.jsx)(Jh,{size:"medium",buttonTheme:"primary",onClick:p,children:c("login_fb_noLonger_LinkPhone")}),(0,n.jsx)(Jh,{size:"medium",buttonTheme:"default",style:{border:"none",fontWeight:"400",fontSize:"16px",color:d.TextTertiaryAlt},onClick:u,children:c("login_fb_noLonger_notNow_cta")})]})},rm=(0,L.memo)((function(){const{mobile:e}=(0,l.Ph)(Qa.U),[{code:t},{sendPhoneCodeForBindAccount:o}]=(0,l.Su)(Ja.m),[{bindPhoneLoading:i,errorMsg:a},{checkAndBindPhone:r,setErrorMsg:s}]=(0,l.Su)(Za);(0,L.useEffect)((()=>{s("")}),[t,s]);const d=(0,L.useCallback)((()=>{o({mobile:e})}),[e,o]),c=(0,L.useCallback)((()=>{r({mobile:e,code:t})}),[e,t,r]),p=(0,L.useMemo)((()=>{var e;return!(null===(e=(0,ye.parse)(location.search))||void 0===e?void 0:e.hide_left_icon)}),[location]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(at,{showLeft:p}),(0,n.jsx)(Xh,{children:(0,n.jsx)(Ls,{codeFromNumber:e,onClickSendCode:d,onSubmit:c,loading:i,errorMsg:a})})]})})),lm=(0,L.memo)((function(){const{email:e=""}=(0,l.Ph)(Va.N),[{code:t},{sendEmailCodeForBindAccount:o}]=(0,l.Su)(Ja.m),[{bindEmailLoading:i,errorMsg:a},{checkAndBindEmail:r,setErrorMsg:s}]=(0,l.Su)(Za);(0,L.useEffect)((()=>{s("")}),[t,s]);const d=(0,L.useCallback)((()=>{o({email:e})}),[e,o]),c=(0,L.useCallback)((()=>{r({email:e,code:t})}),[e,t,r]),p=(0,L.useMemo)((()=>{var e;return!(null===(e=(0,ye.parse)(location.search))||void 0===e?void 0:e.hide_left_icon)}),[location]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(at,{showLeft:p}),(0,n.jsx)(Xh,{children:(0,n.jsx)(Ls,{codeFromNumber:e,onClickSendCode:d,onSubmit:c,loading:i,errorMsg:a,email:!0})})]})})),sm=(0,L.memo)((()=>{const e=(0,ue.W)((()=>["user"]),[]),{isMobile:t}=(0,de.L$)((0,c.U)((()=>["isMobile"]),[]));return(0,h.ZO)()?(null==e?void 0:e.user)?(0,n.jsxs)($,{children:[(0,n.jsx)(W,{path:k.tH.linkPhoneOrEmail,component:am,exact:!0}),(0,n.jsx)(W,{path:k.tH.linkPhone,component:nm,exact:!0}),(0,n.jsx)(W,{path:k.tH.linkEmail,component:im,exact:!0}),t&&(0,n.jsx)(W,{path:k.tH.linkPhoneDigit,component:rm,exact:!0}),t&&(0,n.jsx)(W,{path:k.tH.linkEmailDigit,component:lm,exact:!0})]}):(0,n.jsx)(I.rd,{to:k.tH.loginHome}):(0,n.jsx)(I.rd,{to:"https://www.tiktok.com/foryou"})})),dm=(0,L.memo)((function({onRouteChange:e=T(),isLoginPage:t=!0,loadingUi:o}){var i,a,u,h,m;const x=(0,d.Us)(),f=(0,c.y)(),_=$e();((e,t,o)=>{const n=(0,E.zy)(),{loginModalShow:i,url:a}=(0,j.mZ)((e=>({loginModalShow:e.loginModalShow,url:e.url})),M.bN),{loginType:r}=Be((()=>["loginType"]),[]);gd.initialized||(gd.init(i?a.split("?")[1]:n.search),gd.setDevicePlatform(o)),(0,sd.tF)((()=>Object.assign(Object.assign({page_name:e,login_type:r},gd.eventCommonParams),{skip_init:!t,initConfig:{enable_ios_sendbeacon:!0}})),[r,e,gd.eventCommonParams.enter_method,t]),(0,L.useEffect)((()=>{r&&t&&dd.O.handlePageView({})}),[r,t])})(null!==(i=null==_?void 0:_.pageName)&&void 0!==i?i:"login",t,Boolean(null===(a=f.bizContext)||void 0===a?void 0:a.isMobile));const y=(0,g.Y)(["WebApp_Login"]),v=(0,s.Nj)(Uo.r),C=(0,s.Nj)(Hh.d),w=null===(u=(0,E.W5)(k.tH.loginHome))||void 0===u?void 0:u.isExact;!function(){const{twoStepResponse:e}=(0,l.Ph)(Z.$),[{type:t},{setTwoStepVerifyRes:o,setTwoStepType:n}]=(0,l.Su)(tr),{setRedirectNewModalPage:i}=(0,s.Nj)(Wa.q),a=(0,E.W6)(),{pathname:r}=(0,E.zy)();(0,L.useEffect)((()=>{e&&o(e)}),[e,o]),(0,L.useEffect)((()=>{if(t){const e=`/login/2sv/${Xa[t]}`;if(e!==r){if(r===k.tH.loginSSO)return i(e);a.push(e)}}}),[t,e]),(0,L.useEffect)((()=>()=>{n(void 0)}),[])}(),function(){var e;const{isRegisterWithPrivateOn:t}=(0,l.Ph)(jh.S),{success:o}=(0,l.Ph)(Z.$),{redirectUrl:n,lastSuccessPlatform:i}=(0,l.Ph)(Oe.t),{success:a}=(0,l.Ph)(Dt.H),{success:r}=(0,l.Ph)(Za),{language:d,env:p,abTestVersion:u}=(0,de.L$)((0,ue.W)((()=>["language","env","abTestVersion"]),[])),{isMobile:h=!1}=null!==(e=(0,c.U)((()=>["isMobile"]),[]))&&void 0!==e?e:{},{updateState:m}=(0,l.wA)(an),{pathname:x}=(0,E.zy)(),{isAndroid:f}=(0,de.L$)((0,c.U)((()=>["isAndroid"]),[])),_=(0,g.s)("WebApp_Login"),y=(0,E.W6)(),v=(0,s.Nj)(Uo.r),C=Oh();(0,L.useEffect)((()=>{r&&(h?setTimeout((()=>{location.href=`https://www.tiktok.com/foryou?lang=${d}`}),1e3):setTimeout((()=>{window.location.reload()}),3e3))}),[r,h]),(0,L.useEffect)((()=>{var e;if(!o&&!a)return;if(t)return y.push(k.tH.signupPrivateOn);const r=(0,zh.cb)(1e3),l=Ko(),s=Zo.includes(l)&&"tiktok"===i&&!!f&&x===k.tH.loginHome,c=(0,Je.M3)(d,"boe"===(null==p?void 0:p.type),n),g=new URL(c),h=`${g.pathname}${g.search}`,j=b.nf.getLoginSuccessE2ETrackingProps(),w="v1"===(null===(e=null==u?void 0:u.parameters.login_itp_resolve)||void 0===e?void 0:e.vid)?[v.refreshSessionPromise]:[];C({defaultRedirect:Dh,url:c,nonOriginUrl:h,trackingProps:j,relatedPromises:w,delay1sPromise:r,showLoginSuccessToast:({duration:e}={})=>{const t=_(2===o?"reactivate_toast":"Login Success");(0,ln.P)(t,e)},showOneTapSuccessPopup:(e=c)=>m({isLoginSuccessPopupVisible:!0,successPopupRedirectUrl:e}),isShowOneTapSuccessPopup:s})}),[d,_,n,a,o,t,y,p,i,C])}(),function(){const e=(0,s.Nj)(Ei);(0,L.useEffect)((()=>{e.loadSdk()}),[e])}(),function(){var e;const{user:t,language:o,env:n,abTestVersion:i}=(0,de.L$)((0,ue.W)((()=>["user","language","env","abTestVersion"]),[])),{redirectUrl:a,initialized:r,isSecurityVerification:s,ignoreLoggedInCheck:d}=(0,l.Ph)(Oe.t),c=(0,g.s)("WebApp_Login"),p=(0,sn.SL)(),u=null!==(e=(0,he.qt)(i,"webapp_switch_account"))&&void 0!==e?e:"v1",h=[k.tH.oauth,k.tH.oauthLine,k.tH.logout,k.tH.linkPhoneOrEmail],m=(0,E.W5)(h)||s||d;(0,L.useEffect)((()=>{t&&!m&&r&&"v1"===u&&((0,ln.P)(c("You are logged in, no need to repeat")),p({platform:"repeatLogin",signUp:!1}),(0,Je.ik)(o,"boe"===(null==n?void 0:n.type),a))}),[a,r,n,u,t,m,o])}(),nr(),function(){const e=(0,s.Nj)(zt.D),t=(0,E.W6)();if(!t)throw new Error("History not found!.");(0,L.useEffect)((()=>{e.init(t)}),[t,e])}(),function(){const{hideHomePage:e}=Be((()=>["hideHomePage"]),[]),t=(0,E.W6)();(0,L.useEffect)((()=>{e&&t.replace(k.tH.loginPhoneOrEmail)}),[e,t])}();const{modalType:S,url:P}=(0,j.mZ)((e=>({modalType:e.modalType,url:e.url})),M.bN),[,{setInitializedTTPConfig:F}]=(0,l.Su)(Dt.H),[{initialized:I,ttpConfig:H,phoenix:z,hideHomePage:D,previousModalType:R,targetAid:O,standaloneAid:B},{init:K}]=(0,l.Su)(Oe.t),[{initial:Q},{getComplianceSettings:J}]=(0,l.Su)(N.T),Y=S!==R;(0,L.useEffect)((()=>{var e,t,o;x.appContext&&v.setContext(x.appContext,{phoenix:z,targetAid:O,standaloneAid:B}),x.appContext&&(null===(t=null===(e=window.byted_acrawler)||void 0===e?void 0:e.setUserMode)||void 0===t||t.call(e,(0,Wh.W)("TTP"===(null===(o=x.appContext)||void 0===o?void 0:o.clusterRegion))))}),[x.appContext,v,z]),(0,L.useEffect)((()=>{var e;H&&(C.setInitConfig({isSG:1180===(null===(e=x.appContext)||void 0===e?void 0:e.appId),ttpConfig:H,phoenix:z}),F())}),[null===(h=x.appContext)||void 0===h?void 0:h.appId,H,z,C]),(0,L.useEffect)((()=>{(!I||Y||P)&&K(),!Q&&J()}),[P]);const{pathname:X}=(0,E.zy)();(0,L.useEffect)((()=>{qr.indexOf(X)>-1&&(null==e||e())}),[X,e]);const ee=(()=>{const e=(0,r.u)().colors.Negative;return A.AH` *[role='button'], *[role='link'], *[role='switch'], *[tabindex], button[aria-label], button[aria-labelledby], button[aria-pressed], button[aria-expanded], button[role='tab'], a[aria-label] { &:focus { outline: none; } &:focus-visible { outline: 2px solid ${e}; } } , *[role='button'], button[aria-label], button[aria-labelledby], button[aria-pressed], button[aria-expanded] { &:focus-visible { outline-offset: 1px; } } , li[role='option'] { &:focus-visible { outline-style: auto; } } `})(),te=(()=>{const{pathname:e}=(0,E.zy)(),t=(0,L.useRef)(null);return t.current||(t.current=Pe(e)),t.current})();return!y||!I||D&&w||Y?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(A.mL,{styles:q}),o||(0,n.jsx)(G.R,{center:!0,style:{margin:"auto"}})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(A.mL,{styles:ee}),(0,n.jsx)("link",{rel:"stylesheet",href:U}),(0,n.jsxs)($,{children:[(0,n.jsx)(W,{path:k.tH.logout,component:yh}),(0,n.jsx)(W,{path:k.tH.oauth,component:kh}),(0,n.jsx)(W,{path:k.tH.oauthLine,component:Ch}),(0,n.jsx)(W,{path:k.tH.signupPrivateOn,component:Ih,exact:!0}),(0,n.jsx)(W,{path:k.tH.linkPhoneOrEmail,component:sm}),(null===(m=f.bizContext)||void 0===m?void 0:m.isMobile)?(0,n.jsx)(fh,{}):(0,n.jsx)(sg,{})]}),(0,n.jsx)(V.p,{appContext:x.appContext,bizContext:f.bizContext,slardarBid:p.yH,initialPid:te}),(0,n.jsx)(Gh,{})]})})),cm=(0,Q.default)("div",{target:"elnl1sy0"})((({theme:e})=>[(0,J.zy)({theme:e,fontFamily:"TikTokFont",color:"TextPrimary"}),{height:"84px",borderTop:`1px solid ${e.colors.LineSecondary}`,display:"flex",justifyContent:"flex-end",paddingInlineEnd:"24px",alignItems:"center",fontSize:"15px",lineHeight:"18px"},e.isMobile&&(0,J.jJ)({min:Ne.aU,style:{height:"84px !important",fontSize:"28px",lineHeight:"44px"}})]),"label:DivContainer;"),pm=({goBack:e,shouldShowBackButton:t})=>{const o=(0,g.s)("WebApp_Login"),[{region:a,userSelectedRegion:r},{setNewUserRegion:s}]=(0,l.Su)(Dt.H),d=(0,L.useCallback)((()=>{r&&(null==r?void 0:r.countryCode)!==(null==a?void 0:a.countryCode)&&s(r),e()}),[a,r]);return(0,n.jsxs)(cm,{children:[t&&(0,n.jsx)(i.I0,{onClick:e,label:o("common_login_back"),variant:"primary",marginInlineEnd:"16px"}),(0,n.jsx)(i.I0,{onClick:d,label:o("regionOption_selectCountry_list_confirmation"),variant:"primary"})]})},um={margin:"auto",position:"relative",overflow:"hidden",display:"flex"},gm=()=>{const{appContext:e}=(0,d.Us)(),{bizContext:t}=(0,c.y)(),o=(0,E.W6)();return(0,L.useEffect)((()=>(Te.Mh.start({appContext:e,bizContext:t,bid:p.yH,initLocation:o.location,extractPid:Pe}),o.listen((e=>Te.Mh.handleLocationChange(e))))),[e,t,o]),null},hm={transform:"scale(1.7)"},mm={transform:"scale(1.2)"},xm=Object.assign(Object.assign({},hm),{marginTop:"8px",marginInlineEnd:"8px"}),fm=(0,L.memo)((function({parentRef:e}){var t;const[o,{setLoginModalShow:d,setCloseCallback:c,setGroupId:p,setIsLoginOnLoadClosed:S}]=(0,j.MR)((e=>({loginModalShow:e.loginModalShow,url:e.url,closeable:e.closeable,closeCallback:e.closeCallback,modalImage:e.modalImage,isGuestMode:e.isGuestMode,isGuestModeUI:e.isGuestModeUI,popupType:e.popupType})),M.bN),[,{setShowFlashingButton:A}]=(0,l.Su)(Oe.t),[{loginLoading:E}]=(0,l.Su)(Z.$),F=(0,l.wA)(u.i),I=(0,s.Nj)(C.$F),[H,z]=(0,L.useState)(0),[D,R]=(0,L.useState)(!1),[W,B]=(0,L.useState)(!1),$=(0,g.Y)(["WebApp_Login"]),[U,N]=(0,L.useState)(!1),V=(0,L.useRef)((0,w.sC)({initialEntries:[null!==(t=o.url)&&void 0!==t?t:k.tH.loginHome]})),G=V.current.location.pathname,q=E||U,K=(0,g.s)("WebApp_Login"),Q=(0,Je.lw)(G),J=G===k.tH.linkPhoneOrEmail,Y=G===k.tH.loginGuestMode,{showLoginOptionSlider:X}=(0,h.LK)(),ee=(0,L.useMemo)((()=>[{expId:"webapp_guest_mode",segmentId:"segment_default",versionId:o.isGuestMode?"v12":"v1",propertyList:["cta_style","login_text","signup_text","close_icon"]}]),[o.isGuestMode]),{cta_style:te="default",login_text:oe="pcWeb_guestLogin_without",signup_text:ne="pcWeb_guestLogin_withoutSignup",close_icon:ie=!1}=(0,L.useMemo)((()=>(0,m.J)(x.a,ee)),[ee]);(0,L.useMemo)((()=>{!(0,f.fU)()&&o.loginModalShow&&o.url&&(V.current.go(Number(`-${V.current.length}`)),V.current.replace(o.url))}),[o.loginModalShow,o.url]),(0,L.useEffect)((()=>{const e=Uo.D.pipe((0,P.M)((e=>{N(e)}))).subscribe();return()=>{e.unsubscribe()}}),[]);const{forceLogin:ae}=Be((()=>["forceLogin"]),[]),re=(0,L.useCallback)((()=>{V.current.goBack(),I.clickGoBackButton()}),[I]),le=(0,L.useCallback)((e=>{13===e.keyCode&&re()}),[re]),se=(0,L.useCallback)((()=>{R([k.tH.signupAgeGateConfirm,k.tH.signupCreateAccount,k.tH.signupHome,k.tH.loginHome,k.tH.loginGuestMode].includes(G))}),[G]),de=(0,L.useCallback)((()=>{B([k.tH.signupAgeGateConfirm,k.tH.signupCreateAccount,k.tH.linkPhoneOrEmail,k.tH.linkPhone,k.tH.linkEmail,k.tH.loginGuestMode].includes(G))}),[G,B]),ce=G.match("/signup"),pe=G===k.tH.signupCountrySelector,ue=(0,L.useCallback)((()=>{var e;d(!1),I.loginNotifyClose({isSignUp:ce?"1":"0",e2eInfo:b.nf.getTrackingInfo()}),F.setLoginModalInitialState(),null===(e=o.closeCallback)||void 0===e||e.call(o),c(T()),p(void 0),o.isGuestMode&&((0,_.AP)("guest-mode-flag","1"),(0,_.AP)("timeOfLastPopup",Date.now().toString())),o.isGuestModeUI&&(0,_.AP)("timeOfLastPopup",Date.now().toString()),S({isLoginOnLoadClosed:!0})}),[d,I,ce,F,o.closeCallback,c,p,o.isGuestMode,o.isGuestModeUI,S]);(0,L.useEffect)((()=>{o.loginModalShow||b.nf.resetTrackingProps()}),[o.loginModalShow]),(0,L.useEffect)((()=>{(Q||Y)&&B(!0),V.current.listen((()=>{de(),se(),z(V.current.index)}))}),[Q,V,se,de,B,Y]);const{colors:ge}=(0,r.u)(),he=(0,L.useMemo)((()=>Object.assign(Object.assign(Object.assign(Object.assign({},um),{height:Q?"unset":"642px"}),Y?{width:"379px",height:"409px"}:{}),{backgroundColor:ge.BGSecondary})),[ge.BGSecondary,Y,Q]),me=(e=>{const t=(0,g.Y)(["WebApp_Login"]),o=(0,g.s)("WebApp_Login");return(0,L.useMemo)((()=>t?o(e?"accessibilityLabels_signup_form_back":"accessibilityLabels_login_form_back"):""),[t,e,o])})(Boolean(ce)),xe=(0,L.useCallback)((()=>{if(H>0&&!D){const e=document.querySelector("#login-modal");null==e||e.focus()}}),[D,H]);(0,L.useEffect)((()=>{xe()}),[xe]);const fe=o.popupType?4:ae||W||!o.closeable||(o.isGuestMode||o.isGuestModeUI)&&!ie?0:(o.isGuestMode||o.isGuestModeUI)&&ie?4:2,be=(0,L.useMemo)((()=>pe?xm:o.popupType?{}:(o.isGuestMode||o.isGuestModeUI)&&ie?mm:hm),[ie,pe,o.isGuestMode,o.isGuestModeUI,o.popupType]),_e=(0,L.useCallback)((()=>Y?null:"text"!==te||!o.isGuestMode&&!o.isGuestModeUI||o.popupType?G===k.tH.signupCountrySelector?(0,n.jsx)(pm,{goBack:re}):(0,n.jsx)(Nt,{isPopup:"sso"===o.popupType}):(0,n.jsx)($t,{popupType:o.popupType,isModal:o.loginModalShow,isMobileUiOptimize:!1,children:(0,n.jsxs)("div",{onClick:ue,style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:[ie&&(0,n.jsx)(a.A,{}),(0,n.jsx)(Ae.UU,{children:K(ce?ne:oe)})]})})),[Y,te,o.isGuestMode,o.isGuestModeUI,o.popupType,G,o.loginModalShow,ue,ie,K,ce,ne,oe,re]),ye=(0,L.useCallback)((()=>{A(!0),setTimeout((function(){A(!1)}),3e3)}),[]);return(0,n.jsx)(y.aF,{visible:o.loginModalShow,parentRef:e,onClose:ue,maskCloseable:!1,contentStyle:he,closeStyles:be,closeStyle:fe,focusTrapDisabled:q,popupType:o.popupType,maskOnClickAction:ye,zIndex:3001,keyboardCloseable:G!==k.tH.signupInterestSelector&&!o.isGuestMode,children:(0,n.jsxs)(O,{history:V.current,children:[(0,n.jsx)(gm,{}),(0,n.jsx)(Ae.Ug,{popupType:o.popupType,role:"dialog","aria-modal":"true","aria-labelledby":"login-modal-title",isCountrySelector:pe,isLinkPhoneOrEmail:Q,isLinkPhoneOrEmailHome:J,isGuestModeRedesign:Y,children:(0,n.jsxs)(v.t,{isMobile:!1,componentName:"login-modal-new",children:[pe&&(0,n.jsx)("div",{style:{marginInlineStart:"60px",marginTop:"10px",marginBottom:"16px",height:"108px"},children:(0,n.jsx)(i.Fm,{type:"P1-Bold",align:"start",children:K("regionOption_selectCountry_list_title")})}),(0,n.jsxs)(Ae.YM,{isGuestModeRedesign:Y,popupType:o.popupType,isInterestSelector:G===k.tH.signupInterestSelector,id:"loginContainer",children:[H>0&&!D&&"qr_bottom_right"!==o.popupType&&(0,n.jsx)(Ae.Rf,{onClick:re,onKeyDown:le,tabIndex:0,role:"button","aria-label":me,isCountrySelector:pe,children:(0,n.jsx)(Ae.xr,{})}),(0,n.jsx)(dm,{onRouteChange:xe,isLoginPage:!1})]}),$&&"qr"!==o.popupType&&"qr_bottom_right"!==o.popupType&&(!Q||X)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_u,{}),_e()]})]})})]})})})),bm=fm},45596:(e,t,o)=>{o.d(t,{CA:()=>m,Rf:()=>r,UU:()=>x,Ug:()=>c,YM:()=>p,bm:()=>g,rz:()=>u,t_:()=>h,xr:()=>l});var n=o(62186),i=o(12527),a=o(72153);const r=(0,n.default)("div",{target:"eg439om0"})((({theme:e,isCountrySelector:t})=>[(0,a.mp)({direction:e.direction,start:"16px"}),{position:"absolute",top:t?"30px":"16px",cursor:"pointer",transform:"rtl"===e.direction?"rotateZ(180deg)":"unset"}]),"label:DivBack;"),l=(0,n.default)(i.A,{target:"eg439om1"})([{width:"24px",height:"24px"}],"label:StyledChevronLeftOffset;"),s=(e,t,o,n)=>e||o||n?"0 0 0":t?"16px 0 0":"0 0 64px",d=(e,t,o)=>e?"qr_bottom_right"===e?"164px":"360px":t?"280px":o?"375px":"483px",c=(0,n.default)("div",{target:"eg439om2"})({height:"100%",display:"flex",flexDirection:"column"},(({popupType:e,isCountrySelector:t,isLinkPhoneOrEmail:o,isLinkPhoneOrEmailHome:n,isGuestModeRedesign:i})=>[{width:d(e,n,i),padding:s(e,t,o,i)}]),"label:DivModalContent;");c.defaultProps=Object.assign(Object.assign({},c.defaultProps),{"data-e2e":"login-modal"});const p=(0,n.default)("div",{target:"eg439om3"})((({theme:e,isGuestModeRedesign:t,popupType:o,isInterestSelector:n})=>[{flex:"1",overflowY:t||"qr_bottom_right"===o||n?"hidden":"scroll",background:"qr_bottom_right"===o?e.colors.BGView:e.colors.BGPrimary}]),"label:DivPageWrapper;"),u=(0,n.default)("div",{target:"eg439om4"})([{display:"flex",flexDirection:"column",padding:"0 60px 0 60px",width:"483px"}],"label:DivModalRevampContent;"),g=(0,n.default)("div",{target:"eg439om7"})({display:"flex",flexDirection:"row",flexShrink:"0",alignItems:"center",justifyContent:"center",margin:"22px auto",overflow:"hidden",width:"337px"},"label:DivOrContinueWithContainer;"),h=(0,n.default)("div",{target:"eg439om8"})((({theme:e})=>[{width:"100%",height:"1px",flexShrink:"0",background:e.colors.LineReverse2}]),"label:DivSeparatorLine;"),m=(0,n.default)("div",{target:"eg439om9"})((({theme:e})=>[{fontSize:"12px",fontStyle:"normal",fontWeight:"500",lineHeight:"22px",letterSpacing:"0.127px",color:e.colors.TextTertiary2,margin:"0 15px",whiteSpace:"nowrap"}]),"label:DivSeparatorText;"),x=(0,n.default)("p",{target:"eg439om11"})((({theme:e})=>[(0,a.zy)({theme:e,color:"TextPrimary",fontWeight:"semiBold"}),{fontSize:"13px",marginInlineStart:"5px","&:hover, &:focus":{textDecoration:"underline",textDecorationColor:e.colors.TextPrimary},"&:focus":{outline:"none"},"&:focus-visible":{outline:`2px auto ${e.colors.Negative}`}}]),"label:PGuestModeLink;");n.default.img` display: flex; height: 642px; width: 408px; @media (max-width: 800px) { display: none; } `}}]);