"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[13],{50190:(e,t,o)=>{o.d(t,{g:()=>_});var n=o(24643),i=o(47236),a=o(40099),r=o(47172),s=o(25616),l=o(49730),c=o(78662),d=o(82715),p=o(23255),u=o(74499),h=o(46102),g=o(62186),f=o(31355);const m=(0,g.default)(f.N_,{target:"eih5y5d0"})({fontSize:0},"label:StyledLinkLogo;");m.defaultProps=Object.assign(Object.assign({},m.defaultProps),{"data-e2e":"tiktok-logo"});var b=o(21683);const x=(0,i.Ay)({resolved:{},chunkName:()=>"logo-muted-white.svg",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!o.m[t]},importAsync:()=>o.e(976).then(o.bind(o,6060)),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:()=>6060}),v=(0,i.Ay)({resolved:{},chunkName:()=>"logo-muted-black.svg",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!o.m[t]},importAsync:()=>o.e(4666).then(o.bind(o,90758)),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:()=>90758}),_=(0,a.memo)((function({isDark:e,isGrayFilter:t,style:o={}}){var i,g;const f=(0,s.s)(),{pathname:_}=(0,r.useLocation)(),y=(0,l.sL)(),w=(0,b.YS)(),k=(0,l.E7)(void 0,null!==(g=null===(i=(0,d.jN)(_))||void 0===i?void 0:i.name)&&void 0!==g?g:d.eU.foryou),C=(0,a.useCallback)((e=>{(0,c.tO)(_)&&(e.preventDefault(),y.resetRecommendList({}),k()),p.t.handleClickLogo()}),[_,y,k]),j=f("TikTok i18n title"),S=(0,a.useMemo)((()=>e?t?(0,n.jsx)(x,{height:42,width:118}):(0,n.jsx)(h.A,{alt:j,height:42,width:118}):t?(0,n.jsx)(v,{height:42,width:118}):(0,n.jsx)(u.A,{height:42,width:118,alt:j})),[e,t,j]);return(0,n.jsxs)(m,{to:d.OZ.home,onClick:C,style:Object.assign({position:"relative"},o),ariaLabel:f("accessibilityLabels_forYou_nav_tiktok_btn"),forceSSR:w,children:[S,(0,n.jsx)("strong",{children:j})]})}))},22941:(e,t,o)=>{o.d(t,{PO:()=>i,nj:()=>a,wt:()=>r});const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",i=62,a=(e,t)=>{if(10===t||![2,8,16,62].includes(t))return e;const o=[];let i,a,r,s,l;for(;e.length>0;){for(r="",i=0,a=0;an[e])).join("")},r=(e,t)=>{const o=[];let i,a,r,s,l;for(;e.length>0;){for(r="",i=0,a=0;a{o.r(t),o.d(t,{default:()=>Ln});var n=o(2787),i=o(21683),a=o(40099),r=o(11060),s=o(5441),l=o(84506),c=o(78662),d=o(75431),p=o(62186);const u=(0,d.i7)({from:{transform:"rotateZ(0)"},to:{transform:"rotateZ(-360deg)"}}),h=(0,p.default)("div",{target:"e1dilpaq0"})((({theme:{direction:e},isRefreshing:t=!1})=>[{width:"32px",height:"32px",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",marginInlineEnd:"16px",transform:`rotateY(${"rtl"===e?180:0}deg)`},t?{animation:`${u} 1s infinite`}:{}]),"label:DivBackIconContainer;"),g=(0,p.default)("div",{target:"e1dilpaq1"})((({marginInlineStart:e="unset"})=>({display:"flex",alignItems:"center",height:"32px",marginInlineStart:e,WebkitAppRegion:"no-drag"})),"label:DivAppButtonsContainer;");var f=o(24643),m=o(91066),b=o(243),x=o.n(b),v=o(93608);const _=(0,a.memo)((()=>{const e=(0,a.useCallback)((()=>{v.f.sendEvent("click_go_home_btn"),x().app.mainWindowMoveTop()}),[]);return(0,f.jsx)(h,{onClick:e,children:(0,f.jsx)(m.p,{size:32})})}));var y=o(47172),w=o(65404),k=o(72081);const C=(0,a.memo)((()=>{const{pathname:e}=(0,y.useLocation)(),t=(0,c.Tc)(e)||(0,c.b8)(e),o=(0,a.useCallback)((()=>{v.f.sendEvent("click_go_back_btn"),x().app.navigationGoBack()}),[]);return t?null:(0,f.jsx)(h,{onClick:o,children:(0,f.jsx)(w.p,{size:24})})})),j=(0,a.memo)((()=>{const[e,t]=(0,a.useState)(!1),o=(0,a.useCallback)((()=>{t(!0),v.f.sendEvent("click_refresh_button"),window.location.reload()}),[]);return(0,f.jsx)(h,{onClick:o,isRefreshing:e,children:(0,f.jsx)(k.S,{size:24})})}));o(28591),o(77966);var S=o(41271),P=o(50970),T=o(54888),E=o(20157),I=o(25616),A=o(70142),L=o(33805),D=o(72153),M=o(97397);const R=(0,p.default)(M.y,{target:"e145h5950"})((({theme:e,isFocus:t})=>[{position:"absolute",top:t?"6px":"-9999px",zIndex:99999,padding:"0 48px",height:"48px",fontSize:"16px",fontWeight:700,background:e.colors.BGPrimary,border:"1px solid #e3e3e5",borderRadius:"4px"},(0,D.mp)({direction:e.direction,start:"8px"})]),"label:StyledButton;");function z(){const e=(0,I.s)(),{pathname:t}=(0,y.useLocation)(),o=(0,L.N2)(t),n=[String("homepage_hot"),String("homepage_follow"),String("others_homepage"),String("explore_page")],i=(0,a.useMemo)((()=>"unknown"===o?"":`main-content-${o}`),[o]),[r,s]=(0,a.useState)(!1),l=(0,a.useCallback)((()=>{s(!0)}),[]),c=(0,a.useCallback)((()=>{s(!1)}),[]),d=(0,a.useCallback)((e=>{e.preventDefault(),(e=>{var t;try{if(!e)return;const o=document.querySelector(`#${e}`);if(!o)return;const n=(0,A.ke)(o);n.length>0?null===(t=n[0])||void 0===t||t.focus():o.focus()}catch(e){}})(i)}),[i]);return n.includes(o)?(0,f.jsx)(R,{isFocus:r,onFocus:l,onBlur:c,onClick:d,children:e("accessibilityLabels_home_skipContentFeed")}):null}const W=(0,p.default)("div",{target:"e1as599v0"})((({scrollWidth:e=0,shouldTransparent:t=!1,theme:{colors:o}})=>[{display:"flex",justifyContent:"space-around",boxShadow:`0px 1px 1px ${o.ShadowPrimary}`,height:D.uF,width:`calc(100% - ${e}px)`,top:0,position:"fixed",alignItems:"center",background:t?"transparent":o.BGPrimary,zIndex:3e3}]),"label:DivHeaderContainer;"),B=(0,p.default)("div",{target:"e1as599v1"})({width:"100%",display:"flex",height:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",WebkitAppRegion:"drag"},(({expand:e})=>e?{}:{maxWidth:D.hj}),(({theme:{direction:e}})=>(0,D.mp)({direction:e,paddingStart:"20px",paddingEnd:"24px"})),"label:DivHeaderWrapperMain;"),F=(0,p.default)(B,{target:"e1as599v2"})([{maxWidth:"100%"},({theme:{direction:e}})=>(0,D.mp)({direction:e,paddingStart:"16px",paddingEnd:"24px"})],"label:StyledDivHeaderWrapperMainV2;");var N=o(50190),O=o(85245),U=o(46682),H=o(47236),K=o(28086),q=o(48881),G=o(64127),V=o(38812),$=o(89311),Y=o(86389),Z=o(67842),X=o(88920),J=o(60484),Q=o(49057),ee=o(71281),te=o(61886),oe=o(60342),ne=o(58305),ie=o(45297),ae=o(25754),re=o(95197),se=o(34012),le=o(27375),ce=o(31355),de=o(31922),pe=o(68159),ue=o(82715),he=o(65556),ge=o(53737),fe=o(7089),me=o(32125),be=o(77181);const xe=function({removeMarginLeft:e,style:t}){var o;const n=(0,I.s)(),{pathname:i}=(0,y.useLocation)(),r=i.startsWith("/message"),s=r?pe.Nk:pe.vE,{lang:l,abTestVersion:c}=(0,S.P)(P.L,{dependencies:[],selector:e=>{var t;return{lang:e.lang,abTestVersion:null===(t=e.appContext)||void 0===t?void 0:t.abTestVersion}}}),d="v2"===(null!==(o=(0,ee.qt)(c,"web_dm_icon_click_check"))&&void 0!==o?o:"v1"),p=(0,ge.VB)((e=>e.messageCount),me.bN),[{businessPermission:u,businessAccountInfoResponse:h},g]=(0,fe.hG)((e=>e),me.bN),[m,b]=(0,a.useState)(!1),x=(0,le.lH)(p),{path:_,target:w}=(0,se._Y)(l),k=(0,a.useCallback)((e=>{var t;if(e.preventDefault(),u.comment&&u.message&&(null===(t=h.data)||void 0===t?void 0:t.can_use_bc))h.data.has_bc?(()=>{var e;const t=i===ue.OZ.messages,o=null===(e=h.data)||void 0===e?void 0:e.redirect_url;o&&(t?location.href=o:window.open(o),b(!1))})():b(!0);else if("_blank"===w)window.open(_,"_blank");else{if(d&&r)return;window.location.href=_}ae.w.handleEnterChatList(p)}),[p,h,u,r,d]);(0,de.$)(),(0,he.c)(),(0,de.q)(),(0,a.useEffect)((()=>{g.getBusinessPermissionList()}),[g]),(0,a.useEffect)((()=>{u.comment&&u.message&&g.getBusinessAccountInfoResponse()}),[u,g]);const C=(0,a.useMemo)((()=>(0,f.jsx)(re.m,{overlay:n("webdm_message_button"),placement:"bottom",children:(0,f.jsxs)(pe.pS,{removeMarginLeft:e,children:[(0,f.jsx)(ce.N_,{forceSSR:!1,to:"#",target:w,onClick:e=>{k(e),v.f.event("webtt_bc_dm_on_popup_window_show")},ariaLabel:n("accessibilityLabels_forYou_nav_messages_btn"),children:(0,f.jsx)("span",{children:(0,f.jsx)(s,{})})}),p>0&&(0,f.jsx)(pe.F3,{long:p>10,children:x})]})})),[k,p,e]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(pe.n5,{style:t,children:C}),m&&(0,f.jsx)(be.oL,{canUseBcVisible:m,setCanUseBcVisible:b})]})};var ve=o(6986),_e=o(509),ye=o(56723),we=o(77734),ke=o(91164),Ce=o(67518),je=o(48615),Se=o(82902),Pe=o(97706),Te=o(84987);const Ee={id:"pc-dark-fa706b14",use:"pc-dark-fa706b14-usage",viewBox:"0 0 116 100",content:''};function Ie(e){const t=(0,a.useContext)(Te.X);return(0,a.useLayoutEffect)((()=>(t.add(Ee),()=>{t.remove("pc-dark-fa706b14")})),[]),(0,f.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,f.jsx)("use",{xlinkHref:"#pc-dark-fa706b14"},void 0)}),void 0)}const Ae={id:"pc-light-47856b85",use:"pc-light-47856b85-usage",viewBox:"0 0 116 100",content:''};function Le(e){const t=(0,a.useContext)(Te.X);return(0,a.useLayoutEffect)((()=>(t.add(Ae),()=>{t.remove("pc-light-47856b85")})),[]),(0,f.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,f.jsx)("use",{xlinkHref:"#pc-light-47856b85"},void 0)}),void 0)}const De=(0,p.default)("div",{target:"e17vztu20"})({paddingTop:"21px",minWidth:"216px",maxWidth:"320px",display:"flex",flexDirection:"column",alignItems:"center"},"label:DivDownloadContainerV1;"),Me=(0,p.default)(M.y,{target:"e17vztu21"})((({theme:e})=>[(0,D.zy)({theme:e,typography:"P3",fontFamily:"TikTokFont",fontWeight:"semiBold"}),{height:"48px",borderRadius:"0 0 12px 12px",marginTop:"18px",cursor:"pointer",width:"100%"}]),"label:FullButton;"),Re=(0,p.default)("p",{target:"e17vztu25"})((({theme:e})=>[(0,D.zy)({theme:e,typography:"P3",fontFamily:"TikTokFont",fontWeight:"bold",color:"TextPrimary"}),{fontSize:"16px",lineHeight:"21px",textAlign:"center",marginTop:"8px",padding:"0 12px"}]),"label:PTitle;"),ze=(0,p.default)("p",{target:"e17vztu26"})((({theme:e})=>[(0,D.zy)({theme:e,fontFamily:"TikTokFont",color:"TextTertiary"}),{fontSize:"12px",lineHeight:1.3,textAlign:"center",marginTop:"8px",padding:"0 12px"}]),"label:PSubTitle;"),We=(0,p.default)(Ie,{target:"e17vztu27"})({width:"116px",height:"100px"},"label:StyledPCDarkIcon;"),Be=(0,p.default)(Le,{target:"e17vztu28"})({width:"116px",height:"100px"},"label:StyledPCLightIcon;");var Fe=o(22941);const Ne=(0,a.memo)((function({active:e,margin:t=-17,onKeyDown:o,onBlur:n,onStartLoading:i,onEndLoading:r}){const{direction:s,colors:l,isDark:c}=(0,Ce.u)(),d=(0,I.s)(),p="ltr"===s?"bottomRight":"bottomLeft",[u,h]=(0,a.useState)(!1),{wid:g=""}=(0,J.L$)((0,Q.W)((()=>["wid"]),[])),{config:m,os:b}=(0,J.L$)((0,je.U)((()=>["config","os"]),[])),{desktopAppDownloadLink:x}=(0,J.L$)(m),{mac:_="",win:y=""}=(0,J.L$)(x),{downloadHref:w,downloadAttr:k}=(0,a.useMemo)((()=>{const e=(0,Fe.nj)(g,Fe.PO),t="mac"===b?_:y,o="mac"===b?".dmg":".exe";return{downloadHref:t,downloadAttr:`${t.split(o)[0].substring(t.lastIndexOf("/")+1)}-wid-${e}${o}`}}),[_,b,g,y]),C=(0,a.useCallback)((()=>{return e=this,t=void 0,n=function*(){u||(v.f.sendEvent("click_download_app_btn"),h(!0),i(),(yield(0,Se.k)({cors:!0,downloadAddr:w,fileName:k}))||(yield(0,Se.k)({cors:!1,downloadAddr:w,fileName:k})),v.f.sendEvent("desktop_app_download_success"),h(!1),r())},new((o=void 0)||(o=Promise))((function(i,a){function r(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(r,s)}l((n=n.apply(e,t||[])).next())}));var e,t,o,n}),[k,w,u]),j=(0,a.useCallback)((e=>{if(9===e.keyCode){if(!e.target)return;setTimeout((()=>{var e;try{const t=document.querySelector(`#${ye.mS}`);(null===(e=Array.from(null==t?void 0:t.querySelectorAll("*")))||void 0===e?void 0:e.includes(document.activeElement))||null==n||n()}catch(e){console.error(e)}}),0)}null==o||o(e)}),[n,o]);return(0,f.jsx)(Pe.z,{style:{borderRadius:"12px"},backgroundColor:l.BGSecondary,placement:p,active:e,arrowMargin:58,margin:t,id:ye.mS,onKeyDown:j,ariaLabelledBy:"",children:(0,f.jsxs)(De,{children:[c?(0,f.jsx)(We,{}):(0,f.jsx)(Be,{}),(0,f.jsx)(Re,{children:d("desktop_app_downloadPopup_header")}),(0,f.jsx)(ze,{children:d("pcWeb_desktopApp_maintainPopup_body")}),(0,f.jsx)(Me,{buttonTheme:"primary",onClick:C,loading:u,children:d("desktop_app_downloadPopup_cta")})]})})}));var Oe=o(11983),Ue=o(31476),He=o(33399);const Ke=(0,p.default)("div",{target:"eyzz2kj0"})((({theme:e})=>({width:"8px",height:"8px",borderRadius:"8px",background:e.colors.Primary,margin:"auto 4px"})),"label:DivUpdateRedDot;"),qe={padding:"10px 8px 10px 16px",width:"unset"},Ge=(0,a.memo)((function({active:e,margin:t=-17,e2eTag:o,onKeyDown:n,onBlur:r}){const{direction:s,colors:l}=(0,Ce.u)(),c=(0,I.s)(),[d,p]=(0,a.useState)({isNeedUpdate:!1,isSilentDownload:!1}),[u,h]=(0,a.useState)(!1),[g,m]=(0,a.useState)(!1);(0,a.useEffect)((()=>{x().app.getClientUpdateInfo().then((e=>{var t;const{isNeedUpdate:o=!1,isSilentUpdate:n=!1}=null!==(t=null==e?void 0:e.data)&&void 0!==t?t:{};p({isNeedUpdate:o,isSilentDownload:n})}))}),[]),(0,a.useEffect)((()=>{const{isNeedUpdate:e=!1,isSilentDownload:t=!1}=null!=d?d:{};h(e&&(!t||g))}),[d,g]),(0,a.useEffect)((()=>{x().app.getIsUpdatePackageReady().then((e=>{var t;m(null!==(t=e.data)&&void 0!==t&&t)}))}),[]);const b=(0,i.Db)(),_=(0,a.useCallback)((()=>{var e,t,o;v.f.sendEvent("open_general_settings"),x().app.showAbout({data:{pageList:null===(e=b.pageList)||void 0===e?void 0:e.children,programList:null===(t=b.programList)||void 0===t?void 0:t.children,legalList:null===(o=b.legalList)||void 0===o?void 0:o.children}})}),[b]),y=(0,a.useCallback)((()=>{u?(v.f.sendEvent("open_update_app_modal"),x().app.showUpdateModal()):(Oe.F.destroy(),Oe.F.open({content:c("desktop_app_upToDate_toast"),duration:3}))}),[u,c]),w="ltr"===s?"bottomRight":"bottomLeft",k=(0,a.useCallback)((e=>{if(9===e.keyCode){if(!e.target)return;setTimeout((()=>{var e;try{const t=document.querySelector(`#${ye.u3}`);(null===(e=Array.from(null==t?void 0:t.querySelectorAll("*")))||void 0===e?void 0:e.includes(document.activeElement))||null==r||r()}catch(e){console.error(e)}}),0)}null==n||n(e)}),[r,n]);return(0,f.jsx)(Pe.z,{backgroundColor:l.BGSecondary,placement:w,active:e,arrowMargin:15,margin:t,id:ye.u3,onKeyDown:k,ariaLabelledBy:"",children:(0,f.jsxs)(He.Dp,{"data-e2e":o,id:ye.u3,role:"listbox",children:[(0,f.jsx)(Ue.K,{text:"desktop_app_tab_settings",onClick:_,href:null,e2eTag:"general-settings-entrance",style:qe}),(0,f.jsx)(Ue.K,{text:"desktop_app_tab_updateTikTok",onClick:y,href:null,e2eTag:"update-entrance",style:qe,containerStyle:{justifyContent:"flex-start"},children:u&&(0,f.jsx)(Ke,{})})]})})}));var Ve=o(42617),$e=o(17784),Ye=o(91532),Ze=o(30699),Xe=o(88344),Je=o(67616),Qe=o(6191),et=o(72642),tt=o(81230),ot=o(52261),nt=o(92925),it=o(88479),at=o(14496),rt=o(62334);const st=(0,p.default)("div",{target:"e1xroc440"})((({theme:{direction:e}})=>(0,D.mp)({direction:e,marginStart:"16px"})),{position:"relative",WebkitAppRegion:"no-drag"},"label:DivHeaderInboxContainer;");st.defaultProps=Object.assign(Object.assign({},st.defaultProps),{"data-e2e":"inbox-icon"});const lt={cursor:"pointer",display:"block"},ct=(0,p.default)(it.A,{target:"e1xroc441"})(lt,"label:StyledInboxIcon;"),dt=(0,p.default)(at.A,{target:"e1xroc442"})(lt,"label:StyledInboxIconActive;"),pt=(0,p.default)("sup",{target:"e1xroc443"})((({long:e,theme:t})=>[(0,D.zy)({theme:t,fontFamily:"TikTokFont",typography:"P3",fontWeight:"semiBold",color:"ConstTextInverse"}),(0,D.mp)({direction:t.direction,start:"16px"}),{background:t.colors.Primary,minWidth:"20px",height:"20px",display:"flex",justifyContent:"center",borderRadius:"10px",position:"absolute",top:"-20%"},e?{padding:"0 6px"}:{}]),"label:SupBadge;"),ut=(0,p.default)("div",{target:"e1xroc444"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P4",color:"ConstTextInverse",fontWeight:"semiBold"})),{display:"flex",padding:"12px",fontSize:"12px"},"label:DivTipWrapper;"),ht=(0,p.default)("span",{target:"e1xroc447"})({display:"flex",alignItems:"center",justifyContent:"center","& + &":{marginLeft:"16px"},b:{marginLeft:"2px",fontWeight:600}},"label:SpanTipItem;"),gt=(0,p.default)(rt.A,{target:"e1xroc448"})({position:"absolute",top:"-8px"},(({theme:{direction:e}})=>(0,D.mp)({direction:e,end:"70px"})),"label:StyledArrow;"),ft=(0,p.default)("div",{target:"e1xroc449"})((({theme:{colors:e,direction:t},state:o,duration:n})=>[{display:o===$e.kp?"none":"block",position:"absolute",width:"376px",height:"640px",top:"45px",background:e.BGSecondary,borderRadius:"8px",boxShadow:"0 -4px 32px rgba(0, 0, 0, 0.12)",transition:`all ${n}ms linear`,zIndex:3e3,opacity:Number(o===$e._K)},(0,D.mp)({direction:t,end:"-66px"})]),"label:DivHeaderInboxWrapper;");var mt=o(39505),bt=o(73580),xt=o(81125),vt=o(82535);const _t={width:16,height:16},yt={2:(0,f.jsx)(Ye.A,Object.assign({},_t)),3:(0,f.jsx)(Ze.A,Object.assign({},_t)),505:(0,f.jsx)(Ze.A,Object.assign({},_t)),6:(0,f.jsx)(Xe.A,Object.assign({},_t)),7:(0,f.jsx)(Je.A,Object.assign({},_t)),[et.Tu]:(0,f.jsx)(Qe.A,Object.assign({},_t))},wt=(0,a.memo)((function(){const e=(0,I.s)(),t=(0,Ce.u)(),{pathname:o}=(0,y.useLocation)(),n=(0,S.P)(tt.s),[{noticeList:i,isFooterRequest:r,reportInboxNoticeCount:s},l]=(0,U.S)(et.kK,{selector:e=>({noticeList:e.noticeCount,reportInboxNoticeCount:e.reportInbox.count,isFooterRequest:e.isFooterRequest}),dependencies:[]}),{tooltipPriority:c,handlePopoverEnd:d,handlePopoverInitial:p}=(0,mt.N)(5),[u,h]=(0,ot.P4)((e=>e.inboxTabShowing)),{totalText:g,totalLong:m,countList:b,isShowTotal:x,totalUnreadCount:_}=(0,a.useMemo)((()=>{const e=i.reduce(((e,{count:t})=>e+t),0),t=e+s;return{isShowTotal:e>0,totalText:(0,le.lH)(t),totalLong:t>10,countList:i.filter((e=>e.count>0)),totalUnreadCount:t}}),[i,s]),w=function(){const[e,t]=(0,a.useState)(!1);return(0,a.useEffect)((()=>(t(!0),()=>{t(!1)})),[]),e}(),[k,C]=(0,a.useState)(!1),j=(0,a.useRef)(0);(0,a.useEffect)((()=>(r&&(x?5===c&&(p(),C(!0),clearTimeout(j.current),j.current=window.setTimeout((()=>{C(!1),d()}),5e3)):d()),()=>{clearTimeout(j.current)})),[r,c,x]);const P=(0,a.useRef)(null),{handleEnter:T}=function({showTip:e}){const t=(0,a.useRef)(0),o=(0,bt.Nj)(xt.b),{total:n,countList:i}=(0,S.P)(et.kK,{dependencies:[],selector:e=>{const t=e.noticeCount;return{total:t.reduce(((e,{count:t})=>e+t),0),countList:t.filter((e=>e.count>=0))}}});(0,a.useEffect)((()=>{t.current=Date.now()}),[]);const r=(0,a.useCallback)((()=>{const e=Date.now()-t.current;v.f.sendEvent("notification_panel_show",{enter_method:"click_inbox_button"}),vt.q.handleEnterMessage({show_cnt:n,enter_within_30s:e<3e4?1:0})}),[n]);return(0,a.useEffect)((()=>{if(e){const e=i.reduce(((e,{group:t,count:o})=>{switch(t){case 2:e.comment_cnt=o;break;case 3:e.like_cnt=o;break;case 6:e.mention_cnt=o;break;case 7:e.follower_cnt=o}return e}),{like_cnt:0,comment_cnt:0,mention_cnt:0,follower_cnt:0});o.handlePopShow(e)}}),[o,e]),{handleEnter:r}}({showTip:k}),A=(0,a.useCallback)((()=>{h.setInboxTabShowing(!u),l.setNoticeCount([]),l.setReportInboxNoticeCount(0),u||T()}),[l,T,u]),L=(0,a.useCallback)((e=>{e&&(e.preventDefault(),e.stopPropagation()),A()}),[A]),D=(0,a.useCallback)((e=>{13===e.keyCode||32===e.keyCode?(e.stopPropagation(),e.target===P.current&&(A(),32===e.keyCode&&e.preventDefault())):27===e.keyCode?u&&h.setInboxTabShowing(!1):9===e.keyCode&&(e.shiftKey&&e.target===P.current&&u&&h.setInboxTabShowing(!1),setTimeout((()=>{var e,t;!(null===(t=Array.from(null===(e=P.current)||void 0===e?void 0:e.querySelectorAll("*")))||void 0===t?void 0:t.includes(document.activeElement))&&u&&h.setInboxTabShowing(!1)}),0))}),[A,u]);(0,a.useEffect)((()=>{-1!==location.search.indexOf("open_inbox=1")&&L()}),[]);const M=(0,a.useMemo)((()=>u?dt:ct),[u]),{hideModal:R}=(0,E.g)(),z=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation()}),[]),W=(0,a.useCallback)((e=>{32!==e.keyCode&&38!==e.keyCode&&40!==e.keyCode||(e.stopPropagation(),e.preventDefault())}),[]),{region:B,language:F}=(0,J.L$)((0,Q.W)((()=>["region","language"]),[]));(0,a.useEffect)((()=>{l.fetchNoticeCount(),l.fetchReportInbox({region:B,language:F})}),[l,B,F]);const N=(0,a.useRef)(null),O=(0,a.useRef)(!1),H=(0,a.useCallback)((()=>{O.current=!0}),[]),K=(0,a.useCallback)((()=>{O.current=!1}),[]);(0,a.useEffect)((()=>{const e=()=>{O.current||h.setInboxTabShowing(!1)};return window.addEventListener("click",e),()=>{window.removeEventListener("click",e)}}),[]),(0,a.useEffect)((()=>{u&&h.setInboxTabShowing(!1)}),[o]);const q=(0,a.useRef)(!1);(0,a.useEffect)((()=>{u&&!q.current&&(h.fetchNoticeData(),q.current=!0)}),[h,u]);const G=(0,a.useCallback)((()=>(R(),!0)),[R]),V=(0,a.useCallback)((()=>{h.setInboxTabShowing(!1)}),[]),$=(0,a.useMemo)((()=>e("accessibilityLabels_forYou_btn_inbox",{number:_})),[e,_]),Y=(0,a.useCallback)((()=>{setTimeout((()=>{var e;null===(e=P.current)||void 0===e||e.focus()}),0)}),[]);return(0,f.jsxs)(st,{tabIndex:0,onClick:L,onKeyDown:D,ref:P,role:"button","aria-expanded":u,"aria-label":$,children:[(0,f.jsx)(y.Prompt,{when:u,message:G}),u?(0,f.jsx)(M,{width:32,height:32}):(0,f.jsx)(re.m,{placement:"bottom",overlay:e("Inbox"),children:(0,f.jsx)("span",{children:(0,f.jsx)(M,{width:32,height:32})})}),(x||s>0)&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Pe.z,{active:k,placement:"bottom",backgroundColor:t.colors.Primary,children:(0,f.jsx)(ut,{children:b.map((({group:e,count:t})=>(0,f.jsxs)(ht,{children:[yt[e],(0,f.jsx)("b",{children:(0,J.D1)(t)})]},e)))})}),!k&&(0,f.jsx)(pt,{long:m,children:g})]}),w&&(0,f.jsx)($e.Ay,{timeout:200,in:u,nodeRef:N,children:o=>(0,f.jsx)(Ve.Ay,{autoFocus:!1,disabled:!u||n.visible,onDeactivation:Y,children:(0,f.jsxs)(ft,{ref:N,state:o,duration:200,onClick:z,onKeyDown:W,onMouseEnter:H,onMouseLeave:K,role:"dialog","aria-label":e("Inbox_Notifications"),children:[(0,f.jsx)(gt,{width:24,height:8,fill:t.colors.BGSecondary}),(0,f.jsx)(nt.b,{closeInbox:V})]})})})]})}));var kt=o(89005),Ct=o(82548);const jt=({children:e})=>{const{tooltipPriority:t,handlePopoverEnd:o,handlePopoverInitial:n}=(0,mt.N)(9),[i,r]=(0,a.useState)(!1),s=(0,bt.Nj)(kt.Ku),{direction:l}=(0,Ce.u)(),c=(0,a.useMemo)((()=>({offset:"ltr"===l?[30,20]:[-30,20]})),[l]),d=(0,a.useMemo)((()=>"ltr"===l?"bottomRight":"bottomLeft"),[l]),p=(0,je.U)((()=>["liveAnchorEntrance"]),[]),u=(0,a.useMemo)((()=>{var e;return null===(e=null==p?void 0:p.liveAnchorEntrance)||void 0===e?void 0:e.creatorHub}),[p]),h=(0,a.useRef)(0),g=(0,a.useMemo)((()=>({width:180,padding:12,fontSize:14})),[]),m=(0,I.s)(),{removeLivePop:b}=(0,X.gR)();(0,a.useEffect)((()=>{s.getLiveCreatorHubPopup()&&u&&!b?9===t?(r(!0),n(),clearTimeout(h.current),Ct.U.handlePopupShow({enter_method:"live_popup"}),h.current=window.setTimeout((()=>{r(!1),o(),s.setLiveCreatorHubPopup(!0)}),5e3)):r(!1):(r(!1),o())}),[o,n,u,s,t,b]);const x=(0,a.useCallback)((e=>{e||(r(!1),o(),s.setLiveCreatorHubPopup(!0))}),[o,s]);return(0,f.jsx)(re.m,{visible:i,trigger:"click",tooltipTheme:"blue",placement:d,align:c,overlay:m("live_creator_hub_home_desc",{},"Explore the endless possibilities of TikTok LIVE. It's the place to be for real-time fun, expression, creativity, and connection."),overlayInnerStyle:g,onVisibleChange:x,children:e})};var St=o(81211),Pt=o(72688),Tt=o(54129);const Et=(0,p.default)("div",{target:"eha49cm0"})({padding:"16px",width:"264px",wordBreak:"break-word"},"label:DivTipWrapper;"),It=(0,p.default)("h3",{target:"eha49cm1"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P2",color:"ConstTextInverse",fontWeight:"semiBold"})),{marginBottom:"4px"},"label:H3TipTitle;"),At=(0,p.default)("p",{target:"eha49cm2"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P3",color:"ConstTextInverse"})),"label:PTipDesc;"),Lt=(0,p.default)("div",{target:"eha49cm3"})({display:"flex",justifyContent:"flex-end"},"label:DivButtonWrapper;"),Dt=(0,p.default)(y.Link,{target:"eha49cm4"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P2",color:"ConstTextInverse",fontWeight:"semiBold"})),(({theme:e})=>(0,D.mp)({direction:e.direction,marginStart:"16px"})),{color:"#ffffff!important",cursor:"pointer","&:hover":{textDecoration:"none"}},"label:StyledLink;"),Mt=(0,p.default)("button",{target:"eha49cm5"})(D.WA,(({theme:e})=>(0,D.zy)({theme:e,typography:"P2",color:"ConstTextInverse",fontWeight:"semiBold"})),{cursor:"pointer"},"label:ButtonCancel;"),Rt=(0,a.memo)((({uniqueId:e,secUid:t,userPopupActive:o})=>{const{colors:n,direction:i}=(0,Ce.u)(),r=(0,I.s)(),{pathname:s}=(0,y.useLocation)(),l=(0,c.sn)(s),d="fyp"===l?"homepage_hot_tooltip":`${l}_tooltip`,[p,u]=(0,a.useState)(!1),{tooltipPriority:h,handlePopoverEnd:g,handlePopoverInitial:m}=(0,mt.N)(8),b=(0,c.cj)(s)&&s.replace("/@","")===e,x=(0,a.useRef)(!1);(0,a.useEffect)((()=>{let e;return p&&(e=window.setTimeout((()=>{x.current=!0,Tt.s.handleCloseProfileTooltip({enter_from:d,close_method:"auto_cancel"}),g(),u(!1)}),5e3)),()=>clearTimeout(e)}),[p]),(0,a.useEffect)((()=>()=>{p&&!x.current&&Tt.s.handleCloseProfileTooltip({enter_from:d,close_method:"other"})}),[p]);const{removeEditProfilePop:v}=(0,X.gR)();(0,a.useEffect)((()=>{(0,ne._S)(ie.vt)||b||v?(u(!1),g()):8===h?(u(!0),m(),Tt.s.handleShowProfileTooltip({enter_from:d}),Ct.U.handlePopupShow({enter_method:"edit_profile_popup"}),(0,ne.AP)(ie.vt,"1")):u(!1)}),[h,v]),(0,a.useEffect)((()=>{o&&p&&(x.current=!0,Tt.s.handleCloseProfileTooltip({enter_from:d,close_method:"other"}),g(),u(!1))}),[o,d,p]);const _=(0,a.useCallback)((()=>{Tt.s.handleCloseProfileTooltip({enter_from:d,close_method:"edit_profile"}),Tt.s.handleClickEditProfile({enter_from:d}),(0,ne.J2)(ie.Iw,d),x.current=!0,u(!1),g()}),[d]),w=(0,a.useCallback)((()=>{x.current=!0,u(!1),g(),Tt.s.handleCloseProfileTooltip({enter_from:d,close_method:"cancel"})}),[d]),k=(0,St.U)({pathname:(0,Pt.fJR)({uniqueId:e,secUid:t}),search:{}}),C=(0,a.useMemo)((()=>({pathname:k})),[k]),j="ltr"===i?"bottomRight":"bottomLeft";return(0,f.jsx)(Pe.z,{active:p,backgroundColor:n.ConstSecondary2,placement:j,arrowMargin:"16px",margin:"-12px",children:(0,f.jsxs)(Et,{children:[(0,f.jsx)(It,{children:r("editprofile_feedtooltip_title")}),(0,f.jsx)(At,{children:r("editprofile_feedtooltip_subtitle")}),(0,f.jsxs)(Lt,{children:[(0,f.jsx)(Mt,{onClick:w,children:r("editprofile_close")}),(0,f.jsx)(Dt,{to:C,onClick:_,children:r("editprofile_editprofile")})]})]})})}));var zt=o(466),Wt=o(87260),Bt=o(84643);const Ft=(0,p.default)("div",{target:"eulelxm0"})((({theme:{direction:e}})=>(0,D.mp)({direction:e,marginStart:"16px"})),{cursor:"pointer",height:"32px",position:"relative",width:"32px",display:"flex",alignItems:"center",justifyContent:"center"},"label:DivRechargeContainer;");Ft.defaultProps=Object.assign(Object.assign({},Ft.defaultProps),{"data-e2e":"recharge-icon"});const Nt=(0,p.default)("span",{target:"eulelxm1"})({width:"24px",height:"24px",display:"block"},"label:SpanLogoContainer;"),Ot=(0,p.default)("span",{target:"eulelxm2"})((({theme:{direction:e}})=>(0,D.mp)({direction:e,marginEnd:"8px"})),{width:"20px",height:"20px",display:"block"},"label:SpanLogoContainerInner;"),Ut=(0,p.default)("div",{target:"eulelxm3"})((({theme:{colors:e,direction:t}})=>[(0,D.mp)({direction:t,marginStart:"16px"}),{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",cursor:"pointer",height:"36px",position:"relative",padding:"7px 16px",borderRadius:"2px",border:`1px solid ${e.LineSecondary}`,boxSizing:"border-box"}]),"label:DivRechargeContainerWithText;");Ut.defaultProps=Object.assign(Object.assign({},Ut.defaultProps),{"data-e2e":"recharge-icon"});const Ht=(0,p.default)("h2",{target:"eulelxm4"})((({theme:{colors:e,direction:t}})=>[(0,D.mp)({direction:t}),{fontFamily:"TikTokFont",height:"24px",position:"relative",fontStyle:"normal",whiteSpace:"nowrap",fontWeight:600,fontSize:"16px",lineHeight:"24px",color:e.TextPrimary}]),"label:H2RechargeTextContainer;"),Kt="HAS_ENTERED_KEY",qt="HAS_ENTERED_VALUE";var Gt;!function(e){e[e.Showing=0]="Showing",e[e.Clicking=1]="Clicking"}(Gt||(Gt={}));const Vt=()=>(0,f.jsx)(Ot,{children:(0,f.jsx)(zt.A,{width:20,height:20})}),$t=()=>{const e=(0,I.s)();return(0,f.jsx)(re.m,{placement:"bottom",overlay:e("WebApp_coin_recharge_1"),children:(0,f.jsx)(Nt,{children:(0,f.jsx)(zt.A,{width:22.5,height:22.5})})})},Yt=()=>{const e=(0,I.s)(),t=(0,y.useHistory)(),o=(0,bt.Nj)(te.y_),[{atomState:n}]=(0,K.I)(Bt.v),{rechargeEntryPermission:i,isWebRechargedBefore:r}=n,s=i,l=(0,a.useCallback)((()=>{o.handleLiveWebGetCoinShow({show_page:"live_page",is_web_recharged_before:r?"yes":"no",request_page:"webapp",style:"icon_and_text"})}),[r,o]);(0,a.useEffect)((()=>{l()}),[l]);const c=(0,a.useCallback)((()=>{o.handleLiveWebGetCoinClick({show_page:"live_page",is_web_recharged_before:r?"yes":"no",request_page:"webapp",style:"icon_and_text"})}),[r,o]),d=(0,a.useCallback)((()=>{t.push(`${Wt.I7.coin}?enter_from=web_live_nav`)}),[t]),p=(0,a.useCallback)((()=>{c(),d()}),[c,d]);return s?(0,f.jsxs)(Ut,{"data-e2e":"LivePage-GetCoin",onClick:p,children:[(0,f.jsx)(Vt,{}),(0,f.jsx)(Ht,{children:e("WebApp_coin_recharge_1")})]}):null},Zt=()=>{const[e,t]=(0,a.useState)(!0),[o,n]=(0,a.useState)(!1),i=(0,y.useHistory)(),r=(0,I.s)(),l=(0,bt.Nj)(te.y_),c=(0,Q.W)((()=>["abTestVersion"]),[]),[{atomState:d}]=(0,K.I)(Bt.v),{rechargeEntryPermission:p,isWebRechargedBefore:u}=d,{isElectronApp:h}=(0,s.B)(),g=p,m=(0,ee.qt)(null==c?void 0:c.abTestVersion,"expose_recharge_entry_pc"),b=void 0===m||"v1"===m,x=void 0!==m&&"v2"===m,v=x&&e;(0,a.useEffect)((()=>{e&&x&&(0,ne._S)(Kt)===qt&&t(!1),n(!0)}),[e,x]);const _=(0,a.useCallback)((e=>{const t={show_page:"main_page",is_web_recharged_before:u?"yes":"no",request_page:"webapp",style:v?"icon_and_text":"icon_only"};0===e?l.handleLiveWebGetCoinShow(t):1===e&&l.handleLiveWebGetCoinClick(t)}),[l,u,v]),w=(0,a.useCallback)((()=>{_(0)}),[_]);(0,a.useEffect)((()=>{o&&g&&!b&&w()}),[o,e,g,b,w]);const k=(0,a.useCallback)((()=>{(0,ne.AP)(Kt,qt)}),[]),C=(0,a.useCallback)((()=>{const e=`${Wt.I7.coin}?enter_from=web_main_nav`;h&&window.open(e,"_blank"),i.push(e)}),[i,h]),j=(0,a.useCallback)((()=>{_(1)}),[_]),S=(0,a.useCallback)((()=>{x&&e&&k(),j(),C()}),[x,e,k,C,j]);return!g||b?null:v?(0,f.jsxs)(Ut,{onClick:S,children:[(0,f.jsx)(Vt,{}),(0,f.jsx)(Ht,{children:r("WebApp_coin_recharge_1")})]}):(0,f.jsx)(Ft,{onClick:S,children:(0,f.jsx)($t,{})})},Xt=({alwaysShowRechargeIconAndText:e})=>e?(0,f.jsx)(Yt,{}):(0,f.jsx)(Zt,{});var Jt=o(16469),Qt=o(21620);const eo=(0,p.default)("div",{target:"e1ngqdcv0"})({padding:"12px",width:"180px",wordBreak:"break-word"},"label:DivTipWrapper;"),to=(0,p.default)("p",{target:"e1ngqdcv1"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P3",color:"ConstTextInverse"})),"label:PTipDesc;"),oo=(0,a.memo)((({userPopupActive:e})=>{const t=(0,I.s)(),{colors:o,direction:n}=(0,Ce.u)(),[i,r]=(0,a.useState)(!1),{tooltipPriority:s,handlePopoverEnd:l,handlePopoverInitial:c}=(0,mt.N)(6),d=(0,a.useRef)(0),p="ltr"===n?"bottomRight":"bottomLeft",{removeOtherPop:u}=(0,X.gR)();return(0,a.useEffect)((()=>{Jt.bc.getItem(we.Ak)||u?l():6===s?(c(),r(!0),Qt.I.handleShowCollectionsTooltip(),Jt.bc.setItem(we.Ak,!0),Ct.U.handlePopupShow({enter_method:"series_popup"})):r(!1)}),[l,c,s,u]),(0,a.useEffect)((()=>(i&&(clearTimeout(d.current),d.current=window.setTimeout((()=>{r(!1),l()}),15e3)),()=>clearTimeout(d.current))),[i]),(0,a.useEffect)((()=>{e&&i&&(r(!1),l())}),[i,e]),(0,f.jsx)(Pe.z,{active:i,backgroundColor:o.ConstSecondary2,placement:p,arrowMargin:"16px",margin:"-12px",children:(0,f.jsx)(eo,{children:(0,f.jsx)(to,{children:t("tiktok_series_webapp_tooltip_get_started")})})})}));var no=o(20203),io=o(17189);const ao=(0,p.default)("div",{target:"e8m7uf60"})((({needMarginEnd:e=!1})=>({display:"flex",flexDirection:"row",alignItems:"center",position:"relative",marginInlineEnd:e?"70px":"unset"})),"label:DivHeaderRightContainer;"),ro=(0,p.default)(M.y,{target:"e8m7uf61"})((({theme:e,theme:{direction:t}})=>[(0,D.zy)({theme:e,typography:"P2",fontFamily:"TikTokFont",fontWeight:"bold"}),(0,D.mp)({direction:t,marginStart:"16px"}),{minWidth:"100px",WebkitAppRegion:"no-drag"}]),"label:StyledLoginButton;");ro.defaultProps=Object.assign(Object.assign({},ro.defaultProps),{"data-e2e":"top-login-button"});const so=(0,p.default)("div",{target:"e8m7uf62"})((({theme:{direction:e},isLoggedin:t})=>[(0,D.mp)({direction:e,marginStart:t?"23px":"16px",marginEnd:t?"0":"-10px",paddingStart:"5px"}),{alignItems:"center",width:"32px",height:"32px",paddingTop:"5px",WebkitAppRegion:"no-drag"}]),"label:DivEhIconContainer;");so.defaultProps=Object.assign(Object.assign({},so.defaultProps),{"data-e2e":"eh-header-icon"});const lo=(0,p.default)("i",{target:"e8m7uf63"})((({theme:{direction:e}})=>(0,D.mp)({direction:e,marginStart:"16px"})),{position:"relative",cursor:"pointer",fontStyle:"normal",padding:"0 4px",WebkitAppRegion:"no-drag"},"label:IMoreIconWrapper;");lo.defaultProps=Object.assign(Object.assign({},lo.defaultProps),{"data-e2e":"see-more-icon"});const co=(0,p.default)(io.A,{target:"e8m7uf64"})({width:"20px",height:"20px",display:"block"},"label:StyledEllipsisVertical;"),po=(0,p.default)("i",{target:"e8m7uf65"})((({theme:e})=>[(0,D.mp)({direction:e.direction,right:"unset",left:0}),{position:"absolute",width:"8px",height:"8px",borderRadius:"50%",background:e.colors.Primary,border:`1px solid ${e.colors.ConstTextInverse}`,boxSizing:"content-box",right:0,top:"-4px"}]),"label:IStyledRedDot;");po.defaultProps=Object.assign(Object.assign({},po.defaultProps),{"data-e2e":"profile-icon-red"});const uo=(0,p.default)("div",{target:"e8m7uf66"})((({theme:{direction:e,colors:t}})=>({width:"24px",height:"24px",display:"flex",justifyContent:"center",alignItems:"center",marginInlineStart:"26px",cursor:"pointer",position:"relative",WebkitAppRegion:"no-drag",":before":{display:"block",content:'""',position:"absolute",left:"rtl"===e?"unset":"-14px",right:"rtl"===e?"-14px":"unset",width:"1px",height:"24px",background:t.LinePrimary,top:"50%",transform:"translateY(-50%)"}})),"label:DivElectronSettingContainer;"),ho=(0,p.default)("div",{target:"e8m7uf67"})({position:"relative",width:"48px",height:"48px",display:"flex",justifyContent:"center",alignItems:"center",marginInlineStart:"12px",cursor:"pointer",WebkitAppRegion:"no-drag"},"label:DivDownloadContainer;"),go=(0,p.default)("div",{target:"e8m7uf68"})((({theme:e,theme:{direction:t,colors:o}})=>[(0,D.zy)({theme:e,color:"ConstTextInverse"}),{height:"18px",padding:"0 6px",borderRadius:"10px",backgroundColor:o.Primary,fontSize:"12px",lineHeight:"18px",fontWeight:600,position:"absolute",bottom:24,whiteSpace:"nowrap"},(0,D.mp)({direction:t,start:"28px"})]),"label:DivNewLabelContainer;"),fo=e=>{v.f.sendEvent("click_upload_entrance",e)};var mo=o(23255),bo=o(84783);const xo=(0,p.default)("div",{target:"e1on1cg30"})((({needMarginLeft:e})=>({marginLeft:e?"16px":"0px",position:"relative",height:"36px",WebkitAppRegion:"no-drag","a:hover":[{textDecoration:"none"}],"@media screen and (max-width: 479px)":{display:"none"}})),"label:DivUploadContainer;");xo.defaultProps=Object.assign(Object.assign({},xo.defaultProps),{"data-e2e":"upload-icon"});const vo=(0,p.default)(ce.N_,{target:"e1on1cg31"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P2",fontWeight:"bold",fontFamily:"TikTokFont"})),{display:"block",WebkitAppRegion:"no-drag",":hover":{textDecoration:"none"}},"label:StyledLinkText;");vo.defaultProps=Object.assign(Object.assign({},vo.defaultProps),{"data-e2e":"upload-icon"});const _o=(0,p.default)(ce.N_,{target:"e1on1cg32"})({display:"block"},"label:StyledLink;"),yo=(0,p.default)("div",{target:"e1on1cg33"})((({style:e})=>{var t,o;return{padding:null!==(t=null==e?void 0:e.padding)&&void 0!==t?t:"16px",width:null!==(o=null==e?void 0:e.width)&&void 0!==o?o:"282px",wordBreak:"break-word"}}),"label:DivTipWrapper;"),wo=(0,p.default)("div",{target:"e1on1cg34"})((({theme:{colors:e}})=>({minWidth:"110px",padding:"0 16px",height:"36px",border:"1px solid rgba(22, 24, 35, 0.12)",borderRadius:"2px",display:"flex",alignItems:"center",justifyContent:"center",background:e.BGSecondary2,":hover":{backgroundColor:e.BGView},":target":{backgroundColor:"rgba(22, 24, 35, 0.06)"}})),"label:DivUpload;"),ko=(0,p.default)(bo.A,{target:"e1on1cg35"})({height:"20px",width:"20px",marginRight:"8px"},"label:StyledPlusIcon;"),Co=(0,p.default)("span",{target:"e1on1cg36"})({fontStyle:"normal",fontWeight:600,fontSize:"16px",lineHeight:"24px",color:"ConstTextInverse2"},"label:SpanUploadText;"),jo=(0,p.default)("h3",{target:"e1on1cg37"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P2",color:"ConstTextInverse",fontWeight:"semiBold"})),{marginBottom:"4px"},"label:H3TipTitle;"),So=(0,p.default)("h3",{target:"e1on1cg38"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P3",color:"ConstTextInverse",fontWeight:"semiBold",textAlign:"center",lineHeight:"22px"})),"label:H3TipSmallTitle;"),Po=(0,p.default)("p",{target:"e1on1cg39"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P3",color:"ConstTextInverse"})),"label:PTipDesc;"),To=(0,p.default)("div",{target:"e1on1cg310"})({display:"flex",justifyContent:"flex-end"},"label:DivButtonWrapper;"),Eo=(0,p.default)("button",{target:"e1on1cg311"})(D.WA,(({theme:e})=>(0,D.zy)({theme:e,typography:"P2",color:"ConstTextInverse",fontWeight:"semiBold"})),{cursor:"pointer"},"label:ButtonOk;"),Io=(0,p.default)(Eo,{target:"e1on1cg312"})({width:"100%",height:"36px",borderRadius:"4px",backgroundColor:"rgba(255, 255, 255, .12)",marginTop:"8px"},"label:StyledButtonUpload;");var Ao;!function(e){e[e.Schedule=0]="Schedule",e[e.LongVideo=1]="LongVideo",e[e.Podcast=2]="Podcast"}(Ao||(Ao={}));const Lo=function({needMarginLeft:e}){var t,o;const n=(0,I.s)(),{colors:i,direction:r}=(0,Ce.u)(),[l,c]=(0,a.useState)(0),[,d]=(0,U.S)(we.GC),p=(0,Q.W)((()=>["user"]),[]),{showScheduleTips:u,showPodcastTooltip:h}=(0,J.L$)(null==p?void 0:p.user),[g,m]=(0,a.useState)(!1),{tooltipPriority:b,maxPublishVideoDuration:x,handlePopoverEnd:v,handlePopoverInitial:_}=(0,mt.N)(4),{lang:y}=(0,S.P)(P.L,{selector:e=>({lang:e.lang}),dependencies:[]}),{removeUploadPop:w}=(0,X.gR)(),k=x,C=(0,a.useCallback)((()=>{v(),m(!1),d.postScheduleRecord({ack_type:1})}),[d,v]),j=(0,a.useCallback)((()=>{fo({enter_method:"navigation_bar"}),mo.t.handleClickNav({target:"upload",order:1})}),[]);(0,a.useEffect)((()=>{d.checkLongVideoTooltipStatus({})}),[d]),(0,a.useEffect)((()=>{4!==b||w?(v(),m(!1)):setTimeout((()=>{_(),u?(c(0),m(!0),Ct.U.handlePopupShow({enter_method:"schedule_popup"})):k>0?(c(1),m(!0),Ct.U.handlePopupShow({enter_method:"long_video_popup"})):h&&!Jt.bc.getItem(we.xX)?(c(2),m(!0),Ct.U.handlePopupShow({enter_method:"podcast_popup"})):(v(),m(!1))}),1e3)}),[v,_,b,u,k,h,w]),(0,a.useEffect)((()=>{if(g){switch(l){case 1:Jt.bc.setItem(we.VB,!0);break;case 2:Jt.bc.setItem(we.xX,!0)}setTimeout((()=>{v(),m(!1)}),15e3)}}),[d,v,g,l]);const T=(0,a.useCallback)((()=>{v(),m(!1),window.location.href=`https://www.tiktok.com/upload?lang=${y}`}),[v,y]),E=(0,f.jsxs)(wo,{children:[(0,f.jsx)(ko,{}),(0,f.jsx)(Co,{children:n("Upload")})]}),A=null===(t=(0,Q.W)((()=>["abTestVersion"]),[]))||void 0===t?void 0:t.abTestVersion,L="v1"!==(null!==(o=(0,ee.qt)(A,"creator_center_reverse"))&&void 0!==o?o:"v2")?"/tiktokstudio/upload?from=upload":`/upload?lang=${y}`,{isElectronApp:D}=(0,s.B)();let M,R,z;switch(l){case 0:M=(0,f.jsx)(jo,{children:n("scheduler_welcome_tooltip_title")}),R=n("scheduler_welcome_tooltip_des"),z=(0,f.jsx)(To,{children:(0,f.jsx)(Eo,{onClick:C,children:n("OK")})});break;case 1:M=(0,f.jsx)(jo,{children:n("tenMinPlusUpload_webPage_introduceToolTip_title",{minute:k}).replace(/%\w/,String(k))}),R=n("tenMinPlusUpload_webPage_introduceToolTip_body",{minute:k}).replace(/%\w/,String(k)),z=(0,f.jsx)(Io,{onClick:T,children:n("new_feature_guidance_Upload")});break;case 2:M=(0,f.jsx)(So,{children:n("podcasts_linkFullEpisodes_linkPodcastPage_tooltip")})}const W=2===l?"58px":"16px",B="ltr"===r?"bottomRight":"bottomLeft";return(0,f.jsxs)(xo,{needMarginLeft:e,children:[(0,f.jsx)(_o,{forceSSR:!0,to:L,target:D?"_blank":"_self",onClick:j,ariaLabel:n("accessibilityLabels_forYou_nav_upload_btn"),children:E}),(0,f.jsx)(Pe.z,{active:g&&Boolean(M),backgroundColor:i.ConstSecondary2,placement:B,arrowMargin:W,margin:"-12px",children:(0,f.jsxs)(yo,{style:2===l?{width:"max-content",padding:"12px",textAlign:"center"}:void 0,children:[M,(0,f.jsx)(Po,{children:R}),z]})})]})},Do=function(){const e=(0,I.s)(),t=(0,Z.b1)(),o=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),fo({enter_method:"navigation_bar"}),t.openModal({query:{enter_method:"click_navigation_bar",redirect_url:"https://www.tiktok.com/upload/"}})}),[t]);return(0,f.jsx)("div",{children:(0,f.jsx)(vo,{forceSSR:!0,to:"/upload",onClick:o,ariaLabel:e("accessibilityLabels_forYou_nav_upload_btn"),children:(0,f.jsxs)(wo,{children:[(0,f.jsx)(ko,{}),(0,f.jsx)(Co,{children:e("Upload")})]})})})},Mo={id:"maximize-e9777099",use:"maximize-e9777099-usage",viewBox:"0 0 20 20",content:''};function Ro(e){const t=(0,a.useContext)(Te.X);return(0,a.useLayoutEffect)((()=>(t.add(Mo),()=>{t.remove("maximize-e9777099")})),[]),(0,f.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,f.jsx)("use",{xlinkHref:"#maximize-e9777099"},void 0)}),void 0)}const zo={id:"maximize-dark-7a16b296",use:"maximize-dark-7a16b296-usage",viewBox:"0 0 20 20",content:''};function Wo(e){const t=(0,a.useContext)(Te.X);return(0,a.useLayoutEffect)((()=>(t.add(zo),()=>{t.remove("maximize-dark-7a16b296")})),[]),(0,f.jsx)("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},e,{children:(0,f.jsx)("use",{xlinkHref:"#maximize-dark-7a16b296"},void 0)}),void 0)}const Bo=(0,p.default)("div",{target:"e9yoi3o0"})({height:"20px",display:"flex",alignItems:"center",WebkitAppRegion:"no-drag"},"label:DivToolbarWrapper;"),Fo=(0,p.default)("div",{target:"e9yoi3o1"})({width:"20px",height:"20px",marginInlineStart:"12px",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},"label:DivToolIconWrapper;"),No=(0,p.default)(Ro,{target:"e9yoi3o2"})({width:"20px",height:"20px"},"label:StyledMaximizeIcon;"),Oo=(0,p.default)(Wo,{target:"e9yoi3o3"})({width:"20px",height:"20px"},"label:StyledMaximizeDarkIcon;"),Uo=(0,p.default)("img",{target:"e9yoi3o4"})({width:"20px",height:"20px"},"label:ImgUnMaximize;");var Ho=o(62998),Ko=o(30543);const qo=o.p+"993b033eb04317ef03e7.png",Go=o.p+"e32127eb9c7c49723b79.png";const Vo=(0,a.memo)((()=>{const{isMaximized:e}=function(){const[e,t]=(0,a.useState)(!1),o=(0,a.useCallback)((()=>{return e=this,o=void 0,i=function*(){const{data:e}=yield x().app.isFull();t(e)},new((n=void 0)||(n=Promise))((function(t,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof n?o:new n((function(e){e(o)}))).then(r,s)}l((i=i.apply(e,o||[])).next())}));var e,o,n,i}),[]);return(0,a.useEffect)((()=>{o()}),[o]),(0,a.useEffect)((()=>{const e=x().on("ON_MAXIMIZE_CHANGE",((e,{data:o})=>{t(o)}));return()=>{null==e||e()}}),[]),{isMaximized:e}}(),{isDark:t}=(0,Ce.u)();(0,a.useEffect)((()=>{x().app.handlePageReady()}),[]);const o=(0,a.useCallback)((()=>{v.f.sendEvent("click_close_app_button"),x().app.closeWindow()}),[]),n=(0,a.useCallback)((()=>{v.f.sendEvent("click_minimize_button"),x().app.minimize()}),[]),i=(0,a.useCallback)((()=>{return e=void 0,t=void 0,n=function*(){v.f.sendEvent("click_maximize_button"),x().app.maximize()},new((o=void 0)||(o=Promise))((function(i,a){function r(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(r,s)}l((n=n.apply(e,t||[])).next())}));var e,t,o,n}),[]),r=t?(0,f.jsx)(Oo,{}):(0,f.jsx)(No,{}),s=(0,f.jsx)(Uo,{src:t?Go:qo});return(0,f.jsxs)(Bo,{children:[(0,f.jsx)(Fo,{onClick:n,children:(0,f.jsx)(Ho.b,{size:20})}),(0,f.jsx)(Fo,{onClick:i,children:e?s:r}),(0,f.jsx)(Fo,{onClick:o,children:(0,f.jsx)(Ko.g,{size:20})})]})}));var $o=o(8227),Yo=o(42712);const Zo=(0,H.Ay)({resolved:{},chunkName:()=>"download-animation",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!o.m[t]},importAsync:()=>Promise.all([o.e(2402),o.e(7598)]).then(o.bind(o,32599)),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:()=>32599}),Xo=function({alwaysShowRechargeIconAndText:e=!1,disableToggleTheme:t=!1,reportRechargeClickToLogin:o}){var n;const r=(0,I.s)(),{isRTL:c}=(0,$.m)(),{user:d}=(0,S.P)(P.L,{selector:e=>{var t;return{user:null===(t=e.appContext)||void 0===t?void 0:t.user}},dependencies:[]}),p=(0,a.useRef)(!1);p.current=(0,Yo.Y)();const[u,h]=(0,a.useState)(!1),[g,m]=(0,a.useState)(!1),{hasNewFeedbackReply:b}=(0,S.P)(Y.i),x=(0,Z.b1)(),{showUpload:_}=(0,X.E1)(),{isElectronApp:w,isWinElectronApp:k,isMacElectronApp:C}=(0,s.B)(),{enableMessageRefactor:j,enableUploadRefactor:T}=(0,X.NF)(),E=[ue.no.messages,ue.no.setting,ue.no.settingBlockList,ue.no.feedback,ue.no.feedbackReport,ue.no.feedbackHistory,ue.no.upload,Wt.I7.coin,$o.vI.kyc,$o.vI.kycSubmission,$o.vI.studioFaq,$o.vI.studioDownload,$o.vI.giftCpcFaq],A=(0,y.useRouteMatch)(E),D=(0,i.oY)()||A,M=(0,a.useMemo)((()=>!(w||!d||T&&!D)),[w,T,D,d]),R=(0,a.useMemo)((()=>!(!(null==d?void 0:d.hasIMPermission)||j&&!D)),[null==d?void 0:d.hasIMPermission,j,D]),{abTestVersion:z,region:W}=(0,J.L$)((0,Q.W)((()=>["abTestVersion","region"]),[])),B=null!==(n=(0,ee.qt)(z,"search_video"))&&void 0!==n?n:"v1",F=Boolean(d),[N,O]=(0,U.S)(we.GC,{selector:e=>-1!==e.redDot.indexOf(1),dependencies:[]}),H=(0,bt.Nj)(te.y_),ae=(0,a.useCallback)(((e=!1)=>()=>{o&&o({click_area:"top_bar"});const t=(0,V.Y)()||(0,V.CW)();x.openModal({closeable:!0,isSignup:e,query:{enter_method:"click_top_bar",redirect_url:(0,L.Q2)(),last_group_id:t,type:"general_search"!==v.f.commonParams.page_name&&"search_video"!==v.f.commonParams.page_name&&"search_user"!==v.f.commonParams.page_name||"v3"!==B&&"v4"!==B||F?"":"loginsearchmore"}})}),[x,B,F,H]),{active:re,handleMouseEnter:se,handleMouseLeave:le}=(0,oe.K)(500),{active:ce,handleMouseEnter:de,handleMouseLeave:pe}=(0,oe.K)(500),{active:he,handleMouseEnter:ge,handleMouseLeave:fe,handleEndAutoShow:me}=(0,i.r7)(500),{isDesktopTestV2:be}=(0,l._j)(),je=(0,l.K8)(),Se=!w&&be&&!je,[,Pe]=(0,K.I)(Bt.v);(0,a.useEffect)((()=>{var e;const t=`${null===window||void 0===window?void 0:window.location.host}${null===window||void 0===window?void 0:window.location.pathname}`;Pe({uid:null!==(e=null==d?void 0:d.uid)&&void 0!==e?e:"",region:W,source:t})}),[d,W]),(0,a.useEffect)((()=>{re&&(ve.W.handleShowEntrance(),_e.d.handleProfileHoveShow(p.current))}),[re]),(0,a.useEffect)((()=>{const e=(0,ne._S)(ie.fm);h(!e)}),[]),(0,a.useEffect)((()=>{Se&&he&&(h(!1),(0,ne.AP)(ie.fm,"1"),v.f.sendEvent("desktop_app_download_show"))}),[he,Se]);const Te=(0,a.useCallback)((()=>{N&&O.updateRedDot({type:1}),se()}),[N,O,se]),Ee=(0,a.useCallback)((e=>{const t=document.querySelector(`#${ye.dy}`),o=e.target===t;13===e.keyCode||32===e.keyCode?(e.stopPropagation(),o&&(e.preventDefault(),Te())):9===e.keyCode&&e.shiftKey&&re&&o&&le()}),[re,Te,le]),Ie=(0,a.useCallback)((e=>{27===e.keyCode&&(e.preventDefault(),e.stopPropagation(),le())}),[le]),Ae=(0,a.useCallback)((()=>{m(!0),me()}),[]),Le=(0,a.useCallback)((()=>{m(!1)}),[]),De=C&&c,{isDark:Me}=(0,Ce.u)();if(!d)return(0,f.jsxs)(ao,{needMarginEnd:De,children:[_&&!w&&(0,f.jsx)(Do,{}),(0,f.jsx)(ro,{id:"header-login-button",size:"medium",buttonTheme:"primary",onClick:ae(!1),children:r("Log In")}),Se&&(0,f.jsxs)(ho,{onMouseEnter:ge,onMouseLeave:fe,children:[u?(0,f.jsx)(go,{children:r("Inbox_New")}):null,g?(0,f.jsx)(Zo,{isDark:Me}):(0,f.jsx)(q._,{size:26}),(0,f.jsx)(Ne,{onStartLoading:Ae,onEndLoading:Le,active:he,margin:-46,e2eTag:"download-popup",onKeyDown:Ie,onBlur:fe})]}),(0,f.jsxs)(lo,{id:ye.dy,tabIndex:0,onMouseEnter:Te,onMouseLeave:le,onKeyDown:Ee,role:"button","aria-label":r("accessibilityLabels_forYou_nav_settings_btn"),"aria-expanded":re,"aria-controls":re?ye.hA:"",children:[(0,f.jsx)(co,{}),(0,f.jsx)(no.t,{active:re,e2eTag:"see-more-popup",margin:-13,onKeyDown:Ie,onBlur:le,disableToggleTheme:t})]}),w&&(0,f.jsxs)(uo,{onMouseEnter:de,onMouseLeave:pe,children:[(0,f.jsx)(G.C,{size:20}),(0,f.jsx)(Ge,{margin:-12,active:ce,e2eTag:"electron-setting-popup",onBlur:pe})]}),k&&(0,f.jsx)(Vo,{})]});const{uniqueId:Re,secUid:ze}=d;return(0,f.jsxs)(ao,{needMarginEnd:De,children:[M&&(0,f.jsx)(Lo,{}),Se&&(0,f.jsxs)(ho,{onMouseEnter:ge,onMouseLeave:fe,children:[u?(0,f.jsx)(go,{children:r("Inbox_New")}):null,g?(0,f.jsx)(Zo,{isDark:Me}):(0,f.jsx)(q._,{size:26}),(0,f.jsx)(Ne,{onStartLoading:Ae,onEndLoading:Le,active:he,margin:-46,e2eTag:"download-popup",onKeyDown:Ie,onBlur:fe})]}),R&&(0,f.jsx)(xe,{}),(0,f.jsx)(wt,{}),!w&&(0,f.jsx)(Xt,{alwaysShowRechargeIconAndText:e}),(0,f.jsx)(jt,{children:(0,f.jsxs)(ke.W,{id:ye.dy,onMouseEnter:Te,onMouseLeave:le,onKeyDown:Ee,role:"button",ariaLabel:r("accessibilityLabels_forYou_nav_settings_btn"),ariaExpanded:re,children:[(b||N)&&(0,f.jsx)(po,{className:"red-dot"}),(0,f.jsx)(no.t,{margin:-12,active:re,e2eTag:"profile-popup",onKeyDown:Ie,onBlur:le,disableToggleTheme:t}),(0,f.jsx)(Rt,{uniqueId:Re,secUid:ze,userPopupActive:re})]})}),w&&(0,f.jsxs)(uo,{onMouseEnter:de,onMouseLeave:pe,children:[(0,f.jsx)(G.C,{size:20}),(0,f.jsx)(Ge,{margin:-12,active:ce,e2eTag:"electron-setting-popup",onBlur:pe})]}),k&&(0,f.jsx)(Vo,{}),(null==d?void 0:d.hasCollectionsAccess)&&(0,f.jsx)(oo,{userPopupActive:re})]})};var Jo=o(72241);const Qo=(0,p.default)("div",{target:"etz70ds0"})({position:"relative",minWidth:"200px",padding:"0 8px",width:"516px","-webkit-app-region":"no-drag"},(0,D.jJ)({max:767,style:{display:"none"}}),"label:DivHeaderCenterContainer;"),en=(0,p.default)("div",{target:"etz70ds1"})((({marginInlineStart:e="unset"})=>({display:"flex",alignItems:"center",minWidth:"300px",marginInlineStart:e})),"label:DivHeaderLeftContainer;"),tn=(0,a.memo)((function(e){const{visible:t=!0,showLogo:o=!0,isWideHeader:n,electronElement:i,pushElement:r,leftContainerStyle:s,reportRechargeClickToLogin:l}=e,{isLoaded:c,isGrayFilter:d}=function(){const{isAppContextLoaded:e}=(0,S.P)(P.L,{selector:({appContext:e})=>({isAppContextLoaded:Boolean(e)}),dependencies:[]}),{isBizContextLoaded:t,isGrayFilter:o}=(0,S.P)(T.$,{selector:({bizContext:e})=>({isBizContextLoaded:Boolean(e),isGrayFilter:null==e?void 0:e.config.isGrayFilter}),dependencies:[]});return{isLoaded:(0,a.useMemo)((()=>e&&t),[e,t]),isGrayFilter:o}}(),p=function(){const[e,t]=(0,a.useState)(0),o=(0,a.useCallback)((({hasModal:e,scrollWidth:o})=>{t(e?o:0)}),[]),{subscribeModalChange:n}=(0,E.g)();return(0,a.useEffect)((()=>{const e=n(o);return()=>{e()}}),[o,n]),e}(),{value:u}=(0,a.useContext)(Jo.xm),h=n?F:B;return(0,f.jsxs)(W,{id:"app-header",scrollWidth:p,style:{display:t?"flex":"none"},children:[r,(0,f.jsxs)(h,{children:[(0,f.jsx)(z,{}),(0,f.jsxs)(en,{marginInlineStart:null==s?void 0:s.marginInlineStart,children:[o&&(0,f.jsx)(N.g,{isGrayFilter:d,isDark:u}),i]}),(0,f.jsx)(Qo,{children:(0,f.jsx)(O.v,{})}),c&&(0,f.jsx)(Xo,{reportRechargeClickToLogin:l})]})]})}));var on,nn,an=o(58632),rn=o(64162),sn=o(4126),ln=o(93995),cn=o(23999),dn=o(26324),pn=o(95719),un=o(8536),hn=o(62564),gn=o(20259);!function(e){e.Show="browser_push_notifications_show",e.Granted="browser_push_notifications_allow",e.Denied="browser_push_notifications_block",e.Default="browser_push_notifications_close"}(on||(on={})),function(e){e.Show="guide_permission_popup_show",e.Yes="guide_permission_popup_turn_on",e.No="guide_permission_popup_cancel"}(nn||(nn={}));var fn,mn=o(38203),bn=o(65070),xn=o(68628),vn=o(9796);function _n(){return e=this,t=void 0,i=function*(){const{FCM:e}=yield Promise.resolve().then(o.bind(o,44805));return e},new((n=void 0)||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}!function(e){e.GrantedSuccess="GRANTED_SUCCESS",e.GrantedFailed="GRANTED_FAILED",e.Denied="DENIED",e.Default="DEFAULT",e.Failed="FAILED"}(fn||(fn={}));const yn="web-push-permission";let wn=class{initFCM(e,t,o){o||console.error("Error. Unable to get firebaseApiKey...");const n={firebaseConfig:{apiKey:o,appId:"1:943363548815:web:f9a03b69b49a48fb5c72fa",authDomain:"tiktok-webapp.firebaseapp.com",databaseURL:"https://tiktok-webapp.firebaseio.com",measurementId:"G-WTKRD0C8TF",messagingSenderId:"943363548815",projectId:"tiktok-webapp",storageBucket:"tiktok-webapp.appspot.com"},messagingConfig:{vapidKey:"BAxZo-Q87DGZeDuCG33n7l9hsdXb2Zwf3-Cc9_NPuaNZvqMCHhCtCm-5kivnFwhVef1N06SoKbWlJBpZU0jcfa4",onMessageShow:!0,requestPermission:!1},commonParameter:{aid:1988,sender_id:17,app_region:e,app_language:t,version_code:"1.0.0"}};return(0,bn.p)([_n(),(0,xn.H)(vn.Qf.load())]).pipe((0,un.Z)((([e])=>{const t=new e(n.firebaseConfig,n.messagingConfig,n.commonParameter);return(0,xn.H)(t.requestPermission().then((e=>{switch(e){case"granted":return t.onTokenRefresh().then((()=>"GRANTED_SUCCESS")).catch((()=>"GRANTED_FAILED"));case"denied":return"DENIED";default:return"DEFAULT"}})))})),(0,gn.W)((()=>(console.warn("fcm init failed"),(0,cn.of)("FAILED")))))}getPushPermissionAllowed(){var e;try{const t=null!==(e=Jt.bc.getItem(yn))&&void 0!==e?e:[],o=Date.now();return 0===t.length?(t.unshift(o),Jt.bc.setItem(yn,t),(0,cn.of)(!0)):o-t[0]<864e5?(0,cn.of)(!1):t.length<3?(t.unshift(o),Jt.bc.setItem(yn,t),(0,cn.of)(!0)):o-t[2]<2592e6?(0,cn.of)(!1):(t.unshift(o),Jt.bc.setItem(yn,t.slice(0,3)),(0,cn.of)(!0))}catch(e){return(0,cn.of)(!1)}}};wn=(0,an.__decorate)([(0,mn._)()],wn);let kn=class extends rn.E{constructor(e){super(),this.service=e,this.defaultState={pushPermissionOn:!1}}setPushPermissionOn(e,t){e.pushPermissionOn=t}initFCM(e){return e.pipe((0,pn.M)((({showMethod:e})=>{e&&(e=>{v.f.event("browser_push_notifications_show",{show_method:e})})(e)})),(0,un.Z)((({region:e,lang:t,showMethod:o,firebaseApiKey:n,callback:i})=>this.service.initFCM(e,t,n).pipe((0,pn.M)((e=>{if(null==i||i(e),o)switch(e){case"GRANTED_SUCCESS":case"GRANTED_FAILED":(e=>{v.f.event("browser_push_notifications_allow",{show_method:e})})(o);break;case"DENIED":(e=>{v.f.event("browser_push_notifications_block",{show_method:e})})(o);break;case"DEFAULT":(e=>{v.f.event("browser_push_notifications_close",{show_method:e})})(o)}})),(0,hn.T)((()=>this.noop()))))))}judgeIfPush(e){return e.pipe((0,un.Z)((({region:e,lang:t,firebaseApiKey:o})=>this.service.getPushPermissionAllowed().pipe((0,hn.T)((n=>n?this.getActions().initFCM({region:e,lang:t,firebaseApiKey:o,showMethod:"direct_ask_notification_permission"}):this.noop())),(0,gn.W)((()=>(0,cn.of)(this.noop())))))))}};(0,an.__decorate)([(0,sn.h5)(),(0,an.__metadata)("design:type",Function),(0,an.__metadata)("design:paramtypes",[Object,Boolean]),(0,an.__metadata)("design:returntype",void 0)],kn.prototype,"setPushPermissionOn",null),(0,an.__decorate)([(0,sn.Mj)(),(0,an.__metadata)("design:type",Function),(0,an.__metadata)("design:paramtypes",[dn.c]),(0,an.__metadata)("design:returntype",void 0)],kn.prototype,"initFCM",null),(0,an.__decorate)([(0,sn.Mj)(),(0,an.__metadata)("design:type",Function),(0,an.__metadata)("design:paramtypes",[dn.c]),(0,an.__metadata)("design:returntype",void 0)],kn.prototype,"judgeIfPush",null),kn=(0,an.__decorate)([(0,ln.n)("Push"),(0,an.__metadata)("design:paramtypes",[wn])],kn);const Cn=(0,p.default)("div",{target:"e1gxxrd20"})((({theme:{colors:e}})=>({position:"absolute",boxSizing:"border-box",width:"400px",padding:"32px",top:"0",left:"50%",transform:"translateX(-50%)",background:e.BGPrimary,boxShadow:"0 2px 12px rgba(0, 0, 0, .12)",borderRadius:"8px",zIndex:2,textAlign:"center"})),"label:DivPushPermissionContainer;"),jn=(0,p.default)("div",{target:"e1gxxrd21"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P0",fontWeight:"bold",fontFamily:"TikTokFont"})),"label:DivPushPermissionTitle;"),Sn=(0,p.default)("div",{target:"e1gxxrd22"})((({theme:e})=>(0,D.zy)({theme:e,typography:"P2",fontFamily:"TikTokFont"})),(({theme:{colors:e}})=>({margin:"8px 0 24px",color:e.TextPrimary})),"label:DivPushPermissionSubtitle;"),Pn=(0,p.default)("div",{target:"e1gxxrd23"})({display:"flex","flex-direction":"row","justify-content":"space-between","align-items":"center"},"label:DivPushPermissionButtonContainer;"),Tn=(0,p.default)(M.y,{target:"e1gxxrd24"})({"min-width":"164px"},"label:StyledButton;"),En=function({permissionCallback:e}){const t=(0,I.s)();(0,a.useEffect)((()=>{v.f.event("guide_permission_popup_show")}),[]);const o=(0,a.useCallback)((()=>{e("denied"),v.f.event("guide_permission_popup_cancel")}),[e]),i=(0,a.useCallback)((()=>{e("granted"),v.f.event("guide_permission_popup_turn_on")}),[e]);return(0,n.FD)(Cn,{children:[(0,n.Y)(jn,{children:t("push_popup_title")}),(0,n.Y)(Sn,{children:t("push_popup_content")}),(0,n.FD)(Pn,{children:[(0,n.Y)(Tn,{buttonTheme:"default",size:"largeNew",onClick:o,children:t("push_popup_btn1")}),(0,n.Y)(Tn,{buttonTheme:"primary",size:"largeNew",onClick:i,children:t("push_popup_btn2")})]})]})};var In=o(66994);const An=(0,a.memo)((function({visible:e=!0}){const{pathname:t}=(0,r.zy)(),{pushPermissionOn:o,permissionCallback:i}=function(){const[{pushPermissionOn:e},t]=(0,U.S)(kn),{lang:o,region:n,user:i}=(0,S.P)(P.L,{selector:e=>{var t,o,n,i;return{lang:e.lang,region:null!==(o=null===(t=e.appContext)||void 0===t?void 0:t.region)&&void 0!==o?o:"",user:null===(n=e.appContext)||void 0===n?void 0:n.user,abTestVersion:null===(i=e.appContext)||void 0===i?void 0:i.abTestVersion}},dependencies:[]}),{firebaseApiKey:r}=(0,S.P)(T.$,{selector:({bizContext:e})=>{var t;return{firebaseApiKey:(null===(t=null==e?void 0:e.apiKeys)||void 0===t?void 0:t.firebase)||""}},dependencies:[]}),s=(0,a.useCallback)((e=>{t.setPushPermissionOn(!1),"granted"===e&&t.initFCM({region:n,lang:o,firebaseApiKey:r,showMethod:"click_guide_permission_popup_turn_on"})}),[n,o,r,t]),l=(0,a.useCallback)((()=>{_n().then((e=>{if(e.isAvailable()&&("US"!==n||i))switch(Notification.permission){case"denied":return;case"granted":t.initFCM({region:n,lang:o,firebaseApiKey:r});break;default:t.judgeIfPush({region:n,lang:o,firebaseApiKey:r})}})).catch((()=>{console.warn("load fcm failed")}))}),[n,i,t,o]);return(0,a.useEffect)((()=>{l()}),[l]),{pushPermissionOn:e,permissionCallback:s}}(),{isElectronApp:d,isMacElectronApp:p,isWinElectronApp:u}=(0,s.B)(),h=(0,l.W3)(),f=(0,l.Sd)(),m=(0,c.Tc)(t)||(0,c.hh)(t),b=!p||p&&m,x=u||m?"20px":"80px",v=p&&m?"60px":"unset",y=!h&&!f,w=!f,k=function(){const{isFeedbackPage:e}=(0,In.YH)();return!e}(),E=o?(0,n.Y)(En,{permissionCallback:i}):null,I=d&&(0,n.FD)(g,{marginInlineStart:x,children:[y&&(0,n.Y)(_,{}),w&&(0,n.Y)(C,{}),(0,n.Y)(j,{})]});return(0,n.Y)(tn,{showLogo:b,visible:e,isWideHeader:k,pushElement:E,electronElement:I,leftContainerStyle:{marginInlineStart:v}})})),Ln=()=>{const e=(0,i.oY)(),{showFullSideNav:t}=(0,X.vY)();return(0,n.Y)(An,{visible:!e&&!t})}},82858:(e,t,o)=>{o.d(t,{Eo:()=>s});var n=o(46682),i=o(75974),a=o(40099),r=o(37434);function s(){var e;const[t]=(0,n.S)(i.P),[o,s]=(0,a.useState)(!1),[l,c]=(0,a.useState)(!1),d=(0,r.Us)();return(0,a.useEffect)((()=>{s(t.engagementCountHide),c(t.guardianComplianceSettingInited)}),[t.engagementCountHide,t.guardianComplianceSettingInited]),!!Boolean(null===(e=d.appContext)||void 0===e?void 0:e.user)&&(!l||o)}},70142:(e,t,o)=>{o.d(t,{dw:()=>i,ke:()=>a,t3:()=>n});const n=(e,t,o=!0,n=!1)=>{const{keyCode:i,altKey:a,ctrlKey:r,metaKey:s,key:l}=e;if(!t&&[13,32,38,40].includes(i))return 2;if(!t&&n&&27===i)return 13;if(8===i||144===i||1===l.length&&32!==i&&!a&&!r&&!s)return t?10:2;if(t)switch(i){case 38:return a?4:1;case 40:return a?12:0;case 27:return 3;case 13:case 32:return 4;case 33:return 8;case 34:return 7;case 36:return 5;case 35:return 6;case 9:return o?11:4;default:return 12}return 12},i=e=>{const{keyCode:t}=e;switch(t){case 38:case 37:return 1;case 40:case 39:return 0;case 13:case 32:return 2;default:return 4}},a=e=>{try{const t=e.querySelectorAll('a[href], button, input, textarea, details, [tabindex]:not([tabindex="-1"])');return Array.from(t).filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden")&&e.clientWidth>0))}catch(e){return console.warn("[A11y] no focusable element found: ",e),[]}}},54129:(e,t,o)=>{o.d(t,{s:()=>a});var n,i=o(93608);!function(e){e.SaveProfile="save_profile",e.ClickEditProfile="click_edit_profile",e.EditProfileNotifyShow="edit_profile_notify_show",e.CancelEditProfile="cancel_edit_profile",e.CancelEditProfileShow="cancel_edit_profile_show"}(n||(n={}));const a={handleSaveReport:e=>{i.f.event("save_profile",e)},handleClickEditProfile:e=>{i.f.event("click_edit_profile",e)},handleShowProfileTooltip:e=>{i.f.event("edit_profile_notify_show",e)},handleCancelEditProfile:e=>{i.f.event("cancel_edit_profile",e)},handleCloseProfileTooltip:e=>{i.f.event("cancel_edit_profile_show",e)}}}}]);