"use strict";(self.webpackChunkbongacams=self.webpackChunkbongacams||[]).push([[97],{21355:function(t,n,e){e.d(n,{Mn:function(){return f},So:function(){return u},cQ:function(){return h},ku:function(){return l}});var i=e(2268),s=e(19826),o=e(41669),a={};function r(t,n,e){var i=t.find(".js-fw_hint"),s=e&&i.data("hint_extra")||i.data("hint".concat(n||e?"_active":""));i.html(s),t.toggleClass("__active",n),t.toggleClass("__extra",e),t.addClass("__anim_click"),t.addClass("__no_hint"),t.one("transitionend WebkitTransitionEnd",(function(){return t.removeClass("__anim_click")})),t.off("mouseleave.noHintAfterClick").one("mouseleave.noHintAfterClick",(function(){return t.removeClass("__no_hint")}))}function c(t,n){void 0===n&&(n=!1);var e=t.closest(".js-fw_wrap_mp");e.addClass("__anim_click"),e.addClass("__no_hint"),e.parent().one("transitionend WebkitTransitionEnd",(function(){return e.removeClass("__anim_click")})),e.off("mouseleave.noHintAfterClick").one("mouseleave.noHintAfterClick",(function(){return e.removeClass("__no_hint")})),clearTimeout(a[n?"mp_nb":"mp_fw"]),a[n?"mp_nb":"mp_fw"]=window.setTimeout((function(){return e.removeClass("__no_hint")}),2e3)}var u=function(t,n,e,s){if(void 0===e&&(e=!1),void 0===s&&(s=!1),o(".js-flw_follow").toggleClass("__hidden",s||t),o(".js-flw_followed").toggleClass("__hidden",s||!t),o(".js-flw_unrequested").toggleClass("__hidden",!s),n.hasClass("__disabled")?n.remove():(r(n,t,s),clearTimeout(a.fw),a.fw=window.setTimeout((function(){return n.removeClass("__no_hint")}),2e3)),e){var c=o(".js-flwr_cnt"),u=+c.data("count")+(t?1:-1);c.data("count",u),c.html("".concat(u," ").concat(i.kX.pluralise("followers",u)))}t||l(n.closest(".js-follow_wrp").find(".js-ntf_btn"),t)},l=function(t,n){if(s.A.getState().isAuthenticated&&n){var e=t.closest(".js-follow_wrp").find(".js-fw_btn");u(!0,e)}r(t,n,!1),clearTimeout(a.nb),a.nb=window.setTimeout((function(){return t.removeClass("__no_hint")}),2e3)},f=function(t,n){var e=t.siblings(".js-flw_mp_btn.__notify"),i=t.hasClass("mp_notify")?[t,e]:[e,t],s=i[0],a=i[1];if(c(t,!0),n){s.hide(),a.show();var r=o(".js-flw_mp_btn.__follow:visible");t.hasClass("mp_notify")&&!r.hasClass("mp_is_following")&&h(r)}else s.show(),a.hide()},h=function(t){(c(t),t.hasClass("__disabled"))?t.closest(".js-fw_wrap_mp").remove():(t.hide(),t.siblings(".js-flw_mp_btn").show());var n=o(".js-flw_mp_btn.__notify:visible");t.hasClass("mp_is_following")&&n.hasClass("mp_is_notified")&&f(n,!1)}},9923:function(t,n,e){e.r(n),e.d(n,{NotificationWidget:function(){return A},init:function(){return y}});var i=e(15215),s=e(54022),o=e(63065),a=e(4645),r=e(13907),c=e(19826),u=e(9988),l=e(62614),f=e(50172),h=e(26580),b=e(22847),d=e(53336),_=function(t){var n=t.displayName,e=t.avatarUrl;return(0,f.h)("div",{className:"bc_online_notification bc_flex"},(0,f.h)("div",{className:"ont_item __icon"},(0,f.h)("img",{className:"ont_avatar",src:e,alt:""})),(0,f.h)("div",{className:"ont_item __info bc_flex bc_flex_column bc_flex_justify_s_between"},(0,f.h)(b.E,{tagName:"div",className:"ont_i_block bc_flex",html:__("%badge% %display_name% is online now!",{badge:'live',display_name:''+n+""})}),(0,f.h)("div",{className:"ont_i_block bc_flex bc_flex_items_center"},(0,f.h)("div",{className:"ont_i_inner"},__("Visit chat room")),(0,f.h)(h.A,{group:"ont_arrow",icon:"#svg_icon_arrow_right",url:d.ed}))))},p=e(1579),v=e(63410),m=e(67374),g=e(83714),w=e(21355),k=e(7715),N=e(41669),A=function(){function t(){var t=this;this.handleChangeOnlineNotification=function(n){var e=n.onlineNotifications;e&&e.length&&(e.map(t.showNotification),(0,v.V7)())},this.handleChangeNotificationSettings=function(t,n){var e=(0,k.d)().username;if(e){var i=n.onlineNotificationSettings[e],s=t.onlineNotificationSettings[e];if(void 0===i&&void 0!==s||i!==s){var o=N(".js-ntf_btn");o.length&&(0,w.ku)(o,s);var a=N(".js-flw_mp_btn.__notify").filter(":visible");a.length&&(0,w.Mn)(a,s)}}},this.showNotification=function(t){var n=t.username,i=t.displayName,s=t.avatarUrl;e.e(151).then(e.bind(e,34897)).then((function(t){new t.default({className:"bc_online_notification_wrp",html:l.w.renderToString(_({displayName:i,avatarUrl:s})),close:l.w.renderToString((0,f.h)("div",{className:"ont_close_wrp"},(0,f.h)(h.A,{group:"ont_close",icon:"#svg_icon_empty_close",url:d.ed}))),onClick:function(){location.href="/"+n}},5e3)}))},this.handleNotificationMessage=function(n){return(0,i.sH)(t,void 0,void 0,(function(){var t,e;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return(t=(null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.type)!==g.A.ONLINE_NOTIFICATION||!n.data.username)?[3,2]:[4,m.I_.getInstance().checkAndSaveAllowing(n.data.username)];case 1:t=!i.sent(),i.label=2;case 2:return t||[(0,r.ip)("@member_buy_tokens"),(0,r.ip)("@member_buy_vip"),(0,r.ip)("@member_buy_invisibility")].includes(location.pathname)||this.showNotification({username:n.data.username,displayName:n.data.displayName,avatarUrl:n.data.icon}),[2]}}))}))}}return t.checkSubscription=function(n){return(0,i.sH)(this,void 0,void 0,(function(){var e,s,u,l,f,h;return(0,i.YH)(this,(function(i){switch(i.label){case 0:if(!t.pushNotificationInstance)return t.instantCheckSubscriptionFor.push(n),[2];if(e=c.A.getState().isAuthenticated,s=t.pushNotificationInstance.getToken(),u=!1,e||!t.pushNotificationInstance.isAvailable()||!s)return[2];l=(0,o.o)(n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,new Promise((function(t,n){N.ajax({url:(0,r.ip)("@is_subscribed_on_online_push_notification?username=".concat(l)),type:"POST",dataType:"json",data:(0,a.Z)({hash:s}),success:function(e){e&&e.success||n(),u=Boolean(e.is_subscribed),t()},error:n})}))];case 2:return i.sent(),[3,4];case 3:return i.sent(),[3,4];case 4:return f=N('.js-ntf_btn[data-username="'.concat(l,'"]')),(0,w.ku)(f,u),h=N('#profile-part[data-id="'.concat(n,'"]')).find(".js-flw_mp_btn.mp_notify"),(0,w.Mn)(h,u),[2]}}))}))},t.handleNotificationBtnClick=function(t,n){return(0,i.sH)(this,void 0,void 0,(function(){var e,a,u=this;return(0,i.YH)(this,(function(l){return e=c.A.getState().isAuthenticated,a=(0,o.o)(t),[2,new Promise((function(t,o){return(0,i.sH)(u,void 0,void 0,(function(){var u,l,f,h,b,d,_;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return"",e?(u=n?(0,r.ip)("@api_follower_unsubscribe_from_online_ws_notifications"):(0,r.ip)("@api_follower_subscribe_on_online_ws_notifications"),[4,(0,s.gQ)(u,{method:"POST",body:JSON.stringify({username:a})})]):[3,2];case 1:return l=i.sent(),f=l.errors,h=l.data,f&&o(),b=null===(_=null===(d=null===window||void 0===window?void 0:window.chat)||void 0===d?void 0:d.performerData)||void 0===_?void 0:_.username,e&&b&&c.A.action(v.U_)({username:b,isSubscribed:!n}),[2,t(h)];case 2:o("signup"),i.label=3;case 3:return[2]}}))}))}))]}))}))},t.prototype.init=function(){return(0,i.sH)(this,void 0,void 0,(function(){var n,e,s;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return p.c.on("onlineNotifications",this.handleChangeOnlineNotification),p.c.on("onlineNotificationSettings",this.handleChangeNotificationSettings),n=t,[4,u.k.getInstance()];case 1:return n.pushNotificationInstance=i.sent(),t.pushNotificationInstance.onMessage(this.handleNotificationMessage),(e=N(".js-ntf_btn")).length&&t.instantCheckSubscriptionFor.push(e.data("username")),s=[],t.instantCheckSubscriptionFor.map((function(n){n&&s.push(t.checkSubscription(n))})),t.instantCheckSubscriptionFor=[],[4,Promise.all(s)];case 2:return i.sent(),[4,m.I_.getInstance().updateConfig()];case 3:return i.sent(),[2]}}))}))},t.prototype.rebind=function(){return this},t.instantCheckSubscriptionFor=[],t}();function y(){return(new A).init()}},7715:function(t,n,e){e.d(n,{d:function(){return o}});var i=e(28812),s=e(41669);function o(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var e=n?{}:(0,i.json_parse)(s("#wallProfileStateData").text())||{};return!t||!e||e.gender&&e.username||console.error("Invalid Profile State Data",e),e}},63410:function(t,n,e){e.d(n,{U_:function(){return l},V:function(){return c},V7:function(){return f},dz:function(){return h},lf:function(){return r}});var i=e(15215),s=e(19826),o=e(67374),a=e(13907),r=function(t,n){return void 0===t&&(t=s.A.getState()),new Promise((function(e,i){return document.body.classList.contains("fullscreen")?i(new Error("Not Allowed for fullscreen mod")):"#buy_tokens"===location.hash||[(0,a.ip)("@member_buy_tokens"),(0,a.ip)("@member_buy_vip"),(0,a.ip)("@member_buy_invisibility")].includes(location.pathname)?i(new Error('Not Allowed for this page: "'.concat(location.href,'".'))):n?t.onlineNotifications.find((function(t){return t.username===n}))?i(new Error("Not Allowed for ".concat(n,". User exits in queue"))):o.I_.getInstance().checkAndSaveAllowing(n).then((function(t){e(t)})).catch((function(t){return new Error("Not Allowed by NotificationsSettings->checkAndSaveAllowing")})):e(!0)}))};function c(t,n){return(0,i.sH)(this,arguments,void 0,(function(t,n,e){var s;return void 0===e&&(e=!1),(0,i.YH)(this,(function(e){switch(e.label){case 0:return(s=!1)?[3,2]:[4,r(t,n.username).catch((function(t){return!1}))];case 1:s=e.sent(),e.label=2;case 2:return s?[2,{onlineNotifications:(0,i.fX)((0,i.fX)([],t.onlineNotifications,!0),[n],!1)}]:[2]}}))}))}function u(t,n){var e=[];return n&&t.onlineNotifications.map((function(t){t.username!==n&&e.push(t)})),{onlineNotifications:e}}function l(t,n){return(0,i.sH)(this,void 0,void 0,(function(){var e;return(0,i.YH)(this,(function(s){return[2,{onlineNotificationSettings:(0,i.Cl)((0,i.Cl)({},t.onlineNotificationSettings),(e={},e[n.username]=n.isSubscribed,e))}]}))}))}function f(){s.A.action(u)()}function h(t){s.A.action(u)(t)}},9988:function(t,n,e){e.d(n,{k:function(){return u},T:function(){return i}});var i=function(){},s=e(15215),o=e(18697),a=function(t){function n(){var n=t.call(this)||this;return n._innerStatus=1,n.waitMaxFails=20,n.waitFailCounter=0,n.callbacks=[],n.waitLoading=function(){if(!n.checkStatusComplete(2,!0))throw new Error("Firebase not loaded but status do not equal ".concat(2," (initializing): ").concat(n.status));if("firebase"in window&&"messaging"in firebase)try{n.status=3,n.init()}catch(t){n.status=0}else n.waitFailCounter++,n.waitFailCounter>n.waitMaxFails?n.status=0:window.setTimeout(n.waitLoading,1e3)},n.handleMessage=function(t){(0,o._b)("PushAPI Firebase handleMessage").log(t),n.callbacks.map((function(n){n(t)}))},"Notification"in window&&"serviceWorker"in navigator&&"https:"===window.location.protocol||(n.status=0),n}return(0,s.C6)(n,t),n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n.prototype.subscribe=function(){return(0,s.sH)(this,void 0,void 0,(function(){var t,n;return(0,s.YH)(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),[4,this.ready()];case 1:return e.sent(),[4,(t=firebase.messaging()).requestPermission()];case 2:return e.sent(),[4,t.getToken()];case 3:return[2,e.sent()];case 4:throw n=e.sent(),(0,o._b)("PushAPI Firebase subscribe failed").error(n.message||n),n;case 5:return[2]}}))}))},n.prototype.unsubscribe=function(t){return(0,s.sH)(this,void 0,void 0,(function(){var n;return(0,s.YH)(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,this.ready()];case 1:return e.sent(),[4,firebase.messaging().deleteToken(t)];case 2:return[2,e.sent()];case 3:throw n=e.sent(),(0,o._b)("PushAPI Firebase unsubscribe failed").error(n.message||n),n;case 4:return[2]}}))}))},n.prototype.onMessage=function(t){this.callbacks.push(t)},n.prototype.isAvailable=function(){return 0!==this.status},n.prototype.setup=function(){if(this.isAvailable()&&!("firebase"in window)&&!this.checkStatusComplete(3)){this.status=2;var t=function(e){if(n.libUris[e]){var i=n.libUris[e];if(!document.querySelector('script[src="'.concat(i,'"]'))){var s=document.createElement("script");s.async=!0,s.src=i,s.onload=function(){(0,o._b)("PushAPI Firebase loadLib success").log(e,i),t(e+1)},document.head.appendChild(s)}}};n.libUris.length&&t(0),this.waitLoading()}},n.prototype.init=function(){this.isAvailable()&&!this.checkStatusComplete(4)&&(this.status=4,firebase.initializeApp(n.config),firebase.messaging().onMessage(this.handleMessage))},n.prototype.ready=function(){return(0,s.sH)(this,void 0,void 0,(function(){var t,n=this;return(0,s.YH)(this,(function(e){switch(e.label){case 0:return this.checkStatusComplete(4)?[2,!0]:this.checkStatusComplete(2)?(t=this,[4,new Promise((function(e,i){n.readyGenerator=function(){return(0,s.YH)(this,(function(n){switch(n.label){case 0:return t.checkStatusComplete(4)?[3,2]:[4];case 1:return n.sent(),t.isAvailable()||i("Network error"),[3,0];case 2:return e(),[2,!0]}}))}(),n.readyGenerator.next(null)}))]):((0,o._b)("PushAPI Firebase ready").error("You must setup firebase before"),[2,!1]);case 1:return[2,e.sent()]}}))}))},n.prototype.onChangeStatus=function(t,n){(0,o._b)("PushAPI Firebase onChangeStatus").log(t,"->",n),this.readyGenerator&&this.readyGenerator.next(n)},n.prototype.checkStatusComplete=function(t,n){return void 0===n&&(n=!1),n?this.status===t:this.status>=t},Object.defineProperty(n.prototype,"status",{get:function(){return this._innerStatus},set:function(t){var n=this.status;this._innerStatus=t,this.onChangeStatus(n,t)},enumerable:!1,configurable:!0}),n.libVersion="7.21.0",n.libUris=["https://www.gstatic.com/firebasejs/".concat(n.libVersion,"/firebase-app.js"),"https://www.gstatic.com/firebasejs/".concat(n.libVersion,"/firebase-messaging.js")],n.config={apiKey:"AIzaSyBZPKKo_tInwfJZ0COBg0ZfmYyxacO6lsU",projectId:"bongacams-e8ad2",messagingSenderId:"918428164766",appId:"1:918428164766:web:c8b01dbfcdaf92e0c8918f"},n}(i),r=e(22706),c=e(67374),u=function(){function t(){var n,e=this;if(this.token=null,this.onMessage=function(n){e.isAvailable()&&t.callbacks.push(n)},this.removeMessageListener=function(n){if(e.isAvailable()){var i=[];t.callbacks.map((function(t){t!==n&&i.push(t)})),t.callbacks=i}},"Notification"in window&&!r.BrowserDetect.isSafari()){var i=a.getInstance();i.isAvailable()&&(i.setup(),n=i)}n?(this.service=n,this.service.onMessage((function(n){(0,o._b)("PushAPI PushNotification onMessage").log(n),t.callbacks.map((function(t){t(n)}))}))):(0,o._b)("PushAPI PushNotification init failed").error("not available")}return t.getInstance=function(){return(0,s.sH)(this,void 0,void 0,(function(){return(0,s.YH)(this,(function(n){switch(n.label){case 0:return t.instance?[3,2]:(t.instance=new t,[4,t.instance.checkSubscription()]);case 1:n.sent(),n.label=2;case 2:return[2,t.instance]}}))}))},t.prototype.isAvailable=function(){return Boolean(this.service)},t.prototype.getToken=function(){return this.token},t.prototype.subscribe=function(){return(0,s.sH)(this,void 0,void 0,(function(){var t,n;return(0,s.YH)(this,(function(e){switch(e.label){case 0:if(!this.isAvailable())return[2,null];e.label=1;case 1:return e.trys.push([1,6,,7]),(0,o._b)("PushAPI PushNotification subscribe try").log(),[4,this.service.subscribe()];case 2:return(t=e.sent())?(this.token=t,[4,c.I_.getInstance().saveToken(this.token)]):[3,5];case 3:return e.sent(),[4,c.I_.getInstance().checkIsAuth()];case 4:e.sent(),(0,o._b)("PushAPI PushNotification subscribe success").log(t),e.label=5;case 5:return[2,t];case 6:switch((n=e.sent()).code){case"messaging/permission-blocked":case"messaging/permission-default":(0,o._b)("PushAPI PushNotification subscribe failed").log("show alert");break;case"messaging/unsupported-browser":(0,o._b)("PushAPI PushNotification subscribe failed").log("unsupported browser");break;default:(0,o._b)("PushAPI PushNotification subscribe failed").log(n)}return[2,null];case 7:return[2]}}))}))},t.prototype.unsubscribeAll=function(){return(0,s.sH)(this,void 0,void 0,(function(){var t,n;return(0,s.YH)(this,(function(e){switch(e.label){case 0:if(!this.isAvailable()||!this.isSubscribed())return[2,!1];e.label=1;case 1:return e.trys.push([1,5,,6]),(0,o._b)("PushAPI PushNotification unsubscribeAll try").log(),[4,this.service.unsubscribe(this.token)];case 2:return(t=e.sent())?[4,c.I_.getInstance().removeToken()]:[3,4];case 3:e.sent(),this.token=null,(0,o._b)("PushAPI PushNotification unsubscribeAll success").log(),e.label=4;case 4:return[2,t];case 5:if("messaging/delete-token-not-found"===(n=e.sent()).code);else(0,o._b)("PushAPI PushNotification unsubscribeAll failed").error(n);return[3,6];case 6:return[2]}}))}))},t.prototype.isSubscribed=function(){return Boolean(this.token)},t.prototype.checkSubscription=function(){return(0,s.sH)(this,void 0,void 0,(function(){var t,n;return(0,s.YH)(this,(function(e){switch(e.label){case 0:return window.Notification&&"granted"===Notification.permission&&c.I_.getInstance().isAvailable()?[4,c.I_.getInstance().checkIsAuth()]:[2];case 1:return e.sent(),this.isAvailable()?[4,c.I_.getInstance().getToken()]:[2];case 2:return t=e.sent(),(0,o._b)("PushAPI PushNotification checkSubscription savedToken").log(t),t?[4,this.service.subscribe()]:[2];case 3:return n=e.sent(),(0,o._b)("PushAPI PushNotification checkSubscription serviceToken").log(n),n&&t===n?[3,7]:((0,o._b)("PushAPI PushNotification checkSubscription").log("remove all"),[4,c.I_.getInstance().removeToken()]);case 4:return e.sent(),n?[4,this.service.unsubscribe(n)]:[3,6];case 5:e.sent(),e.label=6;case 6:return[2];case 7:return this.token=n,(0,o._b)("PushAPI PushNotification checkSubscription success").log(),[2]}}))}))},t.callbacks=[],t}()},83714:function(t,n,e){var i=e(15215),s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,i.C6)(n,t),n.SITE_NOTIFICATION="siteNotification",n.ONLINE_NOTIFICATION="onlineNotification",n}(e(53767).A);n.A=s}}]);