OwlCyberSecurity - MANAGER
Edit File: Main.CsYRKlwt.js
import{a as M,e as k,g as T,D as h}from"./links.w575jfOL.js";import{l as g}from"./license.BWlasdzY.js";import{G as A}from"./GoogleSearchConsole.B8DLXXIm.js";import{C as v,_ as R}from"./Caret.B8YmKvEY.js";import{_ as d}from"./_plugin-vue_export-helper.BN1snXvA.js";import{v as n,o as a,k as r,l,a as S,t as u,b as o,c as p,C as y,x as f,q as D,F as O}from"./runtime-dom.esm-bundler.CWn9hmRK.js";import{B as U}from"./DatePicker.EC4dtefp.js";import{C as J}from"./ConnectCta.BLOUWz1L.js";import{C as P}from"./Blur.DIwtbD0z.js";import{C as F}from"./Index.BgYBArag.js";import G from"./ContentRankings.BMDTlP7P.js";import{C as N}from"./Index.BLcpDwVY.js";import V from"./Dashboard.DLxNsErA.js";import z from"./KeywordRankTracker.BVdjFyEb.js";import q from"./SeoStatistics.BNuiwn5j.js";import"./default-i18n.DXRQgkn2.js";import"./helpers.CXsRrhc8.js";import"./upperFirst.yVnsg4QL.js";import"./_stringToArray.DnK4tKcY.js";import"./toString.zLSwYOtv.js";import"./Calendar.Ch9ZELBO.js";import"./pick.E0dwuk96.js";import"./_baseSet.rYV3oc6X.js";import"./_getTag.BWQxgJie.js";import"./debounce.CMPzYXJX.js";import"./toNumber.BAPajc32.js";import"./_baseTrim.BYZhh0MR.js";import"./isEqual.DkU1ezAe.js";import"./_baseIsEqual.MNbeg0L2.js";import"./allowed.jlDmxPN2.js";/* empty css */import"./params.B3T1WKlC.js";import"./Ellipse.Br8hAdqt.js";import"./Header.Dl9l7HVR.js";import"./addons.CJ8lJt9v.js";import"./ScrollAndHighlight.CgbfptKH.js";import"./LogoGear.DQjXqfk4.js";import"./AnimatedNumber.BelgQe_o.js";import"./numbers.BT5e8rgb.js";import"./Logo.BukaIm9R.js";import"./index.vo0_cz49.js";import"./Support.D_rtj1Hi.js";import"./Tabs.qjdtP0a-.js";import"./TruSeoScore.DmC22Awy.js";import"./ProBadge.CeTQI5Mm.js";import"./Information.DOYCSlH5.js";import"./Slide.DwUOEoDg.js";import"./Url.CJ1cXO5Z.js";import"./Date.DuGsSEmw.js";import"./constants.Ct0G2N2t.js";import"./Exclamation.SlOpu0r6.js";import"./Gear.BX0imWnw.js";import"./Row.Depn1REx.js";import"./PostsTable.BtWbRxEu.js";import"./WpTable.CVGg_b1u.js";import"./ScoreButton.DRYjwmcC.js";import"./Table.eZ8iPnsH.js";import"./Tooltip.u2Cos2P_.js";import"./vue3-apexcharts.EA6uzAM7.js";import"./IndexStatus.D9ftAjIk.js";import"./CheckSolid.DDc-X85M.js";import"./Mobile.DlhK7U8A.js";import"./Checkmark.CZaciSER.js";import"./ExclamationSolid.B2A5dpHD.js";import"./Link.BehCAKHn.js";import"./PostTypes.Cef6XkQ_.js";import"./LicenseConditions.D0P8U_He.js";import"./_baseClone.BiVlRo9x.js";import"./_arrayEach.Fgt6pfHj.js";import"./RequiredPlans.DbYABcJ7.js";import"./Card.DcyLIJc9.js";import"./Overview.CUZcU2tm.js";import"./DonutChartWithLegend.BQla0SbV.js";import"./KeywordsGraph.DWfOpYYc.js";import"./Graph.WtVg2p4K.js";import"./SeoStatisticsOverview.C0dqdW-d.js";import"./List.DFu8kfnA.js";import"./Statistics.B2x6g7QK.js";import"./SettingsRow.CSjiqnfy.js";import"./Editor.Cvkhfn-n.js";import"./Index.Sx0bRfob.js";import"./External.htlge_um.js";import"./Star.ZLYr0-AM.js";const E={setup(){return{optionsStore:M(),searchStatisticsStore:k()}},components:{CoreAlert:v},data(){return{error:this.$t.__("Your connection with Google Search Console has expired or is invalid. Please check that your site is verified in Google Search Console and try to reconnect. If the problem persists, please contact our support team.",this.$td)}},computed:{invalidAuthentication(){var t,e;return this.searchStatisticsStore.unverifiedSite||typeof((e=(t=this.optionsStore.internalOptions.internal)==null?void 0:t.searchStatistics)==null?void 0:e.profile)!="object"}}};function I(t,e,i,c,m,s){const _=n("core-alert");return s.invalidAuthentication?(a(),r(_,{key:0,class:"aioseo-input-error aioseo-search-statistics-authentication-alert",type:"red"},{default:l(()=>[S("strong",null,u(m.error),1)]),_:1})):o("",!0)}const j=d(E,[["render",I]]),K={};function Y(t,e){return a(),p("div")}const Z=d(K,[["render",Y]]),H={};function Q(t,e){return a(),p("div")}const W=d(H,[["render",Q]]),X={setup(){return{licenseStore:T(),searchStatisticsStore:k()}},emits:["rolling"],components:{AuthenticationAlert:j,BaseButton:R,BaseDatePicker:U,ConnectCta:J,CoreAlert:v,CoreBlur:P,CoreMain:F,ContentRankings:G,Cta:N,Dashboard:V,KeywordRankTracker:z,PostDetail:Z,Settings:W,SeoStatistics:q},mixins:[A],data(){return{maxDate:null,minDate:null,strings:{pageName:this.$t.__("Search Statistics",this.$td),sampleDataAlert:this.$t.__("Sample data is available for you to explore. Connect your site to Google Search Console to receive insights on how content is being discovered. Identify areas for improvement and drive traffic to your website.",this.$td),ctaButtonText:this.$t.__("Connect to Google Search Console",this.$td),ctaUnlockButtonText:this.$t.__("Unlock Search Statistics",this.$td)}}},computed:{defaultRange(){const t=new Date(`${this.searchStatisticsStore.range.start} 00:00:00`),e=new Date(`${this.searchStatisticsStore.range.end} 00:00:00`);return[t,e]},excludeTabs(){const t=["post-detail"];return(this.licenseStore.isUnlicensed||!g.hasCoreFeature("search-statistics"))&&t.push("settings"),t},isSettings(){return this.$route.name==="settings"},showSampleDataUnlockCta(){return g.hasCoreFeature("search-statistics")&&!this.searchStatisticsStore.isConnected||this.searchStatisticsStore.unverifiedSite},showConnectCta(){return(g.hasCoreFeature("search-statistics")&&!this.searchStatisticsStore.isConnected||this.searchStatisticsStore.unverifiedSite)&&!this.isSettings},showDatePicker(){const t=this.searchStatisticsStore.isConnected&&!this.searchStatisticsStore.unverifiedSite,e=this.searchStatisticsStore.range.start&&this.searchStatisticsStore.range.end;return!["settings","content-rankings"].includes(this.$route.name)&&t&&e},containerClasses(){const t=[];return this.searchStatisticsStore.fetching&&t.push("aioseo-blur"),t},getOriginalMaxDate(){return this.searchStatisticsStore.latestAvailableDate?h.fromFormat(this.searchStatisticsStore.latestAvailableDate,"yyyy-MM-dd").setZone(h.zone)||h.local().plus({days:-2}):h.local().plus({days:-2})},datepickerShortcuts(){return[{text:this.$t.__("Last 7 Days",this.$td),value:()=>(window.aioseoBus.$emit("rolling","last7Days"),[this.getOriginalMaxDate.plus({days:-6}).toJSDate(),this.getOriginalMaxDate.toJSDate()])},{text:this.$t.__("Last 28 Days",this.$td),value:()=>(window.aioseoBus.$emit("rolling","last28Days"),[this.getOriginalMaxDate.plus({days:-27}).toJSDate(),this.getOriginalMaxDate.toJSDate()])},{text:this.$t.__("Last 3 Months",this.$td),value:()=>(window.aioseoBus.$emit("rolling","last3Months"),[this.getOriginalMaxDate.plus({days:-89}).toJSDate(),this.getOriginalMaxDate.toJSDate()])}]}},methods:{isDisabledDate(t){return this.minDate===null?!0:t.getTime()<this.minDate.getTime()||t.getTime()>this.maxDate.getTime()},onDateChange(t,e){this.searchStatisticsStore.setDateRange({dateRange:t,rolling:e})},highlightShortcut(t){if(!t)return;document.querySelectorAll(".el-picker-panel__shortcut").forEach(i=>{switch(i.innerText){case this.$t.__("Last 7 Days",this.$td):t==="last7Days"?i.classList.add("active"):i.classList.remove("active");break;case this.$t.__("Last 28 Days",this.$td):t==="last28Days"?i.classList.add("active"):i.classList.remove("active");break;case this.$t.__("Last 3 Months",this.$td):t==="last3Months"?i.classList.add("active"):i.classList.remove("active");break;case this.$t.__("Last 6 Months",this.$td):t==="last6Months"?i.classList.add("active"):i.classList.remove("active");break;default:i.classList.remove("active")}})}},mounted(){this.minDate=h.now().plus({months:-16}).toJSDate(),this.maxDate=this.getOriginalMaxDate.toJSDate()}},tt=S("br",null,null,-1),et=S("br",null,null,-1),st={key:1,class:"connect-cta"};function at(t,e,i,c,m,s){const _=n("base-date-picker"),x=n("authentication-alert"),C=n("base-button"),w=n("core-alert"),b=n("core-blur"),$=n("connect-cta"),L=n("core-main");return a(),r(L,{"page-name":m.strings.pageName,"exclude-tabs":s.excludeTabs,showTabs:!s.excludeTabs.includes(t.$route.name),containerClasses:s.containerClasses},{extra:l(()=>[s.showDatePicker?(a(),r(_,{key:0,onChange:s.onDateChange,onUpdated:e[0]||(e[0]=B=>s.highlightShortcut(B)),clearable:!1,defaultValue:s.defaultRange,defaultRolling:c.searchStatisticsStore.rolling,isDisabledDate:s.isDisabledDate,shortcuts:s.datepickerShortcuts,size:"small"},null,8,["onChange","defaultValue","defaultRolling","isDisabledDate","shortcuts"])):o("",!0)]),default:l(()=>[S("div",null,[y(x),c.searchStatisticsStore.shouldShowSampleReports?(a(),p(O,{key:0},[y(w,{class:"description sample-data-alert",type:"yellow",onCloseAlert:()=>{}},{default:l(()=>[f(u(m.strings.sampleDataAlert)+" ",1),tt,et,s.showSampleDataUnlockCta?(a(),r(C,{key:0,type:"green",size:"small",onClick:t.connect,loading:t.loading},{default:l(()=>[f(u(m.strings.ctaButtonText),1)]),_:1},8,["onClick","loading"])):o("",!0),s.showSampleDataUnlockCta?o("",!0):(a(),r(C,{key:1,tag:"a",href:t.$links.getPricingUrl("search-statistics","search-statistics-demo-upsell",t.$route.name),target:"_blank",type:"green",size:"small",onClick:c.searchStatisticsStore.showSampleReports,loading:t.loading},{default:l(()=>[f(u(m.strings.ctaUnlockButtonText),1)]),_:1},8,["href","onClick","loading"]))]),_:1}),(a(),r(D(t.$route.name)))],64)):o("",!0),s.showConnectCta?(a(),p("div",st,[c.searchStatisticsStore.shouldShowSampleReports?o("",!0):(a(),r(b,{key:0},{default:l(()=>[(a(),r(D(t.$route.name)))]),_:1})),c.searchStatisticsStore.shouldShowSampleReports?o("",!0):(a(),r($,{key:1}))])):o("",!0),!s.showConnectCta&&!c.searchStatisticsStore.shouldShowSampleReports?(a(),r(D(t.$route.name),{key:2})):o("",!0)])]),_:1},8,["page-name","exclude-tabs","showTabs","containerClasses"])}const Re=d(X,[["render",at]]);export{Re as default};