selenium-atoms
Version:
113 lines (108 loc) • 51.4 kB
JavaScript
function(){return function(){var h,l=this;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||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b}
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 m(a){return"string"==typeof a}function da(a){return"number"==typeof 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 ga(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:ga;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 p(a,b){function c(){}c.prototype=b.prototype;a.P=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.N=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};var la=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};
function ma(a,b){for(var c=0,d=la(String(a)).split("."),e=la(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var k=d[g]||"",n=e[g]||"",r=RegExp("(\\d*)(\\D*)","g"),G=RegExp("(\\d*)(\\D*)","g");do{var A=r.exec(k)||["","",""],t=G.exec(n)||["","",""];if(0==A[0].length&&0==t[0].length)break;c=na(0==A[1].length?0:parseInt(A[1],10),0==t[1].length?0:parseInt(t[1],10))||na(0==A[2].length,0==t[2].length)||na(A[2],t[2])}while(0==c)}return c}function na(a,b){return a<b?-1:a>b?1:0}
function oa(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};var pa=Array.prototype;function qa(a,b){if(m(a))return m(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 q(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function ra(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d}
function sa(a,b){for(var c=a.length,d=Array(c),e=m(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 ta(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ua(a,b){for(var c=a.length,d=m(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 va(a,b){var c;a:{c=a.length;for(var d=m(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:m(a)?a.charAt(c):a[c]}
function wa(a){return pa.concat.apply(pa,arguments)}function xa(a,b,c){return 2>=arguments.length?pa.slice.call(a,b):pa.slice.call(a,b,c)};var ya={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 za="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Aa=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Ba=/^#(?:[0-9a-f]{3}){1,2}$/i,Ca=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Da=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function Ea(a,b){this.code=a;this.a=u[a]||Fa;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||""}p(Ea,Error);var Fa="unknown error",u={15:"element not selectable",11:"element not visible"};u[31]=Fa;u[30]=Fa;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]=Fa;u[9]="unknown command";Ea.prototype.toString=function(){return this.name+": "+this.message};var v;a:{var Ga=l.navigator;if(Ga){var Ha=Ga.userAgent;if(Ha){v=Ha;break a}}v=""}function w(a){return-1!=v.indexOf(a)};function Ia(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Ja(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Ka(a,b){return null!==a&&b in a}function La(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ma(){return w("Opera")||w("OPR")}function Na(){return(w("Chrome")||w("CriOS"))&&!Ma()&&!w("Edge")};function Oa(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var Pa=Ma(),x=w("Trident")||w("MSIE"),Qa=w("Edge"),y=w("Gecko")&&!(-1!=v.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),Ra=-1!=v.toLowerCase().indexOf("webkit")&&!w("Edge"),Sa=w("Macintosh"),Ta=w("Windows");function Ua(){var a=v;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Qa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ra)return/WebKit\/(\S+)/.exec(a)}function Va(){var a=l.document;return a?a.documentMode:void 0}
var Wa=function(){if(Pa&&l.opera){var a;var b=l.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ua())&&(a=b?b[1]:"");return x&&(b=Va(),b>parseFloat(a))?String(b):a}(),Xa={};function Ya(a){return Xa[a]||(Xa[a]=0<=ma(Wa,a))}var Za=l.document,z=Za&&x?Va()||("CSS1Compat"==Za.compatMode?parseInt(Wa,10):5):void 0;!y&&!x||x&&9<=z||y&&Ya("1.9.1");x&&Ya("9");function $a(a,b,c){return Math.min(Math.max(a,b),c)};function ab(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}h=ab.prototype;h.clone=function(){return new ab(this.x,this.y)};h.toString=function(){return"("+this.x+", "+this.y+")"};h.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};h.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};h.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};h.scale=function(a,b){var c=da(b)?b:a;this.x*=a;this.y*=c;return this};function bb(a,b){this.width=a;this.height=b}h=bb.prototype;h.clone=function(){return new bb(this.width,this.height)};h.toString=function(){return"("+this.width+" x "+this.height+")"};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};
h.scale=function(a,b){var c=da(b)?b:a;this.width*=a;this.height*=c;return this};function cb(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 db(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=z)){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?eb(a,b):!c&&cb(e,b)?-1*fb(a,b):!d&&cb(f,a)?fb(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 fb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return eb(d,a)}function eb(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 gb(a){this.a=a||l.document||document}gb.prototype.contains=cb;var hb=w("Firefox"),ib=Oa()||w("iPod"),jb=w("iPad"),kb=w("Android")&&!(Na()||w("Firefox")||Ma()||w("Silk")),lb=Na(),mb=w("Safari")&&!(Na()||w("Coast")||Ma()||w("Edge")||w("Silk")||w("Android"))&&!(Oa()||w("iPad")||w("iPod"));/*
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 nb(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var C=x&&!(9<=z),ob=x&&!(8<=z);function pb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function qb(a,b){var c=ob&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new pb(b,a,b.nodeName,c)};function rb(a){this.b=a;this.a=0}function sb(a){a=a.match(tb);for(var b=0;b<a.length;b++)ub.test(a[b])&&a.splice(b,1);return new rb(a)}var tb=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),ub=/^\s/;function D(a,b){return a.b[a.a+(b||0)]}function E(a){return a.b[a.a++]}function vb(a){return a.b.length<=a.a};function H(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 I(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}ob&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function wb(a,b,c,d,e){return(C?xb:yb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new J)}
function xb(a,b,c,d,e){if(a instanceof zb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Ab(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)I(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||K(e,b);return e}Bb(a,b,c,d,e);return e}
function yb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&K(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&K(e,b)})):a instanceof L?Bb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),q(b,function(a){I(a,c,d)&&K(e,a)}));return e}
function Cb(a,b,c,d,e){var f;if((a instanceof zb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Ab(a);if("*"!=g&&(f=ra(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=ra(f,function(a){return I(a,c,d)}));q(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||K(e,a)});return e}return Db(a,b,c,d,e)}function Db(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)I(b,c,d)&&a.a(b)&&K(e,b);return e}
function Bb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)I(b,c,d)&&a.a(b)&&K(e,b),Bb(a,b,c,d,e)}function Ab(a){if(a instanceof L){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function J(){this.b=this.a=null;this.s=0}function Eb(a){this.node=a;this.a=this.b=null}function Fb(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,k=d.node;f==k||f instanceof pb&&k instanceof pb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<db(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.s=g;return a}
J.prototype.unshift=function(a){a=new Eb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function K(a,b){var c=new Eb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function Gb(a){return(a=a.a)?a.node:null}function Hb(a){return(a=Gb(a))?H(a):""}function Ib(a,b){return new Jb(a,!!b)}function Jb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function M(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 N(a){this.m=a;this.b=this.i=!1;this.h=null}function O(a){return"\n "+a.toString().split("\n").join("\n ")}function Kb(a,b){a.i=b}function Lb(a,b){a.b=b}function P(a,b){var c=a.a(b);return c instanceof J?+Hb(c):+c}function Q(a,b){var c=a.a(b);return c instanceof J?Hb(c):""+c}function Mb(a,b){var c=a.a(b);return c instanceof J?!!c.s:!!c};function Nb(a,b,c){N.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Ob&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}p(Nb,N);
function Pb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof J&&c instanceof J){e=Ib(b);for(d=M(e);d;d=M(e))for(b=Ib(c),f=M(b);f;f=M(b))if(a(H(d),H(f)))return!0;return!1}if(b instanceof J||c instanceof J){b instanceof J?e=b:(e=c,c=b);e=Ib(e);b=typeof c;for(d=M(e);d;d=M(e)){switch(b){case "number":d=+H(d);break;case "boolean":d=!!H(d);break;case "string":d=H(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)}Nb.prototype.a=function(a){return this.c.u(this.j,this.w,a)};Nb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+O(this.j);return a+=O(this.w)};function Qb(a,b,c,d){this.a=a;this.H=b;this.m=c;this.u=d}Qb.prototype.toString=function(){return this.a};var Rb={};
function S(a,b,c,d){if(Rb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Qb(a,b,c,d);return Rb[a.toString()]=a}S("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});S("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});S("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});S("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});S("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});S("<",4,2,function(a,b,c){return Pb(function(a,b){return a<b},a,b,c)});
S(">",4,2,function(a,b,c){return Pb(function(a,b){return a>b},a,b,c)});S("<=",4,2,function(a,b,c){return Pb(function(a,b){return a<=b},a,b,c)});S(">=",4,2,function(a,b,c){return Pb(function(a,b){return a>=b},a,b,c)});var Ob=S("=",3,2,function(a,b,c){return Pb(function(a,b){return a==b},a,b,c,!0)});S("!=",3,2,function(a,b,c){return Pb(function(a,b){return a!=b},a,b,c,!0)});S("and",2,2,function(a,b,c){return Mb(a,c)&&Mb(b,c)});S("or",1,2,function(a,b,c){return Mb(a,c)||Mb(b,c)});function Sb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");N.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}p(Sb,N);Sb.prototype.a=function(a){a=this.c.a(a);return Tb(this.j,a)};Sb.prototype.toString=function(){var a;a="Filter:"+O(this.c);return a+=O(this.j)};function Ub(a,b){if(b.length<a.I)throw Error("Function "+a.o+" expects at least"+a.I+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.M&&q(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});N.call(this,a.m);this.j=a;this.c=b;Kb(this,a.i||ua(b,function(a){return a.i}));Lb(this,a.L&&!b.length||a.K&&!!b.length||ua(b,function(a){return a.b}))}
p(Ub,N);Ub.prototype.a=function(a){return this.j.u.apply(null,wa(a,this.c))};Ub.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=ta(this.c,function(a,b){return a+O(b)},"Arguments:"),a=a+O(b);return a};function Vb(a,b,c,d,e,f,g,k,n){this.o=a;this.m=b;this.i=c;this.L=d;this.K=e;this.u=f;this.I=g;this.D=void 0!==k?k:g;this.M=!!n}Vb.prototype.toString=function(){return this.o};var Wb={};
function T(a,b,c,d,e,f,g,k){if(Wb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Wb[a]=new Vb(a,b,c,d,!1,e,f,g,k)}T("boolean",2,!1,!1,function(a,b){return Mb(b,a)},1);T("ceiling",1,!1,!1,function(a,b){return Math.ceil(P(b,a))},1);T("concat",3,!1,!1,function(a,b){return ta(xa(arguments,1),function(b,d){return b+Q(d,a)},"")},2,null);T("contains",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);T("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0);
T("false",2,!1,!1,function(){return!1},0);T("floor",1,!1,!1,function(a,b){return Math.floor(P(b,a))},1);T("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 va(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=Q(b,a).split(/\s+/),f=[];q(d,function(a){a=c(a);!a||0<=qa(f,a)||f.push(a)});f.sort(db);var g=new J;q(f,function(a){K(g,a)});return g},1);
T("lang",2,!1,!1,function(){return!1},1);T("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);T("local-name",3,!1,!0,function(a,b){var c=b?Gb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);T("name",3,!1,!0,function(a,b){var c=b?Gb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);T("namespace-uri",3,!0,!1,function(){return""},0,1,!0);
T("normalize-space",3,!1,!0,function(a,b){return(b?Q(b,a):H(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);T("not",2,!1,!1,function(a,b){return!Mb(b,a)},1);T("number",1,!1,!0,function(a,b){return b?P(b,a):+H(a.a)},0,1);T("position",1,!0,!1,function(a){return a.b},0);T("round",1,!1,!1,function(a,b){return Math.round(P(b,a))},1);T("starts-with",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);T("string",3,!1,!0,function(a,b){return b?Q(b,a):H(a.a)},0,1);
T("string-length",1,!1,!0,function(a,b){return(b?Q(b,a):H(a.a)).length},0,1);T("substring",3,!1,!1,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=Q(b,a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);T("substring-after",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
T("substring-before",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);T("sum",1,!1,!1,function(a,b){for(var c=Ib(b.a(a)),d=0,e=M(c);e;e=M(c))d+=+H(e);return d},1,1,!0);T("translate",3,!1,!1,function(a,b,c,d){b=Q(b,a);c=Q(c,a);var e=Q(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);T("true",2,!1,!1,function(){return!0},0);function L(a,b){this.j=a;this.c=void 0!==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 Xb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}L.prototype.a=function(a){return null===this.b||this.b==a.nodeType};L.prototype.h=function(){return this.j};
L.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=O(this.c));return a};function Yb(a){N.call(this,3);this.c=a.substring(1,a.length-1)}p(Yb,N);Yb.prototype.a=function(){return this.c};Yb.prototype.toString=function(){return"Literal: "+this.c};function zb(a,b){this.o=a.toLowerCase();this.c=b?b.toLowerCase():"http://www.w3.org/1999/xhtml"}zb.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.nodeName.toLowerCase()?!1:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};zb.prototype.h=function(){return this.o};zb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Zb(a){N.call(this,1);this.c=a}p(Zb,N);Zb.prototype.a=function(){return this.c};Zb.prototype.toString=function(){return"Number: "+this.c};function $b(a,b){N.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.B||c.c!=ac||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}p($b,N);function bc(){N.call(this,4)}p(bc,N);bc.prototype.a=function(a){var b=new J;a=a.a;9==a.nodeType?K(b,a):K(b,a.ownerDocument);return b};bc.prototype.toString=function(){return"Root Helper Expression"};function cc(){N.call(this,4)}p(cc,N);cc.prototype.a=function(a){var b=new J;K(b,a.a);return b};cc.prototype.toString=function(){return"Context Helper Expression"};
function dc(a){return"/"==a||"//"==a}$b.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof J))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=Ib(b,e.c.a),g;if(e.i||e.c!=ec)if(e.i||e.c!=fc)for(g=M(f),b=e.a(new nb(g));null!=(g=M(f));)g=e.a(new nb(g)),b=Fb(b,g);else g=M(f),b=e.a(new nb(g));else{for(g=M(f);(b=M(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new nb(g))}}return b};
$b.prototype.toString=function(){var a;a="Path Expression:"+O(this.j);if(this.c.length){var b=ta(this.c,function(a,b){return a+O(b)},"Steps:");a+=O(b)}return a};function gc(a,b){this.a=a;this.b=!!b}
function Tb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=Ib(b),f=b.s,g,k=0;g=M(e);k++){var n=a.b?f-k:k+1;g=d.a(new nb(g,n,f));if("number"==typeof g)n=n==g;else if("string"==typeof g||"boolean"==typeof g)n=!!g;else if(g instanceof J)n=0<g.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!n){n=e;g=n.h;var r=n.a;if(!r)throw Error("Next must be called at least once before remove.");var G=r.b,r=r.a;G?G.a=r:g.a=r;r?r.b=G:g.b=G;g.s--;n.a=null}}return b}
gc.prototype.toString=function(){return ta(this.a,function(a,b){return a+O(b)},"Predicates:")};function hc(a,b,c,d){N.call(this,4);this.c=a;this.w=b;this.j=c||new gc([]);this.B=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=C?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}p(hc,N);
hc.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?Q(c.A,a):null,f=1);if(this.B)if(this.i||this.c!=ic)if(a=Ib((new hc(jc,new L("node"))).a(a)),b=M(a))for(c=this.u(b,d,e,f);null!=(b=M(a));)c=Fb(c,this.u(b,d,e,f));else c=new J;else c=wb(this.w,b,d,e),c=Tb(this.j,c,f);else c=this.u(a.a,d,e,f);return c};hc.prototype.u=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Tb(this.j,a,d)};
hc.prototype.toString=function(){var a;a="Step:"+O("Operator: "+(this.B?"//":"/"));this.c.o&&(a+=O("Axis: "+this.c));a+=O(this.w);if(this.j.a.length){var b=ta(this.j.a,function(a,b){return a+O(b)},"Predicates:");a+=O(b)}return a};function kc(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}kc.prototype.toString=function(){return this.o};var lc={};function U(a,b,c,d){if(lc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new kc(a,b,c,!!d);return lc[a]=b}
U("ancestor",function(a,b){for(var c=new J,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new J,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);
var ac=U("attribute",function(a,b){var c=new J,d=a.h();if("style"==d&&b.style&&C)return K(c,new pb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof L&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)C?f.nodeValue&&K(c,qb(b,f)):K(c,f);else(f=e.getNamedItem(d))&&(C?f.nodeValue&&K(c,qb(b,f)):K(c,f));return c},!1),ic=U("child",function(a,b,c,d,e){return(C?Cb:Db).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new J)},!1,!0);U("descendant",wb,!1,!0);
var jc=U("descendant-or-self",function(a,b,c,d){var e=new J;I(b,c,d)&&a.a(b)&&K(e,b);return wb(a,b,c,d,e)},!1,!0),ec=U("following",function(a,b,c,d){var e=new J;do for(var f=b;f=f.nextSibling;)I(f,c,d)&&a.a(f)&&K(e,f),e=wb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new J,d=b;d=d.nextSibling;)a.a(d)&&K(c,d);return c},!1);U("namespace",function(){return new J},!1);
var mc=U("parent",function(a,b){var c=new J;if(9==b.nodeType)return c;if(2==b.nodeType)return K(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&K(c,d);return c},!1),fc=U("preceding",function(a,b,c,d){var e=new J,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var n=[];for(b=f[g];b=b.previousSibling;)n.unshift(b);for(var r=0,G=n.length;r<G;r++)b=n[r],I(b,c,d)&&a.a(b)&&K(e,b),e=wb(a,b,c,d,e)}return e},!0,!0);
U("preceding-sibling",function(a,b){for(var c=new J,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var nc=U("self",function(a,b){var c=new J;a.a(b)&&K(c,b);return c},!1);function oc(a){N.call(this,1);this.c=a;this.i=a.i;this.b=a.b}p(oc,N);oc.prototype.a=function(a){return-P(this.c,a)};oc.prototype.toString=function(){return"Unary Expression: -"+O(this.c)};function pc(a){N.call(this,4);this.c=a;Kb(this,ua(this.c,function(a){return a.i}));Lb(this,ua(this.c,function(a){return a.b}))}p(pc,N);pc.prototype.a=function(a){var b=new J;q(this.c,function(c){c=c.a(a);if(!(c instanceof J))throw Error("Path expression must evaluate to NodeSet.");b=Fb(b,c)});return b};pc.prototype.toString=function(){return ta(this.c,function(a,b){return a+O(b)},"Union Expression:")};function qc(a,b){this.a=a;this.b=b}function rc(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=sc(a);var d=E(a.a);if(!d)break;var e=(d=Rb[d]||null)&&d.H;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].H;)b=new Nb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Nb(c.pop(),c.pop(),b);return b}function V(a,b){if(vb(a.a))throw Error(b);}function tc(a,b){var c=E(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);}
function uc(a){a=E(a.a);if(")"!=a)throw Error("Bad token: "+a);}function vc(a){a=E(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Yb(a)}function wc(a){var b=E(a.a),c=b.indexOf(":");if(-1==c)return new zb(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 zb(b,a)}
function xc(a){var b,c=[],d;if(dc(D(a.a))){b=E(a.a);d=D(a.a);if("/"==b&&(vb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new bc;d=new bc;V(a,"Missing next location step.");b=yc(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=rc(a);V(a,'unclosed "("');tc(a,")");break;case '"':case "'":b=vc(a);break;default:if(isNaN(+b))if(!Xb(b)&&/(?![0-9])[\w]/.test(d)&&"("==D(a.a,1)){b=E(a.a);
b=Wb[b]||null;E(a.a);for(d=[];")"!=D(a.a);){V(a,"Missing function argument list.");d.push(rc(a));if(","!=D(a.a))break;E(a.a)}V(a,"Unclosed function argument list.");uc(a);b=new Ub(b,d)}else{b=null;break a}else b=new Zb(+E(a.a))}"["==D(a.a)&&(d=new gc(zc(a)),b=new Sb(b,d))}if(b)if(dc(D(a.a)))d=b;else return b;else b=yc(a,"/"),d=new cc,c.push(b)}for(;dc(D(a.a));)b=E(a.a),V(a,"Missing next location step."),b=yc(a,b),c.push(b);return new $b(d,c)}
function yc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==D(a.a))return d=new hc(nc,new L("node")),E(a.a),d;if(".."==D(a.a))return d=new hc(mc,new L("node")),E(a.a),d;var f;if("@"==D(a.a))f=ac,E(a.a),V(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=lc[c]||null;if(!f)throw Error("No axis with name: "+c);E(a.a);V(a,"Missing node name")}else f=ic;c=D(a.a);if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("==
D(a.a,1)){if(!Xb(c))throw Error("Invalid node type: "+c);c=E(a.a);if(!Xb(c))throw Error("Invalid type name: "+c);tc(a,"(");V(a,"Bad nodetype");e=D(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=vc(a);V(a,"Bad nodetype");uc(a);c=new L(c,g)}else c=wc(a);else if("*"==c)c=wc(a);else throw Error("Bad token: "+E(a.a));e=new gc(zc(a),f.a);return d||new hc(f,c,e,"//"==b)}
function zc(a){for(var b=[];"["==D(a.a);){E(a.a);V(a,"Missing predicate expression.");var c=rc(a);b.push(c);V(a,"Unclosed predicate expression.");tc(a,"]")}return b}function sc(a){if("-"==D(a.a))return E(a.a),new oc(sc(a));var b=xc(a);if("|"!=D(a.a))a=b;else{for(b=[b];"|"==E(a.a);)V(a,"Missing next union location path."),b.push(xc(a));a.a.a--;a=new pc(b)}return a};function Ac(a){switch(a.nodeType){case 1:return ja(Bc,a);case 9:return Ac(a.documentElement);case 11:case 10:case 6:case 12:return Cc;default:return a.parentNode?Ac(a.parentNode):Cc}}function Cc(){return null}function Bc(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?Bc(a.parentNode,b):null};function Dc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=sb(a);if(vb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=rc(new qc(c,b));if(!vb(c))throw Error("Bad token: "+E(c));this.evaluate=function(a,b){var c=d.a(new nb(a));return new W(c,b)}}
function W(a,b){if(0==b)if(a instanceof J)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 J))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof J?Hb(a):""+a;break;case 1:this.numberValue=a instanceof J?+Hb(a):+a;break;case 3:this.booleanValue=a instanceof J?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d=
Ib(a);c=[];for(var e=M(d);e;e=M(d))c.push(e instanceof pb?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=Gb(a);this.singleNodeValue=d instanceof pb?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]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function Ec(a){this.lookupNamespaceURI=Ac(a)}
function Fc(a){a=a||l;var b=a.document;b.evaluate||(a.XPathResult=W,b.evaluate=function(a,b,e,f){return(new Dc(a,e)).evaluate(b,f)},b.createExpression=function(a,b){return new Dc(a,b)},b.createNSResolver=function(a){return new Ec(a)})}aa("wgxpath.install",Fc);var X={};X.F=function(){var a={R:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
X.u=function(a,b,c){var d=B(a);if(!d.documentElement)return null;(x||kb)&&Fc(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):X.F;if(x&&!Ya(7))return d.evaluate.call(d,b,a,e,c,null);if(!x||9<=z){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var n=g[k],r=n.namespaceURI;if(r&&!f[r]){var G=n.lookupPrefix(r);if(!G){var A=r.match(".*/(\\w+)/?$");A?G=A[1]:G="xhtml"}f[r]=G}}var t={},F;for(F in f)t[f[F]]=F;e=function(a){return t[a]||
null}}try{return d.evaluate(b,a,e,c,null)}catch(R){if("TypeError"===R.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):X.F,d.evaluate(b,a,e,c,null);throw R;}}catch(ha){if(!y||"NS_ERROR_ILLEGAL_VALUE"!=ha.name)throw new Ea(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+ha);}};X.G=function(a,b){if(!a||1!=a.nodeType)throw new Ea(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};
X.J=function(a,b){var c=function(){var c=X.u(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||X.G(c,a);return c};
X.O=function(a,b){var c=function(){var c=X.u(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)):[]}();q(c,function(b){X.G(b,a)});return c};function Gc(a){return(a=a.exec(v))?a[1]:""}var Hc=function(){if(hb)return Gc(/Firefox\/([0-9.]+)/);if(x||Qa||Pa)return Wa;if(lb)return Gc(/Chrome\/([0-9.]+)/);if(mb&&!(Oa()||w("iPad")||w("iPod")))return Gc(/Version\/([0-9.]+)/);if(ib||jb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(v))return a[1]+"."+a[2]}else if(kb)return(a=Gc(/Android\s+([0-9.]+)/))?a:Gc(/Version\/([0-9.]+)/);return""}();var Ic,Jc;function Kc(a){return Lc?Ic(a):x?0<=ma(z,a):Ya(a)}function Mc(a){Lc?Jc(a):kb?ma(Nc,a):ma(Hc,a)}
var Lc=function(){if(!y)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;Ic=function(a){return 0<=d.compare(e,""+a)};Jc=function(a){d.compare(f,""+a)};return!0}(),Oc;if(kb){var Pc=/Android\s+([0-9\.]+)/.exec(v);Oc=Pc?Pc[1]:"0"}else Oc="0";
var Nc=Oc,Qc=x&&!(9<=z);kb&&Mc(2.3);kb&&Mc(4);mb&&Mc(6);function Rc(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}h=Rc.prototype;h.clone=function(){return new Rc(this.top,this.right,this.bottom,this.left)};h.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};h.contains=function(a){return this&&a?a instanceof Rc?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1};
h.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};h.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};h.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};
h.scale=function(a,b){var c=da(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function Y(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}h=Y.prototype;h.clone=function(){return new Y(this.left,this.top,this.width,this.height)};h.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};h.contains=function(a){return a instanceof Y?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};
h.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};h.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};h.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};
h.scale=function(a,b){var c=da(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function Sc(a,b){var c=B(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}var Tc={thin:2,medium:4,thick:6};
function Uc(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null,d;if(c in Tc)d=Tc[c];else if(/^\d+px?$/.test(c))d=parseInt(c,10);else{d=a.style.left;var e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=c;c=a.style.pixelLeft;a.style.left=d;a.runtimeStyle.left=e;d=c}return d};function Vc(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function Wc(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return Vc(a)?a:null}
function Xc(a,b){var c=oa(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=Qc?"styleFloat":"cssFloat";var d=Sc(a,c)||Yc(a,c);if(null===d)d=null;else if(0<=qa(za,c)){b:{var e=d.match(Ca);if(e){var c=Number(e[1]),f=Number(e[2]),g=Number(e[3]),e=Number(e[4]);if(0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g&&0<=e&&1>=e){c=[c,f,g,e];break b}}c=null}if(!c)b:{if(g=d.match(Da))if(c=Number(g[1]),f=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g){c=[c,f,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase();
f=ya[c.toLowerCase()];if(!f&&(f="#"==c.charAt(0)?c:"#"+c,4==f.length&&(f=f.replace(Aa,"#$1$1$2$2$3$3")),!Ba.test(f))){c=null;break b}c=[parseInt(f.substr(1,2),16),parseInt(f.substr(3,2),16),parseInt(f.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d}function Yc(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&"function"==ba(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(c=Wc(a))?Yc(c,b):null}
function Zc(a,b){function c(a){function b(a){return a==k?!0:0==Xc(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==Xc(a,"position")?!1:!0}var c=Xc(a,"position");if("fixed"==c)return G=!0,a==k?null:k;for(a=Wc(a);a&&!b(a);)a=Wc(a);return a}function d(a){var b=a;if("visible"==r)if(a==k&&n)b=n;else if(a==n)return{x:"visible",y:"visible"};b={x:Xc(b,"overflow-x"),y:Xc(b,"overflow-y")};a==k&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function e(a){if(a==k){var b=
(new gb(g)).a;a=b.scrollingElement?b.scrollingElement:Ra||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=x&&Ya("10")&&b.pageYOffset!=a.scrollTop?new ab(a.scrollLeft,a.scrollTop):new ab(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new ab(a.scrollLeft,a.scrollTop);return a}for(var f=$c(a,b),g=B(a),k=g.documentElement,n=g.body,r=Xc(k,"overflow"),G,A=c(a);A;A=c(A)){var t=d(A);if("visible"!=t.x||"visible"!=t.y){var F=ad(A);if(0==
F.width||0==F.height)return"hidden";var R=f.right<F.left,ha=f.bottom<F.top;if(R&&"hidden"==t.x||ha&&"hidden"==t.y)return"hidden";if(R&&"visible"!=t.x||ha&&"visible"!=t.y){R=e(A);ha=f.bottom<F.top-R.y;if(f.right<F.left-R.x&&"visible"!=t.x||ha&&"visible"!=t.x)return"hidden";f=Zc(A);return"hidden"==f?"hidden":"scroll"}R=f.left>=F.left+F.width;F=f.top>=F.top+F.height;if(R&&"hidden"==t.x||F&&"hidden"==t.y)return"hidden";if(R&&"visible"!=t.x||F&&"visible"!=t.y){if(G&&(t=e(A),f.left>=k.scrollWidth-t.x||
f.right>=k.scrollHeight-t.y))return"hidden";f=Zc(A);return"hidden"==f?"hidden":"scroll"}}}return"none"}
function ad(a){var b;var c=Vc(a,"MAP");if(c||Vc(a,"AREA")){var d=c?a:Vc(a.parentNode,"MAP")?a.parentNode:null,e=b=null;if(d&&d.name&&(b=X.J('/descendant::*[@usemap = "#'+d.name+'"]',B(d)))&&(e=ad(b),!c&&"default"!=a.shape.toLowerCase()))var f=bd(a),c=Math.min(Math.max(f.left,0),e.width),d=Math.min(Math.max(f.top,0),e.height),g=Math.min(f.width,e.width-c),f=Math.min(f.height,e.height-d),e=new Y(c+e.left,d+e.top,g,f);b={a:b,rect:e||new Y(0,0,0,0)}}else b=null;if(b)return b.rect;if(Vc(a,"HTML"))return a=
B(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new bb(a.clientWidth,a.clientHeight),new Y(0,0,a.width,a.height);var k;try{k=a.getBoundingClientRect()}catch(n){return new Y(0,0,0,0)}k=new Y(k.left,k.top,k.right-k.left,k.bottom-k.top);x&&a.ownerDocument.body&&(a=B(a),k.left-=a.documentElement.clientLeft+a.body.clientLeft,k.top-=a.documentElement.clientTop+a.body.clientTop);return k}
function bd(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 Y(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new Y(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 Y(b,c,d-b,e-c)}return new Y(0,0,0,0)}
function $c(a,b){var c;c=ad(a);c=new Rc(c.top,c.left+c.width,c.top+c.height,c.left);if(b){var d=b instanceof Y?b:new Y(b.x,b.y,1,1);c.left=$a(c.left+d.left,c.left,c.right);c.top=$a(c.top+d.top,c.top,c.bottom);c.right=$a(c.left+d.width,c.left,c.right);c.bottom=$a(c.top+d.height,c.top,c.bottom)}return c};Ra||Lc&&Mc(3.6);x&&Kc(10);kb&&Mc(4);function cd(a,b){this.v={};this.l=[];this.b=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)dd(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof cd)for(d=ed(a),fd(a),e=[],c=0;c<a.l.length;c++)e.push(a.v[a.l[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++)dd(this,d[c],e[c])}}function ed(a){fd(a);return a.l.concat()}
cd.prototype.clear=function(){this.v={};this.b=this.a=this.l.length=0};function fd(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.v,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}cd.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.v,a)?this.v[a]:b};
function dd(a,b,c){Object.prototype.hasOwnProperty.call(a.v,b)||(a.a++,a.l.push(b),a.b++);a.v[b]=c}cd.prototype.forEach=function(a,b){for(var c=ed(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};cd.prototype.clone=function(){return new cd(this)};var gd={};function Z(a,b,c){ea(a)&&(a=y?a.f:a.g);a=new hd(a);!b||b in gd&&!c||(gd[b]={key:a,shift:!1},c&&(gd[c]={key:a,shift:!0}));return a}function hd(a){this.code=a}Z(8);Z(9);Z(13);var id=Z(16),jd=Z(17),kd=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D");
Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var ld=Z(Ta?{f:91,g:91}:Sa?{f:224,g:91}:{f:0,g:91});Z(Ta?{f:92,g:92}:Sa?{f:224,g:93}:{f:0,g:92});Z(Ta?{f:93,g:93}:Sa?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1");
Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{");
Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var md=new cd;dd(md,1,id);dd(md,2,jd);dd(md,4,kd);dd(md,8,ld);(function(a){var b=new cd;q(ed(a),function(c){dd(b,a.get(c).code,c)});return b})(md);y&&Kc(12);function nd(a,b){a:if("scroll"==Zc(a,b)){if(a.scrollIntoView&&(a.scrollIntoView(),"none"==Zc(a,b)))break a;for(var c=$c(a,b),d=Wc(a);d;d=Wc(d)){var e=d,f=ad(e),g;var k=e;if(!x||9<=z)n=Sc(k,"borderLeftWidth"),g=Sc(k,"borderRightWidth"),r=Sc(k,"borderTopWidth"),k=Sc(k,"borderBottomWidth"),g=new Rc(parseFloat(r),parseFloat(g),parseFloat(k),parseFloat(n));else{var n=Uc(k,"borderLeft");g=Uc(k,"borderRight");var r=Uc(k,"borderTop"),k=Uc(k,"borderBottom");g=new Rc(r,g,k,n)}n=c.left-f.left-g.left;f=c.top-
f.top-g.top;g=e.clientHeight+c.top-c.bottom;e.scrollLeft+=Math.min(n,Math.max(n-(e.clientWidth+c.left-c.right),0));e.scrollTop+=Math.min(f,Math.max(f-g,0))}Zc(a,b)}c=$c(a,b);return new ab(c.left,c.top)};function od(){}
function pd(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),pd(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),qd(d,c),c.push(":"),pd(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":qd(b,c);break;case "number":c.push(isFinite(b)&&
!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var rd={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},sd=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
function qd(a,b){b.push('"',a.replace(sd,function(a){var b=rd[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),rd[a]=b);return b}),'"')};Ra||y&&Kc(3.5)||x&&Kc(8);function td(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return sa(a,td);case "object":if(Ka(a,"nodeType")&&(1==a.nodeType||