import{r as registerInstance,g as getElement}from"./index-55faf181.js";import{A as ActiveRouter}from"./active-router-4c299649.js";import"./state-tunnel-04c0b67a.js";var StencilRouterPrompt=function(){function e(e){registerInstance(this,e);this.when=true;this.message=""}e.prototype.enable=function(e){if(this.unblock){this.unblock()}if(this.history){this.unblock=this.history.block(e)}};e.prototype.disable=function(){if(this.unblock){this.unblock();this.unblock=undefined}};e.prototype.componentWillLoad=function(){if(this.when){this.enable(this.message)}};e.prototype.updateMessage=function(e,t){if(this.when){if(!this.when||t!==e){this.enable(this.message)}}else{this.disable()}};e.prototype.componentDidUnload=function(){this.disable()};e.prototype.render=function(){return null};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{message:["updateMessage"],when:["updateMessage"]}},enumerable:false,configurable:true});return e}();ActiveRouter.injectProps(StencilRouterPrompt,["history"]);export{StencilRouterPrompt as stencil_router_prompt};