OwlCyberSecurity - MANAGER
Edit File: frontend.min.js
import{V as o,a as g,n as r,_ as n,m as c,i as h,f as v}from"./chunks/vendor-008d034f.min.js";import{R as w,D as $}from"./chunks/date-intervals-1516c30d.min.js";import{W as b}from"./chunks/WidgetReportError-9afd455d.min.js";import{M as y,s as a}from"./chunks/index-f32ade64.min.js";const x=e=>new Promise(t=>{let s=new FormData,l=o.prototype.$mi.page_id?o.prototype.$mi.page_id:window.location.pathname;s.append("action","monsterinsights_pageinsights_refresh_report"),s.append("security",o.prototype.$mi.nonce),s.append("report","pageinsights"),s.append("post_id",l),s.append("json",1),g.post(o.prototype.$mi.ajax,s).then(i=>{t(i.data)}).catch(function(i){e.dispatch("$_app/block",!1,{root:!0}),i.response})}),C={fetchReportData:x},R=e=>new Promise(t=>{e.dispatch("$_queue/add",()=>C.fetchReportData(e).then(function(s){if(s.data.message==="license_level"){t(!1);return}s.success?(e.commit("UPDATE_REPORT_DATA",{report:"pageinsights",data:s.data}),t(!0)):(o.prototype.$mi_error_toast(!1,s.data.message,s.data.footer),t(!1))}),{root:!0})}),E={getReportData:R},P=e=>e.date,A=e=>e.pageinsights,D=e=>e.loaded,F=e=>e.error,T=e=>e.noauth,U={date:P,pageinsights:A,loaded:D,error:F,noauth:T},M=(e,t)=>{t.report&&t.data&&e[t.report]&&o.set(e,t.report,t.data)},S=(e,t)=>{t.start&&t.end&&(o.set(e.date,"start",t.start),o.set(e.date,"end",t.end))},O=(e,t)=>{o.set(e.date,"interval",t)},I=(e,t)=>{e.loaded=t},L=(e,t)=>{e.error=t},N=e=>{e.noauth=!0,e.loaded=!0},V={UPDATE_REPORT_DATA:M,UPDATE_DATE:S,UPDATE_INTERVAL:O,UPDATE_LOADED:I,SET_ERROR:L,ENABLE_NOAUTH:N},k={loaded:!1,pageinsights:{},error:!1,noauth:!1},B={namespaced:!0,state:k,actions:E,getters:U,mutations:V},W={name:"FrontendStatsColumn",props:{extraClass:{type:String,default:""},label:String,value:[String,Number]},computed:{columnClass(){return"monsterinsights-stats-column "+this.extraClass}}};var H=function(){var t=this,s=t._self._c;return s("div",{class:t.columnClass},[t.label?s("div",{staticClass:"monsterinsights-stats-label",domProps:{textContent:t._s(t.label)}}):t._e(),t.value?s("div",{staticClass:"monsterinsights-stats-value",domProps:{innerHTML:t._s(t.value)}}):t._e(),t._t("default")],2)},z=[],G=r(W,H,z,!1,null,null,null,null);const K=G.exports,Y={name:"FrontendUpsell",data(){return{text_button:n("Upgrade to PRO","google-analytics-for-wordpress"),is_admin:this.$mi.is_admin,text_view_reports:n("View All Reports","google-analytics-for-wordpress")}},computed:{upgradeUrl(){return this.$getUpgradeUrl("frontend-reports","admin-bar")},reportsUrl(){return this.$mi.reports_url},canManageOptions(){return!!(this.$mi.roles_manage_options&&this.$mi.roles_manage_options.length!==0)},buttonText(){return!this.$mi.is_admin&&this.canManageOptions?this.text_button:!this.$mi.is_admin&&!this.canManageOptions?this.text_view_reports:this.text_button},buttonLink(){return!this.$mi.is_admin&&this.canManageOptions?this.upgradeUrl:!this.$mi.is_admin&&!this.canManageOptions?this.reportsUrl:this.upgradeUrl}}};var j=function(){var t=this,s=t._self._c;return s("a",{staticClass:"monsterinsights-button",attrs:{target:"_blank",rel:"noopener",href:t.buttonLink},domProps:{textContent:t._s(t.buttonText)}})},q=[],Z=r(Y,j,q,!1,null,null,null,null);const J=Z.exports,Q={name:"NotificationsIndicator",data(){return{text_view_notifications:n("View notifications","google-analytics-for-wordpress")}},computed:{...c({notifications:"$_notifications/notifications",view_url:"$_notifications/view_url",sidebar_url:"$_notifications/sidebar_url"}),has_notifications(){return this.notifications&&this.notifications.length>0}}};var X=function(){var t=this,s=t._self._c;return s("div",{staticClass:"monsterinsights-notifications-indicator"},[s("a",{attrs:{href:t.sidebar_url,title:t.text_view_notifications}},[s("svg",{attrs:{width:"35",height:"39",viewBox:"0 0 35 39",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:"M17.6898 39C20.3431 39 22.4954 36.8177 22.4954 34.125H12.8841C12.8841 36.8177 15.0364 39 17.6898 39ZM33.8706 27.5963C32.4192 26.015 29.7035 23.6361 29.7035 15.8438C29.7035 9.9252 25.6108 5.18731 20.0922 4.02492V2.4375C20.0922 1.09154 19.0164 0 17.6898 0C16.3631 0 15.2873 1.09154 15.2873 2.4375V4.02492C9.76874 5.18731 5.67602 9.9252 5.67602 15.8438C5.67602 23.6361 2.96031 26.015 1.50893 27.5963C1.05818 28.0876 0.858356 28.6749 0.862112 29.25C0.870376 30.4992 1.83721 31.6875 3.27357 31.6875H32.1059C33.5423 31.6875 34.5099 30.4992 34.5174 29.25C34.5212 28.6749 34.3213 28.0869 33.8706 27.5963Z",fill:"#393F4C"}})]),t.has_notifications?s("span",{staticClass:"monsterinsights-notifications-unread",domProps:{textContent:t._s(t.notifications.length)}}):t._e()])])},tt=[],st=r(Q,X,tt,!1,null,null,null,null);const et=st.exports,nt={name:"FrontendStatsGeneral",components:{NotificationsIndicator:et,FrontendUpsell:J,FrontendStatsColumn:K},data(){return{text_insights_for:n("Last 30 Days Insights for:","google-analytics-for-wordpress"),text_your_website:n("Your Website","google-analytics-for-wordpress"),text_sessions:n("Sessions","google-analytics-for-wordpress"),text_pageviews:n("Pageviews","google-analytics-for-wordpress"),text_session_duration:n("Avg. Duration","google-analytics-for-wordpress"),text_total_users:n("Total Users","google-analytics-for-wordpress")}},computed:{...c({overview:"$_reports/overview",addons:"$_addons/addons"}),text_upsell_title(){return this.$mi.is_admin?n("More data is available","google-analytics-for-wordpress"):this.addons["page-insights"]&&this.addons["page-insights"].active?n("More data is available","google-analytics-for-wordpress"):n("Want to see page-specific stats?","google-analytics-for-wordpress")},hasTotalUsersData(){return typeof this.overview.infobox.totalusers<"u"&&typeof this.overview.infobox.totalusers.value<"u"}},mounted(){if(!this.$mi.authed){this.$store.commit("$_frontend/ENABLE_NOAUTH");return}this.$store.dispatch("$_reports/getReportData","overview").then(()=>{this.$store.commit("$_frontend/UPDATE_LOADED",!0)})}};var ot=function(){var t=this,s=t._self._c;return t.overview.infobox?s("div",{staticClass:"monsterinsights-frontend-stats-inner"},[s("frontend-stats-column",{attrs:{label:t.text_insights_for,value:t.text_your_website}}),s("frontend-stats-column",{attrs:{label:t.text_sessions,value:t.overview.infobox.sessions.value}}),s("frontend-stats-column",{attrs:{label:t.text_pageviews,value:t.overview.infobox.pageviews.value}}),s("frontend-stats-column",{attrs:{label:t.text_session_duration,value:t.overview.infobox.duration.value}}),t.hasTotalUsersData?s("frontend-stats-column",{attrs:{label:t.text_total_users,value:t.overview.infobox.totalusers.value}}):t._e(),s("frontend-stats-column",{staticClass:"monsterinsights-frontend-column-button",attrs:{label:t.text_upsell_title}},[s("frontend-upsell")],1),s("frontend-stats-column",{staticClass:"monsterinsights-frontend-column-notifications"},[s("notifications-indicator")],1)],1):t._e()},rt=[],it=r(nt,ot,rt,!1,null,null,null,null);const at=it.exports,lt={name:"FrontendStatsContent",components:{FrontendStatsGeneral:at}};var ct=function(){var t=this,s=t._self._c;return s("div",{staticClass:"monsterinsights-content-lite"},[s("frontend-stats-general")],1)},_t=[],dt=r(lt,ct,_t,!1,null,null,null,null);const ut=dt.exports,pt={name:"FrontendPoweredBy",data(){return{text_powered_by:n("Powered by MonsterInsights","google-analytics-for-wordpress"),upgrade_url:this.$getUpgradeUrl("admin-bar","powered-by")}}};var ft=function(){var t=this,s=t._self._c;return s("a",{staticClass:"monsterinsights-powered-by",attrs:{href:t.upgrade_url},domProps:{textContent:t._s(t.text_powered_by)}})},mt=[],gt=r(pt,ft,mt,!1,null,null,null,null);const ht=gt.exports,vt={name:"FrontendNoAuth",data(){return{text_no_auth:n("Please Setup Website Analytics to See Audience Insights","google-analytics-for-wordpress"),text_auth_label:n("MonsterInsights, the #1 WordPress Analytics Plugin, helps you connect your website with Google Analytics, so you can see how people find and use your website. Over 3 million website owners use MonsterInsights to see the stats that matter and grow their business.","google-analytics-for-wordpress"),text_wizard:n("Connect MonsterInsights and Setup Website Analytics","google-analytics-for-wordpress"),text_learn:n("Learn More","google-analytics-for-wordpress"),wizard_url:this.$mi.wizard_url,learn_link:this.$mi.getting_started_url}}};var wt=function(){var t=this,s=t._self._c;return s("div",{staticClass:"monsterinsights-not-authenticated-notice"},[s("h3",{domProps:{textContent:t._s(t.text_no_auth)}}),s("div",{staticClass:"monsterinsights-settings-input monsterinsights-settings-input-authenticate"},[s("p",{domProps:{textContent:t._s(t.text_auth_label)}}),s("div",[s("a",{staticClass:"monsterinsights-wp-button monsterinsights-wp-button-primary",attrs:{href:t.wizard_url},domProps:{textContent:t._s(t.text_wizard)}}),s("a",{staticClass:"monsterinsights-wp-button",attrs:{href:t.learn_link},domProps:{textContent:t._s(t.text_learn)}})])])])},$t=[],bt=r(vt,wt,$t,!1,null,null,null,null);const yt=bt.exports,xt={name:"ModuleFrontendReports",components:{FrontendNoAuth:yt,FrontendPoweredBy:ht,WidgetReportError:b,FrontendStatsContent:ut},data(){return{statsVisible:!1,page_id:this.$mi.page_id,text_insights:n("Insights","google-analytics-for-wordpress")}},created(){const e="$_reports";e in this.$store._modules.root._children||this.$store.registerModule(e,w);const t="$_frontend";t in this.$store._modules.root._children||this.$store.registerModule(t,B)},computed:{...c({reportdata:"$_frontend/pageinsights",loaded:"$_frontend/loaded",error:"$_frontend/error",noauth:"$_frontend/noauth"}),toggleButtonClass(){let e="ab-item ab-empty-item monsterinsights-toggle";return this.statsVisible&&(e+=" monsterinsights-toggle-active"),e},has_notifications(){return this.notifications&&this.notifications.length>0}},methods:{toggleStatsVisibility(){this.statsVisible=!this.statsVisible}}};var Ct=function(){var t=this,s=t._self._c;return s("li",{staticClass:"monsterinsights-adminbar-menu-item",attrs:{id:"wp-admin-bar-monsterinsights_frontend_button"}},[s("div",{class:t.toggleButtonClass,on:{click:t.toggleStatsVisibility}},[s("span",{staticClass:"ab-icon dashicons-before dashicons-chart-bar"}),s("span",{staticClass:"monsterinsights-admin-bar-handle-text",domProps:{textContent:t._s(t.text_insights)}}),t.has_notifications?s("span",{staticClass:"monsterinsights-menu-notification-indicator",domProps:{textContent:t._s(t.notifications.length)}}):t._e()]),t.statsVisible?s("div",{staticClass:"monsterinsights-frontend-stats"},[t.noauth?s("frontend-no-auth"):t.error?s("widget-report-error",{attrs:{error:t.error}}):s("frontend-stats-content"),t.loaded?t._e():s("div",{staticClass:"monsterinsights-frontend-stats-loading"},[s("span",{staticClass:"monsterinsights-frontend-spinner"})]),s("frontend-powered-by")],1):t._e()])},Rt=[],Et=r(xt,Ct,Rt,!1,null,null,null,null);const Pt=Et.exports;const At={install(e,{store:t}){e.prototype.$mi_loading_toast||(e.prototype.$mi_loading_toast=function(){}),e.prototype.$mi_error_toast||(e.prototype.$mi_error_toast=function(s){let{type:l="error",customContainerClass:i="monsterinsights-swal",allowOutsideClick:_=!1,allowEscapeKey:d=!1,allowEnterKey:u=!1,title:p=n("Error","google-analytics-for-wordpress"),html:f=n("Please try again.","google-analytics-for-wordpress"),footer:m=!1}=s;s={type:l,customContainerClass:i,allowOutsideClick:_,allowEscapeKey:d,allowEnterKey:u,title:p,html:f,footer:m},t.commit("$_frontend/SET_ERROR",{title:s.title,content:s.html,footer:s.footer})}),e.prototype.$mi_intervals=function(){return $}}};window.addEventListener("load",function(){const e=document.getElementById("wp-admin-bar-monsterinsights_frontend_button");o.config.productionTip=!1,e&&({}.NODE_ENV!=="production"&&(o.config.devtools=!0,o.config.performance=!0),h({ctrl:!0}),o.use(y),o.use(At,{store:a}),v(window.monsterinsights.translations,"google-analytics-for-wordpress"),new o({store:a,mounted:()=>{window.pagenow&&window.pagenow!=="dashboard"&&window.pagenow!=="toplevel_page_monsterinsights_reports"&&a.dispatch("$_queue/add",()=>a.dispatch("$_notifications/getNotifications"))},render:t=>t(Pt)}).$mount(e))});