1. Stephen McKamey
  2. duel

Commits

Stephen McKamey  committed 07a2217

minor optimizations in bind

  • Participants
  • Parent commits ee36a33
  • Branches default

Comments (0)

Files changed (3)

File duel-js/src/main/javascript/bind.js

View file
  • Ignore whitespace
 					for (var i=1, length=child.length; i<length; i++) {
 						append(parent, child[i]);
 					}
+
 				} else {
 					// child is an element array
 					parent.push(child);
 				}
 				break;
-	
+
 			case OBJ:
 				// child is attributes object
-				var old = parent[1];
-				if (getType(old) === OBJ) {
-					// merge attribute objects
-					for (var key in child) {
-						if (child.hasOwnProperty(key)) {
-							old[key] = child[key];
+				if (parent.length === 1) {
+					parent.push(child);
+
+				} else {
+					var old = parent[1];
+					if (getType(old) === OBJ) {
+						// merge attribute objects
+						for (var key in child) {
+							if (child.hasOwnProperty(key)) {
+								old[key] = child[key];
+							}
 						}
+
+					} else {
+						// insert attributes object
+						parent.splice(1, 0, child);
 					}
-				} else {
-					// insert attributes object
-					parent.splice(1, 0, child);
 				}
 				break;
 
 			case VAL:
-				var last = parent.length-1;
-				if (last > 0 && getType(parent[last]) === VAL) {
-					// combine string literals
-					parent[last] = '' + parent[last] + child;
-				} else if (child !== '') {
-					// convert primitive to string literal and append
-					parent.push('' + child);
+				if (child !== '') {
+					// coerce primitive to string literal
+					child = '' + child;
+
+					var last = parent.length-1;
+					if (last > 0 && getType(parent[last]) === VAL) {
+						// combine string literals
+						parent[last] += child;
+
+					} else {
+						// append
+						parent.push(child);
+					}
 				}
 				break;
-	
+
 			case NUL:
 				// cull empty values
 				break;
-	
+
 			default:
-				// directly append
+				// append others
 				parent.push(child);
 				break;
 		}
 
 			// just bind to single value
 			items = obj;
+
 		} else {
 			// evaluate for-each loop
 			items = args[EACH];
 				// Closure Compiler type cast
 				append(result, bindContent(/** @type {Array} */(node), items[i], i, length, null, parts));
 			}
+
 		} else if (type !== NUL) {
 			// just bind the single value
 			// Closure Compiler type cast

File duel-js/target/duel.js

View file
  • Ignore whitespace
 					for (var i=1, length=child.length; i<length; i++) {
 						append(parent, child[i]);
 					}
+
 				} else {
 					// child is an element array
 					parent.push(child);
 				}
 				break;
-	
+
 			case OBJ:
 				// child is attributes object
-				var old = parent[1];
-				if (getType(old) === OBJ) {
-					// merge attribute objects
-					for (var key in child) {
-						if (child.hasOwnProperty(key)) {
-							old[key] = child[key];
+				if (parent.length === 1) {
+					parent.push(child);
+
+				} else {
+					var old = parent[1];
+					if (getType(old) === OBJ) {
+						// merge attribute objects
+						for (var key in child) {
+							if (child.hasOwnProperty(key)) {
+								old[key] = child[key];
+							}
 						}
+
+					} else {
+						// insert attributes object
+						parent.splice(1, 0, child);
 					}
-				} else {
-					// insert attributes object
-					parent.splice(1, 0, child);
 				}
 				break;
 
 			case VAL:
-				var last = parent.length-1;
-				if (last > 0 && getType(parent[last]) === VAL) {
-					// combine string literals
-					parent[last] = '' + parent[last] + child;
-				} else if (child !== '') {
-					// convert primitive to string literal and append
-					parent.push('' + child);
+				if (child !== '') {
+					// coerce primitive to string literal
+					child = '' + child;
+
+					var last = parent.length-1;
+					if (last > 0 && getType(parent[last]) === VAL) {
+						// combine string literals
+						parent[last] += child;
+
+					} else {
+						// append
+						parent.push(child);
+					}
 				}
 				break;
-	
+
 			case NUL:
 				// cull empty values
 				break;
-	
+
 			default:
-				// directly append
+				// append others
 				parent.push(child);
 				break;
 		}
 
 			// just bind to single value
 			items = obj;
+
 		} else {
 			// evaluate for-each loop
 			items = args[EACH];
 				// Closure Compiler type cast
 				append(result, bindContent(/** @type {Array} */(node), items[i], i, length, null, parts));
 			}
+
 		} else if (type !== NUL) {
 			// just bind the single value
 			// Closure Compiler type cast

File duel-js/target/duel.min.js

View file
  • Ignore whitespace
-var duel=function(A,k){function w(a){this.value=a}function l(a){switch(typeof a){case "object":return!a?0:x(a)?2:a instanceof w?5:a instanceof Date?4:3;case "function":return 1;case "undefined":return 0;default:return 4}}function o(a){return typeof a==="function"}function p(){this.value=p.FAST?"":[]}function q(a){x(a)||(a=["",a]);this.value=a}function s(a,b){switch(l(b)){case 2:if(b[0]==="")for(var c=1,e=b.length;c<e;c++)s(a,b[c]);else a.push(b);break;case 3:c=a[1];if(l(c)===3)for(e in b)b.hasOwnProperty(e)&&
-(c[e]=b[e]);else a.splice(1,0,b);break;case 4:c=a.length-1;c>0&&l(a[c])===4?a[c]=""+a[c]+b:b!==""&&a.push(""+b);break;case 0:break;default:a.push(b)}}function t(a,b,c,e,d,f){var h=l(a[1])===3;if(a.length===(h?3:2))return m(a[a.length-1],b,c,e,d,f);for(var g=[""],h=h?2:1,i=a.length;h<i;h++)s(g,m(a[h],b,c,e,d,f));return g}function B(a,b,c,e,d,f){for(var h=1,g=a.length;h<g;h++){var i=a[h],j=i[1].test;if(l(i[1])===3&&j&&(o(j)&&(j=j(b,c,e,d)),!j))continue;return t(i,b,c,e,d,f)}return null}function K(a){l(a)!==
-2&&(a=["",a]);var b=function(b){try{var e=m(a,b,0,1,null);return new q(e)}catch(d){return new q("["+d+"]")}};b.getView=function(){return a};return b}function L(a){return typeof a!=="string"?a:a.replace(/[&<>]/g,function(a){switch(a){case "&":return"&amp;";case "<":return"&lt;";case ">":return"&gt;";default:return a}})}function M(a){return typeof a!=="string"?a:a.replace(/[&<>"]/g,function(a){switch(a){case "&":return"&amp;";case "<":return"&lt;";case ">":return"&gt;";case '"':return"&quot;";default:return a}})}
-function C(a,b){var c=b[0]||"",e=b.length,d=1,f,h=N[c];if(c.charAt(0)==="!")b[0]==="!DOCTYPE"?a.append("<!DOCTYPE ",b[1],">"):a.append("<\!--",b[1],"--\>");else{if(c){a.append("<",c);f=b[d];if(l(f)===3){for(var g in f)if(f.hasOwnProperty(g)){a.append(" ",g);var i=f[g];l(i)!==0&&a.append('="',M(i),'"')}d++}h&&a.append(" /");a.append(">")}for(;d<e;d++)f=b[d],x(f)?C(a,f):a.append(L(f));c&&!h&&a.append("</",c,">")}}function D(a){try{var b=new p;C(b,a);return b.toString()}catch(c){return"["+c+"]"}}function r(a){if(a){if(a.charAt(0)===
-"!")return k.createComment(a==="!"?"":a.substr(1)+" ")}else{if(k.createDocumentFragment)return k.createDocumentFragment();a=""}return a.toLowerCase()==="style"&&k.createStyleSheet?k.createStyleSheet():k.createElement(a)}function v(a,b){if(b){var c=(a.tagName||"").toLowerCase();if(a.nodeType===8)b.nodeType===3&&(a.nodeValue+=b.nodeValue);else if(c==="table"&&a.tBodies)if(b.tagName)if((c=b.tagName.toLowerCase())&&c!=="tbody"&&c!=="thead"){var e=a.tBodies.length>0?a.tBodies[a.tBodies.length-1]:null;
-e||(e=r(c==="th"?"thead":"tbody"),a.appendChild(e));e.appendChild(b)}else a.canHaveChildren!==false&&a.appendChild(b);else{if(b.nodeType===11)for(;b.firstChild;)v(a,b.removeChild(b.firstChild))}else if(c==="style"&&k.createStyleSheet)a.cssText=b;else if(a.canHaveChildren!==false)a.appendChild(b);else if(c==="object"&&b.tagName&&b.tagName.toLowerCase()==="param"){try{a.appendChild(b)}catch(d){}try{if(a.object)a.object[b.name]=b.value}catch(f){}}}}function E(a,b,c){o(c)?a.addEventListener?a.addEventListener(b.substr(0,
-2)==="on"?b.substr(2):b,c,false):a[b]=c:typeof c==="string"&&(a[b]=new Function("event",c))}function F(a,b){if(b.name&&k.attachEvent&&!a.parentNode)try{var c=r("<"+a.tagName+' name="'+b.name+'">');a.tagName===c.tagName&&(a=c)}catch(e){}for(var d in b)if(b.hasOwnProperty(d)){var c=b[d],f=l(c);if(d)f===0&&(c="",f=4),d=O[d.toLowerCase()]||d,d==="style"?typeof a.style.cssText!=="undefined"?a.style.cssText=c:a.style=c:d==="class"?a.className=c:d.substr(0,2)==="on"?(E(a,d,c),u[d]&&E(a,u[d],c)):f===4&&d.charAt(0)!==
-"$"?(a.setAttribute(d,c),u[d]&&a.setAttribute(u[d],c)):(a[d]=c,u[d]&&(a[u[d]]=c))}return a}function G(a){return!!a&&a.nodeType===3&&(!a.nodeValue||!/\S/.exec(a.nodeValue))}function H(a,b){if(a&&a.nodeType===3&&b.exec(a.nodeValue))a.nodeValue=a.nodeValue.replace(b,"")}function y(a){if(a){for(;G(a.firstChild);)a.removeChild(a.firstChild);for(H(a.firstChild,P);G(a.lastChild);)a.removeChild(a.lastChild);H(a.lastChild,Q)}}function I(a,b){var c=a[b];if(c){try{delete a[b]}catch(e){a[b]=void 0}if(!o(c))try{c=
-new Function(""+c)}catch(d){c=null}}return c}function J(a){if(a){var b=I(a,"$init");b&&b.call(a);(b=I(a,"$load"))?setTimeout(function(){b.call(a);b=a=null},0):b=a=null}}function z(a,b){for(var c=1,e=b.length;c<e;c++){var d=b[c];switch(l(d)){case 2:var f=d[0],d=z(r(f),d);if(f==="html")return y(d),J(d),d;v(a,d);break;case 4:d!==""&&v(a,k.createTextNode(""+d));break;case 3:a.nodeType===1&&(a=F(a,d));break;case 5:var f=v,h=a;var g=d,d=r("div");d.innerHTML=""+g;y(d);if(d.childNodes.length===1)d=d.firstChild;
-else{for(g=r("");d.firstChild;)g.appendChild(d.firstChild);d=g}f(h,d)}}y(a);J(a);if(a.nodeType===11&&a.childNodes.length===1)a=a.firstChild;return a}w.prototype.toString=function(){return this.value};var x=Array.isArray||function(a){return a instanceof Array};p.FAST=!A.ScriptEngineMajorVersion;p.prototype.append=function(a,b,c){p.FAST?(this.value+=a,b!==null&&b!==void 0&&(this.value+=b,c!==null&&c!==void 0&&(this.value+=c))):this.value.push.apply(this.value,arguments)};p.prototype.clear=function(){this.value=
-p.FAST?"":[]};p.prototype.toString=function(){return p.FAST?this.value:this.value.join("")};var m;m=function(a,b,c,e,d,f){switch(l(a)){case 1:return a(b,c,e,d);case 2:var h=a[0]||"";switch(h){case "$for":a:{var g=a[1]||{},h=[""],i;if(g.hasOwnProperty("count")){i=g.count;o(i)&&(i=i(b,c,e,d));g.hasOwnProperty("data")?(g=g.data,o(g)&&(g=g(b,c,e,d))):g=b;for(b=0;b<i;b++)s(h,t(a,g,b,i,null,f))}else{if(g.hasOwnProperty("in")){var j=g["in"];o(j)&&(j=j(b,c,e,d));if(l(j)===3){g=[];for(i in j)j.hasOwnProperty(i)&&
-g.push(i);for(b=0,i=g.length;b<i;b++)s(h,t(a,j[g[b]],b,i,g[b],f));a=h;break a}g=j}else g=g.each,o(g)&&(g=g(b,c,e,d));b=l(g);if(b===2)for(b=0,i=g.length;b<i;b++)s(h,t(a,g[b],b,i,null,f));else b!==0&&(h=t(a,g,0,1,null,f))}a=h}return a;case "$xor":return B(a,b,c,e,d,f);case "$if":return B(["$xor",a],b,c,e,d,f);case "$call":f=a[1]||{};if(f.view){h=m(f.view,b,c,e,d);g=f.hasOwnProperty("data")?m(f.data,b,c,e,d):b;i=f.hasOwnProperty("index")?m(f.index,b,c,e,d):c;j=f.hasOwnProperty("count")?m(f.count,b,c,
-e,d):e;b=f.hasOwnProperty("key")?m(f.key,b,c,e,d):d;c={};for(e=a.length-1;e>=2;e--)d=a[e],f=d[1]||{},f.hasOwnProperty("name")&&(c[f.name]=d);a=h&&o(h.getView)?m(h.getView(),g,i,j,b,c):null}else a=null;return a;case "$part":return h=(a[1]||{}).name||"",h=f&&f.hasOwnProperty(h)?f[h]:a,t(h,b,c,e,d)}h=[h];g=1;for(i=a.length;g<i;g++)s(h,m(a[g],b,c,e,d,f));return h;case 3:f={};for(h in a)a.hasOwnProperty(h)&&(f[h]=m(a[h],b,c,e,d));return f}return a};var n=A.duel=function(a){return o(a)&&o(a.getView)?a:
-K(a)};n.raw=n.raw=function(a){return new w(a)};var N={area:true,base:true,basefont:true,br:true,col:true,frame:true,hr:true,img:true,input:true,isindex:true,keygen:true,link:true,meta:true,param:true,source:true,wbr:true};q.prototype.toString=function(){return D(this.value)};n.write=n.write=function(a,b,c,e,d){a=n(a).getView();a=m(a,b,c,e,d);k.write(D(a))};var O={rowspan:"rowSpan",colspan:"colSpan",cellpadding:"cellPadding",cellspacing:"cellSpacing",tabindex:"tabIndex",accesskey:"accessKey",hidefocus:"hideFocus",
-usemap:"useMap",maxlength:"maxLength",readonly:"readOnly",contenteditable:"contentEditable"},u={enctype:"encoding",onscroll:"DOMMouseScroll"},P=/^[\r\n]+/,Q=/[\r\n]+$/;q.prototype.toDOM=q.prototype.toDOM=function(){try{return z(r(this.value[0]),this.value)}catch(a){return k.createTextNode("["+a+"]")}};q.prototype.reload=q.prototype.reload=function(){var a=k;try{var b=this.toDOM();a.replaceChild(b,a.documentElement);if(a.createStyleSheet){for(var c=b.firstChild;c&&(c.tagName||"")!=="HEAD";)c=c.nextSibling;
-for(var e=c&&c.firstChild;e;){if((e.tagName||"")==="LINK")e.href=e.href;e=e.nextSibling}}}catch(d){a=a.open("text/html"),a.write(this.toString()),a.close()}};n.attr=n.attr=function(a,b,c,e,d,f){l(a)===4&&(a=k.getElementById(a));a&&(b=m(b,c,e,d,f),F(a,b))};n.replace=n.replace=function(a,b,c,e,d,f){l(a)===4&&(a=k.getElementById(a));if(a&&a.parentNode){b=n(b).getView();b=m(b,c,e,d,f);try{b=z(r(b[0]),b)}catch(h){b=k.createTextNode("["+h+"]")}a.parentNode.replaceChild(b,a)}};return n}(window,document);
+var duel=function(A,k){function w(a){this.value=a}function l(a){switch(typeof a){case "object":return!a?0:x(a)?2:a instanceof w?5:a instanceof Date?4:3;case "function":return 1;case "undefined":return 0;default:return 4}}function o(a){return typeof a==="function"}function p(){this.value=p.FAST?"":[]}function q(a){x(a)||(a=["",a]);this.value=a}function s(a,b){switch(l(b)){case 2:if(b[0]==="")for(var c=1,e=b.length;c<e;c++)s(a,b[c]);else a.push(b);break;case 3:if(a.length===1)a.push(b);else if(c=a[1],
+l(c)===3)for(e in b)b.hasOwnProperty(e)&&(c[e]=b[e]);else a.splice(1,0,b);break;case 4:b!==""&&(b=""+b,c=a.length-1,c>0&&l(a[c])===4?a[c]+=b:a.push(b));break;case 0:break;default:a.push(b)}}function t(a,b,c,e,d,f){var h=l(a[1])===3;if(a.length===(h?3:2))return m(a[a.length-1],b,c,e,d,f);for(var g=[""],h=h?2:1,i=a.length;h<i;h++)s(g,m(a[h],b,c,e,d,f));return g}function B(a,b,c,e,d,f){for(var h=1,g=a.length;h<g;h++){var i=a[h],j=i[1].test;if(l(i[1])===3&&j&&(o(j)&&(j=j(b,c,e,d)),!j))continue;return t(i,
+b,c,e,d,f)}return null}function K(a){l(a)!==2&&(a=["",a]);var b=function(b){try{var e=m(a,b,0,1,null);return new q(e)}catch(d){return new q("["+d+"]")}};b.getView=function(){return a};return b}function L(a){return typeof a!=="string"?a:a.replace(/[&<>]/g,function(a){switch(a){case "&":return"&amp;";case "<":return"&lt;";case ">":return"&gt;";default:return a}})}function M(a){return typeof a!=="string"?a:a.replace(/[&<>"]/g,function(a){switch(a){case "&":return"&amp;";case "<":return"&lt;";case ">":return"&gt;";
+case '"':return"&quot;";default:return a}})}function C(a,b){var c=b[0]||"",e=b.length,d=1,f,h=N[c];if(c.charAt(0)==="!")b[0]==="!DOCTYPE"?a.append("<!DOCTYPE ",b[1],">"):a.append("<\!--",b[1],"--\>");else{if(c){a.append("<",c);f=b[d];if(l(f)===3){for(var g in f)if(f.hasOwnProperty(g)){a.append(" ",g);var i=f[g];l(i)!==0&&a.append('="',M(i),'"')}d++}h&&a.append(" /");a.append(">")}for(;d<e;d++)f=b[d],x(f)?C(a,f):a.append(L(f));c&&!h&&a.append("</",c,">")}}function D(a){try{var b=new p;C(b,a);return b.toString()}catch(c){return"["+
+c+"]"}}function r(a){if(a){if(a.charAt(0)==="!")return k.createComment(a==="!"?"":a.substr(1)+" ")}else{if(k.createDocumentFragment)return k.createDocumentFragment();a=""}return a.toLowerCase()==="style"&&k.createStyleSheet?k.createStyleSheet():k.createElement(a)}function v(a,b){if(b){var c=(a.tagName||"").toLowerCase();if(a.nodeType===8)b.nodeType===3&&(a.nodeValue+=b.nodeValue);else if(c==="table"&&a.tBodies)if(b.tagName)if((c=b.tagName.toLowerCase())&&c!=="tbody"&&c!=="thead"){var e=a.tBodies.length>
+0?a.tBodies[a.tBodies.length-1]:null;e||(e=r(c==="th"?"thead":"tbody"),a.appendChild(e));e.appendChild(b)}else a.canHaveChildren!==false&&a.appendChild(b);else{if(b.nodeType===11)for(;b.firstChild;)v(a,b.removeChild(b.firstChild))}else if(c==="style"&&k.createStyleSheet)a.cssText=b;else if(a.canHaveChildren!==false)a.appendChild(b);else if(c==="object"&&b.tagName&&b.tagName.toLowerCase()==="param"){try{a.appendChild(b)}catch(d){}try{if(a.object)a.object[b.name]=b.value}catch(f){}}}}function E(a,b,
+c){o(c)?a.addEventListener?a.addEventListener(b.substr(0,2)==="on"?b.substr(2):b,c,false):a[b]=c:typeof c==="string"&&(a[b]=new Function("event",c))}function F(a,b){if(b.name&&k.attachEvent&&!a.parentNode)try{var c=r("<"+a.tagName+' name="'+b.name+'">');a.tagName===c.tagName&&(a=c)}catch(e){}for(var d in b)if(b.hasOwnProperty(d)){var c=b[d],f=l(c);if(d)f===0&&(c="",f=4),d=O[d.toLowerCase()]||d,d==="style"?typeof a.style.cssText!=="undefined"?a.style.cssText=c:a.style=c:d==="class"?a.className=c:d.substr(0,
+2)==="on"?(E(a,d,c),u[d]&&E(a,u[d],c)):f===4&&d.charAt(0)!=="$"?(a.setAttribute(d,c),u[d]&&a.setAttribute(u[d],c)):(a[d]=c,u[d]&&(a[u[d]]=c))}return a}function G(a){return!!a&&a.nodeType===3&&(!a.nodeValue||!/\S/.exec(a.nodeValue))}function H(a,b){if(a&&a.nodeType===3&&b.exec(a.nodeValue))a.nodeValue=a.nodeValue.replace(b,"")}function y(a){if(a){for(;G(a.firstChild);)a.removeChild(a.firstChild);for(H(a.firstChild,P);G(a.lastChild);)a.removeChild(a.lastChild);H(a.lastChild,Q)}}function I(a,b){var c=
+a[b];if(c){try{delete a[b]}catch(e){a[b]=void 0}if(!o(c))try{c=new Function(""+c)}catch(d){c=null}}return c}function J(a){if(a){var b=I(a,"$init");b&&b.call(a);(b=I(a,"$load"))?setTimeout(function(){b.call(a);b=a=null},0):b=a=null}}function z(a,b){for(var c=1,e=b.length;c<e;c++){var d=b[c];switch(l(d)){case 2:var f=d[0],d=z(r(f),d);if(f==="html")return y(d),J(d),d;v(a,d);break;case 4:d!==""&&v(a,k.createTextNode(""+d));break;case 3:a.nodeType===1&&(a=F(a,d));break;case 5:var f=v,h=a;var g=d,d=r("div");
+d.innerHTML=""+g;y(d);if(d.childNodes.length===1)d=d.firstChild;else{for(g=r("");d.firstChild;)g.appendChild(d.firstChild);d=g}f(h,d)}}y(a);J(a);if(a.nodeType===11&&a.childNodes.length===1)a=a.firstChild;return a}w.prototype.toString=function(){return this.value};var x=Array.isArray||function(a){return a instanceof Array};p.FAST=!A.ScriptEngineMajorVersion;p.prototype.append=function(a,b,c){p.FAST?(this.value+=a,b!==null&&b!==void 0&&(this.value+=b,c!==null&&c!==void 0&&(this.value+=c))):this.value.push.apply(this.value,
+arguments)};p.prototype.clear=function(){this.value=p.FAST?"":[]};p.prototype.toString=function(){return p.FAST?this.value:this.value.join("")};var m;m=function(a,b,c,e,d,f){switch(l(a)){case 1:return a(b,c,e,d);case 2:var h=a[0]||"";switch(h){case "$for":a:{var g=a[1]||{},h=[""],i;if(g.hasOwnProperty("count")){i=g.count;o(i)&&(i=i(b,c,e,d));g.hasOwnProperty("data")?(g=g.data,o(g)&&(g=g(b,c,e,d))):g=b;for(b=0;b<i;b++)s(h,t(a,g,b,i,null,f))}else{if(g.hasOwnProperty("in")){var j=g["in"];o(j)&&(j=j(b,
+c,e,d));if(l(j)===3){g=[];for(i in j)j.hasOwnProperty(i)&&g.push(i);for(b=0,i=g.length;b<i;b++)s(h,t(a,j[g[b]],b,i,g[b],f));a=h;break a}g=j}else g=g.each,o(g)&&(g=g(b,c,e,d));b=l(g);if(b===2)for(b=0,i=g.length;b<i;b++)s(h,t(a,g[b],b,i,null,f));else b!==0&&(h=t(a,g,0,1,null,f))}a=h}return a;case "$xor":return B(a,b,c,e,d,f);case "$if":return B(["$xor",a],b,c,e,d,f);case "$call":f=a[1]||{};if(f.view){h=m(f.view,b,c,e,d);g=f.hasOwnProperty("data")?m(f.data,b,c,e,d):b;i=f.hasOwnProperty("index")?m(f.index,
+b,c,e,d):c;j=f.hasOwnProperty("count")?m(f.count,b,c,e,d):e;b=f.hasOwnProperty("key")?m(f.key,b,c,e,d):d;c={};for(e=a.length-1;e>=2;e--)d=a[e],f=d[1]||{},f.hasOwnProperty("name")&&(c[f.name]=d);a=h&&o(h.getView)?m(h.getView(),g,i,j,b,c):null}else a=null;return a;case "$part":return h=(a[1]||{}).name||"",h=f&&f.hasOwnProperty(h)?f[h]:a,t(h,b,c,e,d)}h=[h];g=1;for(i=a.length;g<i;g++)s(h,m(a[g],b,c,e,d,f));return h;case 3:f={};for(h in a)a.hasOwnProperty(h)&&(f[h]=m(a[h],b,c,e,d));return f}return a};
+var n=A.duel=function(a){return o(a)&&o(a.getView)?a:K(a)};n.raw=n.raw=function(a){return new w(a)};var N={area:true,base:true,basefont:true,br:true,col:true,frame:true,hr:true,img:true,input:true,isindex:true,keygen:true,link:true,meta:true,param:true,source:true,wbr:true};q.prototype.toString=function(){return D(this.value)};n.write=n.write=function(a,b,c,e,d){a=n(a).getView();a=m(a,b,c,e,d);k.write(D(a))};var O={rowspan:"rowSpan",colspan:"colSpan",cellpadding:"cellPadding",cellspacing:"cellSpacing",
+tabindex:"tabIndex",accesskey:"accessKey",hidefocus:"hideFocus",usemap:"useMap",maxlength:"maxLength",readonly:"readOnly",contenteditable:"contentEditable"},u={enctype:"encoding",onscroll:"DOMMouseScroll"},P=/^[\r\n]+/,Q=/[\r\n]+$/;q.prototype.toDOM=q.prototype.toDOM=function(){try{return z(r(this.value[0]),this.value)}catch(a){return k.createTextNode("["+a+"]")}};q.prototype.reload=q.prototype.reload=function(){var a=k;try{var b=this.toDOM();a.replaceChild(b,a.documentElement);if(a.createStyleSheet){for(var c=
+b.firstChild;c&&(c.tagName||"")!=="HEAD";)c=c.nextSibling;for(var e=c&&c.firstChild;e;){if((e.tagName||"")==="LINK")e.href=e.href;e=e.nextSibling}}}catch(d){a=a.open("text/html"),a.write(this.toString()),a.close()}};n.attr=n.attr=function(a,b,c,e,d,f){l(a)===4&&(a=k.getElementById(a));a&&(b=m(b,c,e,d,f),F(a,b))};n.replace=n.replace=function(a,b,c,e,d,f){l(a)===4&&(a=k.getElementById(a));if(a&&a.parentNode){b=n(b).getView();b=m(b,c,e,d,f);try{b=z(r(b[0]),b)}catch(h){b=k.createTextNode("["+h+"]")}a.parentNode.replaceChild(b,
+a)}};return n}(window,document);