import{r as registerInstance,c as createEvent,h,H as Host}from"./index-c948674f.js";import Taro from"@rtarojs/taro";import{c as classnames}from"./index-394db4c1.js";var indexCss=".navigator-hover{background:#efefef}";var Navigator=function(){function e(e){registerInstance(this,e);this.onSuccess=createEvent(this,"cuccess",7);this.onFail=createEvent(this,"fail",7);this.onComplete=createEvent(this,"Complete",7);this.hoverClass=undefined;this.url=undefined;this.openType="navigate";this.isHover=false;this.delta=0}e.prototype.onClick=function(){var e=this,a=e.openType,t=e.onSuccess,r=e.onFail,s=e.onComplete;var i=Promise.resolve();switch(a){case"navigate":i=Taro.navigateTo({url:this.url});break;case"redirect":i=Taro.redirectTo({url:this.url});break;case"switchTab":i=Taro.switchTab({url:this.url});break;case"reLaunch":i=Taro.reLaunch({url:this.url});break;case"navigateBack":i=Taro.navigateBack({delta:this.delta});break;case"exit":i=Promise.reject(new Error('navigator:fail 暂不支持"openType: exit"'));break}if(i){i.then((function(e){t.emit(e)})).catch((function(e){r.emit(e)})).finally((function(){s.emit()}))}};e.prototype.render=function(){var e;var a=this,t=a.isHover,r=a.hoverClass;return h(Host,{class:classnames((e={},e[r]=t,e))})};return e}();Navigator.style=indexCss;export{Navigator as taro_navigator_core};
//# sourceMappingURL=taro-navigator-core.entry.js.map