import{r as registerInstance,d as getElement}from"./index-67f7ec52.js";import{A as ActiveRouter}from"./active-router-2beca2cb.js";var getUrl=function(t,e){if(t.charAt(0)=="/"&&e.charAt(e.length-1)=="/"){return e.slice(0,e.length-1)+t}return e+t};var Redirect=function(){function t(t){registerInstance(this,t)}t.prototype.componentWillLoad=function(){if(this.history&&this.root&&this.url){return this.history.replace(getUrl(this.url,this.root))}};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ActiveRouter.injectProps(Redirect,["history","root"]);export{Redirect as stencil_router_redirect};