//>>built
define("dojo/NodeList-manipulate",["./query","./_base/lang","./_base/array","./dom-construct","./NodeList-dom"],function(j,k,p,l){function n(a){for(var c="",a=a.childNodes,d=0,b;b=a[d];d++)8!=b.nodeType&&(c=1==b.nodeType?c+n(b):c+b.nodeValue);return c}function o(a){for(;a.childNodes[0]&&1==a.childNodes[0].nodeType;)a=a.childNodes[0];return a}function m(a,c){"string"==typeof a?(a=l.toDom(a,c&&c.ownerDocument),11==a.nodeType&&(a=a.childNodes[0])):1==a.nodeType&&a.parentNode&&(a=a.cloneNode(!1));return a}
var f=j.NodeList;k.extend(f,{_placeMultiple:function(a,c){for(var d="string"==typeof a||a.nodeType?j(a):a,b=[],g=0;g<d.length;g++)for(var e=d[g],f=this.length,h=f-1,i;i=this[h];h--)0<g&&(i=this._cloneNode(i),b.unshift(i)),h==f-1?l.place(i,e,c):e.parentNode.insertBefore(i,e),e=i;b.length&&(b.unshift(0),b.unshift(this.length-1),Array.prototype.splice.apply(this,b));return this},innerHTML:function(a){return arguments.length?this.addContent(a,"only"):this[0].innerHTML},text:function(a){if(arguments.length){for(var c=
0,d;d=this[c];c++)1==d.nodeType&&(l.empty(d),d.appendChild(d.ownerDocument.createTextNode(a)));return this}for(var b="",c=0;d=this[c];c++)b+=n(d);return b},val:function(a){if(arguments.length){for(var c=k.isArray(a),d=0,b;b=this[d];d++){var g=b.nodeName.toUpperCase(),e=b.type,f=c?a[d]:a;if("SELECT"==g){g=b.options;for(e=0;e<g.length;e++){var h=g[e];h.selected=b.multiple?-1!=p.indexOf(a,h.value):h.value==f}}else"checkbox"==e||"radio"==e?b.checked=b.value==f:b.value=f}return this}if((b=this[0])&&1==
b.nodeType){a=b.value||"";if("SELECT"==b.nodeName.toUpperCase()&&b.multiple){a=[];g=b.options;for(e=0;e<g.length;e++)h=g[e],h.selected&&a.push(h.value);a.length||(a=null)}return a}},append:function(a){return this.addContent(a,"last")},appendTo:function(a){return this._placeMultiple(a,"last")},prepend:function(a){return this.addContent(a,"first")},prependTo:function(a){return this._placeMultiple(a,"first")},after:function(a){return this.addContent(a,"after")},insertAfter:function(a){return this._placeMultiple(a,
"after")},before:function(a){return this.addContent(a,"before")},insertBefore:function(a){return this._placeMultiple(a,"before")},remove:f.prototype.orphan,wrap:function(a){if(this[0])for(var a=m(a,this[0]),c=0,d;d=this[c];c++){var b=this._cloneNode(a);d.parentNode&&d.parentNode.replaceChild(b,d);o(b).appendChild(d)}return this},wrapAll:function(a){if(this[0]){a=m(a,this[0]);this[0].parentNode.replaceChild(a,this[0]);for(var a=o(a),c=0,d;d=this[c];c++)a.appendChild(d)}return this},wrapInner:function(a){if(this[0])for(var a=
m(a,this[0]),c=0;c<this.length;c++){var d=this._cloneNode(a);this._wrap(k._toArray(this[c].childNodes),null,this._NodeListCtor).wrapAll(d)}return this},replaceWith:function(a){for(var a=this._normalize(a,this[0]),c=0,d;d=this[c];c++)this._place(a,d,"before",0<c),d.parentNode.removeChild(d);return this},replaceAll:function(a){for(var a=j(a),c=this._normalize(this,this[0]),d=0,b;b=a[d];d++)this._place(c,b,"before",0<d),b.parentNode.removeChild(b);return this},clone:function(){for(var a=[],c=0;c<this.length;c++)a.push(this._cloneNode(this[c]));
return this._wrap(a,this,this._NodeListCtor)}});if(!f.prototype.html)f.prototype.html=f.prototype.innerHTML;return f});