var touch,__extends=this&&this.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();!function(t){var e;!function(t){t[t.REVIVE=0]="REVIVE",t[t.NO_REVIVE=1]="NO_REVIVE"}(e=t.ReviveChoice||(t.ReviveChoice={}));var o=function(o){function n(){var e=o.call(this)||this;return e._reviveCountdown=0,e._choice=0,e.btnNoRevive.clickHandler=Laya.Handler.create(e,e.onNoRevive,null,!1),e.btnRevive.clickHandler=Laya.Handler.create(e,e.onRevive,null,!1),e.btnRevive.label=t.Lang.getLangText(t.Lang.revive),e.txtScore.text=GameBaseData.score.toFixed(0),e.continueLab.text=t.Lang.getLangText(t.Lang.continue),e.scoreLab.text=t.Lang.getLangText(t.Lang.score),e.no_thanks_lab.text=t.Lang.getLangText(t.Lang.no_thank),e}return __extends(n,o),n.prototype._open=function(t,e,n){this._parent&&(this.width=this._parent.width,this.height=this._parent.height),o.prototype._open.call(this,t,e,n)},n.prototype.onResize=function(){this.adapterScreen()},n.prototype.adapterScreen=function(){var t=GameBaseData.getAdapterRatio();this.scale(t,t)},n.prototype.onTimer=function(){this._reviveCountdown--,this._updateCountDownDisplay(),this._reviveCountdown<=0&&(this.stopTimer(),this.onNoRevive())},n.prototype.stopTimer=function(){this.timer.clearAll(this)},n.prototype.destroy=function(t){o.prototype.destroy.call(this,t),console.info("Dialog Destroyed"),Laya.stage.off(Laya.Event.RESIZE,this,this.onResize)},n.prototype._updateCountDownDisplay=function(){this.txtCountdown.text=this._reviveCountdown.toString()},n.prototype.onRevive=function(){this.stopTimer(),this._choice=e.REVIVE,this._closeHandler&&this._closeHandler(this._choice),this.close("",!1)},n.prototype.onNoRevive=function(){this.stopTimer(),this._choice=e.NO_REVIVE,this._closeHandler&&this._closeHandler(this._choice),this.close("",!1)},Object.defineProperty(n.prototype,"closeHanlder",{set:function(t){this._closeHandler=t},enumerable:!1,configurable:!0}),n.prototype.startCountDown=function(){this._reviveCountdown=t.GameConfig.REVIVE_COUNTDOWN,this._updateCountDownDisplay(),this.timer.loop(1e3,this,this.onTimer),this.updateDisplay()},n.prototype.updateDisplay=function(){this.txtScore.text=GameBaseData.score.toFixed(0)},n}(ui.ReviveDialogUI);t.GameReviveDialog=o}(touch||(touch={}));