import{v as y,o as a,c as l,a as r,F as U,J as z,k as B,G as C,q as N,C as T,t as m,B as P,b as S,V as ie}from"./js/runtime-dom.esm-bundler.tPRhSV4q.js";import{l as re}from"./js/index.0vjAWxAz.js";import{l as ne}from"./js/index.Dbgw3oZ8.js";import{l as ae}from"./js/index.3BJ3ZnWB.js";import{a as ce,b as le,e as de,d as F,F as ue,l as G,u as pe}from"./js/links.Byq_3x2e.js";import{a as he}from"./js/allowed.DT5C8zBi.js";import{t as me}from"./js/postSlug.D7DEP4-b.js";import{a as _e}from"./js/Image.DLwxCRSi.js";import{T as ge}from"./js/Tags.DAtAys4G.js";import{C as fe}from"./js/GoogleSearchPreview.buqqHJAY.js";import{c as ve,e as Se,f as be}from"./js/Caret.Ke5gylGO.js";import{S as Pe}from"./js/Exclamation.DGJubTNT.js";import{S as ye}from"./js/External.BnlDuPIp.js";import{_ as b}from"./js/_plugin-vue_export-helper.BN1snXvA.js";import{S as we}from"./js/Twitter.B1Gw9Cwq.js";import{s as xe}from"./js/metabox.BEL0zdkw.js";import{l as Ee}from"./js/loadTruSeo.DEZge1rS.js";import{e as $e}from"./js/elemLoaded.COgXIo-H.js";import{t as W}from"./js/toString.zLSwYOtv.js";import{u as ke}from"./js/upperFirst.yVnsg4QL.js";import{d as Ae}from"./js/cleanForSlug.BVGRQ_59.js";import"./js/default-i18n.DXRQgkn2.js";import"./js/constants.CPpKID74.js";import"./js/helpers.CXsRrhc8.js";import"./js/_baseSet.rYV3oc6X.js";import"./js/_stringToArray.DnK4tKcY.js";import"./js/_baseTrim.BYZhh0MR.js";function Ce(e){return ke(W(e).toLowerCase())}function Te(e,t,s,o){for(var i=-1,d=e==null?0:e.length;++ithis.allowed(t.access)&&(t.access!=="aioseo_page_analysis"||me()));return!this.optionsStore.options.social.facebook.general.enable&&!this.optionsStore.options.social.twitter.general.enable&&(e=e.filter(t=>t.name!=="social")),e.forEach((t,s)=>{e[s]={...t,...this.getData(t.name)}}),e},canImprove(){return this.tips.some(e=>e.type==="error")}},methods:{getIcon(e){switch(e){case"error":return"svg-circle-close";case"warning":return"svg-circle-exclamation";case"success":default:return"svg-circle-check"}},getData(e){const t={};if(e==="visibility"&&(t.value=this.$t.__("Good!",this.$td),t.type="success",(this.postEditorStore.currentPost.default?this.optionsStore.dynamicOptions.searchAppearance.postTypes[this.postEditorStore.currentPost.postType]&&!this.optionsStore.dynamicOptions.searchAppearance.postTypes[this.postEditorStore.currentPost.postType].advanced.robotsMeta.default&&this.optionsStore.dynamicOptions.searchAppearance.postTypes[this.postEditorStore.currentPost.postType].advanced.robotsMeta.noindex:this.postEditorStore.currentPost.noindex)&&(t.value=this.$t.__("Blocked!",this.$td),t.type="error")),e==="seoAnalysis"){t.value=this.$t.__("N/A",this.$td),t.type="error";const s=this.postEditorStore.currentPost.seo_score;Number.isInteger(s)&&(t.value=s+"/100",t.type=80{this.socialImage=this.imageUrl}),window.aioseoBus.$on("updateSocialImagePreview",e=>{this.socialImage=e.image,this.socialImageKey++}),this.$nextTick(()=>{const e=document.querySelector(".aioseo-pre-publish .editor-post-publish-panel__link");e&&(e.innerHTML=this.canImprove?this.$t.__("Your post needs improvement!",this.$td):this.$t.__("You're good to go!",this.$td))})}},lt={key:0,class:"seo-overview"},dt={class:"pre-publish-checklist"},ut={class:"icon"},pt=["onClick"],ht={key:0,class:"snippet-preview"},mt={class:"title"},_t={key:1,class:"canonical-url"},gt={class:"title"},ft=["href"];function vt(e,t,s,o,i,d){const c=y("svg-pencil"),u=y("core-google-search-preview"),p=y("svg-external");return o.postEditorStore.currentPost.id?(a(),l("div",lt,[r("ul",dt,[(a(!0),l(U,null,z(d.tips,(n,h)=>(a(),l("li",{key:h},[r("span",ut,[(a(),B(N(n.icon),{class:C(n.type)},null,8,["class"]))]),r("span",null,[T(m(n.label)+": ",1),r("span",{class:C(["result",n.value.endsWith("/100")?n.type:null])},m(n.value),3)]),o.optionsStore.dynamicOptions.searchAppearance.postTypes[o.postEditorStore.currentPost.postType]&&o.optionsStore.dynamicOptions.searchAppearance.postTypes[o.postEditorStore.currentPost.postType].advanced.showMetaBox?(a(),l("span",{key:0,class:"edit",onClick:_=>d.openSidebar(n.name)},[P(c)],8,pt)):S("",!0)]))),128))]),i.allowed("aioseo_page_analysis")?(a(),l("div",ht,[r("p",mt,m(i.strings.serpPreview)+":",1),P(u,{url:o.tagsStore.liveTags.permalink,title:e.parseTags(o.postEditorStore.currentPost.title||o.postEditorStore.currentPost.tags.title||"#post_title #separator_sa #site_title"),description:e.parseTags(o.postEditorStore.currentPost.description||o.postEditorStore.currentPost.tags.description||"#post_content")},null,8,["url","title","description"])])):S("",!0),i.allowed("aioseo_page_analysis")&&o.postEditorStore.currentPost.canonicalUrl?(a(),l("div",_t,[r("p",gt,[T(m(i.strings.canonicalUrl)+": ",1),r("span",{class:"edit",onClick:t[0]||(t[0]=n=>d.openSidebar("canonical"))},[P(c)])]),r("a",{href:o.postEditorStore.currentPost.canonicalUrl,target:"_blank",rel:"noopener noreferrer"},[r("span",null,m(o.postEditorStore.currentPost.canonicalUrl),1),P(p)],8,ft)])):S("",!0)])):S("",!0)}const V=b(ct,[["render",vt]]),St={},bt={width:"32",height:"32",fill:"none",class:"aioseo-facebook-rounded",xmlns:"http://www.w3.org/2000/svg"},Pt=r("circle",{cx:"16",cy:"16",r:"16",fill:"currentColor"},null,-1),yt=r("path",{d:"M24 16c0-4.4-3.6-8-8-8s-8 3.6-8 8c0 4 2.9 7.3 6.7 7.9v-5.6h-2V16h2v-1.8c0-2 1.2-3.1 3-3.1.9 0 1.8.2 1.8.2v2h-1c-1 0-1.3.6-1.3 1.2V16h2.2l-.4 2.3h-1.9V24c4-.6 6.9-4 6.9-8z",fill:"#fff"},null,-1),wt=[Pt,yt];function xt(e,t){return a(),l("svg",bt,wt)}const Et=b(St,[["render",xt]]),$t={},kt={width:"32",height:"32",fill:"none",class:"aioseo-linkedin-rounded",xmlns:"http://www.w3.org/2000/svg"},At=r("circle",{cx:"16",cy:"16",r:"16",fill:"currentColor"},null,-1),Ct=r("path",{d:"M11.6 24H8.2V13.3h3.4V24zM9.9 11.8C8.8 11.8 8 11 8 9.9 8 8.8 8.9 8 9.9 8c1.1 0 1.9.8 1.9 1.9 0 1.1-.8 1.9-1.9 1.9zM24 24h-3.4v-5.8c0-1.7-.7-2.2-1.7-2.2s-2 .8-2 2.3V24h-3.4V13.3h3.2v1.5c.3-.7 1.5-1.8 3.2-1.8 1.9 0 3.9 1.1 3.9 4.4V24h.2z",fill:"#fff"},null,-1),Tt=[At,Ct];function Rt(e,t){return a(),l("svg",kt,Tt)}const Ot=b($t,[["render",Rt]]),It={},Mt={width:"32",height:"32",fill:"none",class:"aioseo-pinterest-rounded",xmlns:"http://www.w3.org/2000/svg"},Lt=r("circle",{cx:"16",cy:"16",r:"16",fill:"currentColor"},null,-1),Vt=r("path",{d:"M16.056 6.583c-5.312 0-9.658 4.346-9.658 9.658a9.581 9.581 0 005.795 8.813c0-.724 0-1.448.12-2.173.242-.845 1.207-5.312 1.207-5.312s-.362-.604-.362-1.57c0-1.448.846-2.535 1.811-2.535.845 0 1.328.604 1.328 1.45 0 .844-.603 2.172-.845 3.38-.241.965.483 1.81 1.57 1.81 1.81 0 3.018-2.293 3.018-5.19 0-2.174-1.449-3.743-3.984-3.743-2.898 0-4.709 2.173-4.709 4.587 0 .845.242 1.449.604 1.932.12.241.242.241.12.483 0 .12-.12.603-.24.724-.121.242-.242.362-.483.242-1.329-.604-1.932-2.053-1.932-3.743 0-2.777 2.294-6.036 6.881-6.036 3.743 0 6.157 2.656 6.157 5.553 0 3.743-2.052 6.64-5.19 6.64-1.087 0-2.053-.603-2.415-1.207 0 0-.604 2.173-.725 2.656a10.702 10.702 0 01-.966 2.052c.846.242 1.811.363 2.777.363 5.312 0 9.658-4.347 9.658-9.659.121-4.829-4.225-9.175-9.537-9.175z",fill:"#fff"},null,-1),Dt=[Lt,Vt];function Ut(e,t){return a(),l("svg",Mt,Dt)}const zt=b(It,[["render",Ut]]),Bt={setup(){return{tagsStore:F()}},components:{SvgFacebookRounded:Et,SvgLinkedinRounded:Ot,SvgPinterestRounded:zt,SvgIconTwitter:we},data(){return{strings:{title:this.$t.__("Get out the word!",this.$td),description:this.$t.__("Share your content on your favorite social media platforms to drive engagement and increase your SEO.",this.$td)}}},computed:{socialNetworks(){return[{icon:"svg-icon-twitter",link:"https://x.com/share?url="},{icon:"svg-facebook-rounded",link:"https://www.facebook.com/sharer/sharer.php?u="},{icon:"svg-pinterest-rounded",link:"https://pinterest.com/pin/create/button/?url="},{icon:"svg-linkedin-rounded",link:"https://www.linkedin.com/shareArticle?url="}].map(e=>({...e,link:e.link+this.tagsStore.liveTags.permalink}))}}},Nt={key:0,class:"aioseo-post-publish"},Ft={class:"title"},Gt={class:"description"},Wt={class:"links"},Zt=["href"];function Kt(e,t,s,o,i,d){return o.tagsStore.liveTags.permalink?(a(),l("div",Nt,[r("h2",Ft,m(i.strings.title),1),r("p",Gt,m(i.strings.description),1),r("div",Wt,[(a(!0),l(U,null,z(d.socialNetworks,(c,u)=>(a(),l("a",{class:"link",target:"_blank",key:u,href:c.link},[(a(),B(N(c.icon)))],8,Zt))),128))])])):S("",!0)}const jt=b(Bt,[["render",Kt]]);(function(e){var u,p,n,h,_,f,v,w,x,E,$,k,A;if(!ue()||!xe()||!((p=(u=window.wp)==null?void 0:u.editor)!=null&&p.PluginDocumentSettingPanel)&&!((h=(n=window.wp)==null?void 0:n.editPost)!=null&&h.PluginDocumentSettingPanel))return;const t=((_=window==null?void 0:window.editor)==null?void 0:_.PluginDocumentSettingPanel)||((v=(f=window.wp)==null?void 0:f.editPost)==null?void 0:v.PluginDocumentSettingPanel),s=((w=window==null?void 0:window.editor)==null?void 0:w.PluginPrePublishPanel)||((E=(x=window.wp)==null?void 0:x.editPost)==null?void 0:E.PluginPrePublishPanel),o=(($=window==null?void 0:window.editor)==null?void 0:$.PluginPostPublishPanel)||((A=(k=window.wp)==null?void 0:k.editPost)==null?void 0:A.PluginPostPublishPanel),i=e.plugins.registerPlugin;G();const c=pe().aioseo.user;!c.capabilities.aioseo_page_analysis&&!c.capabilities.aioseo_page_general_settings&&!c.capabilities.aioseo_page_advanced_settings||i("aioseo-publish-panel",{render:()=>e.element.createElement(e.element.Fragment,{},e.element.createElement(t,{title:"AIOSEO",className:"aioseo-document-setting aioseo-seo-overview",icon:e.element.Fragment},e.element.createElement("div",{},e.element.createElement("div",{id:"aioseo-document-setting"}))),e.element.createElement(s,{title:["AIOSEO",":",e.element.createElement("span",{key:"scoreDescription",className:"editor-post-publish-panel__link"})],className:"aioseo-pre-publish aioseo-seo-overview",initialOpen:!0,icon:e.element.Fragment},e.element.createElement("div",{},e.element.createElement("div",{id:"aioseo-pre-publish"}))),e.element.createElement(o,{title:"AIOSEO",initialOpen:!0,icon:e.element.Fragment},e.element.createElement("div",{},e.element.createElement("div",{id:"aioseo-post-publish"}))))})})(window.wp);const D=e=>{let t=ie({...e.component,name:"Standalone/PublishPanel"});return t=re(t),t=ne(t),t=ae(t),G(t),t.mount("#"+e.id),window.addEventListener("load",()=>{Ee(t,!1)}),t};window.aioseo.currentPost&&window.aioseo.currentPost.context==="post"&&[{id:"aioseo-pre-publish",component:V},{id:"aioseo-document-setting",component:V},{id:"aioseo-post-publish",component:jt}].forEach(t=>{document.getElementById(t.id)?D(t):($e("#"+t.id,L(t.id)),document.addEventListener("animationstart",function(s){L(t.id)===s.animationName&&D(t)},{passive:!0}))});