text: /**
   * Hilo 1.0.1 for commonjs
   * Copyright 2016 alibaba.com
   * Licensed under the MIT License
   */
  var Hilo=require("../core/Hilo"),Class=require("../core/Class"),View=require("./View"),Drawable=require("./Drawable"),Button=Class.create({Extends:View,constructor:function(t){t=t||{},this.id=this.id||t.id||Hilo.getUid("Button"),Button.superclass.constructor.call(this,t),this.drawable=new Drawable(t),this.setState(Button.UP)},upState:null,overState:null,downState:null,disabledState:null,state:null,enabled:!0,useHandCursor:!0,setEnabled:function(t){return this.enabled!=t&&(t?this.setState(Button.UP):this.setState(Button.DISABLED)),this},setState:function(t){if(this.state!==t){this.state=t,this.pointerEnabled=this.enabled=t!==Button.DISABLED;var e;switch(t){case Button.UP:e=this.upState;break;case Button.OVER:e=this.overState;break;case Button.DOWN:e=this.downState;break;case Button.DISABLED:e=this.disabledState}e&&(this.drawable.init(e),Hilo.copy(this,e,!0))}return this},fire:function(t,e){if(this.enabled){var s="string"==typeof t?t:t.type;switch(s){case"mousedown":case"touchstart":case"touchmove":this.setState(Button.DOWN);break;case"mouseover":this.setState(Button.OVER);break;case"mouseup":this.overState?this.setState(Button.OVER):this.upState&&this.setState(Button.UP);break;case"touchend":case"touchout":case"mouseout":this.setState(Button.UP)}return Button.superclass.fire.call(this,t,e)}},Statics:{UP:"up",OVER:"over",DOWN:"down",DISABLED:"disabled"}});module.exports=Button;