import{r as registerInstance,g as getElement}from"./index-b7735e0d.js";import{A as ActiveRouter}from"./active-router-36ad0201.js";import"./state-tunnel-04c0b67a.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};