//>>built
define("dojox/form/manager/_Mixin","dojo/_base/window,dojo/_base/lang,dojo/_base/array,dojo/_base/connect,dojo/dom-attr,dojo/dom-class,dijit/_base/manager,dijit/_Widget,dijit/form/_FormWidget,dijit/form/Button,dijit/form/CheckBox,dojo/_base/declare".split(","),function(j,g,f,k,m,r,i,s,n,t,u,l){var j=g.getObject("dojox.form.manager",!0),v=j.actionAdapter=function(a){return function(b,d,c){g.isArray(d)?f.forEach(d,function(d){a.call(this,b,d,c)},this):a.apply(this,arguments)}};j.inspectorAdapter=function(a){return function(b,
d,c){return a.call(this,b,g.isArray(d)?d[0]:d,c)}};var w={domNode:1,containerNode:1,srcNodeRef:1,bgIframe:1},x=j._keys=function(a){var b=[],d;for(d in a)a.hasOwnProperty(d)&&b.push(d);return b},o=function(a){var b=a.get("name");if(b&&a instanceof n)if(b in this.formWidgets){var d=this.formWidgets[b].widget;g.isArray(d)?d.push(a):this.formWidgets[b].widget=[d,a]}else this.formWidgets[b]={widget:a,connections:[]};else b=null;return b},p=function(a){var b={};v(function(a,c){var e=c.get("observer");e&&
"string"==typeof e&&f.forEach(e.split(","),function(a){(a=g.trim(a))&&g.isFunction(this[a])&&(b[a]=1)},this)}).call(this,null,this.formWidgets[a].widget);return x(b)},q=function(a,b){var d=this.formWidgets[a],c=d.widget,e=d.connections;if(e.length)f.forEach(e,k.disconnect),e=d.connections=[];if(g.isArray(c))f.forEach(c,function(c){f.forEach(b,function(b){e.push(k.connect(c,"onChange",this,function(d){if(this.watching&&m.get(c.focusNode,"checked"))this[b](c.get("value"),a,c,d)}))},this)},this);else{var h=
c.isInstanceOf(t)?"onClick":"onChange";f.forEach(b,function(b){e.push(k.connect(c,h,this,function(d){if(this.watching)this[b](c.get("value"),a,c,d)}))},this)}},l=l("dojox.form.manager._Mixin",null,{watching:!0,startup:function(){if(!this._started)this.formWidgets={},this.formNodes={},this.registerWidgetDescendants(this),this.inherited(arguments)},destroy:function(){for(var a in this.formWidgets)f.forEach(this.formWidgets[a].connections,k.disconnect);this.formWidgets={};this.inherited(arguments)},
registerWidget:function(a){"string"==typeof a?a=i.byId(a):a.tagName&&a.cloneNode&&(a=i.byNode(a));(a=o.call(this,a))&&q.call(this,a,p.call(this,a));return this},unregisterWidget:function(a){a in this.formWidgets&&(f.forEach(this.formWidgets[a].connections,this.disconnect,this),delete this.formWidgets[a]);return this},registerWidgetDescendants:function(a){"string"==typeof a?a=i.byId(a):a.tagName&&a.cloneNode&&(a=i.byNode(a));var b=f.map(a.getDescendants(),o,this);f.forEach(b,function(a){a&&q.call(this,
a,p.call(this,a))},this);return this.registerNodeDescendants?this.registerNodeDescendants(a.domNode):this},unregisterWidgetDescendants:function(a){"string"==typeof a?a=i.byId(a):a.tagName&&a.cloneNode&&(a=i.byNode(a));f.forEach(f.map(a.getDescendants(),function(a){return a instanceof n&&a.get("name")||null}),function(a){a&&this.unregisterWidget(a)},this);return this.unregisterNodeDescendants?this.unregisterNodeDescendants(a.domNode):this},formWidgetValue:function(a,b){var d=2==arguments.length&&void 0!==
b,c;if("string"==typeof a&&(a=this.formWidgets[a]))a=a.widget;if(!a)return null;if(g.isArray(a)){if(d)return f.forEach(a,function(a){a.set("checked",!1,!this.watching)},this),f.forEach(a,function(a){a.set("checked",a.value===b,!this.watching)},this),this;f.some(a,function(a){return m.get(a.focusNode,"checked")?(c=a,!0):!1});return c?c.get("value"):""}if(a.isInstanceOf&&a.isInstanceOf(u))return d?(a.set("value",Boolean(b),!this.watching),this):Boolean(a.get("value"));return d?(a.set("value",b,!this.watching),
this):a.get("value")},formPointValue:function(a,b){a&&"string"==typeof a&&(a=this[a]);if(!a||!a.tagName||!a.cloneNode||!r.contains(a,"dojoFormValue"))return null;return 2==arguments.length&&void 0!==b?(a.innerHTML=b,this):a.innerHTML},inspectFormWidgets:function(a,b,d){var c,e={};if(b)if(g.isArray(b))f.forEach(b,function(b){b in this.formWidgets&&(e[b]=a.call(this,b,this.formWidgets[b].widget,d))},this);else for(c in b)c in this.formWidgets&&(e[c]=a.call(this,c,this.formWidgets[c].widget,b[c]));else for(c in this.formWidgets)e[c]=
a.call(this,c,this.formWidgets[c].widget,d);return e},inspectAttachedPoints:function(a,b,d){var c,e={};if(b)if(g.isArray(b))f.forEach(b,function(b){var c=this[b];c&&c.tagName&&c.cloneNode&&(e[b]=a.call(this,b,c,d))},this);else for(c in b){var h=this[c];h&&h.tagName&&h.cloneNode&&(e[c]=a.call(this,c,h,b[c]))}else for(c in this)c in w||(h=this[c])&&h.tagName&&h.cloneNode&&(e[c]=a.call(this,c,h,d));return e},inspect:function(a,b,d){var c=this.inspectFormWidgets(function(b,c,d){return g.isArray(c)?a.call(this,
b,f.map(c,function(a){return a.domNode}),d):a.call(this,b,c.domNode,d)},b,d);this.inspectFormNodes&&g.mixin(c,this.inspectFormNodes(a,b,d));return g.mixin(c,this.inspectAttachedPoints(a,b,d))}});g.extend(s,{observer:""});return l});