/*! VERSION | 11.1.0 */"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[5254,4963],{55788:(e,t,a)=>{a.d(t,{Z:()=>i});let i={root:"ViewCamWrapper#p6",theatreMode:"ViewCamWrapper__theatreMode#fV",videoLayout:"ViewCamWrapper__videoLayout#EP",video:"ViewCamWrapper__video#XY",chatLayout:"ViewCamWrapper__chatLayout#HW",chat:"ViewCamWrapper__chat#Fq",vertical:"ViewCamWrapper__vertical#AV",isPoster:"ViewCamWrapper__isPoster#lT"}},62962:(e,t,a)=>{a.d(t,{W:()=>i});let i=(0,a(98846).n7)({resolved:{},chunkName:()=>"ModelChat",isReady(e){let t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Promise.resolve().then(a.bind(a,36106)),requireAsync(e){let t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){return a(this.resolve(e))},resolve:()=>36106})},48233:(e,t,a)=>{a.d(t,{Z:()=>C});var i=a(27378),s=a(48204),r=a(99382),n=a(29413),l=a(43806),o=a(3034),c=a(99973),d=a(99748),u=a(97606),m=a(80176),p=a(7685),h=a(243),v=a(68020),E=a(40671),g=a(29421);let S={routerPush:m.J5,requestPrivate:E.zG},C=(0,s.$j)(e=>({offlinePrivateProposal:(0,v.Y5)(e),isViewCamPage:(0,h.mT)(e),proposeError:(0,g.Nh)(e),isProposeLoading:(0,g.sh)(e)}),S)(e=>{var t;let{trans:a}=(0,u.QT)(),[s,m]=(0,i.useState)(!1),{className:h,model:v,offlinePrivateProposal:E,isViewCamPage:g,proposeError:S,isProposeLoading:C}=e,b=(0,p.L)("request-private-button-");(0,i.useEffect)(()=>{m(!!(null==E?void 0:E.declined))},[E]);let T=E&&!s&&v.id===(null==E?void 0:null===(t=E.model)||void 0===t?void 0:t.id),w="request-private-button";return i.createElement(i.Fragment,null,!!E&&i.createElement(o.Z,{isMobileRelative:!1,indentation:4,placement:"bottom",targetId:b},a(T?"viewCamStatuses.offline.requestPrivate.alreadyRequestedPrivateOfTheModel":"viewCamStatuses.offline.requestPrivate.alreadyRequestingPrivateFromAnotherModel")),i.createElement("div",{id:b,className:(0,d.AK)("request-private-button",h,{"request-private-button--with-timer":T})},!!S&&i.createElement(o.Z,{isMobileRelative:!1,indentation:4,placement:"top",targetId:w,isForceVisible:!0},a("viewCamStatuses.offline.requestPrivate.alreadyRequestingPrivateFromAnotherUser")),i.createElement("span",{id:w},i.createElement(r.ZP,{onClick:()=>{if(g){e.requestPrivate(v.id);return}e.routerPush(`/${v.username}`)},disabled:!!E||!!S,loading:C},T?i.createElement("div",{className:"request-private-button__timer"},i.createElement(n.Z,{img:"clock",size:16}),i.createElement(l.Z,{maxTime:c.ht,endTime:E.expiresAt,onTimeEnd:()=>{m(!0)}})):i.createElement(i.Fragment,null,i.createElement(n.Z,{img:"flash"}),a("viewCamStatuses.offline.requestPrivate.button"))))))})},29409:(e,t,a)=>{a.d(t,{r:()=>r});var i=a(27378),s=a(98655);let r=(0,a(98846).n7)({resolved:{},chunkName:()=>"TicketShowConfirmationModal",isReady(e){let t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>a.e(3742).then(a.bind(a,70143)),requireAsync(e){let t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){return a(this.resolve(e))},resolve:()=>70143},{ssr:!1,fallback:i.createElement(s.c,null)})},99992:(e,t,a)=>{a.d(t,{L:()=>i});let i=(0,a(98846).n7)({resolved:{},chunkName:()=>"SendTipButton",isReady(e){let t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>a.e(7714).then(a.bind(a,89314)),requireAsync(e){let t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){return a(this.resolve(e))},resolve:()=>89314})},48361:(e,t,a)=>{a.d(t,{Z:()=>ei});var i=a(27378),s=a(48204),r=a(3620),n=a(53738),l=a(6035),o=a(98568),c=a(77382),d=a(97554),u=a(52345),m=a(16040),p=a(1948),h=a(61395),v=a(65101),E=a(29413),g=a(91090),S=a(84423),C=a(99748),b=a(53788),T=a(97606),w=a(80176),y=a(20717),f=a(94380),_=a(95654),P=a(243),N=a(62203),A=a(60673),k=a(61678),I=a(51091),M=a(80092),R=a(12278),L=a(71227),O=a(42339),U=a(20436),B=a(17723),Z=a(82512),V=a(66483),F=a(32284),D=a(40671),W=a(4289),H=a(72914),x=a(19144),$=a(87489);let G=({onClick:e,model:t,modelUsername:a,isMediaPage:s})=>{let r=(0,$.n3)(t);return i.createElement(W.rU,{key:a,to:`/${a}/profile`,onClick:e,className:"viewcam-profile-menu-item"},i.createElement(x.Z,{className:"viewcam-profile-menu-item__avatar",onlineStatusClassName:"viewcam-profile-menu-item__online-status",user:t?(0,F.T$)(t):{username:a},modelData:r,showOnlineStatus:!0,isBorderAvatar:!0}),i.createElement(H.f,{className:"viewcam-profile-menu-item__label",as:s?"span":"h1",fallback:"span"},a,i.createElement(E.Z,{className:"viewcam-profile-menu-item__icon media-up-to-m-hidden",img:"next",size:9})))};var K=a(79561),q=a(29421),Y=a(61435);let z={createFreeAccountModal:D.cS,showModal:c.K4,routerReplace:w.sb,analyzeOpenModelProfile:A.Ch},j={myClub:{iconFile:"myclub-gradient",label:"My.Club"},twitter:{icon:"x-logo-ds",label:"Twitter"},instagram:{icon:"instagram-original",label:"Instagram"},snapchat:{icon:"snapchat-square",label:"Snapchat"},facebook:{icon:"facebook-square",label:"Facebook"},faphouse:{icon:"faphouse",label:"Faphouse"},xhamster:{icon:"xhamster-original",label:"xHamster"},xhamsterPornstar:{icon:"xhamster-original",label:"xhamsterPornstar"},amazonWishlist:{icon:"amazon-square",label:"Amazon"},fancentro:{icon:"fancentro",label:"Fancentro",processUrl:y.uG}},Q=e=>{let{modelSocialLinks:t,modelSocialLinksIcons:a,model:s,isShowFaphouseLinkEnabled:r}=e;return(0,i.useMemo)(()=>{let e=(null==s?void 0:s.amazonWishlist)||"",n={...t,amazonWishlist:e};return Object.keys(j).filter(e=>!!n[e]&&(!!r||"faphouse"!==e)).map(e=>{let t=j[e],s=t.processUrl?t.processUrl((0,y.jh)(n[e])):(0,y.jh)(n[e]);return{className:"external-link",customItem:i.createElement(p.Z,{className:"header-sub-social-link",href:s,key:t.label,target:"_blank"},t.iconFile?i.createElement("img",{src:(0,y.jz)(`common/components/ui/HeaderSub/images/${t.iconFile}.svg`),className:(0,C.AK)("header-sub-social-link-main-icon","icon",`icon-${t.iconFile}`),alt:"social icon"}):i.createElement(E.Z,{img:t.icon||"question",className:"header-sub-social-link-main-icon"}),a[e]&&i.createElement(E.Z,{img:a[e],size:10,className:"header-sub-social-link-star-icon"}),i.createElement("span",{className:"social-name"},t.label)),label:t.label}})},[a,t,s,r])},J=e=>{let t=(0,f.T)(),a=(0,b.v1)(),s=(0,_.C)(M.yD),r=(0,_.C)(K.L),l=s&&!r,{trans:c}=(0,T.QT)(),{isTimelineModelMenuEnabled:d,shouldShowFanClubButton:u,hasModelFeedNewPosts:m,modelUsername:p}=e,h=(0,n.Z)(()=>{t((0,I.NB)({experimentKey:"ab_fc_modal_above_stream"})),l?a.emit("fanClub:clickJoinFanClub",{source:"viewcamSubheader"}):t((0,w.sb)(`/${p}/${k.pt}`))});return(0,i.useMemo)(()=>[d&&{label:c("viewCam.subheader.feed"),route:{pathname:`/${p}/timeline`,hash:""},isActive:()=>!1},u&&{className:"external-link view-cam-header-sub__fan-club-button",customItem:i.createElement(o.Z,{source:"viewcamSubheader",hasUpdate:m,onClick:h}),label:"Fan Club"}],[d,c,p,u,m,h])},X=e=>{let t=(0,f.T)(),{isLoggedIn:a,shouldShowPlasma:s}=e,r=(0,i.useCallback)(()=>{a?S.P4.show(l.K,{}):t((0,D.cS)(g.Dt.SIGNUP_PLASMA,{type:"chatPlasma"}))},[a,t]);return(0,i.useMemo)(()=>s&&{className:"local-link plasma",customItem:i.createElement("a",{className:"header-sub-social-link",onClick:r},i.createElement(E.Z,{img:"plasma",size:20}),i.createElement("span",{className:"social-name"},"Messenger")),label:"Plasma"},[r,s])},ee=({hasAccessToNotInterestedModels:e,model:t,isLoggedRegularUser:a,isDSAReportModelContentMessageAvailable:s})=>(0,i.useMemo)(()=>{if(!t)return[];let r=(0,F.T$)(t);return[{label:"ModelAdditionalMenu",className:"local-link model-aditional-menu",customItem:i.createElement(d.Z,{id:"view-cam-header-additional-menu",shouldSwitchToNextModelOnNotInterested:!0,report:{source:"viewcam"},portalRootId:Y.y.IDS.HEADER_SUB_PORTAL_CONTAINER,model:r,variant:"view-cam-header"})},e&&{label:"NotInterestedModelButton",className:"header-sub-item-wrapper local-link model-aditional-menu-item",customItem:i.createElement(u.$,{model:r,className:"header-sub-button",shouldSwitchToNextModel:!0})},!s&&a&&{label:"ReportModelButton",className:"header-sub-item-wrapper local-link model-aditional-menu-item",customItem:i.createElement(m.t,{source:"viewcam",model:r,className:"header-sub-button"})},s&&{label:"ReportModelButton",className:"header-sub-item-wrapper local-link model-aditional-menu-item",customItem:i.createElement(U.f,{source:"viewcam",className:"header-sub-button",reportedUser:r,reportType:"model"})}]},[e,a,t,s]),et=(e,t)=>{let{videosCount:a,photosCount:s,modelUsername:r}=e,{trans:n}=(0,T.QT)();return(0,i.useMemo)(()=>[{className:"local-link",label:n("viewCam.subheader.videos"),route:{pathname:`/${r}/videos`,hash:""},count:a,isActive:()=>!1,onClick:()=>t("VIDEO_BUTTON")},{className:"local-link",label:n("viewCam.subheader.gallery"),route:{pathname:`/${r}/photos`,hash:""},count:s,isActive:()=>!1,onClick:()=>t("ALBUM_BUTTON")}].filter(e=>e.count>0),[s,a,r,t,n])},ea=e=>{let{model:t,modelUsername:a,isMediaPage:s}=e,r=(0,f.T)(),{trans:n}=(0,T.QT)(),l=(0,i.useCallback)(e=>{r((0,A.Ch)({triggerSource:g.YW[e]}))},[r]),o=et(e,l),c=J(e),d=X(e),u=Q(e),m=ee(e);return(0,i.useMemo)(()=>[{label:a,customItem:i.createElement(G,{model:t,isMediaPage:s,modelUsername:a,onClick:()=>l("MODEL_NAME")})},{className:"local-link",label:n("viewCam.subheader.profile"),route:`/${a}/profile`,isActive:()=>!1,badgeRight:i.createElement(h.Z,null),onClick:()=>l("PROFILE_BUTTON")},...o,...c,d,...u,...m].filter(Boolean),[a,t,o,c,d,u,m,s,l,n])},ei=(0,r.EN)((0,s.$j)((e,t)=>{let a=t.match.params.username,i=t.model?(0,V.GA)(e,t.model.id):null,s=(0,N.Km)(e),r=i&&!s?(0,q.jQ)(e):0,n=i&&!s?(0,q.E)(e):0,{modelSocialLinks:l,modelSocialLinksIcons:o}=(0,Z.V9)(e,t.model);return{isLoggedIn:(0,R.M7)(e),isMediaPage:(0,P.HK)(e),shouldShowPlasma:(0,K.M9)(e),shouldShowFanClubButton:(0,K.lv)(e),hasModelFeedNewPosts:(0,q.x$)(e),modelSocialLinks:l,modelSocialLinksIcons:o,isLoggedRegularUser:(0,R.Tv)(e),modelUsername:a,photosCount:r,videosCount:n,isTimelineModelMenuEnabled:(0,q.KW)(e),hasAccessToNotInterestedModels:(0,B.bl)(e),isShowFaphouseLinkEnabled:(0,O.jcC)(e),isDSAReportModelContentMessageAvailable:(0,L.PO)(e)}},z)(e=>{let t=ea(e);return i.createElement(v.Z,{className:"view-cam-header-sub",items:t,hasNextModel:!e.shouldHideNextModel,hasSearch:!0,hasCategories:!0})}))},48867:(e,t,a)=>{a.d(t,{Z:()=>c});var i=a(27378),s=a(3034),r=a(99748),n=a(97606),l=a(7685);let o=250,c=({messageId:e,className:t,children:a,placement:c="top",maxWidth:d=o})=>{let{trans:u}=(0,n.QT)(),m=(0,l.L)("help_tooltip_"),p=e||a?i.createElement(s.Z,{isMobileRelative:!1,placement:c,targetId:m,maxWidth:d},e&&u(e),a):null;return i.createElement("span",{className:(0,r.AK)("help-tooltip",t),id:m},"?",p)}},8851:(e,t,a)=>{a.d(t,{b:()=>i});let i=(0,a(98846).n7)({resolved:{},chunkName:()=>"ModelFeedUnderViewCamEntry",isReady(e){let t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Promise.all([a.e(702),a.e(616)]).then(a.bind(a,62812)),requireAsync(e){let t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){return a(this.resolve(e))},resolve:()=>62812})},18984:(e,t,a)=>{a.d(t,{ZP:()=>F});var i=a(18775),s=a(76482),r=a(37051),n=a(91343),l=a(27378),o=a(48204),c=a(11718),d=a(35506),u=a(62668),m=a(50557),p=a(41950),h=a(99973),v=a(99748),E=a(98846),g=a(243),S=a(98371),C=a(62182),b=a(2656),T=a(61061),w=a(51945),y=a(53514),f=a(38629),_=a(78021),P=a(14151),N=a(58320),A=a(60278),k=a(12265),I=a(79336),M=a(30399),R=a(79561),L=a(29421);let O=(0,E.n7)({resolved:{},chunkName:()=>"webRTCPlayer",isReady(e){let t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Promise.all([a.e(7992),a.e(2035),a.e(4052)]).then(a.bind(a,61220)),requireAsync(e){let t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){return a(this.resolve(e))},resolve:()=>61220},{isErrorBoundary:!1}),U=(0,E.n7)({resolved:{},chunkName:()=>"HLSPlayerWrapper",isReady(e){let t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Promise.all([a.e(7992),a.e(6805)]).then(a.bind(a,67830)),requireAsync(e){let t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){return a(this.resolve(e))},resolve:()=>67830},{isErrorBoundary:!1}),B=["scroll","mousemove","pointerdown","keydown"];class Z extends l.PureComponent{componentDidMount(){this.props.isMediaPage&&B.forEach(e=>document.addEventListener(e,this.handleFirstInteraction)),this.props.updateHLSStreamEndedState(!1),this.removeAudioStartListener=p.KY.subscribePlayAudioEvent(e=>{e.detail.playerId!==this.VideoPlayerId&&this.props.togglePlayerAvailability(!1)})}componentDidUpdate(e){var t;this.updateDocumentVisibilityState(e,this.props),(null==e?void 0:e.modelId)!==(null===(t=this.props)||void 0===t?void 0:t.modelId)&&this.setState({wasPlayed:!1})}componentWillUnmount(){var e;this.updateInitializePlayer&&this.updateInitializePlayer.cancel(),null===(e=this.removeAudioStartListener)||void 0===e||e.call(this),this.props.updateInitializePlayer(!1),this.clearTimeout(),B.forEach(e=>document.removeEventListener(e,this.handleFirstInteraction))}static getDerivedStateFromError(){return{isFailed:!0}}componentDidCatch(e,t){d.ZP.error(e,t),this.props.apiLog("error","playerFailed",{error:e.toString(),errorInfo:t})}render(){return this.state.isFailed?l.createElement(y.Z,null):l.createElement(f.default,{className:(0,v.AK)("player",I.j.player,this.props.className)},l.createElement(w._,null),this.renderPlayerContent(),l.createElement(c.P,{className:"player__player-controls"}),this.renderStreamController())}constructor(e){super(e),(0,i._)(this,"lastScrollY",0),(0,i._)(this,"updateInitializePlayer",(0,s.Z)(()=>{this.props.updateInitializePlayer(!0)},500)),(0,i._)(this,"removeAudioStartListener",void 0),(0,i._)(this,"VideoPlayerId",`WebRTC${(0,n.x0)()}`),(0,i._)(this,"timeoutId",void 0),(0,i._)(this,"handleFirstInteraction",e=>{if("scroll"===e.type&&this.lastScrollY<=window.scrollY){this.lastScrollY=window.scrollY;return}this.setState({isAfterUserInteraction:!0}),B.forEach(e=>document.removeEventListener(e,this.handleFirstInteraction))}),(0,i._)(this,"clearTimeout",()=>{void 0!==this.timeoutId&&clearTimeout(this.timeoutId)}),(0,i._)(this,"handlePlaying",()=>{this.state.wasPlayed||(this.setState({wasPlayed:!0}),this.props.onPlaying(),this.props.updateHLSStreamEndedState(!1))}),(0,i._)(this,"togglePlayerAvailabilityIfNeeded",({isDocumentVisible:e,isInPrivate:t,isBlurVideoOnPrivate:a})=>{if(h.BROWSER_CAPABILITIES.isMobile||h.BROWSER_CAPABILITIES.isTablet){if(e||a){this.clearTimeout();return}t?this.timeoutId=setTimeout(()=>this.props.togglePlayerAvailability(!1),6e4):this.props.togglePlayerAvailability(!1)}}),(0,i._)(this,"updateDocumentVisibilityState",(e,t)=>{let{isDocumentVisible:a}=t;(0,C.gk)(e,t)&&(a&&this.setState({isDocumentVisible:a}),this.togglePlayerAvailabilityIfNeeded(t))}),(0,i._)(this,"handlePlayClick",()=>{p.KY.emitPlayAudioEvent(this.VideoPlayerId),this.props.togglePictureInPicture(!1),this.props.togglePlayerAvailability(!0),this.props.updateDocumentVisibility()}),(0,i._)(this,"handleHLSStreamEnded",()=>{this.props.updateHLSStreamEndedState(!0)}),(0,i._)(this,"handleHLSStreamRestored",()=>{this.props.isHLSStreamWasEnded&&this.props.updateHLSStreamEndedState(!1)}),(0,i._)(this,"renderPlayer",()=>{let{lastSnapshotUrl:e,volume:t,playerType:a,isPlayerAvailability:i,isPictureInPicture:s,isMediaPage:r,isBackgroundForceStopPlaying:n}=this.props,{isDocumentVisible:o,isAfterUserInteraction:c}=this.state;if(!o||!i||s||r&&!c||n)return l.createElement(T.Z,{onClick:this.handlePlayClick});let d={lastSnapshotUrl:e,volume:t};switch(a){case P.PLAYER_TYPES.WEBRTC:return l.createElement(O,{onPlaying:this.handlePlaying,wasPlayed:this.state.wasPlayed,updatePlayerResolution:this.props.updatePlayerResolution,...d,updateInitializePlayer:this.updateInitializePlayer});case P.PLAYER_TYPES.HLS:default:return l.createElement(U,{onPlaying:this.handlePlaying,wasPlayed:this.state.wasPlayed,onStreamEnded:this.handleHLSStreamEnded,onStreamRestored:this.handleHLSStreamRestored,updatePlayerResolution:this.props.updatePlayerResolution,...d,updateInitializePlayer:this.updateInitializePlayer})}}),(0,i._)(this,"renderStreamController",()=>{let{playerType:e}=this.props;return e===P.PLAYER_TYPES.WEBRTC||e===P.PLAYER_TYPES.HLS?l.createElement(_.Z,null):null}),(0,i._)(this,"renderPlayerContent",()=>l.createElement(m.s,null,this.renderPlayer())),this.state={wasPlayed:!1,isDocumentVisible:this.props.isDocumentVisible,isFailed:!1,isAfterUserInteraction:!this.props.isMediaPage}}}(0,i._)(Z,"defaultProps",{isLoggedIn:!1,isInCam2Cam:!1,isInPrivate:!1,isPictureInPicture:!1,lastSnapshotUrl:"",playerType:"",volume:0,onPlaying:r.Z,isHLSStreamWasEnded:!1});let V={togglePlayerAvailability:k.X6,updatePlayerType:k.$5,updateInitializePlayer:b.kV,updateDocumentVisibility:u.uP,togglePictureInPicture:b.x0,apiLog:d.t$,updateHLSStreamEndedState:k.zH,setEmulatePlayerCrashState:b.LA},F=(0,o.$j)(e=>{let{auth:{isLoggedIn:t,isLoggingOut:a},viewCam:{isPlayerAvailability:i},ui:{isDocumentVisible:s},player:{isBroadcastSettingsVisible:r}}=e,n=(0,M.D_)(e),l=(0,R.IW)(e);return{isDocumentVisible:!!s,isBroadcastSettingsVisible:r,isLoggedIn:t&&!a,isInCam2Cam:l&&(0,R.UP)(e),isInPrivate:l,modelId:n,isMediaPage:(0,g.HK)(e),playerType:(0,N.Aq)(e),isPlayerAvailability:i,volume:(0,N.Sf)(e),isPictureInPicture:(0,A.bd)(e),isHLSStreamWasEnded:(0,L.pc)(e),deviceType:(0,S.y$)(e),crashEmulateState:(0,A.jU)(e),isBackgroundForceStopPlaying:(0,N.aX)(e),isBlurVideoOnPrivate:(0,N.$C)(e)}},V)(Z)},51945:(e,t,a)=>{a.d(t,{_:()=>c});var i=a(27378),s=a(94380),r=a(95654),n=a(68020),l=a(2656),o=a(60278);let c=()=>{let e=(0,r.C)(o.jU),t=(0,r.C)(n.hX),a=(0,s.T)();return i.useEffect(()=>{if(e&&t)throw a((0,l.LA)(!1)),Error("QA Test error")},[a,e,t]),null}},53514:(e,t,a)=>{a.d(t,{Z:()=>o});var i=a(27378),s=a(99382),r=a(99748),n=a(97606),l=a(79336);let o=()=>{let{trans:e}=(0,n.QT)();return i.createElement("div",{className:(0,r.AK)("player-error-boundary",l.j.player)},i.createElement("div",{className:"player-error-boundary__bg"},i.createElement("div",{className:"player-error-boundary__description"},e("errors.playerFailure.sorry"),i.createElement("br",null),e("errors.playerFailure.instruction")),i.createElement("div",{className:"player-error-boundary__action"},i.createElement(s.ZP,{style:"default-filled",onClick:()=>{window.location.reload()}},e("errors.playerFailure.reload")))))}},78021:(e,t,a)=>{a.d(t,{Z:()=>p});var i=a(27378),s=a(48204),r=a(75151),n=a(95366),l=a(37112),o=a(243),c=a(96811),d=a(58320),u=a(30399);let m={fetchStreamPlayingPercent:r.oz},p=(0,s.$j)(e=>{let t=(0,u.D_)(e),a=(0,u.yY)(e);return{playerType:(0,d.Aq)(e),streamResolution:(0,d.Cj)(e),modelId:t,modelStatus:a,isViewCamPage:(0,o.mT)(e),streamControllerConfig:(0,d.Yb)(e)}},m)(({playerType:e,streamResolution:t,modelId:a,modelStatus:s,streamControllerConfig:r,isViewCamPage:o,fetchStreamPlayingPercent:d})=>{let u=(0,i.useCallback)(i=>{a&&s&&(l.Z.setFields({playingPercent:i.playingPercent}),d({playerType:e,streamResolution:t,modelId:a,modelStatus:s,stats:i}))},[a,s,e,d,t]);return(0,i.useEffect)(()=>{s===n.MODEL_STATUSES.STATUS_PUBLIC&&o?c.Z.init({...r,update:u}):c.Z.destroy()},[s,o,r,u]),null})},5144:(e,t,a)=>{a.d(t,{O:()=>r});var i=a(27378),s=a(98655);let r=(0,a(98846).n7)({resolved:{},chunkName:()=>"AddToSubscriptionModal",isReady(e){let t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>a.e(2230).then(a.bind(a,71406)),requireAsync(e){let t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){return a(this.resolve(e))},resolve:()=>71406},{ssr:!1,resolveComponent:e=>e.AddToSubscriptionModal,fallback:i.createElement(s.c,null)})},94296:(e,t,a)=>{a.d(t,{_:()=>i});let i=(0,a(98846).n7)({resolved:{},chunkName:()=>"ViewCamProfile",isReady(e){let t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Promise.all([a.e(3616),a.e(4427),a.e(2022),a.e(9152)]).then(a.bind(a,52997)),requireAsync(e){let t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){return a(this.resolve(e))},resolve:()=>52997})},9617:(e,t,a)=>{a.r(t),a.d(t,{ViewCamPage:()=>tS,default:()=>tb});var i=a(18775),s=a(99942),r=a(13165),n=a(27378),l=a(48204),o=a(93704),c=a(56694),d=a(53522),u=a(89),m=a(52872),p=a(68994),h=a(44143),v=a(29409),E=a(95366),g=a(21769),S=a(39120),C=a(60159);let b=e=>{(0,n.useEffect)(()=>C.Z.bindBusinessArea(e),[e])},T=({area:e})=>(b(e),null);var w=a(99748),y=a(87937),f=a(42815),_=a(80176),P=a(82168),N=a(66261),A=a(13743),k=a(12712),I=a(62203),M=a(73804),R=a(98131),L=a(88275),O=a(98853),U=a(2656),B=a(60278),Z=a(3160),V=a(82208),F=a(91456),D=a(38933),W=a(66483),H=a(40671),x=a(97606),$=a(94380),G=a(95654),K=a(28656),q=a(98371),Y=a(12278),z=a(84185),j=a(12265),Q=a(85353);let J=()=>n.createElement("div",{className:"view-cam"},n.createElement("div",{className:"wrapper"},n.createElement("div",{className:"main"},n.createElement("div",{className:"strut"}))),n.createElement("div",{className:"controls-wrapper"})),X=({isVisible:e=!0,message:t})=>e?n.createElement("div",{className:"loader-wrapper"},n.createElement(Q.Z,{isCentered:!0}),t?n.createElement("div",{className:"loader-wrapper-message"},t):null):null,ee=({content:e=null,loadingMessage:t=""})=>n.createElement("div",{className:"main"},e,n.createElement(X,{isVisible:!e,message:t}),n.createElement("div",{className:"video"},n.createElement(J,null))),et=({children:e})=>{let[,t]=(0,n.useTransition)(),[a,i]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{t(()=>{i(!1)})},[]),a?null:n.createElement(n.Fragment,null,e)};var ea=a(47080),ei=a(46486),es=a(3620),er=a(4289),en=a(29413),el=a(8851),eo=a(61678),ec=a(42339),ed=a(98699),eu=a(69024),em=a(99696),ep=a(87489),eh=a(39709),ev=a(94296),eE=a(21044),eg=a(32284);let eS=e=>(0,n.useMemo)(()=>(0,eg.T$)(e),[e]),eC=e=>"profile"===e||"photos"===e||"videos"===e||"timeline"===e;var eb=a(79561),eT=a(29421);let ew=({model:e})=>{let{trans:t}=(0,x.QT)(),a=(0,G.C)(eT.KW),i=(0,G.C)(k.z),s=(0,G.C)(eT.x$),r=(0,G.C)(eb.L),l=(0,G.C)(eT._W),o=r||(null==l?void 0:l.isActive),c=(0,G.C)(e=>(0,eT.E)(e)),d=(0,G.C)(e=>(0,eT.jQ)(e)),u=(0,G.C)(ec.VgH),m=(0,ep.n3)(e),p=eS(e),h=(0,es.k6)(),{hasProfile:v,timelineType:g,mediaType:S,mediaId:C}=(0,es.UO)(),b=null,T=(0,n.useRef)(null);if(v||"profile"===T.current&&C?b="profile":g?b="timeline":S&&eC(S)&&(b=S),(0,K.L)(()=>{!e||("photos"!==b||d)&&("videos"!==b||c)&&("timeline"!==b||a)||h.replace(`/${e.username}/profile`)},[b,e,e.username,h,d,c,a]),!S&&!g&&!v)return null;T.current=b;let y=u&&e.isNonNude,f=[{key:"profile",label:t("viewCam.subheader.profile"),to:{pathname:`/${e.username}/profile`,state:{shouldSkipScroll:!0}},isActive:()=>"profile"===b}];return c&&!y&&f.push({key:eE.oZ.VIDEOS,label:t("viewCam.subheader.videos"),count:c,to:{pathname:`/${e.username}/${eE.oZ.VIDEOS}`,state:{shouldSkipScroll:!0}},isActive:()=>b===eE.oZ.VIDEOS}),d&&!y&&f.push({key:eE.oZ.PHOTOS,label:t("viewCam.subheader.gallery"),count:d,to:{pathname:`/${e.username}/${eE.oZ.PHOTOS}`,state:{shouldSkipScroll:!0}},isActive:()=>b===eE.oZ.PHOTOS}),a&&f.push({key:"timeline",label:n.createElement(n.Fragment,null,t(o?"viewCam.subheader.fanClubAndFeed":"viewCam.subheader.feed"),s&&n.createElement("span",{className:"user-feed-link-attention-marker"})),to:{pathname:`/${e.username}/${o?eo.pt:eo.Ps}`,state:{shouldSkipScroll:!0}},isActive:()=>"timeline"===b}),n.createElement("div",{className:(0,w.AK)("view-cam-model-info profile-wrapper",{isTheatreMode:i})},n.createElement("div",{className:"page"},n.createElement("div",{className:"header-sub navigation"},n.createElement("div",{className:"right-navigation-section"},n.createElement(er.rU,{to:`/${e.username}`,className:"close-icon-wrapper","aria-label":t("aria.links.model")},n.createElement(en.Z,{img:"close-2",size:14})))),n.createElement("div",{className:"profile-cover-wrapper"},n.createElement(em.Z,{user:p,isProfileAvailable:!0,editable:!1,isLive:e.isLive,modelData:m})),n.createElement(eh.l,{menuItems:f,className:E.ByQ}),"profile"===b&&n.createElement(n.Fragment,null,n.createElement(ev._,{user:p,modelData:m}),n.createElement("div",{className:"container"},n.createElement(er.rU,{to:`/${e.username}`,className:"bottom-close icon-wrapper","aria-label":t("aria.links.model")},n.createElement(en.Z,{img:"scroll-top",size:50})))),"timeline"===b&&n.createElement(el.b,{model:e,timelineType:g}),b===eE.oZ.PHOTOS&&n.createElement(ed.D,{owner:p,ownerData:m}),b===eE.oZ.VIDEOS&&n.createElement(eu.J,{wrapper:"user-page",listClassName:"user-videos-page__video-list",isOwnProfile:!1,user:p,modelData:m})))},ey=({model:e})=>{let t=(0,$.T)(),a=null==e?void 0:e.id;return((0,n.useEffect)(()=>{a&&t((0,H.f5)(a))},[a,t]),e)?n.createElement(ew,{model:e}):null};var ef=a(97683),e_=a(65804),eP=a(46911),eN=a(77602);let eA=()=>{let e=(0,G.C)(eN.Z8);return(null==e?void 0:e.length)?n.createElement("div",{className:"view-cam-model-tags-specials"},n.createElement("p",{className:"view-cam-model-tags-title"},n.createElement(e_.Z,{messageId:"viewCam.tagsInfo.relatedTags"})),n.createElement(eP.Z,{shouldShowMore:!0,shouldShowCategoriesButton:!1,tags:e,variant:"multi-line"})):null},ek=({tagGroup:e})=>{if("mixedTags"===e.alias)return null;let t=`viewCam.tagsInfo.tagGroupTitle_${e.alias}`,a=n.createElement(e_.Z,{messageId:t}),i=n.createElement("p",{className:"view-cam-model-tags-group-title"},a);return n.createElement("div",{key:e.alias,className:"view-cam-model-tags-group"},n.createElement("p",{className:"view-cam-model-tags-group-title-mobile"},a),n.createElement(eP.Z,{contentStart:i,shouldShowCategoriesButton:!1,tags:e.tags,variant:"multi-line"}))},eI=({modelUsername:e})=>{let t=(0,G.C)(eN.dH),a=(0,G.C)(I.ok);return(null==t?void 0:t.length)?n.createElement(n.Fragment,null,n.createElement(a?"h2":"p",{className:"view-cam-model-tags-title"},n.createElement(e_.Z,{messageId:"viewCam.tagsInfo.title",elements:{link:n.createElement(er.rU,{className:"link",to:`/${e}/profile`})},parameters:{modelName:e}})),t.map(e=>n.createElement(ek,{key:e.alias,tagGroup:e}))):null},eM=({model:e})=>e?n.createElement("div",{className:"view-cam-model-tags"},n.createElement(eI,{modelUsername:e.username}),n.createElement(eA,null)):null,eR=({model:e,baseModel:t})=>{let a=(0,G.C)(eb.Fu),i=(0,G.C)(k.z);return n.createElement(n.Fragment,null,n.createElement(ef.Z,{isTheatreModeActive:i,model:e,baseModel:t,shouldShowOtherModels:a}),n.createElement("div",null,n.createElement(ey,{model:e})),!i&&n.createElement(ea.$,{className:"widescreen-container",onlyPaymenticoAllowed:!0}),a&&!i&&n.createElement(n.Fragment,null,n.createElement(et,null,n.createElement(ei.S,{model:e})),n.createElement("div",{className:"widescreen-container"},n.createElement(eM,{model:e}))))};var eL=a(84423),eO=a(60736),eU=a(30399),eB=a(31560),eZ=a(50399),eV=a(50218);let eF=e=>{let t=(0,eB.q)();return(0,n.useEffect)(()=>{e&&(0,eV.mD)({modelId:e,actions:[]})},[e]),(0,n.useCallback)(e=>{(0,eV.Zt)({type:e,timestamp:(0,eZ.b7)(t.getState())})},[t])},eD=()=>{let e=(0,G.C)(eT._u),t=(0,G.C)(eT.cU),a=(0,G.C)(eU.D_),i=(0,G.C)(eU.yY),s=(0,eO.W)(a,Boolean),r=(0,eO.W)(i,Boolean),{openIds:l}=(0,n.useContext)(eL.rH),o=r||E.MODEL_STATUSES.STATUS_IDLE,c=e||[E.MODEL_STATUSES.STATUS_OFF,E.MODEL_STATUSES.STATUS_IDLE].includes(o)?o:E.MODEL_STATUSES.STATUS_IDLE,d=l.length>0,u=eF(s);(0,n.useEffect)(()=>{u("page-opened");let e=new AbortController,t=()=>{e.signal.aborted||(u("page-closed"),e.abort())};return window.addEventListener("beforeunload",t,{signal:e.signal}),window.addEventListener("pagehide",t,{signal:e.signal}),()=>{t()}},[u]),(0,n.useEffect)(()=>{let e=()=>{u("visible"===document.visibilityState?"page-visible":"page-hidden")};return e(),document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[u]),(0,n.useEffect)(()=>{u(d?"modal-opened":"modal-closed")},[d,u]),(0,n.useEffect)(()=>{u(`join-${c}`)},[u,c]),(0,n.useEffect)(()=>{u(t?"fullscreen-opened":"fullscreen-closed")},[u,t])};var eW=a(91090),eH=a(6558),ex=a(56671),e$=a(78983),eG=a(53788),eK=a(27254),eq=a(53678),eY=a(60673),ez=a(68020),ej=a(53359),eQ=a(14445);let eJ=()=>{var e;let t=(0,$.T)(),a=(0,G.C)(N.TF),i=null!==(e=(0,G.C)(ez.Z1))&&void 0!==e?e:1/0,s=(0,eO.W)(a,e=>"none"!==e),r=(0,eQ.yx)(),l=(0,eQ.ke)(),o=(0,eQ.IM)(),c=(0,eQ.P4)(),d=(0,eG.v1)(),u=(0,n.useCallback)(({totalTime:e,clearTime:a,targetClearTime:i,modelId:s})=>{i===r&&t((0,eY.f4)({totalTime:e,clearTime:a,modelId:s,eventName:eW.mk.WATCH_MODEL})),i===l&&t((e,t)=>{var a,i;null===(i=window)||void 0===i||null===(a=i.StripChat)||void 0===a||a.emit(eK.Cj.ON_WATCH_MODEL,{userId:(0,Y.rc)(t()),modelId:s})}),i===c&&d.emit("analytics:Watch Model",{triggerType:"moengage",totalTimeInMilliseconds:e,clearTimeInMilliseconds:a,modelId:s})},[t,d,c,l,r]),m=(0,n.useCallback)(({modelId:e,phase:a,clearTime:r,totalTime:n,startTimestamp:l})=>{t((t,c,{Api:d})=>{let u=c();r>=(0,e$.mo)(i)&&(0,ej.iQ)({modelId:e,userId:(0,Y.rc)(u)||(0,Y.PY)(u)||0,spentTime:(0,e$.r$)(r),startedAt:(0,e$.r$)(l),shouldSendWatchTimeWithBeacon:"unload"===a,pageSection:s},d).catch(()=>{}),r>=o&&(0,ex.tO)(u,()=>{let t=(0,eq.uh)(u,{modelId:e,duration:(0,e$.r$)(r),totalTabOpenTime:(0,e$.r$)(n)},eW.mk.WATCH_MODEL_LONG);t&&(0,ej.Id)(d,{modelId:e,userId:(0,Y.rc)(u)||(0,Y.PY)(u)||0,method:"unload"===a?"beacon":"post",payload:{ampl:t.ampl}}).catch(()=>{})})})},[s,t,i,o]),p=(0,n.useMemo)(()=>({[r]:u,[l]:u,[c]:u}),[c,l,u,r]);(0,eH.h)({onWatchClearTime:p,onWatchEnd:m})};var eX=a(13216);let e0=()=>(eD(),eJ(),null),e1=(0,n.memo)(()=>n.createElement(eX.g,null,n.createElement(e0,null)));e1.displayName="ViewCamWatchAnalytics";let e2=({isAutoSpyExpected:e})=>{let{trans:t}=(0,x.QT)();return n.createElement(ee,{loadingMessage:e?t("modelsRoomIsLoading"):""})},e6=n.memo(({model:e,username:t,hasProfile:a,baseModel:i})=>{let s=(0,$.T)(),r=(0,G.C)(eb.Dg),l=(0,G.C)(Y.ts),o=(0,G.C)(q.ne),c=(0,n.useRef)(null);return(0,n.useEffect)(()=>{(0,R.eN)({isLoggedIn:!!l,currentUser:l},{isLoggedIn:!!c.current,currentUser:c.current})&&!o&&a&&e&&s((0,z.TR)(e.username)),l&&(c.current=l)},[l,s,o,a,e]),(0,K.L)(()=>{s((0,j.t1)(t))},[s,t]),n.createElement("div",{className:"view-cam-container"},r?n.createElement(e2,{isAutoSpyExpected:r}):n.createElement(eR,{baseModel:i,model:e}),n.createElement(e1,null))});var e3=a(37705),e4=a(15428),e8=a(99973),e9=a(46607);let e5=({isBanned:e,isGeoBanned:t,model:a})=>{let{trans:i}=(0,x.QT)(),s=t?"country-ban":"account-blocked-colored",r=(0,G.C)(e=>(0,e9.t0)(e,a.id)),l=(0,n.useMemo)(()=>{if(t)return i("camChat.yourCountryIsBlockedByModel");let e=(null==r?void 0:r.type)||eE.Gq.BAN_FOREVER;return n.createElement(n.Fragment,null,a.username,n.createElement("br",null),i(`bans.profilePeriods.${e}`))},[t,a.username,null==r?void 0:r.type,i]),o=(0,n.useMemo)(()=>{if(t)return null;let e=i("bans.profileReasonDescription.common");return!(null==r?void 0:r.reason)||eE.Nc.includes(r.reason)?e:n.createElement(n.Fragment,null,n.createElement(e_.Z,{elements:{highlight:n.createElement("span",{className:"banned-container-description__highlight"})},messageId:`bans.profileReasonDescription.${r.reason}`}),n.createElement("br",null),e)},[t,null==r?void 0:r.reason,i]);return e||t?n.createElement(e4.M,{status:t?e8.EH.SUCCESS:e8.EH.FORBIDDEN},n.createElement("div",{className:"page view-cam-page banned"},n.createElement("div",{className:"main"},n.createElement("div",{className:(0,w.AK)("banned-container",{"banned-container_geo":t})},n.createElement(en.Z,{img:s,fullyCSSControlled:!0}),n.createElement("div",{className:"banned-container-title"},l),o&&n.createElement("div",{className:"banned-container-description"},o))))):null};var e7=a(64402),te=a(243),tt=a(45793),ta=a(55618),ti=a(70125);let ts=({model:e,isNotFoundStatus:t,isGeoBanned:a})=>{let{trans:i}=(0,x.QT)(),s=(0,G.C)(te.mT),r=a?"modelAccountHiddenPage":"modelAccountDeletedPage";return n.createElement(tt.Z,{className:"account-disabled-page model-deleted-page container page"},t&&n.createElement(e3.Z,{status:e8.EH.NOT_FOUND}),n.createElement("div",{className:"deleted-wrapper"},n.createElement(en.Z,{img:"account-disabled",size:100}),n.createElement("div",{className:"account-disabled-header"},i(`${r}.title`)),n.createElement("div",{className:"account-disabled-description"},i(`${r}.description`,{modelname:e.username}))),n.createElement("div",null,s?n.createElement(ti.Z,{shouldLogPopularSnapshot:!0,isWidescreen:!1,onlyInitialLoad:!0,showFilters:!0}):n.createElement(ta.a,{shouldLogPopularSnapshot:!0})))},tr=({username:e,children:t})=>{let a=(0,G.C)(eU.RV),i=(0,G.C)(eU.cs),s=(0,G.C)(te.Ol);return a&&i?"notModel"===i.type?n.createElement(e3.Z,{to:`/user/${e}`}):"newUsername"===i.type?n.createElement(e3.Z,{to:s.replace(e,i.newUsername)}):"notFound"===i.type?n.createElement(e7.Z,null):"deleted"===i.type||"blocked"===i.type||"notApproved"===i.type?n.createElement(ts,{model:i.model,isNotFoundStatus:!0,isGeoBanned:!1}):"geoBanned"===i.type?n.createElement(ts,{model:i.model,isNotFoundStatus:!1,isGeoBanned:!0}):"banned"===i.type?n.createElement(e5,{model:i.model,isBanned:!0,isGeoBanned:!1}):n.createElement(n.Fragment,null,t):n.createElement(n.Fragment,null,t)};var tn=a(89061),tl=a(88056),to=a(6966);function tc({image:e}){let t=[];return t.push((0,to.by)("type","website")),t.push((0,to.by)("image",e)),t}let td=({username:e,mediaMeta:t,titleLimit:a,mediaType:i,videosCount:s,isStripChat:r,hasProfile:l,photosCount:o,modelStatus:c,isNonNudeWL:d,isXhlOrMirror:u,topicOrGoal:m,snapshotUrl:p})=>{let h;let{transSeo:v,transSeoFormatted:E}=(0,x.QT)(),g="",S="",C=(0,tn.Z)(e);if(t)g=E(`seo.title.${t.type}`,{model:C,...t,seoExtra:!1},{limit:a}),S=t.description||E("seo.description.media",{model:C,seoExtra:!1},{limit:e8.J7,shouldShowEllipsis:!0}),h=function({type:e,description:t,media:a}){let i=[];switch(e){case"photo":i=tc({image:a.url});break;case"album":i=tc({image:a.preview});break;case"video":i=function({preview:e}){let t=[];return t.push((0,to.by)("type","video.other")),e&&t.push((0,to.by)("image",e)),t}({preview:a.coverUrl})}return i.length&&t&&i.push((0,to.by)("description",t)),i}(t);else if(i===eE.oZ.VIDEOS||i===eE.oZ.PHOTOS){let e=i===eE.oZ.VIDEOS&&s&&s>=20&&r;g=E(`seo.title.${i}.${e?"model_many_videos":"model"}`,{username:C,seoExtra:!1,videosCount:s},{limit:a}),S=E(`seo.description.${i}.model`,{username:C,seoExtra:!1},{limit:e8.J7,shouldShowEllipsis:!0})}else if(l)g=E("seo.title.profile.model",{username:C,seoExtra:!1},{limit:a}),S=E("seo.description.profile.model",{username:C,photos:o,videos:s,status:c,seoExtra:!1},{limit:e8.J7,shouldShowEllipsis:!0});else throw Error("Not a content page, use ViewCamShowPageMeta");d&&(g=v("seo.title.camNonNudeWL",{model:e,seoExtra:!1}),S=v("seo.description.camNonNudeWL",{model:e,seoExtra:!1}));let{descriptionOg:b,imageOg:T}=r||u?{descriptionOg:m,imageOg:p}:{descriptionOg:S,imageOg:void 0};return n.createElement(tl.Z,{title:g,description:S,descriptionOg:b,imageOg:T,tags:h})},tu=({username:e,isNonNudeWL:t,titleLimit:a,topicOrGoal:i,isStripChat:s,isXhlOrMirror:r,snapshotUrl:l})=>{let{transSeo:o,transSeoFormatted:c}=(0,x.QT)(),d="",u="",m=(0,tn.Z)(e);t?(d=o("seo.title.camNonNudeWL",{model:e,seoExtra:!1}),u=o("seo.description.camNonNudeWL",{model:e,seoExtra:!1})):(d=c("seo.title.cam",{model:m,seoExtra:!1},{limit:a}),u=c("seo.description.cam",{model:m,topicOrGoal:i,seoExtra:!1},{limit:e8.J7,shouldShowEllipsis:!0}));let{descriptionOg:p,imageOg:h}=s||r?{descriptionOg:i,imageOg:l}:{descriptionOg:u,imageOg:void 0};return n.createElement(tl.Z,{title:d,description:u,descriptionOg:p,imageOg:h,skipRobots:!0})},tm=({isNonNudeWL:e,match:{params:{username:t,mediaType:a}},titleLimit:i,topicOrGoal:s,hasProfile:r,isStripChat:l,isXhlOrMirror:o,photosCount:c,snapshotUrl:d,videosCount:u,mediaMeta:m,modelStatus:p})=>m||a===eE.oZ.VIDEOS||a===eE.oZ.PHOTOS||r?n.createElement(td,{username:t,mediaMeta:m,titleLimit:i,mediaType:a,videosCount:u,isStripChat:l,hasProfile:r,photosCount:c,modelStatus:p,isNonNudeWL:e,isXhlOrMirror:o,topicOrGoal:s,snapshotUrl:d}):n.createElement(tu,{username:t,isNonNudeWL:e,titleLimit:i,topicOrGoal:s,isStripChat:l,isXhlOrMirror:o,snapshotUrl:d});var tp=a(66813),th=a(58320);let tv=(e,t)=>{let a=(0,th.$C)(e),i=(0,M.AQ)(e,t);if(i)return(0,tp.iJ)({mode:a?"blurred":void 0,isLowQualityPreview:!1,model:(0,eg.T$)(i),modelData:(0,ep.tA)(i),snapshotUrlTemplate:(0,ez.FO)(e),hasWebpSupport:(0,eZ.h6)(e)}).url;let s=(0,eU.JU)(e,t);return s?(0,tp.iJ)({mode:a?"blurred":void 0,isLowQualityPreview:!1,model:{id:s.id},modelData:{snapshotTimestamp:s.snapshotTimestamp,status:s.status},snapshotUrlTemplate:(0,ez.FO)(e),hasWebpSupport:(0,eZ.h6)(e)}).url:null};var tE=a(92201);let tg=["profile","videos","photos"];class tS extends n.Component{componentDidMount(){let{isPictureInPictureEnabled:e}=this.props;this._isMounted=!0,this.unblockRouter=this.props.history.block(this.routerWillLeave),this.resetPageScroll(),e&&this.props.togglePictureInPicture(!1),this.optionalAvailableSettingsLoading()}resetPageScroll(){P.Z.reset(void 0,-100),window.requestAnimationFrame(()=>{P.Z.reset(void 0,-100)})}componentWillUnmount(){var e;let{isPictureInPictureEnabled:t,model:a}=this.props;this._isMounted=!1,null===(e=this.unblockRouter)||void 0===e||e.call(this),t&&(null==a?void 0:a.status)===E.MODEL_STATUSES.STATUS_PUBLIC&&this.props.togglePictureInPicture(!0),this.props.resetViewCamBase()}componentDidUpdate(e){!e.model&&this.props.model&&P.Z.reset(void 0,-100)}replaceCurrentHistoryEntry(e){var t;let{hasProfile:a,hasRouteConflict:i,match:{params:{username:r},url:n},model:l,modelAction:o,isVisitorsAgreementAccepted:c,isLoggedIn:d}=e;if(!this._isMounted)return!1;let u=!!l&&l.isModel,m=!!l&&l.isStudio,p=!!l&&!u&&!m,h=a?"/profile":"";return u&&"follow-me"===o?(this.props.routerReplace(`/${l.username}`),!d&&l.isApprovedModel&&(c?this.props.checkInAsReferee(r):this.props.saveModelReferee(r)),!0):u&&i?(this.props.routerReplace(`/cams/${l.username}${h}`),!0):u&&(0,s.Z)(n,"/cams/")&&!i||u&&(null==r?void 0:r.toLowerCase())!==(null===(t=l.username)||void 0===t?void 0:t.toLowerCase())?(this.props.routerReplace(`/${l.username}${h}`),!0):m?(this.props.routerReplace(`/studio/${l.username}${h}`),!0):!!p&&(this.props.routerReplace(`/user/${l.username}${h}`),!0)}renderMeta(){return n.createElement(tm,this.props)}renderContainer(){let{match:e,model:t,baseModel:a}=this.props;return n.createElement(e6,{hasProfile:!!e.params.hasProfile,username:e.params.username,model:t,baseModel:a})}render(){let{isTheatreModeActive:e,username:t}=this.props;return n.createElement(S.Z,{propsUpdateToActionsMap:this.propsUpdateToActionsMap,...this.props},n.createElement("div",{className:(0,w.AK)("view-cam-page-wrapper",{"theatre-mode":e})},this.renderMeta(),n.createElement(tr,{username:t},n.createElement("div",{className:"view-cam-page"},this.renderContainer(),n.createElement(u.e,null)))),n.createElement(T,{area:"interaction"}))}constructor(...e){super(...e),(0,i._)(this,"_isMounted",!1),(0,i._)(this,"unblockRouter",void 0),(0,i._)(this,"isInitRequestDone",n.createRef()),(0,i._)(this,"optionalAvailableSettingsLoading",()=>{let{photoConfig:e}=this.props;e||this.props.loadAvailableSettings()}),(0,i._)(this,"routerWillLeave",e=>{var t,a,i;let{location:s,shouldOpenLinksInNewTab:n,isTimeline:l}=this.props,u=null!==(a=null==s?void 0:s.pathname)&&void 0!==a?a:"",m=null!==(i=null==e?void 0:e.pathname)&&void 0!==i?i:"",p=u!==m,h=p&&(0,r.Z)(u)===(0,r.Z)(m),[,,v]=m.split(/\/|#/),E=!tg.includes(v);if(f.ZP.addClick(m),(0,y.C5)()&&n)return p&&window.open(e.pathname),!!h&&void 0;!p||(0,o.NL)(m)||(0,c.KS)(m)||(0,d.Q7)(m)||!E||l||(null==e?void 0:null===(t=e.state)||void 0===t?void 0:t.shouldSkipScroll)||P.Z.reset(void 0,-100),p&&E&&this.props.giveControlDestroy()}),(0,i._)(this,"propsUpdateToActionsMap",[{update:[R.M7,R.iM],action:()=>{let{isActiveModel:e,match:{params:{username:t}}}=this.props;if(this.props.hideNotification({key:"subscription"}),!e){this.props.loadFailViewCamBase({type:"notApproved",model:{username:(0,g.no)(t)}}),this.replaceCurrentHistoryEntry(this.props);return}e&&(0,p.T)(t)&&(this.props.initViewCam({username:t,willKnightsBeLoaded:this.isInitRequestDone.current||!this.props.hasProfile}).finally(()=>this.replaceCurrentHistoryEntry(this.props)),this.isInitRequestDone.current=!0)}},{update:"model.status",action:()=>{let{model:e}=this.props;e&&(("private"===e.status||"p2p"===e.status)&&h.a.preload(),"groupShow"===e.status&&v.r.preload())}}])}}let tC={checkInAsReferee:V.eT,initViewCam:H.S1,hideNotification:L.yK,routerReplace:_.sb,saveModelReferee:V.cO,togglePictureInPicture:U.x0,loadAvailableSettings:Z.z,giveControlDestroy:m.Os,loadFailViewCamBase:tE.bk.actions.loadFail,resetViewCamBase:tE.bk.actions.reset},tb=(0,l.$j)((e,t)=>{var a;let{auth:{currentUser:i,isLoggedIn:s,isLoggingOut:r}}=e,{match:{params:{hasProfile:n,modelAction:l="",timelineType:o,username:c,mediaType:d}}}=t,u=(0,M.AQ)(e,c),m=(0,A.Uh)(e,`/${c}`),p=(0,W.Mp)(e,c),h=null===(a=null==u?void 0:u.isApprovedModel)||void 0===a||a,v=(0,D.Y)(e,{model:u}),E={};return u&&(n||d)&&(E={photosCount:(0,eT.jQ)(e),videosCount:(0,eT.E)(e),modelStatus:u.offlineStatus,siteName:(0,I.hA)(e)}),{currentUser:i,shouldOpenLinksInNewTab:(0,eb.o9)(e),hasProfile:!!n,hasRouteConflict:m,isActiveModel:h&&!p,isLoggedIn:s&&!r,isNonNudeWL:(0,I.Km)(e),isStripChat:(0,I.ok)(e),isXhlOrMirror:(0,I.cv)(e),photoConfig:(0,F.VD)(e),isTheatreModeActive:(0,k.z)(e),mediaMeta:v,model:u,baseModel:(0,eU.JU)(e,c),modelAction:l,isTimeline:!!o,snapshotUrl:tv(e,c),username:c,titleLimit:(0,I.Ei)(e),topicOrGoal:(0,eb.Ms)(e),isPictureInPictureEnabled:(0,B.Tm)(e),isVisitorsAgreementAccepted:(0,O.IG)(),modelListSectionName:(0,N.TF)(e),...E}},tC)(tS)},46486:(e,t,a)=>{a.d(t,{S:()=>i});let i=(0,a(98846).n7)({resolved:{},chunkName:()=>"ViewCamModelListWrapper",isReady(e){let t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>a.e(4134).then(a.bind(a,89325)),requireAsync(e){let t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){return a(this.resolve(e))},resolve:()=>89325},{fallback:void 0})},97683:(e,t,a)=>{a.d(t,{Z:()=>T});var i=a(27378),s=a(87048),r=a(62962),n=a(95366),l=a(48361),o=a(99748),c=a(98846),d=a(95654),u=a(62663),m=a(80092),p=a(12278),h=a(54319),v=a(87466),E=a(46672),g=a(55788);let S=9/16,C=(0,c.n7)({resolved:{},chunkName:()=>"[dynamic@Lottery]",isReady(e){let t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>a.e(3298).then(a.bind(a,55502)),requireAsync(e){let t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){return a(this.resolve(e))},resolve:()=>55502},{fallback:void 0,ssr:!1}),b=()=>{let e=(0,d.C)(p.ts),t=(0,d.C)(m.gI);return!(!e||!e.isStudio&&!e.isModel)||t?null:i.createElement(C,null)},T=({model:e,baseModel:t,shouldShowOtherModels:a,isTheatreModeActive:c})=>{let{isLayoutUpToL:m}=(0,u.do)("isLayoutUpToL"),p=(0,d.C)(h.rr),C=e&&n.LKO.includes(null==e?void 0:e.status)?S:p;return i.createElement(i.Fragment,null,!c&&i.createElement(l.Z,{model:e,shouldHideNextModel:!a}),i.createElement("div",{className:"page"},i.createElement("div",{style:{"--aspect-ratio":1/C},className:(0,o.AK)(g.Z.root,g.Z.heightAuto,"view-cam-page-main widescreen-container",{[g.Z.theatreMode]:c,[g.Z.vertical]:C>1})},i.createElement(E.L,null),i.createElement(v.Z,{model:e,baseModel:t,layout:({content:e,controls:t,info:a,systems:s},{isPoster:r})=>i.createElement("div",{className:(0,o.AK)(g.Z.videoLayout,"video","view-cam")},s,i.createElement("div",{className:(0,o.AK)(g.Z.video,{[g.Z.isPoster]:r})},e),i.createElement("div",{className:g.Z.bottom},t,a))}),m&&i.createElement(s.$,null),i.createElement("div",{className:(0,o.AK)(g.Z.chatLayout,"chat")},i.createElement(r.W,{className:g.Z.chat,chatOwner:e||t}),!c&&i.createElement(b,null)))))}},87466:(e,t,a)=>{a.d(t,{Z:()=>sW});var i,s,r,n=a(18775),l=a(27378),o=a(48204),c=a(94380),d=a(95654),u=a(42339),m=a(14151),p=a(58320),h=a(60278),v=a(12265),E=a(79561);let g=()=>{let e=(0,c.T)(),t=(0,d.C)(h.HN),a=(0,d.C)(u.pIH),i=(0,d.C)(E.UP),s=(0,d.C)(E.tM),r=(0,d.C)(E.gJ),n=(0,d.C)(p.fM),o=(0,d.C)(h.Jl);(0,l.useEffect)(()=>{if(!r&&(s&&e((0,v.$5)("")),t&&i)){let t=!n||!o;(!a||a&&t)&&e((0,v.$5)(m.PLAYER_TYPES.WEBRTC))}},[e,t,r,n,i,s,o,a])},S=()=>(g(),null);var C=a(38901),b=a(61229),T=a(95366),w=a(93337),y=a(23359),f=a(38667),_=a(77382),P=a(62668),N=a(83550),A=a(81346),k=a(80936),I=a(36846),M=a(54534),R=a(91090),L=a(99973),O=a(84423),U=a(47813),B=a(99748),Z=a(42815),V=a(64696),F=a(62512),D=a(37112),W=a(70203),H=a(66261),x=a(13743),$=a(62182),G=a(27251),K=a(12712),q=a(62203),Y=a(73804),z=a(80092),j=a(12278),Q=a(71227),J=a(2656);let X={updateIsBackgroundThrottle:J.gk,updateIsBackgroundForceStopPlaying:J.ZF};class ee extends l.Component{componentDidUpdate(e){this.props.isBackgroundVideoStopPlayingEnabled&&!e.isBackgroundVideoStopPlayingEnabled&&document.addEventListener("visibilitychange",this.onVisibilityChange)}componentDidMount(){(this.props.isBackgroundThrottleEnabled||this.props.isBackgroundVideoStopPlayingEnabled)&&(this.props.isBackgroundThrottle&&this.props.updateIsBackgroundThrottle(!1),this.props.isForceStopPlaying&&this.props.updateIsBackgroundForceStopPlaying(!1),(0,B.AO)()&&this.launchBackgroundTimer(),document.addEventListener("visibilitychange",this.onVisibilityChange))}componentWillUnmount(){(this.props.isBackgroundThrottleEnabled||this.props.isBackgroundVideoStopPlayingEnabled)&&(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.timer&&clearTimeout(this.timer))}render(){return null}constructor(...e){super(...e),(0,n._)(this,"timer",null),(0,n._)(this,"launchBackgroundTimer",()=>{this.timer=window.setTimeout(()=>{this.props.isBackgroundVideoStopPlayingEnabled?this.props.updateIsBackgroundForceStopPlaying(!0):this.props.isBackgroundThrottleEnabled&&this.props.updateIsBackgroundThrottle(!0),this.timer=null},this.props.backgroundActionDelay)}),(0,n._)(this,"onVisibilityChange",()=>{let e=(0,B.AO)(),{isBackgroundThrottle:t,isForceStopPlaying:a}=this.props;!e||t||a||this.timer||this.launchBackgroundTimer(),!e&&this.timer&&(clearTimeout(this.timer),this.timer=null),!e&&t&&this.props.updateIsBackgroundThrottle(!1),!e&&a&&this.props.updateIsBackgroundForceStopPlaying(!1)})}}let et=(0,o.$j)(e=>{let t=(0,z.MC)(e),a=(0,z.No)(e),i=(0,E.x)(e),s=(0,p.if)(e);return{isBackgroundThrottle:(0,p.zO)(e),isForceStopPlaying:(0,p.aX)(e),isBackgroundThrottleEnabled:!t&&!a,isBackgroundVideoStopPlayingEnabled:(a&&s||t)&&i,backgroundActionDelay:t||a?1e4:6e4}},X)(ee);var ea=a(36886),ei=a(76482),es=a(37051),er=a(91343),en=a(11718),el=a(35506),eo=a(50557),ec=a(41950),ed=a(87937),eu=a(243),em=a(98371),ep=a(61061),eh=a(51945),ev=a(53514),eE=a(38629),eg=a(78021),eS=a(79336),eC=a(30399),eb=a(29421),eT=a(69497),ew=a(64489),ey=a(87444),ef=a(48015),e_=a(85353),eP=a(4368),eN=a(82349),eA=a(31029),ek=a(96811),eI=a(15218);let eM=(e,t)=>{let[a,i]=l.useState(e),s=l.useCallback((0,ei.Z)(e=>{i(e)},t),[]);return l.useEffect(()=>{s(e)},[e]),a},eR=({isRemote:e,isLoading:t,shouldDelayControlsRendering:a,isPlaying:i,isBlurred:s,onPlayButtonClick:r})=>{let n=l.useMemo(()=>e?t?l.createElement(e_.Z,{isCentered:!0}):i||s?null:l.createElement(ep.Z,{onClick:r}):null,[e,t,i,s,r]),o=eM(n,300);return a&&n?o:n},eL=e=>{let[t,a]=l.useState(e),i=(0,l.useRef)((0,ew.Z)(e=>{a(e)},400,{leading:!0,trailing:!1}));return l.useEffect(()=>{e?i.current(e):a(void 0)},[e,i,a]),[t]},eO=(0,l.forwardRef)(({videoElement:e,lastSnapshotUrl:t,isWatermark:a,wasPlayed:i,modelName:s,isRemote:r,isPlaying:n,isLoading:o,onTimeUpdate:c,isCollectLogs:u,shouldDelayControlsRendering:m,shouldUseNewControls:h},v)=>{let g=l.useRef(null),S=(0,d.C)(E.tS),C=(0,d.C)(p._V),b=(0,d.C)(p.Bk),T=(0,d.C)(z.vK),w=(0,d.C)(p.$C),y=l.useRef(()=>{}),[f,_]=l.useState(!1),[P]=eL(t);l.useImperativeHandle(v,()=>g.current);let N=l.useRef(null),[A,k]=l.useState(0);l.useEffect(()=>{let e=null;return o?e=setTimeout(()=>{_(o)},500):_(!1),()=>{e&&clearTimeout(e)}},[o]),l.useEffect(()=>{if(g.current&&e&&C){let{destroy:t}=(0,eI.N)(e,g.current,b,w);y.current=t}else y.current&&y.current();return()=>{y.current&&y.current()}},[w,e,C,b,g]),(0,l.useEffect)(()=>{let t;return S&&e&&requestAnimationFrame(()=>{t=(0,B.Cu)(e)}),()=>{null==t||t()}},[S,e]),(0,eN.Z)(()=>{var t;e&&(null===(t=N.current)||void 0===t||t.updatePosition(),A!==e.currentTime?(k(e.currentTime),ek.Z.playing(),c&&c()):ek.Z.paused())},500),(0,eN.Z)(()=>{e&&u&&D.Z.setFields({width:e.videoWidth,height:e.videoHeight})},1e3);let I=l.useCallback(()=>{(0,eA.z)(0).play()},[]);return l.createElement("div",{key:"video_element_wrappper",className:(0,B.AK)("video-element-wrapper",{"video-element-wrapper--poster":T&&!w&&!S&&r,"video-element-wrapper--loading":o,"video-element-wrapper--played":!o||i}),ref:g},l.createElement("div",{className:(0,B.AK)("video-element-wrapper-blur",{"with-poster":!i,"with-blur":!0})},t&&l.createElement(eP.s,{src:t,area:"snapshot",username:s})),T&&l.createElement("div",{className:"video-element-wrapper-image-poster"},P&&l.createElement(eP.s,{src:P,area:"snapshot",username:s})),a&&l.createElement(ey.l,{ref:N,videoElement:e}),h?l.createElement(eR,{isRemote:r,isLoading:o,shouldDelayControlsRendering:m,isPlaying:n,isBlurred:S,onPlayButtonClick:I}):r?f?l.createElement(e_.Z,{isCentered:!0}):o||n||S?null:l.createElement(ep.Z,{onClick:I}):null,e&&l.createElement(ef.Z.Consumer,null,({registerVideoElement:t})=>{null==t||t(e)}))});var eU=a(53738),eB=a(33491),eZ=a(75151),eV=a(25304),eF=a(34342),eD=a(6558),eW=a(84543),eH=a(20717),ex=a(50399),e$=a(98459),eG=a(68479),eK=a(74178);let eq={ab_ios_ll_hls:!!(L.BROWSER_CAPABILITIES.iOS&&(null===(i=window)||void 0===i?void 0:i.ManagedMediaSource)&&(null===(s=window)||void 0===s?void 0:s.ManagedSourceBuffer))},eY=()=>{let e=(0,d.C)(e$.Fy);return l.useMemo(()=>{let t=Object.keys(eq);return Object.entries(e).reduce((e,[a,i])=>(i&&t.includes(i)&&(e[a]=eq[i]),e),{})},[e])};var ez=a(32630),ej=a(1210),eQ=a(40671),eJ=a(14445),eX=a(76811),e0=a(83211),e1=a(43562);let e2=!1,e6=({mmpModule:e,shouldShowPip:t})=>{let{playerRef:a}=e.useMouflonPlayer(),i=l.useRef(null),s=l.useRef(null),{abTests:r,metricsCollectorEndpoint:n}=(0,e1.W)(),o=(0,d.C)(j.rc),c=(0,d.C)(em.Pu);l.useEffect(()=>{if(a.current&&n&&o){var e,t,i,s;a.current.configureMetrics(n,"stripchat_broadcast"),a.current.setAbTests(r),null===(e=(t=a.current).setMetricsUserId)||void 0===e||e.call(t,o),null===(i=(s=a.current).setUserType)||void 0===i||i.call(s,"user"),a.current.setAdditionalMetricsFields({isMobile:c})}},[a.current,r,o,c,n]);let{settingDevices:u,isBroadcastSettingsVisible:m,broadcastConfig:p,settings:h,mediaStream:v,handleBroadcastSettingsChange:E,isMicMuted:g,isCameraDisabled:S}=(0,e0.$)({mmp:e,shouldRequestPermissions:!e2,onPermissionsRequested:()=>{e2=!0}}),C=l.useMemo(()=>({videoControllerConfig:{rootElement:i.current,autoplay:!0}}),[i.current]),b=l.useMemo(()=>({userId:null==p?void 0:p.userId,userStreamNameExpiration:null==p?void 0:p.streamNameExpiration}),[p]);return p?l.createElement(l.Fragment,null,l.createElement("div",{className:"web-rtc-broadcasting web-rtc-broadcasting--new",ref:i},l.createElement(e.MouflonPlayer,{playerType:e.EPlayerType.BROADCAST,videoElement:s.current||void 0,isABREnabled:!1,volume:0,MediaStream:v||void 0,WebRTCSignallingUrl:p.streamUrl,WebRTCStreamId:p.streamName,WebRTCPublishCustomData:b,WebRTCACLToken:p.broadcastToken,playerConfig:C,playerRef:a,appKey:p.webRTCAppKey,autoplay:!0}),l.createElement("video",{className:t?"":"hidden",ref:s})),!L.BROWSER_CAPABILITIES.touch&&l.createElement(eX.Z,{settings:h,devices:u,localStream:v,isBroadcastSettingsVisible:m,changeBroadcastStreamSettings:E,isMicMuted:g,isCameraDisabled:S})):null},e3=e=>{let t=(0,d.C)(p.Ki),a=(0,d.C)(p.Ur),i=(0,d.C)(eB.TM),[s,r]=(0,l.useState)(!1),n=(0,l.useCallback)((0,ei.Z)(e=>{r(e)},1e3),[r]);return((0,l.useEffect)(()=>{n(!!e.shouldRenderCamToCamBroadcast)},[e.shouldRenderCamToCamBroadcast]),e.isWebRTC)?l.createElement("div",{className:"web-rtc-player-wrapper"},l.createElement("div",{className:(0,B.AK)("web-rtc-player",{"cam-to-cam":e.isCamToCam,mirror:a,settings:t&&!L.BROWSER_CAPABILITIES.touch,"expanded-in-cam-to-cam":i})},l.createElement("div",{className:"web-rtc-content"},l.createElement("div",{className:"web-rtc-content-wrapper"},l.createElement("div",{className:"web-rtc-playing"},l.createElement(eO,{...e,ref:e.playingVideoRootRef})),s&&l.createElement(e6,{shouldShowPip:e.isCamToCam&&e.isVideoEnabled,mmpModule:e.mmpModule}))))):l.createElement("div",{className:"mse-player"},l.createElement(eO,{...e,ref:e.playingVideoRootRef}))},e4="mmpStartResolution",e8=({resolutions:e,currentResolution:t,playerType:a,isEnabled:i})=>{let s=(0,c.T)(),r=(0,d.C)(eb.qr),n=(0,d.C)(p.UO),o=(0,d.C)(eC.D_),u=(0,l.useRef)(!1),m=(0,l.useRef)(!1),[h,v]=l.useState(W.m.get(e4,{bitrate:0,name:""})),E=(t,a)=>{if(!i){W.m.remove(e4),v({bitrate:0,name:""});return}if((null==e?void 0:e.length)&&t){let i=e.find(e=>e.name===t||e.height&&e.height===parseInt(t,10));i?(v({bitrate:i.bitrate,name:i.name}),a&&W.m.set(e4,{bitrate:i.bitrate,name:i.name})):v({bitrate:0,name:t})}};return l.useEffect(()=>{if(n){E(n.presetQuality,!1);return}if(m.current){m.current=!1;return}E(r,!0)},[r,n]),l.useEffect(()=>{u.current=!1},[o,a]),l.useEffect(()=>{if(t&&i&&!n){if(r!==T.rdN&&t.name!==r&&(m.current=!0,s((0,eQ.J0)(t.name))),!u.current){u.current=!0;return}(null==t?void 0:t.name)&&E(null==t?void 0:t.name,!0)}},[t,i]),{startResolution:h}};var e9=a(52953);let e5=e=>e.bitrate||0,e7=({playerType:e,wasPlayed:t,lastSnapshotUrl:a,mmpModule:i,onPlaying:s,updateInitializePlayer:r,modelName:n,modelId:o,updatePlayerResolution:u})=>{var v;let g=(0,d.C)(p.Nl),S=(0,d.C)(p.ro),[C,b]=l.useState(""),w=(0,c.T)(),y=l.useRef((0,eA.z)(0));y.current.disableRemotePlayback=!0;let f=(0,eU.Z)(e=>{null==u||u(e.width,e.height)}),_=l.useCallback(e=>{w((0,eZ.gi)({error:e.error.message,playerType:e.playerType}))},[w]),P=(0,l.useRef)(!1),[N,A]=l.useState(!1),k=l.useCallback(()=>{P.current=!0,e===m.PLAYER_TYPES.HLS&&g&&(A(!1),b(g))},[e,g]),{playerRef:I,abrPolicy:M,resolutions:R,videoPlaybackState:O,isLoading:U,isPlaying:B,isErrored:Z,isModuleLoading:V,playbackStartType:F,currentResolution:D}=i.useMouflonPlayer({onPlaying:s,onUpdatePlayerResolution:f,onError:_,onResolutionNotFound:k}),W=(0,d.C)(p.Cj),{playConfig:H,broadcastConfig:x}=(0,d.C)(p.df),$=(0,d.C)(p.PW),{metricsCollectorEndpoint:G,metricsProjectId:K,useBitrateBasedResolution:q,tempUseSafariC2CFix:Y}=(0,d.C)(p.I4),Q=(0,d.C)(e$.Aj),X=l.useRef(-1),[ee,et]=l.useState(null==H?void 0:null===(v=H.preset)||void 0===v?void 0:v.presetQuality),[ea,ei]=l.useState(W.value),es=(0,d.C)(p.nc),er=eY(),en=(0,d.C)(p.jq),el=(0,d.C)(E.UP),eo=(0,d.C)(eB.TM),ec=(0,d.C)(p.Xy),ed=(0,d.C)(j.rc),eu=(0,d.C)(p.fM),em=(0,d.C)(h.Jl),ep=(0,d.C)(p.Bl),eh=(0,d.C)(p.zO),ev=(0,d.C)(z.gn),eE=(0,d.C)(E.Fx),eg=(0,l.useRef)(),[eS,eC]=(0,l.useState)(!0),eb=(0,d.C)(p.Nt),eT=(0,d.C)(E.hX),ew=(0,d.C)(p.$C),ey=(0,d.C)(p.CF),ef=(0,d.C)(ex.wf),e_=(0,ez.c)({isCanvasEnabledByFeature:ec,isPlaying:B,isLoading:U,streamId:o}),eP=(0,d.C)(p.ou),eN=(0,d.C)(p.Cj),ek=(0,d.C)(p.Vh),eI=(0,d.C)(z.mV),eM=(0,d.C)(z.Ko),eR=(0,eJ.yx)(),{debugContainerNode:eL}=(0,l.useContext)(e9.e),eO=(0,d.C)(j.PY),eq=l.useMemo(()=>ed?2*ed:2*Math.abs(Number(eO))+1,[ed,eO]),{startResolution:eX}=e8({resolutions:R,currentResolution:D,playerType:e,isEnabled:q}),e0=(0,l.useMemo)(()=>({[eR]:()=>{var e;null===(e=I.current)||void 0===e||e.sendCustomEvent("watchClearTime")}}),[o,eR]);(0,eD.h)({onWatchClearTime:e0});let e1=l.useRef(null),e2=l.useMemo(()=>e===m.PLAYER_TYPES.WEBRTC?i.EPlayerType.WEBRTC:(0,eG.JV)(eT)?i.EPlayerType.HLS:i.EPlayerType.NATIVE,[i,e,eT]);l.useEffect(()=>{"auto"===F&&w((0,eF.u)())},[w,F]),l.useEffect(()=>{e2===i.EPlayerType.WEBRTC&&w((0,J.G4)(ej.p.WEBRTC_RISTRETTO)),w((0,J.G4)(e2===i.EPlayerType.NATIVE?ej.p.NATIVE:ej.p.DOPPIO))},[w,i.EPlayerType,e2]),l.useEffect(()=>{if(U)return()=>{A(!0)}},[U]),l.useEffect(()=>{A(!1)},[o,e]),l.useEffect(()=>{var t,a,i;if(!R.length)return;let s=null===(t=(0,eH.en)(R[0].url||""))||void 0===t?void 0:t.hostname;if(s){let e=s.indexOf("hls-"),t=(null===(a=s.split(".")[0])||void 0===a?void 0:a.substr(e))||"";w((0,eV.M3)(t))}if(q)return;let r=X.current,n=L.BROWSER_CAPABILITIES.isMobile?es.startMobileResolution:es.startDesktopResolution,l=(0,h.Fm)(n,R.map((e,t)=>({value:parseInt(e.name,10),index:t}))).index||0;if(r>-1){let e=Array.from(R).sort((e,t)=>e5(t)-e5(e))[0],t=r>=e5(e),a=eN&&eM?R.findIndex(e=>e.name===eN.presetQuality):-1,i=t?R.findIndex(t=>t.bitrate===e.bitrate):R.findIndex(e=>e5(e)+1e5>=r&&r>=e5(e)-1e5);if(a>=0)l=a;else if(i>=0)l=i;else{let e=R.reduce((e,t,a)=>r?r<=e5(t)&&(!e||r>=e5(t))?{level:a,bitrate:t.bitrate}:e:null,null);l=(null==e?void 0:e.level)||l}}if(l||0===l||(l=R.findIndex(e=>`${e.height}p`===m.cC)),null!==l){let t=R[l].name;ei(t),e===m.PLAYER_TYPES.HLS&&(null===(i=I.current)||void 0===i||i.setResolutionByName(t))}},[e,I,w,es,R]),l.useEffect(()=>{P.current&&(A(!1),P.current=!1),eM&&!ew?b(S||""):(A(!1),b(g||""))},[g,S,eM,ew]);let e6=l.useMemo(()=>{var e;return(null==H?void 0:null===(e=H.preset)||void 0===e?void 0:e.type)===T.rdN},[H]),e4=l.useCallback(()=>{if(y.current){let{videoHeight:e}=y.current;if(e6&&!eh&&e!==eg.current){let t=e?`${e}p`:null;t&&w((0,eQ.wb)(t))}eg.current=e}},[w,y,eh,e6]);l.useEffect(()=>{var e,t;(null==H?void 0:null===(e=H.preset)||void 0===e?void 0:e.name)&&(null==H?void 0:null===(t=H.preset)||void 0===t?void 0:t.name)!==ee&&et(H.preset.type===T.pgl?T.pgl:H.preset.presetQuality||H.preset.quality)},[ee,H]),l.useEffect(()=>{(0,eW.p)(M,eK.jI)&&w((0,J.LV)(M))},[w,M]),l.useEffect(()=>{var e,t,a;ef&&(null===(e=I.current)||void 0===e?void 0:e.setMetricsTimeOrigin)&&I.current.setMetricsTimeOrigin(ef),(null===(t=I.current)||void 0===t?void 0:t.setMetricsUserId)&&I.current.setMetricsUserId(eq),null===(a=I.current)||void 0===a||a.start()},[I]),l.useEffect(()=>{eL&&I.current&&eL.appendChild(I.current.debugPanelRootContainer)},[eL,I]);let e7=l.useMemo(()=>({isMobile:L.BROWSER_CAPABILITIES.isMobile,streamType:eE}),[eE]),te=l.useMemo(()=>{var t;let a=e===m.PLAYER_TYPES.WEBRTC?"video-element web-rtc-video-element":"video-element";return{autoplay:!0,webRTCConfig:{abrControllerConfig:ev?{isNewAbr:!0,...eb}:{isNewAbr:!1},streamDispatcherConfig:{startResolution:null==H?void 0:null===(t=H.preset)||void 0===t?void 0:t.presetQuality,startResolutionBitrate:eX.bitrate,isFastStartEnabled:ep},broadcastDispatcherConfig:{enableBackendStreamQualityRecognition:eP},peerConnectionConfig:{playoutDelayHint:(null==H?void 0:H.playoutDelayHint)||void 0,setIceServersForFirefox:ey}},hlsConfig:{playlistLoader:eI?{partHoldBack:ek.hlsPartHoldback,additionalStartParts:ek.hlsAdditionalStartParts}:{},bufferStallsDetector:{bufferAmountToDetectStall:eM?.3:void 0},bufferController:{recreateSourceBufferOnResolutionChange:eM&&L.BROWSER_CAPABILITIES.safari},resolutionsManager:{initialResolutionBitrate:eX.bitrate,useFallbackResolutionIfResolutionNotFound:!eM&&void 0}},videoControllerConfig:{rootElement:e1.current,minimalPossibleVideoDimension:50,shouldUseCanvas:e_,canvasElementClassName:a,videoElementClassName:a,isNonAnonymous:!0,isRemote:!0,autoplay:!0}}},[H,e,e1.current,e_,ep,eP,W,ea,ek,eI]);l.useEffect(()=>{r()},[r]),(0,l.useEffect)(()=>{eC(!0)},[e]),(0,l.useEffect)(()=>{V||eC(!1)},[V]),(0,l.useEffect)(()=>{el||w((0,J.UK)(!1))},[el,w]);let tt=U||Z||!O,ta=Y?V:eS;return l.createElement(i.MouflonPlayer,{videoElement:y.current,HLSStreamUrl:C,NativeStreamURL:g||void 0,WebRTCStreamId:null==H?void 0:H.streamName,WebRTCSignallingUrl:null==H?void 0:H.streamUrl,WebRTCACLToken:null==H?void 0:H.token,playerType:e2,playerRef:I,isABREnabled:e6,WebRTCQuality:ee,quality:eM&&(0,eG.JV)(eT)&&!q?eN.presetQuality:void 0,qualityBitrate:eX.bitrate,playerConfig:te,abrPresets:q?void 0:$,volume:en,metricsProjectId:K,metricsCollectionEndpoint:G,appKey:"callbackApp",abTests:Q,abTestsSupport:er,additionalMetricFields:e7},l.createElement(e3,{mmpModule:i,playingVideoRootRef:e1,lastSnapshotUrl:a,isLoading:tt,isPlaying:B,wasPlayed:t,isRemote:!0,modelName:n,videoElement:y.current,isWatermark:!(el&&eo),onTimeUpdate:e4,isCollectLogs:!0,isVideoEnabled:!eu,isCamToCam:el,shouldUseNewControls:eM,shouldDelayControlsRendering:N,shouldRenderCamToCamBroadcast:!!(el&&x&&ed&&!ta&&(!eu||!em)),isWebRTC:e===m.PLAYER_TYPES.WEBRTC}))},te=e=>{let[t,a]=l.useState(null),i=(0,d.C)(eC.MV),s=(0,d.C)(eC.D_),r=(0,c.T)(),{version:n,maxAttemptsToLoad:o,isEnabled:u,sourceOrigin:m}=(0,d.C)(p.u4);return l.useEffect(()=>{(0,eT.K5)({isExternalSourceEnabled:u,externalVersion:n,externalSourceOrigin:m,maxAttempts:o}).then(({module:e,localModuleLoaderWasUsed:t})=>{e&&(r((0,J.pF)({playerWasLoadedFromExternalSource:!t,playerVersion:t?void 0:n,isMMP:!0})),a(e))})},[]),t?l.createElement(e7,{...e,mmpModule:t,modelName:i,modelId:s}):l.createElement(eO,{lastSnapshotUrl:e.lastSnapshotUrl,isLoading:!1,isPlaying:!1,wasPlayed:!1,modelName:i,isRemote:!0})};var tt=a(61326);let ta=e=>{let{playerType:t,isInCam2Cam:a,isCameraDisabled:i,modelName:s,isBackgroundThrottle:r,isHLSSmoothResolutionChangeEnabled:n,isBroadcastExpandedInCam2Cam:o,mmpState:{isLoading:u,isPlaying:h,isErrored:v,videoPlaybackState:E,isABREnabled:g,shouldRenderCam2CamBroadcast:S,shouldDelayLoader:C}}=(0,e1.W)(),{mmpModule:b}=(0,tt.V)({isEnabled:!0}),{activePlayerIndex:T}=(0,l.useContext)(e9.e),{rootElementRef:w,videoElementRef:y}=(0,eA.N)(T),f=(0,d.C)(p.Ki),_=(0,d.C)(p.Ur),P=l.useRef(),N=(0,c.T)(),A=l.useCallback(()=>{if(y.current){let{videoHeight:e}=y.current;if(g&&!r&&e!==P.current){let t=e?`${e}p`:null;t&&N((0,eQ.wb)(t))}P.current=e}},[N,y,r,g]);l.useEffect(()=>{h&&e.onPlaying&&e.onPlaying()},[h]),l.useEffect(()=>{e.updateInitializePlayer&&e.updateInitializePlayer()},[e.updateInitializePlayer]);let k=t===m.PLAYER_TYPES.WEBRTC,I=l.createElement(eO,{isRemote:!0,isCollectLogs:!0,ref:w,wasPlayed:e.wasPlayed,lastSnapshotUrl:e.lastSnapshotUrl,isLoading:u||v||!E,isPlaying:h,modelName:s,videoElement:y.current||void 0,isWatermark:!(a&&o),onTimeUpdate:A,shouldUseNewControls:n,shouldDelayControlsRendering:C,isWebRTC:k});return k?l.createElement("div",{className:"web-rtc-player-wrapper"},l.createElement("div",{className:(0,B.AK)("web-rtc-player",{"cam-to-cam":a,mirror:_,settings:f&&!L.BROWSER_CAPABILITIES.touch,"expanded-in-cam-to-cam":o})},l.createElement("div",{className:"web-rtc-content"},l.createElement("div",{className:"web-rtc-content-wrapper"},l.createElement("div",{className:"web-rtc-playing"},I),S&&b&&l.createElement(e6,{shouldShowPip:a&&!i,mmpModule:b}))))):l.createElement("div",{className:"mse-player"},I)},ti=["scroll","mousemove","pointerdown","keydown"];class ts extends l.PureComponent{componentDidMount(){this.props.isMediaPage&&ti.forEach(e=>document.addEventListener(e,this.handleFirstInteraction)),this.props.updateHLSStreamEndedState(!1),this.removeAudioStartListener=ec.KY.subscribePlayAudioEvent(e=>{e.detail.playerId!==this.VideoPlayerId&&this.props.togglePlayerAvailability(!1)})}componentDidUpdate(e){var t;this.updateDocumentVisibilityState(e,this.props),(null==e?void 0:e.modelId)!==(null===(t=this.props)||void 0===t?void 0:t.modelId)&&this.setState({wasPlayed:!1})}componentWillUnmount(){var e;this.updateInitializePlayer&&this.updateInitializePlayer.cancel(),null===(e=this.removeAudioStartListener)||void 0===e||e.call(this),this.props.updateInitializePlayer(!1),this.clearTimeout(),ti.forEach(e=>document.removeEventListener(e,this.handleFirstInteraction))}static getDerivedStateFromError(){return{isFailed:!0}}componentDidCatch(e,t){el.ZP.error(e,t),this.props.apiLog("error","playerFailed",{error:e.toString(),errorInfo:t,isMMP:!0})}render(){return this.state.isFailed?l.createElement(ev.Z,null):l.createElement(eE.default,{className:(0,B.AK)("player",eS.j.player,this.props.className)},l.createElement(eh._,null),this.renderPlayerContent(),l.createElement(en.P,{className:"player__player-controls"}),this.renderStreamController())}constructor(e){super(e),(0,n._)(this,"lastScrollY",0),(0,n._)(this,"updateInitializePlayer",(0,ei.Z)(()=>{this.props.updateInitializePlayer(!0)},500)),(0,n._)(this,"removeAudioStartListener",void 0),(0,n._)(this,"VideoPlayerId",`WebRTC${(0,er.x0)()}`),(0,n._)(this,"timeoutId",void 0),(0,n._)(this,"handleFirstInteraction",e=>{if("scroll"===e.type&&this.lastScrollY<=window.scrollY){this.lastScrollY=window.scrollY;return}this.setState({isAfterUserInteraction:!0}),ti.forEach(e=>document.removeEventListener(e,this.handleFirstInteraction))}),(0,n._)(this,"clearTimeout",()=>{void 0!==this.timeoutId&&clearTimeout(this.timeoutId)}),(0,n._)(this,"handlePlaying",()=>{this.state.wasPlayed||(this.setState({wasPlayed:!0}),this.props.onPlaying(),this.props.updateHLSStreamEndedState(!1))}),(0,n._)(this,"togglePlayerAvailabilityIfNeeded",({isDocumentVisible:e,isInPrivate:t,isBlurVideoOnPrivate:a,isPlayerAvailability:i})=>{if(L.BROWSER_CAPABILITIES.isMobile||L.BROWSER_CAPABILITIES.isTablet){if(e||a){this.clearTimeout(),!i&&this.state.wasPlayed&&this.props.togglePlayerAvailability(!0);return}t?this.timeoutId=setTimeout(()=>this.props.togglePlayerAvailability(!1),6e4):this.props.togglePlayerAvailability(!1)}}),(0,n._)(this,"updateDocumentVisibilityState",(e,t)=>{let{isDocumentVisible:a}=t;(0,$.gk)(e,t)&&(a&&this.setState({isDocumentVisible:a}),this.togglePlayerAvailabilityIfNeeded(t))}),(0,n._)(this,"handlePlayClick",()=>{ec.KY.emitPlayAudioEvent(this.VideoPlayerId),this.props.togglePictureInPicture(!1),this.props.togglePlayerAvailability(!0),this.props.updateDocumentVisibility()}),(0,n._)(this,"handleHLSStreamEnded",()=>{this.props.updateHLSStreamEndedState(!0)}),(0,n._)(this,"handleHLSStreamRestored",()=>{this.props.isHLSStreamWasEnded&&this.props.updateHLSStreamEndedState(!1)}),(0,n._)(this,"renderPlayer",()=>{let{lastSnapshotUrl:e,volume:t,playerType:a,isPlayerAvailability:i,isPictureInPicture:s,isMediaPage:r,isBackgroundForceStopPlaying:n,shouldUseDetachedMMP:o}=this.props,{isDocumentVisible:c,isAfterUserInteraction:d}=this.state;if(!c||!i||s||n||r&&!d)return l.createElement(ep.Z,{onClick:this.handlePlayClick});let u={lastSnapshotUrl:e};return(0,ed.sk)()?l.createElement(l.Fragment,null):o?l.createElement(ta,{wasPlayed:!!this.state.wasPlayed,lastSnapshotUrl:u.lastSnapshotUrl,onPlaying:this.handlePlaying,updateInitializePlayer:this.updateInitializePlayer}):l.createElement(te,{onPlaying:this.handlePlaying,wasPlayed:this.state.wasPlayed,lastSnapshotUrl:u.lastSnapshotUrl,updateInitializePlayer:this.updateInitializePlayer,updatePlayerResolution:this.props.updatePlayerResolution,playerType:a})}),(0,n._)(this,"renderStreamController",()=>{let{playerType:e}=this.props;return e===m.PLAYER_TYPES.WEBRTC||e===m.PLAYER_TYPES.HLS?l.createElement(eg.Z,null):null}),(0,n._)(this,"renderPlayerContent",()=>l.createElement(eo.s,null,this.renderPlayer())),this.state={wasPlayed:!1,isDocumentVisible:this.props.isDocumentVisible,isFailed:!1,isAfterUserInteraction:!this.props.isMediaPage}}}(0,n._)(ts,"defaultProps",{isLoggedIn:!1,isInCam2Cam:!1,isInPrivate:!1,isPictureInPicture:!1,lastSnapshotUrl:"",playerType:void 0,volume:0,onPlaying:es.Z,isHLSStreamWasEnded:!1});let tr={togglePlayerAvailability:v.X6,updatePlayerType:v.$5,updateInitializePlayer:J.kV,updateDocumentVisibility:P.uP,togglePictureInPicture:J.x0,apiLog:el.t$,updateHLSStreamEndedState:v.zH,setEmulatePlayerCrashState:J.LA},tn=(0,o.$j)(e=>{let{auth:{isLoggedIn:t,isLoggingOut:a},viewCam:{isPlayerAvailability:i},ui:{isDocumentVisible:s},player:{isBroadcastSettingsVisible:r}}=e,n=(0,eC.D_)(e),l=(0,E.IW)(e);return{isDocumentVisible:!!s,isBroadcastSettingsVisible:r,isLoggedIn:t&&!a,isInCam2Cam:l&&(0,E.UP)(e),isInPrivate:l,modelId:n,isMediaPage:(0,eu.HK)(e),playerType:(0,p.Aq)(e),isPlayerAvailability:i,volume:(0,p.Sf)(e),isPictureInPicture:(0,h.bd)(e),isHLSStreamWasEnded:(0,eb.pc)(e),deviceType:(0,em.y$)(e),crashEmulateState:(0,h.jU)(e),isBackgroundForceStopPlaying:(0,p.aX)(e),isBlurVideoOnPrivate:(0,p.$C)(e),shouldUseDetachedMMP:(0,p.Ju)(e)}},tr)(ts);var tl=a(18984);let to=e=>{let t=(0,d.C)(p.l2);return(0,ea.t)()?t?l.createElement(tn,e):l.createElement(tl.ZP,e):null};var tc=a(29413),td=a(97606);let tu=()=>{let{trans:e}=(0,td.QT)();return l.createElement("div",{className:"player-shutter"},l.createElement(tc.Z,{img:"no-video"}),l.createElement("div",{className:"text-wrapper"},e("playerErrors.outdatedBrowser")))};var tm=a(79455),tp=a(87489),th=a(66483),tv=a(32284),tE=a(53603);let tg={root:"ViewCamWrapper#TP",fullscreen:"ViewCamWrapper__fullscreen#XX",theatreMode:"ViewCamWrapper__theatreMode#KG",blur:"ViewCamWrapper__blur#SX",img:"ViewCamWrapper__img#QA",stub:"ViewCamWrapper__stub#Vs",bg:"ViewCamWrapper__bg#qk",filter:"ViewCamWrapper__filter#du",backdrop:"ViewCamWrapper__backdrop#ms",softBackdrop:"ViewCamWrapper__softBackdrop#Yo"},tS=[T.MODEL_STATUSES.STATUS_PRIVATE,T.MODEL_STATUSES.STATUS_VIRTUAL_PRIVATE,T.MODEL_STATUSES.STATUS_P2P,T.MODEL_STATUSES.STATUS_PUBLIC],tC=({posterImageSrc:e,children:t,model:a})=>{let[i,s]=(0,l.useState)(e),r=(0,d.C)(eb.cU),n=(0,d.C)(K.z),o=(0,d.C)(eb._u),c=(0,d.C)(eC.eF),u=(0,d.C)(E.Xt),m=(null==a?void 0:a.status)&&T.LKO.includes(a.status),p=(0,tE.T)(m?"offline":"snapshot",null==a?void 0:a.username),h=!u&&(null==a?void 0:a.status)&&!tS.includes(a.status)&&!o;return(0,l.useEffect)(()=>{if(!e){s(void 0);return}let t=!1,a=new Image;return a.addEventListener("load",()=>{t||s(e)}),a.addEventListener("error",()=>{t||s(void 0)}),a.src=e,()=>{t=!0}},[e]),l.createElement("div",{className:(0,B.AK)(tg.root,{[tg.blur]:!u&&!h&&(o||c),[tg.fullscreen]:r,[tg.theatreMode]:n})},l.createElement("div",{className:tg.stub},l.createElement("div",{className:(0,B.AK)(tg.filter,{[tg.backdrop]:h})},l.createElement("div",{className:tg.bg}),i&&l.createElement("img",{className:tg.img,src:i,alt:p}),u&&l.createElement("div",{className:(0,B.AK)(tg.filter,tg.softBackdrop)}))),t)};var tb=a(45106),tT=a(10269),tw=a(29502),ty=a(51932),tf=a(4359),t_=a(65804);let tP=(0,o.$j)(e=>({joinedUsers:(0,E.xO)(e),timeRemaining:(0,E.g9)(e),isTicketShow:(0,E.yY)(e)}))(e=>{let{joinedUsers:t,timeRemaining:a,isTicketShow:i}=e,s=i?"ticketShowAnnouncement":"groupShowAnnouncement";return l.createElement("div",{className:"group-show-announce"},l.createElement("div",{className:"group-show-announce-head"},l.createElement("div",{className:"group-show-announce-title"},l.createElement(t_.Z,{messageId:`viewCam.${s}.${a<=60?"lastMinuteWarning":"groupShowAnnounced"}`,elements:{strong:l.createElement("strong",null)}})),!!t&&l.createElement(t_.Z,{messageId:`viewCam.${s}.joinedUsers`,className:"group-show-announce-subtitle",choiceParameter:"joinedUsers",parameters:{joinedUsers:t}})),l.createElement(tf.Z,null))});var tN=a(47722),tA=a(15921);let tk={root:"GroupShowAnnounce#YA",mobile:"GroupShowAnnounce__mobile#Xy",closeButton:"GroupShowAnnounce__closeButton#yT"},tI={root:"GroupShowAnnounceBody#Yk",mobile:"GroupShowAnnounceBody__mobile#SL"},tM={root:"GroupShowBody#Pk",info:"GroupShowBody__info#pK",rate:"GroupShowBody__rate#Ov"};var tR=a(59922);let tL=()=>{let e=(0,d.C)(E.XZ),{trans:t}=(0,td.QT)();return l.createElement("div",{className:tM.root},l.createElement(tR.T,null),l.createElement("div",{className:tM.info},l.createElement("div",{className:tM.rate},t("viewCam.groupTicketShowAnnouncement.rateMin",{rate:e})),t("viewCam.groupTicketShowAnnouncement.whenStarts")))};var tO=a(57174);let tU={root:"GroupShowIcon#To",overlay:"GroupShowIcon__overlay#o6",icon:"GroupShowIcon__icon#DL",ticketIcon:"GroupShowIcon__ticketIcon#qk",animated:"GroupShowIcon__animated#RE"},tB=({hasOverlay:e,isAnimated:t,showType:a,className:i})=>l.createElement("div",{className:(0,B.AK)(tU.root,{[tU.overlay]:e},i)},l.createElement("div",{className:(0,B.AK)(tU.icon,{[tU.ticketIcon]:"ticket"===a,[tU.animated]:t})})),tZ={root:"TicketShowBody#aS",button:"TicketShowBody__button#a0",announced:"TicketShowBody__announced#a4",text:"TicketShowBody__text#Re",highlight:"TicketShowBody__highlight#Rl",icon:"TicketShowBody__icon#oV"},tV=()=>{let e=(0,d.C)(E.Ke),t=(0,d.C)(E.ug),a=(0,c.T)(),{trans:i}=(0,td.QT)();return l.createElement("div",{className:(0,B.AK)(tZ.root,{[tZ.announced]:!e})},e?l.createElement(l.Fragment,null,l.createElement(tB,{showType:"ticket",className:tZ.icon}),l.createElement("span",{className:tZ.text},i("viewCam.groupTicketShowAnnouncement.gotTicket"))):l.createElement(l.Fragment,null,l.createElement(tO.ZP,{onClick:()=>{a((0,P.oC)(tm.t.JoinAnnouncedTicketShow)),a((0,N.wp)(!1)),a((0,N.d2)(L.FO.GROUP_SHOW_ANNOUNCEMENT_BUTTON,{source:R.Uu.ANNOUNCEMENT_TOAST}))},style:"gold-outline-ds",className:tZ.button},l.createElement(t_.Z,{messageId:"viewCam.groupTicketShowAnnouncement.getTicket",elements:{highlight:l.createElement("span",{className:tZ.highlight})},parameters:{price:t}})),l.createElement("span",{className:tZ.text},i("viewCam.groupTicketShowAnnouncement.anyTip"))))},tF=({isMobile:e})=>{let t=(0,d.C)(E.yY);return l.createElement("div",{className:(0,B.AK)(tI.root,{[tI.mobile]:e})},t?l.createElement(tV,null):l.createElement(tL,null))},tD={root:"GroupShowAnnounceHeader#yv",mobile:"GroupShowAnnounceHeader__mobile#UD",icon:"GroupShowAnnounceHeader__icon#Hp",title:"GroupShowAnnounceHeader__title#X9",topic:"GroupShowAnnounceHeader__topic#dX"},tW=({isMobile:e})=>{let t=(0,d.C)(E.cj),a=(0,d.C)(E.Ke),i=(0,d.C)(E.yY),s=(0,d.C)(E.r_),{trans:r}=(0,td.QT)();return l.createElement("div",{className:(0,B.AK)(tD.root,{[tD.mobile]:e})},!(a||s)&&l.createElement(tB,{hasOverlay:!0,isAnimated:!0,showType:i?"ticket":"group",className:tD.icon}),l.createElement("div",{className:(0,B.AK)(tD.description)},l.createElement("div",{className:tD.title},r("viewCam.groupTicketShowAnnouncement.showTopic")),l.createElement("div",{className:tD.topic},"“",t,"”")))},tH=({isMobile:e})=>l.createElement("div",{className:(0,B.AK)(tk.root,{[tk.mobile]:e})},!e&&l.createElement(tN.mI,{className:tk.closeButton},l.createElement(tA.Z,{img:"close-ds",size:20})),l.createElement("div",{onClick:e=>e.stopPropagation()},l.createElement(tW,{isMobile:e}),l.createElement(tF,{isMobile:e})));var tx=a(53719),t$=a(7185),tG=a(11850),tK=a(99382),tq=a(61171),tY=a(43806),tz=a(67233);let tj={announcement:"GroupShowControlButton__announcement#g0",announcementShort:"GroupShowControlButton__announcementShort#Ea",dropdownContent:"GroupShowControlButton__dropdownContent#gW"},tQ={emitButtonEvent:N.d2,addGroupShowAnnouncementMessage:t$.wG,addGroupShowMessageStartInNMinutes:tx.gf},tJ=(0,k.H)("isLayoutUpToS")((0,o.$j)(e=>({groupShowStartTime:(0,E.NN)(e),isGroupShowSlotReserved:(0,E.r_)(e),isTicketShow:(0,E.yY)(e),isTicketShowPaid:(0,E.Ke)(e),isUpgradeGroupShowAnnouncementActive:(0,E.Iu)(e),isNewAppearanceEnabled:(0,z.iQ)(e)||(0,E.Iu)(e)}),tQ)(({groupShowStartTime:e,isGroupShowSlotReserved:t,isTicketShowPaid:a,isLayoutUpToS:i,isTicketShow:s,className:r,emitButtonEvent:n,addGroupShowAnnouncementMessage:o,addGroupShowMessageStartInNMinutes:c,isNewAppearanceEnabled:d,isUpgradeGroupShowAnnouncementActive:u})=>{let[m,p]=(0,tG.eW)(),h=(0,l.useRef)(null),v=(0,l.useCallback)(e=>{n(L.FO.GROUP_SHOW_DROPDOWN_TOGGLER,{isVisible:m,isLayoutUpToS:i}),n(L.FO.GROUP_SHOW_ANNOUNCEMENT_BUTTON,{source:R.Uu.UNDER_VIEWCAM}),p(e)},[i,m,p,n]),E=s?"ticketShow":"groupShow",g=function({isGroupShowSlotReserved:e,isTicketShowPaid:t,isTicketShow:a,isNewAppearanceEnabled:i}){return e||t?i?"check-ds":"check-1":a?"ticket":"group"}({isGroupShowSlotReserved:t,isTicketShowPaid:a,isTicketShow:s,isNewAppearanceEnabled:d}),S=(0,l.useMemo)(()=>({timer:l.createElement(tY.Z,{className:"private-show-timer",endTime:e,ticks:{301:()=>{c(5,!0)},601:()=>{c(10,!0)},60:()=>{o({isLastMinute:!0})}}}),accent:l.createElement("span",{className:"pale"}),strong:l.createElement("strong",null)}),[c,o,e]);return l.createElement("div",{className:"group-show-control",ref:h},l.createElement(tz.Y,{experimentKey:"ab_upgrade_group_show_announcement"}),l.createElement(tK.ZP,{className:(0,B.AK)(r,"group-show-btn",{"group-show-btn--new":d,"group-show-btn--purchased":d&&(t||a)}),style:"outline",onClick:v},l.createElement(tc.Z,{img:g}),l.createElement(t_.Z,{className:tj.announcement,messageId:`privateModes.${E}.announcementTimerButton`,elements:S}),l.createElement(t_.Z,{className:tj.announcementShort,messageId:`privateModes.${E}.announcementTimerButtonShort`,elements:S})),!i&&l.createElement(tq.Z,{initiatorRef:h,position:"top",spaced:!0,stateValueGetter:()=>m,contentClassName:(0,B.AK)({[tj.dropdownContent]:u,"group-show-btn__dropdownContent":!u})},u?l.createElement(tH,null):l.createElement(tP,null)))}));var tX=a(29409),t0=a(15734),t1=a(99992),t2=a(38924),t6=a(56851),t3=a(3478),t4=a(69531),t8=a(53788),t9=a(40580),t5=a(4358),t7=a(6818),ae=a(47742),at=a(17353),aa=a(93223),ai=a(65103),as=a(90813),ar=a(45465),an=a(80167),al=a(51255);let ao=({onClick:e,size:t="large"})=>{let a=(0,c.T)();return(0,an.a)("KeyT",()=>{e(),a((0,ty.Y0)(!0))}),l.createElement(tO.ZP,{className:"view-cam-controls-btn view-cam-controls__private-tip-button",onClick:e,style:"gold-ds",size:t},l.createElement(al.t,{shortTextId:"button.sendPrivateTipShort",textId:"button.sendPrivateTip"}))};var ac=a(1961),ad=a(65797),au=a(69353),am=a(40108),ap=a(80176),ah=a(61678),av=a(51091);let aE=({model:e})=>{let{trans:t}=(0,td.QT)(),a=(0,d.C)(z.yD),i=(0,d.C)(E.L),s=(0,c.T)(),r=(0,t8.v1)(),{isSubscribed:n,tier:o}=(0,d.C)(E.Y4);return l.createElement(tN.mI,{className:"subscriptions-control-panel__button",onClick:()=>{s((0,av.NB)({experimentKey:"ab_fc_modal_above_stream"})),a&&!i?r.emit("fanClub:clickJoinFanClub",{source:"profileControlPanel"}):s((0,ap.sb)(`/${e.username}/${ah.pt}`))}},n?l.createElement(am.g,{tier:o,size:20}):l.createElement(tc.Z,{className:"subscriptions-control-panel__icon",img:"diamond"}),l.createElement("span",{className:"subscriptions-control-panel__button-label"},t(n&&o?T.HN4[o]:"fanClub.user.joinFanClub")))};var ag=a(12710);let aS=(0,l.createContext)(void 0),aC=(0,l.createContext)(void 0),ab=()=>{let e=(0,l.useContext)(aS);return e?e.favoritedCount:(el.ZP.error("useFavoritedCount must be used inside SubscriptionsControlStateContext context"),0)},aT=()=>{let e=(0,l.useContext)(aS);return e?e.isInFavorites:(el.ZP.error("useIsInFavorites must be used inside SubscriptionsControlStateContext context"),!1)},aw=()=>{let e=(0,l.useContext)(aS);return e?e.panelStatus:(el.ZP.error("usePanelStatus must be used inside SubscriptionsControlStateContext context"),"closed")},ay=()=>{let e=(0,l.useContext)(aC);return e?e.setPanelStatus:(el.ZP.error("useSetPanelStatus must be used inside SubscriptionsControlActionsContext context"),es.Z)},af=()=>{let e=(0,l.useContext)(aC);return e?e.toggleFavorite:(el.ZP.error("useToggleFavorite must be used inside SubscriptionsControlActionsContext context"),es.Z)},a_=()=>{let{trans:e}=(0,td.QT)(),t=ay(),a=af(),i=(0,d.C)(E.D);return l.createElement(tN.mI,{className:"subscriptions-control-panel__button subscriptions-control-panel__favorited-button",onClick:()=>{a(),t("hidden")}},l.createElement(tc.Z,{className:"subscriptions-control-panel__icon subscriptions-control-panel__favorited-icon",img:"heart-fill"}),l.createElement("span",{className:"subscriptions-control-panel__button-label"},e("viewCam.subscriptionsControl.favorited")),l.createElement("span",{className:"subscriptions-control-panel__button-info"},(0,ag.ER)(i)))},aP=()=>l.createElement("div",{className:"button-pointer__outer"},l.createElement("div",{className:"button-pointer__inner"})),aN=({onClick:e,isNotificationsControlVisible:t,isUserSubscribed:a})=>{let{trans:i}=(0,td.QT)();return l.createElement(tN.mI,{className:(0,B.AK)("subscriptions-control-panel__button subscriptions-control-panel__following-button",{"subscriptions-control-panel--subscribed":a}),onClick:e},l.createElement(tc.Z,{img:a?"notifications-2":"notifications-off-2",className:"subscriptions-control-panel__icon"}),l.createElement("span",{className:"subscriptions-control-panel__button-label"},i(a?"viewCam.subscriptionsControl.following":"button.notifyMe")),t&&l.createElement(aP,null))},aA=()=>{let e=aw(),[t,a]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{"openedFirstTime"===e&&a(!0),"closed"===e&&a(!1)},[e]),{isNotificationsControlVisible:t,setIsNotificationsControlVisible:a,currentPanelStatus:e}},ak=()=>{let e=(0,c.T)(),t=(0,d.C)(eb.oC),{shouldShow:a}=(0,d.C)(E.Y4),i=(0,d.C)(e=>!!t&&(0,au.LW)(e,t.id)),{isNotificationsControlVisible:s,setIsNotificationsControlVisible:r,currentPanelStatus:n}=aA();return t&&"hidden"!==n?l.createElement("div",{className:(0,B.AK)("subscriptions-control-panel",{closed:"closed"===n})},["opened","openedFirstTime"].includes(n)&&l.createElement("div",{className:(0,B.AK)("subscriptions-control-panel__icons-panel",{"with-three-button":a})},l.createElement(aN,{onClick:()=>{i||e((0,ac.oj)({model:t,buttonLocation:"PushNotificationPopupOnAddedToFavs"})),(!s||i)&&r(e=>!e)},isNotificationsControlVisible:s,isUserSubscribed:i}),l.createElement("div",{className:"subscriptions-control-panel__icons-divider"}),l.createElement(a_,null),a&&l.createElement(l.Fragment,null,l.createElement("div",{className:"subscriptions-control-panel__icons-divider"}),l.createElement(aE,{model:t}))),s&&l.createElement(ad.Z,{className:"subscriptions-control-panel__notifications-tooltip",key:String(null==t?void 0:t.id),buttonLocation:"PushNotificationPopupOnAddedToFavs",model:t,isMobile:!0,onClose:()=>{r(!1)},isVisible:!0,shouldMethodsListBeExpanded:!0})):null},aI=()=>{let e=(0,d.C)(t2.AI),t=(0,d.C)(eC.D_),[a,i]=(0,l.useState)("closed");return(0,l.useEffect)(()=>{i(e?"hidden":"closed")},[e]),(0,l.useEffect)(()=>{i(e=>"hidden"===e?"hidden":"closed")},[t]),[a,i]},aM=({isInFavoritesFromServer:e,favoritedCountFromServer:t,favoritesClickHandler:a})=>{let[i,s]=(0,l.useState)(t),[r,n]=(0,l.useState)(e);(0,l.useEffect)(()=>{n(e)},[e]),(0,l.useEffect)(()=>{s(t)},[t]);let o=(0,ei.Z)(a,200);return{favoritedCount:i,isInFavorites:r,toggleFavorite:()=>{n(e=>!e),s(e=>r?e-1:e+1),o()}}},aR=({children:e,isInFavoritesFromServer:t,favoritedCountFromServer:a,favoritesClickHandler:i})=>{let[s,r]=aI(),{favoritedCount:n,isInFavorites:o,toggleFavorite:c}=aM({isInFavoritesFromServer:t,favoritedCountFromServer:a,favoritesClickHandler:i}),d=(0,l.useMemo)(()=>({panelStatus:s,favoritedCount:n,isInFavorites:o}),[s,n,o]),u=(0,l.useMemo)(()=>({setPanelStatus:r,toggleFavorite:c}),[r,c]);return l.createElement(aS.Provider,{value:d},l.createElement(aC.Provider,{value:u},e))};var aL=a(56802);let aO=()=>{let e=aw(),t=ay(),a="closed"===e;return l.createElement(tN.mI,{className:(0,B.AK)("subscriptions-control-toggle"),onClick:()=>{t(a?"opened":"closed")}},l.createElement(tc.Z,{img:"chevron-right",className:(0,B.AK)("subscriptions-control-toggle__icon",{closed:a})}))};var aU=a(3034),aB=a(62663),aZ=a(52913),aV=a(76919),aF=a(28656);let aD=(e,t)=>{(0,aF.L)(()=>{let a=null==e?void 0:e.current;if(!t||!a)return;let i=Object.keys(t),s=(0,aZ.Z)(getComputedStyle(a),i);a.style.transition="unset",Object.assign(a.style,t);let r=new Set(i);setTimeout(()=>{a.addEventListener("transitionend",e=>{if(r.delete((0,aV.p)(e.propertyName)),!r.size){let e=i.reduce((e,t)=>(e[t]="",e),{});Object.assign(a.style,e)}}),a.style.transition="",Object.assign(a.style,s)})},[])},aW=({favoritedCount:e,className:t})=>l.createElement("div",{className:(0,B.AK)("favorited-count",t)},(0,ag.uf)(e,1)),aH=({favoritedCount:e,favoritesClickHandler:t,canAddToFavorite:a,innerRef:i,stylesToAnimate:s})=>{let{trans:r}=(0,td.QT)(),n=(0,d.C)(z.gN),o=(0,d.C)(E.u_),{isLayoutUpToS:c,isLayoutUpToDesktop:u}=(0,aB.do)("isLayoutUpToS","isLayoutUpToDesktop"),m=ay(),[p,h]=(0,l.useState)(!1),v=(0,l.useRef)(null);return aD(i,s),l.createElement("div",{className:(0,B.AK)("add-to-favorite-control",{animated:p})},!u&&l.createElement(aU.Z,{placement:"top-start",targetRef:v,gap:22,isForcePlacement:!0,className:"add-to-favorite-control__tooltip",innerClassName:"add-to-favorite-control__tooltip-inner"},r("button.addToFavorites")),l.createElement(tN.mI,{"aria-label":r("button.addToFavorites"),className:(0,B.AK)("add-to-favorite-control__toggle",{"add-to-favorite-control__toggle-new":n}),disabled:!a,onClick:()=>{if(h(!0),c){t(),m("openedFirstTime");return}setTimeout(()=>{t()},150)},ref:v},!n&&l.createElement(tc.Z,{className:(0,B.AK)("add-to-favorite-control__favorite-icon add-to-favorite-control__favorite-icon--mobile"),img:"heart-fill"}),l.createElement(tc.Z,{className:(0,B.AK)("add-to-favorite-control__favorite-icon add-to-favorite-control__favorite-icon--desktop",{"add-to-favorite-control__favorite-icon-new":n}),img:p?"heart-fill":"heart-2"})),l.createElement(aW,{favoritedCount:e,className:(0,B.AK)("add-to-favorite-control__favorited-count",{"add-to-favorite-control__favorited-count--with-announce":o})}))};var ax=a(59374),a$=a(46675);let aG=()=>{let e=(0,l.useRef)(null),t=(0,c.T)(),[a,i]=(0,l.useState)(!1),s=(0,d.C)(eb.oC),r=(0,d.C)(e=>(0,au.LW)(e,null==s?void 0:s.id)),n=(0,d.C)(G.dx),o=(0,l.useRef)(n);o.current=n,(0,l.useEffect)(()=>{a&&t((0,N.Vg)(!0))},[t,a]);let u=(0,eU.Z)(()=>t((0,N.Vg)(!1)));(0,l.useEffect)(()=>()=>{o.current&&u()},[u]);let m=(0,a$.t)(()=>{O.P4.has(ax.W)||u()},!n);return(0,l.useEffect)(()=>{var t;let a;let i=null===(t=e.current)||void 0===t?void 0:t.tooltipRef;return n&&r&&(a=setTimeout(()=>{if(!i)return;let e=i.getBoundingClientRect();i.style.top=`-${e.height}px`,i.style.bottom="initial"},300)),()=>{let e=null==i?void 0:i.getBoundingClientRect();a&&e&&e.height<150&&clearTimeout(a)}},[r,n]),(0,l.useEffect)(()=>{n||requestAnimationFrame(()=>{var t;(null===(t=e.current)||void 0===t?void 0:t.tooltipRef)&&(e.current.tooltipRef.style.top="initial",e.current.tooltipRef.style.bottom="100%")})},[n]),{tooltipRef:e,toggleNotificationTooltip:e=>{m(e),i(!1);let l=a&&n,o=n&&!r;l||o||t((0,N.Vg)(!n)),r||t((0,ac.oj)({model:s,buttonLocation:"PushNotificationPopupOnAddedToFavs"}))},isNotificationTooltipVisible:n,preventClose:m,hideNotificationTooltip:u}},aK=({onClick:e,isAnimated:t,className:a})=>{let[i,s]=(0,l.useState)(!1);return l.createElement(tN.mI,{className:(0,B.AK)("broken-heart-button",{animated:t,hoverable:i,[a||""]:!!a}),onClick:e,onMouseEnter:e=>{e.relatedTarget!==window&&s(!0)}},l.createElement("div",{className:"broken-heart-button__left-icon"}),l.createElement("div",{className:"broken-heart-button__right-icon"}))},aq=({favoritedCount:e,hasJustBeenAddedToFavorite:t,onFavoriteButtonClick:a,stylesToAnimate:i,innerRef:s,toggleNotificationTooltip:r})=>{let n=(0,c.T)(),o=(0,d.C)(eC.D_),u=(0,d.C)(e=>!!o&&(0,au.LW)(e,o)),[m,p]=(0,l.useState)(!1);return aD(s,i),(0,l.useEffect)(()=>{t&&n((0,N.Vg)(!0))},[n,t]),l.createElement("div",{className:(0,B.AK)("subscriptions-control-button-group",{animated:m}),ref:s},l.createElement(aK,{onClick:()=>{p(!0),setTimeout(()=>{a()},200)},isAnimated:m}),l.createElement("span",{className:"subscriptions-control-button-group__counter"},(0,ag.uf)(e,1)),l.createElement("div",{className:"subscriptions-control-button-group__divider"}),l.createElement(tN.mI,{onClick:r,className:(0,B.AK)("subscriptions-control-button-group__notification-button",{active:u})},l.createElement(tc.Z,{img:u?"notifications-2":"notifications-off-2",className:"subscriptions-control-button-group__notification-icon"})))},aY=()=>l.createElement("div",{className:"broken-heart-icons-preloader"}),az=({showAnnounced:e,canAddToFavorite:t})=>{let a=aw(),i=(0,l.useRef)(null),s=(0,l.useRef)(null),r=(0,c.T)(),{toggleNotificationTooltip:n,tooltipRef:o,isNotificationTooltipVisible:u,hideNotificationTooltip:m,preventClose:p}=aG(),[h,v]=(0,l.useState)(!1),E=(0,d.C)(eb.oC);(0,l.useEffect)(()=>{h&&r((0,N.Vg)(!0))},[r,h]);let[g,S]=(0,l.useState)(),C=af(),b=aT(),T=ab();return l.createElement("div",{className:"favorite-control"},l.createElement("div",{className:"favorite-control__mobile"},b&&t&&"hidden"!==a&&l.createElement(aO,null)),l.createElement("div",{className:"favorite-control__desktop"},b&&t&&l.createElement(aq,{innerRef:i,stylesToAnimate:g,onFavoriteButtonClick:()=>{if(i.current){let e=getComputedStyle(i.current);S({backgroundColor:e.backgroundColor,width:e.width})}C()},favoritedCount:T,hasJustBeenAddedToFavorite:h,toggleNotificationTooltip:n}),E&&l.createElement(aL.R,{onClick:p,onClose:m,buttonLocation:"PushNotificationPopupOnAddedToFavs",model:E,isVisible:u,gap:20,absolutePlacement:"top",shouldMethodsListBeExpanded:u&&!h,tooltipRef:o,shouldRenderWithoutPortal:!0})),(!b||!t)&&l.createElement(aH,{stylesToAnimate:g,canAddToFavorite:t,favoritedCount:T,favoritesClickHandler:()=>{if(s.current){let e=getComputedStyle(s.current);S({backgroundColor:e.backgroundColor,width:e.width})}v(!0),C()},showAnnounced:e,innerRef:s}),l.createElement(aY,null))};var aj=a(29697),aQ=a(45216),aJ=a(23766),aX=a(60765);let a0={ADD:"Add",PROCESSING:"Processing",DECLINED:"Declined",SUCCESS:"Success",BUY:"Buy"},a1=({isOwnShow:e,model:t={},groupShowMode:a})=>{var i,s,r;if(!t)return 0;let n=t.status;return n===T.hBS.MODE_PRIVATE||n===T.hBS.MODE_VIRTUAL_PRIVATE?null!==(i=e?t.privateRate:t.spyRate)&&void 0!==i?i:0:n===T.hBS.MODE_P2P||n===T.hBS.MODE_P2P_AUDIO?null!==(s=t.p2pRate)&&void 0!==s?s:0:n===T.hBS.MODE_GROUP_SHOW&&"perMinute"===a&&null!==(r=t.groupRate)&&void 0!==r?r:0},a2=(e,t)=>{if(!t)return null;let[a,i="00"]=(e/t).toString().split("."),s=parseInt(a,10),r=Math.floor(60*parseFloat(`0.${i}`)).toString();return`0${s}:${1===r.length?"0":""}${r}`},a6=({phase:e})=>e===a0.BUY||e===a0.ADD;class a3 extends l.Component{componentWillUnmount(){this.hide()}componentDidUpdate(e){(0,V.Z)(this.propsUpdateToActionsMap,e,this.props)}componentDidMount(){(0,V.Z)(this.propsUpdateToActionsMap,{},this.props)}updatePanelState({timeLeft:e,isVisible:t,isAvailable:a}){if(a&&!t){this.show(e);return}!a&&t&&a6(this.state)&&this.hide()}renderOneClickAdd(e){let{timeLeft:t}=this.state,{isMobile:a,isLightTheme:i,i18n:{trans:s}}=this.props,r=a?"mobile":"desktop",n=(0,ag.W3)(e.currencySum,e.currencyCode);return l.createElement(l.Fragment,null,l.createElement("div",{className:"one-click-recharge-layer-left"},l.createElement(tc.Z,{className:"one-click-recharge-icon",img:i?"tokens-lightning-black":"tokens-lightning"}),l.createElement("div",null,l.createElement("div",{className:"one-click-recharge-title"},l.createElement(t_.Z,{elements:{highlighted:l.createElement("span",{className:"highlighted-brand"}),hiddenForXs:l.createElement("span",{className:"media-up-to-xs-hidden"}),visibleForXs:l.createElement("span",{className:"media-after-xs-hidden"})},parameters:{time:null!=t?t:""},messageId:`oneClickRecharge.addTokens.${r}.title`})),l.createElement("div",{className:"one-click-recharge-description"},s(`oneClickRecharge.addTokens.${r}.description`)))),l.createElement("div",{className:"one-click-recharge-layer-right"},l.createElement("div",null,l.createElement(tK.ZP,{style:"apply-alter2",onClick:this.addTokensClickHandler},l.createElement(t_.Z,{elements:{pale:l.createElement("span",{className:"highlighted-pale"})},parameters:{tk_amount:e.tokensSum,currency_amount:n},messageId:`oneClickRecharge.addTokens.${r}.button`})),!a&&l.createElement("div",{className:"one-click-recharge-alternative-action",onClick:this.buyTokensClickHandler},s("oneClickRecharge.addTokens.common.buyAnotherAmount"))),l.createElement(tK.ZP,{className:"one-click-recharge-close-btn",onClick:this.smoothHidingWithPhaseCheck},l.createElement(tc.Z,{img:"close-3"}))))}renderOneClickProcessing(){let{trans:e}=this.props.i18n;return l.createElement(l.Fragment,null,l.createElement("div",{className:"one-click-recharge-layer-left"},l.createElement(e_.Z,{className:"one-click-recharge-loader",loaderType:"sector-circle",size:30,isInline:!0}),l.createElement("div",{className:"one-click-recharge-title"},e("oneClickRecharge.processing.title"))),l.createElement("div",{className:"one-click-recharge-layer-right"},l.createElement(tK.ZP,{className:"one-click-recharge-close-btn",onClick:this.smoothHidingWithPhaseCheck},l.createElement(tc.Z,{img:"close-3"}))))}renderOneClickDeclined(){let{isMobile:e,i18n:{trans:t}}=this.props;return l.createElement(l.Fragment,null,l.createElement("div",{className:"one-click-recharge-layer-left"},l.createElement(tc.Z,{className:"one-click-recharge-icon",img:"tokens-error"}),l.createElement("div",{className:"one-click-recharge-title"},t("oneClickRecharge.declined.common.title"))),l.createElement("div",{className:"one-click-recharge-layer-right"},l.createElement(tK.ZP,{onClick:this.buyTokensClickHandler},t(`oneClickRecharge.declined.${e?"mobile":"desktop"}.button`)),l.createElement(tK.ZP,{className:"one-click-recharge-close-btn",onClick:this.smoothHidingWithPhaseCheck},l.createElement(tc.Z,{img:"close-3"}))))}renderOneClickSuccess(){let{lastRefillTokensSum:e}=this.props;return l.createElement(l.Fragment,null,l.createElement("div",{className:"one-click-recharge-layer-left"},l.createElement(tc.Z,{className:"one-click-recharge-icon",img:"tokens-check"}),l.createElement("div",{className:"one-click-recharge-title"},l.createElement(t_.Z,{elements:{highlighted:l.createElement("span",{className:"highlighted-green"}),br:l.createElement("br",null)},parameters:{tokens:e},messageId:"oneClickRecharge.success.title"}))),l.createElement("div",{className:"one-click-recharge-layer-right"},l.createElement(tK.ZP,{className:"one-click-recharge-close-btn",onClick:this.smoothHidingWithPhaseCheck},l.createElement(tc.Z,{img:"close-3"}))))}renderOneClickBuy(){let{timeLeft:e}=this.state,{isMobile:t,isLightTheme:a,i18n:{trans:i}}=this.props,s=t?"mobile":"desktop";return l.createElement(l.Fragment,null,l.createElement("div",{className:"one-click-recharge-layer-left"},l.createElement(tc.Z,{className:"one-click-recharge-icon",img:a?"tokens-plus-red":"tokens-plus-orange"}),l.createElement("div",null,l.createElement("div",{className:"one-click-recharge-title"},l.createElement(t_.Z,{elements:{highlighted:l.createElement("span",{className:"highlighted-brand"})},parameters:{time:null!=e?e:""},messageId:`oneClickRecharge.buyTokens.${s}.title`})),l.createElement("div",{className:"one-click-recharge-description"},i(`oneClickRecharge.buyTokens.${s}.description`)))),l.createElement("div",{className:"one-click-recharge-layer-right"},l.createElement(tK.ZP,{style:"apply-alter2",onClick:this.buyTokensClickHandler},i(`oneClickRecharge.buyTokens.${s}.button`)),l.createElement(tK.ZP,{className:"one-click-recharge-close-btn",onClick:this.smoothHidingWithPhaseCheck},l.createElement(tc.Z,{img:"close-3"}))))}renderClickPhase(){switch(this.state.phase){case a0.BUY:return this.renderOneClickBuy();case a0.ADD:{let{refillPackage:e}=this.props;if(e)return this.renderOneClickAdd(e);return this.renderOneClickBuy()}case a0.DECLINED:return this.renderOneClickDeclined();case a0.SUCCESS:return this.renderOneClickSuccess();case a0.PROCESSING:return this.renderOneClickProcessing();default:return null}}render(){let{isDisappearing:e,isHiddenByUser:t,phase:a}=this.state,{isAvailable:i,isVisible:s}=this.props,r=a6(this.state);return!i&&r||!s&&r||t||!a?null:l.createElement(aj.Z,{classNames:"one-click-recharge-wrapper",in:!e,enter:!1,timeout:1e3,onExited:()=>{this.setState({isDisappearing:!1})}},l.createElement("div",{className:(0,B.AK)("one-click-recharge-wrapper",{"one-click-recharge-wrapper-processing":a===a0.PROCESSING})},this.renderClickPhase()))}constructor(e){super(e),(0,n._)(this,"timeoutId",void 0),(0,n._)(this,"propsUpdateToActionsMap",[{update:["isRefillAvailable"],action:()=>{let{isRefillAvailable:e}=this.props;this.setState(t=>{let{phase:a}=t;return!a||a6(t)?{...t,phase:a0[e?"ADD":"BUY"]}:t})}},{update:["hasPurchaseFailed","purchaseSucceededToken"],action:()=>{let{hasPurchaseFailed:e}=this.props;this.state.phase===a0.PROCESSING&&(this.setState({phase:a0[e?"DECLINED":"SUCCESS"]}),this.props.resetPurchase(),setTimeout(this.smoothHidingWithoutPhaseCheck,1e4))}},{update:["isVisible","isAvailable"],action:()=>this.updatePanelState(this.props)}]),(0,n._)(this,"updateCountDown",()=>{this.setState(e=>{var t;let a=(null!==(t=e.timeLeft)&&void 0!==t?t:"")>"00:00"?this.props.i18n.getTimeSubtractSeconds(e.timeLeft,1):e.timeLeft;return{...e,timeLeft:a}},()=>{clearTimeout(this.timeoutId),this.timeoutId=setTimeout(this.updateCountDown,1e3)})}),(0,n._)(this,"smoothHidingBase",e=>{this.setState({isDisappearing:!0});let t=a6(this.state)&&e;setTimeout(()=>{t&&this.setState({isHiddenByUser:!0}),this.hide()},1e3)}),(0,n._)(this,"smoothHidingWithoutPhaseCheck",()=>{this.smoothHidingBase(!1)}),(0,n._)(this,"smoothHidingWithPhaseCheck",()=>{this.smoothHidingBase(!0)}),(0,n._)(this,"show",e=>{this.props.emitUiEvent(L.Q7.ONE_CLICK_RECHARGE_PANEL_TOGGLED,{value:!0}),this.setState({timeLeft:e},()=>{this.updateCountDown()})}),(0,n._)(this,"hide",()=>{let{isRefillAvailable:e}=this.props;this.props.emitUiEvent(L.Q7.ONE_CLICK_RECHARGE_PANEL_TOGGLED,{value:!1}),this.setState({phase:a0[e?"ADD":"BUY"]})}),(0,n._)(this,"buyTokensClickHandler",()=>{this.props.showPurchaseModal({triggerSource:tm.t.RefillBuyOtherAmount})}),(0,n._)(this,"addTokensClickHandler",()=>{let{model:e}=this.props;this.props.emitButtonEvent(L.FO.PRIVATE_RECHARGE_ONE_CLICK,{modelId:e.id,refillPackage:this.props.refillPackage,source:tm.t.TipFromPrivate,tipAmount:void 0,makeRefill:!0,purchaseFrom:R.Lk.REFILL_PRIVATE_SHOW_PROLONG}),this.setState({phase:a0.PROCESSING})}),this.state={isDisappearing:!1,isHiddenByUser:!1,phase:null,timeLeft:null}}}let a4=(0,td.GV)(a3),a8={emitButtonEvent:N.d2,emitUiEvent:N.gz,resetPurchase:aX.hd,showPurchaseModal:_.U1},a9=(0,k.H)("isLayoutUpToM")((0,o.$j)((e,t)=>{var a;let{auth:{currentUser:i,isLoggedIn:s,isLoggingOut:r},viewCam:{isOwnShow:n,isOneClickRechargePanelVisible:l,isRefillAvailable:o,show:c},tokens:{hasPurchaseFailed:d}}=e,{model:u,isLayoutUpToM:m}=t,p=null==u?void 0:u.status,h=null==c?void 0:c.mode,v=(0,ai.xV)(e),g=(0,E.R3)(e),S=null!==(a=null==v?void 0:v.tokens)&&void 0!==a?a:0,C=(0,aQ.Zf)(e),b=(0,aJ.UD)(e),T=s&&!r&&!(null==i?void 0:i.isStudio)&&!(null==i?void 0:i.isModel)&&!(null==i?void 0:i.isAdmin)&&!(null==i?void 0:i.isSupport),w=a1({model:u,isOwnShow:n,groupShowMode:(0,E.U8)(e)}),y=3*w<=S,f="endSpy"===g&&(0,E.V$)(e);return{refillPackage:C,currentUser:i,hasPurchaseFailed:d,isAvailable:T&&h===p&&!y&&!f&&["sendPrivateTip","endSpy","quitGroupShowOrTip"].includes(g),isMobile:m,purchaseSucceededToken:(0,aJ.BN)(e),isRefillAvailable:o,lastRefillTokensSum:b,isVisible:l&&!f,isLightTheme:(0,q.LK)(e),timeLeft:a2(S,w)}},a8)(a4)),a5=e=>({...e,isRegular:!1,isExGreen:!1,isUltimate:!1,isGreen:!1});class a7 extends(r=l.Component){renderControls(){let{model:e,baseModel:t,discounts:a,controlsState:i,viewCamFanClubTier:s,canOpenPrivateMessages:r,isLayoutMoreThanL:n,isSendTipFromSpyModeEnabled:o,fanClubPrivateDiscounts:c,isChevronPrivateShowButtonEnabled:d}=this.props;switch(i){case"waitingForModelAnswer":return l.createElement("div",{className:"proposal-controls-block"},l.createElement("span",{className:"proposal"},l.createElement(e_.Z,{size:24}),this.props.i18n.trans("viewCam.waitingForModelAnswer")),l.createElement("div",{className:"proposal-cancel",onClick:this.cancelProposalClickHandler},l.createElement(tc.Z,{img:"close-5"})));case"startPrivateOrSendTip":{if(!e)return l.createElement("span",{className:"view-cam-controls__btn-wrapper"},this.renderSendTipButton());let t=e.doPrivate||e.doP2p,{actual:i,discounted:r,type:n}=(0,f.oB)(e,a,c);return l.createElement(l.Fragment,null,t&&l.createElement("span",{className:"view-cam-controls__btn-wrapper"},l.createElement(tK.ZP,{size:"large",style:"gold-outline-ds",onClick:this.startPrivateClickHandler,className:(0,B.AK)("view-cam-controls-btn view-cam-controls__private-btn",{"view-cam-controls__private-btn--with-discount":!!n,"view-cam-controls__private-btn--with-icon":d})},l.createElement(al.t,{textId:"button.privateShow",shortTextId:"button.startPrivateShort"}),this.renderPrivatePrice(i,r),d&&l.createElement(tA.Z,{className:"view-cam-controls__private-btn--chevron",img:"chevron-down-ds",size:24})),n&&l.createElement(t4.V,{tier:s,type:n})),l.createElement("span",{className:"view-cam-controls__btn-wrapper"},this.renderSendTipButton()))}case"joinGroupShowOrSendTip":return l.createElement(l.Fragment,null,l.createElement(tJ,{className:"view-cam-controls-btn"}),this.renderSendTipButton());case"quitGroupShowOrTip":return l.createElement(l.Fragment,null,l.createElement(tK.ZP,{size:"large",style:"default-outline",className:"view-cam-controls-btn",onClick:this.handleQuitShowButtonClick},this.props.i18n.trans("button.quit")),this.renderSendTipButton());case"sendPrivateTip":return this.renderSendPrivateTipButton();case"endSpy":return l.createElement(l.Fragment,null,l.createElement(tO.ZP,{size:"large",style:"end-broadcasting",onClick:this.stopSpyClickHandler,className:"view-cam-controls-btn view-cam-controls__stop-spy"},l.createElement(al.t,{shortTextId:"button.endSpyShort",textId:"button.endSpy"})),o&&l.createElement(ao,{onClick:()=>{this.props.startTokenTransaction("SendTipButton"),r&&n?(this.props.modelChatSelectTab(T.MODEL_CHAT_TABS.PRIVATE),this.props.setIsPrivateActionListVisible(!0)):this.props.emitButtonEvent(L.FO.VIEWCAM_SEND_PRIVATE_TIP,{source:T.buX.TIP_MENU,shouldScrollToChat:!0,isInBackground:!0,modelId:t.id,additionalParam:{amplitudeEventProps:{prodSubtype:T.buX.TIP_MENU,prodType:T.Hrc.TIP}}})}}));case"sendOfflineTip":{let a=(a,i)=>l.createElement(aa.Z,{className:`${a} view-cam-controls-btn view-cam-controls__pm-btn`,triggerSource:L.FO.VIEWCAM_PRIVATE_MESSAGE,shouldRenderIcon:!i,customContent:i,shouldOpen:"privateTab",user:a5(e||t)});return l.createElement(l.Fragment,null,a("btn-default-outline media-up-to-xs-hidden"),a("media-after-s-hidden send-pm-mobile",l.createElement(tc.Z,{img:"envelope-bubble"})),l.createElement(ao,{onClick:this.sendOfflineTipClickHandler}))}case"sendOfflinePrivateTip":return l.createElement(ao,{onClick:this.sendOfflineTipClickHandler});default:return l.createElement("span",null,"\xa0")}}renderGroupShowMobileDropdown(){let{isLayoutUpToS:e,controlsState:t,isXhlOrMirror:a,isUpgradeGroupShowAnnouncementActive:i}=this.props;return e&&"joinGroupShowOrSendTip"===t?l.createElement(tq.Z,{className:(0,B.AK)("group-show-dropdown-mobile",{"group-show-dropdown-xhl":a}),stateValueGetter:G.X7,position:"bottom",initiatorRef:{current:null},contentClassName:(0,B.AK)({"group-show-dropdown-mobile--new":i})},i?l.createElement(tH,{isMobile:!0}):l.createElement(tP,null)):null}renderFavoriteToggle({showAnnounced:e,isSpying:t}){let{isCurrentUserModelOrStudio:a,isInCam2Cam:i,isInPrivateMode:s,isLoggedIn:r,model:n}=this.props;return!n||i||s&&!t?null:l.createElement(az,{showAnnounced:e,canAddToFavorite:!r||!a})}renderUpgradePrivate(){let{isInCam2Cam:e,isInPrivateMode:t,isInSpyMode:a,isCam2camEnabled:i}=this.props;return e||a||!t||!i?null:l.createElement(t6.Y,{className:"control view-cam-controls-btn view-cam-controls__upgrade-private"})}renderStopPrivate(){let{isInCam2Cam:e,isInPrivateMode:t,isInSpyMode:a}=this.props;return a?null:e||t?l.createElement(tK.ZP,{className:"control view-cam-controls-btn view-cam-controls__end-cam2cam",onClick:e?this.stopCam2CamClickHandler:this.stopPrivateClickHandler,style:"end-broadcasting"},l.createElement("div",{className:"player-toolbox-icon-item view-cam-controls-btn__stop-spy"},l.createElement(tc.Z,{img:"stop",size:14})),l.createElement(al.t,{className:"view-cam-controls-btn__stop-spy-text",shortTextId:"button.endShort",textId:"button.endPrivate"})):null}renderToolboxControl(){let{isInCam2Cam:e}=this.props;return e?l.createElement(ar.Z,null):null}render(){let{controlsState:e,isCamAvailable:t,isCurrentUserModelOrStudio:a,isInSpyMode:i,isMyStudioModel:s,model:r,baseModel:n,isInPrivateMode:o,isInCam2Cam:c,isInFavorites:d,favoritedCount:u,isPrivateToSpyModeTransitionEnabled:m}=this.props,p=s&&(!t||i)&&n.status===T.MODEL_STATUSES.STATUS_PRIVATE,h=!a||p,v="joinGroupShowOrSendTip"===e,E="endSpy"===e;return l.createElement(aR,{isInFavoritesFromServer:d,favoritedCountFromServer:u,favoritesClickHandler:this.favoritesClickHandler},l.createElement("div",{className:(0,B.AK)("view-cam-controls","with-new-send-tip")},l.createElement("div",{className:(0,B.AK)("view-cam-controls-wrapper",{"view-cam-controls-wrapper--private":o,"view-cam-controls-wrapper--cam2cam":c,"view-cam-controls-wrapper--show":v,"view-cam-controls-wrapper--controls-start-spy":"startSpy"===e})},this.renderFavoriteToggle({showAnnounced:v,isSpying:E}),h&&l.createElement(l.Fragment,null,l.createElement("div",{className:"view-cam-controls-wrapper__left"},this.renderStopPrivate()),l.createElement("div",{className:"view-cam-controls-wrapper__center"},this.renderUpgradePrivate(),this.renderToolboxControl()),l.createElement("div",{className:"view-cam-controls-wrapper__right"},l.createElement("div",{className:(0,B.AK)("view-cam-buttons-wrapper",{"view-cam-buttons-wrapper--private-or-cam2cam":o||c||E&&m,"view-cam-buttons-wrapper--offline":"sendOfflineTip"===e})},this.renderControls()),r&&l.createElement(a9,{model:r})))),h&&this.renderGroupShowMobileDropdown()),h&&l.createElement(ak,null))}constructor(e){super(e),(0,n._)(this,"showConfirmationModalCounter",void 0),(0,n._)(this,"favoritesClickHandler",e=>{null==e||e.preventDefault(),null==e||e.stopPropagation();let{baseModel:t,isInFavorites:a}=this.props;a||this.props.enableUserFeedIfModelHasPosts(t.id),this.props.toggleFavorite(t)}),(0,n._)(this,"startPrivateClickHandler",()=>{let{baseModel:e,startTokenTransaction:t}=this.props;t("PrivateShowButton"),this.props.eventBus.emit("button:Click private modal",{modelUsername:e.username}),this.props.emitButtonEvent(L.FO.VIEWCAM_START_PRIVATE,{modelId:e.id})}),(0,n._)(this,"stopPrivateClickHandler",()=>{let{baseModel:e}=this.props;D.Z.send(t0.L.STOP_PRIVATE),this.props.emitButtonEvent(L.FO.VIEWCAM_STOP_PRIVATE,{modelId:e.id})}),(0,n._)(this,"stopCam2CamClickHandler",()=>{let{baseModel:e}=this.props;D.Z.send(t0.L.STOP_CAM_2_CAM),this.props.emitButtonEvent(L.FO.VIEWCAM_STOP_P2P,{modelId:e.id})}),(0,n._)(this,"stopSpyClickHandler",()=>{let{baseModel:e}=this.props;D.Z.send(t0.L.STOP_SPY),this.props.emitButtonEvent(L.FO.VIEWCAM_STOP_SPY,{modelId:e.id})}),(0,n._)(this,"cancelProposalClickHandler",()=>{this.props.cancelProposal("buttonClickHandler")}),(0,n._)(this,"handleSendTipNewClick",()=>{let{model:e,baseModel:t,isInPrivateMode:a,isInCam2Cam:i,isActionMenuVisible:s,eventBus:r}=this.props;if(this.props.startTokenTransaction("SendTipButton"),!s){let e=a||i?L.FO.VIEWCAM_SEND_PRIVATE_TIP:L.FO.VIEWCAM_SEND_ONLINE_TIP;this.props.emitButtonEvent(e,{modelId:null==t?void 0:t.id,shouldAvoidTipModal:!0})}this.props.emitButtonEvent(L.FO.TIP_MENU_OPEN),this.props.toggleActionMenu(void 0,void 0,{user:e||t}),r.emit("button:Click Send Tip",{source:"SendTipButton"})}),(0,n._)(this,"handleSendPrivateTipClick",()=>{let{model:e,baseModel:t}=this.props;this.props.startTokenTransaction("SendTipButton"),this.props.toggleActionMenu(T.pow.PRIVATE_MENU,void 0,{user:e||t,isPrivateTip:!0})}),(0,n._)(this,"sendOfflineTipClickHandler",()=>{let{baseModel:e,startTokenTransaction:t}=this.props;t("SendTipButton"),this.props.emitButtonEvent(L.FO.VIEWCAM_SEND_OFFLINE_TIP,{modelId:e.id,shouldScrollToChat:!0,source:T.buX.TIP_MENU,additionalParam:{buyTokensSource:tm.t.ViewCamOffline,isPrivateTip:!0}})}),(0,n._)(this,"renderSendTipButton",()=>l.createElement(t1.L,{isActive:this.props.isActionMenuVisible,isActionMenuAvailable:this.props.hasActionMenuItems,className:"send-tip-btn",onClick:this.handleSendTipNewClick})),(0,n._)(this,"renderSendPrivateTipButton",()=>l.createElement(t1.L,{isActive:this.props.isActionMenuVisible,isActionMenuAvailable:this.props.hasActionMenuItems,className:"send-tip-btn",isPrivate:!0,onClick:this.handleSendPrivateTipClick})),(0,n._)(this,"renderPrivatePrice",(e,t)=>l.createElement("span",{className:"view-cam-controls__private-btn-price"},e&&l.createElement(t3.Z,{className:"view-cam-controls__private-btn-actual-price"},e),"\xa0",l.createElement("span",{className:"btn-gold-outline-ds__accent-text"},this.props.i18n.trans("tokensShort",{amount:t})))),(0,n._)(this,"handleQuitShowButtonClick",()=>{if(this.props.isPerMinuteShow)this.props.quitGroupShow({type:"groupShow"});else{var e,t;null!==(t=(e=this.showConfirmationModalCounter).current)&&void 0!==t||(e.current=0),this.showConfirmationModalCounter.current++,O.P4.show(tX.r,{exitTicketShowConfirmationModalShownCount:this.showConfirmationModalCounter.current,onLeave:this.props.quitGroupShow})}}),this.showConfirmationModalCounter=(0,l.createRef)()}}(0,n._)(a7,"defaultProps",{model:null});let ie=(0,td.GV)(a7),it={cancelProposal:eQ.sA,emitButtonEvent:N.d2,quitGroupShow:eQ.Mx,toggleFavorite:t9.ZN,enableUserFeedIfModelHasPosts:t5.at,toggleActionMenu:tT.Wp,modelChatSelectTab:ty.aK,setIsPrivateActionListVisible:tw.Jg,setSendTipData:v.pD,showModal:_.K4,startTokenTransaction:at.B.actions.start},ia=(0,tb.qC)((0,o.$j)((e,t)=>{let{baseModel:a}=t,i=(0,ai.pC)(e),s=!!a&&(0,as.pF)(e,a.id);return{controlsState:(0,E.R3)(e),currentUser:(0,j.ts)(e),favoritedCount:(0,E.D)(e),isCurrentUserModelOrStudio:(0,th.ly)(e),isInFavorites:!!a&&(0,t7.D9)(e,a.id),isInSpyMode:(0,E.Hn)(e),isInPrivateMode:(0,E.wp)(e),isInCam2Cam:(0,E.UP)(e),isPerMinuteShow:!(0,E.Tn)(e),isXhlOrMirror:(0,q.cv)(e),isLoggedIn:(0,j.Cg)(e),isMyStudioModel:(0,Y.EP)(e),isActionMenuVisible:(0,t2.AI)(e),hasActionMenuItems:(0,y.KN)(e),isCam2camEnabled:(0,E.RR)(e),canOpenPrivateMessages:i||s,isSendTipFromSpyModeEnabled:(0,u.MLn)(e),discounts:(0,ae.Pn)(e),isCurrentUserUltimate:(0,th.Kr)(e),landingParams:(0,ex.TK)(e),isPrivateToSpyModeTransitionEnabled:(0,u.zP$)(e),fanClubPrivateDiscounts:(0,E.ti)(e),viewCamFanClubTier:(0,E.oh)(e),isUpgradeGroupShowAnnouncementActive:(0,E.Iu)(e),isChevronPrivateShowButtonEnabled:(0,z.Mj)(e)}},it),t8.p1,(0,k.H)("isLayoutUpToS","isLayoutMoreThanL"))(ie),ii=()=>l.createElement("div",{className:"view-cam-controls with-new-send-tip"},l.createElement("div",{className:"view-cam-controls-wrapper"}));var is=a(29754),ir=a(76485),il=a(7474),io=a(19171);let ic=({kingInfo:e,becomeKingThreshold:t})=>{let a=(0,c.T)(),i=(0,d.C)(E.OV),s=(0,d.C)(ai.Ms),{start:r}=(0,ir.V)();return s&&s===e.kingUsername||(null==i?void 0:i.status)!==T.MODEL_STATUSES.STATUS_PUBLIC?null:l.createElement(tK.ZP,{style:"call2action-premium",size:"small",onClick:()=>{r("BecomeKingTooltipButton");let s=e.kingAmount||t;if(s){let t=s-(e.selfAmount||0)+1;a((0,N.FZ)(t))}a((0,N.d2)(L.FO.VIEWCAM_SEND_ONLINE_TIP,{modelId:null==i?void 0:i.id,additionalParam:{source:T.buX.TIP_MENU,amplitudeEventProps:{prodType:T.Hrc.TIP,prodSubtype:T.hZ6.KING}}}))}},l.createElement(t_.Z,{messageId:"viewCam.info.tooltip.becomeKing",elements:{icon:l.createElement(tc.Z,{className:"king-icon",img:"king"})}}))},id=e=>{let{trans:t}=(0,td.QT)(),{fanClubTier:a,kingInfo:i,kingUser:s,kingSettings:r}=e,n=Number(null==r?void 0:r.becomeKingThreshold)||0;return l.createElement("div",{className:"view-cam-info-king"},l.createElement("div",{className:"view-cam-info-king-content",id:"view_cam_info_king"},t("viewCam.info.king"),s?l.createElement("div",{className:"king-wrapper is-king"},l.createElement(tc.Z,{img:"king"}),l.createElement(il.Z,{user:s,isIconVisible:!1,fanClubTier:a,isVisibleTierTooltip:!1,isLevelLeagueStatusVisible:!1,isUltimateIconTooltipVisible:!1})):n>0?l.createElement(t_.Z,{className:"become-king-info",messageId:"viewCam.info.kingThreshold",parameters:{amount:n},elements:{accent:l.createElement("span",{className:"king-threshold"})}}):l.createElement("div",{className:"king-wrapper"},l.createElement(tc.Z,{img:"king"}),l.createElement("span",{className:"be-first"},t("viewCam.info.toBeKing"))),i?l.createElement(aU.Z,{targetId:"view_cam_info_king",placement:"left",isMobileRelative:!1,maxWidth:350,showDelay:250},s&&l.createElement(t_.Z,{className:"king-wrapper-tooltip-title",messageId:"viewCam.info.tooltip.title",elements:{username:l.createElement(il.Z,{user:s,isIconVisible:!1,isLevelLeagueStatusVisible:!1,placeId:"kink-tooltip"}),tokens:l.createElement("span",{className:"king-wrapper-tooltip-tokens"},i.kingAmount)}}),s||n?l.createElement(t_.Z,{className:"king-wrapper-tooltip-description",messageId:"viewCam.info.tooltip.description",elements:{tokens:l.createElement("span",{className:"king-wrapper-tooltip-tokens"},i.selfAmount)}}):l.createElement("span",{className:"king-wrapper-tooltip-description"},t("viewCam.info.tooltip.hint")),l.createElement(ic,{kingInfo:i,becomeKingThreshold:n}),l.createElement(io.Z,null)):null))};var iu=a(6848);let im=e=>{let t=(0,eC.MV)(e),a=(0,eb.qF)(e);if(!t||!a)return null;let i=(0,iu.dN)(e,t);return(null==i?void 0:i[a.id])||null},ip=(0,o.$j)(e=>({isTheatreModeActive:(0,K.z)(e),goalData:(0,E.IY)(e),isPromoModel:(0,E.P1)(e),kingUser:(0,eb.qF)(e),kingInfo:(0,eb.Kd)(e),kingFanClubTier:im(e),kingSettings:(0,E.LF)(e)}))(({goalData:e,isPromoModel:t,kingFanClubTier:a,kingUser:i,kingInfo:s,kingSettings:r,isVisible:n,isTheatreModeActive:o})=>o?null:l.createElement("div",{className:(0,B.AK)("view-cam-info view-cam-info--with-new-goal",{"view-cam-info--visible":n})},l.createElement(is.Z,{goal:e}),!t&&l.createElement(id,{kingSettings:r,kingInfo:s,kingUser:i,fanClubTier:a}))),ih=({modelStatus:e,children:t,isBackgroundVideo:a,isBlurVideoOnPrivate:i})=>{let s=[T.MODEL_STATUSES.STATUS_IDLE,T.MODEL_STATUSES.STATUS_OFF,T.MODEL_STATUSES.STATUS_PRIVATE,T.MODEL_STATUSES.STATUS_VIRTUAL_PRIVATE,T.MODEL_STATUSES.STATUS_P2P,T.MODEL_STATUSES.STATUS_P2P_VOICE,T.MODEL_STATUSES.STATUS_GROUP_SHOW],r=e&&s.includes(e);return l.createElement("div",{className:(0,B.AK)("poster",eS.j.player,{"big-height":r,"above-background-video":a||i})},t)};var iv=a(7581),iE=a(59010),ig=a(65656),iS=a(78983),iC=a(8031),ib=a(87766),iT=a(41552),iw=a(23033),iy=a(98131),i_=a(68020),iP=a(97686),iN=a(11116),iA=a(5144);let ik=2.5*iC.ks*iC.Zv,iI="viewCamUnobtrusiveProposal",iM="watchingLimit",iR="camMembers",iL="publicRecordingRenewInterval",iO="enjoyWatchHistory",iU=(e,t)=>e.viewCamNotification===iN.h3.SUBSCRIBE&&!t.viewCamNotification,iB=(e,t)=>e.currentModalName===L.Ny.AUTH&&!t.currentModalName,iZ={addToWatchHistory:iw.xr,closeNotification:eQ.vU,createFreeAccountModal:eQ.cS,hideModal:_.VG,loadMembers:ig.el,showModal:_.K4,resetModelWatchingLimit:eQ.JY,updateModelWatchingLimit:eQ.Hn,showNotification:eQ.c0,discountsReset:iP.B7,renewPublicRecording:eQ.oN,setGuestImitationMessageStep:N.G4};class iV extends l.Component{componentDidMount(){this._isMounted=!0,(0,V.Z)(this.propsUpdateToActionsMap,{},this.props)}componentDidUpdate(e){(0,V.Z)(this.propsUpdateToActionsMap,e,this.props)}componentWillUnmount(){this._isMounted=!1,this.stopAllSchedulers()}isViewCamNotificationAllowed(){return L.BROWSER_CAPABILITIES.desktop||L.BROWSER_CAPABILITIES.isTablet}getMinuteOfDay(){let e=(0,iS.YF)(new Date,iS.Ju.day);return 0|(0,iS.og)(new Date,e,iS.$v.minutes)}render(){return null}constructor(e){super(e),(0,n._)(this,"discountsTimeoutId",void 0),(0,n._)(this,"_isMounted",!1),(0,n._)(this,"isSubscriptionPopupClosedByModelChange",!1),(0,n._)(this,"hasShownCreateFreeAccountModal",!1),(0,n._)(this,"hasShownSubscriptionPopup",!1),(0,n._)(this,"propsUpdateToActionsMap",[{update:E.jh,action:()=>{this.hasShownCreateFreeAccountModal=!1,this.hasShownSubscriptionPopup=!1,this.isSubscriptionPopupClosedByModelChange=!0,this.closeSubscriptionPopup(),this.startScheduler(this.props)}},{update:(...e)=>iU(...e),action:()=>{this.isSubscriptionPopupClosedByModelChange?this.isSubscriptionPopupClosedByModelChange=!1:this.hasShownSubscriptionPopup=!0,this.startScheduler(this.props)}},{update:(e,t)=>!e.isCamAvailableOrPublic&&t.isCamAvailableOrPublic,action:()=>{this.hasShownSubscriptionPopup||this.startScheduler(this.props)}},{update:["isSubscribed"],action:()=>{let{isSubscribed:e}=this.props;e&&(this.closeSubscriptionPopup(),this.hasShownSubscriptionPopup=!0)}},{update:iB,action:()=>{this.hasShownSubscriptionPopup||this.startScheduler(this.props)}},{update:$.gk,action:()=>this.startScheduler(this.props)},{update:iy.tH,action:()=>this.closeSubscriptionPopup()},{update:["isLoggedIn"],action:()=>{let{isLoggedIn:e}=this.props;e?(this.resetAllWatchingLimits(),this.stopWatchingScheduler()):this.startWatchingScheduler()}},{update:["model.id","model.status"],action:()=>{let{model:e}=this.props;(null==e?void 0:e.id)&&e.status!==T.MODEL_STATUSES.STATUS_OFF?(this.startCamMembersScheduler(),this.startGuestWatchHistoryTimeout()):(this.stopCamMembersScheduler(),this.clearGuestWatchHistoryTimeout())}},{update:["model.id","discounts"],action:()=>{this.discountsTimeoutId&&clearTimeout(this.discountsTimeoutId);let{discounts:e}=this.props;if(!(null==e?void 0:e.activatedTill))return;let t=new Date,a=new Date(null==e?void 0:e.activatedTill).getTime()-t.getTime();if(a<0){this.props.discountsReset();return}this.discountsTimeoutId=setTimeout(()=>this.props.discountsReset(),a)}},{update:["isPublicRecordingStarted","publicRecordingRenewInterval"],action:()=>{this.props.isPublicRecordingStarted?this.startPublicRecordingRenewScheduler():this.stopPublicRecordingRenewScheduler()}}]),(0,n._)(this,"stopAllSchedulers",()=>{this.stopScheduler(),this.stopWatchingScheduler(),this.stopCamMembersScheduler(),this.clearGuestWatchHistoryTimeout(),this.stopPublicRecordingRenewScheduler(),this.discountsTimeoutId&&clearTimeout(this.discountsTimeoutId)}),(0,n._)(this,"clearGuestWatchHistoryTimeout",()=>{ib.Z.stopTimeout(iO)}),(0,n._)(this,"startGuestWatchHistoryTimeout",()=>{let{addToWatchHistory:e,model:t,currentUserId:a,watchHistoryTimeoutFromConfig:i}=this.props;this.clearGuestWatchHistoryTimeout();let s=!!a;ib.Z.startTimeout(iO,"number"==typeof i?1e3*i:15e4,()=>e(t.id,{shouldSendSaveRequest:s,userId:a}))}),(0,n._)(this,"stopScheduler",()=>{ib.Z.stopTimeout(iI)}),(0,n._)(this,"startScheduler",e=>{let{isDocumentVisible:t,isMessageForGuestsEnabled:a}=e;if(a){let e=1e3*Number(W.m.get("SHOW_GUEST_MESSAGE_TIMEOUT"))||12e4;ib.Z.startTimeout("guestImitationMessageTimeout",e,this.showGuestImitationMessage)}else{let e=!this.hasShownSubscriptionPopup||!this.hasShownCreateFreeAccountModal;this.stopScheduler(),t&&e&&ib.Z.startTimeout(iI,ik,this.showPopup)}}),(0,n._)(this,"showPopup",()=>{if(!this._isMounted)return;let{hasModal:e,isCamAvailableOrPublic:t,isLoggedIn:a,isPushApiAvailable:i,isSubscribed:s}=this.props;if(!a&&!e){if(i&&t&&!this.hasShownSubscriptionPopup&&!s){this.showSubscriptionPopup();return}if(!this.hasShownCreateFreeAccountModal){let{invitePopupActionParams:e}=this.props;this.hasShownCreateFreeAccountModal=!0,this.props.createFreeAccountModal(R.Dt.VIEW_CAM_WATCH_MODEL,e)}}}),(0,n._)(this,"showGuestImitationMessage",()=>{!this.props.isLoggedIn&&this.props.shouldShowGuestMessage&&this.props.setGuestImitationMessageStep("initial")}),(0,n._)(this,"showSubscriptionPopup",()=>{let{model:e}=this.props;this.isSubscriptionPopupClosedByModelChange=!1,this.isViewCamNotificationAllowed()?this.props.showNotification(iN.h3.SUBSCRIBE):O.P4.show(iA.O,{model:e})}),(0,n._)(this,"closeSubscriptionPopup",()=>{this.isViewCamNotificationAllowed()&&this.props.closeNotification()}),(0,n._)(this,"stopWatchingScheduler",()=>{let{isWatchingIntervalStart:e}=this.state;e&&(ib.Z.stopInterval(iM),this.setState({isWatchingIntervalStart:!1}))}),(0,n._)(this,"startWatchingScheduler",()=>{let{isWatchingIntervalStart:e}=this.state;e||(ib.Z.startInterval(iM,3e4,this.updateTimeLeft),this.setState({isWatchingIntervalStart:!0}))}),(0,n._)(this,"stopCamMembersScheduler",()=>{ib.Z.stopInterval(iR)}),(0,n._)(this,"startCamMembersScheduler",()=>{let{viewersListEnabled:e,viewersListUpdateInterval:t}=this.props;this.stopCamMembersScheduler(),e&&t&&ib.Z.startInterval(iR,1e3*t,this.updateCamMembers)}),(0,n._)(this,"stopPublicRecordingRenewScheduler",()=>{ib.Z.stopInterval(iL)}),(0,n._)(this,"startPublicRecordingRenewScheduler",()=>{let{publicRecordingRenewInterval:e}=this.props;this.stopPublicRecordingRenewScheduler(),e&&(this.props.renewPublicRecording(),ib.Z.startInterval(iL,e*iC.Zv,this.props.renewPublicRecording))}),(0,n._)(this,"hasLimitationExpires",()=>{let{modelWatchingLimit:e}=this.props,{timeStart:t}=e;return t&&new Date(t).getTime()+T.UbK{let{model:e}=this.props;this.props.resetModelWatchingLimit(e.id)}),(0,n._)(this,"resetAllWatchingLimits",()=>{this.props.resetModelWatchingLimit()}),(0,n._)(this,"updateTimeLeft",()=>{let{isCamAvailableOrPublic:e,model:t,modelWatchingLimit:a}=this.props,{timeStart:i=Date.now(),minutes:s=[]}=a,r=this.getMinuteOfDay();if(this.hasLimitationExpires())this.resetWatchingLimit();else if(e){let e={timeStart:i,minutes:(0,iv.Z)((0,iE.Z)(s,r))};this.props.updateModelWatchingLimit(t.id,e)}}),(0,n._)(this,"updateCamMembers",()=>{this.props.loadMembers({isDefaultErrorHandlerEnabled:!1})}),this.state={isWatchingIntervalStart:!1}}}let iF=(0,o.$j)((e,{model:t})=>{let{auth:{isLoggedIn:a},ui:{currentModalName:i,hasModal:s,isDocumentVisible:r},viewCam:{notification:n}}=e,l=(0,E.G3)(e),o=(0,$.ff)(e,t.id),c=(0,y.KN)(e),d=(0,E.ab)(e);return{currentModalName:i,hasModal:s,isCamAvailableOrPublic:l,isDocumentVisible:r,isLoggedIn:a,isPushApiAvailable:(0,iT.iV)(),isSubscribed:(0,au.LW)(e,null==t?void 0:t.id),viewCamNotification:n,modelWatchingLimit:(0,E.OB)(e),viewersListEnabled:(0,i_.cL)(e),viewersListUpdateInterval:(0,i_.Bi)(e),discounts:(0,ae.Pn)(e),currentUserId:(0,j.rc)(e),watchHistoryTimeoutFromConfig:(0,i_.Jc)(e),isPublicRecordingStarted:(0,E.qJ)(e),publicRecordingRenewInterval:(0,u.NRb)(e),isMessageForGuestsEnabled:(0,z.ef)(e),shouldShowGuestMessage:c&&!o,invitePopupActionParams:d}},iZ)(iV);var iD=a(94537),iW=a(98233),iH=a(19144);let ix=({image:e,content:t,controls:a,closeClickHandler:i})=>l.createElement("div",{className:"view-cam-notification"},e&&l.createElement("div",{className:"view-cam-notification-image"},e),l.createElement("div",{className:"view-cam-notification-content"},t),a&&l.createElement("div",{className:"view-cam-notification-controls"},a),l.createElement("div",{className:"view-cam-notification-closer",onClick:i},l.createElement("div",{className:"view-cam-notification-closer-icon-wrapper"},l.createElement(tc.Z,{img:"close-5"})))),i$={closeNotification:eQ.vU},iG={[iN.h3.SUBSCRIBE]:({model:e,closeClickHandler:t})=>{let a=(0,tp.n3)(e);return l.createElement(ix,{content:l.createElement(t_.Z,{messageId:"viewCam.notifications.dontMissMe"}),controls:l.createElement(iW.Z,{buttonLocation:L.FO.VIEWCAM_PLAYER_SUBSCRIBE_PROMO,preventResponsiveCaption:!0,style:"blue",subscribeCaption:l.createElement(t_.Z,{messageId:"button.notifyMe"}),user:e,withoutTooltip:!0}),image:l.createElement(iH.Z,{isBorderAvatar:!1,user:(0,tv.T$)(e),modelData:a,showOnlineStatus:!1}),closeClickHandler:t})}};class iK extends l.Component{componentDidMount(){(0,V.Z)(this.propsUpdateToActionsMap,{},this.props)}componentDidUpdate(e){(0,V.Z)(this.propsUpdateToActionsMap,e,this.props)}componentWillUnmount(){this.props.closeNotification()}renderNotification(){let{model:e,notification:t}=this.props,a=iG[t];return a?l.createElement(aj.Z,{classNames:"children-transition",timeout:500},l.createElement(a,{closeClickHandler:this.closeClickHandler,model:e})):null}render(){let{playerType:e}=this.props;return l.createElement(iD.Z,{className:(0,B.AK)(["view-cam-notifications",e?`view-cam-notifications-${e}`:""])},this.renderNotification())}constructor(...e){super(...e),(0,n._)(this,"propsUpdateToActionsMap",[{update:["model.id"],action:()=>{let{notification:e}=this.props;e===iN.h3.SUBSCRIBE&&this.props.closeNotification()}}]),(0,n._)(this,"closeClickHandler",()=>{this.props.closeNotification()})}}let iq=(0,o.$j)(e=>({notification:(0,eb.O5)(e),playerType:(0,p.Aq)(e)}),i$)(iK);var iY=a(20159),iz=a(5637),ij=a(59188);let iQ=({isOngoingTicketShowAvailable:e,onClick:t,children:a})=>{let i=(0,c.T)();return(0,ij.H)(()=>{i((0,av.NB)({experimentKey:"ab_upd_enter_group_show_flow"}))}),l.createElement(tK.ZP,{className:"vc-status-private-btn",onClick:t,style:e?"apply":"gold-ds",size:"medium"},a)};var iJ=a(61250);let iX=({duration:e,onOverlimit:t})=>((0,iJ.Z)(t,e),null);var i0=a(17473);let i1=({text:e})=>l.createElement("div",{className:"vc-status-hint"},l.createElement("div",{className:"vc-status-hint-icon-box"},l.createElement(tc.Z,{img:"hint",className:"vc-status-hint-icon"})),l.createElement("div",{className:"vc-status-hint-text"},e)),i2=e=>!!(e&&"number"!=typeof e&&"object"!=typeof e&&"boolean"!=typeof e),i6=({className:e})=>{let{trans:t,formatTime:a}=(0,td.QT)(),i=(0,d.C)(eb.CR),s=(0,d.C)(x.lY),[r,n]=(0,l.useState)(new Date);if((0,l.useEffect)(()=>{let e=setInterval(()=>n(e=>new Date(e.getTime()+1e3)),1e3);return()=>clearInterval(e)},[]),null==i)return null;let o=(0,iS.og)(r.getTime()+s,i),c=o<36e5?iS.TIME_FORMATS.MINUTES_SECONDS:iS.TIME_FORMATS.HOURS_MINUTES_SECONDS;return l.createElement("div",{suppressHydrationWarning:!0,className:(0,B.AK)("vc-status-elapsed-show-time",e)},t("viewCamStatuses.heading.showIsOn",{duration:a(o,c)}))},i3=({headingIcon:e,headingText:t,withElapsedShowTime:a,subheadingText:i,bodyText:s,controls:r,footerText:n,backdropMode:o,underControlsText:c})=>l.createElement(l.Fragment,null,l.createElement(i0.M,{mode:o}),l.createElement("div",{className:"vc-status-body"},e&&(i2(e)?l.createElement(tc.Z,{img:e,className:"vc-status-heading-icon"}):e),l.createElement("div",{className:"vc-status-heading-text"},t),a&&l.createElement(i6,null),i&&l.createElement("div",{className:"vc-status-subheading-text"},"“",i,"”"),s&&l.createElement("div",{className:"vc-status-body-text"},s),r&&l.createElement("div",{className:"vc-status-controls"},r),c&&l.createElement("div",{className:"vc-status-undercontrols-text"},c)),n&&l.createElement("div",{className:"vc-status-footer"},l.createElement(i1,{text:n}))),i4=e=>{if(!e)return null;let t={[T.MODEL_STATUSES.STATUS_VIRTUAL_PRIVATE]:T.MODEL_STATUSES.STATUS_PRIVATE};return`status-${t[e]||e}`},i8=({model:{status:e},...t})=>{let a=(0,c.T)();return l.createElement("div",{className:(0,B.AK)(["vc-status",i4(e)])},e?l.createElement(i3,t):l.createElement(l.Fragment,null,l.createElement(iX,{duration:15e3,onOverlimit:()=>{a((0,el.t$)("error","viewCamStatusVideoLoadingTooLong",{}))}}),l.createElement(e_.Z,{isCentered:!0})))},i9="is_up_enter_group_show_flow_perma_on",i5={emitButtonEvent:N.d2,showModal:_.K4,joinToGroupShow:v.W6,loadActiveApps:iY.UQ,processGroupShowRequest:eQ.Mr};class i7 extends l.Component{render(){let{model:e,model:{username:t},description:a,isTicketShow:i,isOngoingTicketShowAvailable:s,viewCamShow:r}=this.props;return(null==r?void 0:r.details.groupShow)?l.createElement(i8,{model:e,withElapsedShowTime:!0,backdropMode:this.getBackdropMode(),headingIcon:i?l.createElement("div",{className:"vs-status-ticket-show-wrapper"},l.createElement(tc.Z,{img:"ticket",size:48}),s&&l.createElement(tc.Z,{img:"success-check-white",size:22,className:"vs-status-ticket-show-check-icon"})):"group",headingText:l.createElement(t_.Z,{messageId:`viewCamStatuses.heading.${i?"ticketShow":"groupShow"}`,elements:{strong:l.createElement("strong",null)},parameters:{username:t}}),subheadingText:a,controls:this.getControls(),underControlsText:this.getUnderControlsText()}):null}constructor(...e){super(...e),(0,n._)(this,"showJoinGroupShow",()=>{let{model:e,isExtensionsForTicketGroupShowsEnabled:t,isOngoingTicketShowAvailable:a,eventBus:i,ticketShowRemainingPrice:s,isTicketShow:r}=this.props,n=this.getIsShowAlternativeJoinShowButton();this.props.emitButtonEvent(L.FO.WATCH_GROUP_SHOW_NOW);let l=r?s:e.groupRate;if(i.emit(r?"button:Click ticket show":"button:Click group show",{modelUsername:e.username,price:null!=l?l:0}),n){this.props.processGroupShowRequest(e,r?tm.t.JoinGroupTicketShow:tm.t.JoinGroupShow);return}if(!a){O.P4.show(iz.G,{});return}this.props.joinToGroupShow(),t&&this.props.loadActiveApps(e.id)}),(0,n._)(this,"getIsShowAlternativeJoinShowButton",()=>{let{isUpdEnterGroupShowFlowEnabled:e,isLoggedIn:t,hasPurchase:a}=this.props;if(!e)return!1;let i=!t||!a,s=W.m.get(i9);return i&&!s&&W.m.set(i9,1),s||i}),(0,n._)(this,"renderJoinButtonContents",()=>{let{isOngoingTicketShowAvailable:e,ticketShowRemainingPrice:t,isTicketShow:a,model:i}=this.props,s=this.getIsShowAlternativeJoinShowButton();if(e)return l.createElement(t_.Z,{messageId:"button.returnToShow"});let r=a?t:i.groupRate;return s?l.createElement(t_.Z,{messageId:a?"button.getTicketForTk":"button.watchForTk",parameters:{cost:r}}):l.createElement(t_.Z,{messageId:"button.watchNow"})}),(0,n._)(this,"getControls",()=>{let{isModelOrStudio:e,isOngoingTicketShowAvailable:t}=this.props;return e?null:l.createElement(iQ,{onClick:this.showJoinGroupShow,isOngoingTicketShowAvailable:t},this.renderJoinButtonContents())}),(0,n._)(this,"getUnderControlsText",()=>{let{watchers:e,isOngoingTicketShowAvailable:t}=this.props;return l.createElement(l.Fragment,null,t&&l.createElement(t_.Z,{className:"vc-status-undercontrols-text--accent",messageId:"viewCamStatuses.body.alreadyHaveTicket",parameters:{watchers:e}}),e>=2&&!t&&l.createElement(t_.Z,{className:"vc-status-undercontrols-text--regular",messageId:"viewCamStatuses.body.groupShowWatchingNew",parameters:{watchers:e}}))}),(0,n._)(this,"getBackdropMode",()=>{let{isBlurVideoOnPrivate:e}=this.props;return e?"soft":"transparent"})}}let se=(0,t8.p1)(i7),st=(0,td.GV)(se),sa=(0,o.$j)((e,t)=>{let a=(0,E.Tn)(e)||t.model.groupShowType===T.G$M.TICKET;return{description:(0,E.cj)(e),isModelOrStudio:(0,th.ly)(e),watchers:(0,E.xO)(e),isOngoingTicketShowAvailable:a&&(0,eb._u)(e),isTicketShow:a,isExtensionsForTicketGroupShowsEnabled:(0,u.RHc)(e),viewCamShow:(0,E.Yq)(e),isBlurVideoOnPrivate:(0,p.$C)(e),ticketShowRemainingPrice:(0,E.Le)(e),isUpdEnterGroupShowFlowEnabled:(0,z.Tk)(e),isLoggedIn:(0,j.M7)(e),hasPurchase:(0,ai.gK)(e)}},i5)(st),si={wrapper:"ViewCamGroupV2__wrapper#VU",timer:"ViewCamGroupV2__timer#Hs",joinBtn:"ViewCamGroupV2__joinBtn#f3",iconContainer:"ViewCamGroupV2__iconContainer#dC",icon:"ViewCamGroupV2__icon#zi",subIcon:"ViewCamGroupV2__subIcon#Zp",title:"ViewCamGroupV2__title#nu",descriptionBlock:"ViewCamGroupV2__descriptionBlock#rC",avatar:"ViewCamGroupV2__avatar#FZ",watchersBlock:"ViewCamGroupV2__watchersBlock#Tz",haveTicket:"ViewCamGroupV2__haveTicket#OE",fires:"ViewCamGroupV2__fires#sO",watchers:"ViewCamGroupV2__watchers#Wo",watchersAccent:"ViewCamGroupV2__watchersAccent#R2"},ss=(e,t,a)=>{let i="";return a?(["female","group"].includes(e)?t>=10&&t<=35?i="\uD83D\uDD25":t>=36&&t<=70?i="\uD83D\uDD25\uD83D\uDD25":t>=71&&t<=149?i="\uD83D\uDD25\uD83D\uDD25\uD83D\uDD25":t>=150&&(i="\uD83D\uDD25\uD83D\uDD25\uD83D\uDD25\uD83D\uDD25\uD83D\uDD25"):t>=5&&t<=10?i="\uD83D\uDD25":t>=11&&t<=20?i="\uD83D\uDD25\uD83D\uDD25":t>=21&&(i="\uD83D\uDD25\uD83D\uDD25\uD83D\uDD25"),i):""},sr=({model:e})=>{let t=(0,tp.n3)(e),{trans:a}=(0,td.QT)(),i=(0,c.T)(),s=(0,d.C)(E.Tn),r=(0,d.C)(E.cj),n=(0,d.C)(th.ly),o=(0,d.C)(E.xO),u=(0,d.C)(eb._u),m=(0,d.C)(p.$C),h=(0,d.C)(z.NF),g=s||e.groupShowType===T.G$M.TICKET,S=ss(e.broadcastGender,o,h);return l.createElement("div",{className:(0,B.AK)(si.wrapper,"vc-status")},m&&l.createElement(i0.M,{mode:"soft"}),l.createElement("span",{className:si.iconContainer},g?l.createElement(l.Fragment,null,l.createElement(tc.Z,{img:"ticket",className:si.icon}),u&&l.createElement(tc.Z,{img:"success-check-white",className:si.subIcon})):l.createElement(tc.Z,{img:"group",className:si.icon})),l.createElement(t_.Z,{messageId:`viewCamStatuses.heading.${g?"ticketShow":"groupShow"}`,parameters:{username:e.username},elements:{strong:l.createElement("strong",null)},className:si.title}),l.createElement(i6,{className:si.timer}),l.createElement("div",{className:si.descriptionBlock},l.createElement(iH.q,{user:(0,tv.T$)(e),className:si.avatar,showOnlineStatus:!1,isBorderAvatar:!1,modelData:t}),l.createElement("span",null,"“",r,"”")),!n&&l.createElement(tO.ZP,{style:u?"apply":"gold-ds",onClick:()=>{if(!u){O.P4.show(iz.G,{});return}i((0,v.W6)()),i((0,iY.UQ)(e.id))},className:si.joinBtn,size:"medium"},a(`button.${u?"returnToShow":"joinNow"}`)),l.createElement("div",{className:si.watchersBlock},u?l.createElement("span",{className:si.haveTicket},a("viewCamStatuses.body.alreadyHaveTicket",{watchers:o})):l.createElement(l.Fragment,null,S&&l.createElement("div",{className:si.fires},S),l.createElement("div",{className:(0,B.AK)(si.watchers,{[si.watchersAccent]:!!S})},o>=2&&a("viewCamStatuses.body.groupShowWatching",{watchers:o})))))},sn=({model:{username:e}})=>l.createElement("div",{className:"vc-status status-idle"},l.createElement("div",{className:"clock-wrapper"},l.createElement(tc.Z,{img:"time-clock"})),l.createElement("div",{className:"status"},l.createElement(t_.Z,{className:"status-text",messageId:"viewCam.poster.idle",parameters:{username:e}})));var sl=a(6035);let so=()=>{let e=(0,d.C)(j.M7),t=(0,c.T)();return l.createElement(tK.ZP,{className:"lets-chat-plasma",style:"lets-chat-plasma",onClick:()=>{e?O.P4.show(sl.K,{}):t((0,eQ.cS)(R.Dt.SIGNUP_PLASMA_OFFLINE,{type:"chatPlasma"}))}},l.createElement("div",{className:"plasma-icon"}),l.createElement(t_.Z,{messageId:"plasma.startChat"}))};var sc=a(48233),sd=a(4289),su=a(70104);let sm=(0,o.$j)(function(e){return{next:(0,su.to)(e),modelUsername:e.viewCam.modelUsername}})(({modelUsername:e,next:t})=>{let{formatTime:a,getWeekDay:i,trans:s}=(0,td.QT)(),r=(0,l.useRef)(null),[n,o]=(0,l.useMemo)(()=>{var e;return null!==(e=null==t?void 0:t.period)&&void 0!==e?e:[]},[t]),c=(0,l.useMemo)(()=>(0,iS.YF)(new Date,iS.Ju.day),[]),d=(0,l.useMemo)(()=>(0,iS.yG)(c,{seconds:null!=n?n:0}),[c,n]),u=(0,l.useMemo)(()=>(0,iS.yG)(c,{seconds:null!=o?o:0}),[c,o]),m=(0,l.useMemo)(()=>{var e;return i(L.tz.indexOf(null!==(e=null==t?void 0:t.day)&&void 0!==e?e:"mon"))},[t,i]);return(null==t?void 0:t.day)&&(n||o)?l.createElement("div",{className:"schedule-next-informer"},l.createElement(tc.Z,{img:"calendar"})," ",s("schedule.nextBroadcast"),":"," ",l.createElement(sd.OL,{to:{pathname:`/${e}/profile#schedule`},className:"schedule-next-informer__link"},l.createElement("span",{ref:r},l.createElement(tc.Z,{img:"info-circle"}),l.createElement(aU.Z,{targetRef:r,isMobileRelative:!1,shouldPreventDefault:!0,placement:"top"},s("schedule.tooltip.yourLocalTime"))),l.createElement("span",{className:"schedule-next-informer__weekday"},l.createElement("span",{className:"schedule-next-informer__weekday-short"},s(`weekdaysAbbr.${t.day}`)),l.createElement("span",{className:"schedule-next-informer__weekday-full"},m)),"\xa0",a(d,iS.TIME_FORMATS.TIME),"\xa0–\xa0",a(u,iS.TIME_FORMATS.TIME),l.createElement(tc.Z,{img:"chevron-right"}))):null});var sp=a(75997);let sh={toggleModelNotifications:ac.oj},sv=(0,o.$j)((e,t)=>{let{model:a}=t;return{isSubscribed:(0,au.LW)(e,a.id),isCurrentUserModelOrStudio:(0,th.ly)(e)}},sh)(({icon:e="bell",isCurrentUserModelOrStudio:t,isSubscribed:a,model:i,toggleModelNotifications:s})=>{let r=(0,c.T)(),{trans:n}=(0,td.QT)();return!i.isModel||t?null:l.createElement("div",{className:"subscribe-switch-container"},l.createElement(tc.Z,{img:e}),l.createElement("span",{className:"subscribe-caption"},n("switcher.subscription.subscribe")),l.createElement(sp.Z,{className:"subscribe-switch",iconImg:"check-1",isChecked:a,onChange:(e,t)=>{t.stopPropagation(),s({model:i,buttonLocation:L.FO.SUBSCRIBE}),e&&r((0,N.Vg)(!0))},size:"small",theme:"light"}))});var sE=a(85037),sg=a(71520);let sS=()=>{let{trans:e}=(0,td.QT)(),{isLayoutUpToL:t}=(0,aB.do)("isLayoutUpToL");return l.createElement(sg.Lp,{source:R.mw.OFFLINE_SHUTTER},l.createElement(sE.m,{tooltipPlacement:t?"bottom":"right",className:"add-to-calendar-from-offline-view-cam",buttonClassName:"add-to-calendar-from-offline-view-cam__button",iconClassName:"add-to-calendar-from-offline-view-cam__icon"},l.createElement("span",{className:"media-up-to-m-hidden add-to-calendar-from-offline-view-cam__text"},e("viewCam.addToCalendar.button"))))};var sC=a(79866);let sb=(0,o.$j)(e=>({timeDelta:(0,x.lY)(e),isPlasmaAvailable:(0,E.M9)(e),isModel:(0,th.A4)(e),shouldShowAddToCalendarButton:(0,su.rf)(e)}))(({model:e,timeDelta:t,isPlasmaAvailable:a,isModel:i,shouldShowAddToCalendarButton:s})=>{let r=(0,td.QT)(),{getFormattedDateFrom:n,trans:o}=r,c=(0,l.useRef)(null),[m,p]=(0,l.useState)(!0),h=(0,tp.n3)(e),v=(0,d.C)(u.HwD);(0,aB.i6)(["windowWidth","windowHeight"],()=>{if(c.current){var e,t,a;p(((null===(t=(a=c.current).getBoundingClientRect)||void 0===t?void 0:null===(e=t.call(a))||void 0===e?void 0:e.height)||0)>500)}});let E=(0,sC.Z)(e)&&!v,g=E?"available":"offline",S=(0,sC.x)({isPlasmaAvailable:a,isOfflinePrivateAvailable:E,i18n:r}),C=e.wentIdleAt||e.statusChangedAt,b=new Date(Date.now()+t);return l.createElement("div",{ref:c,className:"vc-status-offline"},l.createElement("div",{className:"vc-status-offline-inner"},l.createElement("div",null,l.createElement("div",{className:(0,B.AK)("vc-status-avatar-container",{"avatar-hidden":!m})},l.createElement(iH.Z,{className:"vc-status-offline-avatar",isBorderAvatar:!1,user:(0,tv.T$)(e),modelData:h}),l.createElement("div",{className:(0,B.AK)("availability-status",g)},o(`viewCamStatuses.offline.availabilityStatus.${g}`)))),l.createElement("div",null,C&&l.createElement("div",{className:"offline-status-time",suppressHydrationWarning:!0},o("viewCam.wasOnline",{lastTimeLabel:n(C,b,!1)}))),l.createElement("div",null,e.offlineStatus&&l.createElement(aU.Z,{className:"offline-status",isForceVisible:!0,placement:"bottom"},l.createElement(tc.Z,{img:"megaphone-bold"}),l.createElement("span",null,e.offlineStatus))),l.createElement("div",null,!i&&l.createElement(l.Fragment,null,!!S&&l.createElement("div",{className:"private-and-start-chatting-mobile-title"},l.createElement("div",null,S)),l.createElement("div",{className:"private-and-start-chatting"},E&&l.createElement("div",{className:"private-and-start-chatting-card"},l.createElement("div",{className:"private-and-start-chatting-title"},o("viewCamStatuses.offline.requestPrivate.title")),l.createElement("div",{className:"private-and-start-chatting-body"},o("viewCamStatuses.offline.requestPrivate.body")),l.createElement(sc.Z,{model:e,className:"private-and-start-chatting-button"})),a&&l.createElement("div",{className:(0,B.AK)("private-and-start-chatting-card",{single:!E})},l.createElement("div",{className:"private-and-start-chatting-title"},o("viewCamStatuses.offline.plasma.title")),l.createElement("div",{className:"private-and-start-chatting-body"},o("viewCamStatuses.offline.plasma.body")),l.createElement("div",{className:"private-and-start-chatting-button"},l.createElement(so,null)))))),l.createElement("div",{className:"vc-status-offline-bottom"},l.createElement("div",{className:"vc-status-next-broadcast"},l.createElement(sm,null))),l.createElement("div",{className:"vc-status-subscribe"},l.createElement(sv,{key:e.id,model:e,icon:"notifications-2"}),s&&l.createElement(l.Fragment,null,l.createElement("div",{className:"vc-status-offline__button-divider"}),l.createElement(sS,null)))))}),sT=(0,o.$j)(e=>({isModelOrStudio:(0,th.ly)(e)}))(({isModelOrStudio:e,model:t,model:{username:a}})=>l.createElement(i8,{model:t,headingIcon:"lock-1",headingText:l.createElement(t_.Z,{messageId:`viewCamStatuses.heading.${e?"exclusivePrivateShort":"exclusivePrivate"}`,parameters:{username:a}}),bodyText:e?null:l.createElement(t_.Z,{messageId:"viewCamStatuses.body.whenExclusivePrivateEnds"}),footerText:e?null:l.createElement(t_.Z,{messageId:"viewCamStatuses.hint.default"})})),sw={emitButtonEvent:N.d2};class sy extends l.Component{render(){let{canSpy:e,isModelOrStudio:t,model:a,model:{username:i}}=this.props;return l.createElement(i8,{model:a,backdropMode:this.getBackdropMode(),headingIcon:"spy-on",headingText:l.createElement(t_.Z,{messageId:t?"viewCamStatuses.heading.privateShort":"viewCamStatuses.heading.private",parameters:{username:i}}),bodyText:t?null:l.createElement(t_.Z,{messageId:`viewCamStatuses.body.${e?"reveal":"whenPrivateEnds"}`}),controls:this.getControls(),footerText:t?null:l.createElement(t_.Z,{messageId:`viewCamStatuses.hint.${e?"chanceToSpy":"default"}`})})}constructor(...e){super(...e),(0,n._)(this,"startSpyClickHandler",()=>{let{model:{id:e},eventBus:t}=this.props;t.emit("button:Click spy",{modelId:e}),this.props.emitButtonEvent(L.FO.VIEWCAM_START_SPY,{modelId:e})}),(0,n._)(this,"getBackdropMode",()=>{let{canSpy:e,isBlurVideoOnPrivate:t}=this.props;return t?"soft":e?"flashlight":""}),(0,n._)(this,"getControls",()=>{let{canSpy:e,isFanClubFreeSpyAvailableForCurrentUser:t,isFreeSpyTrialAvailable:a}=this.props;return e?l.createElement(l.Fragment,null,l.createElement(tK.ZP,{className:"vc-status-private-btn",size:"medium",style:"apply-alter",onClick:this.startSpyClickHandler},l.createElement(tc.Z,{img:"spy-on",className:"vc-status-private-btn-icon"}),l.createElement(t_.Z,{messageId:"button.spyOn",parameters:{username:this.props.model.username}})),!t&&a&&l.createElement(t_.Z,{className:"vc-status-first-some-seconds-free",messageId:"viewCamStatuses.body.firstSomeSecondsFree",choiceParameter:"time",parameters:{time:T.LOf},elements:{green:l.createElement("span",{className:"vc-status-first-some-seconds-free-green"})}})):null})}}let sf=(0,t8.p1)(sy),s_=(0,o.$j)((e,t)=>{let a=(0,th.ly)(e),i=(0,eb._W)(e);return{canSpy:!!t.model.doSpy&&!a,isModelOrStudio:a,isFanClubFreeSpyAvailableForCurrentUser:(0,as.aw)(i),isFreeSpyTrialAvailable:(0,E.fj)(e),isBlurVideoOnPrivate:(0,p.$C)(e)}},sw)(sf),sP=({model:e=null})=>{let t=(0,d.C)(z.NF);if(!e)return null;switch(e.status){case T.MODEL_STATUSES.STATUS_OFF:return l.createElement(sb,{model:e});case T.MODEL_STATUSES.STATUS_IDLE:return l.createElement(sn,{model:e});case T.MODEL_STATUSES.STATUS_PRIVATE:case T.MODEL_STATUSES.STATUS_VIRTUAL_PRIVATE:return l.createElement(s_,{model:e});case T.MODEL_STATUSES.STATUS_P2P:case T.MODEL_STATUSES.STATUS_P2P_VOICE:return l.createElement(sT,{model:e});case T.MODEL_STATUSES.STATUS_GROUP_SHOW:return t?l.createElement(sr,{model:e}):l.createElement(sa,{model:e});case T.MODEL_STATUSES.STATUS_PUBLIC:return null;default:return l.createElement(i8,{model:e})}};var sN=a(23489),sA=a(66813);let sk=(0,a(80406).P1)([eC.ux,eC.GH,i_.FO,ex.h6,p.$C],(e,t,a,i,s)=>{let r=t||e;if(r)return(0,sA.iJ)({mode:s?"blurred":void 0,isLowQualityPreview:!1,model:{id:r.id},modelData:{snapshotTimestamp:r.snapshotTimestamp,status:r.status},snapshotUrlTemplate:a,hasWebpSupport:i}).url}),sI=()=>{let e=(0,c.T)(),t=(0,d.C)(eb.hj);return t?l.createElement(I.Z,{eventsWithCallbacks:[{subscriptionKey:`userUpdated@${t}`,callback:t=>{t.user&&e((0,eQ.kA)(t.user))}}]}):null};var sM=a(31560),sR=a(92201);let sL=()=>{let e=(0,d.C)(eC.D_),t=(0,d.C)(u.rsj),a=(0,sM.q)();return e&&t?l.createElement(I.Z,{eventsWithCallbacks:[{subscriptionKey:`broadcastChanged@${e}`,callback:e=>{let t=a.getState(),i=(0,eC.ux)(t);(null==i?void 0:i.username)===e.username&&(a.dispatch((0,v.Zc)(e.status)),a.dispatch(sR.bk.actions.updateModel({...i,isApprovedModel:e.isApprovedModel,isBlocked:e.isBlocked,isDeleted:e.isDeleted,isLive:e.isLive,isMobile:e.isMobile,isNonNude:e.isNonNude,status:e.status})),a.dispatch(sR.bk.actions.changeBroadcastSettings({isMicInactive:e.isMicInactive})))}}]}):null};var sO=a(56973);let sU=()=>{let e=(0,d.C)(eC.D_),t=(0,d.C)(p.Aq);return(0,sO.M)(e||null,t,(0,eA.z)(0)),null},sB={beginModelWatching:v.yS,beginVrModelWatching:v._s,cancelProposal:eQ.sA,closeNotification:eQ.vU,createFreeAccountModal:eQ.cS,emitButtonEvent:N.d2,goToModel:eQ.dX,resetViewCam:eQ.mc,shadeLayout:P.Xk,showModal:_.K4,stopShow:eQ.a$,stopSpy:eQ.Kp,changeVolume:J.v6,updatePlayerWasInPlayedState:v.ll,updateHLSStreamEndedState:v.zH,updateViewCamBaseRealResolution:sN.dI},sZ=(e,t)=>{var a,i;return(null==e?void 0:null===(a=e.model)||void 0===a?void 0:a.id)!==(null==t?void 0:null===(i=t.model)||void 0===i?void 0:i.id)},sV=(e,t)=>sZ(e,t)||(null==e?void 0:e.playerType)!==(null==t?void 0:t.playerType),sF=(e,t)=>{var a,i;return(null==e?void 0:null===(a=e.model)||void 0===a?void 0:a.id)!==(null==t?void 0:null===(i=t.model)||void 0===i?void 0:i.id)};class sD extends l.Component{componentDidMount(){this.props.updatePlayerWasInPlayedState(!1),(0,V.Z)(this.propsUpdateToActionsMap,{},this.props),(0,F.H0)(this,document,"keydown",this.viewCamBlockKeyDownHandler),(0,F.H0)(this,window,"beforeunload",this.onBeforeUnloadEventHandler),(0,F.H0)(this,window,"unload",this.onBeforeUnloadEventHandler),(0,F.H0)(this,window,"pagehide",this.onBeforeUnloadEventHandler)}componentDidUpdate(e){(0,V.Z)(this.propsUpdateToActionsMap,e,this.props)}componentWillUnmount(){let{model:e}=this.props;e&&this.props.resetViewCam({isResetViewCamConfig:!0,isResetActiveApps:!0}),(0,F.OM)(this)}checkShowNonNudeShutter(){let{needVerifyAge:e,model:t,isNonNudeCategoryEnabled:a}=this.props;return(0,f.tB)({needVerifyAge:e,isNonNudeCategoryEnabled:a,isModelNonNude:null==t?void 0:t.isNonNude})}renderSocket(){let{isUserFanClubActive:e,isAppBotsEnabled:t,currentUserId:a,isLoggedIn:i,model:s}=this.props,r=s?[a?`userBanned@${s.id}#${a}`:`userBanned@${s.id}`,`goalChanged@${s.id}`,`broadcastSettingsChanged@${s.id}`,`tipMenuUpdated@${s.id}`,`topicChanged@${s.id}`,`userUpdated@${s.id}`,`interactiveToyStatusChanged@${s.id}`,a?`groupShow@${s.id}#${a||""}`:`groupShow@${s.id}`,`deleteChatMessages@${s.id}`,`tipLeaderboardSettingsUpdated@${s.id}`,`modelStatusChanged@${s.id}`,`tipMenuLanguageDetected@${s.id}`,...e?[`fanClubUpdated@${s.id}`]:[],...t?[`modelAppUpdated@${s.id}`]:[],`userBroadcastServerChanged@${s.id}`]:[],n=[];i&&n.push(`userBroadcastServerChanged@${a}`,`interactiveToyStatusChanged@${a}`,`privateEndedV2@${a}#${a}`);let o=[];return s&&i&&o.push(`spyChanged@${s.id}#${a}`,`knightChanged@${s.id}`,`userUnbanned@${s.id}#${a}`),s&&o.push(`modelDiscountActivated@${s.id}`),l.createElement(l.Fragment,null,l.createElement(sI,null),l.createElement(sL,null),l.createElement(I.Z,{events:["lotteryChanged",...r,...n,...o],eventsWithCallbacks:[]}))}renderControlsWrapper(){let{isCamAvailable:e,isPromoModel:t,baseModel:a,model:i,isViewCamRequestsCompleted:s}=this.props;return t?null:s&&a?l.createElement(ia,{isCamAvailable:e,model:i,baseModel:a}):l.createElement(ii,null)}renderViewCamContent(){let{shouldRenderPlayer:e,shouldRenderPlayerOnBackground:t,isBlurVideoOnPrivate:a}=this.props;return this.checkShowNonNudeShutter()?l.createElement(l.Fragment,null,e&&t&&this.renderPlayer(),this.renderNonNude()):e&&t||a?l.createElement(l.Fragment,null,this.renderPoster(),this.renderPlayer()):e?this.renderPlayer():this.renderPoster()}render(){let{isViewCamInfoVisible:e,model:t,shouldRenderPlayer:a,isWebRTCSupported:i,shouldRenderPlayerOnBackground:s,isBlurVideoOnPrivate:r,layout:n}=this.props,o=this.getPosterImageUrl(),c=!a&&!!t||this.checkShowNonNudeShutter()||s||r,d=l.createElement(A.Z,null,l.createElement(tC,{model:t,posterImageSrc:o},this.renderViewCamContent()));return n({systems:l.createElement(l.Fragment,null,i&&l.createElement(S,null),t&&l.createElement(iF,{model:t}),t&&l.createElement(iq,{model:t}),t&&l.createElement(et,null),this.renderSocket()),content:d,controls:this.renderControlsWrapper(),info:l.createElement(ip,{isVisible:e})},{isPoster:c})}constructor(...e){super(...e),(0,n._)(this,"isWatchingSuspended",!1),(0,n._)(this,"visibilityChangeCount",0),(0,n._)(this,"propsUpdateToActionsMap",[{update:(e,t)=>!!e.isSocketReady&&!t.isSocketReady,action:()=>{let{isSocketReady:e,isInPrivate:t,privateMode:a}=this.props;!e&&t&&(a?(Z.ZP.addSource(Z.OF.USER_SOCKET_NOT_WORKING),D.Z.send(Z.OF.USER_SOCKET_NOT_WORKING),this.props.stopShow("socketNotReady")):this.props.cancelProposal("socketNotReady"),this.props.shadeLayout(!1))}},{update:sF,action:()=>{let{model:e}=this.props;(null==e?void 0:e.isVr)&&this.props.beginVrModelWatching(e)}},{update:sZ,action:()=>{this.props.updatePlayerWasInPlayedState(!1)}},{update:sV,action:()=>{let{isDocumentVisible:e,model:t}=this.props;this.isWatchingSuspended=!e,!this.isWatchingSuspended&&t&&this.props.beginModelWatching(t)}},{update:$.Kh,action:()=>{let{isDocumentVisible:e,model:t}=this.props;e&&t&&(this.props.beginModelWatching(t),this.isWatchingSuspended=!1)}},{update:["shouldShadeLayout"],action:()=>{let{shouldShadeLayout:e}=this.props;this.props.shadeLayout(e)}},{update:["shouldRenderPlayer"],action:()=>{let{shouldRenderPlayer:e}=this.props;e||(this.props.updatePlayerWasInPlayedState(!1),this.props.updateHLSStreamEndedState(!1))}},{update:["isDocumentVisible","shouldRenderPlayerOnBackground"],action:()=>{if(this.visibilityChangeCount++,this.props.shouldRenderPlayerOnBackground){this.props.changeVolume(0,!1);return}if(this.visibilityChangeCount<=1)return;let{isDocumentVisible:e}=this.props;if(L.BROWSER_CAPABILITIES.isMobile||L.BROWSER_CAPABILITIES.isTablet||this.props.isTicketShow){if(e){let e=W.m.get(T.dAu.PLAYER_VOLUME);this.props.changeVolume("number"==typeof e?e:50,!1)}else this.props.changeVolume(0,!1)}}}]),(0,n._)(this,"onBeforeUnloadEventHandler",()=>{let{isInPrivate:e,isInSpyMode:t}=this.props;if(t||e){Z.ZP.addSource(Z.OF.USER_CLOSE_BROWSER_IN_PRIVATE);return}this.props.resetViewCam({isResetViewCamConfig:!1,isResetActiveApps:!1})}),(0,n._)(this,"viewCamBlockKeyDownHandler",e=>{let{ctrlKey:t,keyCode:a}=e,{isCurrentUserModelOrStudio:i,isCamAvailable:s,isOwnShow:r,model:n,isNextModelAvailable:l,isPrevModelAvailable:o}=this.props,c=(null==n?void 0:n.status)===T.MODEL_STATUSES.STATUS_PRIVATE||(null==n?void 0:n.status)===T.MODEL_STATUSES.STATUS_VIRTUAL_PRIVATE,d=!r&&!(s&&c),u=a===L.KEY_CODES.sChar,m=a===L.KEY_CODES.comma,p=a===L.KEY_CODES.period;t&&((u||m||p)&&(e.preventDefault(),e.stopPropagation()),r||c||!u||i||this.startPurchaseTokensModalWizard(),m&&d&&o&&this.props.goToModel("prev"),p&&d&&l&&this.props.goToModel("next"))}),(0,n._)(this,"goToNextModel",()=>{this.props.goToModel("next")}),(0,n._)(this,"startPurchaseTokensModalWizard",()=>{O.P4.show(w.a,{user:this.props.model,buyTokensSource:tm.t.ViewcamHotKey})}),(0,n._)(this,"getPosterImageUrl",()=>{let{model:e,isNonNudeWL:t,isTheatreModeActive:a,snapshotUrl:i=null==e?void 0:e.previewUrl,isCamAvailable:s,shouldRenderPlayerOnBackground:r,isBlurVideoOnPrivate:n,isViewCamRequestsCompleted:l,isModelInGroupShow:o}=this.props,c=this.checkShowNonNudeShutter();if(!t&&!a&&!r&&!n&&!c)return(null==e?void 0:e.status)&&T.i1C.includes(e.status)&&!s||!o&&!s&&l?null==e?void 0:e.previewUrl:i}),(0,n._)(this,"renderNavButtons",()=>l.createElement("div",{className:"view-cam-room-nav"},l.createElement(M.Z,{id:"room_nav_next",type:"next-small",onClick:this.goToNextModel,pageNumber:0}))),(0,n._)(this,"renderViewStatus",()=>{let{model:e}=this.props;return l.createElement(sP,{model:e||null})}),(0,n._)(this,"renderPoster",()=>{let{model:e,isNextModelAvailable:t,shouldRenderPlayerOnBackground:a,isBlurVideoOnPrivate:i}=this.props;return l.createElement(ih,{modelStatus:null==e?void 0:e.status,isBackgroundVideo:a,isBlurVideoOnPrivate:i},t&&this.renderNavButtons(),this.renderViewStatus())}),(0,n._)(this,"renderShutter",()=>{let{model:e}=this.props;return l.createElement(ih,{modelStatus:null==e?void 0:e.status},l.createElement(tu,null))}),(0,n._)(this,"renderNonNude",()=>{let{model:e,baseModel:t,shouldRenderPlayer:a,shouldRenderPlayerOnBackground:i,isViewCamRequestsCompleted:s}=this.props,r=i&&a||!s,n=r||!s,o=e?(0,tv.T$)(e):void 0;return l.createElement(C.u,{isViewcam:!0,model:o||t||void 0,modelData:e&&(0,tp.tA)(e)||t||void 0,isTranslucent:r,hideSnapshot:n},l.createElement(b.R,{isViewcam:!0,isForceWhiteText:!0,triggerSource:R.Dt.AVP_STREAM_SHUTTER,model:o,className:"view-cam__non-nude-shutter"}))}),(0,n._)(this,"onPlaying",()=>{U.s.clearMarks(),this.props.updatePlayerWasInPlayedState(!0)}),(0,n._)(this,"renderPlayer",()=>{let{isPlayerShuttered:e,shouldRenderPlayerOnBackground:t,isBlurVideoOnPrivate:a,model:i}=this.props;if(e)return this.renderShutter();let s=this.getPosterImageUrl();return l.createElement(l.Fragment,null,!!i&&l.createElement(eo.s,null,l.createElement(sU,null)),l.createElement(to,{updatePlayerResolution:this.props.updateViewCamBaseRealResolution,onPlaying:this.onPlaying,lastSnapshotUrl:s,className:(0,B.AK)((t||a)&&"view-cam_bg-player")}))})}}let sW=(0,k.H)("isLayoutUpToL")((0,o.$j)((e,t)=>({currentUserId:(0,j.rc)(e),isPlayerShuttered:!(0,x.Wu)(e),isViewCamInfoVisible:!(0,y._8)(e,t.isLayoutUpToL),isCamAvailable:(0,eb._u)(e),isCurrentUserModelOrStudio:(0,th.ly)(e),isDocumentVisible:(0,G.PF)(e),isAppBotsEnabled:(0,u.N$r)(e).appBots,isInSpyMode:(0,E.Hn)(e),isInPrivate:(0,E.IW)(e),isInPersonal:(0,E.Ex)(e),isLoggedIn:(0,j.Cg)(e),isNonNudeWL:(0,q.Km)(e),isMyStudioModel:(0,Y.EP)(e),isNextModelAvailable:(0,eb.xr)(e),isModelInGroupShow:(0,E.Vf)(e),isOwnShow:(0,eb.$u)(e),isPrevModelAvailable:(0,eb.N5)(e),isPromoModel:(0,E.P1)(e),needVerifyAge:(0,Q.m5)(e),isSocketReady:(0,x.F7)(e),model:(0,eb.oC)(e)||t.model,playerType:(0,p.Aq)(e),privateMode:(0,E.Zu)(e),shouldShadeLayout:(0,E.TE)(e),shouldRenderPlayer:(0,E.AO)(e),isUserFanClubActive:(0,E._I)(e),isWebRTCSupported:(0,p.XI)(e)(m.PLAYER_TYPES.WEBRTC),isTheatreModeActive:(0,K.z)(e),isViewCamRequestsCompleted:(0,E.UY)(e),isNonNudeCategoryEnabled:(0,z.Sk)(e),shouldRenderPlayerOnBackground:(0,E.qe)(e),isTicketShow:(0,E.Tn)(e),isBlurVideoOnPrivate:(0,p.$C)(e),modelListSectionName:(0,H.TF)(e),snapshotUrl:sk(e)}),sB)(sD))},79866:(e,t,a)=>{a.d(t,{Z:()=>s,x:()=>i});let i=({isPlasmaAvailable:e,isOfflinePrivateAvailable:t,i18n:{trans:a}})=>t&&e?a("viewCamStatuses.offline.requestPrivate.mobileBody"):t?a("viewCamStatuses.offline.requestPrivate.mobileBodyOnlyOfflineRequest"):e?a("viewCamStatuses.offline.requestPrivate.mobileBodyOnlyChatting"):"",s=e=>e.isOfflinePrivateAvailable&&(e.doPrivate||e.doP2p)},46672:(e,t,a)=>{a.d(t,{L:()=>g});var i=a(27378),s=a(57174),r=a(29413),n=a(91090),l=a(84423),o=a(97606),c=a(94380),d=a(95654),u=a(96330),m=a(68020),p=a(32284),h=a(79561),v=a(29421);let E=e=>"number"!=typeof e?60:e<60?1:Math.floor(e/60),g=()=>{let{trans:e}=(0,o.QT)(),t=(0,d.C)(h.TN),a=(0,d.C)(m.AW),g=(0,d.C)(v.oC),S=(0,c.T)(),C=!!(g&&t);(0,l.GT)(C);let b=()=>{S((0,u.I)("SignUp",{action:{backgroundImage:null==g?void 0:g.avatarUrl,shouldBypassActionPrefix:!0,type:"continueWatching",user:g?(0,p.T$)(g):void 0},amplParams:{triggerSource:n.Dt.WATCHING_LIMITATION}}))};return C?i.createElement("div",{className:"view-cam-watching-limit"},i.createElement("div",{className:"view-blocked-container"},i.createElement("div",{className:"watching-limit-title"},e("viewCam.watchingLimit.title")),i.createElement("div",{className:"watching-limit-description"},i.createElement("div",null,e("viewCam.watchingLimit.description",{limit:E(a)})),i.createElement("div",{className:"watching-limit-description-features"},e("viewCam.watchingLimit.youWillGet"))),i.createElement("div",{className:"watching-limit-features",onClick:b},i.createElement("div",{className:"watching-limit-feature"},i.createElement(r.Z,{img:"play-2",size:14}),e("viewCam.watchingLimit.features.watchForFree")),i.createElement("div",{className:"watching-limit-feature"},i.createElement(r.Z,{img:"chat",size:18}),e("viewCam.watchingLimit.features.publicChat")),i.createElement("div",{className:"watching-limit-feature"},i.createElement(r.Z,{img:"tokens-2",size:20}),e("viewCam.watchingLimit.features.tokenGiveaway")))),i.createElement(s.ZP,{style:"accept",size:"large",onClick:b},e("viewCam.watchingLimit.button"))):null}}}]);