"use strict";(self.webpackChunkbongacams=self.webpackChunkbongacams||[]).push([[690],{8639:function(e,t,n){n.d(t,{E8:function(){return a},Ji:function(){return o},yF:function(){return i},zp:function(){return s}});n(74848);var i={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},s="adjltid";function a(e){var t=e.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/);return!(!t||11!==t[7].length)&&t[7]}function o(e){var t;return e=Math.round(e),Math.floor(e/60)+":"+((t=e%60)<10?"0".concat(t):"".concat(t))}},58236:function(e,t,n){n.d(t,{u:function(){return s}});var i=n(96540),s=function(e){var t=(0,i.useRef)(e);t.current=e,(0,i.useLayoutEffect)(function(){"function"==typeof t.current&&t.current()},[])}},2584:function(e,t,n){n.d(t,{E:function(){return i}});var i="500"},10680:function(e,t,n){n.d(t,{Y:function(){return o}});var i=n(45070),s=n(21110),a=n(2584),o=function(e){return s.q.isEnabled(i.i.TIP_AMOUNT_BUY_TOKENS_CUSTOM_FIELD)?{customAmount:Math.max(e,Number(a.E))}:{}}},69623:function(e,t,n){var i=n(15215),s=n(96540),a=n(8639),o=function(e){function t(t){var n=e.call(this,t)||this;return n.handleInput=function(e){var t=e.target.value;n.setState({input:t,valid:!!(0,a.E8)(t)})},n.togglePremium=function(){n.setState({isPremium:!n.state.isPremium})},n.state={isPremium:!1,input:"",valid:!1},n}return(0,i.C6)(t,e),t.prototype.handleSubmit=function(e){var t=this.props,n=t.description,i=t.onHit;e.preventDefault();var s=(0,a.E8)(this.state.input);s&&(this.setState({input:"",valid:!1}),i(n.id,{url:s,is_premium:this.state.isPremium?1:0}))},t}(s.Component);t.A=o},18071:function(e,t,n){n.d(t,{cl:function(){return c},hI:function(){return d}});var i=n(15215),s=n(74848),a=n(96540),o=n(80742),r=n(72983),u=n(89979),l=n(83375);function c(){return(0,s.jsxs)("div",{className:(0,l.n)({cg_adj_icon_play:!0,__rtl:r.isRTLCulture}),children:[(0,s.jsx)("div",{className:"ip_bar __1"}),(0,s.jsx)("div",{className:"ip_bar __2"}),(0,s.jsx)("div",{className:"ip_bar __3"}),(0,s.jsx)("div",{className:"ip_bar __4"})]})}function d(){return(0,s.jsx)("div",{className:(0,l.n)({cg_adj_icon_premium:!0,__rtl:r.isRTLCulture}),children:(0,s.jsx)(u.A,{group:"ip_icon",icon:"#icon_auto_dj_priority"})})}var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={currentTime:0},t.updateCurrentTime=function(e){var n=t.props,i=n.data,s=i.lastOffsetMs,a=i.lastActionTS,r=n.settings,u=r.playing,l=r.playlist;if(l.length){var c=function(e){return(0,o.clamp)(Math.round((e||0)/1e3),0,l[0].duration)};u&&l.length?t.setState({currentTime:c(Date.now()-a+s)}):e&&t.setState({currentTime:c(s)})}},t}return(0,i.C6)(t,e),t.prototype.componentDidMount=function(){this.timer=window.setInterval(this.updateCurrentTime,1e3),this.updateCurrentTime(!0)},t.prototype.componentWillUnmount=function(){clearInterval(this.timer)},t}(a.Component);t.Ay=p},97619:function(e,t,n){n.d(t,{A:function(){return E}});var i=n(15215),s=n(74848),a=n(40961),o=n(99525),r=n(40172),u=n(35321),l=n(45070),c=n(21110),d=function(){c.q.isEnabled(l.i.TIP_MENU_ENABLED_NOTICE)&&n.e(709).then(n.bind(n,76803)).then(function(e){e.TipMenuEnabledNoticeController.instance.init()}),c.q.isEnabled(l.i.TIP_MENU_AUTO_MESSAGE_CLICKABLE)&&n.e(700).then(n.bind(n,20377)).then(function(e){e.TipMenuServiceMessageController.instance.init()})},p=n(15597),h=n(47303),m=n(41669),g=n(52804),f=n(89348),v=n(73645),b=n(62340),S=n(83910),y=n(62779),_=n(90093),T=n(42914);var C=n(37828),M=n(99128),A=n(46955),D=n(57510),k=n(8556),w=n(41669),E=function(){function e(){var e=this;this.getIsGameDisabled=function(t){return(0,_.R)(t,e.prevState.gamesSettings,e.prevState.gamesData)},this.buildGameData=function(e){var t=C.A.getState(),n=(0,i.Cl)((0,i.Cl)({},t.gamesSettings),{lovenseVibeWithMe:t.lovenseVibeWithMe.gameData}),s=(null!=e?e:b.Fp).reduce(function(e,s){var a,o,r;return{data:(0,i.Cl)((0,i.Cl)({},e.data),(a={},a[s.id]=t.gamesData[s.storeKey],a)),isEnabledGames:e.isEnabledGames||!s.isStealthy&&(!s.performerStatuses||(null===(r=s.performerStatuses)||void 0===r?void 0:r.includes(t.performerStatus)))&&s.isShow(s,n[s.storeKey],t.gamesData[s.storeKey]),settings:(0,i.Cl)((0,i.Cl)({},e.settings),(o={},o[s.id]=n[s.storeKey],o))}},{data:{},isEnabledGames:!1,settings:{}});return{data:s.data,isEnabledGames:s.isEnabledGames,settings:s.settings}},this.toggleGamesVisibleMobile=function(){w.mobile&&n.e(696).then(n.bind(n,34232)).then(function(t){var n=t.gamesList,i=e.buildGameData(n).isEnabledGames;chat.toggleGamesTabVisibility&&chat.toggleGamesTabVisibility(i)})},this.timers={},this.handleConfirmBuyTokens=function(){w.mobile?function(e){var t=e.text,n=void 0===t?"":t,i=e.acceptText,s=void 0===i?__("OK"):i,a=e.cancelText,o=void 0===a?__("Cancel"):a,r=e.accept,u=void 0===r?function(){}:r,l=document.createElement("div");l.classList.add("bc_confirmer","bc_flex","bc_flex_full_center");var c='\n
\n

'.concat(n,'

\n
\n \n \n
\n
\n ");l.innerHTML=c.trim(),document.body.append(l);var d=document.querySelector(".js-bcc_alert"),p=d.querySelector(".js_btn_confirm"),h=d.querySelector(".js_btn_decline"),m=function(){g(),u()};function g(){p.removeEventListener("click",m),h.removeEventListener("click",g),document.querySelector(".bc_confirmer").remove()}p.addEventListener("click",m),h.addEventListener("click",g)}({accept:function(){return chat.buyTokensPopup()},acceptText:__("Buy Tokens!"),text:__("Insufficient funds"),cancelText:__("Close")}):chat.buyTokensPopup()},this.handleHit=function(t,n){var r=e.gamesById[t];e.checkHitAvailability(t,n)?(0,a.flushSync)(function(){if(["auto-dj","vibe-with-me"].includes(t)||(0,v.blockHitButtons)(),!o.A.getState().isMobile&&["roll-dice","spin-wheel","token-keno"].includes(t)){var a=C.A.getState().gamesSettings[e.gamesById[t].storeKey];e.setSettings(t,(0,i.Cl)((0,i.Cl)({},a),{isActiveNow:!0}))}r.hitAction(r,n,function(t){(0,v.unblockHitButtons)(),(0,v.openPopup)((0,s.jsx)(e.AlertPopup,{content:t}),{title:__("Error")})})}):w.mobile?(0,v.closeGame)():(0,v.setGameTab)(null)},C.A.subscribe(function(t){e.prevState||(e.prevState=t);var n=e.buildGameData(),a=n.data,o=n.settings,r=b.Xq["token-keno"].storeKey,u=w("#bChat .js-token-keno-promo-container");if(o["token-keno"]&&o["token-keno"].enabled){if(u.length){var l=e.gamesById["token-keno"].promoComponent,c=M.w.renderToString((0,s.jsx)(l,{data:a["token-keno"],description:e.gamesById["token-keno"],isRu:t.isRu,settings:o["token-keno"]}));u.replaceWith(c)}}else e.prevState.gamesSettings&&e.prevState.gamesSettings[r]&&e.prevState.gamesSettings[r].enabled&&(u.replaceWith(""),w("#bChat .js-token-keno-hit-container .cg_msg_actions").hide());e.checkLovenseVibeWithMePromo(e.prevState,t),(0,A.b)(e.prevState.hitResult,t.hitResult)||e.handleHitResultChange(t,e.prevState),e.prevState.pendingHitResult===t.pendingHitResult&&e.prevState.gamesData[r].waitingSettings===t.gamesData[r].waitingSettings||w("#bChat .js-game-control").each(function(n,i){var s=w(i);if("token-keno"===s.data("id")){var a=t.pendingHitResult||t.gamesData[r].waitingSettings;s.prop("disabled",a).toggleClass("mls_btn_disabled",a)}else e.prevState.pendingHitResult!==t.pendingHitResult&&s.prop("disabled",t.pendingHitResult).toggleClass("mls_btn_disabled",t.pendingHitResult)}),e.onStoreChange(e.prevState,t),e.prevState=(0,i.Cl)({},t)})}return e.prototype.updateTipMenuMessageButton=function(e,t){var n,i;void 0===t&&(t=this.prevState.performerStatus),(null===(i=(0,S.f6)(null!==(n=e.items)&&void 0!==n?n:[]))||void 0===i?void 0:i.length)&&"public"===t&&e.enabled?w(".history .js-tip_msg_menu_btn").removeClass("bc_hide"):w(".history .js-tip_msg_menu_btn").addClass("bc_hide")},e.prototype.startPromoTimer=function(e,t){var n=this;this.stopPromoTimer(e),this.gamesById[e].promoComponent&&!this.isModerator&&(this.timers[e]=setInterval(function(){n.renderPromo(e)},Math.min(2147483647,1e3*t)))},e.prototype.stopPromoTimer=function(e){this.timers[e]&&(clearInterval(this.timers[e]),delete this.timers[e])},e.prototype.renderPromo=function(e,t){if(void 0===t&&(t=h.B.NOTIFICATION),!this.isModerator){var n=this.gamesById[e].promoComponent,i=C.A.getState();if("vibe-with-me"!==e){if("public"===i.performerStatus){var a=i.gamesSettings[this.gamesById[e].storeKey],o=i.gamesData[this.gamesById[e].storeKey],r=M.w.renderToString((0,s.jsx)(n,{data:o,description:this.gamesById[e],isRu:i.isRu,settings:a}));chat.addMessage(r,this.$history)}}else chat.addMessage(M.w.renderToString((0,s.jsx)(n,{lovenseVibeWithMe:i.lovenseVibeWithMe,type:t})),this.$history)}},e.prototype.checkHitAvailability=function(e,t){var n=C.A.getState(),i=n.gamesSettings[this.gamesById[e].storeKey],s=n.gamesData[this.gamesById[e].storeKey];return"vibe-with-me"===e?(0,T.w)():chat.userData.isLogged?"member"!==chat.userData.role?(this.openChat(),chat.addServiceMessage(__("Only members can play the games"),"alert",chat.currentChatType),!1):chat.userData.balance?i.enabled?"roll-dice"===e&&("d1"===s.type&&!i.d1_enabled||"d2"===s.type&&!i.d2_enabled)?(this.openChat(),chat.addServiceMessage(__("Game disabled"),"alert",chat.currentChatType),!1):"public"!==chat.performerStatus?(this.openChat(),chat.addServiceMessage(__("Games are available in public chat only"),"alert",chat.currentChatType),!1):!("auto-dj"===e&&chat.userData.balance<(t.is_premium?i.amountPremium:i.amount))||(this.handleConfirmBuyTokens(),!1):(this.openChat(),chat.addServiceMessage(__("Game disabled"),"alert",chat.currentChatType),!1):(this.handleConfirmBuyTokens(),!1):(chat.signupPopup(),!1)},e.prototype.isDefaultMessage=function(e){return e.includes("%username% wants to play ")},e.prototype.setSettings=function(e,t){(0,v.setGameSettings)(e,t);var n=b.Xq[e];if(n){y.A.instance.stackSettings(window.chat.performerData.username,e,C.A.getState().gamesSettings[n.storeKey]),t&&t.enabled&&t.promo_interval?this.startPromoTimer(e,t.promo_interval):this.stopPromoTimer(e);var i=n.sounds;if(t&&t.enabled&&i&&"object"==typeof i){var s=[];(0,D.loopv)(i,function(e,t){s.push({name:e,volume:1})}),u.A.instance.add(s,"games")}this.toggleGamesVisibleMobile()}},e.prototype.setRollTheDiceSettings=function(e){var t='%username% wants to play "Dice" with you!',n=window.chat.performerData?window.chat.performerData.displayName:"";e.message=this.isDefaultMessage(e.message)?__(t,{username:n}):e.message,e.message_ru=this.isDefaultMessage(e.message_ru)?__(t,{username:n}):e.message_ru,this.setSettings("roll-dice",e),e.enabled&&(!e.d1_enabled&&e.d2_enabled?(0,v.setRollTheDiceType)("d2"):e.d1_enabled&&!e.d2_enabled&&(0,v.setRollTheDiceType)("d1"))},e.prototype.setSpinTheWheelSettings=function(e){var t='%username% wants to play "Wheel of Fortune" with you!',n=window.chat.performerData?window.chat.performerData.displayName:"";e.message=this.isDefaultMessage(e.message)?__(t,{username:n}):e.message,e.message_ru=this.isDefaultMessage(e.message_ru)?__(t,{username:n}):e.message_ru,this.setSettings("spin-wheel",e)},e.prototype.setTokenKenoSettings=function(e){var t='%username% wants to play "Bingo" with you!',n=window.chat.performerData?window.chat.performerData.displayName:"";e.message=this.isDefaultMessage(e.message)?__(t,{username:n}):e.message,e.message_ru=this.isDefaultMessage(e.message_ru)?__(t,{username:n}):e.message_ru,this.setSettings("token-keno",e),(0,v.setTokenKenoSuggestingAmount)()},e.prototype.setSlotMachineSettings=function(e){var t='%username% wants to play "Slot Machine" with you!',n=window.chat.performerData?window.chat.performerData.displayName:"";e.message=this.isDefaultMessage(e.message)?__(t,{username:n}):e.message,e.message_ru=this.isDefaultMessage(e.message_ru)?__(t,{username:n}):e.message_ru,this.setSettings("slot-machine",e),e.no_lose&&(0,v.setSlotMachineRate)()},e.prototype.setTipMenuSettings=function(e){this.setSettings("tip-menu",e),this.updateTipMenuMessageButton(e)},e.prototype.setAutoDJSettings=function(e){(0,v.setAutoDJSettings)({amount:e.amount,amountPremium:e.amountPremium,enabled:e.isEnable,max_length:e.max_length})},e.prototype.setAutoDJTracks=function(e){(0,v.setAutoDJTracks)(e),e&&e.length&&(0,v.setAutoDJPlaying)(!!e[0].isPlaying)},e.prototype.openTipMenuPopup=function(e){this.setTipMenuPopupOpenSource(e),this.openGameTab("tip-menu")},e.prototype.setChatBotsData=function(e){var t,n;this.setTipMenuLatestHashes(null!==(t=e.tipMenuLatestHashes)&&void 0!==t?t:[]),this.setLastTipMenuOrder(null!==(n=e.lastTipMenuOrderHash)&&void 0!==n?n:null)},e.prototype.setLastTipMenuOrder=function(e){(0,v.setLastTipMenuOrder)(e),c.q.isEnabled(l.i.TIP_MENU_MOBILE_GAME)&&this.toggleGamesVisibleMobile()},e.prototype.setTipMenuLatestHashes=function(e){c.q.isEnabled(l.i.TIP_MENU_SORT_BY_PURCHASES)&&(0,v.setTipMenuLatestHashes)(e)},e.prototype.setTipMenuPopupOpenSource=function(e){(0,v.setTipMenuPopupOpenSource)(e)},e.prototype.addAutoDJTrack=function(e,t){var n="auto-dj";(0,v.addAutoDJTrack)(e,t);var i=C.A.getState().gamesSettings[this.gamesById["auto-dj"].storeKey],a=this.gamesById[n].hitComponent,o=M.w.renderToString((0,s.jsx)(a,{description:this.gamesById[n],track:t,settings:i}));chat.addMessage(o,this.$history)},e.prototype.setAutoDJPlaying=function(e){(0,v.setAutoDJPlaying)(e)},e.prototype.skipAutoDJTrack=function(e){(0,v.skipAutoDJTrack)(e)},e.prototype.checkLovenseVibeWithMePromo=function(e,t){var n,i,s,a,o,r,u,l,c,d,m,g,f,v=e.lovenseVibeWithMe,b=t.lovenseVibeWithMe,S=this.gamesById["vibe-with-me"];!(null===(n=v.gameData)||void 0===n?void 0:n.enable)&&(null===(i=b.gameData)||void 0===i?void 0:i.enable)?(null===(s=b.customerData)||void 0===s?void 0:s.status)!==p.Q.JOIN&&this.startPromoTimer("vibe-with-me",S.promoInterval):(null===(a=v.gameData)||void 0===a?void 0:a.enable)&&!(null===(o=b.gameData)||void 0===o?void 0:o.enable)?this.stopPromoTimer("vibe-with-me"):(null===(r=v.customerData)||void 0===r?void 0:r.status)!==(null===(u=b.customerData)||void 0===u?void 0:u.status)&&(null===(l=b.customerData)||void 0===l?void 0:l.status)===p.Q.JOIN?(this.renderPromo("vibe-with-me",h.B.CONNECT),this.stopPromoTimer("vibe-with-me")):(null===(c=v.customerData)||void 0===c?void 0:c.status)!==(null===(d=b.customerData)||void 0===d?void 0:d.status)&&(null===(m=v.customerData)||void 0===m?void 0:m.status)===p.Q.JOIN?(this.renderPromo("vibe-with-me",h.B.DISCONNECT),this.startPromoTimer("vibe-with-me",S.promoInterval)):(null===(g=v.customerData)||void 0===g?void 0:g.status)===p.Q.NO_REWARD&&(null===(f=b.customerData)||void 0===f?void 0:f.status)===p.Q.REWARD&&(this.stopPromoTimer("vibe-with-me"),this.renderPromo("vibe-with-me",h.B.REWARD))},e.prototype.addChatGameHitMessage=function(e){if("ServerMessageEvent:UPDATE_TRACK_LIST"===e.type){var t=e.body,n=(t.in,t.ti),i=this.gamesById["auto-dj"].hitComponent,a=M.w.renderToString((0,s.jsx)(i,{description:this.gamesById["auto-dj"],track:n}));chat.addMessage(a,this.$history)}else try{this.addChatHitMessage(e.body)}catch(e){console.warn(e)}},e.prototype.addChatHitMessage=function(e,t){var n=this;void 0===t&&(t={});var a=e.game.type,o=this.gamesById[a];if(o){var r=t.justAdded?function(e){var t=e.find(".js-cb-game-msg");t.addClass("__just_added"),t.find("video:hidden").each(function(e,t){t.play()}),setTimeout(function(){t.removeClass("__just_added")},2e3)}:null;chat.addDeferredMessage((0,i.sH)(n,void 0,void 0,function(){var n,r,u,l;return(0,i.YH)(this,function(i){switch(i.label){case 0:return n=C.A.getState(),[4,y.A.instance.getSettings(window.chat.performerData.username,a,e.game.sv,C.A.getState().gamesSettings[o.storeKey])];case 1:return r=i.sent(),u=n.gamesData[o.storeKey],l=o.hitComponent,[2,M.w.renderToString((0,s.jsx)(l,{data:u,description:o,eventData:e,justAdded:t.justAdded,sameMember:e.game.un===chat.userData.username,settings:r,isModerator:this.isModerator,isRu:n.isRu})).replace(/