var d=Object.defineProperty,m=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var r=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var l=(n,t,i)=>t in n?d(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,o=(n,t)=>{for(var i in t||(t={}))k.call(t,i)&&l(n,i,t[i]);if(r)for(var i of r(t))f.call(t,i)&&l(n,i,t[i]);return n},e=(n,t)=>m(n,p(t));import{n as _,V as h}from"./js/vueComponentNormalizer.87056a83.js";import{S as L}from"./js/index.a4161053.js";import{e as v}from"./js/elemLoaded.b1f6e29c.js";import{u as g}from"./js/url.3b1355c1.js";import{b as A,a as w,d as y,s as F}from"./js/index.d328c175.js";import{S}from"./js/Information.f4b75b56.js";import"./js/client.94d919c5.js";import"./js/_commonjsHelpers.f40d732e.js";import"./js/default-i18n.abde8d59.js";import"./js/constants.a1b1778a.js";import"./js/isArrayLikeObject.a4a9229a.js";var x=function(){var n=this,t=n.$createElement,i=n._self._c||t;return n.canShowUpsell?i("div",{staticClass:"aioseo-link-assistant-did-you-know"},[i("svg-circle-information"),i("span",{domProps:{innerHTML:n._s(n.strings.upsell)},on:{click:function(s){s.stopPropagation(),n.disabled=!0}}}),i("svg-close",{nativeOn:{click:function(s){return s.stopPropagation(),n.disableLinkAssistantEducation.apply(null,arguments)}}})],1):n._e()},C=[];const P={components:{SvgCircleInformation:S,SvgClose:L},data(){return{linkFormatValue:{},disabled:!1,url:null,strings:{upsell:this.$t.sprintf(this.$t.__("Did you know you can automatically add internal links using Link Assistant? %1$s",this.$td),this.$links.getPlainLink(this.$constants.GLOBAL_STRINGS.learnMore,this.$aioseo.urls.aio.linkAssistant,!0))}}},computed:e(o(o({},A(["isUnlicensed"])),w(["currentPost"])),{canShowUpsell(){const n=this.$addons.getAddon("aioseo-link-assistant"),{options:t}=this.currentPost,i=t.linkFormat.internalLinkCount,s=t.linkFormat.linkAssistantDismissed;return(this.isUnlicensed||!n||!n.isActive||n.requiresUpgrade)&&2<i&&!s&&!this.disabled&&this.linkFormatValue.url&&this.isInternalLink(this.linkFormatValue.url)}}),methods:e(o({},y(["incrementInternalLinkCount","disableLinkAssistantEducation"])),{async linkAdded(n){var a;await this.$nextTick();const{options:t}=this.currentPost,i=t.linkFormat.internalLinkCount,s=t.linkFormat.linkAssistantDismissed;2<i||s||this.isInternalLink(n.url||((a=n.suggestion)==null?void 0:a.url)||null)&&this.incrementInternalLinkCount()},async setLinkFormatValue(){await this.$nextTick();const n=document.querySelector("#aioseo-link-assistant-education input");!this.linkFormatValue.url&&(n==null?void 0:n.value)&&(this.linkFormatValue=JSON.parse(n.value))},isInternalLink(n){const t=g.parse(n,!1,!0);return n.indexOf("//")===-1&&n.indexOf("/")===0?!0:n.indexOf("#")===0?!1:t.host?t.host===this.$aioseo.urls.domain:!0}}),created(){this.setLinkFormatValue();const{addAction:n,hasAction:t}=window.wp.hooks;t("aioseo-link-format-link-added","aioseo")||n("aioseo-link-format-link-added","aioseo",this.linkAdded)}},u={};var $=_(P,x,C,!1,D,null,null,null);function D(n){for(let t in u)this[t]=u[t]}var I=function(){return $.exports}();const c=()=>{new h({store:F,render:n=>n(I)}).$mount("#aioseo-link-assistant-education-mount")};window.aioseo&&window.aioseo.currentPost&&window.aioseo.currentPost.context==="post"&&(document.getElementById("aioseo-link-assistant-education")?c():(v("#aioseo-link-assistant-education","aioseoLaDidYouKnow"),document.addEventListener("animationstart",function(t){t.animationName==="aioseoLaDidYouKnow"&&c()},{passive:!0})));
