import{r as s,c as e,h as t,H as a}from"./p-78e3ebb9.js";import r from"@rtarojs/taro";import{c as i}from"./p-2fad2a65.js";const o=".navigator-hover{background:#efefef}";const c=class{constructor(t){s(this,t);this.onSuccess=e(this,"cuccess",7);this.onFail=e(this,"fail",7);this.onComplete=e(this,"Complete",7);this.hoverClass=undefined;this.url=undefined;this.openType="navigate";this.isHover=false;this.delta=0}onClick(){const{openType:s,onSuccess:e,onFail:t,onComplete:a}=this;let i=Promise.resolve();switch(s){case"navigate":i=r.navigateTo({url:this.url});break;case"redirect":i=r.redirectTo({url:this.url});break;case"switchTab":i=r.switchTab({url:this.url});break;case"reLaunch":i=r.reLaunch({url:this.url});break;case"navigateBack":i=r.navigateBack({delta:this.delta});break;case"exit":i=Promise.reject(new Error('navigator:fail 暂不支持"openType: exit"'));break}if(i){i.then((s=>{e.emit(s)})).catch((s=>{t.emit(s)})).finally((()=>{a.emit()}))}}render(){const{isHover:s,hoverClass:e}=this;return t(a,{class:i({[e]:s})})}};c.style=o;export{c as taro_navigator_core};
//# sourceMappingURL=p-3d23428c.entry.js.map