import{R as w,C as $,L as v}from"./Redirects.dwvei1_5.js";import{k as g,c as R}from"./links.DYfvsp_u.js";import{J as T}from"./JsonValues.D25FTfEu.js";import{C as b}from"./Index.Di8wjR57.js";import{C}from"./Card.D-184XDc.js";import{C as k}from"./Caret.CE8P-qnG.js";import{x as t,o as s,l as u,m as p,a as f,C as c,D as x,t as U,d as _,c as y}from"./vue.esm-bundler.DqIKZLqK.js";import{_ as h}from"./_plugin-vue_export-helper.BN1snXvA.js";import{A}from"./AddonConditions.C8XINbzC.js";const L={setup(){return{redirectsStore:g(),rootStore:R()}},components:{CoreAlert:k},data(){return{strings:{nginxReload:this.$t.sprintf(this.$t.__("Your redirect settings have been updated. In order for them to work properly you may need to reload your %1$s configuration. %2$s",this.$tdPro),this.detectedServer(),this.$links.getDocLink(this.$constants.GLOBAL_STRINGS.learnMore,"redirectServerConfigReload",!0)),dontKnow:this.$t.__("If you don't know how to do that please revert your Redirect Method to PHP.",this.$tdPro),checkAgain:this.$t.__("Check Again",this.$tdPro)}}},methods:{maybeTest(){this.redirectsStore.testServerRedirects()},detectedServer(){switch(this.rootStore.aioseo.data.server){case"apache":return"Apache";case"nginx":return"NGINX";case"litespeed":return"LiteSpeed";default:return""}}},mounted(){this.maybeTest(),window.aioseoBus.$on("changes-saved",this.maybeTest),window.aioseoBus.$on("added-redirect",this.maybeTest),window.aioseoBus.$on("redirect-updated",this.maybeTest)},beforeUnmount(){window.aioseoBus.$off("changes-saved",this.maybeTest),window.aioseoBus.$off("added-redirect",this.maybeTest),window.aioseoBus.$off("redirect-updated",this.maybeTest)}},B=["innerHTML"],N=["innerHTML"];function M(e,d,m,r,o,n){const i=t("base-button"),a=t("core-alert");return r.redirectsStore.server.redirectTest.failed&&r.redirectsStore.options.main.method==="server"?(s(),u(a,{key:0,size:"small",type:"yellow"},{default:p(()=>[f("div",{innerHTML:o.strings.nginxReload},null,8,B),f("div",{innerHTML:o.strings.dontKnow},null,8,N),c(i,{type:"blue",size:"small",onClick:d[0]||(d[0]=l=>r.redirectsStore.testServerRedirects()),loading:r.redirectsStore.server.redirectTest.testing},{default:p(()=>[x(U(o.strings.checkAgain),1)]),_:1},8,["loading"])]),_:1})):_("",!0)}const P=h(L,[["render",M],["__scopeId","data-v-fef844cd"]]),q={setup(){return{redirectsStore:g()}},components:{CoreAddRedirection:b,CoreCard:C,ServerConfigReloadWarning:P,RedirectsTable:w},mixins:[T],data(){return{queryUrls:[],targetUrl:"",type:0,strings:{addNewRedirection:this.$t.__("Add New Redirection",this.$tdPro)}}},computed:{getType(){return this.type?this.type:-1},getTarget(){return this.targetUrl?this.targetUrl:this.queryUrls.length?"/":""},getUrls(){return this.redirectsStore.manualUrls.length?(this.redirectsStore.manualUrls.forEach(e=>{this.queryUrls.push({url:e.url,regex:e.regex||!1,ignoreSlash:e.slash||!1,ignoreCase:e.case||!1,errors:[],warnings:[]}),e.target&&(this.targetUrl=e.target),e.type&&(this.type=e.type)}),this.queryUrls):this.queryUrls}}},H={class:"aioseo-redirects"};function I(e,d,m,r,o,n){const i=t("server-config-reload-warning"),a=t("core-add-redirection"),l=t("core-card"),S=t("redirects-table");return s(),y("div",H,[c(i),c(l,{slug:"addNewRedirection","header-text":o.strings.addNewRedirection},{default:p(()=>[c(a,{urls:n.getUrls,target:n.getTarget,type:n.getType},null,8,["urls","target","type"])]),_:1},8,["header-text"]),c(S)])}const V=h(q,[["render",I]]),z={mixins:[A],components:{Cta:$,Lite:v,Redirects:V},data(){return{addonSlug:"aioseo-redirects"}}},D={class:"aioseo-redirects-main"};function G(e,d,m,r,o,n){const i=t("redirects",!0),a=t("cta"),l=t("lite");return s(),y("div",D,[e.shouldShowMain?(s(),u(i,{key:0})):_("",!0),e.shouldShowUpdate||e.shouldShowActivate?(s(),u(a,{key:1})):_("",!0),e.shouldShowLite?(s(),u(l,{key:2})):_("",!0)])}const O=h(z,[["render",G]]),Z=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"}));export{O as R,P as S,Z as a};
