//>>built
define("dojox/dtl/contrib/dom","dojo/_base/kernel dojo/_base/lang dojo/_base/connect dojo/dom-style dojo/dom-construct ../_base ../dom".split(" "),function(m,d,c,n,p,h,r){var g=d.getObject("contrib.dom",!0,h),q={render:function(){return this.contents}};g.StyleNode=d.extend(function(b){this.contents={};this._current={};this._styles=b;for(var a in b){if(-1!=b[a].indexOf("{{"))var e=new h.Template(b[a]);else e=d.delegate(q),e.contents=b[a];this.contents[a]=e}},{render:function(b,a){for(var e in this.contents){var c=
this.contents[e].render(b);this._current[e]!=c&&n.set(a.getParent(),e,this._current[e]=c)}return a},unrender:function(b,a){this._current={};return a},clone:function(b){return new this.constructor(this._styles)}});g.BufferNode=d.extend(function(b,a){this.nodelist=b;this.options=a},{_swap:function(b,a){if(!this.swapped&&this.parent.parentNode){if("node"==b){if(3==a.nodeType&&!this.options.text||1==a.nodeType&&!this.options.node)return}else if("class"==b&&"class"!=b)return;this.onAddNode&&c.disconnect(this.onAddNode);
this.onRemoveNode&&c.disconnect(this.onRemoveNode);this.onChangeAttribute&&c.disconnect(this.onChangeAttribute);this.onChangeData&&c.disconnect(this.onChangeData);this.swapped=this.parent.cloneNode(!0);this.parent.parentNode.replaceChild(this.swapped,this.parent)}},render:function(b,a){this.parent=a.getParent();this.options.node&&(this.onAddNode=c.connect(a,"onAddNode",d.hitch(this,"_swap","node")),this.onRemoveNode=c.connect(a,"onRemoveNode",d.hitch(this,"_swap","node")));this.options.text&&(this.onChangeData=
c.connect(a,"onChangeData",d.hitch(this,"_swap","node")));this.options["class"]&&(this.onChangeAttribute=c.connect(a,"onChangeAttribute",d.hitch(this,"_swap","class")));a=this.nodelist.render(b,a);this.swapped?(this.swapped.parentNode.replaceChild(this.parent,this.swapped),p.destroy(this.swapped)):(this.onAddNode&&c.disconnect(this.onAddNode),this.onRemoveNode&&c.disconnect(this.onRemoveNode),this.onChangeAttribute&&c.disconnect(this.onChangeAttribute),this.onChangeData&&c.disconnect(this.onChangeData));
delete this.parent;delete this.swapped;return a},unrender:function(b,a){return this.nodelist.unrender(b,a)},clone:function(b){return new this.constructor(this.nodelist.clone(b),this.options)}});d.mixin(g,{buffer:function(b,a){for(var e=a.contents.split().slice(1),c={},d=!1,f=e.length;f--;)d=!0,c[e[f]]=!0;d||(c.node=!0);e=b.parse(["endbuffer"]);b.next_token();return new g.BufferNode(e,c)},html:function(b,a){m.deprecated("{% html someVariable %}","Use {{ someVariable|safe }} instead");return b.create_variable_node(a.contents.slice(5)+
"|safe")},style_:function(b,a){var c={};a=a.contents.replace(/^style\s+/,"");for(var h=a.split(/\s*;\s*/g),l=0,f;f=h[l];l++){var k=f.split(/\s*:\s*/g);f=k[0];(k=d.trim(k[1]))&&(c[f]=k)}return new g.StyleNode(c)}});h.register.tags("dojox.dtl.contrib",{dom:["html","attr:style","buffer"]});return g});