"use strict";(self.webpackChunkhybrid_client=self.webpackChunkhybrid_client||[]).push([[16],{"./src/components/HybridClient.js":(e,t,s)=>{s.r(t),s.d(t,{HybridClientWithoutBoundary:()=>Fe,booleanProps:()=>Be,default:()=>Me,numberProps:()=>je});var n,r,o=s("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),a=s("./node_modules/@babel/runtime/helpers/esm/extends.js"),i=s("./node_modules/@babel/runtime/helpers/esm/jsx.js"),l=s("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),d=s("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),c=s("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),u=s("./node_modules/@babel/runtime/helpers/esm/createClass.js"),m=s("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),p=s("./node_modules/@babel/runtime/helpers/esm/inherits.js"),h=s("./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"),A=s("./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"),f=s("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),y=s("./node_modules/@babel/runtime/regenerator/index.js"),b=s.n(y),g=s("webpack/sharing/consume/default/react/react"),v=s.n(g),E=s("./node_modules/prop-types/index.js"),C=s.n(E),w=s("./node_modules/lodash/debounce.js"),T=s.n(w),S=s("./node_modules/lodash/get.js"),R=s.n(S),_=s("./node_modules/lodash/isEqual.js"),I=s.n(_),O=s("./node_modules/lodash/noop.js"),P=s.n(O),k=s("./node_modules/universal-cookie/lib/index.js"),L=s.n(k),D=s("./node_modules/styled-components/dist/styled-components.browser.esm.js"),N=s("./node_modules/@atg/icf-react-components/themes/Theme.js"),M=s("./node_modules/ua-parser-js/src/ua-parser.js"),F=s.n(M),B=s("./src/constants/Actions.js"),j=s("./src/constants/LogLevel.js"),U=s("./src/constants/Messages.js"),x=s("./src/constants/SetupPlayerErrors.js"),q=s("./src/constants/DisconnectReasons.js"),G=s("./src/constants/LayoutConstants.ts"),X=s("./src/constants/Platforms.ts"),H=s("./src/constants/VideoConstants.js"),V=s("./src/constants/Feature.ts"),W=s("./src/constants/Xment.ts"),z=s("./src/constants/Globals.js"),K=s("./src/constants/RewardsConstants.ts"),Y=s("./src/constants/Tenant.ts"),J=s("./src/utils/OpenPayModal.js"),Z=s("./src/utils/DebugHook.js"),Q=s("./src/utils/log.js"),$=s("./src/utils/tools.ts"),ee=s("./src/utils/localization.js"),te=s("./src/utils/TranslationProvider.tsx"),se=s("./src/lib/Dispatcher.js"),ne=s("./src/lib/PerformanceTiming.js"),re=s("./src/lib/AjaxRequest.js"),oe=s("./src/lib/Strings.js"),ae=s("./src/stores/ConnectionStore.js"),ie=s("./src/stores/LayoutStore.js"),le=s("./src/stores/PerformerStore.ts"),de=s("./src/stores/UserStore.js"),ce=s("./src/stores/RateStore.js"),ue=s("./src/stores/XmentStore.ts"),me=s("./src/stores/VideoPipStore.js"),pe=s("./src/stores/ModalStore.js"),he=s("./src/stores/PerformerSubscribersStore.js"),Ae=s("./src/stores/MediaStore.ts"),fe=s("./src/stores/ConfigStore.ts"),ye=s("./src/components/videoclient/store/videoClient/VideoClientStore.ts"),be=s("./src/stores/FeatureTrackerStore.ts"),ge=s("./node_modules/lscache/lscache.js"),ve=s.n(ge),Ee=s("./node_modules/react-resize-detector/build/index.esm.js"),Ce=s("./src/components/ThemeProvider.tsx"),we=s("./src/components/MobileRoot.js"),Te=s("./src/components/DesktopRoot.js"),Se=s("./src/components/JssConfiguration.js"),Re=s("./src/components/goldshow/TopContributorsUpsellCreator.tsx"),_e=s("./src/components/AdComponent.tsx"),Ie=s("./src/utils/withErrorBoundary.tsx"),Oe=s("./src/constants/Feedback.ts"),Pe=s("./src/constants/CurrencyConstants.js");function ke(e){var t=function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}();return function(){var s,n=(0,A.A)(e);if(t){var r=(0,A.A)(this).constructor;s=Reflect.construct(n,arguments,r)}else s=n.apply(this,arguments);return(0,h.A)(this,s)}}ve().setBucket("hybridclient");var Le=D.Ay.div.attrs({id:"".concat(ie.UD)}).withConfig({displayName:"HybridClient__HCRoot",componentId:"sc-2fme2u-0"})(["direction:",";width:100%;height:100%;display:flex;flex-direction:column;justify-content:",";overflow:auto;background-color:",";position:relative;z-index:0;*{box-sizing:border-box;}*:focus{outline:0 none transparent;}svg use{pointer-events:none;}input{font-size:100%;}"],(function(e){return e.direction}),(function(e){return e.fullscreen?"center":"start"}),(function(e){return e.fullscreen?"#000":""})),De=D.Ay.div.withConfig({displayName:"HybridClient__ClientModalTarget",componentId:"sc-2fme2u-1"})(["position:fixed;top:0;left:0;right:0;bottom:0;pointer-events:none;& > *{pointer-events:auto;}*{box-sizing:border-box;}*:focus{outline:0 none transparent;}svg use{pointer-events:none;}input{font-size:100%;}"]),Ne=function(e){(0,p.A)(s,e);var t=ke(s);function s(e){var n;(0,c.A)(this,s),n=t.call(this,e),(0,f.A)((0,m.A)(n),"handleWindowBeforeUnload",(function(){se.A.dispatch({type:B.A.BROWSER_CLOSE}),Q.A.usage("user_left",Date.now()),Q.A.sendAndStop()})),(0,f.A)((0,m.A)(n),"handleWindowOffline",(function(){n.setState({wentOffline:!0}),Q.A.statsIncCounter("connection.went_offline"),ne.A.mark("client_offline")})),(0,f.A)((0,m.A)(n),"handleWindowOnline",(function(){n.state.wentOffline&&(n.setState({wentOffline:!1}),Q.A.statsIncCounter("connection.went_online"),ne.A.mark("client_online"))})),(0,f.A)((0,m.A)(n),"handleWindowMessage",(function(e){if(e.origin===window.location.origin){var t=n.props.platform;switch(e.data.name){case K.hI:t===X.Ay.SCP&&se.A.dispatch({type:B.A.UPDATE_USER_REWARDS_INFORMATION,data:{rewards:e.data.rewards}});break;case U.A.DESTROY_STREAM:se.A.dispatch({type:B.A.DISCONNECT,data:[q.A.USER_DISCONNECT]});break;case U.A.RESET_STREAM:se.A.dispatch({type:B.A.CONNECT,data:{}})}}})),(0,f.A)((0,m.A)(n),"removeWindowListeners",(function(){"undefined"!=typeof window&&(Object.defineProperty(window,"onbeforeunload",{value:null}),window.removeEventListener("offline",n.handleWindowOffline),window.removeEventListener("online",n.handleWindowOnline),window.removeEventListener("message",n.handleWindowMessage),window.removeEventListener("user_nickname_update",n.handleUserNicknameUpdate))})),(0,f.A)((0,m.A)(n),"handleLayoutStoreUpdate",(function(){var e=ie.Ay.getState(),t=e.fullscreen,s=e.showPerformerBio,r=e.layout,o=e.orientation;n.state.fullscreen===t&&n.state.showPerformerBio===s&&n.state.layout===r&&n.state.orientation===o||(n.setState({fullscreen:t,showPerformerBio:s,layout:r,orientation:o}),n.updateDom(r))})),(0,f.A)((0,m.A)(n),"requestConfigData",T()((function(){var e;return(e=n)._requestConfigData.apply(e,arguments)}),10)),(0,f.A)((0,m.A)(n),"requestBioData",T()((function(){var e;return(e=n)._requestBioData.apply(e,arguments)}),11)),(0,f.A)((0,m.A)(n),"dispatchResize",(function(e,t){var s,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e&&t?(s={width:e,height:t,forceRecalc:r||!n.handledFirstResize},n.handledFirstResize=!0):s={forceRecalc:r},se.A.dispatch({type:B.A.WINDOW_RESIZE,data:s}),n.rootRef){var o=n.rootRef.getBoundingClientRect();se.A.dispatch({type:B.A.CLIENT_ROOT_BOUNDING_RECT,data:{rect:o}})}})),(0,f.A)((0,m.A)(n),"handleRootRef",(function(e){n.rootRef=e})),(0,f.A)((0,m.A)(n),"handleClientModalTargetRef",(function(e){n.clientModalTargetElement=e})),(0,f.A)((0,m.A)(n),"getClientModalTargetElement",(function(){return n.clientModalTargetElement})),(0,f.A)((0,m.A)(n),"getLayoutRootProps",(function(e){var t=e.source,s=e.sabasic,r=e.sakey;return{source:t||s||r?t:"pvc,hls,hlsjs,meow,flash",assetPath:e.assetPath,mobileCam2Cam:e.mobileCam2Cam,themeMode:e.theme,sections:e.sections,performerBioTabs:e.performerBioTabs,performerBioTabOrder:e.performerBioTabOrder,handleGoToLogin:e.handleGoToLogin,handleClearHybridClient:e.handleClearHybridClient,breakpoint:e.breakpoint,xment:n.props.xment,afno:n.props.afno}})),(0,f.A)((0,m.A)(n),"getLayoutRoot",(function(e,t){var s;switch(e){case G.Ay.DESKTOP:s=Te.A;break;case G.Ay.TABLET:s=t!==G.Ay.PORTRAIT||n.state.showPerformerBio?Te.A:we.A;break;case G.Ay.MOBILE:default:s=we.A}return s})),Q.A.startIfNotStarted(),Q.A.usage("render_client",Date.now()),ne.A.mark("render_client_start"),n.setLogUrl(),Q.A.set("serial",z.A.VERSION),Q.A.info("hc_serial: ".concat(z.A.VERSION)),Q.A.set("platform",e.platform),Z.A.setDebug(e.enableDebugHooks),e.name||ne.A.log(),n.addDom(),ie.Ay._setGlobalReference(window),re.A.setBaseUrl(e.server),de.A.setSakey(e.sakey),re.A.setSakey(e.sakey);var r=new(L()),o=r.get("smeid"),a=r.get("smtid"),i=r.get("smvid");re.A.setTrackingIds({smtid:a,smeid:o,smvid:i}),e.whitelabel&&(re.A.setSitedomain(e.whitelabel),ue.A.setDomain(e.whitelabel)),ue.A.setXments(e.xmentOverride),r.get("ta-xment-cookie")&&ue.A.setXments("none"),e.usejwt&&ae.A.enableJwtTokenForPrivCalls(),e.urls&&le.A.setUrls(e.urls),e.lang&&(oe.Ay.setLanguage(e.lang),ae.A.setLanguage(e.lang),le.A.setLanguage(e.lang),(0,ee.YC)(e.lang)),e.essUsername&&se.A.dispatch({type:B.A.SET_ESS_USERNAME,data:{essUsername:e.essUsername}}),e.useDebugPerformerData&&(le.A.setUseDebugPerformerData(e.useDebugPerformerData),Ae.A.setUseDebugPerformerData(e.useDebugPerformerData)),ae.A.setGoldOnly(e.isGoldOnly),ae.A.setexclusiveSessionPriceItemId(e.exclusiveSessionPriceItemId),ie.Ay.setPlatform(e.platform),le.A.setPlatform(e.platform),he.A.setPlatform(e.platform),fe.A.setPlatform(e.platform),ae.A.setPlatform(e.platform);var l=Y.rE.get(e.platform);ae.A.setTenantId(l),re.A.setTenantId(l),fe.A.setNotificationsGatewayCaller(e.notificationsGatewayCaller),fe.A.setPerformerbioGatewayCaller(e.performerbioGatewayCaller),fe.A.setXsfHeader(e.xsrfHeader),fe.A.setPayPalConfig(e.payPalConfig),fe.A.setDomain(e.domain),ue.A.checkXment(W.A.HYBRIDCLIENT_BASELINE,(function(){})),null!=e&&e.livelyEndpoint&&se.A.dispatch({type:B.A.SET_LIVELY_ENDPOINT,data:e.livelyEndpoint}),e.memberServer&&se.A.dispatch({type:B.A.MEMBER_SERVER,data:{memberServer:e.memberServer}}),e.federatedModules&&se.A.dispatch({type:B.A.FEDERATED_MODULE_FALLBACK_MAPPINGS,data:{federatedModules:e.federatedModules}});var d=ie.Ay.getState(),u=d.showPerformerBio,p=d.layout,h=d.orientation;return n.state={primaryColor:e.primaryColor||"#3399cc",fullscreen:!1,showPerformerBio:u,smtid:a,smeid:o,smvid:i,layout:p,orientation:h,wentOffline:!1},n.updateDom(p),n}return(0,u.A)(s,[{key:"addDom",value:function(){this.jssInsertionPoint=document.createElement("style"),document.head.appendChild(this.jssInsertionPoint),this.videoContainerElement=document.createElement("div"),this.videoContainerElement.id=H.A.VIDEO_CONTAINER_ID,document.body.appendChild(this.videoContainerElement),this.pipContainerElement=document.createElement("div"),this.pipContainerElement.id=H.A.PIP_CONTAINER_ID,Object.assign(this.pipContainerElement.style,{position:"fixed",top:0}),document.body.appendChild(this.pipContainerElement)}},{key:"updateDom",value:function(e){var t=this.props.platform,s=0;this.isBlackLabel()&&(s=1),e===G.Ay.MOBILE&&t===X.Ay.SCP&&(s=1500),this.pipContainerElement&&Object.assign(this.pipContainerElement.style,{zIndex:s})}},{key:"getChildContext",value:function(){var e=this.state,t=e.primaryColor,s=e.smtid,n=e.smeid,r=e.smvid,o=e.layout,a=e.orientation,i=e.fullscreen,l=this.props,d=l.quickTipBatchingPeriod,c=l.platform,u=l.isExternalSiteFundsOnly,m=l.theme,p=l.lang;return{primaryColor:t,themeMode:m,smtid:s,smeid:n,smvid:r,quickTipBatchingPeriod:d,layout:o,orientation:a,fullscreen:i,platform:c,isBlackLabel:this.isBlackLabel(),isExternalSiteFundsOnly:u,window:window,document:document,videoContainerElement:this.videoContainerElement,pipContainerElement:this.pipContainerElement,getClientModalTargetElement:this.getClientModalTargetElement,direction:"he"===p?N.Direction.rtl:N.Direction.ltr}}},{key:"checkInitialXments",value:function(){this.checkMobileChatXment(),this.checkTagsFedModXment(),this.checkMemberCommentsFedModXment(),this.checkImprovedCamPageFullscreenUIXment(),this.checkCam2CamUIModernizationXment();var e=ie.Ay.getState().layout;e!==G.Ay.MOBILE&&e!==G.Ay.TABLET||this.checkChatJoinPromptMobileXment(),e===G.Ay.DESKTOP&&this.checkChatJoinPromptDesktopXment()}},{key:"componentDidMount",value:function(){var e=this;ne.A.mark("render_client_end");var t=this.props,s=t.server,n=t.name,r=t.sabasic,o=t.sakey,a=t.layout,i=t.wrapperIframe,l=t.sessionLengthForPostPaidModal,d=t.useDebugPerformerData,c=t.platform,u=t.isExternalSiteFundsOnly,m=t.isGoldOnly,p=t.messengerEnabled,h=t.bypassRateThrottler4InternalIPs,A=t.stno,f=t.afno;this.checkInitialXments(),function(e){se.A.dispatch({type:B.A.SET_MESSENGER_ENABLED,data:{messengerEnabled:e}})}(p),this.dispatchFeatureVisibility(this.props);var y=new(L());n&&(this.requestConfigData({server:s,performerName:n,sabasic:r,sakey:o,sk:window.location.host,platform:c,isExternalSiteFundsOnly:u,isGoldOnly:m,bypassRateThrottler:Boolean(y.get("brt")),bypassRateThrottler4InternalIPs:h,stno:A,afno:f}),this.requestV2SetupBioXment((function(t){e.requestBioData({server:s,performerName:n,sakey:o,platform:c,shownFeatures:e.shownFeatures,useDebugPerformerData:d,version:t?2:1})})),setInterval((function(){var e=s+"/api/v1/refreshdynamicrate";re.A.get(e,{performerId:ae.A.getState().performerId,userId:ae.A.getState().userId,performerStreamId:ae.A.getState().performerStreamId},(function(e){var t=e.body,s=t.privateRate,n=t.exclusiveRate,r=ce.A.getState().ratePremium.replace(/\./,""),o=ce.A.getState().rateExclusive.replace(/\./,"");ce.A.getState().exchangeRate!==Pe.A.DEFAULT_EXCHANGE_RATE||s==r&&n==o||Q.A.error({message:"refreshed dynamic rate did not match rate state",returnedPrivateRate:s,storedPrivateRate:r,returnedExclusiveRate:n,storedExclusiveRate:o,performerId:ae.A.getState().performerId,userId:ae.A.getState().userId,performerStreamId:ae.A.getState().performerStreamId})}))}),27e5)),o||ie.Ay.getState().layout!==G.Ay.MOBILE||c!==X.Ay.SCP||de.A.setUseCreateAccountCta(!0),l>=0&&pe.A.setSessionLengthForPostPaidModal(l),this.layoutToken=ie.Ay.addListener(this.handleLayoutStoreUpdate),a&&ie.Ay.forceLayout(a),i&&ie.Ay._setGlobalReference(i.contentWindow),ie.Ay.onResize(),"undefined"!=typeof window&&(window.addEventListener("beforeunload",this.handleWindowBeforeUnload),window.addEventListener("offline",this.handleWindowOffline),window.addEventListener("online",this.handleWindowOnline),window.addEventListener("message",this.handleWindowMessage)),this.addMobileOrientationChangeListeners(ie.Ay.getState().layout),this.addMobileResizeListeners(ie.Ay.getState().layout,c),this.addUserNicknameUpdateListeners()}},{key:"addMobileOrientationChangeListeners",value:function(e){if(e===G.Ay.MOBILE||e===G.Ay.TABLET){var t=this.state.isLandscape?G.Ay.LANDSCAPE:G.Ay.PORTRAIT;be.A.initOrientationTracking(e,t),window.addEventListener("orientationchange",(function(){be.A.handleOrientationChange()}))}}},{key:"addMobileResizeListeners",value:function(e,t){var s,n,r=this;if([X.Ay.FOUNDATION,X.Ay.UNKNOWN].includes(t)){var o=window.top;try{o.location.href}catch(e){return}var a=null===(s=F()(window.navigator.userAgent))||void 0===s||null===(n=s.device)||void 0===n?void 0:n.type;if(e===G.Ay.MOBILE||e===G.Ay.TABLET||("mobile"===a||"tablet"===a)){var i=function(){me.A.getState().mobilePipState===H.A.PIP_STATE.DEFAULT&&r.props.name&&window.location.href.toLowerCase().includes(r.props.name.toLowerCase())&&o.scrollTo(0,0)},l=T()((function(){return r.dispatchResize(window.innerWidth,window.innerHeight,!0)}),150),d=T()(i,150);l(),i(),window.addEventListener("hybridclientcamload",(function(){l(),i()}));var c=void 0,u=!1;window.addEventListener("touchstart",(function(e){var t;u=!0,c=null===(t=e.touches[0])||void 0===t?void 0:t.clientY})),window.addEventListener("touchend",(function(e){var t,s=null===(t=e.touches[0])||void 0===t?void 0:t.clientY;void 0!==c&&void 0!==s&&Math.abs(s-c)>10&&d(),c=void 0,u=!1})),window.addEventListener("scroll",(function(){u||d(),l()})),window.addEventListener("orientationchange",(function(){d(),l()}))}}}},{key:"addUserNicknameUpdateListeners",value:function(){"undefined"!=typeof window&&window.addEventListener("user_nickname_update",this.handleUserNicknameUpdate)}},{key:"handleUserNicknameUpdate",value:function(e){var t,s;if((null===(t=e.target)||void 0===t||null===(s=t.location)||void 0===s?void 0:s.origin)===window.location.origin){var n=e.detail.usernickname;n&&"string"==typeof n&&se.A.dispatch({type:B.A.UPDATE_USER_NICKNAME,data:{usernickname:n}})}}},{key:"setLogUrl",value:function(){var e=(0,$.Q8)();e&&(e=e.split("?")[0],Q.A.set("url",e))}},{key:"isBlackLabel",value:function(){return this.props.platform===X.Ay.BLACKLABEL}},{key:"componentDidUpdate",value:function(e){var t=this;if(this.setLogUrl(),this.props.hidePhotosTab===e.hidePhotosTab&&this.props.hideBioTab===e.hideBioTab&&this.props.hiddenFeatures===e.hiddenFeatures&&this.props.shownFeatures===e.shownFeatures||this.dispatchFeatureVisibility(this.props),this.props.name!==e.name||this.props.sakey!==e.sakey||this.props.sabasic!==e.sabasic){var s=this.props.sakey&&e.sakey!==this.props.sakey||this.props.sabasic&&e.sabasic!==this.props.sabasic;if(this.resetEverything({exceptTheConnection:s}),this.props.name){Q.A.startIfNotStarted(),this.checkInitialXments();var n=this.props,r=n.server,o=n.name,a=n.sabasic,i=n.sakey,l=n.platform,d=n.isExternalSiteFundsOnly,c=n.useDebugPerformerData,u=n.isGoldOnly,m=n.bypassRateThrottler4InternalIPs,p=n.stno,h=n.afno,A=new(L());setTimeout((function(){t.requestConfigData({server:r,performerName:o,sabasic:a,sakey:i,sk:window.location.host,platform:l,isExternalSiteFundsOnly:d,isGoldOnly:u,bypassRateThrottler:Boolean(A.get("brt")),bypassRateThrottler4InternalIPs:m,stno:p,afno:h}),t.requestV2SetupBioXment((function(e){t.requestBioData({server:r,performerName:o,sakey:i,platform:l,shownFeatures:t.shownFeatures,useDebugPerformerData:c,version:e?2:1})}))})),this.dispatchResize()}else se.A.dispatch({type:B.A.EXIT_FULLSCREEN})}this.props.platform!==e.platform&&ie.Ay.setPlatform(this.props.platform),this.props.lang!==e.lang&&(oe.Ay.setLanguage(this.props.lang),(0,ee.YC)(this.props.lang),se.A.dispatch({type:B.A.UPDATE_USER_PREFERRED_LANG,data:{lang:this.props.lang}})),this.props.usejwt!==e.usejwt&&(this.props.usejwt&&ae.A.enableJwtTokenForPrivCalls(),ae.A.disableJwtTokenForPrivCalls()),this.props.whitelabel&&this.props.whitelabel!==e.whitelabel&&(re.A.setSitedomain(this.props.whitelabel),ue.A.setDomain(this.props.whitelabel)),this.props.sakey||ie.Ay.getState().layout!==G.Ay.MOBILE||this.props.platform!==X.Ay.SCP||de.A.setUseCreateAccountCta(!0),this.props.layout!==e.layout&&(ie.Ay.forceLayout(this.props.layout),this.dispatchResize(null,null,!0)),this.props.name&&this.props.name!==e.name&&window.dispatchEvent(new Event("hybridclientcamload")),this.props.sakey!==e.sakey&&re.A.setSakey(this.props.sakey),document.__HC_IS_FULLSCREEN=this.state.fullscreen}},{key:"shouldComponentUpdate",value:function(e,t){return!I()(e,this.props)||!I()(t,this.state)}},{key:"componentWillUnmount",value:function(){this.resetEverything({exceptTheConnection:!0}),se.A.dispatch({type:B.A.BROWSER_CLOSE}),this.layoutToken.remove(),this.removeWindowListeners(),Q.A.usage("user_left",Date.now()),ne.A.mark("user_left"),ne.A.log(),Q.A.sendAndStop()}},{key:"resetEverything",value:function(e){var t=e.exceptTheConnection;se.A.dispatch({type:B.A.RESET,data:{exceptTheConnection:t}})}},{key:"initializeConfigStore",value:function(e){var t=e.config,s=e.limits,n=e.platform,r=e.performerSubscribers,o=e.disabledFeatures,a=e.enabledFeatures,i=e.decimalLocalGold,l=e.twoFactorAuthenticationRequired,d=e.twoFactorAuthenticationEmailRequestToken,c=e.connection,u=e.siteConfig,m=e.stno,p=e.afno;ne.A.mark("load_config_start");var h=t.site,A=h.primaryColor,f=h.logLevel;this.setState({primaryColor:this.getFinalPrimaryColor(A)}),Q.A.statsIncCounter("session.platform.".concat(n)),n===X.Ay.UNKNOWN&&Q.A.error({message:"platform-unknown",url:window.location.href}),t.performer.isAvailable&&this.requestGoldMenu(t.performer.id),this.requestComments(t.performer.id,t.user.id),!0===r.userIsSubscribed&&ce.A.requestSubscriptionDiscounts(t.rate.premium,t.rate.exclusive,t.performer.id,t.user.id,t.user.sakey),this.props.showFullLogs?(Q.A.setLogToConsole(!0),Q.A.setLogLevel(j.A.DEBUG)):Q.A.setLogLevel(f),t.user.id>0?(Q.A.set("userid",Number(t.user.id)),Q.A.statsIncCounter("session.loaded.user.loggedin")):Q.A.statsIncCounter("session.loaded.user.anon"),Q.A.set("performerid",Number(t.performer.id)),Q.A.usage("usertype",t.user.type),Q.A.usage("config_loaded",Date.now());if(0===t.user.id&&16===this.props.sakey.length&&Q.A.error({message:"verify-user no-user-from-config",userid:Number(t.user.id),propsSakey:this.props.sakey,configSakey:t.user.sakey,url:window.location.href}),t.user.id>0&&this.props.openPayModal&&(0,J.oI)(),l){var y=this.props.handleScpTwoFactorAuthentication;n===X.Ay.SCP&&y?y(d):(n===X.Ay.BLACKLABEL||X.Ay.FOUNDATION)&&setTimeout((function(){se.A.dispatch({type:B.A.OPEN_TWO_FACTOR_AUTHENTICATION_REQUIRED_MODAL})}))}var b=F()(window.navigator.userAgent),g=/\./gi,v=z.A.VERSION.replace(g,"_"),E=b.os.name,C=R()(b,"os.version","unknown").replace(g,"_"),w=b.browser.name,T=R()(b,"browser.major","unknown").replace(g,"_");Q.A.statsIncCounter("session.loaded.config.".concat(v)),Q.A.statsIncCounter("session.loaded.browser.".concat(w,".").concat(T)),Q.A.statsIncCounter("session.loaded.os.".concat(E,".").concat(C)),Q.A.statsIncCounter("platforms.".concat(de.A.getState().browserStatsBucket,".loaded")),se.A.dispatch({type:B.A.LOAD_CONFIG,data:{config:t,limits:s,platform:n,disabledFeatures:o,enabledFeatures:a,decimalLocalGold:i,twoFactorAuthenticationRequired:l,twoFactorAuthenticationEmailRequestToken:d,connection:c,siteConfig:u,os:E,osVersion:C,browser:w,browserVersion:T,stno:m,afno:p}}),ne.A.mark("load_config_end")}},{key:"getFinalPrimaryColor",value:function(e){return!this.props.primaryColor&&e&&this.state.primaryColor!==e?e:this.state.primaryColor}},{key:"requestGoldMenu",value:function(e){var t=re.A.getBaseUrl()+"/api/v2/goldmenu";re.A.get(t,{performerid:e},(function(e){e.body&&se.A.dispatch({type:B.A.PERFORMER_GOLD_MENU,data:e.body})}))}},{key:"requestComments",value:function(e,t){e&&((0,se.T)({type:B.A.REQUEST_COMMENTS,data:{performerId:e,pageSize:Oe.V,page:0,commentRequestType:Oe.l.ALL_COMMENTS}}),t>0&&(0,se.T)({type:B.A.REQUEST_COMMENTS,data:{performerId:e,pageSize:Oe.V,page:0,commentRequestType:Oe.l.MY_COMMENTS}}))}},{key:"requestVideoStartupXment",value:function(){ae.A.setInVideoStartupXment(!1)}},{key:"setLivelyLogger",value:function(){var e=fe.A.getState().livelyEndpoint;e&&fe.A.setLoggerGlobal(e)}},{key:"checkMobileChatXment",value:function(){var e=W.A.MOBILE_CHAT;ue.A.checkXment(e,(function(){}))}},{key:"checkTagsFedModXment",value:function(){var e=W.A.TAGS_FED_MOD;ue.A.checkXment(e,(function(){}))}},{key:"checkMemberCommentsFedModXment",value:function(){var e=W.A.MEMBERCOMMENTS_FED_MOD;ue.A.checkXment(e,(function(){}))}},{key:"checkChatJoinPromptDesktopXment",value:function(){var e=W.A.CHAT_PROMPT_JOIN_DESKTOP;ue.A.checkXment(e,(function(){}))}},{key:"checkChatJoinPromptMobileXment",value:function(){var e=W.A.CHAT_PROMPT_JOIN_MOBILE;ue.A.checkXment(e,(function(){}))}},{key:"checkImprovedCamPageFullscreenUIXment",value:function(){var e=W.A.IMPROVED_CAM_PAGE_FULLSCREEN_UI;ue.A.checkXment(e,(function(){}))}},{key:"checkCam2CamUIModernizationXment",value:function(){var e=W.A.CAM2CAM_UI_MODERNIZATION;ue.A.checkXment(e,(function(){}))}},{key:"requestV2SetupBioXment",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P();if("function"!=typeof e)throw new Error("callback must be a function");this.props.platform===X.Ay.SCP?ue.A.checkXment(W.A.V2_SETUPBIO,(function(t){return e(1===t)})):e(!1)}},{key:"setRequireAgeConfirmation",value:function(e){ae.A.setRequireAgeConfirmation(e),e&&ye.A.setBlurStream(e)}},{key:"setStreamBlurPenalty",value:function(e){ae.A.setStreamBlurPenalty(e),e&&ye.A.setBlurStream(e)}},{key:"_requestConfigData",value:function(e){var t,s=this,n=e.performerName,r=e.sabasic,o=e.sakey,a=e.sk,i=e.server,l=e.platform,c=e.isExternalSiteFundsOnly,u=e.isGoldOnly,m=e.bypassRateThrottler,p=e.bypassRateThrottler4InternalIPs,h=e.stno,A=e.afno;if(i&&n){se.A.dispatch({type:B.A.SET_PERFORMER_NICKNAME,data:n}),this.requestVideoStartupXment(),this.setLivelyLogger(),ne.A.mark("request_config"),null===(t=this.setupStreamRequest)||void 0===t||t.abort();var f=i+"/api/v2/setupstream/";this.setupStreamRequest=re.A.post(f,{performerName:n,version:z.A.VERSION,platform:l,sakey:o,sabasic:r,sk:a,clientUrl:(0,$.Q8)(),isExternalSiteFundsOnly:c,isGoldOnly:u,bypassRateThrottler:m,bypassRateThrottler4InternalIPs:p},"json",function(){var e=(0,d.A)(b().mark((function e(t){var n,r,a,i,d,c,u,m,p,f,y,g,v,E,C,w,T,S,_,I,O,P,k;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.setupStreamRequest=null,202!==t.status){e.next=7;break}return p=parseInt(null!==(m=t.headers["delay-time"])&&void 0!==m?m:"0",10),se.A.dispatch({type:B.A.SET_THROTTLE_TIME,data:p}),se.A.dispatch({type:B.A.DISCONNECT,data:[q.A.WAIT_TO_SET_UP_STREAM]}),e.next=7,new Promise((function(e){return setTimeout(e,p)}));case 7:if(f=t.body,y=f.config,g=f.user,v=f.blur,y&&g&&g.limits){e.next=13;break}return se.A.dispatch({type:B.A.DISCONNECT,data:[q.A.INVALID_STARTUP]}),Q.A.statsIncCounter("session.invalid.missingData"),e.abrupt("return");case 13:E=g.limits,C=null!==(n=f.browserStatsBucket)&&void 0!==n?n:"other",w=null!==(r=f.performerSubscribers)&&void 0!==r?r:{},T=null!==(a=g.disabledFeatures)&&void 0!==a?a:[],S=null!==(i=g.enabledFeatures)&&void 0!==i?i:[],_=null!==(d=g.decimalLocalGold)&&void 0!==d&&d,I=R()(g,"twoFactorAuthentication.required",!1),O=R()(g,"twoFactorAuthentication.emailRequestToken",""),P=null!==(c=f.connection)&&void 0!==c?c:{},k=null!==(u=f.siteConfig)&&void 0!==u?u:{},g.requiresAgeConfirmation?s.setRequireAgeConfirmation(!0):v?s.setStreamBlurPenalty(!0):!o||g.isNonBillableUser?s.props.requiresAgeConfirmation&&s.setRequireAgeConfirmation(!0):ye.A.setBlurStream(!1),se.A.dispatch({type:B.A.SET_STATS_BUCKET,data:C}),se.A.dispatch({type:B.A.SET_GEO_RESTRICTED,data:{geoRestricted:!1}}),g.forcedVideoStartupXment&&ae.A.setForcedVideoStartupXment(!0),s.initializeConfigStore({config:y,limits:E,platform:l,performerSubscribers:w,disabledFeatures:T,enabledFeatures:S,decimalLocalGold:_,twoFactorAuthenticationRequired:I,twoFactorAuthenticationEmailRequestToken:O,connection:P,siteConfig:k,stno:h,afno:A}),(0,$.Zj)(K.ve);case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),(function(e){var t=R()(e,"response.body.error",null);if(Q.A.statsIncCounter(t?"session.invalid.servererror_".concat(t):"session.invalid.networkerror"),t===x.A.FORCE_BILLING_INFO_UPDATE)return se.A.dispatch({type:B.A.FORCE_BILLING_INFO_UPDATE,data:{}}),void Q.A.send();t!==x.A.BLOCKED_BY_PERFORMER?(t===x.A.GEORESTRICTED&&((0,$.Zj)(U.A.INVALID_PERFORMER),se.A.dispatch({type:B.A.SET_GEO_RESTRICTED,data:{geoRestricted:!0}})),t===x.A.PLUS_ONE_CREATOR&&((0,$.Zj)(U.A.INVALID_PERFORMER),se.A.dispatch({type:B.A.DISCONNECT,data:[q.A.NEW_PERFORMER]})),t!==x.A.INVALID_HC_VERSION?t!==x.A.MAX_USERS_IN_ROOM?t!==x.A.TENANT_MISMATCH?se.A.dispatch({type:B.A.DISCONNECT,data:[t?q.A.INVALID_STARTUP:q.A.STARTUP_NETWORK_ERROR]}):(0,$.Zj)(U.A.INVALID_PERFORMER):se.A.dispatch({type:B.A.DISCONNECT,data:[q.A.ROOM_FULL]}):se.A.dispatch({type:B.A.DISCONNECT,data:[q.A.INVALID_HC_VERSION]})):se.A.dispatch({type:B.A.DISCONNECT,data:[q.A.BLOCKED]})}),[400])}else Q.A.error({message:"request-config-called-without-url-or-name",server:i,performerName:n,from:window.location.href,platform:l})}},{key:"_requestBioData",value:function(e){var t,s=this,n=e.performerName,r=e.sakey,o=e.server,a=e.platform,i=e.shownFeatures,d=e.useDebugPerformerData,c=e.version,u=void 0===c?1:c;if(o&&n){null===(t=this.setupBioRequest)||void 0===t||t.abort();var m=o+"/api/v".concat(u,"/setupbio/");this.setupBioRequest=re.A.post(m,{performerName:n,platform:a,sakey:r,shownFeatures:(0,l.A)(i),useDebugPerformerData:d},"json",(function(e){s.setupBioRequest=null;var t=[],n=e.body,r=n.performerDetails,o=n.performerPhotos,a=n.similarModels,i=n.country,l=n.performerSubscribers,d=n.spinGoldMenus,c=n.performerStreamingSchedule,m=n.features;1===u&&(t=e.body.bioPics),r||Q.A.statsIncCounter("session.degraded.missingData"),i&&se.A.dispatch({type:B.A.SET_USER_COUNTRY,data:{country:i}}),se.A.dispatch({type:B.A.PERFORMER_BIO_INFO,data:{bio:r,photos:o,similarModels:a,bioPics:t,spinGoldMenus:d,streamingSchedule:c,features:m}}),l&&se.A.dispatch({type:B.A.PERFORMER_SUBSCRIBERS_INFO,data:l})}),(function(e){var t=R()(e,"response.body.error",null);t!==x.A.TENANT_MISMATCH?Q.A.statsIncCounter(t?"session.degraded.servererror_".concat(t):"session.degraded.networkerror"):(0,$.Zj)(U.A.INVALID_PERFORMER)}),[400])}else Q.A.error({message:"request-config-called-without-url-or-name",server:o,performerName:n,from:window.location.href,platform:a})}},{key:"dispatchFeatureVisibility",value:function(e){var t=e.hiddenFeatures,s=e.shownFeatures,n=e.hidePhotosTab,r=e.hideBioTab,o=function(e){return e.trim().replace(/\s+/g,"_").replace(/([a-z])([A-Z])/g,"$1_$2").toUpperCase()},a=function(e){return new Set(e.map(o).filter((function(e){return V.Zi.has(e)})))};this.hiddenFeatures=Array.isArray(t)?a(t):new Set,n&&this.hiddenFeatures.add(V.Ay.PHOTOS_TAB),r&&this.hiddenFeatures.add(V.Ay.BIO_TAB),this.shownFeatures=Array.isArray(s)?a(s):new Set,se.A.dispatch({type:B.A.SET_FEATURE_VISIBILITY,data:{hiddenFeatures:this.hiddenFeatures,shownFeatures:this.shownFeatures}})}},{key:"render",value:function(){var e=this.props,t=e.theme,s=e.lang,o=this.state,l=o.primaryColor,d=o.layout,c=o.orientation,u=o.fullscreen,m=this.getLayoutRoot(d,c),p=this.getLayoutRootProps(this.props);return(0,i.A)(te.A,{language:s},void 0,n||(n=(0,i.A)(Re.A,{})),r||(r=(0,i.A)(_e.A,{})),v().createElement(Le,{fullscreen:u,ref:this.handleRootRef,direction:"he"===s?N.Direction.rtl:N.Direction.ltr},(0,i.A)(Ee.Ay,{onResize:this.dispatchResize,handleHeight:!0,handleWidth:!0,refreshMode:d!==G.Ay.DESKTOP?"debounce":void 0,refreshRate:250}),(0,i.A)(Se.A,{insertionPoint:this.jssInsertionPoint},void 0,(0,i.A)(D.ID,{target:document.head},void 0,(0,i.A)(Ce.A,{primaryColor:l,themeMode:t},void 0,v().createElement(m,(0,a.A)({},p,{key:0})),v().createElement(De,{ref:this.handleClientModalTargetRef,style:{zIndex:100},key:1}))))))}}]),s}(g.Component);(0,f.A)(Ne,"displayName","HybridClient"),Ne.childContextTypes={primaryColor:C().string,themeMode:C().string,smtid:C().string,smeid:C().string,smvid:C().string,quickTipBatchingPeriod:C().number,layout:C().oneOf([G.Ay.DESKTOP,G.Ay.TABLET,G.Ay.MOBILE]),orientation:C().oneOf([G.Ay.LANDSCAPE,G.Ay.PORTRAIT]),fullscreen:C().bool,isBlackLabel:C().bool,isExternalSiteFundsOnly:C().bool,window:C().any,document:C().any,videoContainerElement:C().instanceOf(Element).isRequired,pipContainerElement:C().instanceOf(Element).isRequired,getClientModalTargetElement:C().func.isRequired,platform:C().oneOf(Object.values(X.Ay)),direction:C().string},Ne.defaultProps={lang:"en",primaryColor:"",sabasic:"",sakey:"",source:"",userid:0,server:"https://hybridclient.naiadsystems.com",memberServer:"https://member.naiadsystems.com",assetPath:"https://hybridclient.naiadsystems.com/static/vendor/aiw",fastManifestUrlTemplate:"https://manifest-server.naiadsystems.com/live/s:{performerName}.json",tdsName:"",messengerEnabled:!1,openPayModal:!1,mobileCam2Cam:!0,xmentOverride:z.A.PROP_XMENT,enablePrivCalls:!0,vibeShow:!1,usejwt:!0,whitelabel:"",theme:"dark",hidePhotosTab:!1,hideBioTab:!1,urls:null,platform:z.A.PROP_PLATFORM||X.Ay.UNKNOWN,hiddenFeatures:[],shownFeatures:[],sections:null,performerBioTabs:null,isGoldOnly:!1,handleScpTwoFactorAuthentication:function(){},rewards:null,exclusiveSessionPriceItemId:null,livelyEndpoint:"icf-prod-global.generflow.com",requiresAgeConfirmation:!1,payPalConfig:{},sessionLengthForPostPaidModal:-1,useDebugPerformerData:!1,enableDebugHooks:!1,notificationsGatewayCaller:{},performerbioGatewayCaller:{},xsrfHeader:{},handleGoToLogin:function(){},handleClearHybridClient:function(){},breakpoint:"",domain:""},Ne.propTypes={lang:C().string,primaryColor:C().string,sabasic:C().string,sakey:C().string,source:C().string,server:C().string,memberServer:C().string,name:C().string,userid:C().number,showFullLogs:C().bool,assetPath:C().string,fastManifestUrlTemplate:C().string,manifestUrl:C().string,layout:C().string,liveServicesHost:C().string,tdsName:C().string,messengerEnabled:C().bool,openPayModal:C().bool,mobileCam2Cam:C().bool,xmentOverride:C().string,enablePrivCalls:C().bool,wrapperIframe:C().instanceOf(Element),vibeShow:C().bool,usejwt:C().bool,whitelabel:C().string,theme:C().string,hidePhotosTab:C().bool,hideBioTab:C().bool,urls:C().object,platform:C().oneOf(Object.values(X.Ay)),isExternalSiteFundsOnly:C().bool,essUsername:C().string,hiddenFeatures:C().arrayOf(C().string),shownFeatures:C().arrayOf(C().string),sections:C().object,performerBioTabs:C().arrayOf(C().shape({name:C().string,titleStringKey:C().string,render:C().func})),performerBioTabOrder:C().arrayOf(C().string),isGoldOnly:C().bool,handleScpTwoFactorAuthentication:C().func,exclusiveSessionPriceItemId:C().number,livelyEndpoint:C().string,requiresAgeConfirmation:C().bool,quickTipBatchingPeriod:C().number,sessionLengthForPostPaidModal:C().number,useDebugPerformerData:C().bool,enableDebugHooks:C().bool,bypassRateThrottler4InternalIPs:C().bool,federatedModules:C().object,notificationsGatewayCaller:C().object,performerbioGatewayCaller:C().object,xsrfHeader:C().string,handleGoToLogin:C().func,handleClearHybridClient:C().func,breakpoint:C().string,stno:C().string,afno:C().string,xment:C().object,domain:C().string,payPalConfig:C().object};const Me=(0,Ie.A)(Ne,"hybrid_client");var Fe=Ne,Be=["showFullLogs","messengerEnabled","openPayModal","mobileCam2Cam","enablePrivCalls","vibeShow","usejwt","hidePhotosTab","hideBioTab","isExternalSiteFundsOnly","useDebugPerformerData","enableDebugHooks","isGoldOnly","requiresAgeConfirmation","bypassRateThrottler4InternalIPs"],je=["userid","quickTipBatchingPeriod","sessionLengthForPostPaidModal","exclusiveSessionPriceItemId"];if(z.A.DEBUG){var Ue=new Set(Object.keys(Ne.propTypes)),xe=Be.filter((function(e){return!Ue.has(e)})),qe=je.filter((function(e){return!Ue.has(e)})),Ge=Object.entries(Ne.propTypes).filter((function(e){var t=(0,o.A)(e,2),s=t[0];return t[1]===C().bool&&!Be.includes(s)})),Xe=Object.entries(Ne.propTypes).filter((function(e){var t=(0,o.A)(e,2),s=t[0];return t[1]===C().number&&!je.includes(s)}));if(xe.length)throw new Error("booleanProps items not in HybridClient props: ".concat(xe.join(", ")));if(qe.length)throw new Error("numberProps items not in HybridClient props: ".concat(qe.join(", ")));if(Ge.length)throw new Error("HybridClient props missing from booleanProps: ".concat(Ge.join(", ")));if(Xe.length)throw new Error("HybridClient props missing from numberProps: ".concat(Xe.join(", ")))}}}]); //# sourceMappingURL=https://hybridclient.naiadsystems.com/dist/hybrid/27.5.9/16~fdf2c3f97e87c5086dc8.js.map