import{S as p}from"./LogoGear.BF23BIEd.js";import{x as f,o as d,c as m,a as c,C as $}from"./vue.esm-bundler.CWQFYt9y.js";import{_}from"./_plugin-vue_export-helper.BN1snXvA.js";import{u as h}from"./links.C7Z9vJvv.js";import{g,r as u}from"./params.B3T1WKlC.js";const y={components:{SvgAioseoLogoGear:p},data(){return{strings:{boldText:this.$t.sprintf("<strong>%1$s %2$s</strong>","AIOSEO",this.$isPro?"Pro":""),linkText:this.$t.__("Click here to learn more",this.$td)}}},computed:{link(){return this.$t.sprintf('<strong><a href="%1$s" target="_blank" class="text-white">%2$s</a></strong>',this.$links.getDocUrl("restApi"),this.strings.linkText)},upgradeText(){return this.$t.sprintf(this.$t.__("%1$s relies on the WordPress Rest API and your site might have it disabled. %2$s.",this.$td),this.strings.boldText,this.link)}},mounted(){document.body.classList.add("aioseo-has-bar")},beforeUnmount(){document.body.classList.remove("aioseo-has-bar")}},v={class:"aioseo-api-bar"},x={class:"upgrade-text"},A=["innerHTML"];function T(t,o,e,r,n,s){const i=f("svg-aioseo-logo-gear");return d(),m("div",v,[c("div",x,[$(i),c("div",{innerHTML:s.upgradeText},null,8,A)])])}const B=_(y,[["render",T]]),S={};function b(t,o){return d(),m("div")}const w=_(S,[["render",b]]),E={setup(){return{rootStore:h()}},data(){return{running:!1}},watch:{"rootStore.navigate.scroll"(){this.running||(this.running=!0,this.scrollAndHighlight())},"rootStore.navigate.highlight"(){this.running||(this.running=!0,this.scrollAndHighlight())}},methods:{scrollAndHighlight(){var r,n;const t=h(),o=g()["aioseo-scroll"]||((r=history.state)==null?void 0:r.scroll)||t.navigate.scroll;o&&typeof o=="string"&&setTimeout(()=>{var s;this.$scrollTo(`#${o}`,{offset:-130,container:document.querySelector(this.scrollContainer||null)?this.scrollContainer:"body"}),u("aioseo-scroll"),(s=history.state)==null||delete s.scroll,t.navigate.scroll=null,this.running=!1},this.scrollTimeout||500);const e=g()["aioseo-highlight"]||((n=history.state)==null?void 0:n.highlight)||t.navigate.highlight;if(e&&typeof e=="string"){const s=o?this.scrollAndHighlightTimeout||1500:this.highlightTimeout||500;setTimeout(()=>{var a;const i=document.querySelectorAll(`#${e.replace(/,/g,", #").replace(/%2C/ig,", #")}`);i.length&&i.forEach(l=>{l.classList.add("aioseo-row-highlight"),setTimeout(()=>{l.classList.remove("aioseo-row-highlight")},1500)}),u("aioseo-highlight"),(a=history.state)==null||delete a.highlight,t.navigate.highlight=null,this.running=!1},s)}}},mounted(){this.scrollAndHighlight()}};export{B as C,E as S,w as a};
