UNPKG

slimerjs-firefox

Version:

This repo includes slimerjs as well as downloads a local copy of Firefox.

93 lines 66.3 kB
function(){return function(){function h(a){return function(){return this[a]}}function ba(a){return function(){return a}}var l,n=this; function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function p(a){return void 0!==a}function da(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length}function t(a){return"string"==typeof a}function ea(a){return"number"==typeof a}function fa(a){return"function"==ca(a)}function ga(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ha(a,b,c){return a.call.apply(a.bind,arguments)} function ia(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 ja(a,b,c){ja=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ha:ia;return ja.apply(null,arguments)} function ka(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=Array.prototype.slice.call(arguments);b.unshift.apply(b,c);return a.apply(this,b)}}var la=Date.now||function(){return+new Date};function u(a,b){function c(){}c.prototype=b.prototype;a.Ta=b.prototype;a.prototype=new c};var ma=window;function na(a,b){for(var c=0,d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=String(b).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var k=d[g]||"",m=e[g]||"",r=RegExp("(\\d*)(\\D*)","g"),y=RegExp("(\\d*)(\\D*)","g");do{var s=r.exec(k)||["","",""],q=y.exec(m)||["","",""];if(0==s[0].length&&0==q[0].length)break;c=((0==s[1].length?0:parseInt(s[1],10))<(0==q[1].length?0:parseInt(q[1],10))?-1:(0==s[1].length?0:parseInt(s[1],10))>(0==q[1].length? 0:parseInt(q[1],10))?1:0)||((0==s[2].length)<(0==q[2].length)?-1:(0==s[2].length)>(0==q[2].length)?1:0)||(s[2]<q[2]?-1:s[2]>q[2]?1:0)}while(0==c)}return c}function oa(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};var pa=Array.prototype;function v(a,b){for(var c=a.length,d=t(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function qa(a,b){for(var c=a.length,d=[],e=0,f=t(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 ra(a,b){for(var c=a.length,d=Array(c),e=t(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 sa(a,b,c){if(a.reduce)return a.reduce(b,c);var d=c;v(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ta(a,b){for(var c=a.length,d=t(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 ua(a,b){for(var c=a.length,d=t(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 va(a,b){var c;a:{c=a.length;for(var d=t(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:t(a)?a.charAt(c):a[c]}function wa(a,b){var c;a:if(t(a))c=t(b)&&1==b.length?a.indexOf(b,0):-1;else{for(c=0;c<a.length;c++)if(c in a&&a[c]===b)break a;c=-1}return 0<=c}function xa(a){return pa.concat.apply(pa,arguments)}function ya(a,b,c){return 2>=arguments.length?pa.slice.call(a,b):pa.slice.call(a,b,c)};var za={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 Aa="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Ba=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Ca=/^#(?:[0-9a-f]{3}){1,2}$/i,Da=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Ea=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function w(a,b){this.code=a;this.state=Fa[a]||Ga;this.message=b||"";var c=this.state.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||""}u(w,Error); var Ga="unknown error",Fa={15:"element not selectable",11:"element not visible",31:"ime engine activation failed",30:"ime not available",24:"invalid cookie domain",29:"invalid element coordinates",12:"invalid element state",32:"invalid selector",51:"invalid selector",52:"invalid selector",17:"javascript error",405:"unsupported operation",34:"move target out of bounds",27:"no such alert",7:"no such element",8:"no such frame",23:"no such window",28:"script timeout",33:"session not created",10:"stale element reference", 0:"success",21:"timeout",25:"unable to set cookie",26:"unexpected alert open"};Fa[13]=Ga;Fa[9]="unknown command";w.prototype.toString=function(){return this.name+": "+this.message};var Ha,Ia,Ja,Ka,La,Ma;function Na(){return n.navigator?n.navigator.userAgent:null}Ka=Ja=Ia=Ha=!1;var Oa;if(Oa=Na()){var Pa=n.navigator;Ha=0==Oa.indexOf("Opera");Ia=!Ha&&-1!=Oa.indexOf("MSIE");Ja=!Ha&&-1!=Oa.indexOf("WebKit");Ka=!Ha&&!Ja&&"Gecko"==Pa.product}var x=Ha,A=Ia,B=Ka,Qa=Ja,Ra,Sa=n.navigator;Ra=Sa&&Sa.platform||"";La=-1!=Ra.indexOf("Mac");Ma=-1!=Ra.indexOf("Win");var Ta=-1!=Ra.indexOf("Linux");function Ua(){var a=n.document;return a?a.documentMode:void 0}var Va; a:{var Za="",$a;if(x&&n.opera)var ab=n.opera.version,Za="function"==typeof ab?ab():ab;else if(B?$a=/rv\:([^\);]+)(\)|;)/:A?$a=/MSIE\s+([^\);]+)(\)|;)/:Qa&&($a=/WebKit\/(\S+)/),$a)var bb=$a.exec(Na()),Za=bb?bb[1]:"";if(A){var cb=Ua();if(cb>parseFloat(Za)){Va=String(cb);break a}}Va=Za}var db={};function eb(a){return db[a]||(db[a]=0<=na(Va,a))}function C(a){return A&&fb>=a}var gb=n.document,fb=gb&&A?Ua()||("CSS1Compat"==gb.compatMode?parseInt(Va,10):5):void 0;var hb;!B&&!A||A&&C(9)||B&&eb("1.9.1");A&&eb("9");function ib(a,b){this.x=p(a)?a:0;this.y=p(b)?b:0}l=ib.prototype;l.toString=function(){return"("+this.x+", "+this.y+")"};l.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};l.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};l.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};l.scale=function(a,b){var c=ea(b)?b:a;this.x*=a;this.y*=c;return this};function jb(a,b){this.width=a;this.height=b}l=jb.prototype;l.toString=function(){return"("+this.width+" x "+this.height+")"};l.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};l.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};l.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};l.scale=function(a,b){var c=ea(b)?b:a;this.width*=a;this.height*=c;return this};function kb(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function lb(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function mb(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};var nb=3;function ob(a){a=a.document;a=pb(a)?a.documentElement:a.body;return new jb(a.clientWidth,a.clientHeight)}function D(a){return a?a.parentWindow||a.defaultView:window}function pb(a){return"CSS1Compat"==a.compatMode}function qb(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a} function rb(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 sb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(A&&!C(9)){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?tb(a,b):!c&&rb(e,b)?-1*ub(a,b):!d&&rb(f,a)?ub(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=E(a);c=d.createRange(); c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(n.Range.START_TO_END,d)}function ub(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return tb(d,a)}function tb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function E(a){return 9==a.nodeType?a:a.ownerDocument||a.document}var vb={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},wb={IMG:" ",BR:"\n"}; function xb(a,b,c){if(!(a.nodeName in vb))if(a.nodeType==nb)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in wb)b.push(wb[a.nodeName]);else for(a=a.firstChild;a;)xb(a,b,c),a=a.nextSibling}function yb(a,b,c){c||(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function zb(a){this.F=a||n.document||document}zb.prototype.I=function(a){return t(a)?this.F.getElementById(a):a}; function Ab(a){return!Qa&&pb(a.F)?a.F.documentElement:a.F.body||a.F.documentElement}zb.prototype.contains=rb;var Bb,Cb,Db,Eb,Fb,Gb,Hb;Hb=Gb=Fb=Eb=Db=Cb=Bb=!1;var Ib=Na();Ib&&(-1!=Ib.indexOf("Firefox")?Bb=!0:-1!=Ib.indexOf("Camino")?Cb=!0:-1!=Ib.indexOf("iPhone")||-1!=Ib.indexOf("iPod")?Db=!0:-1!=Ib.indexOf("iPad")?Eb=!0:-1!=Ib.indexOf("Android")?Fb=!0:-1!=Ib.indexOf("Chrome")?Gb=!0:-1!=Ib.indexOf("Safari")&&(Hb=!0));var Jb=Bb,Kb=Cb,Lb=Db,Mb=Eb,Nb=Fb,Ob=Gb,Pb=Hb;function Qb(a,b,c){this.g=a;this.Ia=b||1;this.r=c||1};var Rb=A&&!C(9),Sb=A&&!C(8);function Tb(a,b,c,d,e){this.g=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.ownerElement=b;this.Ra=e;this.parentNode=b}function Ub(a,b,c){var d=Sb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Tb(b,a,b.nodeName,d,c)};function Vb(a){this.ja=a;this.W=0}function Wb(a){a=a.match(Xb);for(var b=0;b<a.length;b++)Yb.test(a[b])&&a.splice(b,1);return new Vb(a)}var Xb=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Yb=/^\s/;function F(a,b){return a.ja[a.W+(b||0)]}Vb.prototype.next=function(){return this.ja[this.W++]};Vb.prototype.back=function(){this.W--};Vb.prototype.empty=function(){return this.ja.length<=this.W};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(Rb&&"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),Rb&&"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 Zb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Sb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function $b(a,b,c,d,e){return(Rb?ac:bc).call(null,a,b,t(c)?c:null,t(d)?d:null,e||new H)} function ac(a,b,c,d,e){if(a instanceof cc||8==a.e||c&&null===a.e){var f=b.all;if(!f)return e;a=dc(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)Zb(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||e.add(b);return e}ec(a,b,c,d,e);return e} function bc(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!A?(b=b.getElementsByName(d),v(b,function(b){a.matches(b)&&e.add(b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),v(b,function(b){b.className==d&&a.matches(b)&&e.add(b)})):a instanceof I?ec(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.getName()),v(b,function(a){Zb(a,c,d)&&e.add(a)}));return e} function fc(a,b,c,d,e){var f;if((a instanceof cc||8==a.e||c&&null===a.e)&&(f=b.childNodes)){var g=dc(a);if("*"!=g&&(f=qa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=qa(f,function(a){return Zb(a,c,d)}));v(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||e.add(a)});return e}return gc(a,b,c,d,e)}function gc(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Zb(b,c,d)&&a.matches(b)&&e.add(b);return e} function ec(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Zb(b,c,d)&&a.matches(b)&&e.add(b),ec(a,b,c,d,e)}function dc(a){if(a instanceof I){if(8==a.e)return"!";if(null===a.e)return"*"}return a.getName()};function H(){this.r=this.k=null;this.P=0}function hc(a){this.u=a;this.next=this.G=null}function ic(a,b){if(!a.k)return b;if(!b.k)return a;for(var c=a.k,d=b.k,e=null,f=null,g=0;c&&d;)c.u==d.u||c.u instanceof Tb&&d.u instanceof Tb&&c.u.g==d.u.g?(f=c,c=c.next,d=d.next):0<sb(c.u,d.u)?(f=d,d=d.next):(f=c,c=c.next),(f.G=e)?e.next=f:a.k=f,e=f,g++;for(f=c||d;f;)f.G=e,e=e.next=f,g++,f=f.next;a.r=e;a.P=g;return a} H.prototype.unshift=function(a){a=new hc(a);a.next=this.k;this.r?this.k.G=a:this.k=this.r=a;this.k=a;this.P++};H.prototype.add=function(a){a=new hc(a);a.G=this.r;this.k?this.r.next=a:this.k=this.r=a;this.r=a;this.P++};function jc(a){return(a=a.k)?a.u:null}H.prototype.t=h("P");function kc(a){return(a=jc(a))?G(a):""}function lc(a,b){return new mc(a,!!b)}function mc(a,b){this.Ea=a;this.ka=(this.J=b)?a.r:a.k;this.ea=null} mc.prototype.next=function(){var a=this.ka;if(null==a)return null;var b=this.ea=a;this.ka=this.J?a.G:a.next;return b.u};mc.prototype.remove=function(){var a=this.Ea,b=this.ea;if(!b)throw Error("Next must be called at least once before remove.");var c=b.G,b=b.next;c?c.next=b:a.k=b;b?b.G=c:a.r=c;a.P--;this.ea=null};function K(a){this.j=a;this.m=this.w=!1;this.Q=null}function L(a){return"\n "+a.toString().split("\n").join("\n ")}K.prototype.h=h("w");function nc(a,b){a.w=b}function oc(a,b){a.m=b}K.prototype.B=h("Q");function M(a,b){var c=a.evaluate(b);return c instanceof H?+kc(c):+c}function N(a,b){var c=a.evaluate(b);return c instanceof H?kc(c):""+c}function pc(a,b){var c=a.evaluate(b);return c instanceof H?!!c.t():!!c};function qc(a,b,c){K.call(this,a.j);this.ia=a;this.oa=b;this.ta=c;this.w=b.h()||c.h();this.m=b.m||c.m;this.ia==rc&&(c.m||c.h()||4==c.j||0==c.j||!b.B()?b.m||(b.h()||4==b.j||0==b.j||!c.B())||(this.Q={name:c.B().name,K:b}):this.Q={name:b.B().name,K:c})}u(qc,K); function sc(a,b,c,d,e){b=b.evaluate(d);c=c.evaluate(d);var f;if(b instanceof H&&c instanceof H){e=lc(b);for(d=e.next();d;d=e.next())for(b=lc(c),f=b.next();f;f=b.next())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=lc(e);b=typeof c;for(d=e.next();d;d=e.next()){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)}qc.prototype.evaluate=function(a){return this.ia.s(this.oa,this.ta,a)};qc.prototype.toString=function(){var a="Binary Expression: "+this.ia,a=a+L(this.oa);return a+=L(this.ta)};function tc(a,b,c,d){this.Ha=a;this.ra=b;this.j=c;this.s=d}tc.prototype.toString=h("Ha");var uc={}; function O(a,b,c,d){if(uc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new tc(a,b,c,d);return uc[a.toString()]=a}O("div",6,1,function(a,b,c){return M(a,c)/M(b,c)});O("mod",6,1,function(a,b,c){return M(a,c)%M(b,c)});O("*",6,1,function(a,b,c){return M(a,c)*M(b,c)});O("+",5,1,function(a,b,c){return M(a,c)+M(b,c)});O("-",5,1,function(a,b,c){return M(a,c)-M(b,c)});O("<",4,2,function(a,b,c){return sc(function(a,b){return a<b},a,b,c)}); O(">",4,2,function(a,b,c){return sc(function(a,b){return a>b},a,b,c)});O("<=",4,2,function(a,b,c){return sc(function(a,b){return a<=b},a,b,c)});O(">=",4,2,function(a,b,c){return sc(function(a,b){return a>=b},a,b,c)});var rc=O("=",3,2,function(a,b,c){return sc(function(a,b){return a==b},a,b,c,!0)});O("!=",3,2,function(a,b,c){return sc(function(a,b){return a!=b},a,b,c,!0)});O("and",2,2,function(a,b,c){return pc(a,c)&&pc(b,c)});O("or",1,2,function(a,b,c){return pc(a,c)||pc(b,c)});function vc(a,b){if(b.t()&&4!=a.j)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");K.call(this,a.j);this.sa=a;this.f=b;this.w=a.h();this.m=a.m}u(vc,K);vc.prototype.evaluate=function(a){a=this.sa.evaluate(a);return wc(this.f,a)};vc.prototype.toString=function(){var a;a="Filter:"+L(this.sa);return a+=L(this.f)};function xc(a,b){if(b.length<a.qa)throw Error("Function "+a.p+" expects at least"+a.qa+" arguments, "+b.length+" given");if(null!==a.fa&&b.length>a.fa)throw Error("Function "+a.p+" expects at most "+a.fa+" arguments, "+b.length+" given");a.Fa&&v(b,function(b,d){if(4!=b.j)throw Error("Argument "+d+" to function "+a.p+" is not of type Nodeset: "+b);});K.call(this,a.j);this.V=a;this.$=b;nc(this,a.w||ta(b,function(a){return a.h()}));oc(this,a.Da&&!b.length||a.Ca&&!!b.length||ta(b,function(a){return a.m}))} u(xc,K);xc.prototype.evaluate=function(a){return this.V.s.apply(null,xa(a,this.$))};xc.prototype.toString=function(){var a="Function: "+this.V;if(this.$.length)var b=sa(this.$,function(a,b){return a+L(b)},"Arguments:"),a=a+L(b);return a};function yc(a,b,c,d,e,f,g,k,m){this.p=a;this.j=b;this.w=c;this.Da=d;this.Ca=e;this.s=f;this.qa=g;this.fa=p(k)?k:g;this.Fa=!!m}yc.prototype.toString=h("p");var zc={}; function P(a,b,c,d,e,f,g,k){if(zc.hasOwnProperty(a))throw Error("Function already created: "+a+".");zc[a]=new yc(a,b,c,d,!1,e,f,g,k)}P("boolean",2,!1,!1,function(a,b){return pc(b,a)},1);P("ceiling",1,!1,!1,function(a,b){return Math.ceil(M(b,a))},1);P("concat",3,!1,!1,function(a,b){var c=ya(arguments,1);return sa(c,function(b,c){return b+N(c,a)},"")},2,null);P("contains",2,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);return-1!=b.indexOf(a)},2); P("count",1,!1,!1,function(a,b){return b.evaluate(a).t()},1,1,!0);P("false",2,!1,!1,ba(!1),0);P("floor",1,!1,!1,function(a,b){return Math.floor(M(b,a))},1); P("id",4,!1,!1,function(a,b){function c(a){if(Rb){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.g,e=9==d.nodeType?d:d.ownerDocument,d=N(b,a).split(/\s+/),f=[];v(d,function(a){(a=c(a))&&!wa(f,a)&&f.push(a)});f.sort(sb);var g=new H;v(f,function(a){g.add(a)});return g},1);P("lang",2,!1,!1,ba(!1),1); P("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.r},0);P("local-name",3,!1,!0,function(a,b){var c=b?jc(b.evaluate(a)):a.g;return c?c.nodeName.toLowerCase():""},0,1,!0);P("name",3,!1,!0,function(a,b){var c=b?jc(b.evaluate(a)):a.g;return c?c.nodeName.toLowerCase():""},0,1,!0);P("namespace-uri",3,!0,!1,ba(""),0,1,!0);P("normalize-space",3,!1,!0,function(a,b){return(b?N(b,a):G(a.g)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1); P("not",2,!1,!1,function(a,b){return!pc(b,a)},1);P("number",1,!1,!0,function(a,b){return b?M(b,a):+G(a.g)},0,1);P("position",1,!0,!1,function(a){return a.Ia},0);P("round",1,!1,!1,function(a,b){return Math.round(M(b,a))},1);P("starts-with",2,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);return 0==b.lastIndexOf(a,0)},2);P("string",3,!1,!0,function(a,b){return b?N(b,a):G(a.g)},0,1);P("string-length",1,!1,!0,function(a,b){return(b?N(b,a):G(a.g)).length},0,1); P("substring",3,!1,!1,function(a,b,c,d){c=M(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?M(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=N(b,a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);P("substring-after",3,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); P("substring-before",3,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);P("sum",1,!1,!1,function(a,b){for(var c=lc(b.evaluate(a)),d=0,e=c.next();e;e=c.next())d+=+G(e);return d},1,1,!0);P("translate",3,!1,!1,function(a,b,c,d){b=N(b,a);c=N(c,a);var e=N(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);P("true",2,!1,!1,ba(!0),0);function I(a,b){this.va=a;this.pa=p(b)?b:null;this.e=null;switch(a){case "comment":this.e=8;break;case "text":this.e=nb;break;case "processing-instruction":this.e=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Ac(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}I.prototype.matches=function(a){return null===this.e||this.e==a.nodeType};I.prototype.getName=h("va"); I.prototype.toString=function(){var a="Kind Test: "+this.va;null===this.pa||(a+=L(this.pa));return a};function Bc(a){K.call(this,3);this.ua=a.substring(1,a.length-1)}u(Bc,K);Bc.prototype.evaluate=h("ua");Bc.prototype.toString=function(){return"Literal: "+this.ua};function cc(a,b){this.p=a.toLowerCase();this.ga=b?b.toLowerCase():"http://www.w3.org/1999/xhtml"}cc.prototype.matches=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.p&&this.p!=a.nodeName.toLowerCase()?!1:this.ga==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};cc.prototype.getName=h("p");cc.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.ga?"":this.ga+":")+this.p};function Cc(a){K.call(this,1);this.wa=a}u(Cc,K);Cc.prototype.evaluate=h("wa");Cc.prototype.toString=function(){return"Number: "+this.wa};function Dc(a,b){K.call(this,a.j);this.ma=a;this.R=b;this.w=a.h();this.m=a.m;if(1==this.R.length){var c=this.R[0];c.ba||c.A!=Ec||(c=c.Z,"*"!=c.getName()&&(this.Q={name:c.getName(),K:null}))}}u(Dc,K);function Fc(){K.call(this,4)}u(Fc,K);Fc.prototype.evaluate=function(a){var b=new H;a=a.g;9==a.nodeType?b.add(a):b.add(a.ownerDocument);return b};Fc.prototype.toString=ba("Root Helper Expression");function Gc(){K.call(this,4)}u(Gc,K);Gc.prototype.evaluate=function(a){var b=new H;b.add(a.g);return b}; Gc.prototype.toString=ba("Context Helper Expression"); Dc.prototype.evaluate=function(a){var b=this.ma.evaluate(a);if(!(b instanceof H))throw Error("Filter expression must evaluate to nodeset.");a=this.R;for(var c=0,d=a.length;c<d&&b.t();c++){var e=a[c],f=lc(b,e.A.J),g;if(e.h()||e.A!=Hc)if(e.h()||e.A!=Ic)for(g=f.next(),b=e.evaluate(new Qb(g));null!=(g=f.next());)g=e.evaluate(new Qb(g)),b=ic(b,g);else g=f.next(),b=e.evaluate(new Qb(g));else{for(g=f.next();(b=f.next())&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.evaluate(new Qb(g))}}return b}; Dc.prototype.toString=function(){var a;a="Path Expression:"+L(this.ma);if(this.R.length){var b=sa(this.R,function(a,b){return a+L(b)},"Steps:");a+=L(b)}return a};function Jc(a,b){this.f=a;this.J=!!b}function wc(a,b,c){for(c=c||0;c<a.f.length;c++)for(var d=a.f[c],e=lc(b),f=b.t(),g,k=0;g=e.next();k++){var m=a.J?f-k:k+1;g=d.evaluate(new Qb(g,m,f));if("number"==typeof g)m=m==g;else if("string"==typeof g||"boolean"==typeof g)m=!!g;else if(g instanceof H)m=0<g.t();else throw Error("Predicate.evaluate returned an unexpected type.");m||e.remove()}return b}Jc.prototype.B=function(){return 0<this.f.length?this.f[0].B():null}; Jc.prototype.h=function(){for(var a=0;a<this.f.length;a++){var b=this.f[a];if(b.h()||1==b.j||0==b.j)return!0}return!1};Jc.prototype.t=function(){return this.f.length};Jc.prototype.toString=function(){return sa(this.f,function(a,b){return a+L(b)},"Predicates:")};function Kc(a,b,c,d){K.call(this,4);this.A=a;this.Z=b;this.f=c||new Jc([]);this.ba=!!d;b=this.f.B();a.Ma&&b&&(a=b.name,a=Rb?a.toLowerCase():a,this.Q={name:a,K:b.K});this.w=this.f.h()}u(Kc,K); Kc.prototype.evaluate=function(a){var b=a.g,c=null,c=this.B(),d=null,e=null,f=0;c&&(d=c.name,e=c.K?N(c.K,a):null,f=1);if(this.ba)if(this.h()||this.A!=Lc)if(a=lc((new Kc(Mc,new I("node"))).evaluate(a)),b=a.next())for(c=this.s(b,d,e,f);null!=(b=a.next());)c=ic(c,this.s(b,d,e,f));else c=new H;else c=$b(this.Z,b,d,e),c=wc(this.f,c,f);else c=this.s(a.g,d,e,f);return c};Kc.prototype.s=function(a,b,c,d){a=this.A.V(this.Z,a,b,c);return a=wc(this.f,a,d)}; Kc.prototype.toString=function(){var a;a="Step:"+L("Operator: "+(this.ba?"//":"/"));this.A.p&&(a+=L("Axis: "+this.A));a+=L(this.Z);if(this.f.t()){var b=sa(this.f.f,function(a,b){return a+L(b)},"Predicates:");a+=L(b)}return a};function Nc(a,b,c,d){this.p=a;this.V=b;this.J=c;this.Ma=d}Nc.prototype.toString=h("p");var Oc={};function Q(a,b,c,d){if(Oc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Nc(a,b,c,!!d);return Oc[a]=b} Q("ancestor",function(a,b){for(var c=new H,d=b;d=d.parentNode;)a.matches(d)&&c.unshift(d);return c},!0);Q("ancestor-or-self",function(a,b){var c=new H,d=b;do a.matches(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); var Ec=Q("attribute",function(a,b){var c=new H,d=a.getName();if("style"==d&&b.style&&Rb)return c.add(new Tb(b.style,b,"style",b.style.cssText,b.sourceIndex)),c;var e=b.attributes;if(e)if(a instanceof I&&null===a.e||"*"==d)for(var d=b.sourceIndex,f=0,g;g=e[f];f++)Rb?g.nodeValue&&c.add(Ub(b,g,d)):c.add(g);else(g=e.getNamedItem(d))&&(Rb?g.nodeValue&&c.add(Ub(b,g,b.sourceIndex)):c.add(g));return c},!1),Lc=Q("child",function(a,b,c,d,e){return(Rb?fc:gc).call(null,a,b,t(c)?c:null,t(d)?d:null,e||new H)}, !1,!0);Q("descendant",$b,!1,!0);var Mc=Q("descendant-or-self",function(a,b,c,d){var e=new H;Zb(b,c,d)&&a.matches(b)&&e.add(b);return $b(a,b,c,d,e)},!1,!0),Hc=Q("following",function(a,b,c,d){var e=new H;do for(var f=b;f=f.nextSibling;)Zb(f,c,d)&&a.matches(f)&&e.add(f),e=$b(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);Q("following-sibling",function(a,b){for(var c=new H,d=b;d=d.nextSibling;)a.matches(d)&&c.add(d);return c},!1);Q("namespace",function(){return new H},!1); var Pc=Q("parent",function(a,b){var c=new H;if(9==b.nodeType)return c;if(2==b.nodeType)return c.add(b.ownerElement),c;var d=b.parentNode;a.matches(d)&&c.add(d);return c},!1),Ic=Q("preceding",function(a,b,c,d){var e=new H,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var m=[];for(b=f[g];b=b.previousSibling;)m.unshift(b);for(var r=0,y=m.length;r<y;r++)b=m[r],Zb(b,c,d)&&a.matches(b)&&e.add(b),e=$b(a,b,c,d,e)}return e},!0,!0); Q("preceding-sibling",function(a,b){for(var c=new H,d=b;d=d.previousSibling;)a.matches(d)&&c.unshift(d);return c},!0);var Qc=Q("self",function(a,b){var c=new H;a.matches(b)&&c.add(b);return c},!1);function Rc(a){K.call(this,1);this.la=a;this.w=a.h();this.m=a.m}u(Rc,K);Rc.prototype.evaluate=function(a){return-M(this.la,a)};Rc.prototype.toString=function(){return"Unary Expression: -"+L(this.la)};function Sc(a){K.call(this,4);this.X=a;nc(this,ta(this.X,function(a){return a.h()}));oc(this,ta(this.X,function(a){return a.m}))}u(Sc,K);Sc.prototype.evaluate=function(a){var b=new H;v(this.X,function(c){c=c.evaluate(a);if(!(c instanceof H))throw Error("Path expression must evaluate to NodeSet.");b=ic(b,c)});return b};Sc.prototype.toString=function(){return sa(this.X,function(a,b){return a+L(b)},"Union Expression:")};function Tc(a,b){this.a=a;this.Ga=b}function Uc(a){for(var b,c=[];;){R(a,"Missing right hand side of binary expression.");b=Vc(a);var d=a.a.next();if(!d)break;var e=(d=uc[d]||null)&&d.ra;if(!e){a.a.back();break}for(;c.length&&e<=c[c.length-1].ra;)b=new qc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new qc(c.pop(),c.pop(),b);return b}function R(a,b){if(a.a.empty())throw Error(b);}function Wc(a,b){var c=a.a.next();if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} function Xc(a){a=a.a.next();if(")"!=a)throw Error("Bad token: "+a);}function Yc(a){a=a.a.next();if(2>a.length)throw Error("Unclosed literal string");return new Bc(a)}function Zc(a){var b=a.a.next(),c=b.indexOf(":");if(-1==c)return new cc(b);var d=b.substring(0,c);a=a.Ga(d);if(!a)throw Error("Namespace prefix not declared: "+d);b=b.substr(c+1);return new cc(b,a)} function $c(a){var b,c=[],d;if("/"==F(a.a)||"//"==F(a.a)){b=a.a.next();d=F(a.a);if("/"==b&&(a.a.empty()||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Fc;d=new Fc;R(a,"Missing next location step.");b=ad(a,b);c.push(b)}else{a:{b=F(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":a.a.next();b=Uc(a);R(a,'unclosed "("');Wc(a,")");break;case '"':case "'":b=Yc(a);break;default:if(isNaN(+b))if(!Ac(b)&&/(?![0-9])[\w]/.test(d)&& "("==F(a.a,1)){b=a.a.next();b=zc[b]||null;a.a.next();for(d=[];")"!=F(a.a);){R(a,"Missing function argument list.");d.push(Uc(a));if(","!=F(a.a))break;a.a.next()}R(a,"Unclosed function argument list.");Xc(a);b=new xc(b,d)}else{b=null;break a}else b=new Cc(+a.a.next())}"["==F(a.a)&&(d=new Jc(bd(a)),b=new vc(b,d))}if(b)if("/"==F(a.a)||"//"==F(a.a))d=b;else return b;else b=ad(a,"/"),d=new Gc,c.push(b)}for(;"/"==F(a.a)||"//"==F(a.a);)b=a.a.next(),R(a,"Missing next location step."),b=ad(a,b),c.push(b); return new Dc(d,c)} function ad(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==F(a.a))return d=new Kc(Qc,new I("node")),a.a.next(),d;if(".."==F(a.a))return d=new Kc(Pc,new I("node")),a.a.next(),d;var f;if("@"==F(a.a))f=Ec,a.a.next(),R(a,"Missing attribute name");else if("::"==F(a.a,1)){if(!/(?![0-9])[\w]/.test(F(a.a).charAt(0)))throw Error("Bad token: "+a.a.next());c=a.a.next();f=Oc[c]||null;if(!f)throw Error("No axis with name: "+c);a.a.next();R(a,"Missing node name")}else f=Lc; c=F(a.a);if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("==F(a.a,1)){if(!Ac(c))throw Error("Invalid node type: "+c);c=a.a.next();if(!Ac(c))throw Error("Invalid type name: "+c);Wc(a,"(");R(a,"Bad nodetype");e=F(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Yc(a);R(a,"Bad nodetype");Xc(a);c=new I(c,g)}else c=Zc(a);else if("*"==c)c=Zc(a);else throw Error("Bad token: "+a.a.next());e=new Jc(bd(a),f.J);return d||new Kc(f,c,e,"//"==b)} function bd(a){for(var b=[];"["==F(a.a);){a.a.next();R(a,"Missing predicate expression.");var c=Uc(a);b.push(c);R(a,"Unclosed predicate expression.");Wc(a,"]")}return b}function Vc(a){if("-"==F(a.a))return a.a.next(),new Rc(Vc(a));var b=$c(a);if("|"!=F(a.a))a=b;else{for(b=[b];"|"==a.a.next();)R(a,"Missing next union location path."),b.push($c(a));a.a.back();a=new Sc(b)}return a};function cd(a){switch(a.nodeType){case 1:return ka(dd,a);case 9:return cd(a.documentElement);case 2:return a.ownerElement?cd(a.ownerElement):ed;case 11:case 10:case 6:case 12:return ed;default:return a.parentNode?cd(a.parentNode):ed}}function ed(){return null}function dd(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?dd(a.parentNode,b):null};function fd(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Wb(a);if(c.empty())throw Error("Invalid XPath expression.");b?fa(b)||(b=ja(b.lookupNamespaceURI,b)):b=ba(null);var d=Uc(new Tc(c,b));if(!c.empty())throw Error("Bad token: "+c.next());this.evaluate=function(a,b){var c=d.evaluate(new Qb(a));return new S(c,b)}} function S(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?kc(a):""+a;break;case 1:this.numberValue=a instanceof H?+kc(a):+a;break;case 3:this.booleanValue=a instanceof H?0<a.t():!!a;break;case 4:case 5:case 6:case 7:var d= lc(a);c=[];for(var e=d.next();e;e=d.next())c.push(e instanceof Tb?e.g:e);this.snapshotLength=a.t();this.invalidIteratorState=!1;break;case 8:case 9:d=jc(a);this.singleNodeValue=d instanceof Tb?d.g: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]}}S.ANY_TYPE=0;S.NUMBER_TYPE=1;S.STRING_TYPE=2;S.BOOLEAN_TYPE=3;S.UNORDERED_NODE_ITERATOR_TYPE=4;S.ORDERED_NODE_ITERATOR_TYPE=5;S.UNORDERED_NODE_SNAPSHOT_TYPE=6;S.ORDERED_NODE_SNAPSHOT_TYPE=7;S.ANY_UNORDERED_NODE_TYPE=8;S.FIRST_ORDERED_NODE_TYPE=9;function gd(a){this.lookupNamespaceURI=cd(a)} function hd(a){a=a||n;var b=a.document;b.evaluate||(a.XPathResult=S,b.evaluate=function(a,b,e,f){return(new fd(a,e)).evaluate(b,f)},b.createExpression=function(a,b){return new fd(a,b)},b.createNSResolver=function(a){return new gd(a)})};var T={};T.ya=function(){var a={Ua:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();T.s=function(a,b,c){var d=E(a);(A||Nb)&&hd(D(d));try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):T.ya;return A&&!eb(7)?d.evaluate.call(d,b,a,e,c,null):d.evaluate(b,a,e,c,null)}catch(f){if(!B||"NS_ERROR_ILLEGAL_VALUE"!=f.name)throw new w(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+f);}}; T.aa=function(a,b){if(!a||1!=a.nodeType)throw new w(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};T.La=function(a,b){var c=function(){var c=T.s(b,a,9);return c?(c=c.singleNodeValue,x?c:c||null):b.selectSingleNode?(c=E(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||T.aa(c,a);return c}; T.Qa=function(a,b){var c=function(){var c=T.s(b,a,7);if(c){var e=c.snapshotLength;x&&!p(e)&&T.aa(null,a);for(var f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=E(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();v(c,function(b){T.aa(b,a)});return c};function id(a){return(a=a.exec(Na()))?a[1]:""}var jd=function(){if(Jb)return id(/Firefox\/([0-9.]+)/);if(A||x)return Va;if(Ob)return id(/Chrome\/([0-9.]+)/);if(Pb)return id(/Version\/([0-9.]+)/);if(Lb||Mb){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(Na());if(a)return a[1]+"."+a[2]}else{if(Nb)return(a=id(/Android\s+([0-9.]+)/))?a:id(/Version\/([0-9.]+)/);if(Kb)return id(/Camino\/([0-9.]+)/)}return""}();var kd,ld;function U(a){return md?kd(a):A?0<=na(fb,a):eb(a)}function nd(a){return md?ld(a):Nb?0<=na(od,a):0<=na(jd,a)} var md=function(){if(!B)return!1;var a=n.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;kd=function(a){return 0<=d.Aa(e,""+a)};ld=function(a){return 0<=d.Aa(f,""+a)};return!0}(),pd=Mb||Lb,qd;if(Nb){var rd=/Android\s+([0-9\.]+)/.exec(Na());qd=rd?rd[1]:"0"}else qd="0"; var od=qd,sd=A&&!C(8),td=A&&!C(9),ud=C(10),vd=A&&!C(10);Nb&&nd(2.3);Nb&&nd(4);Pb&&nd(6);var wd=A&&-1!=Na().indexOf("IEMobile");function xd(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}l=xd.prototype;l.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};l.contains=function(a){return this&&a?a instanceof xd?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}; l.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};l.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};l.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}; l.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function V(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}l=V.prototype;l.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};l.contains=function(a){return a instanceof V?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}; l.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};l.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};l.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}; l.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function yd(a,b){var c=E(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}function zd(a){a=a?E(a):document;var b;(b=!A)||(b=C(9))||(b=a?new zb(E(a)):hb||(hb=new zb),b=pb(b.F));return b?a.documentElement:a.body} function Ad(a){var b=a.offsetWidth,c=a.offsetHeight,d=Qa&&!b&&!c;if((!p(b)||d)&&a.getBoundingClientRect){var e;a:{try{e=a.getBoundingClientRect()}catch(f){e={left:0,top:0,right:0,bottom:0};break a}A&&a.ownerDocument.body&&(a=a.ownerDocument,e.left-=a.documentElement.clientLeft+a.body.clientLeft,e.top-=a.documentElement.clientTop+a.body.clientTop)}return new jb(e.right-e.left,e.bottom-e.top)}return new jb(b,c)}var Bd={thin:2,medium:4,thick:6}; function Cd(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 Bd)d=Bd[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 Dd(a){var b;a:{a=E(a);try{b=a&&a.activeElement;break a}catch(c){}b=null}return A&&b&&"undefined"===typeof b.nodeType?null:b}function W(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function Ed(a){return Fd(a,!0)&&Gd(a)&&!(A||x||B&&!U("1.9.2")?0:"none"==X(a,"pointer-events"))}function Hd(a){return W(a,"OPTION")?!0:W(a,"INPUT")?(a=a.type.toLowerCase(),"checkbox"==a||"radio"==a):!1} function Id(a){if(!Hd(a))throw new w(15,"Element is not selectable");var b="selected",c=a.type&&a.type.toLowerCase();if("checkbox"==c||"radio"==c)b="checked";return!!Jd(a,b)}function Jd(a,b){var c;if(c=sd)if(c="value"==b)if(c=W(a,"OPTION"))c=null===Kd(a);c?(c=[],xb(a,c,!1),c=c.join("")):c=a[b];return c}var Ld=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; function Md(a){var b=[];v(a.split(Ld),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("");b=";"==b.charAt(b.length-1)?b:b+";";return x?b.replace(/\w+:;/g,""):b}function Kd(a){var b;b="value";return"style"==b?Md(a.style.cssText):sd&&"value"==b&&W(a,"INPUT")?a.value:td&&!0===a[b]?String(a.getAttribute(b)):(a=a.getAttributeNode(b))&&a.specified?a.value:null}var Nd="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" "); function Gd(a){var b=a.tagName.toUpperCase();return wa(Nd,b)?Jd(a,"disabled")?!1:a.parentNode&&1==a.parentNode.nodeType&&"OPTGROUP"==b||"OPTION"==b?Gd(a.parentNode):!yb(a,function(a){var b=a.parentNode;if(b&&W(b,"FIELDSET")&&Jd(b,"disabled")){if(!W(a,"LEGEND"))return!0;for(;a=void 0!=a.previousElementSibling?a.previousElementSibling:qb(a.previousSibling);)if(W(a,"LEGEND"))return!0}return!1},!0):!0} function Od(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=oa(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=td?"styleFloat":"cssFloat";var d=yd(a,c)||Pd(a,c);if(null===d)d=null;else if(wa(Aa,c)){b:{var e=d.match(Da);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(Ea))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=za[c.toLowerCase()];if(!f&&(f="#"==c.charAt(0)?c:"#"+c,4==f.length&&(f=f.replace(Ba,"#$1$1$2$2$3$3")),!Ca.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 Pd(a,b){var c=a.currentStyle||a.style,d=c[b];!p(d)&&fa(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?p(d)?d:null:(c=Od(a))?Pd(c,b):null} function Fd(a,b){function c(a){if("none"==X(a,"display"))return!1;a=Od(a);return!a||c(a)}function d(a){var b=Qd(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")&&ta(a.childNodes,function(a){return a.nodeType==nb||W(a)&&d(a)})}function e(a){return Rd(a)==Y&&ua(a.childNodes,function(a){return!W(a)||e(a)})}if(!W(a))throw Error("Argument to isShown must be of type Element");if(W(a,"OPTION")||W(a,"OPTGROUP")){var f= yb(a,function(a){return W(a,"SELECT")});return!!f&&Fd(f,!0)}return(f=Sd(a))?!!f.na&&0<f.rect.width&&0<f.rect.height&&Fd(f.na,b):W(a,"INPUT")&&"hidden"==a.type.toLowerCase()||W(a,"NOSCRIPT")||"hidden"==X(a,"visibility")||!c(a)||!b&&0==Td(a)||!d(a)?!1:!e(a)}var Y="hidden"; function Rd(a,b){function c(a){var b=X(a,"position");if("fixed"==b)return y=!0,a==k?null:k;for(a=Od(a);a&&a!=k&&(0==X(a,"display").lastIndexOf("inline",0)||"absolute"==b&&"static"==X(a,"position"));)a=Od(a);return a}function d(a){var b=a;if("visible"==r)if(a==k&&m)b=m;else if(a==m)return{x:"visible",y:"visible"};b={x:X(b,"overflow-x"),y:X(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 zb(g)).F;a=!Qa&&pb(b)?b.documentElement: b.body||b.documentElement;b=b.parentWindow||b.defaultView;a=A&&eb("10")&&b.pageYOffset!=a.scrollTop?new ib(a.scrollLeft,a.scrollTop):new ib(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new ib(a.scrollLeft,a.scrollTop);return a}for(var f=Ud(a,b),g=E(a),k=g.documentElement,m=g.body,r=X(k,"overflow"),y,s=c(a);s;s=c(s)){var q=d(s);if("visible"!=q.x||"visible"!=q.y){var z=Qd(s);if(0==z.width||0==z.height)return Y;var J=f.right<z.left,aa=f.bottom<z.top;if(J&&"hidden"==q.x||aa&&"hidden"== q.y)return Y;if(J&&"visible"!=q.x||aa&&"visible"!=q.y){J=e(s);aa=f.bottom<z.top-J.y;if(f.right<z.left-J.x&&"visible"!=q.x||aa&&"visible"!=q.x)return Y;f=Rd(s);return f==Y?Y:"scroll"}J=f.left>=z.left+z.width;z=f.top>=z.top+z.height;if(J&&"hidden"==q.x||z&&"hidden"==q.y)return Y;if(J&&"visible"!=q.x||z&&"visible"!=q.y){if(y&&(q=e(s),f.left>=k.scrollWidth-q.x||f.right>=k.scrollHeight-q.y))return Y;f=Rd(s);return f==Y?Y:"scroll"}}}return"none"}var Vd=RegExp("matrix\\(([\\d\\.\\-]+), ([\\d\\.\\-]+), ([\\d\\.\\-]+), ([\\d\\.\\-]+), ([\\d\\.\\-]+)(?:px)?, ([\\d\\.\\-]+)(?:px)?\\)"); function Qd(a){function b(a){var c=D(E(a)).getComputedStyle(a,null).MozTransform.match(Vd);if(c){var d=parseFloat(c[1]),e=parseFloat(c[2]),y=parseFloat(c[3]),s=parseFloat(c[4]),q=parseFloat(c[5]),c=parseFloat(c[6]),z=f.left+f.width,J=f.top+f.height,aa=f.left*d,d=z*d,Wa=f.left*e,e=z*e,Xa=f.top*y,y=J*y,Ya=f.top*s,z=J*s,J=aa+Xa+q,s=Wa+Ya+c,Xa=d+Xa+q,Ya=e+Ya+c,aa=aa+y+q,Wa=Wa+z+c,q=d+y+q,c=e+z+c;f.left=Math.min(J,Xa,aa,q);f.top=Math.min(s,Ya,Wa,c);q=Math.max(J,Xa,aa,q);c=Math.max(s,Ya,Wa,c);f.width=q- f.left;f.height=c-f.top}(a=Od(a))&&b(a)}var c=Sd(a);if(c)return c.rect;if(W(a,"HTML"))return c=E(a),a=ob(D(c)||window),new V(0,0,a.width,a.height);var d;try{d=a.getBoundingClientRect()}catch(e){return new V(0,0,0,0)}var f=new V(d.left,d.top,d.right-d.left,d.bottom-d.top);A&&a.ownerDocument.body&&(c=E(a),f.left-=c.documentElement.clientLeft+c.body.clientLeft,f.top-=c.documentElement.clientTop+c.body.clientTop);x&&(0==f.width&&0<a.offsetWidth&&(f.width=a.offsetWidth),0==f.height&&0<a.offsetHeight&& (f.height=a.offsetHeight));B&&!U(12)&&b(a);return f} function Sd(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=T.La('/descendant::*[@usemap = "#'+c.name+'"]',E(c)))&&(e=Qd(d),!b&&"default"!=a.shape.toLowerCase())){var f=Wd(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{na:d,rect:e||new V(0,0,0,0)}} function Wd(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 Ud(a,b){var c;c=Qd(a);c=new xd(c.top,c.left+c.width,c.top+c.height,c.left);if(b){var d=b instanceof V?b:new V(b.x,b.y,1,1);c.left=Math.min(Math.max(c.left+d.left,c.left),c.right);c.top=Math.min(Math.max(c.top+d.top,c.top),c.bottom);c.right=Math.min(Math.max(c.left+d.width,c.left),c.right);c.bottom=Math.min(Math.max(c.top+d.height,c.top),c.bottom)}return c} function Td(a){if(vd){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 Xd(a)}function Xd(a){var b=1,c=X(a,"opacity");c&&(b=Number(c));(a=Od(a))&&(b*=Xd(a));return b};function Yd(a,b){this.d=ma.document.documentElement;this.n=null;var c=Dd(this.d);c&&Zd(this,c);this.D=a||new $d;this.ca=b||new ae}Yd.prototype.I=h("d");function Zd(a,b){a.d=b;a.n=W(b,"OPTION")?yb(b,function(a){return W(a,"SELECT")}):null} Yd.prototype.o=function(a,b,c,d,e,f,g){if(!f&&!Ed(this.d))return!1;if(d&&be!=a&&ce!=a)throw new w(12,"Event type does not allow related target: "+a);b={clientX:b.x,clientY:b.y,button:c,altKey:this.D.l(4),ctrlKey:this.D.l(2),shiftKey:this.D.l(1),metaKey:this.D.l(8),wheelDelta:e||0,relatedTarget:d||null};g=g||1;c=this.d;a!=de&&a!=ee&&g in fe?c=fe[g]:this.n&&(c=ge(this,a));return c?this.ca.o(c,a,b):!0}; Yd.prototype.da=function(a,b,c,d,e){function f(b,c){var d={identifier:b,screenX:c.x,screenY:c.y,clientX:c.x,clientY:c.y,pageX:c.x,pageY:c.y};g.changedTouches.push(d);if(a==he||a==ie)g.touches.push(d),g.targetTouches.push(d)}var g={touches:[],targetTouches:[],changedTouches:[],altKey:this.D.l(4),ctrlKey:this.D.l(2),shiftKey:this.D.l(1),metaKey:this.D.l(8),relatedTarget:null,scale:0,rotation:0};f(b,c);p(d)&&f