import{f as o,u as t,h as a,d as l,i as c,j as d}from"./index.DshNLnwE.js";const p=o("LicenseStore",{state:()=>({showUpgradePopup:!1}),getters:{isUnlicensed:()=>{const n=t();return n.internalOptions.internal.license.disabled||n.internalOptions.internal.license.valid||n.internalOptions.internal.license.expired||!n.internalOptions.internal.license.licenseKey}},actions:{activate(n){return a.post(l.restUrl("license/activate")).send({licenseKey:n}).then(e=>{if(!e.body.success)throw new Error(e.body.message);const s=c(),i=t(),r=d();return i.internalOptions.internal.license.expires=e.body.licenseData.expires,i.internalOptions.internal.license.expired=e.body.licenseData.expired,i.internalOptions.internal.license.invalid=e.body.licenseData.invalid,i.internalOptions.internal.license.disabled=e.body.licenseData.disabled,i.internalOptions.internal.license.level=e.body.licenseData.level,i.internalOptions.internal.license.licenseKey=e.body.licenseData.licenseKey,i.internalOptions.internal.license.quota=e.body.licenseData.quota,i.internalOptions.internal.license.quotaRemaining=e.body.licenseData.quotaRemaining,s.fetchData({limit:r.settings.tablePagination.brokenLinks,offset:0,searchTerm:"",filter:"all"}),window.aioseoBrokenLinkCheckerBus.$emit("checkForActiveScan"),e})},deactivate(){return a.post(l.restUrl("license/deactivate")).send().then(n=>{if(!n.body.success)throw new Error(n.body.message);const e=t();return e.internalOptions.internal.license.expires=n.body.licenseData.expires,e.internalOptions.internal.license.expired=n.body.licenseData.expired,e.internalOptions.internal.license.invalid=n.body.licenseData.invalid,e.internalOptions.internal.license.disabled=n.body.licenseData.disabled,e.internalOptions.internal.license.level=n.body.licenseData.level,e.internalOptions.internal.license.licenseKey=n.body.licenseData.licenseKey,e.internalOptions.internal.license.quota=0,e.internalOptions.internal.license.quotaRemaining=0,n})}}});export{p as u};
