UNPKG

webdriverio-automation

Version:

WebdriverIO-Automation android ios project

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