define(["Ti/_/declare","Ti/_/UI/TextBox","Ti/_/css","Ti/_/dom","Ti/_/lang","Ti/_/style","Ti/UI"],function(t,e,i,s,n,o,r){var a=["None","Line","Bezel","Rounded"],h={post:"_setKeyboardType"},d=o.set,_=require.on;return t("Ti.UI.TextField",e,{constructor:function(){var t=s.create("input",{autocomplete:"off",className:"TiUITextFieldInput"},this.domNode);this._initTextBox(t),this._setKeyboardType(),this.borderStyle=r.INPUT_BORDERSTYLE_BEZEL,this._disconnectFocusEvent=_(t,"focus",this,function(){this._focused=1,this._setInternalText(this.clearOnEdit?"":this._getInternalText())}),this._disconnectBlurEvent=_(t,"blur",this,function(){this._focused=0,this._updateInternalText()})},destroy:function(){this._disconnectFocusEvent(),this._disconnectBlurEvent(),e.prototype.destroy.apply(this,arguments)},_showingHint:1,_setInternalText:function(t){var i=!this._focused&&!t;i!==this._showingHint&&(this._showingHint=i,this._setKeyboardType()),e.prototype._setInternalText.call(this,i?this.hintText:t)},_getInternalText:function(){return this._showingHint?"":e.prototype._getInternalText.call(this)},_defaultWidth:r.SIZE,_defaultHeight:r.SIZE,_getContentSize:function(t){return{width:this._measureText(this.value,this._field,t).width+6,height:this._measureText(this.value,this._field,t).height+6}},_setTouchEnabled:function(t){this.slider&&d(this._field,"pointerEvents",t?"auto":"none")},_setKeyboardType:function(){var t="text";if(this.passwordMask&&!this._showingHint)t="password";else switch(this.keyboardType){case r.KEYBOARD_EMAIL:t="email";break;case r.KEYBOARD_NUMBER_PAD:t="number";break;case r.KEYBOARD_PHONE_PAD:t="tel";break;case r.KEYBOARD_URL:t="url"}try{this._field.type=t}catch(e){this._field.type="text"}},properties:{borderStyle:{set:function(t,e){var s=this.domNode,n="TiUITextFieldBorderStyle";return t!==e&&(i.remove(s,n+a[e]),i.add(s,n+a[t])),t}},clearOnEdit:!1,hintText:{post:"_updateInternalText",value:""},keyboardType:h,passwordMask:h}})});