//>>built
define("dojox/form/manager/_NodeMixin","dojo/_base/lang dojo/_base/array dojo/on dojo/dom dojo/dom-attr dojo/query ./_Mixin dijit/form/_FormWidget dijit/_base/manager dojo/_base/declare".split(" "),function(g,e,u,m,k,h,l,v,w,x){l=g.getObject("dojox.form.manager",!0);var p=l.actionAdapter,y=l._keys,z=l.changeEvent=function(a){var c="click";switch(a.tagName.toLowerCase()){case "textarea":c="keyup";break;case "select":c="change";break;case "input":switch(a.type.toLowerCase()){case "text":case "password":c=
"keyup"}}return c},q=function(a,c){var d=k.get(a,"name");c=c||this.domNode;if(!d||d in this.formWidgets)d=null;else{for(var b=a;b&&b!==c;b=b.parentNode)if(k.get(b,"widgetId")&&w.byNode(b).isInstanceOf(v))return null;"input"==a.tagName.toLowerCase()&&"radio"==a.type.toLowerCase()?(b=(b=this.formNodes[d])&&b.node)&&g.isArray(b)?b.push(a):this.formNodes[d]={node:[a],connections:[]}:this.formNodes[d]={node:a,connections:[]}}return d},r=function(a){var c={};p(function(a,b){var d=k.get(b,"data-dojo-observer")||
k.get(b,"observer");d&&"string"==typeof d&&e.forEach(d.split(","),function(a){(a=g.trim(a))&&g.isFunction(this[a])&&(c[a]=1)},this)}).call(this,null,this.formNodes[a].node);return y(c)},t=function(a,c){var d=this.formNodes[a],b=d.connections;b.length&&(e.forEach(b,function(a){a.remove()}),b=d.connections=[]);p(function(d,n){var f=z(n);e.forEach(c,function(c){b.push(u(n,f,g.hitch(this,function(b){if(this.watching)this[c](this.formNodeValue(a),a,n,b)})))},this)}).call(this,null,d.node)};return x("dojox.form.manager._NodeMixin",
null,{destroy:function(){for(var a in this.formNodes)e.forEach(this.formNodes[a].connections,function(a){a.remove()});this.formNodes={};this.inherited(arguments)},registerNode:function(a){"string"==typeof a&&(a=m.byId(a));(a=q.call(this,a))&&t.call(this,a,r.call(this,a));return this},unregisterNode:function(a){a in this.formNodes&&(e.forEach(this.formNodes[a].connections,function(a){a.remove()}),delete this.formNodes[a]);return this},registerNodeDescendants:function(a){"string"==typeof a&&(a=m.byId(a));
h("input, select, textarea, button",a).map(function(c){return q.call(this,c,a)},this).forEach(function(a){a&&t.call(this,a,r.call(this,a))},this);return this},unregisterNodeDescendants:function(a){"string"==typeof a&&(a=m.byId(a));h("input, select, textarea, button",a).map(function(c){return k.get(a,"name")||null}).forEach(function(a){a&&this.unregisterNode(a)},this);return this},formNodeValue:function(a,c){var d=2==arguments.length&&void 0!==c,b;"string"==typeof a&&(a=this.formNodes[a])&&(a=a.node);
if(!a)return null;if(g.isArray(a)){if(d)return e.forEach(a,function(a){a.checked=""}),e.forEach(a,function(a){a.checked=a.value===c?"checked":""}),this;e.some(a,function(a){return a.checked?(b=a,!0):!1});return b?b.value:""}switch(a.tagName.toLowerCase()){case "select":if(a.multiple){if(d){if(g.isArray(c)){var f={};e.forEach(c,function(a){f[a]=1});h("\x3e option",a).forEach(function(a){a.selected=a.value in f});return this}h("\x3e option",a).forEach(function(a){a.selected=a.value===c});return this}b=
h("\x3e option",a).filter(function(a){return a.selected}).map(function(a){return a.value});return 1==b.length?b[0]:b}return d?(h("\x3e option",a).forEach(function(a){a.selected=a.value===c}),this):a.value||"";case "button":return d?(a.innerHTML=""+c,this):a.innerHTML;case "input":if("checkbox"==a.type.toLowerCase())return d?(a.checked=c?"checked":"",this):!!a.checked}return d?(a.value=""+c,this):a.value},inspectFormNodes:function(a,c,d){var b,f={};if(c)if(g.isArray(c))e.forEach(c,function(b){b in
this.formNodes&&(f[b]=a.call(this,b,this.formNodes[b].node,d))},this);else for(b in c)b in this.formNodes&&(f[b]=a.call(this,b,this.formNodes[b].node,c[b]));else for(b in this.formNodes)f[b]=a.call(this,b,this.formNodes[b].node,d);return f}})});