define(["Ti/_/declare","Ti/_/lang","Ti/_/Evented","Ti/Locale","Ti/UI","Ti/_/css"],function(t,i,e,o,n,a){return t("Ti.UI.OptionDialog",e,{show:function(){var t=this._optionsWindow=n.createWindow(),e=n.createView({backgroundColor:"black",opacity:0,left:0,top:0,right:0,bottom:0}),d=n.createView({width:"100%",height:n.SIZE,bottom:0,backgroundColor:"white",layout:n._LAYOUT_CONSTRAINING_VERTICAL,opacity:0});t._add(e),t._add(d),d._add(n.createLabel({text:o._getString(this.titleid,this.title),font:{fontWeight:"bold"},left:5,right:5,top:5,height:n.SIZE,textAlign:n.TEXT_ALIGNMENT_CENTER})),require.is(this.options,"Array")&&this.options.forEach(function(e,o,c){var r=n.createButton({left:5,right:5,top:5,bottom:o===c.length-1?5:0,height:n.SIZE,title:e,index:o});o===this.destructive?a.add(r.domNode,"TiUIElementGradientDestructive"):o===this.cancel&&a.add(r.domNode,"TiUIElementGradientCancel"),d._add(r),r.addEventListener("singletap",i.hitch(this,function(){t.close(),this._optionsWindow=void 0,this.fireEvent("click",{index:o,cancel:this.cancel,destructive:this.destructive})}))},this),d.addEventListener("postlayout",function(){setTimeout(function(){d.animate({bottom:-d._measuredHeight,opacity:1,duration:0}),e.animate({opacity:.5,duration:200},function(){d.animate({bottom:0,duration:200})})},0)}),t.open()},properties:{cancel:-1,destructive:-1,options:void 0,title:void 0,titleid:void 0}})});