selenium-atoms
Version:
113 lines (108 loc) • 54.1 kB
JavaScript
function(){return function(){var l=this;function m(a){return void 0!==a}function aa(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&m(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}}
function ba(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 ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function q(a){return"string"==typeof a}function da(a){return"function"==ba(a)}function ea(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function fa(a,b,c){return a.call.apply(a.bind,arguments)}
function ha(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 ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa:ha;return ia.apply(null,arguments)}
function ja(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)}}var ka=Date.now||function(){return+new Date};function r(a,b){function c(){}c.prototype=b.prototype;a.R=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.P=function(a,c,f){for(var g=Array(arguments.length-2),h=2;h<arguments.length;h++)g[h-2]=arguments[h];return b.prototype[c].apply(a,g)}};function t(a,b){this.code=a;this.a=u[a]||la;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}r(t,Error);var la="unknown error",u={15:"element not selectable",11:"element not visible"};u[31]=la;u[30]=la;u[24]="invalid cookie domain";u[29]="invalid element coordinates";u[12]="invalid element state";
u[32]="invalid selector";u[51]="invalid selector";u[52]="invalid selector";u[17]="javascript error";u[405]="unsupported operation";u[34]="move target out of bounds";u[27]="no such alert";u[7]="no such element";u[8]="no such frame";u[23]="no such window";u[28]="script timeout";u[33]="session not created";u[10]="stale element reference";u[21]="timeout";u[25]="unable to set cookie";u[26]="unexpected alert open";u[13]=la;u[9]="unknown command";t.prototype.toString=function(){return this.name+": "+this.message};var ma=window;var na;function oa(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var pa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};
function qa(a,b){for(var c=0,d=pa(String(a)).split("."),e=pa(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var h=d[g]||"",n=e[g]||"",p=RegExp("(\\d*)(\\D*)","g"),k=RegExp("(\\d*)(\\D*)","g");do{var w=p.exec(h)||["","",""],F=k.exec(n)||["","",""];if(0==w[0].length&&0==F[0].length)break;c=ra(0==w[1].length?0:parseInt(w[1],10),0==F[1].length?0:parseInt(F[1],10))||ra(0==w[2].length,0==F[2].length)||ra(w[2],F[2])}while(0==c)}return c}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()})};var ta=Array.prototype;function ua(a,b){if(q(a))return q(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 v(a,b){for(var c=a.length,d=q(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function va(a,b){for(var c=a.length,d=[],e=0,f=q(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d}
function wa(a,b){for(var c=a.length,d=Array(c),e=q(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function xa(a,b,c){var d=c;v(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ya(a,b){for(var c=a.length,d=q(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 za(a,b){for(var c=a.length,d=q(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 Aa(a,b){var c;a:{c=a.length;for(var d=q(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:q(a)?a.charAt(c):a[c]}function Ba(a){return ta.concat.apply(ta,arguments)}function Ca(a,b,c){return 2>=arguments.length?ta.slice.call(a,b):ta.slice.call(a,b,c)};var x;a:{var Da=l.navigator;if(Da){var Ea=Da.userAgent;if(Ea){x=Ea;break a}}x=""}function y(a){return-1!=x.indexOf(a)};function Fa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Ga(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Ha(a,b){return null!==a&&b in a}function Ia(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ja(){return y("Opera")||y("OPR")}function Ka(){return(y("Chrome")||y("CriOS"))&&!Ja()&&!y("Edge")};function La(){return y("iPhone")&&!y("iPod")&&!y("iPad")};var Ma=Ja(),z=y("Trident")||y("MSIE"),Na=y("Edge"),Oa=y("Gecko")&&!(-1!=x.toLowerCase().indexOf("webkit")&&!y("Edge"))&&!(y("Trident")||y("MSIE"))&&!y("Edge"),Pa=-1!=x.toLowerCase().indexOf("webkit")&&!y("Edge");function Qa(){var a=x;if(Oa)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Na)return/Edge\/([\d\.]+)/.exec(a);if(z)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Pa)return/WebKit\/(\S+)/.exec(a)}function Ra(){var a=l.document;return a?a.documentMode:void 0}
var Sa=function(){if(Ma&&l.opera){var a;var b=l.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Qa())&&(a=b?b[1]:"");return z&&(b=Ra(),b>parseFloat(a))?String(b):a}(),Ta={};function Ua(a){return Ta[a]||(Ta[a]=0<=qa(Sa,a))}var Va=l.document,Wa=Va&&z?Ra()||("CSS1Compat"==Va.compatMode?parseInt(Sa,10):5):void 0;!Oa&&!z||z&&9<=Wa||Oa&&Ua("1.9.1");z&&Ua("9");function A(a,b){this.x=m(a)?a:0;this.y=m(b)?b:0}A.prototype.clone=function(){return new A(this.x,this.y)};A.prototype.toString=function(){return"("+this.x+", "+this.y+")"};A.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};A.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};A.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function Xa(a,b){this.width=a;this.height=b}Xa.prototype.clone=function(){return new Xa(this.width,this.height)};Xa.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};Xa.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};Xa.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
Xa.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function Ya(a){return a?new Za(B(a)):na||(na=new Za)}function $a(a){return a?a.parentWindow||a.defaultView:window}function ab(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function bb(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
function cb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(z&&!(9<=Wa)){if(9==a.nodeType)return-1;if(9==b.nodeType)return 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?db(a,b):!c&&bb(e,b)?-1*eb(a,b):!d&&bb(f,a)?eb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=B(a);c=d.createRange();
c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(l.Range.START_TO_END,d)}function eb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return db(d,a)}function db(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function B(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function fb(a,b){a=a.parentNode;for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}
function Za(a){this.a=a||l.document||document}
function gb(a,b,c,d){a=d||a.a;var e=b&&"*"!=b?b.toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(e||c))c=a.querySelectorAll(e+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(b=a.getElementsByClassName(c),e){a={};for(var f=d=0,g;g=b[f];f++)e==g.nodeName&&(a[d++]=g);a.length=d;c=a}else c=b;else if(b=a.getElementsByTagName(e||"*"),c){a={};for(f=d=0;g=b[f];f++){var e=g.className,h;if(h="function"==typeof e.split)h=0<=ua(e.split(/\s+/),c);h&&(a[d++]=g)}a.length=d;c=a}else c=b;return c};var hb={w:function(a){return!(!a.querySelectorAll||!a.querySelector)},s:function(a,b){if(!a)throw new t(32,"No class name specified");a=pa(a);if(-1!==a.indexOf(" "))throw new t(32,"Compound class names not permitted");if(hb.w(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(c){throw new t(32,"An invalid or illegal class name was specified");}var d=gb(Ya(b),"*",a,b);return d.length?d[0]:null},m:function(a,b){if(!a)throw new t(32,"No class name specified");a=pa(a);if(-1!==a.indexOf(" "))throw new t(32,
"Compound class names not permitted");if(hb.w(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new t(32,"An invalid or illegal class name was specified");}return gb(Ya(b),"*",a,b)}};var ib=y("Firefox"),jb=La()||y("iPod"),kb=y("iPad"),lb=y("Android")&&!(Ka()||y("Firefox")||Ja()||y("Silk")),mb=Ka(),nb=y("Safari")&&!(Ka()||y("Coast")||Ja()||y("Edge")||y("Silk")||y("Android"))&&!(La()||y("iPad")||y("iPod"));function ob(a){return(a=a.exec(x))?a[1]:""}var pb=function(){if(ib)return ob(/Firefox\/([0-9.]+)/);if(z||Na||Ma)return Sa;if(mb)return ob(/Chrome\/([0-9.]+)/);if(nb&&!(La()||y("iPad")||y("iPod")))return ob(/Version\/([0-9.]+)/);if(jb||kb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(x))return a[1]+"."+a[2]}else if(lb)return(a=ob(/Android\s+([0-9.]+)/))?a:ob(/Version\/([0-9.]+)/);return""}();var qb,rb;function sb(a){return tb?qb(a):z?0<=qa(Wa,a):Ua(a)}function ub(a){tb?rb(a):lb?qa(vb,a):qa(pb,a)}
var tb=function(){if(!Oa)return!1;var a=l.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(b){return!1}var c=a.classes,a=a.interfaces,d=c["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),c=c["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),e=c.platformVersion,f=c.version;qb=function(a){return 0<=d.compare(e,""+a)};rb=function(a){d.compare(f,""+a)};return!0}(),wb;if(lb){var xb=/Android\s+([0-9\.]+)/.exec(x);wb=xb?xb[1]:"0"}else wb="0";
var vb=wb,yb=z&&!(8<=Wa),zb=z&&!(9<=Wa);lb&&ub(2.3);lb&&ub(4);nb&&ub(6);var Ab={s:function(a,b){if(!da(b.querySelector)&&z&&sb(8)&&!ea(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new t(32,"No selector specified");a=pa(a);var c;try{c=b.querySelector(a)}catch(d){throw new t(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},m:function(a,b){if(!da(b.querySelectorAll)&&z&&sb(8)&&!ea(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new t(32,"No selector specified");a=pa(a);try{return b.querySelectorAll(a)}catch(c){throw new t(32,
"An invalid or illegal selector was specified");}}};var Bb={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"};var Cb="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Db=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Eb=/^#(?:[0-9a-f]{3}){1,2}$/i,Fb=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Gb=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;/*
The MIT License
Copyright (c) 2007 Cybozu Labs, Inc.
Copyright (c) 2012 Google Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
function Hb(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var C=z&&!(9<=Wa),Ib=z&&!(8<=Wa);function Jb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Kb(a,b){var c=Ib&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Jb(b,a,b.nodeName,c)};function Lb(a){this.b=a;this.a=0}function Mb(a){a=a.match(Nb);for(var b=0;b<a.length;b++)Ob.test(a[b])&&a.splice(b,1);return new Lb(a)}var Nb=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Ob=/^\s/;function D(a,b){return a.b[a.a+(b||0)]}function E(a){return a.b[a.a++]}function Pb(a){return a.b.length<=a.a};function G(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(C&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else 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),C&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b}
function Qb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Ib&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Rb(a,b,c,d,e){return(C?Sb:Tb).call(null,a,b,q(c)?c:null,q(d)?d:null,e||new H)}
function Sb(a,b,c,d,e){if(a instanceof Ub||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Vb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],h=0;b=f[h++];)Qb(b,c,d)&&g.push(b);f=g}for(h=0;b=f[h++];)"*"==a&&"!"==b.tagName||I(e,b);return e}Wb(a,b,c,d,e);return e}
function Tb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!z?(b=b.getElementsByName(d),v(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),v(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?Wb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),v(b,function(a){Qb(a,c,d)&&I(e,a)}));return e}
function Xb(a,b,c,d,e){var f;if((a instanceof Ub||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Vb(a);if("*"!=g&&(f=va(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=va(f,function(a){return Qb(a,c,d)}));v(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||I(e,a)});return e}return Yb(a,b,c,d,e)}function Yb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Qb(b,c,d)&&a.a(b)&&I(e,b);return e}
function Wb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Qb(b,c,d)&&a.a(b)&&I(e,b),Wb(a,b,c,d,e)}function Vb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function H(){this.b=this.a=null;this.l=0}function Zb(a){this.node=a;this.a=this.b=null}function $b(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,h=d.node;f==h||f instanceof Jb&&h instanceof Jb&&f.a==h.a?(f=c,c=c.a,d=d.a):0<cb(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.l=g;return a}
H.prototype.unshift=function(a){a=new Zb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.l++};function I(a,b){var c=new Zb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.l++}function ac(a){return(a=a.a)?a.node:null}function bc(a){return(a=ac(a))?G(a):""}function cc(a,b){return new dc(a,!!b)}function dc(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function K(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function L(a){this.i=a;this.b=this.g=!1;this.f=null}function M(a){return"\n "+a.toString().split("\n").join("\n ")}function ec(a,b){a.g=b}function fc(a,b){a.b=b}function N(a,b){var c=a.a(b);return c instanceof H?+bc(c):+c}function O(a,b){var c=a.a(b);return c instanceof H?bc(c):""+c}function gc(a,b){var c=a.a(b);return c instanceof H?!!c.l:!!c};function hc(a,b,c){L.call(this,a.i);this.c=a;this.h=b;this.u=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==ic&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,v:b}):this.f={name:b.f.name,v:c})}r(hc,L);
function jc(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof H&&c instanceof H){e=cc(b);for(d=K(e);d;d=K(e))for(b=cc(c),f=K(b);f;f=K(b))if(a(G(d),G(f)))return!0;return!1}if(b instanceof H||c instanceof H){b instanceof H?e=b:(e=c,c=b);e=cc(e);b=typeof c;for(d=K(e);d;d=K(e)){switch(b){case "number":d=+G(d);break;case "boolean":d=!!G(d);break;case "string":d=G(d);break;default:throw Error("Illegal primitive type for comparison.");}if(a(d,c))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)}hc.prototype.a=function(a){return this.c.o(this.h,this.u,a)};hc.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+M(this.h);return a+=M(this.u)};function kc(a,b,c,d){this.a=a;this.I=b;this.i=c;this.o=d}kc.prototype.toString=function(){return this.a};var lc={};
function P(a,b,c,d){if(lc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new kc(a,b,c,d);return lc[a.toString()]=a}P("div",6,1,function(a,b,c){return N(a,c)/N(b,c)});P("mod",6,1,function(a,b,c){return N(a,c)%N(b,c)});P("*",6,1,function(a,b,c){return N(a,c)*N(b,c)});P("+",5,1,function(a,b,c){return N(a,c)+N(b,c)});P("-",5,1,function(a,b,c){return N(a,c)-N(b,c)});P("<",4,2,function(a,b,c){return jc(function(a,b){return a<b},a,b,c)});
P(">",4,2,function(a,b,c){return jc(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return jc(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return jc(function(a,b){return a>=b},a,b,c)});var ic=P("=",3,2,function(a,b,c){return jc(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return jc(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return gc(a,c)&&gc(b,c)});P("or",1,2,function(a,b,c){return gc(a,c)||gc(b,c)});function mc(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");L.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}r(mc,L);mc.prototype.a=function(a){a=this.c.a(a);return nc(this.h,a)};mc.prototype.toString=function(){var a;a="Filter:"+M(this.c);return a+=M(this.h)};function oc(a,b){if(b.length<a.J)throw Error("Function "+a.j+" expects at least"+a.J+" arguments, "+b.length+" given");if(null!==a.C&&b.length>a.C)throw Error("Function "+a.j+" expects at most "+a.C+" arguments, "+b.length+" given");a.O&&v(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});L.call(this,a.i);this.h=a;this.c=b;ec(this,a.g||ya(b,function(a){return a.g}));fc(this,a.N&&!b.length||a.M&&!!b.length||ya(b,function(a){return a.b}))}
r(oc,L);oc.prototype.a=function(a){return this.h.o.apply(null,Ba(a,this.c))};oc.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=xa(this.c,function(a,b){return a+M(b)},"Arguments:"),a=a+M(b);return a};function pc(a,b,c,d,e,f,g,h,n){this.j=a;this.i=b;this.g=c;this.N=d;this.M=e;this.o=f;this.J=g;this.C=m(h)?h:g;this.O=!!n}pc.prototype.toString=function(){return this.j};var qc={};
function Q(a,b,c,d,e,f,g,h){if(qc.hasOwnProperty(a))throw Error("Function already created: "+a+".");qc[a]=new pc(a,b,c,d,!1,e,f,g,h)}Q("boolean",2,!1,!1,function(a,b){return gc(b,a)},1);Q("ceiling",1,!1,!1,function(a,b){return Math.ceil(N(b,a))},1);Q("concat",3,!1,!1,function(a,b){return xa(Ca(arguments,1),function(b,d){return b+O(d,a)},"")},2,null);Q("contains",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return-1!=b.indexOf(a)},2);Q("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0);
Q("false",2,!1,!1,function(){return!1},0);Q("floor",1,!1,!1,function(a,b){return Math.floor(N(b,a))},1);Q("id",4,!1,!1,function(a,b){function c(a){if(C){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return Aa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=O(b,a).split(/\s+/),f=[];v(d,function(a){a=c(a);!a||0<=ua(f,a)||f.push(a)});f.sort(cb);var g=new H;v(f,function(a){I(g,a)});return g},1);
Q("lang",2,!1,!1,function(){return!1},1);Q("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);Q("local-name",3,!1,!0,function(a,b){var c=b?ac(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);Q("name",3,!1,!0,function(a,b){var c=b?ac(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);Q("namespace-uri",3,!0,!1,function(){return""},0,1,!0);
Q("normalize-space",3,!1,!0,function(a,b){return(b?O(b,a):G(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);Q("not",2,!1,!1,function(a,b){return!gc(b,a)},1);Q("number",1,!1,!0,function(a,b){return b?N(b,a):+G(a.a)},0,1);Q("position",1,!0,!1,function(a){return a.b},0);Q("round",1,!1,!1,function(a,b){return Math.round(N(b,a))},1);Q("starts-with",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return 0==b.lastIndexOf(a,0)},2);Q("string",3,!1,!0,function(a,b){return b?O(b,a):G(a.a)},0,1);
Q("string-length",1,!1,!0,function(a,b){return(b?O(b,a):G(a.a)).length},0,1);Q("substring",3,!1,!1,function(a,b,c,d){c=N(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?N(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=O(b,a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);Q("substring-after",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
Q("substring-before",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);Q("sum",1,!1,!1,function(a,b){for(var c=cc(b.a(a)),d=0,e=K(c);e;e=K(c))d+=+G(e);return d},1,1,!0);Q("translate",3,!1,!1,function(a,b,c,d){b=O(b,a);c=O(c,a);var e=O(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);Q("true",2,!1,!1,function(){return!0},0);function J(a,b){this.h=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 rc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.f=function(){return this.h};
J.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=M(this.c));return a};function sc(a){L.call(this,3);this.c=a.substring(1,a.length-1)}r(sc,L);sc.prototype.a=function(){return this.c};sc.prototype.toString=function(){return"Literal: "+this.c};function Ub(a,b){this.j=a.toLowerCase();this.c=b?b.toLowerCase():"http://www.w3.org/1999/xhtml"}Ub.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.j&&this.j!=a.nodeName.toLowerCase()?!1:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Ub.prototype.f=function(){return this.j};Ub.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j};function tc(a){L.call(this,1);this.c=a}r(tc,L);tc.prototype.a=function(){return this.c};tc.prototype.toString=function(){return"Number: "+this.c};function uc(a,b){L.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.A||c.c!=vc||(c=c.u,"*"!=c.f()&&(this.f={name:c.f(),v:null}))}}r(uc,L);function yc(){L.call(this,4)}r(yc,L);yc.prototype.a=function(a){var b=new H;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};yc.prototype.toString=function(){return"Root Helper Expression"};function zc(){L.call(this,4)}r(zc,L);zc.prototype.a=function(a){var b=new H;I(b,a.a);return b};zc.prototype.toString=function(){return"Context Helper Expression"};
function Ac(a){return"/"==a||"//"==a}uc.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof H))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=cc(b,e.c.a),g;if(e.g||e.c!=Bc)if(e.g||e.c!=Cc)for(g=K(f),b=e.a(new Hb(g));null!=(g=K(f));)g=e.a(new Hb(g)),b=$b(b,g);else g=K(f),b=e.a(new Hb(g));else{for(g=K(f);(b=K(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new Hb(g))}}return b};
uc.prototype.toString=function(){var a;a="Path Expression:"+M(this.h);if(this.c.length){var b=xa(this.c,function(a,b){return a+M(b)},"Steps:");a+=M(b)}return a};function Dc(a,b){this.a=a;this.b=!!b}
function nc(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=cc(b),f=b.l,g,h=0;g=K(e);h++){var n=a.b?f-h:h+1;g=d.a(new Hb(g,n,f));if("number"==typeof g)n=n==g;else if("string"==typeof g||"boolean"==typeof g)n=!!g;else if(g instanceof H)n=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!n){n=e;g=n.f;var p=n.a;if(!p)throw Error("Next must be called at least once before remove.");var k=p.b,p=p.a;k?k.a=p:g.a=p;p?p.b=k:g.b=k;g.l--;n.a=null}}return b}
Dc.prototype.toString=function(){return xa(this.a,function(a,b){return a+M(b)},"Predicates:")};function Ec(a,b,c,d){L.call(this,4);this.c=a;this.u=b;this.h=c||new Dc([]);this.A=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=C?a.toLowerCase():a,this.f={name:a,v:b.v});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}r(Ec,L);
Ec.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.v?O(c.v,a):null,f=1);if(this.A)if(this.g||this.c!=Fc)if(a=cc((new Ec(Gc,new J("node"))).a(a)),b=K(a))for(c=this.o(b,d,e,f);null!=(b=K(a));)c=$b(c,this.o(b,d,e,f));else c=new H;else c=Rb(this.u,b,d,e),c=nc(this.h,c,f);else c=this.o(a.a,d,e,f);return c};Ec.prototype.o=function(a,b,c,d){a=this.c.f(this.u,a,b,c);return a=nc(this.h,a,d)};
Ec.prototype.toString=function(){var a;a="Step:"+M("Operator: "+(this.A?"//":"/"));this.c.j&&(a+=M("Axis: "+this.c));a+=M(this.u);if(this.h.a.length){var b=xa(this.h.a,function(a,b){return a+M(b)},"Predicates:");a+=M(b)}return a};function Hc(a,b,c,d){this.j=a;this.f=b;this.a=c;this.b=d}Hc.prototype.toString=function(){return this.j};var Ic={};function R(a,b,c,d){if(Ic.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Hc(a,b,c,!!d);return Ic[a]=b}
R("ancestor",function(a,b){for(var c=new H,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);R("ancestor-or-self",function(a,b){var c=new H,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);
var vc=R("attribute",function(a,b){var c=new H,d=a.f();if("style"==d&&b.style&&C)return I(c,new Jb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)C?f.nodeValue&&I(c,Kb(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(C?f.nodeValue&&I(c,Kb(b,f)):I(c,f));return c},!1),Fc=R("child",function(a,b,c,d,e){return(C?Xb:Yb).call(null,a,b,q(c)?c:null,q(d)?d:null,e||new H)},!1,!0);R("descendant",Rb,!1,!0);
var Gc=R("descendant-or-self",function(a,b,c,d){var e=new H;Qb(b,c,d)&&a.a(b)&&I(e,b);return Rb(a,b,c,d,e)},!1,!0),Bc=R("following",function(a,b,c,d){var e=new H;do for(var f=b;f=f.nextSibling;)Qb(f,c,d)&&a.a(f)&&I(e,f),e=Rb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);R("following-sibling",function(a,b){for(var c=new H,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);R("namespace",function(){return new H},!1);
var Jc=R("parent",function(a,b){var c=new H;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),Cc=R("preceding",function(a,b,c,d){var e=new H,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var n=[];for(b=f[g];b=b.previousSibling;)n.unshift(b);for(var p=0,k=n.length;p<k;p++)b=n[p],Qb(b,c,d)&&a.a(b)&&I(e,b),e=Rb(a,b,c,d,e)}return e},!0,!0);
R("preceding-sibling",function(a,b){for(var c=new H,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Kc=R("self",function(a,b){var c=new H;a.a(b)&&I(c,b);return c},!1);function Lc(a){L.call(this,1);this.c=a;this.g=a.g;this.b=a.b}r(Lc,L);Lc.prototype.a=function(a){return-N(this.c,a)};Lc.prototype.toString=function(){return"Unary Expression: -"+M(this.c)};function Mc(a){L.call(this,4);this.c=a;ec(this,ya(this.c,function(a){return a.g}));fc(this,ya(this.c,function(a){return a.b}))}r(Mc,L);Mc.prototype.a=function(a){var b=new H;v(this.c,function(c){c=c.a(a);if(!(c instanceof H))throw Error("Path expression must evaluate to NodeSet.");b=$b(b,c)});return b};Mc.prototype.toString=function(){return xa(this.c,function(a,b){return a+M(b)},"Union Expression:")};function Nc(a,b){this.a=a;this.b=b}function Oc(a){for(var b,c=[];;){S(a,"Missing right hand side of binary expression.");b=Pc(a);var d=E(a.a);if(!d)break;var e=(d=lc[d]||null)&&d.I;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].I;)b=new hc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new hc(c.pop(),c.pop(),b);return b}function S(a,b){if(Pb(a.a))throw Error(b);}function Qc(a,b){var c=E(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);}
function Rc(a){a=E(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Sc(a){a=E(a.a);if(2>a.length)throw Error("Unclosed literal string");return new sc(a)}function Tc(a){var b=E(a.a),c=b.indexOf(":");if(-1==c)return new Ub(b);var d=b.substring(0,c);a=a.b(d);if(!a)throw Error("Namespace prefix not declared: "+d);b=b.substr(c+1);return new Ub(b,a)}
function Uc(a){var b,c=[],d;if(Ac(D(a.a))){b=E(a.a);d=D(a.a);if("/"==b&&(Pb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new yc;d=new yc;S(a,"Missing next location step.");b=Vc(a,b);c.push(b)}else{a:{b=D(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":E(a.a);b=Oc(a);S(a,'unclosed "("');Qc(a,")");break;case '"':case "'":b=Sc(a);break;default:if(isNaN(+b))if(!rc(b)&&/(?![0-9])[\w]/.test(d)&&"("==D(a.a,1)){b=E(a.a);
b=qc[b]||null;E(a.a);for(d=[];")"!=D(a.a);){S(a,"Missing function argument list.");d.push(Oc(a));if(","!=D(a.a))break;E(a.a)}S(a,"Unclosed function argument list.");Rc(a);b=new oc(b,d)}else{b=null;break a}else b=new tc(+E(a.a))}"["==D(a.a)&&(d=new Dc(Wc(a)),b=new mc(b,d))}if(b)if(Ac(D(a.a)))d=b;else return b;else b=Vc(a,"/"),d=new zc,c.push(b)}for(;Ac(D(a.a));)b=E(a.a),S(a,"Missing next location step."),b=Vc(a,b),c.push(b);return new uc(d,c)}
function Vc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==D(a.a))return d=new Ec(Kc,new J("node")),E(a.a),d;if(".."==D(a.a))return d=new Ec(Jc,new J("node")),E(a.a),d;var f;if("@"==D(a.a))f=vc,E(a.a),S(a,"Missing attribute name");else if("::"==D(a.a,1)){if(!/(?![0-9])[\w]/.test(D(a.a).charAt(0)))throw Error("Bad token: "+E(a.a));c=E(a.a);f=Ic[c]||null;if(!f)throw Error("No axis with name: "+c);E(a.a);S(a,"Missing node name")}else f=Fc;c=D(a.a);if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("==
D(a.a,1)){if(!rc(c))throw Error("Invalid node type: "+c);c=E(a.a);if(!rc(c))throw Error("Invalid type name: "+c);Qc(a,"(");S(a,"Bad nodetype");e=D(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Sc(a);S(a,"Bad nodetype");Rc(a);c=new J(c,g)}else c=Tc(a);else if("*"==c)c=Tc(a);else throw Error("Bad token: "+E(a.a));e=new Dc(Wc(a),f.a);return d||new Ec(f,c,e,"//"==b)}
function Wc(a){for(var b=[];"["==D(a.a);){E(a.a);S(a,"Missing predicate expression.");var c=Oc(a);b.push(c);S(a,"Unclosed predicate expression.");Qc(a,"]")}return b}function Pc(a){if("-"==D(a.a))return E(a.a),new Lc(Pc(a));var b=Uc(a);if("|"!=D(a.a))a=b;else{for(b=[b];"|"==E(a.a);)S(a,"Missing next union location path."),b.push(Uc(a));a.a.a--;a=new Mc(b)}return a};function Xc(a){switch(a.nodeType){case 1:return ja(Yc,a);case 9:return Xc(a.documentElement);case 11:case 10:case 6:case 12:return Zc;default:return a.parentNode?Xc(a.parentNode):Zc}}function Zc(){return null}function Yc(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?Yc(a.parentNode,b):null};function $c(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Mb(a);if(Pb(c))throw Error("Invalid XPath expression.");b?da(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=Oc(new Nc(c,b));if(!Pb(c))throw Error("Bad token: "+E(c));this.evaluate=function(a,b){var c=d.a(new Hb(a));return new T(c,b)}}
function T(a,b){if(0==b)if(a instanceof H)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 H))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof H?bc(a):""+a;break;case 1:this.numberValue=a instanceof H?+bc(a):+a;break;case 3:this.booleanValue=a instanceof H?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var d=
cc(a);c=[];for(var e=K(d);e;e=K(d))c.push(e instanceof Jb?e.a:e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:d=ac(a);this.singleNodeValue=d instanceof Jb?d.a:d;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>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length||
0>a?null:c[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 ad(a){this.lookupNamespaceURI=Xc(a)}
function bd(a){a=a||l;var b=a.document;b.evaluate||(a.XPathResult=T,b.evaluate=function(a,b,e,f){return(new $c(a,e)).evaluate(b,f)},b.createExpression=function(a,b){return new $c(a,b)},b.createNSResolver=function(a){return new ad(a)})}aa("wgxpath.install",bd);var U={};U.D=function(){var a={S:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
U.o=function(a,b,c){var d=B(a);if(!d.documentElement)return null;(z||lb)&&bd($a(d));try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):U.D;if(z&&!Ua(7))return d.evaluate.call(d,b,a,e,c,null);if(!z||9<=Wa){for(var f={},g=d.getElementsByTagName("*"),h=0;h<g.length;++h){var n=g[h],p=n.namespaceURI;if(p&&!f[p]){var k=n.lookupPrefix(p);if(!k){var w=p.match(".*/(\\w+)/?$");w?k=w[1]:k="xhtml"}f[p]=k}}var F={},ga;for(ga in f)F[f[ga]]=ga;e=function(a){return F[a]||null}}try{return d.evaluate(b,
a,e,c,null)}catch(wc){if("TypeError"===wc.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):U.D,d.evaluate(b,a,e,c,null);throw wc;}}catch(xc){if(!Oa||"NS_ERROR_ILLEGAL_VALUE"!=xc.name)throw new t(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+xc);}};U.F=function(a,b){if(!a||1!=a.nodeType)throw new t(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};
U.s=function(a,b){var c=function(){var c=U.o(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=B(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||U.F(c,a);return c};
U.m=function(a,b){var c=function(){var c=U.o(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=B(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();v(c,function(b){U.F(b,a)});return c};function cd(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}cd.prototype.clone=function(){return new cd(this.top,this.right,this.bottom,this.left)};cd.prototype.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};cd.prototype.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};
cd.prototype.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};cd.prototype.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};function V(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}V.prototype.clone=function(){return new V(this.left,this.top,this.width,this.height)};V.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};V.prototype.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};
V.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};V.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function W(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}var dd=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/;function ed(a){var b=[];v(a.split(dd),function(a){var d=a.indexOf(":");0<d&&(a=[a.slice(0,d),a.slice(d+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}
function fd(a,b){b=b.toLowerCase();if("style"==b)return ed(a.style.cssText);if(yb&&"value"==b&&W(a,"INPUT"))return a.value;if(zb&&!0===a[b])return String(a.getAttribute(b));var c=a.getAttributeNode(b);return c&&c.specified?c.value:null}function gd(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return W(a)?a:null}
function X(a,b){var c=sa(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=zb?"styleFloat":"cssFloat";var d;a:{d=c;var e=B(a);if(e.defaultView&&e.defaultView.getComputedStyle&&(e=e.defaultView.getComputedStyle(a,null))){d=e[d]||e.getPropertyValue(d)||"";break a}d=""}d=d||hd(a,c);if(null===d)d=null;else if(0<=ua(Cb,c)){b:{var f=d.match(Fb);if(f){var c=Number(f[1]),e=Number(f[2]),g=Number(f[3]),f=Number(f[4]);if(0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g&&0<=f&&1>=f){c=[c,e,g,f];break b}}c=null}if(!c)b:{if(g=
d.match(Gb))if(c=Number(g[1]),e=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g){c=[c,e,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase();e=Bb[c.toLowerCase()];if(!e&&(e="#"==c.charAt(0)?c:"#"+c,4==e.length&&(e=e.replace(Db,"#$1$1$2$2$3$3")),!Eb.test(e))){c=null;break b}c=[parseInt(e.substr(1,2),16),parseInt(e.substr(3,2),16),parseInt(e.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d}
function hd(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:(c=gd(a))?hd(c,b):null}
function id(a,b,c){function d(a){var b=jd(a);return 0<b.height&&0<b.width?!0:W(a,"PATH")&&(0<b.height||0<b.width)?(a=X(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=X(a,"overflow")&&ya(a.childNodes,function(a){return 3==a.nodeType||W(a)&&d(a)})}function e(a){return kd(a)==Y&&za(a.childNodes,function(a){return!W(a)||e(a)||!d(a)})}if(!W(a))throw Error("Argument to isShown must be of type Element");if(W(a,"BODY"))return!0;if(W(a,"OPTION")||W(a,"OPTGROUP"))return a=fb(a,function(a){return W(a,"SELECT")}),
!!a&&id(a,!0,c);var f=ld(a);if(f)return!!f.G&&0<f.rect.width&&0<f.rect.height&&id(f.G,b,c);if(W(a,"INPUT")&&"hidden"==a.type.toLowerCase()||W(a,"NOSCRIPT"))return!1;f=X(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=md(a))&&d(a)?!e(a):!1}function nd(a){function b(a){if("none"==X(a,"display"))return!1;a=gd(a);return!a||b(a)}return id(a,!1,b)}var Y="hidden";
function kd(a){function b(a){function b(a){return a==g?!0:0==X(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==X(a,"position")?!1:!0}var c=X(a,"position");if("fixed"==c)return p=!0,a==g?null:g;for(a=gd(a);a&&!b(a);)a=gd(a);return a}function c(a){var b=a;if("visible"==n)if(a==g&&h)b=h;else if(a==h)return{x:"visible",y:"visible"};b={x:X(b,"overflow-x"),y:X(b,"overflow-y")};a==g&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function d(a){if(a==g){var b=(new Za(f)).a;
a=b.scrollingElement?b.scrollingElement:Pa||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=z&&Ua("10")&&b.pageYOffset!=a.scrollTop?new A(a.scrollLeft,a.scrollTop):new A(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new A(a.scrollLeft,a.scrollTop);return a}var e=od(a),f=B(a),g=f.documentElement,h=f.body,n=X(g,"overflow"),p;for(a=b(a);a;a=b(a)){var k=c(a);if("visible"!=k.x||"visible"!=k.y){var w=jd(a);if(0==w.width||0==w.height)return Y;
var F=e.right<w.left,ga=e.bottom<w.top;if(F&&"hidden"==k.x||ga&&"hidden"==k.y)return Y;if(F&&"visible"!=k.x||ga&&"visible"!=k.y){F=d(a);ga=e.bottom<w.top-F.y;if(e.right<w.left-F.x&&"visible"!=k.x||ga&&"visible"!=k.x)return Y;e=kd(a);return e==Y?Y:"scroll"}F=e.left>=w.left+w.width;w=e.top>=w.top+w.height;if(F&&"hidden"==k.x||w&&"hidden"==k.y)return Y;if(F&&"visible"!=k.x||w&&"visible"!=k.y){if(p&&(k=d(a),e.left>=g.scrollWidth-k.x||e.right>=g.scrollHeight-k.y))return Y;e=kd(a);return e==Y?Y:"scroll"}}}return"none"}
function jd(a){var b=ld(a);if(b)return b.rect;if(W(a,"HTML"))return a=B(a),a=($a(a)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new Xa(a.clientWidth,a.clientHeight),new V(0,0,a.width,a.height);var c;try{c=a.getBoundingClientRect()}catch(d){return new V(0,0,0,0)}b=new V(c.left,c.top,c.right-c.left,c.bottom-c.top);z&&a.ownerDocument.body&&(a=B(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}
function ld(a){var b=W(a,"MAP");if(!b&&!W(a,"AREA"))return null;var c=b?a:W(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;if(c&&c.name&&(d=U.s('/descendant::*[@usemap = "#'+c.name+'"]',B(c)))&&(e=jd(d),!b&&"default"!=a.shape.toLowerCase())){var f=pd(a);a=Math.min(Math.max(f.left,0),e.width);b=Math.min(Math.max(f.top,0),e.height);c=Math.min(f.width,e.width-a);f=Math.min(f.height,e.height-b);e=new V(a+e.left,b+e.top,c,f)}return{G:d,rect:e||new V(0,0,0,0)}}
function pd(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 V(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new V(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 V(b,c,d-b,e-c)}return new V(0,0,0,0)}function od(a){a=jd(a);return new cd(a.top,a.left+a.width,a.top+a.height,a.left)}
function qd(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")}function rd(a){var b=[];sd(a,b);a=wa(b,qd);return qd(a.join("\n")).replace(/\xa0/g," ")}
function td(a,b,c){if(W(a,"BR"))b.push("");else{var d=W(a,"TD"),e=X(a,"display"),f=!d&&!(0<=ua(ud,e)),g=m(a.previousElementSibling)?a.previousElementSibling:ab(a.previousSibling),g=g?X(g,"display"):"",h=X(a,"float")||X(a,"cssFloat")||X(a,"styleFloat");!f||"run-in"==g&&"none"==h||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var n=nd(a),p=null,k=null;n&&(p=X(a,"white-space"),k=X(a,"text-transform"));v(a.childNodes,function(a){c(a,b,n,p,k)});a=b[b.length-1]||"";!d&&"table-cell"!=e||!a||oa(a)||(b[b.length-
1]+=" ");f&&"run-in"!=e&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function sd(a,b){td(a,b,function(a,b,e,f,g){3==a.nodeType&&e?vd(a,b,f,g):W(a)&&sd(a,b)})}var ud="inline inline-block inline-table none table-cell table-column table-column-group".split(" ");
function vd(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[\ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(/(^|\s)(\S)/g,function(a,b,c){return b+c.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";oa(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)}
function md(a){if(zb){if("relative"==X(a,"position"))return 1;a=X(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return wd(a)}function wd(a){var b=1,c=X(a,"opacity");c&&(b=Number(c));(a=gd(a))&&(b*=wd(a));return b};var xd={w:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},s:function(a,b){var c=Ya(b),d=q(a)?c.a.getElementById(a):a;if(!d)return null;if(fd(d,"id")==a&&bb(b,d))return d;c=gb(c,"*");return Aa(c,function(c){return fd(c,"id")==a&&bb(b,c)})},m:function(a,b){if(!a)return[];if(xd.w(b,a))try{return b.querySelectorAll("#"+xd.L(a))}catch(c){return[]}var d=gb(Ya(b),"*",null,b);return va(d,function(b){return fd(b,"id")==a})},L:function(a){return a.replace(/(['"\\#.:;,!?+<>=~*^$|%&@`{}\-\/\[\]\(\)])/g,
"\\$1")}};var Z={},yd={};Z.K=function(a,b,c){var d;try{d=Ab.m("a",b)}catch(e){d=gb(Ya(b),"A",null,b)}return Aa(d,function(b){b=rd(b);return c&&-1!=b.indexOf(a)||b==a})};Z.H=function(a,b,c){var d;try{d=Ab.m("a",b)}catch(e){d=gb(Ya(b),"A",null,b)}return va(d,function(b){b=rd(b);return c&&-1!=b.indexOf(a)||b==a})};Z.s=function(a,b){return Z.K(a,b,!1)};Z.m=function(a,b){return Z.H(a,b,!1)};yd.s=function(a,b){retur