Bug 1354211 - Remove clearElement atom. r=automatedtester

The previous patch in this changeset made us independent from the
Selenium clearElement atom.

MozReview-Commit-ID: DejxgD9t9Go

--HG--
extra : rebase_source : 9bec429fc69f63797c79b51ee9b2f8d33a2a07a6
This commit is contained in:
Andreas Tolfsen 2017-12-31 14:57:11 +00:00
Родитель a2f89134da
Коммит 03e9ea6c76
1 изменённых файлов: 0 добавлений и 85 удалений

Просмотреть файл

@ -17,91 +17,6 @@ this.EXPORTED_SYMBOLS = ["atom"];
/** @namespace */
this.atom = {};
// https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/action.js#L83
atom.clearElement = function(element, window){return function(){var g,k=this;function m(a){return void 0!==a}function n(a){return"string"==typeof a}function aa(a){return"number"==typeof a}function ba(a,b){a=a.split(".");var c=k;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&m(b)?c[d]=b:c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}}
function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){return"function"==ca(a)}function ea(a,b,c){return a.call.apply(a.bind,arguments)}function fa(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}
function ga(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ga=ea:ga=fa;return ga.apply(null,arguments)}function ha(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}
function p(a,b){function c(){}c.prototype=b.prototype;a.U=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.S=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};var ia=window;function ja(a,b){this.code=a;this.a=r[a]||ka;this.message=b||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}p(ja,Error);var ka="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=ka;r[30]=ka;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state";
r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=ka;r[9]="unknown command";ja.prototype.toString=function(){return this.name+": "+this.message};var la={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function ma(a,b){this.width=a;this.height=b}g=ma.prototype;g.toString=function(){return"("+this.width+" x "+this.height+")"};g.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};g.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};g.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};g.scale=function(a,b){b=aa(b)?b:a;this.width*=a;this.height*=b;return this};function oa(a){var b=pa;return Object.prototype.hasOwnProperty.call(b,"1.9.2")?b["1.9.2"]:b["1.9.2"]=a("1.9.2")};var qa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function ra(a,b){return a<b?-1:a>b?1:0}function sa(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};
function ta(a,b,c){this.a=a;this.b=b||1;this.f=c||1};function ua(a){this.b=a;this.a=0}function va(a){a=a.match(wa);for(var b=0;b<a.length;b++)xa.test(a[b])&&a.splice(b,1);return new ua(a)}var wa=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,xa=/^\s/;function t(a,b){return a.b[a.a+(b||0)]}function u(a){return a.b[a.a++]}function ya(a){return a.b.length<=a.a};var za;a:{var Aa=k.navigator;if(Aa){var Ba=Aa.userAgent;if(Ba){za=Ba;break a}}za=""};function x(a,b){this.j=a;this.c=m(b)?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Ca(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}x.prototype.a=function(a){return null===this.b||this.b==a.nodeType};x.prototype.f=function(){return this.j};
x.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=y(this.c));return a};function Da(a,b){this.o=a.toLowerCase();a="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.b=b?b.toLowerCase():a}Da.prototype.a=function(a){var b=a.nodeType;if(1!=b&&2!=b)return!1;b=m(a.localName)?a.localName:a.nodeName;return"*"!=this.o&&this.o!=b.toLowerCase()?!1:"*"==this.b?!0:this.b==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Da.prototype.f=function(){return this.o};
Da.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.b?"":this.b+":")+this.o};function Ea(a){switch(a.nodeType){case 1:return ha(Fa,a);case 9:return Ea(a.documentElement);case 11:case 10:case 6:case 12:return Ga;default:return a.parentNode?Ea(a.parentNode):Ga}}function Ga(){return null}function Fa(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Fa(a.parentNode,b):null};function Ha(a,b){if(n(a))return n(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function z(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function Ia(a,b,c){var d=c;z(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function A(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}
function Ja(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0}function Ka(a){return Array.prototype.concat.apply([],arguments)}function La(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var Ma="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Na=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Oa=/^#(?:[0-9a-f]{3}){1,2}$/i,Pa=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Qa=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function Ra(a,b){this.x=m(a)?a:0;this.y=m(b)?b:0}g=Ra.prototype;g.toString=function(){return"("+this.x+", "+this.y+")"};g.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};g.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};g.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};g.scale=function(a,b){b=aa(b)?b:a;this.x*=a;this.y*=b;return this};var Sa=-1!=za.indexOf("Macintosh"),Ta=-1!=za.indexOf("Windows"),Ua,Va="",Wa=/rv\:([^\);]+)(\)|;)/.exec(za);Wa&&(Va=Wa?Wa[1]:"");Ua=Va;var pa={};
function Xa(){return oa(function(){for(var a=0,b=qa(String(Ua)).split("."),c=qa("1.9.2").split("."),d=Math.max(b.length,c.length),e=0;!a&&e<d;e++){var f=b[e]||"",h=c[e]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];if(0==f[0].length&&0==h[0].length)break;a=ra(0==f[1].length?0:parseInt(f[1],10),0==h[1].length?0:parseInt(h[1],10))||ra(0==f[2].length,0==h[2].length)||ra(f[2],h[2]);f=f[3];h=h[3]}while(!a)}return 0<=a})};function Ya(a,b,c,d){this.c=a;this.a=b;this.b=c;this.f=d}g=Ya.prototype;g.toString=function(){return"("+this.c+"t, "+this.a+"r, "+this.b+"b, "+this.f+"l)"};g.contains=function(a){return this&&a?a instanceof Ya?a.f>=this.f&&a.a<=this.a&&a.c>=this.c&&a.b<=this.b:a.x>=this.f&&a.x<=this.a&&a.y>=this.c&&a.y<=this.b:!1};g.ceil=function(){this.c=Math.ceil(this.c);this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.f=Math.ceil(this.f);return this};
g.floor=function(){this.c=Math.floor(this.c);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.f=Math.floor(this.f);return this};g.round=function(){this.c=Math.round(this.c);this.a=Math.round(this.a);this.b=Math.round(this.b);this.f=Math.round(this.f);return this};g.scale=function(a,b){b=aa(b)?b:a;this.f*=a;this.a*=a;this.c*=b;this.b*=b;return this};function Za(a,b){this.w={};this.m=[];this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){if(a instanceof Za){d=$a(a);ab(a);var e=[];for(c=0;c<a.m.length;c++)e.push(a.w[a.m[c]])}else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)this.set(d[c],e[c])}}function $a(a){ab(a);return a.m.concat()}
function ab(a){var b,c;if(a.a!=a.m.length){for(b=c=0;c<a.m.length;){var d=a.m[c];Object.prototype.hasOwnProperty.call(a.w,d)&&(a.m[b++]=d);c++}a.m.length=b}if(a.a!=a.m.length){var e={};for(b=c=0;c<a.m.length;)d=a.m[c],Object.prototype.hasOwnProperty.call(e,d)||(a.m[b++]=d,e[d]=1),c++;a.m.length=b}}Za.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.w,a)?this.w[a]:b};
Za.prototype.set=function(a,b){Object.prototype.hasOwnProperty.call(this.w,a)||(this.a++,this.m.push(a));this.w[a]=b};function B(a,b,c,d){this.a=a;this.b=b;this.width=c;this.height=d}g=B.prototype;g.toString=function(){return"("+this.a+", "+this.b+" - "+this.width+"w x "+this.height+"h)"};g.contains=function(a){return a instanceof Ra?a.x>=this.a&&a.x<=this.a+this.width&&a.y>=this.b&&a.y<=this.b+this.height:this.a<=a.a&&this.a+this.width>=a.a+a.width&&this.b<=a.b&&this.b+this.height>=a.b+a.height};
g.ceil=function(){this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};g.floor=function(){this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};g.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};
g.scale=function(a,b){b=aa(b)?b:a;this.a*=a;this.width*=a;this.b*=b;this.height*=b;return this};var bb,cb,db=function(){var a=k.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;bb=function(a){return 0<=c.compare(d,""+a)};cb=function(a){c.compare(e,""+a)};return!0}();function eb(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function fb(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
function gb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?hb(a,b):!c&&fb(e,b)?-1*ib(a,b):!d&&fb(f,a)?ib(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=C(a);c=d.createRange();c.selectNode(a);c.collapse(!0);a=d.createRange();a.selectNode(b);
a.collapse(!0);return c.compareBoundaryPoints(k.Range.START_TO_END,a)}function ib(a,b){var c=a.parentNode;if(c==b)return-1;for(;b.parentNode!=c;)b=b.parentNode;return hb(b,a)}function hb(a,b){for(;b=b.previousSibling;)if(b==a)return-1;return 1}function C(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function jb(a,b,c){a&&!c&&(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function kb(a){try{return a&&a.activeElement}catch(b){}return null}
function lb(a){this.a=a||k.document||document}lb.prototype.getElementsByTagName=function(a,b){return(b||this.a).getElementsByTagName(String(a))};lb.prototype.contains=fb;function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b}
function mb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function nb(a,b,c,d,e){return ob.call(null,a,b,n(c)?c:null,n(d)?d:null,e||new F)}
function ob(a,b,c,d,e){b.getElementsByName&&d&&"name"==c?(b=b.getElementsByName(d),z(b,function(b){a.a(b)&&G(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),z(b,function(b){b.className==d&&a.a(b)&&G(e,b)})):a instanceof x?pb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),z(b,function(a){mb(a,c,d)&&G(e,a)}));return e}function pb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)mb(b,c,d)&&a.a(b)&&G(e,b),pb(a,b,c,d,e)};function qb(a){var b="tabindex";return"style"==b?rb(a.style.cssText):(a=a.getAttributeNode(b))&&a.specified?a.value:null}var sb=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/;function rb(a){var b=[];z(a.split(sb),function(a){var c=a.indexOf(":");0<c&&(a=[a.slice(0,c),a.slice(c+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}
function H(a,b){b&&"string"!==typeof b&&(b=b.toString());return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};function F(){this.b=this.a=null;this.s=0}function tb(a){this.node=a;this.a=this.b=null}function ub(a,b){if(!a.a)return b;if(!b.a)return a;var c=a.a;b=b.a;for(var d=null,e,f=0;c&&b;)c.node==b.node?(e=c,c=c.a,b=b.a):0<gb(c.node,b.node)?(e=b,b=b.a):(e=c,c=c.a),(e.b=d)?d.a=e:a.a=e,d=e,f++;for(e=c||b;e;)e.b=d,d=d.a=e,f++,e=e.a;a.b=d;a.s=f;return a}function vb(a,b){b=new tb(b);b.a=a.a;a.b?a.a.b=b:a.a=a.b=b;a.a=b;a.s++}function G(a,b){b=new tb(b);b.b=a.b;a.a?a.b.a=b:a.a=a.b=b;a.b=b;a.s++}
function wb(a){return(a=a.a)?a.node:null}function xb(a){return(a=wb(a))?E(a):""}function I(a,b){return new yb(a,!!b)}function yb(a,b){this.f=a;this.b=(this.A=b)?a.b:a.a;this.a=null}function J(a){var b=a.b;if(b){var c=a.a=b;a.b=a.A?b.b:b.a;return c.node}return null};function zb(a,b,c){this.a=a;this.b=b;this.f=c}zb.prototype.create=function(a){a=C(a).createEvent("HTMLEvents");a.initEvent(this.a,this.b,this.f);return a};zb.prototype.toString=function(){return this.a};var Ab=new zb("change",!0,!1);function K(a){this.l=a;this.b=this.i=!1;this.f=null}function y(a){return"\n "+a.toString().split("\n").join("\n ")}function Bb(a,b){a.i=b}function Cb(a,b){a.b=b}function L(a,b){a=a.a(b);return a instanceof F?+xb(a):+a}function M(a,b){a=a.a(b);return a instanceof F?xb(a):""+a}function Db(a,b){a=a.a(b);return a instanceof F?!!a.s:!!a};function Eb(a,b,c){K.call(this,a.l);this.c=a;this.j=b;this.v=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Fb&&(c.b||c.i||4==c.l||0==c.l||!b.f?b.b||b.i||4==b.l||0==b.l||!c.f||(this.f={name:c.f.name,B:b}):this.f={name:b.f.name,B:c})}p(Eb,K);
function Gb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof F&&c instanceof F){b=I(b);for(d=J(b);d;d=J(b))for(e=I(c),f=J(e);f;f=J(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof F||c instanceof F){b instanceof F?(e=b,d=c):(e=c,d=b);f=I(e);for(var h=typeof d,l=J(f);l;l=J(f)){switch(h){case "number":l=+E(l);break;case "boolean":l=!!E(l);break;case "string":l=E(l);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(l,d)||e==c&&a(d,l))return!0}return!1}return e?"boolean"==
typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Eb.prototype.a=function(a){return this.c.u(this.j,this.v,a)};Eb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+y(this.j);return a+=y(this.v)};function Hb(a,b,c,d){this.O=a;this.K=b;this.l=c;this.u=d}Hb.prototype.toString=function(){return this.O};var Ib={};
function N(a,b,c,d){if(Ib.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Hb(a,b,c,d);return Ib[a.toString()]=a}N("div",6,1,function(a,b,c){return L(a,c)/L(b,c)});N("mod",6,1,function(a,b,c){return L(a,c)%L(b,c)});N("*",6,1,function(a,b,c){return L(a,c)*L(b,c)});N("+",5,1,function(a,b,c){return L(a,c)+L(b,c)});N("-",5,1,function(a,b,c){return L(a,c)-L(b,c)});N("<",4,2,function(a,b,c){return Gb(function(a,b){return a<b},a,b,c)});
N(">",4,2,function(a,b,c){return Gb(function(a,b){return a>b},a,b,c)});N("<=",4,2,function(a,b,c){return Gb(function(a,b){return a<=b},a,b,c)});N(">=",4,2,function(a,b,c){return Gb(function(a,b){return a>=b},a,b,c)});var Fb=N("=",3,2,function(a,b,c){return Gb(function(a,b){return a==b},a,b,c,!0)});N("!=",3,2,function(a,b,c){return Gb(function(a,b){return a!=b},a,b,c,!0)});N("and",2,2,function(a,b,c){return Db(a,c)&&Db(b,c)});N("or",1,2,function(a,b,c){return Db(a,c)||Db(b,c)});function Jb(a,b){if(b.a.length&&4!=a.l)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");K.call(this,a.l);this.c=a;this.j=b;this.i=a.i;this.b=a.b}p(Jb,K);Jb.prototype.a=function(a){a=this.c.a(a);return Kb(this.j,a)};Jb.prototype.toString=function(){var a="Filter:"+y(this.c);return a+=y(this.j)};function Lb(a,b){if(b.length<a.J)throw Error("Function "+a.o+" expects at least"+a.J+" arguments, "+b.length+" given");if(null!==a.F&&b.length>a.F)throw Error("Function "+a.o+" expects at most "+a.F+" arguments, "+b.length+" given");a.N&&z(b,function(b,d){if(4!=b.l)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});K.call(this,a.l);this.C=a;this.c=b;Bb(this,a.i||A(b,function(a){return a.i}));Cb(this,a.M&&!b.length||a.L&&!!b.length||A(b,function(a){return a.b}))}p(Lb,K);
Lb.prototype.a=function(a){return this.C.u.apply(null,Ka(a,this.c))};Lb.prototype.toString=function(){var a="Function: "+this.C;if(this.c.length)var b=Ia(this.c,function(a,b){return a+y(b)},"Arguments:"),a=a+y(b);return a};function Mb(a,b,c,d,e,f,h,l,v){this.o=a;this.l=b;this.i=c;this.M=d;this.L=e;this.u=f;this.J=h;this.F=m(l)?l:h;this.N=!!v}Mb.prototype.toString=function(){return this.o};var Nb={};
function O(a,b,c,d,e,f,h,l){if(Nb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Nb[a]=new Mb(a,b,c,d,!1,e,f,h,l)}O("boolean",2,!1,!1,function(a,b){return Db(b,a)},1);O("ceiling",1,!1,!1,function(a,b){return Math.ceil(L(b,a))},1);O("concat",3,!1,!1,function(a,b){return Ia(La(arguments,1),function(b,d){return b+M(d,a)},"")},2,null);O("contains",2,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);return-1!=b.indexOf(a)},2);O("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0);
O("false",2,!1,!1,function(){return!1},0);O("floor",1,!1,!1,function(a,b){return Math.floor(L(b,a))},1);O("id",4,!1,!1,function(a,b){var c=a.a,d=9==c.nodeType?c:c.ownerDocument;a=M(b,a).split(/\s+/);var e=[];z(a,function(a){a=d.getElementById(a);!a||0<=Ha(e,a)||e.push(a)});e.sort(gb);var f=new F;z(e,function(a){G(f,a)});return f},1);O("lang",2,!1,!1,function(){return!1},1);O("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);
O("local-name",3,!1,!0,function(a,b){return(a=b?wb(b.a(a)):a.a)?a.localName||a.nodeName.toLowerCase():""},0,1,!0);O("name",3,!1,!0,function(a,b){return(a=b?wb(b.a(a)):a.a)?a.nodeName.toLowerCase():""},0,1,!0);O("namespace-uri",3,!0,!1,function(){return""},0,1,!0);O("normalize-space",3,!1,!0,function(a,b){return(b?M(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);O("not",2,!1,!1,function(a,b){return!Db(b,a)},1);O("number",1,!1,!0,function(a,b){return b?L(b,a):+E(a.a)},0,1);
O("position",1,!0,!1,function(a){return a.b},0);O("round",1,!1,!1,function(a,b){return Math.round(L(b,a))},1);O("starts-with",2,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);return!b.lastIndexOf(a,0)},2);O("string",3,!1,!0,function(a,b){return b?M(b,a):E(a.a)},0,1);O("string-length",1,!1,!0,function(a,b){return(b?M(b,a):E(a.a)).length},0,1);
O("substring",3,!1,!1,function(a,b,c,d){c=L(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?L(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=M(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);O("substring-after",3,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
O("substring-before",3,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);O("sum",1,!1,!1,function(a,b){a=I(b.a(a));b=0;for(var c=J(a);c;c=J(a))b+=+E(c);return b},1,1,!0);O("translate",3,!1,!1,function(a,b,c,d){b=M(b,a);c=M(c,a);var e=M(d,a);d={};for(var f=0;f<c.length;f++)a=c.charAt(f),a in d||(d[a]=e.charAt(f));c="";for(f=0;f<b.length;f++)a=b.charAt(f),c+=a in d?d[a]:a;return c},3);O("true",2,!1,!1,function(){return!0},0);function Ob(a){K.call(this,3);this.c=a.substring(1,a.length-1)}p(Ob,K);Ob.prototype.a=function(){return this.c};Ob.prototype.toString=function(){return"Literal: "+this.c};function Pb(a){K.call(this,1);this.c=a}p(Pb,K);Pb.prototype.a=function(){return this.c};Pb.prototype.toString=function(){return"Number: "+this.c};function Qb(a,b){K.call(this,a.l);this.j=a;this.c=b;this.i=a.i;this.b=a.b;1==this.c.length&&(a=this.c[0],a.D||a.c!=Rb||(a=a.v,"*"!=a.f()&&(this.f={name:a.f(),B:null})))}p(Qb,K);function Sb(){K.call(this,4)}p(Sb,K);Sb.prototype.a=function(a){var b=new F;a=a.a;9==a.nodeType?G(b,a):G(b,a.ownerDocument);return b};Sb.prototype.toString=function(){return"Root Helper Expression"};function Tb(){K.call(this,4)}p(Tb,K);Tb.prototype.a=function(a){var b=new F;G(b,a.a);return b};Tb.prototype.toString=function(){return"Context Helper Expression"};
function Ub(a){return"/"==a||"//"==a}Qb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof F))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=I(b,e.c.A);if(e.i||e.c!=Vb)if(e.i||e.c!=Wb){var h=J(f);for(b=e.a(new ta(h));h=J(f);)h=e.a(new ta(h)),b=ub(b,h)}else h=J(f),b=e.a(new ta(h));else{for(h=J(f);(b=J(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new ta(h))}}return b};
Qb.prototype.toString=function(){var a="Path Expression:"+y(this.j);if(this.c.length){var b=Ia(this.c,function(a,b){return a+y(b)},"Steps:");a+=y(b)}return a};function Xb(a,b){this.a=a;this.A=!!b}
function Kb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=I(b),f=b.s,h,l=0;h=J(e);l++){var v=a.A?f-l:l+1;h=d.a(new ta(h,v,f));if("number"==typeof h)v=v==h;else if("string"==typeof h||"boolean"==typeof h)v=!!h;else if(h instanceof F)v=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;h=v.f;var w=v.a;if(!w)throw Error("Next must be called at least once before remove.");var q=w.b,w=w.a;q?q.a=w:h.a=w;w?w.b=q:h.b=q;h.s--;v.a=null}}return b}
Xb.prototype.toString=function(){return Ia(this.a,function(a,b){return a+y(b)},"Predicates:")};function Yb(a){K.call(this,1);this.c=a;this.i=a.i;this.b=a.b}p(Yb,K);Yb.prototype.a=function(a){return-L(this.c,a)};Yb.prototype.toString=function(){return"Unary Expression: -"+y(this.c)};function Zb(a){K.call(this,4);this.c=a;Bb(this,A(this.c,function(a){return a.i}));Cb(this,A(this.c,function(a){return a.b}))}p(Zb,K);Zb.prototype.a=function(a){var b=new F;z(this.c,function(c){c=c.a(a);if(!(c instanceof F))throw Error("Path expression must evaluate to NodeSet.");b=ub(b,c)});return b};Zb.prototype.toString=function(){return Ia(this.c,function(a,b){return a+y(b)},"Union Expression:")};function Q(a,b,c,d){K.call(this,4);this.c=a;this.v=b;this.j=c||new Xb([]);this.D=!!d;b=this.j;b=0<b.a.length?b.a[0].f:null;a.R&&b&&(this.f={name:b.name,B:b.B});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.l||0==c.l){a=!0;break a}a=!1}this.i=a}p(Q,K);
Q.prototype.a=function(a){var b=a.a,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.B?M(c.B,a):null,f=1);if(this.D)if(this.i||this.c!=$b)if(b=I((new Q(ac,new x("node"))).a(a)),c=J(b))for(a=this.u(c,d,e,f);c=J(b);)a=ub(a,this.u(c,d,e,f));else a=new F;else a=nb(this.v,b,d,e),a=Kb(this.j,a,f);else a=this.u(a.a,d,e,f);return a};Q.prototype.u=function(a,b,c,d){a=this.c.C(this.v,a,b,c);return a=Kb(this.j,a,d)};
Q.prototype.toString=function(){var a="Step:"+y("Operator: "+(this.D?"//":"/"));this.c.o&&(a+=y("Axis: "+this.c));a+=y(this.v);if(this.j.a.length){var b=Ia(this.j.a,function(a,b){return a+y(b)},"Predicates:");a+=y(b)}return a};function bc(a,b,c,d){this.o=a;this.C=b;this.A=c;this.R=d}bc.prototype.toString=function(){return this.o};var cc={};function R(a,b,c,d){if(cc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new bc(a,b,c,!!d);return cc[a]=b}
R("ancestor",function(a,b){for(var c=new F;b=b.parentNode;)a.a(b)&&vb(c,b);return c},!0);R("ancestor-or-self",function(a,b){var c=new F;do a.a(b)&&vb(c,b);while(b=b.parentNode);return c},!0);
var Rb=R("attribute",function(a,b){var c=new F,d=a.f();if(b=b.attributes)if(a instanceof x&&null===a.b||"*"==d)for(d=0;a=b[d];d++)G(c,a);else(a=b.getNamedItem(d))&&G(c,a);return c},!1),$b=R("child",function(a,b,c,d,e){c=n(c)?c:null;d=n(d)?d:null;e=e||new F;for(b=b.firstChild;b;b=b.nextSibling)mb(b,c,d)&&a.a(b)&&G(e,b);return e},!1,!0);R("descendant",nb,!1,!0);
var ac=R("descendant-or-self",function(a,b,c,d){var e=new F;mb(b,c,d)&&a.a(b)&&G(e,b);return nb(a,b,c,d,e)},!1,!0),Vb=R("following",function(a,b,c,d){var e=new F;do for(var f=b;f=f.nextSibling;)mb(f,c,d)&&a.a(f)&&G(e,f),e=nb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);R("following-sibling",function(a,b){for(var c=new F;b=b.nextSibling;)a.a(b)&&G(c,b);return c},!1);R("namespace",function(){return new F},!1);
var dc=R("parent",function(a,b){var c=new F;if(9==b.nodeType)return c;if(2==b.nodeType)return G(c,b.ownerElement),c;b=b.parentNode;a.a(b)&&G(c,b);return c},!1),Wb=R("preceding",function(a,b,c,d){var e=new F,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,l=f.length;h<l;h++){var v=[];for(b=f[h];b=b.previousSibling;)v.unshift(b);for(var w=0,q=v.length;w<q;w++)b=v[w],mb(b,c,d)&&a.a(b)&&G(e,b),e=nb(a,b,c,d,e)}return e},!0,!0);
R("preceding-sibling",function(a,b){for(var c=new F;b=b.previousSibling;)a.a(b)&&vb(c,b);return c},!0);var ec=R("self",function(a,b){var c=new F;a.a(b)&&G(c,b);return c},!1);function fc(a,b){this.a=a;this.b=b}function gc(a){for(var b,c=[];;){S(a,"Missing right hand side of binary expression.");b=hc(a);var d=u(a.a);if(!d)break;var e=(d=Ib[d]||null)&&d.K;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].K;)b=new Eb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Eb(c.pop(),c.pop(),b);return b}function S(a,b){if(ya(a.a))throw Error(b);}function ic(a,b){a=u(a.a);if(a!=b)throw Error("Bad token, expected: "+b+" got: "+a);}
function jc(a){a=u(a.a);if(")"!=a)throw Error("Bad token: "+a);}function kc(a){a=u(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Ob(a)}
function lc(a){var b=[];if(Ub(t(a.a))){var c=u(a.a);var d=t(a.a);if("/"==c&&(ya(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Sb;d=new Sb;S(a,"Missing next location step.");c=mc(a,c);b.push(c)}else{a:{c=t(a.a);d=c.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":u(a.a);c=gc(a);S(a,'unclosed "("');ic(a,")");break;case '"':case "'":c=kc(a);break;default:if(isNaN(+c))if(!Ca(c)&&/(?![0-9])[\w]/.test(d)&&"("==t(a.a,1)){c=u(a.a);
c=Nb[c]||null;u(a.a);for(d=[];")"!=t(a.a);){S(a,"Missing function argument list.");d.push(gc(a));if(","!=t(a.a))break;u(a.a)}S(a,"Unclosed function argument list.");jc(a);c=new Lb(c,d)}else{c=null;break a}else c=new Pb(+u(a.a))}"["==t(a.a)&&(d=new Xb(nc(a)),c=new Jb(c,d))}if(c)if(Ub(t(a.a)))d=c;else return c;else c=mc(a,"/"),d=new Tb,b.push(c)}for(;Ub(t(a.a));)c=u(a.a),S(a,"Missing next location step."),c=mc(a,c),b.push(c);return new Qb(d,b)}
function mc(a,b){if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==t(a.a)){var c=new Q(ec,new x("node"));u(a.a);return c}if(".."==t(a.a))return c=new Q(dc,new x("node")),u(a.a),c;if("@"==t(a.a)){var d=Rb;u(a.a);S(a,"Missing attribute name")}else if("::"==t(a.a,1)){if(!/(?![0-9])[\w]/.test(t(a.a).charAt(0)))throw Error("Bad token: "+u(a.a));var e=u(a.a);d=cc[e]||null;if(!d)throw Error("No axis with name: "+e);u(a.a);S(a,"Missing node name")}else d=$b;e=t(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("==
t(a.a,1)){if(!Ca(e))throw Error("Invalid node type: "+e);e=u(a.a);if(!Ca(e))throw Error("Invalid type name: "+e);ic(a,"(");S(a,"Bad nodetype");var f=t(a.a).charAt(0),h=null;if('"'==f||"'"==f)h=kc(a);S(a,"Bad nodetype");jc(a);e=new x(e,h)}else if(e=u(a.a),f=e.indexOf(":"),-1==f)e=new Da(e);else{var h=e.substring(0,f);if("*"==h)var l="*";else if(l=a.b(h),!l)throw Error("Namespace prefix not declared: "+h);e=e.substr(f+1);e=new Da(e,l)}else throw Error("Bad token: "+u(a.a));a=new Xb(nc(a),d.A);return c||
new Q(d,e,a,"//"==b)}function nc(a){for(var b=[];"["==t(a.a);){u(a.a);S(a,"Missing predicate expression.");var c=gc(a);b.push(c);S(a,"Unclosed predicate expression.");ic(a,"]")}return b}function hc(a){if("-"==t(a.a))return u(a.a),new Yb(hc(a));var b=lc(a);if("|"!=t(a.a))a=b;else{for(b=[b];"|"==u(a.a);)S(a,"Missing next union location path."),b.push(lc(a));a.a.a--;a=new Zb(b)}return a};function oc(a,b){if(!a.length)throw Error("Empty XPath expression.");a=va(a);if(ya(a))throw Error("Invalid XPath expression.");b?da(b)||(b=ga(b.lookupNamespaceURI,b)):b=function(){return null};var c=gc(new fc(a,b));if(!ya(a))throw Error("Bad token: "+u(a));this.evaluate=function(a,b){a=c.a(new ta(a));return new T(a,b)}}
function T(a,b){if(!b)if(a instanceof F)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof F))throw Error("value could not be converted to the specified type");this.resultType=b;switch(b){case 2:this.stringValue=a instanceof F?xb(a):""+a;break;case 1:this.numberValue=a instanceof F?+xb(a):+a;break;case 3:this.booleanValue=a instanceof F?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var c=
I(a);var d=[];for(var e=J(c);e;e=J(c))d.push(e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:this.singleNodeValue=wb(a);break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=d.length?null:d[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=d.length||0>a?null:d[a]}}T.ANY_TYPE=0;
T.NUMBER_TYPE=1;T.STRING_TYPE=2;T.BOOLEAN_TYPE=3;T.UNORDERED_NODE_ITERATOR_TYPE=4;T.ORDERED_NODE_ITERATOR_TYPE=5;T.UNORDERED_NODE_SNAPSHOT_TYPE=6;T.ORDERED_NODE_SNAPSHOT_TYPE=7;T.ANY_UNORDERED_NODE_TYPE=8;T.FIRST_ORDERED_NODE_TYPE=9;function pc(a){this.lookupNamespaceURI=Ea(a)}
ba("wgxpath.install",function(a,b){a=a||k;var c=a.Document&&a.Document.prototype||a.document;if(!c.evaluate||b)a.XPathResult=T,c.evaluate=function(a,b,c,h){return(new oc(a,c)).evaluate(b,h)},c.createExpression=function(a,b){return new oc(a,b)},c.createNSResolver=function(a){return new pc(a)}});var U={};U.G=function(){var a={V:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
U.u=function(a,b,c){var d=C(a);if(!d.documentElement)return null;try{for(var e=d.createNSResolver?d.createNSResolver(d.documentElement):U.G,f={},h=d.getElementsByTagName("*"),l=0;l<h.length;++l){var v=h[l],w=v.namespaceURI;if(w&&!f[w]){var q=v.lookupPrefix(w);if(!q)var D=w.match(".*/(\\w+)/?$"),q=D?D[1]:"xhtml";f[w]=q}}var P={},W;for(W in f)P[f[W]]=W;e=function(a){return P[a]||null};try{return d.evaluate(b,a,e,c,null)}catch(na){if("TypeError"===na.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):
U.G,d.evaluate(b,a,e,c,null);throw na;}}catch(na){if("NS_ERROR_ILLEGAL_VALUE"!=na.name)throw new ja(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+na);}};U.H=function(a,b){if(!a||1!=a.nodeType)throw new ja(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};
U.P=function(a,b){var c=function(){var c=U.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=C(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||U.H(c,a);return c};
U.T=function(a,b){var c=function(){var c=U.u(b,a,7);if(c){for(var e=c.snapshotLength,f=[],h=0;h<e;++h)f.push(c.snapshotItem(h));return f}return b.selectNodes?(c=C(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();z(c,function(b){U.H(b,a)});return c};var qc="function"===typeof ShadowRoot,rc="A AREA BUTTON INPUT LABEL SELECT TEXTAREA".split(" ");function sc(a){return A(rc,function(b){return H(a,b)})||null!=qb(a)&&0<=Number(a.tabIndex)||(tc(a)||(H(a,"INPUT")?"file"==a.type.toLowerCase():!1))&&!a.readOnly}var uc="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" ");
function vc(a){return A(uc,function(b){return H(a,b)})?a.disabled?!1:a.parentNode&&1==a.parentNode.nodeType&&H(a,"OPTGROUP")||H(a,"OPTION")?vc(a.parentNode):!jb(a,function(a){var b=a.parentNode;if(b&&H(b,"FIELDSET")&&b.disabled){if(!H(a,"LEGEND"))return!0;for(;a=m(a.previousElementSibling)?a.previousElementSibling:eb(a.previousSibling);)if(H(a,"LEGEND"))return!0}return!1},!0):!0}var wc="text search tel url email password number".split(" ");
function tc(a){return H(a,"TEXTAREA")?!0:H(a,"INPUT")?0<=Ha(wc,a.type.toLowerCase()):xc(a)?!0:!1}function xc(a){function b(a){return"inherit"==a.contentEditable?(a=yc(a))?b(a):!1:"true"==a.contentEditable}return m(a.contentEditable)?m(a.isContentEditable)?a.isContentEditable:b(a):!1}function yc(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return H(a)?a:null}
function V(a,b){b=sa(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b="cssFloat";a:{var c=b;var d=C(a);if(d.defaultView&&d.defaultView.getComputedStyle&&(d=d.defaultView.getComputedStyle(a,null))){c=d[c]||d.getPropertyValue(c)||"";break a}c=""}a=c||zc(a,b);if(null===a)a=null;else if(0<=Ha(Ma,b)){b:{var e=a.match(Pa);if(e&&(b=Number(e[1]),c=Number(e[2]),d=Number(e[3]),e=Number(e[4]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d&&0<=e&&1>=e)){b=[b,c,d,e];break b}b=null}if(!b)b:{if(d=a.match(Qa))if(b=Number(d[1]),
c=Number(d[2]),d=Number(d[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d){b=[b,c,d,1];break b}b=null}if(!b)b:{b=a.toLowerCase();c=la[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(Na,"#$1$1$2$2$3$3")),!Oa.test(c))){b=null;break b}b=[parseInt(c.substr(1,2),16),parseInt(c.substr(3,2),16),parseInt(c.substr(5,2),16),1]}a=b?"rgba("+b.join(", ")+")":a}return a}
function zc(a,b){var c=a.currentStyle||a.style,d=c[b];!m(d)&&da(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?m(d)?d:null:(a=yc(a))?zc(a,b):null}
function Ac(a,b,c){function d(a){var b=Bc(a);return 0<b.height&&0<b.width?!0:H(a,"PATH")&&(0<b.height||0<b.width)?(a=V(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=V(a,"overflow")&&A(a.childNodes,function(a){return 3==a.nodeType||H(a)&&d(a)})}function e(a){return Cc(a)==X&&Ja(a.childNodes,function(a){return!H(a)||e(a)||!d(a)})}if(!H(a))throw Error("Argument to isShown must be of type Element");if(H(a,"BODY"))return!0;if(H(a,"OPTION")||H(a,"OPTGROUP"))return a=jb(a,function(a){return H(a,"SELECT")}),
!!a&&Ac(a,!0,c);var f=Dc(a);if(f)return!!f.I&&0<f.rect.width&&0<f.rect.height&&Ac(f.I,b,c);if(H(a,"INPUT")&&"hidden"==a.type.toLowerCase()||H(a,"NOSCRIPT"))return!1;f=V(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||Ec(a))&&d(a)?!e(a):!1}
function Fc(a){var b=qc?function(c){if("none"==V(c,"display"))return!1;do{var d=c.parentNode;if(c.getDestinationInsertionPoints){var e=c.getDestinationInsertionPoints();0<e.length&&(d=e[e.length-1])}if(d instanceof ShadowRoot){if(d.host.shadowRoot!=d)return!1;d=d.host}else!d||9!=d.nodeType&&11!=d.nodeType||(d=null)}while(a&&1!=a.nodeType);return!d||b(d)}:function(a){if("none"==V(a,"display"))return!1;a=yc(a);return!a||b(a)};return Ac(a,!0,b)}var X="hidden";
function Cc(a){function b(a){function b(a){return a==h?!0:!V(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==V(a,"position")?!1:!0}var c=V(a,"position");if("fixed"==c)return w=!0,a==h?null:h;for(a=yc(a);a&&!b(a);)a=yc(a);return a}function c(a){var b=a;if("visible"==v)if(a==h&&l)b=l;else if(a==l)return{x:"visible",y:"visible"};b={x:V(b,"overflow-x"),y:V(b,"overflow-y")};a==h&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function d(a){if(a==h){var b=(new lb(f)).a;
a=b.scrollingElement?b.scrollingElement:"CSS1Compat"==b.compatMode?b.documentElement:b.body||b.documentElement;b=b.parentWindow||b.defaultView;a=new Ra(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new Ra(a.scrollLeft,a.scrollTop);return a}var e=Gc(a);var f=C(a),h=f.documentElement,l=f.body,v=V(h,"overflow"),w;for(a=b(a);a;a=b(a)){var q=c(a);if("visible"!=q.x||"visible"!=q.y){var D=Bc(a);if(!D.width||!D.height)return X;var P=e.a<D.a,W=e.b<D.b;if(P&&"hidden"==q.x||W&&"hidden"==q.y)return X;
if(P&&"visible"!=q.x||W&&"visible"!=q.y){P=d(a);W=e.b<D.b-P.y;if(e.a<D.a-P.x&&"visible"!=q.x||W&&"visible"!=q.x)return X;e=Cc(a);return e==X?X:"scroll"}P=e.f>=D.a+D.width;D=e.c>=D.b+D.height;if(P&&"hidden"==q.x||D&&"hidden"==q.y)return X;if(P&&"visible"!=q.x||D&&"visible"!=q.y){if(w&&(q=d(a),e.f>=h.scrollWidth-q.x||e.a>=h.scrollHeight-q.y))return X;e=Cc(a);return e==X?X:"scroll"}}}return"none"}
function Bc(a){var b=Dc(a);if(b)return b.rect;if(H(a,"HTML"))return a=C(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new ma(a.clientWidth,a.clientHeight),new B(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new B(0,0,0,0)}return new B(c.left,c.top,c.right-c.left,c.bottom-c.top)}
function Dc(a){var b=H(a,"MAP");if(!b&&!H(a,"AREA"))return null;var c=b?a:H(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=U.P('/descendant::*[@usemap = "#'+c.name+'"]',C(c)))&&(e=Bc(d),b||"default"==a.shape.toLowerCase()||(a=Hc(a),b=Math.min(Math.max(a.a,0),e.width),c=Math.min(Math.max(a.b,0),e.height),e=new B(b+e.a,c+e.b,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{I:d,rect:e||new B(0,0,0,0)}}
function Hc(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new B(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new B(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new B(b,c,d-b,e-c)}return new B(0,0,0,0)}function Gc(a){a=Bc(a);return new Ya(a.b,a.a+a.width,a.b+a.height,a.a)}
function Ec(a){var b=1,c=V(a,"opacity");c&&(b=Number(c));(a=yc(a))&&(b*=Ec(a));return b};function Ic(){this.a=ia.document.documentElement;var a=kb(C(this.a));a&&Jc(this,a)}function Jc(a,b){a.a=b;H(b,"OPTION")&&jb(b,function(a){return H(a,"SELECT")})}function Kc(a){var b=jb(a.a,function(a){return!!a&&H(a)&&sc(a)},!0),b=b||a.a;a=kb(C(b));if(b!=a){if(a&&da(a.blur)&&!H(a,"BODY"))try{a.blur()}catch(c){throw c;}da(b.focus)&&b.focus()}}db&&db&&cb(3.6);var Lc={};function Y(a,b,c){var d=typeof a;("object"==d&&null!=a||"function"==d)&&(a=a.g);a=new Mc(a);!b||b in Lc&&!c||(Lc[b]={key:a,shift:!1},c&&(Lc[c]={key:a,shift:!0}));return a}function Mc(a){this.code=a}Y(8);Y(9);Y(13);var Nc=Y(16),Oc=Y(17),Pc=Y(18);Y(19);Y(20);Y(27);Y(32," ");Y(33);Y(34);Y(35);Y(36);Y(37);Y(38);Y(39);Y(40);Y(44);Y(45);Y(46);Y(48,"0",")");Y(49,"1","!");Y(50,"2","@");Y(51,"3","#");Y(52,"4","$");Y(53,"5","%");Y(54,"6","^");Y(55,"7","&");Y(56,"8","*");Y(57,"9","(");Y(65,"a","A");
Y(66,"b","B");Y(67,"c","C");Y(68,"d","D");Y(69,"e","E");Y(70,"f","F");Y(71,"g","G");Y(72,"h","H");Y(73,"i","I");Y(74,"j","J");Y(75,"k","K");Y(76,"l","L");Y(77,"m","M");Y(78,"n","N");Y(79,"o","O");Y(80,"p","P");Y(81,"q","Q");Y(82,"r","R");Y(83,"s","S");Y(84,"t","T");Y(85,"u","U");Y(86,"v","V");Y(87,"w","W");Y(88,"x","X");Y(89,"y","Y");Y(90,"z","Z");var Qc=Y(Ta?{g:91,h:91}:Sa?{g:224,h:91}:{g:0,h:91});Y(Ta?{g:92,h:92}:Sa?{g:224,h:93}:{g:0,h:92});Y(Ta?{g:93,h:93}:Sa?{g:0,h:0}:{g:93,h:null});
Y({g:96,h:96},"0");Y({g:97,h:97},"1");Y({g:98,h:98},"2");Y({g:99,h:99},"3");Y({g:100,h:100},"4");Y({g:101,h:101},"5");Y({g:102,h:102},"6");Y({g:103,h:103},"7");Y({g:104,h:104},"8");Y({g:105,h:105},"9");Y({g:106,h:106},"*");Y({g:107,h:107},"+");Y({g:109,h:109},"-");Y({g:110,h:110},".");Y({g:111,h:111},"/");Y(144);Y(112);Y(113);Y(114);Y(115);Y(116);Y(117);Y(118);Y(119);Y(120);Y(121);Y(122);Y(123);Y({g:107,h:187},"=","+");Y(108,",");Y({g:109,h:189},"-","_");Y(188,",","<");Y(190,".",">");Y(191,"/","?");
Y(192,"`","~");Y(219,"[","{");Y(220,"\\","|");Y(221,"]","}");Y({g:59,h:186},";",":");Y(222,"'",'"');var Rc=new Za;Rc.set(1,Nc);Rc.set(2,Oc);Rc.set(4,Pc);Rc.set(8,Qc);(function(a){var b=new Za;z($a(a),function(c){b.set(a.get(c).code,c)});return b})(Rc);db&&bb(12);function Z(){Ic.call(this)}p(Z,Ic);Z.a=void 0;Z.b=function(){return Z.a?Z.a:Z.a=new Z};ba("_",function(a){var b;(b=!Fc(a)||!vc(a))||(b=(db?bb("1.9.2"):Xa())?"none"==V(a,"pointer-events"):!1);if(b)throw new ja(12,"Element is not currently interactable and may not be manipulated");if(!(tc(a)||H(a,"INPUT")&&"file"==a.type.toLowerCase())||a.readOnly)throw new ja(12,"Element must be user-editable in order to clear it.");b=Z.b();Jc(b,a);Kc(b);a.value?(a.value="",b=Ab.create(a,void 0),"isTrusted"in b||(b.isTrusted=!1),a.dispatchEvent(b)):H(a,"INPUT")&&a.getAttribute("type")&&"number"==a.getAttribute("type").toLowerCase()&&
(a.value="");xc(a)&&(a.innerHTML=" ")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null,document:typeof window!='undefined'?window.document:null}, arguments);}
// https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/dom.js#L979
atom.getElementText = function(element, window){return function(){var g,l=this;function n(a){return void 0!==a}function p(a){return"string"==typeof a}function aa(a){return"number"==typeof a}function ba(a,b){a=a.split(".");var c=l;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&n(b)?c[d]=b:c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}}
function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";