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