define(["Ti/_/declare","Ti/_/UI/Element","Ti/_/string","Ti/_/Layouts","Ti/UI"],function(t,i,n,o,s){var e=/^horizontal|vertical|constrainingHorizontal|constrainingVertical$/;return t("Ti.UI.View",i,{constructor:function(){this.__values__.constants.children=[],this._setLayout(),this.containerNode=this.domNode},_publish:function(t){this.children.push(t),t._isPublished=1},_unpublish:function(t){var i=this.children,n=i.indexOf(t);~n&&i.splice(n,1)},add:function(t){this._add(t),this._publish(t)},remove:function(t){this._remove(t),this._unpublish(t)},_defaultWidth:s.FILL,_defaultHeight:s.FILL,_setLayout:function(t){return t=e.test(t)?t:"composite",this._layout&&(this._layout.destroy(),this._layout=null),this._layout=new(o[n.capitalize("horizontal"!==t||this.horizontalWrap?t:"constrainingHorizontal")])({element:this}),t},constants:{children:void 0},properties:{layout:{set:"_setLayout"},horizontalWrap:{post:function(){this.layout=this.layout},value:!0}}})});